summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--CMakeLists.txt5
-rw-r--r--VERSION4
-rw-r--r--client/client_priv.h1
-rw-r--r--client/mysql_upgrade.c2
-rw-r--r--client/mysqlbinlog.cc6
-rw-r--r--client/mysqldump.c71
-rw-r--r--client/mysqltest.cc9
-rw-r--r--cmake/FindLIBAIO.cmake4
-rw-r--r--cmake/FindLZ4.cmake16
-rw-r--r--cmake/FindLZO.cmake9
-rw-r--r--cmake/FindPMEM.cmake6
-rw-r--r--cmake/FindSnappy.cmake9
-rw-r--r--cmake/FindURING.cmake6
-rw-r--r--cmake/FindZSTD.cmake8
-rw-r--r--cmake/build_configurations/mysql_release.cmake11
-rw-r--r--cmake/libfmt.cmake53
-rw-r--r--cmake/maintainer.cmake1
-rw-r--r--config.h.cmake1
-rw-r--r--configure.cmake1
-rwxr-xr-xdbug/tests-t.pl41
-rw-r--r--dbug/tests.c7
-rw-r--r--dbug/user.r28
-rw-r--r--debian/additions/mariadb.conf.d/50-server.cnf4
-rw-r--r--debian/additions/source_mariadb-10.7.py (renamed from debian/additions/source_mariadb-10.6.py)4
-rwxr-xr-xdebian/autobake-deb.sh11
-rw-r--r--debian/changelog4
-rw-r--r--debian/control179
-rw-r--r--debian/mariadb-client-10.7.README.Debian (renamed from debian/mariadb-client-10.6.README.Debian)0
-rw-r--r--debian/mariadb-client-10.7.docs (renamed from debian/mariadb-client-10.6.docs)0
-rw-r--r--debian/mariadb-client-10.7.install (renamed from debian/mariadb-client-10.6.install)0
-rw-r--r--debian/mariadb-client-10.7.links (renamed from debian/mariadb-client-10.6.links)0
-rw-r--r--debian/mariadb-client-10.7.manpages (renamed from debian/mariadb-client-10.6.manpages)0
-rw-r--r--debian/mariadb-client-10.7.menu (renamed from debian/mariadb-client-10.6.menu)2
-rw-r--r--debian/mariadb-client-core-10.7.install (renamed from debian/mariadb-client-core-10.6.install)0
-rw-r--r--debian/mariadb-client-core-10.7.links (renamed from debian/mariadb-client-core-10.6.links)0
-rw-r--r--debian/mariadb-plugin-provider-bzip2.install2
-rw-r--r--debian/mariadb-plugin-provider-bzip2.lintian-overrides3
-rw-r--r--debian/mariadb-plugin-provider-lz4.install2
-rw-r--r--debian/mariadb-plugin-provider-lz4.lintian-overrides3
-rw-r--r--debian/mariadb-plugin-provider-lzma.install2
-rw-r--r--debian/mariadb-plugin-provider-lzma.lintian-overrides3
-rw-r--r--debian/mariadb-plugin-provider-lzo.install2
-rw-r--r--debian/mariadb-plugin-provider-lzo.lintian-overrides3
-rw-r--r--debian/mariadb-plugin-provider-snappy.install2
-rw-r--r--debian/mariadb-plugin-provider-snappy.lintian-overrides3
-rw-r--r--debian/mariadb-server-10.7.README.Debian (renamed from debian/mariadb-server-10.6.README.Debian)0
-rw-r--r--debian/mariadb-server-10.7.config (renamed from debian/mariadb-server-10.6.config)2
-rw-r--r--debian/mariadb-server-10.7.dirs (renamed from debian/mariadb-server-10.6.dirs)0
-rw-r--r--debian/mariadb-server-10.7.install (renamed from debian/mariadb-server-10.6.install)5
-rw-r--r--debian/mariadb-server-10.7.links (renamed from debian/mariadb-server-10.6.links)0
-rw-r--r--debian/mariadb-server-10.7.logcheck.ignore.paranoid (renamed from debian/mariadb-server-10.6.logcheck.ignore.paranoid)0
-rw-r--r--debian/mariadb-server-10.7.logcheck.ignore.server (renamed from debian/mariadb-server-10.6.logcheck.ignore.server)0
-rw-r--r--debian/mariadb-server-10.7.logcheck.ignore.workstation (renamed from debian/mariadb-server-10.6.logcheck.ignore.workstation)0
-rw-r--r--debian/mariadb-server-10.7.mariadb.init (renamed from debian/mariadb-server-10.6.mariadb.init)2
-rw-r--r--debian/mariadb-server-10.7.mysql-server.logrotate (renamed from debian/mariadb-server-10.6.mysql-server.logrotate)0
-rw-r--r--debian/mariadb-server-10.7.mysql.default (renamed from debian/mariadb-server-10.6.mysql.default)0
-rw-r--r--debian/mariadb-server-10.7.postinst (renamed from debian/mariadb-server-10.6.postinst)0
-rw-r--r--debian/mariadb-server-10.7.postrm (renamed from debian/mariadb-server-10.6.postrm)0
-rw-r--r--debian/mariadb-server-10.7.preinst (renamed from debian/mariadb-server-10.6.preinst)0
-rw-r--r--debian/mariadb-server-10.7.prerm (renamed from debian/mariadb-server-10.6.prerm)0
-rw-r--r--debian/mariadb-server-10.7.templates (renamed from debian/mariadb-server-10.6.templates)6
-rw-r--r--debian/mariadb-server-10.7.triggers (renamed from debian/mariadb-server-10.6.triggers)0
-rw-r--r--debian/mariadb-server-core-10.7.install (renamed from debian/mariadb-server-core-10.6.install)0
-rw-r--r--debian/mariadb-server-core-10.7.links (renamed from debian/mariadb-server-core-10.6.links)0
-rw-r--r--debian/not-installed18
-rw-r--r--debian/po/POTFILES.in2
-rw-r--r--debian/po/ar.po22
-rw-r--r--debian/po/ca.po26
-rw-r--r--debian/po/cs.po24
-rw-r--r--debian/po/da.po30
-rw-r--r--debian/po/de.po24
-rw-r--r--debian/po/es.po22
-rw-r--r--debian/po/eu.po22
-rw-r--r--debian/po/fi.po28
-rw-r--r--debian/po/fr.po26
-rw-r--r--debian/po/gl.po22
-rw-r--r--debian/po/it.po28
-rw-r--r--debian/po/ja.po24
-rw-r--r--debian/po/nb.po22
-rw-r--r--debian/po/nl.po24
-rw-r--r--debian/po/pt.po24
-rw-r--r--debian/po/pt_BR.po28
-rw-r--r--debian/po/ro.po22
-rw-r--r--debian/po/ru.po24
-rw-r--r--debian/po/sv.po26
-rw-r--r--debian/po/templates.pot26
-rw-r--r--debian/po/tr.po24
-rw-r--r--debian/po/vi.po30
-rwxr-xr-xdebian/rules14
-rw-r--r--debian/salsa-ci.yml36
-rw-r--r--debian/source/lintian-overrides28
-rw-r--r--debian/tests/control7
-rw-r--r--debian/tests/smoke17
-rw-r--r--extra/comp_err.c4
-rw-r--r--extra/innochecksum.cc23
-rw-r--r--extra/mariabackup/CMakeLists.txt2
-rw-r--r--extra/mariabackup/backup_mysql.cc9
-rw-r--r--extra/mariabackup/common.h5
-rw-r--r--extra/mariabackup/ds_local.cc4
-rw-r--r--extra/mariabackup/encryption_plugin.h7
-rw-r--r--extra/mariabackup/fil_cur.cc13
-rw-r--r--extra/mariabackup/fil_cur.h4
-rw-r--r--extra/mariabackup/read_filt.h2
-rw-r--r--extra/mariabackup/write_filt.cc4
-rw-r--r--extra/mariabackup/xb_plugin.cc (renamed from extra/mariabackup/encryption_plugin.cc)147
-rw-r--r--extra/mariabackup/xb_plugin.h5
-rw-r--r--extra/mariabackup/xtrabackup.cc129
-rw-r--r--extra/mariabackup/xtrabackup.h20
-rw-r--r--include/hash.h4
-rw-r--r--include/ilist.h4
-rw-r--r--include/json_lib.h7
-rw-r--r--include/my_alloc.h7
-rw-r--r--include/my_bitmap.h14
-rw-r--r--include/my_dbug.h10
-rw-r--r--include/my_dir.h4
-rw-r--r--include/my_sys.h45
-rw-r--r--include/mysql.h14
-rw-r--r--include/mysql.h.pp8
-rw-r--r--include/mysql/plugin.h2
-rw-r--r--include/mysql/plugin_audit.h.pp20
-rw-r--r--include/mysql/plugin_auth.h.pp20
-rw-r--r--include/mysql/plugin_data_type.h.pp20
-rw-r--r--include/mysql/plugin_encryption.h.pp20
-rw-r--r--include/mysql/plugin_ftparser.h.pp20
-rw-r--r--include/mysql/plugin_function.h.pp20
-rw-r--r--include/mysql/plugin_password_validation.h5
-rw-r--r--include/mysql/plugin_password_validation.h.pp23
-rw-r--r--include/mysql/psi/psi_abi_v1.h.pp2
-rw-r--r--include/mysql/psi/psi_abi_v2.h.pp2
-rw-r--r--include/mysql/psi/psi_base.h7
-rw-r--r--include/mysql/psi/psi_memory.h7
-rw-r--r--include/mysql/service_sql.h104
-rw-r--r--include/mysql/services.h1
-rw-r--r--include/providers/bzlib.h126
-rw-r--r--include/providers/lz4.h63
-rw-r--r--include/providers/lzma.h102
-rw-r--r--include/providers/lzo/lzo1x.h62
-rw-r--r--include/providers/snappy-c.h75
-rw-r--r--include/service_versions.h7
-rw-r--r--include/sql_common.h2
-rw-r--r--libmysqld/CMakeLists.txt6
-rw-r--r--libmysqld/lib_sql.cc21
-rw-r--r--libservices/CMakeLists.txt8
-rw-r--r--libservices/provider_service_bzip2.c (renamed from sql/sql_tablespace.h)15
-rw-r--r--libservices/provider_service_lz4.c14
-rw-r--r--libservices/provider_service_lzma.c17
-rw-r--r--libservices/provider_service_lzo.c14
-rw-r--r--libservices/provider_service_snappy.c17
-rw-r--r--libservices/sql_service.c19
-rw-r--r--man/mysql-stress-test.pl.12
-rw-r--r--man/mysql-test-run.pl.12
-rw-r--r--man/mysql.12
-rw-r--r--man/mysql.server.12
-rw-r--r--man/mysql_client_test.12
-rw-r--r--man/mysql_config.12
-rw-r--r--man/mysql_convert_table_format.12
-rw-r--r--man/mysql_find_rows.12
-rw-r--r--man/mysql_fix_extensions.12
-rw-r--r--man/mysql_install_db.12
-rw-r--r--man/mysql_ldb.12
-rw-r--r--man/mysql_plugin.12
-rw-r--r--man/mysql_secure_installation.12
-rw-r--r--man/mysql_setpermission.12
-rw-r--r--man/mysql_tzinfo_to_sql.12
-rw-r--r--man/mysql_upgrade.12
-rw-r--r--man/mysql_waitpid.12
-rw-r--r--man/mysqlaccess.12
-rw-r--r--man/mysqladmin.12
-rw-r--r--man/mysqlbinlog.12
-rw-r--r--man/mysqlcheck.12
-rw-r--r--man/mysqld.82
-rw-r--r--man/mysqld_multi.12
-rw-r--r--man/mysqld_safe.12
-rw-r--r--man/mysqld_safe_helper.12
-rw-r--r--man/mysqldump.12
-rw-r--r--man/mysqldumpslow.12
-rw-r--r--man/mysqlhotcopy.12
-rw-r--r--man/mysqlimport.12
-rw-r--r--man/mysqlshow.12
-rw-r--r--man/mysqlslap.12
-rw-r--r--man/mysqltest.12
-rw-r--r--mysql-test/collections/skip_list_ubsan.txt3
-rw-r--r--mysql-test/include/binlog_combinations.combinations8
-rw-r--r--mysql-test/include/binlog_combinations.inc5
-rw-r--r--mysql-test/include/ctype_ascii_order.inc7
-rw-r--r--mysql-test/include/lcase_names.combinations5
-rw-r--r--mysql-test/include/lcase_names.inc2
-rw-r--r--mysql-test/include/mtr_check.sql3
-rw-r--r--mysql-test/include/show_slave_status.inc4
-rw-r--r--mysql-test/include/wait_for_sql_thread_read_all.inc8
-rw-r--r--mysql-test/main/alter_table.result15
-rw-r--r--mysql-test/main/alter_table.test20
-rw-r--r--mysql-test/main/assign_key_cache.result2
-rw-r--r--mysql-test/main/count_distinct.result14
-rw-r--r--mysql-test/main/count_distinct.test21
-rw-r--r--mysql-test/main/create.test2
-rw-r--r--mysql-test/main/ctype_big5.result194
-rw-r--r--mysql-test/main/ctype_big5.test1
-rw-r--r--mysql-test/main/ctype_cp932.result275
-rw-r--r--mysql-test/main/ctype_cp932.test9
-rw-r--r--mysql-test/main/ctype_eucjpms.result275
-rw-r--r--mysql-test/main/ctype_eucjpms.test8
-rw-r--r--mysql-test/main/ctype_euckr.result270
-rw-r--r--mysql-test/main/ctype_euckr.test2
-rw-r--r--mysql-test/main/ctype_gb2312.result194
-rw-r--r--mysql-test/main/ctype_gb2312.test1
-rw-r--r--mysql-test/main/ctype_gbk.result194
-rw-r--r--mysql-test/main/ctype_gbk.test1
-rw-r--r--mysql-test/main/ctype_sjis.result270
-rw-r--r--mysql-test/main/ctype_sjis.test2
-rw-r--r--mysql-test/main/ctype_tis620.result46
-rw-r--r--mysql-test/main/ctype_ujis.result276
-rw-r--r--mysql-test/main/ctype_ujis.test10
-rw-r--r--mysql-test/main/ctype_utf8.result4
-rw-r--r--mysql-test/main/ctype_utf8.test2
-rw-r--r--mysql-test/main/ddl_i18n_koi8r.result10
-rw-r--r--mysql-test/main/ddl_i18n_utf8.result10
-rw-r--r--mysql-test/main/default.result6
-rw-r--r--mysql-test/main/flush_read_lock_kill.test1
-rw-r--r--mysql-test/main/func_in.result11
-rw-r--r--mysql-test/main/func_in.test11
-rw-r--r--mysql-test/main/func_json.result4
-rw-r--r--mysql-test/main/func_json.test2
-rw-r--r--mysql-test/main/func_misc.result5
-rw-r--r--mysql-test/main/func_misc.test1
-rw-r--r--mysql-test/main/func_sformat.result470
-rw-r--r--mysql-test/main/func_sformat.test228
-rw-r--r--mysql-test/main/func_time.result2
-rw-r--r--mysql-test/main/func_time.test2
-rw-r--r--mysql-test/main/get_diagnostics.result1065
-rw-r--r--mysql-test/main/get_diagnostics.test869
-rw-r--r--mysql-test/main/handlersocket.result2
-rw-r--r--mysql-test/main/information_schema_part.result36
-rw-r--r--mysql-test/main/invisible_field_debug.test14
-rw-r--r--mysql-test/main/json_equals.result98
-rw-r--r--mysql-test/main/json_equals.test69
-rw-r--r--mysql-test/main/json_normalize.result77
-rw-r--r--mysql-test/main/json_normalize.test58
-rw-r--r--mysql-test/main/long_unique_bugs.test2
-rw-r--r--mysql-test/main/mdl_sync.test8
-rw-r--r--mysql-test/main/metadata.result12
-rw-r--r--mysql-test/main/metadata.test4
-rw-r--r--mysql-test/main/mysql.result14
-rw-r--r--mysql-test/main/mysqld--help.result2
-rw-r--r--mysql-test/main/mysqld--help.test5
-rw-r--r--mysql-test/main/mysqldump-max.result84
-rw-r--r--mysql-test/main/mysqldump-system.result1455
-rw-r--r--mysql-test/main/mysqldump-utf8mb4.result3
-rw-r--r--mysql-test/main/mysqldump.result259
-rw-r--r--mysql-test/main/natural_sort_key.result214
-rw-r--r--mysql-test/main/natural_sort_key.test102
-rw-r--r--mysql-test/main/openssl_1.result12
-rw-r--r--mysql-test/main/partition.result2
-rw-r--r--mysql-test/main/partition_alter.result64
-rw-r--r--mysql-test/main/partition_alter.test47
-rw-r--r--mysql-test/main/partition_binlog.result10
-rw-r--r--mysql-test/main/partition_binlog.test2
-rw-r--r--mysql-test/main/partition_error.result6
-rw-r--r--mysql-test/main/partition_error.test2
-rw-r--r--mysql-test/main/partition_exchange.result1
-rw-r--r--mysql-test/main/partition_exchange.test2
-rw-r--r--mysql-test/main/partition_mgm_err.result12
-rw-r--r--mysql-test/main/partition_mgm_err.test12
-rw-r--r--mysql-test/main/partition_range.result12
-rw-r--r--mysql-test/main/partition_sync.result2
-rw-r--r--mysql-test/main/partition_sync.test3
-rw-r--r--mysql-test/main/plugin.result6
-rw-r--r--mysql-test/main/ps.result6
-rw-r--r--mysql-test/main/ps_missed_cmds.result23
-rw-r--r--mysql-test/main/ps_missed_cmds.test45
-rw-r--r--mysql-test/main/ps_missed_cmds_bin_prot.result5
-rw-r--r--mysql-test/main/ps_missed_cmds_bin_prot.test13
-rw-r--r--mysql-test/main/show_explain.test1
-rw-r--r--mysql-test/main/show_explain_non_select.test1
-rw-r--r--mysql-test/main/signal_code.result16
-rw-r--r--mysql-test/main/signal_sqlmode.result4
-rw-r--r--mysql-test/main/sp-anchor-type.result2
-rw-r--r--mysql-test/main/sp-cursor.result4
-rw-r--r--mysql-test/main/sp-error.result2
-rw-r--r--mysql-test/main/sp-vars.result58
-rw-r--r--mysql-test/main/sp.result42
-rw-r--r--mysql-test/main/sp.test17
-rw-r--r--mysql-test/main/trigger.result11
-rw-r--r--mysql-test/main/trigger.test6
-rw-r--r--mysql-test/main/truncate_notembedded.result3
-rw-r--r--mysql-test/main/truncate_notembedded.test7
-rw-r--r--mysql-test/main/type_date.result2
-rw-r--r--mysql-test/main/type_datetime.result4
-rw-r--r--mysql-test/main/type_decimal.result6
-rw-r--r--mysql-test/main/type_newdecimal.result36
-rw-r--r--mysql-test/main/type_time_hires.result8
-rw-r--r--mysql-test/main/type_varchar.result8
-rw-r--r--mysql-test/main/union.test2
-rw-r--r--mysql-test/main/view_debug.test1
-rw-r--r--mysql-test/suite/atomic/alter_partition,innodb.rdiff525
-rw-r--r--mysql-test/suite/atomic/alter_partition.combinations6
-rw-r--r--mysql-test/suite/atomic/alter_partition.result743
-rw-r--r--mysql-test/suite/atomic/alter_partition.test174
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.result54
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-cursor.result4
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-param.result46
-rw-r--r--mysql-test/suite/compat/oracle/r/sp.result2
-rw-r--r--mysql-test/suite/encryption/r/corrupted_during_recovery.result2
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change.result28
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change2.result18
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change4.result8
-rw-r--r--mysql-test/suite/encryption/r/innodb-missing-key.result8
-rw-r--r--mysql-test/suite/encryption/t/corrupted_during_recovery.test6
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change.test20
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change2.test10
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change4.test4
-rw-r--r--mysql-test/suite/encryption/t/innodb-missing-key.test8
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result54
-rw-r--r--mysql-test/suite/engines/funcs/r/tc_partition_reorg_divide.result12
-rw-r--r--mysql-test/suite/engines/funcs/r/tc_partition_reorg_merge.result12
-rw-r--r--mysql-test/suite/engines/funcs/t/tc_partition_reorg_divide.test12
-rw-r--r--mysql-test/suite/engines/funcs/t/tc_partition_reorg_merge.test12
-rw-r--r--mysql-test/suite/federated/error_row_number.result26
-rw-r--r--mysql-test/suite/federated/error_row_number.test18
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_func_view.result4
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_0102.result6
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_03.result6
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_0407.result6
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_08.result6
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_09.result6
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_innodb.result32
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_memory.result38
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_myisam.result38
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result38
-rw-r--r--mysql-test/suite/funcs_1/r/is_routines_embedded.result6
-rw-r--r--mysql-test/suite/funcs_1/r/memory_func_view.result4
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_0102.result6
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_03.result6
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_0407.result6
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_08.result6
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_09.result6
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_1011ext.result6
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_func_view.result4
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_0102.result6
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_03.result6
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_0407.result6
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_08.result6
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_09.result6
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result6
-rw-r--r--mysql-test/suite/funcs_1/r/storedproc.result192
-rw-r--r--mysql-test/suite/galera/include/have_wsrep_replicate_myisam.inc4
-rw-r--r--mysql-test/suite/galera/r/MDEV-27001.result6
-rw-r--r--mysql-test/suite/galera/r/MW-416.result12
-rw-r--r--mysql-test/suite/galera/r/galera_defaults.result8
-rw-r--r--mysql-test/suite/galera/r/galera_myisam_transactions.result8
-rw-r--r--mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result34
-rw-r--r--mysql-test/suite/galera/r/galera_var_wsrep_strict_ddl.result26
-rw-r--r--mysql-test/suite/galera/t/MDEV-27001.opt1
-rw-r--r--mysql-test/suite/galera/t/MDEV-27001.test7
-rw-r--r--mysql-test/suite/galera/t/MW-416.test12
-rw-r--r--mysql-test/suite/galera/t/galera_backup_stage.test6
-rw-r--r--mysql-test/suite/galera/t/galera_defaults.test2
-rw-r--r--mysql-test/suite/galera/t/galera_myisam_transactions.test4
-rw-r--r--mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test14
-rw-r--r--mysql-test/suite/galera/t/galera_var_wsrep_strict_ddl.test13
-rw-r--r--mysql-test/suite/galera_3nodes/r/GCF-363.result4
-rw-r--r--mysql-test/suite/galera_3nodes/t/GCF-363.test6
-rw-r--r--mysql-test/suite/gcol/inc/gcol_column_def_options.inc2
-rw-r--r--mysql-test/suite/gcol/r/gcol_keys_innodb.result2
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_index.result2
-rw-r--r--mysql-test/suite/innodb/include/have_innodb_bzip2.opt1
-rw-r--r--mysql-test/suite/innodb/include/have_innodb_lz4.opt2
-rw-r--r--mysql-test/suite/innodb/include/have_innodb_lzma.opt2
-rw-r--r--mysql-test/suite/innodb/include/have_innodb_lzo.opt2
-rw-r--r--mysql-test/suite/innodb/include/have_innodb_snappy.opt2
-rw-r--r--mysql-test/suite/innodb/r/alter_kill.result2
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_loaded,lz4.rdiff19
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_loaded,lzma.rdiff19
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_loaded,lzo.rdiff19
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_loaded,snappy.rdiff19
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_loaded.result10
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_unloaded,lz4.rdiff26
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_unloaded,lzma.rdiff26
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_unloaded,lzo.rdiff26
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_unloaded,snappy.rdiff26
-rw-r--r--mysql-test/suite/innodb/r/compression_providers_unloaded.result14
-rw-r--r--mysql-test/suite/innodb/r/corrupted_during_recovery.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-online-alter-gis.result2
-rw-r--r--mysql-test/suite/innodb/r/insert_into_empty.result99
-rw-r--r--mysql-test/suite/innodb/r/instant_alter.result12
-rw-r--r--mysql-test/suite/innodb/t/alter_kill.test5
-rw-r--r--mysql-test/suite/innodb/t/compression_providers_loaded.combinations19
-rw-r--r--mysql-test/suite/innodb/t/compression_providers_loaded.test18
-rw-r--r--mysql-test/suite/innodb/t/compression_providers_unloaded.combinations14
-rw-r--r--mysql-test/suite/innodb/t/compression_providers_unloaded.test13
-rw-r--r--mysql-test/suite/innodb/t/corrupted_during_recovery.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-index-online-fk.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-index.test15
-rw-r--r--mysql-test/suite/innodb/t/innodb-table-online.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-wl5980-alter.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug44571.test2
-rw-r--r--mysql-test/suite/innodb/t/insert_into_empty.test99
-rw-r--r--mysql-test/suite/innodb/t/log_corruption.test2
-rw-r--r--mysql-test/suite/innodb/t/log_file_name.test1
-rw-r--r--mysql-test/suite/innodb_gis/r/alter_spatial_index.result2
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_loaded,lz4.rdiff13
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_loaded,lzma.rdiff13
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_loaded,lzo.rdiff13
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_loaded,snappy.rdiff13
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_loaded.combinations14
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_loaded.result27
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_loaded.test38
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_unloaded,lz4.rdiff22
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_unloaded,lzma.rdiff22
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_unloaded,lzo.rdiff22
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_unloaded,snappy.rdiff22
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_unloaded.combinations14
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_unloaded.result22
-rw-r--r--mysql-test/suite/mariabackup/compression_providers_unloaded.test35
-rw-r--r--mysql-test/suite/mariabackup/incremental_compressed.result13
-rw-r--r--mysql-test/suite/mariabackup/incremental_compressed.test38
-rw-r--r--mysql-test/suite/multi_source/change_master.result8
-rw-r--r--mysql-test/suite/multi_source/change_master.test13
-rw-r--r--mysql-test/suite/multi_source/multisource_for_channel.result366
-rw-r--r--mysql-test/suite/multi_source/multisource_for_channel.test429
-rw-r--r--mysql-test/suite/parts/inc/engines.combinations8
-rw-r--r--mysql-test/suite/parts/inc/engines.inc4
-rw-r--r--mysql-test/suite/parts/inc/partition.pre2
-rw-r--r--mysql-test/suite/parts/inc/partition_alter_1.inc6
-rw-r--r--mysql-test/suite/parts/inc/partition_fail.inc11
-rw-r--r--mysql-test/suite/parts/inc/partition_fail_t2.inc20
-rw-r--r--mysql-test/suite/parts/r/alter_table,list.rdiff87
-rw-r--r--mysql-test/suite/parts/r/alter_table.result316
-rw-r--r--mysql-test/suite/parts/r/debug_innodb_fail.result279
-rw-r--r--mysql-test/suite/parts/r/debug_myisam_fail.result279
-rw-r--r--mysql-test/suite/parts/r/partition_alter4_innodb.result160
-rw-r--r--mysql-test/suite/parts/r/partition_alter4_myisam.result160
-rw-r--r--mysql-test/suite/parts/r/partition_debug.result3478
-rw-r--r--mysql-test/suite/parts/r/partition_debug_innodb.result252
-rw-r--r--mysql-test/suite/parts/t/alter_table.combinations2
-rw-r--r--mysql-test/suite/parts/t/alter_table.test273
-rw-r--r--mysql-test/suite/parts/t/partition_debug.test111
-rw-r--r--mysql-test/suite/perfschema/r/digest_view.result50
-rw-r--r--mysql-test/suite/perfschema/r/max_program_zero.result2
-rw-r--r--mysql-test/suite/perfschema/r/misc.result13
-rw-r--r--mysql-test/suite/perfschema/r/ortho_iter.result2
-rw-r--r--mysql-test/suite/perfschema/r/privilege_table_io.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_idle.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_stages.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_statements.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_transactions.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_waits.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_innodb.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_low_index.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_low_table_lock.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_account.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_host.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_index.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mdl.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_memory_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_setup_actors.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_setup_objects.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_socket_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_socket_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stage_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stages_history.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statements_history.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_hdl.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_lock.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_transactions_history.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_user.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_waits_history.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_off.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_on.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_variables.result2
-rw-r--r--mysql-test/suite/perfschema/r/statement_program_lost_inst.result2
-rw-r--r--mysql-test/suite/perfschema/t/misc.test20
-rw-r--r--mysql-test/suite/plugins/r/auth_ed25519.result2
-rw-r--r--mysql-test/suite/plugins/r/compression,innodb-lz4.rdiff24
-rw-r--r--mysql-test/suite/plugins/r/compression,innodb-lzma.rdiff24
-rw-r--r--mysql-test/suite/plugins/r/compression,innodb-lzo.rdiff24
-rw-r--r--mysql-test/suite/plugins/r/compression,innodb-snappy.rdiff24
-rw-r--r--mysql-test/suite/plugins/r/compression,mroonga-lz4.rdiff40
-rw-r--r--mysql-test/suite/plugins/r/compression.result22
-rw-r--r--mysql-test/suite/plugins/r/compression_load.result33
-rw-r--r--mysql-test/suite/plugins/r/cracklib_password_check.result16
-rw-r--r--mysql-test/suite/plugins/r/password_reuse_check.result74
-rw-r--r--mysql-test/suite/plugins/r/show_all_plugins.result4
-rw-r--r--mysql-test/suite/plugins/r/simple_password_check.result4
-rw-r--r--mysql-test/suite/plugins/r/test_sql_service.result66
-rw-r--r--mysql-test/suite/plugins/t/compression.combinations29
-rw-r--r--mysql-test/suite/plugins/t/compression.test52
-rw-r--r--mysql-test/suite/plugins/t/compression_load.test24
-rw-r--r--mysql-test/suite/plugins/t/cracklib_password_check.test8
-rw-r--r--mysql-test/suite/plugins/t/password_reuse_check.test73
-rw-r--r--mysql-test/suite/plugins/t/test_sql_service.test45
-rw-r--r--mysql-test/suite/roles/definer.result7
-rw-r--r--mysql-test/suite/rpl/include/rpl_extra_col_master.test2
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_dml.inc18
-rw-r--r--mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc60
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result30
-rw-r--r--mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result54
-rw-r--r--mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result6
-rw-r--r--mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test6
-rw-r--r--mysql-test/suite/s3/mysqldump.result6
-rw-r--r--mysql-test/suite/sql_sequence/mysqldump.result16
-rw-r--r--mysql-test/suite/sys_vars/r/default_tmp_storage_engine_rocksdb.result102
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result25
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff9
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_wsrep.result30
-rw-r--r--mysql-test/suite/sys_vars/t/default_tmp_storage_engine_rocksdb.test86
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test14
-rw-r--r--mysql-test/suite/sysschema/r/pr_statement_performance_analyzer.result4
-rw-r--r--mysql-test/suite/sysschema/r/pr_table_exists.result2
-rw-r--r--mysql-test/suite/vcol/r/binlog.result2
-rw-r--r--mysql-test/suite/versioning/r/data.result59
-rw-r--r--mysql-test/suite/versioning/r/partition,heap.rdiff88
-rw-r--r--mysql-test/suite/versioning/r/partition.result372
-rw-r--r--mysql-test/suite/versioning/t/alter.test4
-rw-r--r--mysql-test/suite/versioning/t/create.test6
-rw-r--r--mysql-test/suite/versioning/t/data.test32
-rw-r--r--mysql-test/suite/versioning/t/partition.test206
-rw-r--r--mysql-test/suite/wsrep/r/variables.result4
-rw-r--r--mysql-test/suite/wsrep/r/variables_debug.result3
-rw-r--r--mysys/array.c21
-rw-r--r--mysys/hash.c22
-rw-r--r--mysys/my_alloc.c268
-rw-r--r--mysys/my_bitmap.c69
-rw-r--r--mysys/my_default.c6
-rw-r--r--mysys/my_delete.c2
-rw-r--r--mysys/my_init.c11
-rw-r--r--mysys/my_lockmem.c4
-rw-r--r--mysys/my_malloc.c2
-rw-r--r--mysys/my_uuid.c31
-rw-r--r--mysys/thr_mutex.c9
-rw-r--r--mysys/waiting_threads.c2
-rw-r--r--plugin/auth_pam/auth_pam.c2
-rw-r--r--plugin/cracklib_password_check/cracklib_password_check.c13
-rw-r--r--plugin/password_reuse_check/CMakeLists.txt2
-rw-r--r--plugin/password_reuse_check/password_reuse_check.c241
-rw-r--r--plugin/provider_bzip2/CMakeLists.txt15
-rw-r--r--plugin/provider_bzip2/plugin.c61
-rw-r--r--plugin/provider_bzip2/provider_bzip2.cnf3
-rw-r--r--plugin/provider_lz4/CMakeLists.txt15
-rw-r--r--plugin/provider_lz4/plugin.c56
-rw-r--r--plugin/provider_lz4/provider_lz4.cnf3
-rw-r--r--plugin/provider_lzma/CMakeLists.txt15
-rw-r--r--plugin/provider_lzma/plugin.c55
-rw-r--r--plugin/provider_lzma/provider_lzma.cnf3
-rw-r--r--plugin/provider_lzo/CMakeLists.txt15
-rw-r--r--plugin/provider_lzo/plugin.c55
-rw-r--r--plugin/provider_lzo/provider_lzo.cnf3
-rw-r--r--plugin/provider_snappy/CMakeLists.txt15
-rw-r--r--plugin/provider_snappy/plugin.c58
-rw-r--r--plugin/provider_snappy/provider_snappy.cnf3
-rw-r--r--plugin/server_audit/server_audit.c1
-rw-r--r--plugin/simple_password_check/simple_password_check.c4
-rw-r--r--plugin/test_sql_service/CMakeLists.txt2
-rw-r--r--plugin/test_sql_service/test_sql_service.c227
-rw-r--r--plugin/type_inet/item_inetfunc.cc27
-rw-r--r--plugin/type_inet/plugin.cc8
-rw-r--r--plugin/type_inet/sql_type_inet.cc1205
-rw-r--r--plugin/type_inet/sql_type_inet.h912
-rw-r--r--plugin/type_mysql_json/type.cc2
-rw-r--r--plugin/type_uuid/CMakeLists.txt18
-rw-r--r--plugin/type_uuid/item_uuidfunc.cc46
-rw-r--r--plugin/type_uuid/item_uuidfunc.h67
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/binlog_stm_type_uuid.result37
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/binlog_stm_type_uuid.test32
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/binlog_table_map_optional_metadata_type_uuid.result60
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/binlog_table_map_optional_metadata_type_uuid.test72
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/func_uuid_plugin.result35
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/func_uuid_plugin.test30
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/rpl_row_binary_to_uuid.result35
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/rpl_row_binary_to_uuid.test33
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/rpl_row_uuid_to_binary.result35
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/rpl_row_uuid_to_binary.test33
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/rpl_type_uuid.result19
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/rpl_type_uuid.test18
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/std_data/t1nopackkey.frmbin0 -> 944 bytes
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/std_data/t1packkey.frmbin0 -> 944 bytes
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/suite.pm7
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid-debug.result18
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid-debug.test14
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid.result3173
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid.test1672
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_csv.result92
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_csv.test58
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_engines.inc108
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_innodb.result203
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_innodb.test31
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_memory.result250
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_memory.test15
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_myisam.result237
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_myisam.test61
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_mysql.result16
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_mysql.test6
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_partition.result1797
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_partition.test104
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_plugin.result31
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_plugin.test27
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_stat_tables.result24
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_stat_tables.test22
-rw-r--r--plugin/type_uuid/plugin.cc122
-rw-r--r--plugin/type_uuid/sql_type_uuid.cc117
-rw-r--r--plugin/type_uuid/sql_type_uuid.h186
-rw-r--r--plugin/user_variables/mysql-test/user_variables/basic.result5
-rw-r--r--plugin/user_variables/mysql-test/user_variables/basic.test1
-rw-r--r--plugin/win_auth_client/handshake_client.cc2
-rw-r--r--scripts/sys_schema/procedures/ps_setup_save.sql9
-rw-r--r--sql-common/client.c17
-rw-r--r--sql/CMakeLists.txt57
-rw-r--r--sql/backup.cc5
-rw-r--r--sql/ddl_log.cc83
-rw-r--r--sql/ddl_log.h10
-rw-r--r--sql/discover.cc2
-rw-r--r--sql/encryption.cc10
-rw-r--r--sql/field.cc8
-rw-r--r--sql/gcalc_slicescan.cc2
-rw-r--r--sql/ha_partition.cc12
-rw-r--r--sql/handler.cc27
-rw-r--r--sql/handler.h85
-rw-r--r--sql/hostname.cc2
-rw-r--r--sql/item.cc6
-rw-r--r--sql/item.h51
-rw-r--r--sql/item_cmpfunc.cc45
-rw-r--r--sql/item_cmpfunc.h41
-rw-r--r--sql/item_create.cc143
-rw-r--r--sql/item_func.cc3
-rw-r--r--sql/item_jsonfunc.cc107
-rw-r--r--sql/item_jsonfunc.h35
-rw-r--r--sql/item_strfunc.cc433
-rw-r--r--sql/item_strfunc.h70
-rw-r--r--sql/item_subselect.cc38
-rw-r--r--sql/item_subselect.h5
-rw-r--r--sql/item_xmlfunc.cc4
-rw-r--r--sql/json_table.cc3
-rw-r--r--sql/lex.h4
-rw-r--r--sql/lock.cc5
-rw-r--r--sql/log.cc21
-rw-r--r--sql/log_event.cc6
-rw-r--r--sql/log_event_client.cc2
-rw-r--r--sql/log_event_old.cc6
-rw-r--r--sql/log_event_server.cc14
-rw-r--r--sql/mdl.cc16
-rw-r--r--sql/mysqld.cc89
-rw-r--r--sql/mysqld.h13
-rw-r--r--sql/opt_range.cc42
-rw-r--r--sql/opt_split.cc2
-rw-r--r--sql/opt_subselect.cc6
-rw-r--r--sql/opt_table_elimination.cc2
-rw-r--r--sql/partition_element.h4
-rw-r--r--sql/partition_info.cc10
-rw-r--r--sql/partition_info.h8
-rw-r--r--sql/rpl_gtid.cc84
-rw-r--r--sql/rpl_mi.cc27
-rw-r--r--sql/rpl_mi.h2
-rw-r--r--sql/rpl_parallel.cc7
-rw-r--r--sql/rpl_rli.cc3
-rw-r--r--sql/rpl_utility.cc2
-rw-r--r--sql/semisync_master_ack_receiver.cc4
-rw-r--r--sql/semisync_slave.cc9
-rw-r--r--sql/set_var.cc2
-rw-r--r--sql/share/errmsg-utf8.txt20
-rw-r--r--sql/slave.cc12
-rw-r--r--sql/sp_head.h2
-rw-r--r--sql/sp_rcontext.cc3
-rw-r--r--sql/sp_rcontext.h7
-rw-r--r--sql/sql_acl.cc62
-rw-r--r--sql/sql_admin.cc3
-rw-r--r--sql/sql_alter.cc2
-rw-r--r--sql/sql_alter.h6
-rw-r--r--sql/sql_array.h20
-rw-r--r--sql/sql_audit.cc11
-rw-r--r--sql/sql_base.cc8
-rw-r--r--sql/sql_class.cc81
-rw-r--r--sql/sql_class.h67
-rw-r--r--sql/sql_cmd.h1
-rw-r--r--sql/sql_db.cc16
-rw-r--r--sql/sql_delete.cc5
-rw-r--r--sql/sql_error.cc18
-rw-r--r--sql/sql_error.h36
-rw-r--r--sql/sql_get_diagnostics.cc2
-rw-r--r--sql/sql_get_diagnostics.h3
-rw-r--r--sql/sql_insert.cc29
-rw-r--r--sql/sql_lex.cc27
-rw-r--r--sql/sql_lex.h8
-rw-r--r--sql/sql_load.cc1
-rw-r--r--sql/sql_parse.cc18
-rw-r--r--sql/sql_partition.cc712
-rw-r--r--sql/sql_partition.h16
-rw-r--r--sql/sql_partition_admin.cc57
-rw-r--r--sql/sql_plugin.cc75
-rw-r--r--sql/sql_plugin.h2
-rw-r--r--sql/sql_plugin_services.inl96
-rw-r--r--sql/sql_prepare.cc423
-rw-r--r--sql/sql_prepare.h2
-rw-r--r--sql/sql_priv.h10
-rw-r--r--sql/sql_reload.cc2
-rw-r--r--sql/sql_select.cc68
-rw-r--r--sql/sql_show.cc36
-rw-r--r--sql/sql_signal.cc24
-rw-r--r--sql/sql_string.h5
-rw-r--r--sql/sql_table.cc173
-rw-r--r--sql/sql_table.h9
-rw-r--r--sql/sql_tablespace.cc72
-rw-r--r--sql/sql_test.cc2
-rw-r--r--sql/sql_tvc.cc8
-rw-r--r--sql/sql_type_fixedbin.h1915
-rw-r--r--sql/sql_type_fixedbin_storage.h173
-rw-r--r--sql/sql_update.cc3
-rw-r--r--sql/sql_yacc.yy556
-rw-r--r--sql/sys_vars.cc37
-rw-r--r--sql/table.cc27
-rw-r--r--sql/thread_pool_info.cc2
-rw-r--r--sql/tztime.cc2
-rw-r--r--sql/uniques.cc2
-rw-r--r--sql/wsrep_mysqld.cc67
-rw-r--r--sql/wsrep_mysqld.h2
-rw-r--r--sql/wsrep_trans_observer.h6
-rw-r--r--sql/wsrep_var.cc24
-rw-r--r--sql/wsrep_var.h4
-rw-r--r--storage/columnstore/CMakeLists.txt9
-rw-r--r--storage/connect/bsonudf.cpp3
-rw-r--r--storage/connect/ha_connect.cc52
-rw-r--r--storage/connect/jsonudf.cpp3
-rw-r--r--storage/connect/tabrest.cpp3
-rw-r--r--storage/connect/tabutil.cpp4
-rw-r--r--storage/csv/ha_tina.cc1
-rw-r--r--storage/example/ha_example.cc2
-rw-r--r--storage/federatedx/federatedx_io_mysql.cc8
-rw-r--r--storage/innobase/btr/btr0btr.cc4
-rw-r--r--storage/innobase/btr/btr0cur.cc3
-rw-r--r--storage/innobase/buf/buf0buf.cc21
-rw-r--r--storage/innobase/buf/buf0dblwr.cc2
-rw-r--r--storage/innobase/buf/buf0dump.cc7
-rw-r--r--storage/innobase/buf/buf0flu.cc18
-rw-r--r--storage/innobase/buf/buf0rea.cc14
-rw-r--r--storage/innobase/bzip2.cmake36
-rw-r--r--storage/innobase/dict/dict0boot.cc6
-rw-r--r--storage/innobase/dict/dict0crea.cc10
-rw-r--r--storage/innobase/dict/dict0dict.cc14
-rw-r--r--storage/innobase/dict/dict0load.cc42
-rw-r--r--storage/innobase/dict/dict0mem.cc2
-rw-r--r--storage/innobase/dict/dict0stats.cc12
-rw-r--r--storage/innobase/fil/fil0crypt.cc15
-rw-r--r--storage/innobase/fil/fil0fil.cc227
-rw-r--r--storage/innobase/fil/fil0pagecompress.cc62
-rw-r--r--storage/innobase/fsp/fsp0file.cc31
-rw-r--r--storage/innobase/fsp/fsp0fsp.cc5
-rw-r--r--storage/innobase/fsp/fsp0space.cc4
-rw-r--r--storage/innobase/handler/ha_innodb.cc244
-rw-r--r--storage/innobase/handler/handler0alter.cc4
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.cc4
-rw-r--r--storage/innobase/include/buf0buf.h30
-rw-r--r--storage/innobase/include/buf0flu.h2
-rw-r--r--storage/innobase/include/buf0rea.h10
-rw-r--r--storage/innobase/include/buf0types.h6
-rw-r--r--storage/innobase/include/dict0boot.h2
-rw-r--r--storage/innobase/include/dict0dict.h7
-rw-r--r--storage/innobase/include/dict0dict.inl14
-rw-r--r--storage/innobase/include/dict0mem.h14
-rw-r--r--storage/innobase/include/fil0crypt.h6
-rw-r--r--storage/innobase/include/fil0fil.h568
-rw-r--r--storage/innobase/include/fil0pagecompress.h9
-rw-r--r--storage/innobase/include/fsp0file.h33
-rw-r--r--storage/innobase/include/fsp0fsp.h45
-rw-r--r--storage/innobase/include/fsp0space.h52
-rw-r--r--storage/innobase/include/fsp0sysspace.h18
-rw-r--r--storage/innobase/include/fsp0types.h25
-rw-r--r--storage/innobase/include/ibuf0ibuf.h2
-rw-r--r--storage/innobase/include/log0log.inl4
-rw-r--r--storage/innobase/include/log0recv.h4
-rw-r--r--storage/innobase/include/mtr0mtr.h18
-rw-r--r--storage/innobase/include/row0merge.h100
-rw-r--r--storage/innobase/include/srv0srv.h4
-rw-r--r--storage/innobase/include/trx0rec.h2
-rw-r--r--storage/innobase/include/trx0trx.h74
-rw-r--r--storage/innobase/include/trx0types.h2
-rw-r--r--storage/innobase/include/univ.i32
-rw-r--r--storage/innobase/include/ut0pool.h5
-rw-r--r--storage/innobase/innodb.cmake10
-rw-r--r--storage/innobase/log/log0recv.cc409
-rw-r--r--storage/innobase/lz4.cmake38
-rw-r--r--storage/innobase/lzma.cmake35
-rw-r--r--storage/innobase/lzo.cmake34
-rw-r--r--storage/innobase/mtr/mtr0mtr.cc5
-rw-r--r--storage/innobase/os/os0file.cc10
-rw-r--r--storage/innobase/row/row0ftsort.cc9
-rw-r--r--storage/innobase/row/row0import.cc92
-rw-r--r--storage/innobase/row/row0ins.cc36
-rw-r--r--storage/innobase/row/row0merge.cc638
-rw-r--r--storage/innobase/snappy.cmake34
-rw-r--r--storage/innobase/srv/srv0srv.cc13
-rw-r--r--storage/innobase/srv/srv0start.cc46
-rw-r--r--storage/innobase/trx/trx0purge.cc4
-rw-r--r--storage/innobase/trx/trx0rec.cc17
-rw-r--r--storage/innobase/trx/trx0sys.cc6
-rw-r--r--storage/innobase/trx/trx0trx.cc5
-rw-r--r--storage/innobase/ut/ut0ut.cc2
-rw-r--r--storage/maria/aria_chk.c2
-rw-r--r--storage/maria/ma_bitmap.c17
-rw-r--r--storage/maria/ma_control_file.c2
-rw-r--r--storage/maria/ma_ft_update.c2
-rw-r--r--storage/maria/ma_init.c2
-rw-r--r--storage/maria/ma_loghandler.c23
-rw-r--r--storage/maria/ma_open.c6
-rw-r--r--storage/maria/ma_page.c2
-rw-r--r--storage/maria/ma_sort.c36
-rw-r--r--storage/maria/unittest/ma_maria_log_cleanup.c2
-rw-r--r--storage/mroonga/CMakeLists.txt16
-rw-r--r--storage/mroonga/ha_mroonga.cpp6
-rw-r--r--storage/mroonga/lib/mrn_smart_bitmap.cpp2
-rw-r--r--storage/myisam/ft_update.c3
-rw-r--r--storage/myisam/sort.c37
-rw-r--r--storage/myisammrg/ha_myisammrg.cc2
-rw-r--r--storage/oqgraph/cmake/FindJudy.cmake18
-rw-r--r--storage/rocksdb/CMakeLists.txt8
-rw-r--r--storage/rocksdb/build_rocksdb.cmake38
-rw-r--r--storage/rocksdb/ha_rocksdb.cc35
-rw-r--r--storage/rocksdb/ha_rocksdb.h4
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/r/col_opt_not_null.result2
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/r/col_opt_null.result2
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/r/mariadb_plugin.result41
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/t/mariadb_plugin.test28
-rw-r--r--storage/rocksdb/rdb_datadic.cc26
-rw-r--r--storage/rocksdb/rdb_i_s.cc41
-rw-r--r--storage/rocksdb/rdb_sst_info.cc2
-rw-r--r--storage/spider/mysql-test/spider/bg/r/spider3_fixes.result5
-rw-r--r--storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result5
-rw-r--r--storage/spider/mysql-test/spider/bg/r/spider_fixes.result15
-rw-r--r--storage/spider/mysql-test/spider/bg/t/spider3_fixes.test3
-rw-r--r--storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test3
-rw-r--r--storage/spider/mysql-test/spider/bg/t/spider_fixes.test9
-rw-r--r--storage/spider/mysql-test/spider/handler/r/spider3_fixes.result5
-rw-r--r--storage/spider/mysql-test/spider/handler/r/spider3_fixes_part.result5
-rw-r--r--storage/spider/mysql-test/spider/handler/r/spider_fixes.result20
-rw-r--r--storage/spider/mysql-test/spider/handler/r/spider_fixes_part.result5
-rw-r--r--storage/spider/mysql-test/spider/handler/t/spider3_fixes.test3
-rw-r--r--storage/spider/mysql-test/spider/handler/t/spider3_fixes_part.test3
-rw-r--r--storage/spider/mysql-test/spider/handler/t/spider_fixes.test12
-rw-r--r--storage/spider/mysql-test/spider/handler/t/spider_fixes_part.test3
-rw-r--r--storage/spider/mysql-test/spider/include/init_spider.inc8
-rw-r--r--storage/spider/mysql-test/spider/r/error_row_number.result45
-rw-r--r--storage/spider/mysql-test/spider/r/spider_fixes.result15
-rw-r--r--storage/spider/mysql-test/spider/r/variable_deprecation.result223
-rw-r--r--storage/spider/mysql-test/spider/t/error_row_number.test37
-rw-r--r--storage/spider/mysql-test/spider/t/spider_fixes.test9
-rw-r--r--storage/spider/mysql-test/spider/t/variable_deprecation.test135
-rw-r--r--storage/spider/spd_init_query.h11
-rw-r--r--storage/spider/spd_param.cc288
-rw-r--r--storage/spider/spd_table.cc28
-rw-r--r--strings/CMakeLists.txt2
-rw-r--r--strings/ctype-ascii.h189
-rw-r--r--strings/ctype-big5.c2
-rw-r--r--strings/ctype-cp932.c4
-rw-r--r--strings/ctype-euc_kr.c4
-rw-r--r--strings/ctype-eucjpms.c4
-rw-r--r--strings/ctype-gb2312.c2
-rw-r--r--strings/ctype-gbk.c2
-rw-r--r--strings/ctype-sjis.c4
-rw-r--r--strings/ctype-ujis.c4
-rw-r--r--strings/ctype-utf8.c297
-rw-r--r--strings/json_lib.c4
-rw-r--r--strings/json_normalize.c852
-rw-r--r--strings/strcoll.inl96
-rw-r--r--support-files/rpm/server.cnf4
-rw-r--r--tests/mysql_client_test.c90
-rw-r--r--tpool/CMakeLists.txt6
-rw-r--r--unittest/json_lib/CMakeLists.txt2
-rw-r--r--unittest/json_lib/json_normalize-t.c280
-rw-r--r--unittest/mysys/bitmap-t.c10
889 files changed, 38933 insertions, 8978 deletions
diff --git a/.gitignore b/.gitignore
index 5376c582985..02de7b865dc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -106,6 +106,7 @@ packaging/rpm-oel/mysql.spec
packaging/rpm-uln/mysql.10.0.11.spec
packaging/solaris/postinstall-solaris
extra/pcre2
+extra/libfmt
plugin/auth_pam/auth_pam_tool
plugin/auth_pam/config_auth_pam.h
plugin/aws_key_management/aws-sdk-cpp
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d5074a97503..f9e2b1befda 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -160,6 +160,7 @@ INCLUDE(readline)
INCLUDE(libutils)
INCLUDE(dtrace)
INCLUDE(pcre)
+INCLUDE(libfmt)
INCLUDE(ctest)
INCLUDE(plugin)
INCLUDE(install_macros)
@@ -376,7 +377,8 @@ ADD_DEFINITIONS(-DHAVE_CONFIG_H)
IF(_FILE_OFFSET_BITS)
ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=${_FILE_OFFSET_BITS})
ENDIF()
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include
+ ${CMAKE_SOURCE_DIR}/include/providers)
# Add bundled or system zlib.
MYSQL_CHECK_ZLIB_WITH_COMPRESS()
@@ -388,6 +390,7 @@ MYSQL_CHECK_READLINE()
SET(MALLOC_LIBRARY "system")
CHECK_PCRE()
+CHECK_LIBFMT()
ADD_SUBDIRECTORY(tpool)
CHECK_SYSTEMD()
diff --git a/VERSION b/VERSION
index 3cd7498d552..91f606347b6 100644
--- a/VERSION
+++ b/VERSION
@@ -1,4 +1,4 @@
MYSQL_VERSION_MAJOR=10
-MYSQL_VERSION_MINOR=6
-MYSQL_VERSION_PATCH=9
+MYSQL_VERSION_MINOR=7
+MYSQL_VERSION_PATCH=5
SERVER_MATURITY=stable
diff --git a/client/client_priv.h b/client/client_priv.h
index 56e81ebb94f..cde3a4c51e2 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -106,6 +106,7 @@ enum options_client
OPT_SHUTDOWN_WAIT_FOR_SLAVES,
OPT_COPY_S3_TABLES,
OPT_PRINT_TABLE_METADATA,
+ OPT_ASOF_TIMESTAMP,
OPT_MAX_CLIENT_OPTION /* should be always the last */
};
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 06a1992bbfa..7777f4ca1dc 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -72,7 +72,7 @@ static char **defaults_argv;
static my_bool not_used; /* Can't use GET_BOOL without a value pointer */
-char upgrade_from_version[sizeof("10.20.456-MariaDB")+30];
+char upgrade_from_version[1024];
static my_bool opt_write_binlog;
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index ecca3dcbeb6..a642d4df0b5 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -954,7 +954,7 @@ static bool print_row_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
Log_event *e= NULL;
// Print the row_event from the last one to the first one
- for (uint i= events_in_stmt.elements; i > 0; --i)
+ for (size_t i= events_in_stmt.elements; i > 0; --i)
{
e= *(dynamic_element(&events_in_stmt, i - 1, Log_event**));
result= result || print_base64(print_event_info, e);
@@ -962,7 +962,7 @@ static bool print_row_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
// Copy all output into the Log_event
ev->output_buf.copy(e->output_buf);
// Delete Log_event
- for (uint i= 0; i < events_in_stmt.elements-1; ++i)
+ for (size_t i= 0; i < events_in_stmt.elements-1; ++i)
{
e= *(dynamic_element(&events_in_stmt, i, Log_event**));
delete e;
@@ -3171,7 +3171,7 @@ int main(int argc, char** argv)
*/
if (opt_flashback && retval != ERROR_STOP)
{
- for (uint i= binlog_events.elements; i > 0; --i)
+ for (size_t i= binlog_events.elements; i > 0; --i)
{
LEX_STRING *event_str= dynamic_element(&binlog_events, i - 1,
LEX_STRING*);
diff --git a/client/mysqldump.c b/client/mysqldump.c
index e567fe63f62..a4f429ede02 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -129,7 +129,7 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, opt_no_data_m
opt_include_master_host_port= 0,
opt_events= 0, opt_comments_used= 0,
opt_alltspcs=0, opt_notspcs= 0, opt_logging,
- opt_drop_trigger= 0 ;
+ opt_drop_trigger= 0;
#define OPT_SYSTEM_ALL 1
#define OPT_SYSTEM_USERS 2
#define OPT_SYSTEM_PLUGINS 4
@@ -155,7 +155,7 @@ static char *opt_password=0,*current_user=0,
*lines_terminated=0, *enclosed=0, *opt_enclosed=0, *escaped=0,
*where=0, *order_by=0,
*err_ptr= 0,
- *log_error_file= NULL;
+ *log_error_file= NULL, *opt_asof_timestamp= NULL;
static const char *opt_compatible_mode_str= 0;
static char **defaults_argv= 0;
static char compatible_mode_normal_str[255];
@@ -278,6 +278,11 @@ static struct my_option my_long_options[] =
"Adds 'STOP SLAVE' prior to 'CHANGE MASTER' and 'START SLAVE' to bottom of dump.",
&opt_slave_apply, &opt_slave_apply, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
+ {"as-of", OPT_ASOF_TIMESTAMP,
+ "Dump system versioned table(s) as of specified timestamp. "
+ "Argument is interpreted according to the --tz-utc setting. "
+ "Table structures are always dumped as of current timestamp.",
+ &opt_asof_timestamp, &opt_asof_timestamp, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", (char **)&charsets_dir,
(char **)&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -574,7 +579,8 @@ static struct my_option my_long_options[] =
&opt_dump_triggers, &opt_dump_triggers, 0, GET_BOOL,
NO_ARG, 1, 0, 0, 0, 0, 0},
{"tz-utc", OPT_TZ_UTC,
- "SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones.",
+ "Set connection time zone to UTC before commencing the dump and add "
+ "SET TIME_ZONE=´+00:00´ to the top of the dump file.",
&opt_tz_utc, &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
#ifndef DONT_ALLOW_USER_CHANGE
{"user", 'u', "User for login if not current user.",
@@ -1325,6 +1331,12 @@ static int get_options(int *argc, char ***argv)
my_progname_short);
return(EX_USAGE);
}
+ if (opt_asof_timestamp && strchr(opt_asof_timestamp, '\''))
+ {
+ fprintf(stderr, "%s: Incorrect DATETIME value: '%s'\n",
+ my_progname_short, opt_asof_timestamp);
+ return(EX_USAGE);
+ }
if (strcmp(default_charset, MYSQL_AUTODETECT_CHARSET_NAME) &&
!(charset_info= get_charset_by_csname(default_charset,
MY_CS_PRIMARY,
@@ -3039,7 +3051,7 @@ static void get_sequence_structure(const char *seq, const char *db)
*/
static uint get_table_structure(const char *table, const char *db, char *table_type,
- char *ignore_flag)
+ char *ignore_flag, my_bool *versioned)
{
my_bool init=0, delayed, write_data, complete_insert;
my_ulonglong num_fields;
@@ -3106,6 +3118,26 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
verbose_msg("-- Retrieving table structure for table %s...\n", table);
+ if (versioned)
+ {
+ if (!opt_asof_timestamp)
+ versioned= NULL;
+ else
+ {
+ my_snprintf(query_buff, sizeof(query_buff), "select 1 from"
+ " information_schema.tables where table_schema=database()"
+ " and table_name=%s and table_type='SYSTEM VERSIONED'",
+ quote_for_equal(table, table_buff));
+ if (!mysql_query_with_error_report(mysql, &result, query_buff))
+ {
+ *versioned= result->row_count > 0;
+ mysql_free_result(result);
+ }
+ else
+ *versioned= 0;
+ }
+ }
+
len= my_snprintf(query_buff, sizeof(query_buff),
"SET SQL_QUOTE_SHOW_CREATE=%d",
(opt_quoted || opt_keywords));
@@ -3383,9 +3415,10 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
}
else
{
- dynstr_append_checked(&insert_pat, " VALUES ");
- if (!extended_insert)
- dynstr_append_checked(&insert_pat, "(");
+ if (extended_insert)
+ dynstr_append_checked(&insert_pat, " VALUES\n");
+ else
+ dynstr_append_checked(&insert_pat, " VALUES (");
}
}
@@ -3991,6 +4024,15 @@ static char *alloc_query_str(size_t size)
}
+static void vers_append_system_time(DYNAMIC_STRING* query_string)
+{
+ DBUG_ASSERT(opt_asof_timestamp);
+ dynstr_append_checked(query_string, " FOR SYSTEM_TIME AS OF TIMESTAMP '");
+ dynstr_append_checked(query_string, opt_asof_timestamp);
+ dynstr_append_checked(query_string, "'");
+}
+
+
/*
SYNOPSIS
@@ -4018,6 +4060,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
ulong rownr, row_break;
uint num_fields;
size_t total_length, init_length;
+ my_bool versioned= 0;
MYSQL_RES *res;
MYSQL_FIELD *field;
@@ -4028,7 +4071,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
Make sure you get the create table info before the following check for
--no-data flag below. Otherwise, the create table info won't be printed.
*/
- num_fields= get_table_structure(table, db, table_type, &ignore_flag);
+ num_fields= get_table_structure(table, db, table_type, &ignore_flag, &versioned);
/*
The "table" could be a view. If so, we don't do anything here.
@@ -4135,6 +4178,8 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
dynstr_append_checked(&query_string, " FROM ");
dynstr_append_checked(&query_string, result_table);
+ if (versioned)
+ vers_append_system_time(&query_string);
if (where)
{
@@ -4167,6 +4212,8 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
dynstr_append_checked(&query_string, select_field_names.str);
dynstr_append_checked(&query_string, " FROM ");
dynstr_append_checked(&query_string, result_table);
+ if (versioned)
+ vers_append_system_time(&query_string);
if (where)
{
@@ -4444,7 +4491,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
if (total_length + row_length < opt_net_buffer_length)
{
total_length+= row_length;
- fputc(',',md_result_file); /* Always row break */
+ fputs(",\n",md_result_file); /* Always row break */
fputs(extended_row.str,md_result_file);
}
else
@@ -5412,11 +5459,11 @@ static void dump_first_mysql_tables(char *database)
DBUG_ENTER("dump_first_mysql_tables");
if (!get_table_structure((char *) "general_log",
- database, table_type, &ignore_flag) )
+ database, table_type, &ignore_flag, NULL) )
verbose_msg("-- Warning: get_table_structure() failed with some internal "
"error for 'general_log' table\n");
if (!get_table_structure((char *) "slow_log",
- database, table_type, &ignore_flag) )
+ database, table_type, &ignore_flag, NULL) )
verbose_msg("-- Warning: get_table_structure() failed with some internal "
"error for 'slow_log' table\n");
/* general and slow query logs exist now */
@@ -5676,7 +5723,7 @@ static int dump_all_tables_in_db(char *database)
char table_type[NAME_LEN];
char ignore_flag;
if (!get_table_structure((char *) "transaction_registry",
- database, table_type, &ignore_flag) )
+ database, table_type, &ignore_flag, NULL) )
verbose_msg("-- Warning: get_table_structure() failed with some internal "
"error for 'transaction_registry' table\n");
}
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index bde7666f47d..56359ca6c07 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -3677,8 +3677,7 @@ void do_remove_file(struct st_command *command)
void do_remove_files_wildcard(struct st_command *command)
{
int error= 0, sys_errno= 0;
- uint i;
- size_t directory_length;
+ size_t i, directory_length;
MY_DIR *dir_info;
FILEINFO *file;
char dir_separator[2];
@@ -3717,7 +3716,7 @@ void do_remove_files_wildcard(struct st_command *command)
/* Set default wild chars for wild_compare, is changed in embedded mode */
set_wild_chars(1);
- for (i= 0; i < (uint) dir_info->number_of_files; i++)
+ for (i= 0; i < dir_info->number_of_files; i++)
{
file= dir_info->dir_entry + i;
/* Remove only regular files, i.e. no directories etc. */
@@ -3991,7 +3990,7 @@ void do_rmdir(struct st_command *command)
static int get_list_files(DYNAMIC_STRING *ds, const DYNAMIC_STRING *ds_dirname,
const DYNAMIC_STRING *ds_wild)
{
- uint i;
+ size_t i;
MY_DIR *dir_info;
FILEINFO *file;
DBUG_ENTER("get_list_files");
@@ -4000,7 +3999,7 @@ static int get_list_files(DYNAMIC_STRING *ds, const DYNAMIC_STRING *ds_dirname,
if (!(dir_info= my_dir(ds_dirname->str, MYF(MY_WANT_SORT))))
DBUG_RETURN(1);
set_wild_chars(1);
- for (i= 0; i < (uint) dir_info->number_of_files; i++)
+ for (i= 0; i < dir_info->number_of_files; i++)
{
file= dir_info->dir_entry + i;
if (ds_wild && ds_wild->length &&
diff --git a/cmake/FindLIBAIO.cmake b/cmake/FindLIBAIO.cmake
index db49439f318..3a4205f7a45 100644
--- a/cmake/FindLIBAIO.cmake
+++ b/cmake/FindLIBAIO.cmake
@@ -1,7 +1,7 @@
-find_path(LIBAIO_INCLUDE_DIR NAMES libaio.h)
+find_path(LIBAIO_INCLUDE_DIRS NAMES libaio.h)
find_library(LIBAIO_LIBRARIES NAMES aio)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
LIBAIO DEFAULT_MSG
- LIBAIO_LIBRARIES LIBAIO_INCLUDE_DIR)
+ LIBAIO_LIBRARIES LIBAIO_INCLUDE_DIRS)
diff --git a/cmake/FindLZ4.cmake b/cmake/FindLZ4.cmake
index 46c1fdc1b9f..eebd85969e3 100644
--- a/cmake/FindLZ4.cmake
+++ b/cmake/FindLZ4.cmake
@@ -1,9 +1,17 @@
-find_path(LZ4_INCLUDE_DIR NAMES lz4.h)
+find_path(LZ4_INCLUDE_DIRS NAMES lz4.h)
find_library(LZ4_LIBRARIES NAMES lz4)
+if(LZ4_INCLUDE_DIRS AND EXISTS "${LZ4_INCLUDE_DIRS}/lz4.h")
+ file(STRINGS "${LZ4_INCLUDE_DIRS}/lz4.h" LZ4_H REGEX "^#define LZ4_VERSION_[MR]")
+ string(REGEX REPLACE "LZ4_VERSION" "" LZ4_H "${LZ4_H}")
+ string(REGEX MATCHALL "[0-9]+" LZ4_H "${LZ4_H}")
+ string(REGEX REPLACE ";" "." LZ4_VERSION_STRING "${LZ4_H}")
+endif()
+
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
- LZ4 DEFAULT_MSG
- LZ4_LIBRARIES LZ4_INCLUDE_DIR)
+ LZ4
+ REQUIRED_VARS LZ4_LIBRARIES LZ4_INCLUDE_DIRS
+ VERSION_VAR LZ4_VERSION_STRING)
-mark_as_advanced(LZ4_INCLUDE_DIR LZ4_LIBRARIES)
+mark_as_advanced(LZ4_INCLUDE_DIRS LZ4_LIBRARIES)
diff --git a/cmake/FindLZO.cmake b/cmake/FindLZO.cmake
new file mode 100644
index 00000000000..04391bb4720
--- /dev/null
+++ b/cmake/FindLZO.cmake
@@ -0,0 +1,9 @@
+find_path(LZO_INCLUDE_DIRS NAMES lzo/lzo1x.h)
+find_library(LZO_LIBRARIES NAMES lzo2)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(
+ LZO DEFAULT_MSG
+ LZO_LIBRARIES LZO_INCLUDE_DIRS)
+
+mark_as_advanced(LZO_INCLUDE_DIRS LZO_LIBRARIES)
diff --git a/cmake/FindPMEM.cmake b/cmake/FindPMEM.cmake
index 73e71bc29f4..024436444d2 100644
--- a/cmake/FindPMEM.cmake
+++ b/cmake/FindPMEM.cmake
@@ -7,12 +7,12 @@ if(DEFINED PMEM_LIBRARIES)
return()
endif()
-find_path(PMEM_INCLUDE_DIR NAMES libpmem.h)
+find_path(PMEM_INCLUDE_DIRS NAMES libpmem.h)
find_library(PMEM_LIBRARIES NAMES pmem)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
PMEM DEFAULT_MSG
- PMEM_LIBRARIES PMEM_INCLUDE_DIR)
+ PMEM_LIBRARIES PMEM_INCLUDE_DIRS)
-mark_as_advanced(PMEM_INCLUDE_DIR PMEM_LIBRARIES)
+mark_as_advanced(PMEM_INCLUDE_DIRS PMEM_LIBRARIES)
diff --git a/cmake/FindSnappy.cmake b/cmake/FindSnappy.cmake
new file mode 100644
index 00000000000..1e99eb65a50
--- /dev/null
+++ b/cmake/FindSnappy.cmake
@@ -0,0 +1,9 @@
+find_path(SNAPPY_INCLUDE_DIRS NAMES snappy.h)
+find_library(SNAPPY_LIBRARIES NAMES snappy)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(
+ Snappy DEFAULT_MSG
+ SNAPPY_LIBRARIES SNAPPY_INCLUDE_DIRS)
+
+mark_as_advanced(SNAPPY_INCLUDE_DIRS SNAPPY_LIBRARIES)
diff --git a/cmake/FindURING.cmake b/cmake/FindURING.cmake
index 6e5e0783b46..b8141c9d480 100644
--- a/cmake/FindURING.cmake
+++ b/cmake/FindURING.cmake
@@ -1,9 +1,9 @@
-find_path(URING_INCLUDE_DIR NAMES liburing.h)
+find_path(URING_INCLUDE_DIRS NAMES liburing.h)
find_library(URING_LIBRARIES NAMES uring)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
URING DEFAULT_MSG
- URING_LIBRARIES URING_INCLUDE_DIR)
+ URING_LIBRARIES URING_INCLUDE_DIRS)
-mark_as_advanced(URING_INCLUDE_DIR URING_LIBRARIES)
+mark_as_advanced(URING_INCLUDE_DIRS URING_LIBRARIES)
diff --git a/cmake/FindZSTD.cmake b/cmake/FindZSTD.cmake
index ede59010742..d03e96fca15 100644
--- a/cmake/FindZSTD.cmake
+++ b/cmake/FindZSTD.cmake
@@ -1,11 +1,11 @@
# - Find zstd
# Find the zstd compression library and includes
#
-# ZSTD_INCLUDE_DIR - where to find zstd.h, etc.
+# ZSTD_INCLUDE_DIRS - where to find zstd.h, etc.
# ZSTD_LIBRARIES - List of libraries when using zstd.
# ZSTD_FOUND - True if zstd found.
-find_path(ZSTD_INCLUDE_DIR
+find_path(ZSTD_INCLUDE_DIRS
NAMES zstd.h
HINTS ${ZSTD_ROOT_DIR}/include)
@@ -14,8 +14,8 @@ find_library(ZSTD_LIBRARIES
HINTS ${ZSTD_ROOT_DIR}/lib)
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(ZSTD DEFAULT_MSG ZSTD_LIBRARIES ZSTD_INCLUDE_DIR)
+find_package_handle_standard_args(ZSTD DEFAULT_MSG ZSTD_LIBRARIES ZSTD_INCLUDE_DIRS)
mark_as_advanced(
ZSTD_LIBRARIES
- ZSTD_INCLUDE_DIR)
+ ZSTD_INCLUDE_DIRS)
diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake
index 7411627685e..531352d0338 100644
--- a/cmake/build_configurations/mysql_release.cmake
+++ b/cmake/build_configurations/mysql_release.cmake
@@ -107,14 +107,10 @@ ELSEIF(RPM)
SET(WITH_EMBEDDED_SERVER ON CACHE BOOL "")
SET(WITH_PCRE system CACHE STRING "")
IF(RPM MATCHES "fedora|centos|rhel")
- SET(WITH_INNODB_BZIP2 OFF CACHE STRING "")
- SET(WITH_INNODB_LZO OFF CACHE STRING "")
SET(WITH_ROCKSDB_BZip2 OFF CACHE STRING "")
ENDIF()
IF(RPM MATCHES "opensuse|sles|centos|rhel")
- SET(WITH_INNODB_LZ4 OFF CACHE STRING "")
SET(WITH_ROCKSDB_LZ4 OFF CACHE STRING "")
- SET(GRN_WITH_LZ4 no CACHE STRING "")
ENDIF()
ELSEIF(DEB)
SET(WITH_SSL system CACHE STRING "")
@@ -124,9 +120,6 @@ ELSEIF(DEB)
SET(PLUGIN_AUTH_SOCKET YES CACHE STRING "")
SET(WITH_EMBEDDED_SERVER ON CACHE BOOL "")
SET(WITH_PCRE system CACHE STRING "")
- SET(WITH_INNODB_BZIP2 OFF CACHE STRING "")
- SET(WITH_INNODB_LZMA OFF CACHE STRING "")
- SET(WITH_INNODB_LZO OFF CACHE STRING "")
SET(WITH_ROCKSDB_BZip2 OFF CACHE STRING "")
ELSE()
SET(WITH_SSL bundled CACHE STRING "")
@@ -135,12 +128,8 @@ ELSE()
SET(WITH_JEMALLOC static CACHE STRING "")
SET(PLUGIN_AUTH_SOCKET STATIC CACHE STRING "")
SET(WITH_STRIPPED_CLIENT ON CACHE BOOL "Strip all client binaries")
- SET(WITH_INNODB_BZIP2 OFF CACHE STRING "")
- SET(WITH_INNODB_LZ4 OFF CACHE STRING "")
- SET(WITH_INNODB_LZO OFF CACHE STRING "")
SET(WITH_ROCKSDB_BZip2 OFF CACHE STRING "")
SET(WITH_ROCKSDB_LZ4 OFF CACHE STRING "")
- SET(GRN_WITH_LZ4 no CACHE STRING "")
ENDIF()
IF(NOT COMPILATION_COMMENT)
diff --git a/cmake/libfmt.cmake b/cmake/libfmt.cmake
new file mode 100644
index 00000000000..7eaa0dfa012
--- /dev/null
+++ b/cmake/libfmt.cmake
@@ -0,0 +1,53 @@
+INCLUDE (CheckCXXSourceCompiles)
+INCLUDE (ExternalProject)
+
+SET(WITH_LIBFMT "auto" CACHE STRING
+ "Which libfmt to use (possible values are 'bundled', 'system', or 'auto')")
+
+MACRO(BUNDLE_LIBFMT)
+ SET(dir "${CMAKE_BINARY_DIR}/extra/libfmt")
+ SET(LIBFMT_INCLUDE_DIR "${dir}/src/libfmt/include")
+
+ IF(CMAKE_VERSION VERSION_GREATER "3.0")
+ SET(fmt_byproducts BUILD_BYPRODUCTS ${LIBFMT_INCLUDE_DIR}/fmt/format-inl.h)
+ ENDIF()
+
+ ExternalProject_Add(
+ libfmt
+ PREFIX "${dir}"
+ URL "https://github.com/fmtlib/fmt/archive/refs/tags/8.0.1.zip"
+ URL_MD5 e77873199e897ca9f780479ad68e25b1
+ INSTALL_COMMAND ""
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ ${fmt_byproducts}
+ )
+ENDMACRO()
+
+MACRO (CHECK_LIBFMT)
+ IF(WITH_LIBFMT STREQUAL "system" OR WITH_LIBFMT STREQUAL "auto")
+ SET(CMAKE_REQUIRED_INCLUDES ${LIBFMT_INCLUDE_DIR})
+ CHECK_CXX_SOURCE_COMPILES(
+ "#define FMT_STATIC_THOUSANDS_SEPARATOR ','
+ #define FMT_HEADER_ONLY 1
+ #include <fmt/format-inl.h>
+ #include <iostream>
+ int main() {
+ fmt::format_args::format_arg arg=
+ fmt::detail::make_arg<fmt::format_context>(42);
+ std::cout << fmt::vformat(\"The answer is {}.\",
+ fmt::format_args(&arg, 1));
+ }" HAVE_SYSTEM_LIBFMT)
+ SET(CMAKE_REQUIRED_INCLUDES)
+ ENDIF()
+ IF(NOT HAVE_SYSTEM_LIBFMT OR WITH_LIBFMT STREQUAL "bundled")
+ IF (WITH_LIBFMT STREQUAL "system")
+ MESSAGE(FATAL_ERROR "system libfmt library is not found or unusable")
+ ENDIF()
+ BUNDLE_LIBFMT()
+ ELSE()
+ FIND_FILE(Libfmt_core_h fmt/core.h) # for build_depends.cmake
+ ENDIF()
+ENDMACRO()
+
+MARK_AS_ADVANCED(LIBFMT_INCLUDE_DIR)
diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake
index b4936ff57cc..c3ade74b3b3 100644
--- a/cmake/maintainer.cmake
+++ b/cmake/maintainer.cmake
@@ -47,6 +47,7 @@ SET(MY_ERROR_FLAGS -Werror)
IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0.0")
SET(MY_ERROR_FLAGS ${MY_ERROR_FLAGS} -Wno-error=maybe-uninitialized)
+ SET(MY_ERROR_FLAGS ${MY_ERROR_FLAGS} -Wno-error=non-virtual-dtor) # gcc bug 7302
ENDIF()
IF(MYSQL_MAINTAINER_MODE MATCHES "OFF|WARN")
diff --git a/config.h.cmake b/config.h.cmake
index 828f1fbb0d2..99acaf71bee 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -179,6 +179,7 @@
#cmakedefine HAVE_MLOCKALL 1
#cmakedefine HAVE_MMAP 1
#cmakedefine HAVE_MMAP64 1
+#cmakedefine HAVE_MPROTECT 1
#cmakedefine HAVE_PERROR 1
#cmakedefine HAVE_POLL 1
#cmakedefine HAVE_POSIX_FALLOCATE 1
diff --git a/configure.cmake b/configure.cmake
index e940bec5db0..2e0d7ed089e 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -375,6 +375,7 @@ CHECK_FUNCTION_EXISTS (mlock HAVE_MLOCK)
CHECK_FUNCTION_EXISTS (mlockall HAVE_MLOCKALL)
CHECK_FUNCTION_EXISTS (mmap HAVE_MMAP)
CHECK_FUNCTION_EXISTS (mmap64 HAVE_MMAP64)
+CHECK_FUNCTION_EXISTS (mprotect HAVE_MPROTECT)
CHECK_FUNCTION_EXISTS (perror HAVE_PERROR)
CHECK_FUNCTION_EXISTS (poll HAVE_POLL)
CHECK_FUNCTION_EXISTS (posix_fallocate HAVE_POSIX_FALLOCATE)
diff --git a/dbug/tests-t.pl b/dbug/tests-t.pl
index 4803627eda2..22526a7bc61 100755
--- a/dbug/tests-t.pl
+++ b/dbug/tests-t.pl
@@ -44,12 +44,10 @@ __DATA__
% ./tests -#d
func2: info: s=ok
=> execute
-=> evaluate: ON
=> evaluate_if: OFF
main: explain: dbug explained: d
func2: info: s=ok
% ./tests d,ret3
-=> evaluate: OFF
=> evaluate_if: OFF
#
## Testing negative lists
@@ -57,7 +55,6 @@ func2: info: s=ok
% ./tests d:-d,ret3
func2: info: s=ko
=> execute
-=> evaluate: ON
=> evaluate_if: OFF
main: explain: dbug explained: d:-d,ret3
func2: info: s=ko
@@ -69,7 +66,6 @@ func2: info: s=ko
| | | <func3
| | <func2
| <func1
-=> evaluate: OFF
=> evaluate_if: OFF
| >func2
| | >func3
@@ -85,7 +81,6 @@ func2: info: s=ko
| | | info: s=ko
| | <func2
| <func1
-=> evaluate: OFF
=> evaluate_if: OFF
| >func2
| | >func3
@@ -99,19 +94,15 @@ func2: info: s=ko
| | | >func3
| | | <func3
| <func1
-=> evaluate: OFF
=> evaluate_if: OFF
| | >func3
| | <func3
<main
% ./tests t:d,info:-d,ret3:-f,func2 d,evaluate
-=> evaluate: ON
=> evaluate_if: OFF
% ./tests t:d,info:-d,ret3:-f,func2 d,evaluate_if
-=> evaluate: OFF
=> evaluate_if: ON
% ./tests t:d:-d,ret3:-f,func2 d,evaluate_if
-=> evaluate: OFF
=> evaluate_if: ON
% ./tests t:d:-d,ret3:-f,func2
>main
@@ -120,7 +111,6 @@ func2: info: s=ko
| | | <func3
| <func1
=> execute
-=> evaluate: ON
=> evaluate_if: OFF
| explain: dbug explained: d:-d,ret3:f:-f,func2:t
| | >func3
@@ -135,7 +125,6 @@ func2: info: s=ko
| | | >func3
| | | <func3
| <func1
-=> evaluate: OFF
=> evaluate_if: ON
| | >func3
| | <func3
@@ -152,7 +141,6 @@ func2: info: s=ko
| dump: Memory: 0x#### Bytes: (27)
64 2C 64 75 6D 70 3A 2D 64 2C 72 65 74 33 3A 66 3A 2D 66 2C 66 75 6E 63 32 3A
74
-=> evaluate: OFF
=> evaluate_if: OFF
| | >func3
| | <func3
@@ -166,7 +154,6 @@ func2: info: s=ko
| dump: Memory: 0x#### Bytes: (27)
64 2C 64 75 6D 70 3A 2D 64 2C 72 65 74 33 3A 66 3A 2D 66 2C 66 75 6E 63 32 3A
74
-=> evaluate: OFF
=> evaluate_if: OFF
| | >func3
| | <func3
@@ -180,7 +167,6 @@ func2: info: s=ko
| dump: Memory: 0x#### Bytes: (27)
64 2C 64 75 6D 70 3A 2D 64 2C 72 65 74 33 3A 66 3A 2D 66 2C 66 75 6E 63 32 3A
74
-=> evaluate: OFF
=> evaluate_if: OFF
| | >func3
| | <func3
@@ -194,7 +180,6 @@ func2: info: s=ko
| dump: Memory: 0x#### Bytes: (35)
64 2C 64 75 6D 70 2C 65 78 70 6C 61 69 6E 3A 2D 64 2C 72 65 74 33 3A 66 3A 2D
66 2C 66 75 6E 63 32 3A 74
-=> evaluate: OFF
=> evaluate_if: OFF
| explain: dbug explained: d,dump,explain:-d,ret3:f:-f,func2:t
| | >func3
@@ -209,7 +194,6 @@ dbug-tests: | <func1
dbug-tests: | dump: Memory: 0x#### Bytes: (37)
64 2C 64 75 6D 70 2C 65 78 70 6C 61 69 6E 3A 2D 64 2C 72 65 74 33 3A 66 3A 2D
66 2C 66 75 6E 63 32 3A 50 3A 74
-=> evaluate: OFF
=> evaluate_if: OFF
dbug-tests: | explain: dbug explained: d,dump,explain:-d,ret3:f:-f,func2:P:t
dbug-tests: | | >func3
@@ -224,7 +208,6 @@ dbug-tests: tests.c: | <func1
dbug-tests: tests.c: | dump: Memory: 0x#### Bytes: (39)
64 2C 64 75 6D 70 2C 65 78 70 6C 61 69 6E 3A 2D 64 2C 72 65 74 33 3A 66 3A 2D
66 2C 66 75 6E 63 32 3A 46 3A 50 3A 74
-=> evaluate: OFF
=> evaluate_if: OFF
dbug-tests: tests.c: | explain: dbug explained: d,dump,explain:-d,ret3:f:-f,func2:F:P:t
dbug-tests: tests.c: | | >func3
@@ -240,7 +223,6 @@ dbug-tests: tests.c: <main
| | | <func3
| <func1
=> execute
-=> evaluate: ON
=> evaluate_if: OFF
| explain: dbug explained: d:-d,ret3:f:-f,func2:t
| | >func3
@@ -256,7 +238,6 @@ dbug-tests: tests.c: <main
| | <func2
| <func1
=> execute
-=> evaluate: ON
=> evaluate_if: OFF
| explain: dbug explained: d:-d,ret3:t
| >func2
@@ -267,7 +248,6 @@ dbug-tests: tests.c: <main
<main
% ./tests d,info:-d,ret3:d,push
func2: info: s=ko
-=> evaluate: OFF
=> evaluate_if: OFF
| >func2
| | >func3
@@ -277,7 +257,6 @@ func2: info: s=ko
<main
% ./tests d,info:-d,ret3:d,push,explain
func2: info: s=ko
-=> evaluate: OFF
=> evaluate_if: OFF
| explain: dbug explained: d,info,push,explain:-d,ret3:t
| >func2
@@ -288,13 +267,11 @@ func2: info: s=ko
<main
% ./tests d,info:-d,ret3:d,explain
func2: info: s=ko
-=> evaluate: OFF
=> evaluate_if: OFF
main: explain: dbug explained: d,info,explain:-d,ret3
func2: info: s=ko
% ./tests d,info:-d,ret3:d,explain,pop
func2: info: s=ko
-=> evaluate: OFF
=> evaluate_if: OFF
% ./tests d,info:-d,ret3:d,explain t:d,pop
>main
@@ -304,7 +281,6 @@ func2: info: s=ko
| | | <func3
| | <func2
| <func1
-=> evaluate: OFF
=> evaluate_if: OFF
main: explain: dbug explained: d,info,explain:-d,ret3
func2: info: s=ko
@@ -317,13 +293,11 @@ func2: info: s=ko
| | | info: s=ko
| | <func2
| <func1
-=> evaluate: OFF
=> evaluate_if: OFF
main: explain: dbug explained: d,info,explain,pop:-d,ret3
func2: info: s=ko
% ./tests d,info:-d,ret3:d,explain,set
func2: info: s=ko
-=> evaluate: OFF
=> evaluate_if: OFF
tests.c: main: explain: dbug explained: d,info,explain,set:-d,ret3:F
tests.c: func2: info: s=ko
@@ -336,7 +310,6 @@ func2: info: s=ko
| | | info: s=ko
| | <func2
| <func1
-=> evaluate: OFF
=> evaluate_if: OFF
tests.c: | explain: dbug explained: d,info,explain,set:-d,ret3:F:t
tests.c: | >func2
@@ -354,7 +327,6 @@ func2: info: s=ko
| | | info: s=ko
| | <func2
| <func1
-=> evaluate: OFF
=> evaluate_if: OFF
tests.c: | explain: dbug explained: d,info,explain,set:-d,ret3:F:t
tests.c: | >func2
@@ -365,7 +337,6 @@ func2: info: s=ko
tests.c: <main
% ./tests t d,info:-d,ret3:d,explain,set,pop
func2: info: s=ko
-=> evaluate: OFF
=> evaluate_if: OFF
| >func2
| | >func3
@@ -375,7 +346,6 @@ func2: info: s=ko
% ./tests t:f,func2
| | >func2
| | <func2
-=> evaluate: OFF
=> evaluate_if: OFF
| >func2
| <func2
@@ -387,7 +357,6 @@ func2: info: s=ko
| >func1
| <func1
=> execute
-=> evaluate: ON
=> evaluate_if: OFF
| explain: dbug explained: d:f:-f,func2/:t
<main
@@ -399,7 +368,6 @@ func2: info: s=ko
| | | info: s=ok
| | <func2
| <func1
-=> evaluate: OFF
=> evaluate_if: OFF
% ./tests t:f,main/:d,pop
>main
@@ -409,10 +377,8 @@ func2: info: s=ko
| | | <func3
| | <func2
| <func1
-=> evaluate: OFF
=> evaluate_if: OFF
% ./tests f,main/:d,push
-=> evaluate: OFF
=> evaluate_if: OFF
| >func2
| | >func3
@@ -431,7 +397,6 @@ func2: info: s=ko
| | | <func3
| | <func2
=> push1
-=> evaluate: OFF
=> evaluate_if: OFF
| | >func3
| | <func3
@@ -440,7 +405,6 @@ func2: info: s=ko
>main
=> push1
| <func1
-=> evaluate: OFF
=> evaluate_if: OFF
| >func2
| | >func3
@@ -453,7 +417,6 @@ func2: info: s=ko
| | | <func3
=> push1
| <func1
-=> evaluate: OFF
=> evaluate_if: OFF
| >func2
| | >func3
@@ -469,7 +432,6 @@ func2: info: s=ko
| | | <func3
| | <func2
=> push1
-=> evaluate: OFF
=> evaluate_if: OFF
# change the defaults
% ./tests t:f,func3 --push1=t
@@ -477,7 +439,6 @@ func2: info: s=ko
| | | <func3
=> push1
| <func1
-=> evaluate: OFF
=> evaluate_if: OFF
| >func2
| | >func3
@@ -487,11 +448,9 @@ func2: info: s=ko
# repeated keyword
% ./tests d:-d,info,info
=> execute
-=> evaluate: ON
=> evaluate_if: OFF
main: explain: dbug explained: d:-d,info
% ./tests d:-d,info/,info
=> execute
-=> evaluate: ON
=> evaluate_if: OFF
main: explain: dbug explained: d:-d,info/
diff --git a/dbug/tests.c b/dbug/tests.c
index 3e77bf82236..4e3642f09e4 100644
--- a/dbug/tests.c
+++ b/dbug/tests.c
@@ -16,7 +16,8 @@ char *push1=0;
const char *func3()
{
DBUG_ENTER("func3");
- DBUG_RETURN(DBUG_EVALUATE("ret3", "ok", "ko"));
+ DBUG_EXECUTE("ret3", DBUG_RETURN("ok"););
+ DBUG_RETURN("ko");
}
void func2()
@@ -72,10 +73,8 @@ int main (int argc __attribute__((unused)),
DBUG_EXECUTE_IF("push", DBUG_PUSH("+t"); );
DBUG_EXECUTE("execute", fprintf(DBUG_FILE, "=> execute\n"); );
DBUG_EXECUTE_IF("set", DBUG_SET("+F"); );
- fprintf(DBUG_FILE, "=> evaluate: %s\n",
- DBUG_EVALUATE("evaluate", "ON", "OFF"));
fprintf(DBUG_FILE, "=> evaluate_if: %s\n",
- DBUG_EVALUATE_IF("evaluate_if", "ON", "OFF"));
+ (DBUG_IF("evaluate_if") ? "ON": "OFF"));
DBUG_EXECUTE_IF("pop", DBUG_POP(); );
{
char s[1000] __attribute__((unused));
diff --git a/dbug/user.r b/dbug/user.r
index 8d8a9ce6910..c9a9126069a 100644
--- a/dbug/user.r
+++ b/dbug/user.r
@@ -771,32 +771,20 @@ artificial delay checking for race conditions.
.SP 1
EX:\ \fCDBUG_EXECUTE_IF\ ("crashme",\ DBUG_ABORT()\ ());\fR
.SP 1
-.LI DBUG_EVALUATE\
-The DBUG_EVALUATE macro is similar to DBUG_EXECUTE, but it can be used in
-the expression context. The first argument is the debug keyword that is used to
-choose whether the second (keyword is enabled) or the third (keyword is not
-enabled) argument is evaluated. When
-.I dbug
-is compiled off, the third argument is evaluated.
-.SP 1
-EX:\fC
-.br
- printf("Info-debug is %s",
-.br
- DBUG_EVALUATE\ ("info", "ON", "OFF"));\fR
-.SP 1
-.LI DBUG_EVALUATE_IF\
-Works like DBUG_EVALUATE macro, but the second argument is
-.B not
-evaluated, if the keyword is not explicitly listed in
-the 'd' flag. Like DBUG_EXECUTE_IF this could be used to conditionally execute
+.LI DBUG_IF\
+Returns
+.B 1
+if the keyword is explicitly listed in
+the 'd' flag. Otherwise returns
+.B 0
+Like DBUG_EXECUTE_IF this could be used to conditionally execute
"dangerous" actions.
.SP 1
EX:\fC
.br
if (prepare_transaction () ||
.br
- DBUG_EVALUATE ("crashme", (DBUG_ABORT(), 0), 0) ||
+ (DBUG_IF("crashme") && (DBUG_ABORT(), 0)) ||
.br
commit_transaction () )\fR
.SP 1
diff --git a/debian/additions/mariadb.conf.d/50-server.cnf b/debian/additions/mariadb.conf.d/50-server.cnf
index c5a26bd42b2..728ca23178b 100644
--- a/debian/additions/mariadb.conf.d/50-server.cnf
+++ b/debian/additions/mariadb.conf.d/50-server.cnf
@@ -108,7 +108,7 @@ collation-server = utf8mb4_general_ci
# you can put MariaDB-only options here
[mariadb]
-# This group is only read by MariaDB-10.6 servers.
+# This group is only read by MariaDB-10.7 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
-[mariadb-10.6]
+[mariadb-10.7]
diff --git a/debian/additions/source_mariadb-10.6.py b/debian/additions/source_mariadb-10.7.py
index 43b1f35373e..d126a9a28d3 100644
--- a/debian/additions/source_mariadb-10.6.py
+++ b/debian/additions/source_mariadb-10.7.py
@@ -1,4 +1,4 @@
-'''apport package hook for mariadb-10.6
+'''apport package hook for mariadb-10.7
(c) 2009 Canonical Ltd.
Author: Mathias Gug <mathias.gug@canonical.com>
@@ -21,7 +21,7 @@ def _add_my_conf_files(report, filename):
continue
def add_info(report):
- attach_conffiles(report, 'mariadb-server-10.6', conffiles=None)
+ attach_conffiles(report, 'mariadb-server-10.7', conffiles=None)
key = 'Logs' + path_to_key('/var/log/daemon.log')
report[key] = ""
for line in read_file('/var/log/daemon.log').split('\n'):
diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh
index b1e7a8453ef..b7e25abfb56 100755
--- a/debian/autobake-deb.sh
+++ b/debian/autobake-deb.sh
@@ -17,6 +17,7 @@ set -e
export DEB_BUILD_OPTIONS="nocheck $DEB_BUILD_OPTIONS"
source ./VERSION
+
# General CI optimizations to keep build output smaller
if [[ $GITLAB_CI ]]
then
@@ -34,7 +35,7 @@ then
then
cp -v storage/columnstore/columnstore/debian/mariadb-plugin-columnstore.* debian/
echo >> debian/control
- cat storage/columnstore/columnstore/debian/control >> debian/control
+ sed "s/10.6/${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}/" <storage/columnstore/columnstore/debian/control >> debian/control
fi
fi
@@ -67,6 +68,12 @@ disable_pmem()
sed '/-DWITH_PMEM=yes/d' -i debian/rules
}
+disable_libfmt()
+{
+ # 0.7+ required
+ sed '/libfmt-dev/d' -i debian/control
+}
+
architecture=$(dpkg-architecture -q DEB_BUILD_ARCH)
CODENAME="$(lsb_release -sc)"
@@ -79,6 +86,7 @@ case "${CODENAME}" in
disable_pmem
;&
buster)
+ disable_libfmt
replace_uring_with_aio
if [ ! "$architecture" = amd64 ]
then
@@ -108,6 +116,7 @@ case "${CODENAME}" in
;&
focal)
replace_uring_with_aio
+ disable_libfmt
;&
impish|jammy)
# mariadb-plugin-rocksdb s390x not supported by us (yet)
diff --git a/debian/changelog b/debian/changelog
index 08065467bdc..59109117207 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,5 @@
-mariadb-10.6 (1:10.6.0) unstable; urgency=medium
+mariadb-10.7 (1:10.7.0) unstable; urgency=medium
* Initial Release
- -- Otto Kekäläinen <otto@debian.org> Thu, 14 May 2020 18:00:57 +0300
+ -- Vicențiu Ciorbaru <vicentiu@mariadb.org> Thu, 18 Jun 2021 16:08:00 +0300
diff --git a/debian/control b/debian/control
index 7f0d88e991c..61000bd2432 100644
--- a/debian/control
+++ b/debian/control
@@ -1,4 +1,4 @@
-Source: mariadb-10.6
+Source: mariadb-10.7
Section: database
Priority: optional
Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net>
@@ -18,14 +18,18 @@ Build-Depends: bison,
libboost-regex-dev [amd64],
libboost-system-dev [amd64],
libboost-thread-dev [amd64],
+ libbz2-dev,
libcrack2-dev (>= 2.9.0),
libcurl4-openssl-dev | libcurl4-dev,
libedit-dev,
libedit-dev:native,
+ libfmt-dev (>= 7.0.0),
libjemalloc-dev [linux-any],
libjudy-dev,
libkrb5-dev,
liblz4-dev,
+ liblzma-dev,
+ liblzo2-dev,
libncurses5-dev (>= 5.0-6~),
libncurses5-dev:native (>= 5.0-6~),
libnuma-dev [linux-any],
@@ -38,7 +42,7 @@ Build-Depends: bison,
libsystemd-dev [linux-any],
liburing-dev [linux-any],
libxml2-dev,
- libzstd-dev,
+ libzstd-dev (>= 1.1.3),
lsb-release,
perl:any,
po-debconf,
@@ -259,7 +263,7 @@ Description: MariaDB common configuration files
.
This package includes configuration files common to all MariaDB programs.
-Package: mariadb-client-core-10.6
+Package: mariadb-client-core-10.7
Architecture: any
Depends: libmariadb3 (>= 10.5.4),
mariadb-common (>= ${source:Version}),
@@ -271,7 +275,8 @@ Conflicts: mariadb-client-10.0,
mariadb-client-10.3,
mariadb-client-10.4,
mariadb-client-10.5,
- mariadb-client-10.6 (<< ${source:Version}),
+ mariadb-client-10.6,
+ mariadb-client-10.7 (<< ${source:Version}),
mariadb-client-5.1,
mariadb-client-5.2,
mariadb-client-5.3,
@@ -282,6 +287,7 @@ Conflicts: mariadb-client-10.0,
mariadb-client-core-10.3,
mariadb-client-core-10.4,
mariadb-client-core-10.5,
+ mariadb-client-core-10.6,
mariadb-client-core-5.1,
mariadb-client-core-5.2,
mariadb-client-core-5.3,
@@ -304,7 +310,8 @@ Breaks: mariadb-server-10.0,
mariadb-server-core-10.3,
mariadb-server-core-10.4,
mariadb-server-core-10.5,
- mariadb-server-core-10.6 (<< ${source:Version}),
+ mariadb-server-core-10.6,
+ mariadb-server-core-10.7 (<< ${source:Version}),
mysql-server-core-5.5,
mysql-server-core-5.6,
mysql-server-core-5.7,
@@ -318,7 +325,8 @@ Replaces: mariadb-client-10.0,
mariadb-client-10.3,
mariadb-client-10.4,
mariadb-client-10.5,
- mariadb-client-10.6 (<< ${source:Version}),
+ mariadb-client-10.6,
+ mariadb-client-10.7 (<< ${source:Version}),
mariadb-client-5.1,
mariadb-client-5.2,
mariadb-client-5.3,
@@ -329,6 +337,7 @@ Replaces: mariadb-client-10.0,
mariadb-client-core-10.3,
mariadb-client-core-10.4,
mariadb-client-core-10.5,
+ mariadb-client-core-10.6,
mariadb-client-core-5.1,
mariadb-client-core-5.2,
mariadb-client-core-5.3,
@@ -341,7 +350,8 @@ Replaces: mariadb-client-10.0,
mariadb-server-core-10.3,
mariadb-server-core-10.4,
mariadb-server-core-10.5,
- mariadb-server-core-10.6 (<< ${source:Version}),
+ mariadb-server-core-10.6,
+ mariadb-server-core-10.7 (<< ${source:Version}),
mysql-client (<< 5.0.51),
mysql-client-5.0,
mysql-client-5.1,
@@ -369,10 +379,11 @@ Description: MariaDB database core client binaries
.
This package includes the core client files, as used by Akonadi.
-Package: mariadb-client-10.6
+Package: mariadb-client-10.7
Architecture: any
Depends: debianutils (>=1.6),
- mariadb-client-core-10.6 (>= ${source:Version}),
+ libconfig-inifiles-perl,
+ mariadb-client-core-10.7 (>= ${source:Version}),
mariadb-common,
${misc:Depends},
${perl:Depends},
@@ -384,7 +395,8 @@ Conflicts: mariadb-client (<< ${source:Version}),
mariadb-client-10.3,
mariadb-client-10.4,
mariadb-client-10.5,
- mariadb-client-10.6 (<< ${source:Version}),
+ mariadb-client-10.6,
+ mariadb-client-10.7 (<< ${source:Version}),
mariadb-client-5.1,
mariadb-client-5.2,
mariadb-client-5.3,
@@ -410,21 +422,24 @@ Breaks: mariadb-client-core-10.0,
mariadb-client-core-10.3,
mariadb-client-core-10.4,
mariadb-client-core-10.5,
- mariadb-client-core-10.6 (<< ${source:Version}),
+ mariadb-client-core-10.6,
+ mariadb-client-core-10.7 (<< ${source:Version}),
mariadb-server-10.0,
mariadb-server-10.1,
mariadb-server-10.2,
mariadb-server-10.3,
mariadb-server-10.4,
mariadb-server-10.5,
- mariadb-server-10.6 (<< ${source:Version}),
+ mariadb-server-10.6,
+ mariadb-server-10.7 (<< ${source:Version}),
mariadb-server-core-10.0,
mariadb-server-core-10.1,
mariadb-server-core-10.2,
mariadb-server-core-10.3,
mariadb-server-core-10.4,
mariadb-server-core-10.5,
- mariadb-server-core-10.6 (<< ${source:Version}),
+ mariadb-server-core-10.6,
+ mariadb-server-core-10.7 (<< ${source:Version}),
mysql-server-5.5,
mysql-server-5.6,
mysql-server-5.7,
@@ -443,6 +458,7 @@ Replaces: mariadb-client (<< ${source:Version}),
mariadb-client-10.3,
mariadb-client-10.4,
mariadb-client-10.5,
+ mariadb-client-10.6,
mariadb-client-5.1,
mariadb-client-5.2,
mariadb-client-5.3,
@@ -453,21 +469,24 @@ Replaces: mariadb-client (<< ${source:Version}),
mariadb-client-core-10.3,
mariadb-client-core-10.4,
mariadb-client-core-10.5,
- mariadb-client-core-10.6 (<< ${source:Version}),
+ mariadb-client-core-10.6,
+ mariadb-client-core-10.7 (<< ${source:Version}),
mariadb-server-10.0,
mariadb-server-10.1,
mariadb-server-10.2,
mariadb-server-10.3,
mariadb-server-10.4,
mariadb-server-10.5,
- mariadb-server-10.6 (<< ${source:Version}),
+ mariadb-server-10.6,
+ mariadb-server-10.7 (<< ${source:Version}),
mariadb-server-core-10.0,
mariadb-server-core-10.1,
mariadb-server-core-10.2,
mariadb-server-core-10.3,
mariadb-server-core-10.4,
mariadb-server-core-10.5,
- mariadb-server-core-10.6 (<< ${source:Version}),
+ mariadb-server-core-10.6,
+ mariadb-server-core-10.7 (<< ${source:Version}),
mysql-client (<< 5.0.51),
mysql-client-5.0,
mysql-client-5.1,
@@ -508,7 +527,7 @@ Description: MariaDB database client binaries
This package includes the client binaries and the additional tools
innotop and mariadb-report (mysqlreport).
-Package: mariadb-server-core-10.6
+Package: mariadb-server-core-10.7
Architecture: any
Depends: mariadb-common (>= ${source:Version}),
${misc:Depends},
@@ -519,6 +538,7 @@ Conflicts: mariadb-server-core-10.0,
mariadb-server-core-10.3,
mariadb-server-core-10.4,
mariadb-server-core-10.5,
+ mariadb-server-core-10.6,
mariadb-server-core-5.1,
mariadb-server-core-5.2,
mariadb-server-core-5.3,
@@ -537,13 +557,15 @@ Breaks: mariadb-client-10.0,
mariadb-client-10.3,
mariadb-client-10.4,
mariadb-client-10.5,
- mariadb-client-10.6 (<< ${source:Version}),
+ mariadb-client-10.6,
+ mariadb-client-10.7 (<< ${source:Version}),
mariadb-server-10.0,
mariadb-server-10.1,
mariadb-server-10.3,
mariadb-server-10.4,
mariadb-server-10.5,
- mariadb-server-10.6 (<< ${source:Version}),
+ mariadb-server-10.6,
+ mariadb-server-10.7 (<< ${source:Version}),
mysql-client-5.5,
mysql-server-5.5,
mysql-server-5.6,
@@ -558,13 +580,15 @@ Replaces: mariadb-client-10.0,
mariadb-client-10.3,
mariadb-client-10.4,
mariadb-client-10.5,
- mariadb-client-10.6 (<< ${source:Version}),
+ mariadb-client-10.6,
+ mariadb-client-10.7 (<< ${source:Version}),
mariadb-server-10.0,
mariadb-server-10.1,
mariadb-server-10.3,
mariadb-server-10.4,
mariadb-server-10.5,
- mariadb-server-10.6 (<< ${source:Version}),
+ mariadb-server-10.6,
+ mariadb-server-10.7 (<< ${source:Version}),
mariadb-server-core-10.0,
mariadb-server-core-10.1,
mariadb-server-core-10.2,
@@ -601,7 +625,7 @@ Description: MariaDB database core server files
.
This package includes the core server files, as used by Akonadi.
-Package: mariadb-server-10.6
+Package: mariadb-server-10.7
Architecture: any
Suggests: mailx,
mariadb-test,
@@ -616,8 +640,8 @@ Depends: galera-4 (>= 26.4),
libdbi-perl,
lsb-base (>= 3.0-10),
lsof [linux-any],
- mariadb-client-10.6 (>= ${source:Version}),
- mariadb-server-core-10.6 (>= ${source:Version}),
+ mariadb-client-10.7 (>= ${source:Version}),
+ mariadb-server-core-10.7 (>= ${source:Version}),
passwd,
perl (>= 5.6),
procps,
@@ -634,6 +658,7 @@ Conflicts: mariadb-server (<< ${source:Version}),
mariadb-server-10.3,
mariadb-server-10.4,
mariadb-server-10.5,
+ mariadb-server-10.6,
mariadb-server-5.1,
mariadb-server-5.2,
mariadb-server-5.3,
@@ -664,7 +689,8 @@ Replaces: handlersocket-mysql-5.5,
libmariadbclient-dev (<< 5.5.0),
libmariadbclient16,
mariadb-client-10.5,
- mariadb-client-10.6 (<< ${source:Version}),
+ mariadb-client-10.6,
+ mariadb-client-10.7 (<< ${source:Version}),
mariadb-server (<< ${source:Version}),
mariadb-server-10.0,
mariadb-server-10.1,
@@ -672,6 +698,7 @@ Replaces: handlersocket-mysql-5.5,
mariadb-server-10.3,
mariadb-server-10.4,
mariadb-server-10.5,
+ mariadb-server-10.6,
mariadb-server-5.1,
mariadb-server-5.2,
mariadb-server-5.3,
@@ -705,11 +732,11 @@ Description: MariaDB database server binaries
Package: mariadb-server
Architecture: all
-Depends: mariadb-server-10.6 (>= ${source:Version}),
+Depends: mariadb-server-10.7 (>= ${source:Version}),
${misc:Depends}
Description: MariaDB database server (metapackage depending on the latest version)
This is an empty package that depends on the current "best" version of
- mariadb-server (currently mariadb-server-10.6), as determined by the MariaDB
+ mariadb-server (currently mariadb-server-10.7), as determined by the MariaDB
maintainers. Install this package if in doubt about which MariaDB
version you need. That will install the version recommended by the
package maintainers.
@@ -721,11 +748,11 @@ Description: MariaDB database server (metapackage depending on the latest versio
Package: mariadb-client
Architecture: all
-Depends: mariadb-client-10.6 (>= ${source:Version}),
+Depends: mariadb-client-10.7 (>= ${source:Version}),
${misc:Depends}
Description: MariaDB database client (metapackage depending on the latest version)
This is an empty package that depends on the current "best" version of
- mariadb-client (currently mariadb-client-10.6), as determined by the MariaDB
+ mariadb-client (currently mariadb-client-10.7), as determined by the MariaDB
maintainers. Install this package if in doubt about which MariaDB version
you want, as this is the one considered to be in the best shape.
@@ -737,7 +764,7 @@ Breaks: mariadb-backup-10.1,
Replaces: mariadb-backup-10.1,
mariadb-backup-10.2,
mariadb-client-10.1
-Depends: mariadb-client-core-10.6 (= ${binary:Version}),
+Depends: mariadb-client-core-10.7 (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
Description: Backup tool for MariaDB server
@@ -750,7 +777,7 @@ Description: Backup tool for MariaDB server
Package: mariadb-plugin-connect
Architecture: any
Depends: libxml2,
- mariadb-server-10.6 (= ${server:Version}),
+ mariadb-server-10.7 (= ${server:Version}),
unixodbc,
${misc:Depends},
${shlibs:Depends}
@@ -773,7 +800,7 @@ Description: Connect storage engine for MariaDB
Package: mariadb-plugin-s3
Architecture: any
Depends: libcurl4,
- mariadb-server-10.6 (= ${server:Version}),
+ mariadb-server-10.7 (= ${server:Version}),
${misc:Depends},
${shlibs:Depends}
Description: Amazon S3 archival storage engine for MariaDB
@@ -783,7 +810,7 @@ Description: Amazon S3 archival storage engine for MariaDB
Package: mariadb-plugin-rocksdb
Architecture: amd64 arm64 mips64el ppc64el
-Depends: mariadb-server-10.6 (= ${server:Version}),
+Depends: mariadb-server-10.7 (= ${server:Version}),
python3,
rocksdb-tools,
${misc:Depends},
@@ -803,7 +830,7 @@ Description: RocksDB storage engine for MariaDB
Package: mariadb-plugin-oqgraph
Architecture: any
Depends: libjudydebian1,
- mariadb-server-10.6 (= ${server:Version}),
+ mariadb-server-10.7 (= ${server:Version}),
${misc:Depends},
${shlibs:Depends}
Breaks: mariadb-oqgraph-engine-10.0,
@@ -823,7 +850,7 @@ Description: OQGraph storage engine for MariaDB
Package: mariadb-plugin-mroonga
Architecture: any-alpha any-amd64 any-arm any-arm64 any-i386 any-ia64 any-mips64el any-mips64r6el any-mipsel any-mipsr6el any-nios2 any-powerpcel any-ppc64el any-sh3 any-sh4 any-tilegx
-Depends: mariadb-server-10.6 (= ${server:Version}),
+Depends: mariadb-server-10.7 (= ${server:Version}),
${misc:Depends},
${shlibs:Depends}
Breaks: mariadb-server-10.0,
@@ -843,7 +870,7 @@ Description: Mroonga storage engine for MariaDB
Package: mariadb-plugin-spider
Architecture: any
-Depends: mariadb-server-10.6 (= ${server:Version}),
+Depends: mariadb-server-10.7 (= ${server:Version}),
${misc:Depends},
${shlibs:Depends}
Breaks: mariadb-server-10.0,
@@ -865,7 +892,7 @@ Description: Spider storage engine for MariaDB
Package: mariadb-plugin-gssapi-server
Architecture: any
Depends: libgssapi-krb5-2,
- mariadb-server-10.6,
+ mariadb-server-10.7,
${misc:Depends},
${shlibs:Depends}
Breaks: mariadb-gssapi-server-10.1,
@@ -886,7 +913,7 @@ Package: mariadb-plugin-gssapi-client
Architecture: any
Multi-Arch: same
Depends: libgssapi-krb5-2,
- mariadb-client-10.6 (= ${binary:Version}),
+ mariadb-client-10.7 (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
Breaks: mariadb-gssapi-client-10.1,
@@ -906,7 +933,7 @@ Description: GSSAPI authentication plugin for MariaDB client
Package: mariadb-plugin-cracklib-password-check
Architecture: any
Depends: libcrack2 (>= 2.9.0),
- mariadb-server-10.6,
+ mariadb-server-10.7,
${misc:Depends},
${shlibs:Depends}
Description: CrackLib Password Validation Plugin for MariaDB
@@ -915,10 +942,80 @@ Description: CrackLib Password Validation Plugin for MariaDB
.
Install and configure this to enforce stronger passwords for MariaDB users.
+Package: mariadb-plugin-provider-bzip2
+Architecture: any
+Depends: mariadb-server-10.7,
+ ${misc:Depends},
+ ${shlibs:Depends}
+Description: BZip2 compression support in the server and storage engines
+ The various MariaDB storage engines, such as InnoDB, RocksDB, Mroonga,
+ can use different compression libraries.
+ .
+ Plugin provides BZip2 (https://sourceware.org/bzip2/) compression
+ .
+ Note that these affect InnoDB and Mroonga only;
+ RocksDB still uses the compression algorithms from its own library
+
+Package: mariadb-plugin-provider-lz4
+Architecture: any
+Depends: mariadb-server-10.7,
+ ${misc:Depends},
+ ${shlibs:Depends}
+Description: LZ4 compression support in the server and storage engines
+ The various MariaDB storage engines, such as InnoDB, RocksDB, Mroonga,
+ can use different compression libraries.
+ .
+ Plugin provides LZ4 (http://lz4.github.io/lz4/) compression
+ .
+ Note that these affect InnoDB and Mroonga only;
+ RocksDB still uses the compression algorithms from its own library
+
+Package: mariadb-plugin-provider-lzma
+Architecture: any
+Depends: mariadb-server-10.7,
+ ${misc:Depends},
+ ${shlibs:Depends}
+Description: LZMA compression support in the server and storage engines
+ The various MariaDB storage engines, such as InnoDB, RocksDB, Mroonga,
+ can use different compression libraries.
+ .
+ Plugin provides LZMA (https://tukaani.org/lzma/) compression
+ .
+ Note that these affect InnoDB and Mroonga only;
+ RocksDB still uses the compression algorithms from its own library
+
+Package: mariadb-plugin-provider-lzo
+Architecture: any
+Depends: mariadb-server-10.7,
+ ${misc:Depends},
+ ${shlibs:Depends}
+Description: LZO compression support in the server and storage engines
+ The various MariaDB storage engines, such as InnoDB, RocksDB, Mroonga,
+ can use different compression libraries.
+ .
+ Plugin provides LZO (http://www.oberhumer.com/opensource/lzo/) compression
+ .
+ Note that these affect InnoDB and Mroonga only;
+ RocksDB still uses the compression algorithms from its own library
+
+Package: mariadb-plugin-provider-snappy
+Architecture: any
+Depends: mariadb-server-10.7,
+ ${misc:Depends},
+ ${shlibs:Depends}
+Description: Snappy compression support in the server and storage engines
+ The various MariaDB storage engines, such as InnoDB, RocksDB, Mroonga,
+ can use different compression libraries.
+ .
+ Plugin provides Snappy (https://github.com/google/snappy) compression
+ .
+ Note that these affect InnoDB and Mroonga only;
+ RocksDB still uses the compression algorithms from its own library
+
Package: mariadb-test
Architecture: any
-Depends: mariadb-client-10.6 (= ${binary:Version}),
- mariadb-server-10.6 (= ${server:Version}),
+Depends: mariadb-client-10.7 (= ${binary:Version}),
+ mariadb-server-10.7 (= ${server:Version}),
mariadb-test-data (= ${source:Version}),
virtual-mysql-testsuite,
${misc:Depends},
diff --git a/debian/mariadb-client-10.6.README.Debian b/debian/mariadb-client-10.7.README.Debian
index 64f0f509951..64f0f509951 100644
--- a/debian/mariadb-client-10.6.README.Debian
+++ b/debian/mariadb-client-10.7.README.Debian
diff --git a/debian/mariadb-client-10.6.docs b/debian/mariadb-client-10.7.docs
index c09092629c3..c09092629c3 100644
--- a/debian/mariadb-client-10.6.docs
+++ b/debian/mariadb-client-10.7.docs
diff --git a/debian/mariadb-client-10.6.install b/debian/mariadb-client-10.7.install
index 3a92ded15b6..3a92ded15b6 100644
--- a/debian/mariadb-client-10.6.install
+++ b/debian/mariadb-client-10.7.install
diff --git a/debian/mariadb-client-10.6.links b/debian/mariadb-client-10.7.links
index bc42197629b..bc42197629b 100644
--- a/debian/mariadb-client-10.6.links
+++ b/debian/mariadb-client-10.7.links
diff --git a/debian/mariadb-client-10.6.manpages b/debian/mariadb-client-10.7.manpages
index 8735caeea8b..8735caeea8b 100644
--- a/debian/mariadb-client-10.6.manpages
+++ b/debian/mariadb-client-10.7.manpages
diff --git a/debian/mariadb-client-10.6.menu b/debian/mariadb-client-10.7.menu
index 90280215b8b..edd489cf316 100644
--- a/debian/mariadb-client-10.6.menu
+++ b/debian/mariadb-client-10.7.menu
@@ -1,3 +1,3 @@
# According to /usr/share/menu/ policy 1.4, not /usr/share/doc/debian-policy/
-?package(mariadb-client-10.6):needs="text" section="Applications/Data Management"\
+?package(mariadb-client-10.7):needs="text" section="Applications/Data Management"\
title="Innotop" command="/usr/bin/innotop"
diff --git a/debian/mariadb-client-core-10.6.install b/debian/mariadb-client-core-10.7.install
index 421b62d2a1a..421b62d2a1a 100644
--- a/debian/mariadb-client-core-10.6.install
+++ b/debian/mariadb-client-core-10.7.install
diff --git a/debian/mariadb-client-core-10.6.links b/debian/mariadb-client-core-10.7.links
index 5134dd814b5..5134dd814b5 100644
--- a/debian/mariadb-client-core-10.6.links
+++ b/debian/mariadb-client-core-10.7.links
diff --git a/debian/mariadb-plugin-provider-bzip2.install b/debian/mariadb-plugin-provider-bzip2.install
new file mode 100644
index 00000000000..75a73c384a7
--- /dev/null
+++ b/debian/mariadb-plugin-provider-bzip2.install
@@ -0,0 +1,2 @@
+etc/mysql/mariadb.conf.d/provider_bzip2.cnf
+usr/lib/mysql/plugin/provider_bzip2.so
diff --git a/debian/mariadb-plugin-provider-bzip2.lintian-overrides b/debian/mariadb-plugin-provider-bzip2.lintian-overrides
new file mode 100644
index 00000000000..563c05a3a6b
--- /dev/null
+++ b/debian/mariadb-plugin-provider-bzip2.lintian-overrides
@@ -0,0 +1,3 @@
+# It's intentional that bzip2 compression plugin doesn't have symbols from libc
+# More info https://jira.mariadb.org/browse/MDEV-28120
+library-not-linked-against-libc usr/lib/mysql/plugin/provider_bzip2.so \ No newline at end of file
diff --git a/debian/mariadb-plugin-provider-lz4.install b/debian/mariadb-plugin-provider-lz4.install
new file mode 100644
index 00000000000..a3ba1d77bb3
--- /dev/null
+++ b/debian/mariadb-plugin-provider-lz4.install
@@ -0,0 +1,2 @@
+etc/mysql/mariadb.conf.d/provider_lz4.cnf
+usr/lib/mysql/plugin/provider_lz4.so
diff --git a/debian/mariadb-plugin-provider-lz4.lintian-overrides b/debian/mariadb-plugin-provider-lz4.lintian-overrides
new file mode 100644
index 00000000000..3f7d7e9ecfb
--- /dev/null
+++ b/debian/mariadb-plugin-provider-lz4.lintian-overrides
@@ -0,0 +1,3 @@
+# It's intentional that LZ4 compression plugin doesn't have symbols from libc
+# More info https://jira.mariadb.org/browse/MDEV-28120
+library-not-linked-against-libc usr/lib/mysql/plugin/provider_lz4.so \ No newline at end of file
diff --git a/debian/mariadb-plugin-provider-lzma.install b/debian/mariadb-plugin-provider-lzma.install
new file mode 100644
index 00000000000..4a4138b45c6
--- /dev/null
+++ b/debian/mariadb-plugin-provider-lzma.install
@@ -0,0 +1,2 @@
+etc/mysql/mariadb.conf.d/provider_lzma.cnf
+usr/lib/mysql/plugin/provider_lzma.so
diff --git a/debian/mariadb-plugin-provider-lzma.lintian-overrides b/debian/mariadb-plugin-provider-lzma.lintian-overrides
new file mode 100644
index 00000000000..94eafa766a4
--- /dev/null
+++ b/debian/mariadb-plugin-provider-lzma.lintian-overrides
@@ -0,0 +1,3 @@
+# It's intentional that LZMA compression plugin doesn't have symbols from libc
+# More info https://jira.mariadb.org/browse/MDEV-28120
+library-not-linked-against-libc usr/lib/mysql/plugin/provider_lzma.so \ No newline at end of file
diff --git a/debian/mariadb-plugin-provider-lzo.install b/debian/mariadb-plugin-provider-lzo.install
new file mode 100644
index 00000000000..2bf4c091ddc
--- /dev/null
+++ b/debian/mariadb-plugin-provider-lzo.install
@@ -0,0 +1,2 @@
+etc/mysql/mariadb.conf.d/provider_lzo.cnf
+usr/lib/mysql/plugin/provider_lzo.so
diff --git a/debian/mariadb-plugin-provider-lzo.lintian-overrides b/debian/mariadb-plugin-provider-lzo.lintian-overrides
new file mode 100644
index 00000000000..8184923cf9a
--- /dev/null
+++ b/debian/mariadb-plugin-provider-lzo.lintian-overrides
@@ -0,0 +1,3 @@
+# It's intentional that LZO compression plugin doesn't have symbols from libc
+# More info https://jira.mariadb.org/browse/MDEV-28120
+library-not-linked-against-libc usr/lib/mysql/plugin/provider_lzo.so \ No newline at end of file
diff --git a/debian/mariadb-plugin-provider-snappy.install b/debian/mariadb-plugin-provider-snappy.install
new file mode 100644
index 00000000000..26c929c89ba
--- /dev/null
+++ b/debian/mariadb-plugin-provider-snappy.install
@@ -0,0 +1,2 @@
+etc/mysql/mariadb.conf.d/provider_snappy.cnf
+usr/lib/mysql/plugin/provider_snappy.so
diff --git a/debian/mariadb-plugin-provider-snappy.lintian-overrides b/debian/mariadb-plugin-provider-snappy.lintian-overrides
new file mode 100644
index 00000000000..6c76162573d
--- /dev/null
+++ b/debian/mariadb-plugin-provider-snappy.lintian-overrides
@@ -0,0 +1,3 @@
+# It's intentional that Snappy compression plugin doesn't have symbols from libc
+# More info https://jira.mariadb.org/browse/MDEV-28120
+library-not-linked-against-libc usr/lib/mysql/plugin/provider_snappy.so \ No newline at end of file
diff --git a/debian/mariadb-server-10.6.README.Debian b/debian/mariadb-server-10.7.README.Debian
index 6042249a706..6042249a706 100644
--- a/debian/mariadb-server-10.6.README.Debian
+++ b/debian/mariadb-server-10.7.README.Debian
diff --git a/debian/mariadb-server-10.6.config b/debian/mariadb-server-10.7.config
index 27e2e9f4929..f47b147ee62 100644
--- a/debian/mariadb-server-10.6.config
+++ b/debian/mariadb-server-10.7.config
@@ -9,6 +9,6 @@ ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
# Beware that there are two ypwhich one of them needs the 2>/dev/null!
if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then
- db_input high mariadb-server-10.6/nis_warning || true
+ db_input high mariadb-server-10.7/nis_warning || true
db_go
fi
diff --git a/debian/mariadb-server-10.6.dirs b/debian/mariadb-server-10.7.dirs
index 5057fe806c3..5057fe806c3 100644
--- a/debian/mariadb-server-10.6.dirs
+++ b/debian/mariadb-server-10.7.dirs
diff --git a/debian/mariadb-server-10.6.install b/debian/mariadb-server-10.7.install
index 4d15f5d8e54..ea17c087953 100644
--- a/debian/mariadb-server-10.6.install
+++ b/debian/mariadb-server-10.7.install
@@ -3,7 +3,7 @@ debian/additions/debian-start.inc.sh usr/share/mysql
debian/additions/echo_stderr usr/share/mysql
debian/additions/mariadb.conf.d/50-mysqld_safe.cnf etc/mysql/mariadb.conf.d
debian/additions/mariadb.conf.d/50-server.cnf etc/mysql/mariadb.conf.d
-debian/additions/source_mariadb-10.6.py usr/share/apport/package-hooks
+debian/additions/source_mariadb-10.7.py usr/share/apport/package-hooks
etc/apparmor.d/usr.sbin.mariadbd
etc/security/user_map.conf
lib/*/security/pam_user_map.so
@@ -45,6 +45,7 @@ usr/lib/mysql/plugin/ha_sphinx.so
usr/lib/mysql/plugin/handlersocket.so
usr/lib/mysql/plugin/locales.so
usr/lib/mysql/plugin/metadata_lock_info.so
+usr/lib/mysql/plugin/password_reuse_check.so
usr/lib/mysql/plugin/query_cache_info.so
usr/lib/mysql/plugin/query_response_time.so
usr/lib/mysql/plugin/server_audit.so
@@ -52,7 +53,7 @@ usr/lib/mysql/plugin/simple_password_check.so
usr/lib/mysql/plugin/sql_errlog.so
usr/lib/mysql/plugin/type_mysql_json.so
usr/lib/mysql/plugin/wsrep_info.so
-usr/share/doc/mariadb-server-10.6/mariadbd.sym.gz
+usr/share/doc/mariadb-server-10.7/mariadbd.sym.gz
usr/share/man/man1/aria_chk.1
usr/share/man/man1/aria_dump_log.1
usr/share/man/man1/aria_ftdump.1
diff --git a/debian/mariadb-server-10.6.links b/debian/mariadb-server-10.7.links
index 9cc3a436ba8..9cc3a436ba8 100644
--- a/debian/mariadb-server-10.6.links
+++ b/debian/mariadb-server-10.7.links
diff --git a/debian/mariadb-server-10.6.logcheck.ignore.paranoid b/debian/mariadb-server-10.7.logcheck.ignore.paranoid
index 407d4063270..407d4063270 100644
--- a/debian/mariadb-server-10.6.logcheck.ignore.paranoid
+++ b/debian/mariadb-server-10.7.logcheck.ignore.paranoid
diff --git a/debian/mariadb-server-10.6.logcheck.ignore.server b/debian/mariadb-server-10.7.logcheck.ignore.server
index a64fc54e15c..a64fc54e15c 100644
--- a/debian/mariadb-server-10.6.logcheck.ignore.server
+++ b/debian/mariadb-server-10.7.logcheck.ignore.server
diff --git a/debian/mariadb-server-10.6.logcheck.ignore.workstation b/debian/mariadb-server-10.7.logcheck.ignore.workstation
index a64fc54e15c..a64fc54e15c 100644
--- a/debian/mariadb-server-10.6.logcheck.ignore.workstation
+++ b/debian/mariadb-server-10.7.logcheck.ignore.workstation
diff --git a/debian/mariadb-server-10.6.mariadb.init b/debian/mariadb-server-10.7.mariadb.init
index a16e9f88edb..d2a11d6471e 100644
--- a/debian/mariadb-server-10.6.mariadb.init
+++ b/debian/mariadb-server-10.7.mariadb.init
@@ -165,7 +165,7 @@ case "${1:-''}" in
if ! mariadbd_status check_dead warn; then
log_end_msg 1
- log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-10.6/README.Debian.gz!"
+ log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-10.7/README.Debian.gz!"
exit -1
else
log_end_msg 0
diff --git a/debian/mariadb-server-10.6.mysql-server.logrotate b/debian/mariadb-server-10.7.mysql-server.logrotate
index 11e4480c427..11e4480c427 100644
--- a/debian/mariadb-server-10.6.mysql-server.logrotate
+++ b/debian/mariadb-server-10.7.mysql-server.logrotate
diff --git a/debian/mariadb-server-10.6.mysql.default b/debian/mariadb-server-10.7.mysql.default
index 36079edecb2..36079edecb2 100644
--- a/debian/mariadb-server-10.6.mysql.default
+++ b/debian/mariadb-server-10.7.mysql.default
diff --git a/debian/mariadb-server-10.6.postinst b/debian/mariadb-server-10.7.postinst
index 93a1e4e8b87..93a1e4e8b87 100644
--- a/debian/mariadb-server-10.6.postinst
+++ b/debian/mariadb-server-10.7.postinst
diff --git a/debian/mariadb-server-10.6.postrm b/debian/mariadb-server-10.7.postrm
index 94ce91db31d..94ce91db31d 100644
--- a/debian/mariadb-server-10.6.postrm
+++ b/debian/mariadb-server-10.7.postrm
diff --git a/debian/mariadb-server-10.6.preinst b/debian/mariadb-server-10.7.preinst
index 79c6ccc8500..79c6ccc8500 100644
--- a/debian/mariadb-server-10.6.preinst
+++ b/debian/mariadb-server-10.7.preinst
diff --git a/debian/mariadb-server-10.6.prerm b/debian/mariadb-server-10.7.prerm
index 8fd172da9d2..8fd172da9d2 100644
--- a/debian/mariadb-server-10.6.prerm
+++ b/debian/mariadb-server-10.7.prerm
diff --git a/debian/mariadb-server-10.6.templates b/debian/mariadb-server-10.7.templates
index 32e908c71e9..916baf0d483 100644
--- a/debian/mariadb-server-10.6.templates
+++ b/debian/mariadb-server-10.7.templates
@@ -7,7 +7,7 @@
# Even minor modifications require translation updates and such
# changes should be coordinated with translators and reviewers.
-Template: mariadb-server-10.6/old_data_directory_saved
+Template: mariadb-server-10.7/old_data_directory_saved
Type: note
_Description: The old data directory will be saved at new location
A file named /var/lib/mysql/debian-*.flag exists on this system.
@@ -19,7 +19,7 @@ _Description: The old data directory will be saved at new location
.
Please manually export/import your data (e.g. with mysqldump) if needed.
-Template: mariadb-server-10.6/nis_warning
+Template: mariadb-server-10.7/nis_warning
Type: note
#flag:translate!:3,5
_Description: Important note for NIS/YP users
@@ -33,7 +33,7 @@ _Description: Important note for NIS/YP users
.
/var/lib/mysql: drwxr-xr-x mysql mysql
-Template: mariadb-server-10.6/postrm_remove_databases
+Template: mariadb-server-10.7/postrm_remove_databases
Type: boolean
Default: false
_Description: Remove all MariaDB databases?
diff --git a/debian/mariadb-server-10.6.triggers b/debian/mariadb-server-10.7.triggers
index d1f5f5e14f1..d1f5f5e14f1 100644
--- a/debian/mariadb-server-10.6.triggers
+++ b/debian/mariadb-server-10.7.triggers
diff --git a/debian/mariadb-server-core-10.6.install b/debian/mariadb-server-core-10.7.install
index def95268512..def95268512 100644
--- a/debian/mariadb-server-core-10.6.install
+++ b/debian/mariadb-server-core-10.7.install
diff --git a/debian/mariadb-server-core-10.6.links b/debian/mariadb-server-core-10.7.links
index c2be98f38fb..c2be98f38fb 100644
--- a/debian/mariadb-server-core-10.6.links
+++ b/debian/mariadb-server-core-10.7.links
diff --git a/debian/not-installed b/debian/not-installed
index 6924c9ad1a5..ff05d1827ef 100644
--- a/debian/not-installed
+++ b/debian/not-installed
@@ -16,15 +16,15 @@ usr/lib/*/libdbbc.a # ColumnStore header file
usr/lib/*/libidbboot.a # ColumnStore header file
usr/lib/*/libprocessor.a # ColumnStore header file
usr/lib/*/libwe_xml.a # ColumnStore header file
-usr/share/doc/mariadb-server-10.6/COPYING
-usr/share/doc/mariadb-server-10.6/COPYING.AGPLv3
-usr/share/doc/mariadb-server-10.6/COPYING.GPLv2
-usr/share/doc/mariadb-server-10.6/COPYING.thirdparty
-usr/share/doc/mariadb-server-10.6/CREDITS
-usr/share/doc/mariadb-server-10.6/EXCEPTIONS-CLIENT
-usr/share/doc/mariadb-server-10.6/INSTALL-BINARY
-usr/share/doc/mariadb-server-10.6/PATENTS
-usr/share/doc/mariadb-server-10.6/README-wsrep
+usr/share/doc/mariadb-server-10.7/COPYING
+usr/share/doc/mariadb-server-10.7/COPYING.AGPLv3
+usr/share/doc/mariadb-server-10.7/COPYING.GPLv2
+usr/share/doc/mariadb-server-10.7/COPYING.thirdparty
+usr/share/doc/mariadb-server-10.7/CREDITS
+usr/share/doc/mariadb-server-10.7/EXCEPTIONS-CLIENT
+usr/share/doc/mariadb-server-10.7/INSTALL-BINARY
+usr/share/doc/mariadb-server-10.7/PATENTS
+usr/share/doc/mariadb-server-10.7/README-wsrep
usr/share/groonga/COPYING
usr/share/groonga-normalizer-mysql/lgpl-2.0.txt
usr/share/groonga-normalizer-mysql/README.md
diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in
index 17bbe40ee92..d96402785cc 100644
--- a/debian/po/POTFILES.in
+++ b/debian/po/POTFILES.in
@@ -1 +1 @@
-[type: gettext/rfc822deb] mariadb-server-10.6.templates
+[type: gettext/rfc822deb] mariadb-server-10.7.templates
diff --git a/debian/po/ar.po b/debian/po/ar.po
index 8512209efbb..b4a2ff0aab3 100644
--- a/debian/po/ar.po
+++ b/debian/po/ar.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: templates\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2007-05-01 13:04+0300\n"
"Last-Translator: Ossama M. Khayat <okhayat@yahoo.com>\n"
@@ -27,13 +27,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -42,7 +42,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -50,20 +50,20 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "ملاحظة هامة لمستخدمي NIS/YP"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -71,7 +71,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
#, fuzzy
#| msgid ""
#| "You should also check the permissions and the owner of the /var/lib/mysql "
@@ -83,13 +83,13 @@ msgstr "عليك أيضاً أن تقوم بالتأكد من صلاحيات Ù…Ø
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "إزالة جميع قواعد بيانات MariaDB؟"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -97,7 +97,7 @@ msgstr "الدليل /var/lib/mysql الذي يحتوي قواعد بيانات
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/ca.po b/debian/po/ca.po
index d9c69e19983..8796ca196a8 100644
--- a/debian/po/ca.po
+++ b/debian/po/ca.po
@@ -1,12 +1,12 @@
# mariadb (debconf) translation to Catalan.
-# his file is distributed under the same license as the mariadb-10.6 package.
+# his file is distributed under the same license as the mariadb-10.7 package.
# Aleix Badia i Bosch <abadia@ica.es> 2004
# Innocent De Marchi <tangram.peces@gmail.com> 2017
#
msgid ""
msgstr ""
-"Project-Id-Version: mariadb-10.6\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Project-Id-Version: mariadb-10.7\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2017-03-20 17:55+0100\n"
"Last-Translator: Innocent De Marchi <tangram.peces@gmail.com>\n"
@@ -19,13 +19,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr "El directori de dades antigues es desarà a una nova localització"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -37,7 +37,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -47,7 +47,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
@@ -56,13 +56,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "Nota important pels usuaris de «NIS/YP»"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -72,7 +72,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -82,13 +82,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "Eliminar totes les bases de dades MariaDB?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -98,7 +98,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/cs.po b/debian/po/cs.po
index 8176d86457b..573fc645663 100644
--- a/debian/po/cs.po
+++ b/debian/po/cs.po
@@ -13,8 +13,8 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: mariadb-10.6\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Project-Id-Version: mariadb-10.7\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2020-10-18 17:13+0200\n"
"Last-Translator: Miroslav Kure <kurem@debian.cz>\n"
@@ -26,13 +26,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr "Starý adresář s daty bude uložen na novém místě."
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -44,7 +44,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -54,7 +54,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
@@ -63,13 +63,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "Důležitá poznámka pro uživatele NIS/YP"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -79,7 +79,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -88,13 +88,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "Odstranit všechny MariaDB databáze?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -104,7 +104,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/da.po b/debian/po/da.po
index 4de2e4e7057..aa45b277904 100644
--- a/debian/po/da.po
+++ b/debian/po/da.po
@@ -1,13 +1,13 @@
-# Danish translation mariadb-10.6.
-# Copyright (C) 2014 mariadb-10.6 og nedenstående oversættere.
-# This file is distributed under the same license as the mariadb-10.6 package.
+# Danish translation mariadb-10.7.
+# Copyright (C) 2014 mariadb-10.7 og nedenstående oversættere.
+# This file is distributed under the same license as the mariadb-10.7 package.
# Claus Hindsgaul <claus.hindsgaul@gmail.com>, 2005, 2006, 2007.
# Joe Hansen <joedalton2@yahoo.dk>, 2014, 2016.
#
msgid ""
msgstr ""
-"Project-Id-Version: mariadb-10.6\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Project-Id-Version: mariadb-10.7\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2016-07-09 22:41+0200\n"
"Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n"
@@ -19,13 +19,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr "Den gamle datamappe vil blive gemt på en ny placering"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -37,7 +37,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -47,7 +47,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
@@ -56,13 +56,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "Vigtig oplysning til NIS/YP-brugere"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -72,7 +72,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -82,13 +82,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "Fjern alle MariaDB-databaser?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -98,7 +98,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/de.po b/debian/po/de.po
index 2228a07e27d..fdbd3f2986a 100644
--- a/debian/po/de.po
+++ b/debian/po/de.po
@@ -1,4 +1,4 @@
-# German translation of mariadb-10.6 10.0.13-1
+# German translation of mariadb-10.7 10.0.13-1
# Alwin Meschede <ameschede@gmx.de>, 2006, 2007.
# Thomas Mueller <thomas.mueller@tmit.eu>, 2009.
# Chris Leick <c.leick@vollbio.de>, 2014-2016.
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: mariadb 10.0.25-1\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2016-05-12 22:39+0100\n"
"Last-Translator: Chris Leick <c.leick@vollbio.de>\n"
@@ -19,13 +19,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr "Das alte Datenverzeichnis wird an einer neuen Stelle gespeichert"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -37,7 +37,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -47,7 +47,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
@@ -56,13 +56,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "Wichtige Anmerkung für NIS/YP-Benutzer!"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -72,7 +72,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -82,13 +82,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "Alle MariaDB-Datenbanken entfernen?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -98,7 +98,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/es.po b/debian/po/es.po
index db5a8bbf7a6..82f1a8ed576 100644
--- a/debian/po/es.po
+++ b/debian/po/es.po
@@ -40,7 +40,7 @@
msgid ""
msgstr ""
"Project-Id-Version: mysql-dfsg-5.1_5.0.24-3\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2016-04-30 21:26+0200\n"
"Last-Translator: Javier Fernández-Sanguino <jfs@debian.org>\n"
@@ -54,13 +54,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr "Se guardará el directorio antiguo de datos a la nueva ubicación"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -72,7 +72,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -82,7 +82,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
@@ -91,13 +91,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "Nota importante para los usuarios de NIS/YP"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -107,7 +107,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -117,13 +117,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "¿Desea eliminar todas las bases de datos MariaDB?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -133,7 +133,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/eu.po b/debian/po/eu.po
index 191d92b615e..67e07070a3d 100644
--- a/debian/po/eu.po
+++ b/debian/po/eu.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: eu\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2009-07-29 11:59+0200\n"
"Last-Translator: Piarres Beobide <pi@beobide.net>\n"
@@ -20,13 +20,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -35,7 +35,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -43,20 +43,20 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "NIS/YP erabiltzaileentzat ohar garrantzitsua"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -64,7 +64,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
#, fuzzy
#| msgid ""
#| "You should also check the permissions and the owner of the /var/lib/mysql "
@@ -78,13 +78,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "Ezabatu MariaDB datubase guztiak?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -93,7 +93,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/fi.po b/debian/po/fi.po
index 16e310b8c6a..b787b265ea3 100644
--- a/debian/po/fi.po
+++ b/debian/po/fi.po
@@ -1,11 +1,11 @@
-# Finnish translations for mariadb-10.6 package
-# This file is distributed under the same license as the mariadb-10.6 package.
+# Finnish translations for mariadb-10.7 package
+# This file is distributed under the same license as the mariadb-10.7 package.
# Antti Järvinen <antti.jarvinen@katiska.org>, 2017.
#
msgid ""
msgstr ""
-"Project-Id-Version: mariadb-10.6\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Project-Id-Version: mariadb-10.7\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2017-03-15 22:36+0200\n"
"Last-Translator: antti.jarvinen@katiska.org\n"
@@ -19,13 +19,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr "Vanha datahakemisto tullaan tallentamaan uuteen paikkaan"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -37,7 +37,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -47,7 +47,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
@@ -56,13 +56,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "Merkittävä huomio NIS/YP -käyttäjille"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -72,7 +72,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -80,13 +80,13 @@ msgstr "Tarkista myös hakemiston /var/lib/mysql omistaja ja oikeudet:"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "Poistetaanko kaikki MariaDB-tietokannat?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -95,7 +95,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/fr.po b/debian/po/fr.po
index 1604203696b..ade489bae0f 100644
--- a/debian/po/fr.po
+++ b/debian/po/fr.po
@@ -1,6 +1,6 @@
-# Translation of mariadb-10.6 debconf templates to French
+# Translation of mariadb-10.7 debconf templates to French
# Copyright (C) 2004-2016 Debian French l10n team <debian-l10n-french@lists.debian.org>
-# This file is distributed under the same license as the mariadb-10.6 packages.
+# This file is distributed under the same license as the mariadb-10.7 packages.
#
# Translators:
# Christian Perrier <bubulle@debian.org>, 2004, 2006, 2007, 2009, 2013.
@@ -8,7 +8,7 @@
msgid ""
msgstr ""
"Project-Id-Version: fr\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2016-12-31 18:35+0100\n"
"Last-Translator: Baptiste Jammet <baptiste@mailoo.org>\n"
@@ -23,13 +23,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr "L'ancien répertoire de données sera sauvegardé à un nouvel emplacement"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -41,7 +41,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -51,7 +51,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
@@ -60,13 +60,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "Note importante pour les utilisateurs NIS/YP"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -76,7 +76,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -86,13 +86,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "Faut-il supprimer toutes les bases de données MariaDB ?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -102,7 +102,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/gl.po b/debian/po/gl.po
index d84a745a732..a18097f76cd 100644
--- a/debian/po/gl.po
+++ b/debian/po/gl.po
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: mysql-dfsg-5.1\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2007-04-20 09:44+0200\n"
"Last-Translator: Jacobo Tarrio <jtarrio@debian.org>\n"
@@ -17,13 +17,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -32,7 +32,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -40,20 +40,20 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "Nota importante para os usuarios de NIS/YP"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -61,7 +61,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
#, fuzzy
#| msgid ""
#| "You should also check the permissions and the owner of the /var/lib/mysql "
@@ -75,13 +75,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "¿Eliminar tódalas bases de datos de MariaDB?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -91,7 +91,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/it.po b/debian/po/it.po
index 54b9e980b1c..eeef6960313 100644
--- a/debian/po/it.po
+++ b/debian/po/it.po
@@ -1,11 +1,11 @@
-# Italian (it) translation of debconf templates for mariadb-10.6
-# This file is distributed under the same license as the mariadb-10.6 package.
+# Italian (it) translation of debconf templates for mariadb-10.7
+# This file is distributed under the same license as the mariadb-10.7 package.
# Luca Monducci <luca.mo@tiscali.it>, 2006-2017.
#
msgid ""
msgstr ""
-"Project-Id-Version: mariadb-10.6 10.0.13 Italian debconf templates\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Project-Id-Version: mariadb-10.7 10.0.13 Italian debconf templates\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2017-083-20 20:29+0100\n"
"Last-Translator: Luca Monducci <luca.mo@tiscali.it>\n"
@@ -17,13 +17,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr "La vecchia directory data verrà salvata in una nuova posizione"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -35,7 +35,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -45,7 +45,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
@@ -54,13 +54,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "Nota importante per gli utenti NIS/YP"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -70,7 +70,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -80,13 +80,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "Eliminare tutti i database MariaDB?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -96,7 +96,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/ja.po b/debian/po/ja.po
index c7a3bea42ce..a2a8583843c 100644
--- a/debian/po/ja.po
+++ b/debian/po/ja.po
@@ -15,8 +15,8 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: mariadb-10.6 10.0.32-1\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Project-Id-Version: mariadb-10.7 10.0.32-1\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2016-05-01 11:27+0900\n"
"Last-Translator: Takuma Yamada <tyamada@takumayamada.com>\n"
@@ -30,13 +30,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr "å¤ã„データディレクトリã¯ã€æ–°ã—ã„場所ã«ä¿å­˜ã•ã‚Œã¾ã™"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -48,7 +48,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -58,7 +58,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
@@ -67,13 +67,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "NIS/YP ユーザã¸ã®é‡è¦ãªæ³¨æ„"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -83,7 +83,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -91,13 +91,13 @@ msgstr "/var/lib/mysql ã®æ‰€æœ‰è€…権é™ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹å¿…è¦ã‚‚ã‚ã‚Šã¾
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "ã™ã¹ã¦ã® MariaDB データベースを削除ã—ã¾ã™ã‹?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -107,7 +107,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/nb.po b/debian/po/nb.po
index b11a70c3a0e..a3a9e069486 100644
--- a/debian/po/nb.po
+++ b/debian/po/nb.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: mysql_nb\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2007-02-18 12:13+0100\n"
"Last-Translator: Bjørn Steensrud <bjornst@powertech.no>\n"
@@ -19,13 +19,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -34,7 +34,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -42,14 +42,14 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
#, fuzzy
#| msgid "Important note for NIS/YP users!"
msgid "Important note for NIS/YP users"
@@ -57,7 +57,7 @@ msgstr "Viktig merknad for NIS/YP-brukere!"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -65,7 +65,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -73,13 +73,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -87,7 +87,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
#, fuzzy
#| msgid ""
#| "The script is about to remove the data directory /var/lib/mysql. If it is "
diff --git a/debian/po/nl.po b/debian/po/nl.po
index 90e6ea767bb..00ab55777c6 100644
--- a/debian/po/nl.po
+++ b/debian/po/nl.po
@@ -1,13 +1,13 @@
# Dutch mariadb-10 po-debconf translation,
# Copyright (C) 2006 THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the mariadb-10.6 package.
+# This file is distributed under the same license as the mariadb-10.7 package.
# Vincent Zweije <zweije@xs4all.nl>, 2006.
# Frans Spiesschaert <Frans.Spiesschaert@yucom.be>, 2014, 2016, 2018.
#
msgid ""
msgstr ""
"Project-Id-Version: mariadb-10.2.7-1\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2018-03-29 21:25+0200\n"
"Last-Translator: Frans Spiesschaert <Frans.Spiesschaert@yucom.be>\n"
@@ -21,13 +21,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr "De oude data-map zal op een nieuwe locatie bewaard worden"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -39,7 +39,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -49,7 +49,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
@@ -58,13 +58,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "Belangrijke opmerking voor gebruikers van NIS/YP"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -74,7 +74,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -84,13 +84,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "Wilt u alle MariaDB-databases verwijderen?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -100,7 +100,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/pt.po b/debian/po/pt.po
index 4df8e3540a8..8c7823c8edf 100644
--- a/debian/po/pt.po
+++ b/debian/po/pt.po
@@ -6,8 +6,8 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: mariadb-10.6\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Project-Id-Version: mariadb-10.7\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2017-08-06 10:00+0100\n"
"Last-Translator: Rui Branco <ruipb@debianpt.org>\n"
@@ -20,13 +20,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr "O antigo directório de data será guardado num novo local"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -38,7 +38,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -48,7 +48,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
@@ -57,13 +57,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "Nota importante para os utilizadores de NIS/YP"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -73,7 +73,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -82,13 +82,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "Remover todas as bases de dados MariaDB?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -98,7 +98,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/pt_BR.po b/debian/po/pt_BR.po
index cf8127236e5..d0a4c6db8fe 100644
--- a/debian/po/pt_BR.po
+++ b/debian/po/pt_BR.po
@@ -1,12 +1,12 @@
-# Debconf translations for mariadb-10.6.
-# This file is distributed under the same license as the mariadb-10.6 package.
+# Debconf translations for mariadb-10.7.
+# This file is distributed under the same license as the mariadb-10.7 package.
# André Luís Lopes, <andrelop@debian.org>, 2005-2007.
# Adriano Rafael Gomes <adrianorg@arg.eti.br>, 2015-2016.
#
msgid ""
msgstr ""
-"Project-Id-Version: mariadb-10.6\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Project-Id-Version: mariadb-10.7\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2016-04-30 16:16-0300\n"
"Last-Translator: Adriano Rafael Gomes <adrianorg@arg.eti.br>\n"
@@ -19,13 +19,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr "O diretório de dados antigo será salvo em novo local"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -37,7 +37,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -47,7 +47,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
@@ -56,13 +56,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "Aviso importante para usuários NIS/YP"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -72,7 +72,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -82,13 +82,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "Remover todas as bases de dados do MariaDB?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -98,7 +98,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/ro.po b/debian/po/ro.po
index 869a5efddd2..6fda31dc508 100644
--- a/debian/po/ro.po
+++ b/debian/po/ro.po
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: po-debconf://mysql-dfsg\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2006-12-20 21:27+0200\n"
"Last-Translator: stan ioan-eugen <stan.ieugen@gmail.com>\n"
@@ -19,13 +19,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -34,7 +34,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -42,14 +42,14 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
#, fuzzy
#| msgid "Important note for NIS/YP users!"
msgid "Important note for NIS/YP users"
@@ -57,7 +57,7 @@ msgstr "Notă importantă pentru utilizatorii NIS/YP!"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -65,7 +65,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -73,13 +73,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -87,7 +87,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
#, fuzzy
#| msgid ""
#| "The script is about to remove the data directory /var/lib/mysql. If it is "
diff --git a/debian/po/ru.po b/debian/po/ru.po
index 01152031369..ecdc8e658f7 100644
--- a/debian/po/ru.po
+++ b/debian/po/ru.po
@@ -6,8 +6,8 @@
# Yuri Kozlov <yuray@komyakino.ru>, 2009, 2014, 2016.
msgid ""
msgstr ""
-"Project-Id-Version: mariadb-10.6 10.0.25-1\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Project-Id-Version: mariadb-10.7 10.0.25-1\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2016-05-04 18:56+0300\n"
"Last-Translator: Yuri Kozlov <yuray@komyakino.ru>\n"
@@ -22,13 +22,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr "Каталог Ñо Ñтарыми данными будет Ñохранён в новом меÑте"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -40,7 +40,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -51,7 +51,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
@@ -60,13 +60,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "Важное замечание Ð´Ð»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»ÐµÐ¹ NIS/YP"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -76,7 +76,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -84,13 +84,13 @@ msgstr "Также проверьте права доÑтупа и владелÑ
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "Удалить вÑе базы данных MariaDB?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -99,7 +99,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/sv.po b/debian/po/sv.po
index 0c44b9923df..4ac8f477339 100644
--- a/debian/po/sv.po
+++ b/debian/po/sv.po
@@ -1,13 +1,13 @@
-# Translation of mariadb-10.6 debconf template to Swedish
+# Translation of mariadb-10.7 debconf template to Swedish
# Copyright (C) 2017 Martin Bagge <brother@bsnet.se>
-# This file is distributed under the same license as the mariadb-10.6 package.
+# This file is distributed under the same license as the mariadb-10.7 package.
#
# Andreas Henriksson <andreas@fatal.se>, 2007
# Martin Bagge <brother@bsnet.se>, 2009, 2015, 2017
msgid ""
msgstr ""
"Project-Id-Version: mysql-dfsg-5.1 5.0.21-3\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2017-03-23 09:20+0100\n"
"Last-Translator: Martin Bagge / brother <brother@bsnet.se>\n"
@@ -20,13 +20,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr "Den gamla data-katalogen kommer att sparas till en ny plats"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -38,7 +38,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -48,7 +48,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
@@ -57,13 +57,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "Viktig information för NIS/YP-användare"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -73,7 +73,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -83,13 +83,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "Ta bort alla MariaDB-databaser?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -99,7 +99,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/templates.pot b/debian/po/templates.pot
index 73febcc0174..26d3231f0cd 100644
--- a/debian/po/templates.pot
+++ b/debian/po/templates.pot
@@ -1,13 +1,13 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the mariadb-10.6 package.
+# This file is distributed under the same license as the mariadb-10.7 package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: mariadb-10.6\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Project-Id-Version: mariadb-10.7\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
@@ -19,13 +19,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -34,7 +34,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -42,20 +42,20 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -63,7 +63,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -71,13 +71,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -85,7 +85,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/tr.po b/debian/po/tr.po
index 9d292dad46c..2df83c2b502 100644
--- a/debian/po/tr.po
+++ b/debian/po/tr.po
@@ -5,8 +5,8 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: mariadb-10.6\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Project-Id-Version: mariadb-10.7\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2017-03-16 13:16+0300\n"
"Last-Translator: Atila KOÇ <koc@artielektronik.com.tr>\n"
@@ -20,13 +20,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr "Eski veritabanı dizini yeni konumuna kaydedilecektir"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -38,7 +38,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -48,20 +48,20 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr "Gerektiğinde verinizi elle (ör. mysqldump ile) içe/dışa aktarın."
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "NIS/YP kullanıcıları için önemli not"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -71,7 +71,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -81,13 +81,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "Tüm MariaDB veritabanları kaldırılsın mı?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -96,7 +96,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/po/vi.po b/debian/po/vi.po
index 3aa7e3f3d25..6ff1185b81c 100644
--- a/debian/po/vi.po
+++ b/debian/po/vi.po
@@ -1,12 +1,12 @@
-# Vietnamese translations for mariadb-10.6 package
-# Bản dịch Tiếng Việt dành cho gói mariadb-10.6.
-# This file is distributed under the same license as the mariadb-10.6 package.
+# Vietnamese translations for mariadb-10.7 package
+# Bản dịch Tiếng Việt dành cho gói mariadb-10.7.
+# This file is distributed under the same license as the mariadb-10.7 package.
# Trần Ngá»c Quân <vnwildman@gmail.com>, 2017.
#
msgid ""
msgstr ""
-"Project-Id-Version: mariadb-10.6\n"
-"Report-Msgid-Bugs-To: mariadb-10.6@packages.debian.org\n"
+"Project-Id-Version: mariadb-10.7\n"
+"Report-Msgid-Bugs-To: mariadb-10.7@packages.debian.org\n"
"POT-Creation-Date: 2019-07-23 19:16-0300\n"
"PO-Revision-Date: 2017-03-18 13:32+0700\n"
"Last-Translator: Trần Ngá»c Quân <vnwildman@gmail.com>\n"
@@ -20,13 +20,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid "The old data directory will be saved at new location"
msgstr "Thư mục dữ liệu cũ sẽ được lưu tại vị trí mới"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"A file named /var/lib/mysql/debian-*.flag exists on this system. The number "
"indicates a database binary format version that cannot automatically be "
@@ -38,7 +38,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Therefore the previous data directory will be renamed to /var/lib/mysql-* "
"and a new data directory will be initialized at /var/lib/mysql."
@@ -48,7 +48,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:2001
+#: ../mariadb-server-10.7.templates:2001
msgid ""
"Please manually export/import your data (e.g. with mysqldump) if needed."
msgstr ""
@@ -57,13 +57,13 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid "Important note for NIS/YP users"
msgstr "Chú ý quan trá»ng cho ngÆ°á»i dùng NIS/YP"
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"Using MariaDB under NIS/YP requires a mysql user account to be added on the "
"local system with:"
@@ -73,7 +73,7 @@ msgstr ""
#. Type: note
#. Description
-#: ../mariadb-server-10.6.templates:3001
+#: ../mariadb-server-10.7.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
@@ -82,13 +82,13 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid "Remove all MariaDB databases?"
msgstr "Xóa bá» má»i cÆ¡ sở dữ liệu MariaDB chứ?"
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MariaDB databases is about "
"to be removed."
@@ -98,7 +98,7 @@ msgstr ""
#. Type: boolean
#. Description
-#: ../mariadb-server-10.6.templates:4001
+#: ../mariadb-server-10.7.templates:4001
msgid ""
"If you're removing the MariaDB package in order to later install a more "
"recent version or if a different mariadb-server package is already using it, "
diff --git a/debian/rules b/debian/rules
index aaca566d557..2b30f471ae2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -134,12 +134,12 @@ override_dh_auto_install:
ifneq (,$(filter linux,$(DEB_HOST_ARCH_OS)))
# Copy systemd files to a location available for dh_installinit
- cp $(BUILDDIR)/support-files/mariadb.service debian/mariadb-server-10.6.mariadb.service
- cp $(BUILDDIR)/support-files/mariadb.socket debian/mariadb-server-10.6.mariadb.socket
- cp $(BUILDDIR)/support-files/mariadb-extra.socket debian/mariadb-server-10.6.mariadb-extra.socket
- cp $(BUILDDIR)/support-files/mariadb@.service debian/mariadb-server-10.6.mariadb@.service
- cp $(BUILDDIR)/support-files/mariadb@.socket debian/mariadb-server-10.6.mariadb@.socket
- cp $(BUILDDIR)/support-files/mariadb-extra@.socket debian/mariadb-server-10.6.mariadb-extra@.socket
+ cp $(BUILDDIR)/support-files/mariadb.service debian/mariadb-server-10.7.mariadb.service
+ cp $(BUILDDIR)/support-files/mariadb.socket debian/mariadb-server-10.7.mariadb.socket
+ cp $(BUILDDIR)/support-files/mariadb-extra.socket debian/mariadb-server-10.7.mariadb-extra.socket
+ cp $(BUILDDIR)/support-files/mariadb@.service debian/mariadb-server-10.7.mariadb@.service
+ cp $(BUILDDIR)/support-files/mariadb@.socket debian/mariadb-server-10.7.mariadb@.socket
+ cp $(BUILDDIR)/support-files/mariadb-extra@.socket debian/mariadb-server-10.7.mariadb-extra@.socket
endif
# Run 'make install' without output since it is uninteresting and
@@ -158,7 +158,7 @@ endif
# nm numeric soft is not enough, therefore extra sort in command
# to satisfy Debian reproducible build requirements
- nm --defined-only $(BUILDDIR)/sql/mariadbd | LC_ALL=C sort | gzip -n -9 > $(TMP)/usr/share/doc/mariadb-server-10.6/mariadbd.sym.gz
+ nm --defined-only $(BUILDDIR)/sql/mariadbd | LC_ALL=C sort | gzip -n -9 > $(TMP)/usr/share/doc/mariadb-server-10.7/mariadbd.sym.gz
# Rename and install AppArmor profile
install -D -m 644 debian/apparmor-profile $(TMP)/etc/apparmor.d/usr.sbin.mariadbd
diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml
index 3a69c45ead9..417bad0f70d 100644
--- a/debian/salsa-ci.yml
+++ b/debian/salsa-ci.yml
@@ -213,7 +213,7 @@ fresh install:
script:
- *test-prepare-container
- *test-install
- - service mariadb status # There is no init.d/mysql in MariaDB 10.6
+ - service mariadb status # There is no init.d/mysql in MariaDB 10.7
- *test-verify-final
variables:
GIT_STRATEGY: none
@@ -221,7 +221,7 @@ fresh install:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-mariadb-10.6 Sid upgrade:
+mariadb-10.7 Sid upgrade:
stage: upgrade in Sid
needs:
- job: build
@@ -234,7 +234,7 @@ mariadb-10.6 Sid upgrade:
script:
- *test-prepare-container
- *test-install
- - service mariadb status # There is no init.d/mysql in MariaDB 10.6
+ - service mariadb status # There is no init.d/mysql in MariaDB 10.7
- *test-verify-final
variables:
GIT_STRATEGY: none
@@ -242,7 +242,7 @@ mariadb-10.6 Sid upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-mariadb-10.5 Bullseye to mariadb-10.6 upgrade:
+mariadb-10.5 Bullseye to mariadb-10.7 upgrade:
stage: upgrade from Bullseye/Buster
needs:
- job: build
@@ -268,7 +268,7 @@ mariadb-10.5 Bullseye to mariadb-10.6 upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-mariadb-10.3 Buster to mariadb-10.6 upgrade:
+mariadb-10.3 Buster to mariadb-10.7 upgrade:
stage: upgrade from Bullseye/Buster
needs:
- job: build
@@ -307,7 +307,7 @@ test basic features:
script:
- *test-prepare-container
- *test-install
- - service mariadb status # There is no init.d/mysql in MariaDB 10.6
+ - service mariadb status # There is no init.d/mysql in MariaDB 10.7
- *test-verify-final
- |
# Print info about server
@@ -495,7 +495,7 @@ default-libmysqlclient-dev Buster upgrade:
# Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump.
# The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh.
-mysql-8.0 Sid to mariadb-10.6 upgrade:
+mysql-8.0 Sid to mariadb-10.7 upgrade:
stage: upgrade in Sid
needs:
- job: build
@@ -522,7 +522,7 @@ mysql-8.0 Sid to mariadb-10.6 upgrade:
# Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump.
# The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh.
-mysql-8.0 Focal to mariadb-10.6 upgrade:
+mysql-8.0 Focal to mariadb-10.7 upgrade:
stage: upgrade extras
needs:
- job: build buster-backports
@@ -555,7 +555,7 @@ mysql-8.0 Focal to mariadb-10.6 upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-mariadb.org-10.6 to mariadb-10.6 upgrade:
+mariadb.org-10.6 to mariadb-10.7 upgrade:
stage: upgrade extras
needs:
- job: build
@@ -582,7 +582,7 @@ mariadb.org-10.6 to mariadb-10.6 upgrade:
# Verify installation of MariaDB built in this commit
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- mariadb --version # Client version
- - service mariadb status # There is no init.d/mysql in MariaDB 10.6
+ - service mariadb status # There is no init.d/mysql in MariaDB 10.7
- *test-verify-final
variables:
GIT_STRATEGY: none
@@ -590,12 +590,12 @@ mariadb.org-10.6 to mariadb-10.6 upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
allow_failure: true
- # Installation on Sid fails on missing liburing1 because upstream 10.6
+ # Installation on Sid fails on missing liburing1 because upstream 10.7
# MariaDB.org buildbot has not run 'apt upgrade' for a long time.
- # Remove this allow_failure once buildbot has built a new 10.6
+ # Remove this allow_failure once buildbot has built a new 10.7
# release using latest liburing-dev in Debian Sid.
-mariadb.org-10.5 to mariadb-10.6 upgrade:
+mariadb.org-10.5 to mariadb-10.7 upgrade:
stage: upgrade extras
needs:
- job: build
@@ -625,7 +625,7 @@ mariadb.org-10.5 to mariadb-10.6 upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-mariadb.org-10.4 to mariadb-10.6 upgrade:
+mariadb.org-10.4 to mariadb-10.7 upgrade:
stage: upgrade extras
needs:
- job: build
@@ -658,7 +658,7 @@ mariadb.org-10.4 to mariadb-10.6 upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-mariadb.org-10.3 to mariadb-10.6 upgrade:
+mariadb.org-10.3 to mariadb-10.7 upgrade:
stage: upgrade extras
needs:
- job: build
@@ -689,7 +689,7 @@ mariadb.org-10.3 to mariadb-10.6 upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-mariadb.org-10.2 to mariadb-10.6 upgrade:
+mariadb.org-10.2 to mariadb-10.7 upgrade:
stage: upgrade extras
needs:
- job: build
@@ -728,7 +728,7 @@ mariadb.org-10.2 to mariadb-10.6 upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-mysql.com-5.7 to mariadb-10.6 upgrade:
+mysql.com-5.7 to mariadb-10.7 upgrade:
stage: upgrade extras
needs:
- job: build buster-backports
@@ -759,7 +759,7 @@ mysql.com-5.7 to mariadb-10.6 upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-percona-xtradb-5.7 to mariadb-10.6 upgrade (MDEV-22679):
+percona-xtradb-5.7 to mariadb-10.7 upgrade (MDEV-22679):
stage: upgrade extras
needs:
- job: build buster-backports
diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides
index 4bdd335e409..a0235489fb3 100644
--- a/debian/source/lintian-overrides
+++ b/debian/source/lintian-overrides
@@ -1,24 +1,18 @@
# Necessary for drop-in-place-replacement upgrades on mysql-server/-client
# since package breaks/replaces these but at the same time also provides them
-version-substvar-for-external-package mariadb-client-core-10.6 -> mysql-client-5.5
-version-substvar-for-external-package mariadb-server-10.6 -> mysql-server
-version-substvar-for-external-package mariadb-server-10.6 -> mysql-server
+version-substvar-for-external-package mariadb-client-core-10.7 -> mysql-client-5.5
+version-substvar-for-external-package mariadb-server-10.7 -> mysql-server
version-substvar-for-external-package libmariadb-dev -> libmysqlclient-dev
version-substvar-for-external-package libmariadb-dev -> libmysqld-dev
-version-substvar-for-external-package mariadb-server-10.6 -> mysql-client-5.5
-version-substvar-for-external-package mariadb-server-10.6 -> mysql-client-5.6
-version-substvar-for-external-package mariadb-server-10.6 -> mysql-client-5.7
-version-substvar-for-external-package mariadb-server-10.6 -> mysql-client-8.0
-version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5.1
-version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5.1
-version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5.5
-version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5.5
-version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5.6
-version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5.6
-version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5.7
-version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-5.7
-version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-8.0
-version-substvar-for-external-package mariadb-client-10.6 -> mysql-client-core-8.0
+version-substvar-for-external-package mariadb-server-10.7 -> mysql-client-5.5
+version-substvar-for-external-package mariadb-server-10.7 -> mysql-client-5.6
+version-substvar-for-external-package mariadb-server-10.7 -> mysql-client-5.7
+version-substvar-for-external-package mariadb-server-10.7 -> mysql-client-8.0
+version-substvar-for-external-package mariadb-client-10.7 -> mysql-client-core-5.1
+version-substvar-for-external-package mariadb-client-10.7 -> mysql-client-core-5.5
+version-substvar-for-external-package mariadb-client-10.7 -> mysql-client-core-5.6
+version-substvar-for-external-package mariadb-client-10.7 -> mysql-client-core-5.7
+version-substvar-for-external-package mariadb-client-10.7 -> mysql-client-core-8.0
version-substvar-for-external-package libmariadbd-dev -> libmariadbclient-dev
# ColumnStore not used in Debian, safe to ignore. Reported upstream in https://jira.mariadb.org/browse/MDEV-24124
source-is-missing storage/columnstore/columnstore/utils/jemalloc/libjemalloc.so.2
diff --git a/debian/tests/control b/debian/tests/control
index 68067071c6b..1aae1ecf5bd 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -3,7 +3,12 @@ Tests: smoke
# for its existence (see the list in debian/control), install it if available
# and check in the test if it's functional when it should be.
# The plugin package also already depends on the other one.
-Depends: mariadb-plugin-rocksdb | mariadb-server-10.6
+Depends: mariadb-plugin-rocksdb | mariadb-server-10.7,
+ mariadb-plugin-provider-bzip2,
+ mariadb-plugin-provider-lz4,
+ mariadb-plugin-provider-lzma,
+ mariadb-plugin-provider-lzo,
+ mariadb-plugin-provider-snappy
Restrictions: allow-stderr needs-root isolation-container
Tests: upstream
diff --git a/debian/tests/smoke b/debian/tests/smoke
index e5d50496bdb..9838bb90081 100644
--- a/debian/tests/smoke
+++ b/debian/tests/smoke
@@ -4,7 +4,7 @@
#
# This test should be declared in debian/tests/control with a dependency
# on the package that provides a configured MariaDB server (eg.
-# mariadb-server-10.6).
+# mariadb-server-10.7).
#
# This test should be declared in debian/tests/control with the
# following restrictions:
@@ -38,6 +38,11 @@ else
# If systemd (and systemctl) is available, but the service did not start, then
# this smoke test is supposed to fail if next commands don't work.
echo "Found systemctl, continuing smoke test.."
+ # Compression plugins are separated from main server package
+ # to own packages (for example LZ4 package mariadb-plugin-provider-lz4)
+ # and they are installed after mariadb-server.
+ # which means that they don't exist if MariaDB is not restarted
+ systemctl restart mariadb
fi
mysql <<EOT
@@ -71,10 +76,10 @@ EOT
# but disabled with '#' the options that are not available in this binary build
mariadb <<EOT
SET GLOBAL innodb_compression_algorithm=lz4;
-#SET GLOBAL innodb_compression_algorithm=lzo;
-#SET GLOBAL innodb_compression_algorithm=lzma;
-#SET GLOBAL innodb_compression_algorithm=bzip2;
-#SET GLOBAL innodb_compression_algorithm=snappy;
+SET GLOBAL innodb_compression_algorithm=lzo;
+SET GLOBAL innodb_compression_algorithm=lzma;
+SET GLOBAL innodb_compression_algorithm=bzip2;
+SET GLOBAL innodb_compression_algorithm=snappy;
SET GLOBAL innodb_compression_algorithm=zlib;
SET GLOBAL innodb_compression_algorithm=none;
EOT
@@ -88,7 +93,7 @@ if [ "$(dpkg-architecture -qDEB_HOST_ARCH_BITS)" != 32 ] &&
LOG=/var/lib/mysql/#rocksdb/LOG
# XXX: The server may only be started during the install of
- # mariadb-server-10.6, which happens before that of the plugin.
+ # mariadb-server-10.7, which happens before that of the plugin.
[ -e $LOG ] || mysql -e "INSTALL PLUGIN RocksDB SONAME 'ha_rocksdb';"
# XXX: rocksdb_supported_compression_types variable does not report ZSTD.
diff --git a/extra/comp_err.c b/extra/comp_err.c
index 7dc5cd1921a..2b84f1cbca7 100644
--- a/extra/comp_err.c
+++ b/extra/comp_err.c
@@ -440,7 +440,7 @@ static void clean_up(struct languages *lang_head, struct errors *error_head)
{
struct languages *tmp_lang, *next_language;
struct errors *tmp_error, *next_error;
- uint count, i;
+ size_t count, i;
if (default_language_changed)
my_free((void*) default_language);
@@ -724,7 +724,7 @@ static struct message *find_message(struct errors *err, const char *lang,
my_bool no_default)
{
struct message *tmp, *return_val= 0;
- uint i, count;
+ size_t i, count;
DBUG_ENTER("find_message");
count= (err->msg).elements;
diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc
index 4dc65c8d9bc..82b88f7072d 100644
--- a/extra/innochecksum.cc
+++ b/extra/innochecksum.cc
@@ -76,7 +76,7 @@ static my_bool per_page_details;
static ulint n_merge;
static ulint physical_page_size; /* Page size in bytes on disk. */
ulong srv_page_size;
-ulong srv_page_size_shift;
+uint32_t srv_page_size_shift;
/* Current page number (0 based). */
uint32_t cur_page_num;
/* Current space. */
@@ -263,14 +263,14 @@ static void init_page_size(const byte* buf)
+ FSP_SPACE_FLAGS);
if (fil_space_t::full_crc32(flags)) {
- const ulong ssize = FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(flags);
+ const uint32_t ssize = FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(flags);
srv_page_size_shift = UNIV_ZIP_SIZE_SHIFT_MIN - 1 + ssize;
srv_page_size = 512U << ssize;
physical_page_size = srv_page_size;
return;
}
- const ulong ssize = FSP_FLAGS_GET_PAGE_SSIZE(flags);
+ const uint32_t ssize = FSP_FLAGS_GET_PAGE_SSIZE(flags);
srv_page_size_shift = ssize
? UNIV_ZIP_SIZE_SHIFT_MIN - 1 + ssize
@@ -434,12 +434,7 @@ static bool is_page_all_zeroes(
with crypt_scheme encrypted
@param[in] flags tablespace flags
@retval true if page is corrupted otherwise false. */
-static
-bool
-is_page_corrupted(
- byte* buf,
- bool is_encrypted,
- ulint flags)
+static bool is_page_corrupted(byte *buf, bool is_encrypted, uint32_t flags)
{
/* enable if page is corrupted. */
@@ -596,7 +591,7 @@ Rewrite the checksum for the page.
@retval false : skip the rewrite as checksum stored match with
calculated or page is doublwrite buffer.
*/
-static bool update_checksum(byte* page, ulint flags)
+static bool update_checksum(byte* page, uint32_t flags)
{
ib_uint32_t checksum = 0;
byte stored1[4]; /* get FIL_PAGE_SPACE_OR_CHKSUM field checksum */
@@ -705,7 +700,7 @@ write_file(
const char* filename,
FILE* file,
byte* buf,
- ulint flags,
+ uint32_t flags,
fpos_t* pos)
{
bool do_update;
@@ -1373,7 +1368,7 @@ static int verify_checksum(
byte* buf,
bool is_encrypted,
unsigned long long* mismatch_count,
- ulint flags)
+ uint32_t flags)
{
int exit_status = 0;
if (is_page_corrupted(buf, is_encrypted, flags)) {
@@ -1414,7 +1409,7 @@ rewrite_checksum(
byte* buf,
fpos_t* pos,
bool is_encrypted,
- ulint flags)
+ uint32_t flags)
{
bool is_compressed = fil_space_t::is_compressed(flags);
@@ -1583,7 +1578,7 @@ int main(
from fsp_flags and encryption metadata from page 0 */
init_page_size(buf);
- ulint flags = mach_read_from_4(FSP_HEADER_OFFSET + FSP_SPACE_FLAGS + buf);
+ uint32_t flags = mach_read_from_4(FSP_HEADER_OFFSET + FSP_SPACE_FLAGS + buf);
if (physical_page_size == UNIV_ZIP_SIZE_MIN) {
partial_page_read = false;
diff --git a/extra/mariabackup/CMakeLists.txt b/extra/mariabackup/CMakeLists.txt
index a7a35c58ac3..afb172dbbaa 100644
--- a/extra/mariabackup/CMakeLists.txt
+++ b/extra/mariabackup/CMakeLists.txt
@@ -67,7 +67,7 @@ MYSQL_ADD_EXECUTABLE(mariadb-backup
xbstream_write.cc
backup_mysql.cc
backup_copy.cc
- encryption_plugin.cc
+ xb_plugin.cc
${PROJECT_BINARY_DIR}/sql/sql_builtin.cc
${PROJECT_SOURCE_DIR}/sql/net_serv.cc
${PROJECT_SOURCE_DIR}/libmysqld/libmysql.c
diff --git a/extra/mariabackup/backup_mysql.cc b/extra/mariabackup/backup_mysql.cc
index e1dedc70415..2065711b9c2 100644
--- a/extra/mariabackup/backup_mysql.cc
+++ b/extra/mariabackup/backup_mysql.cc
@@ -54,7 +54,7 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
#include "backup_copy.h"
#include "backup_mysql.h"
#include "mysqld.h"
-#include "encryption_plugin.h"
+#include "xb_plugin.h"
#include <sstream>
#include <sql_error.h>
#include "page0zip.h"
@@ -523,7 +523,8 @@ bool get_mysql_vars(MYSQL *connection)
if (innodb_undo_tablespaces_var)
{
- srv_undo_tablespaces= strtoul(innodb_undo_tablespaces_var, &endptr, 10);
+ srv_undo_tablespaces= static_cast<uint32_t>
+ (strtoul(innodb_undo_tablespaces_var, &endptr, 10));
ut_ad(*endptr == 0);
}
@@ -1995,7 +1996,7 @@ bool write_backup_config_file()
"innodb_log_file_size=%llu\n"
"innodb_page_size=%lu\n"
"innodb_undo_directory=%s\n"
- "innodb_undo_tablespaces=%lu\n"
+ "innodb_undo_tablespaces=%u\n"
"innodb_compression_level=%u\n"
"%s%s\n"
"%s\n",
@@ -2010,7 +2011,7 @@ bool write_backup_config_file()
"innodb_buffer_pool_filename=" : "",
innobase_buffer_pool_filename ?
innobase_buffer_pool_filename : "",
- encryption_plugin_get_config());
+ xb_plugin_get_config());
return rc;
}
diff --git a/extra/mariabackup/common.h b/extra/mariabackup/common.h
index beb49524608..4a4cfd39d58 100644
--- a/extra/mariabackup/common.h
+++ b/extra/mariabackup/common.h
@@ -149,10 +149,9 @@ static inline ATTRIBUTE_FORMAT(printf, 1,2) ATTRIBUTE_NORETURN void die(const ch
/***********************************************************************
Computes bit shift for a given value. If the argument is not a power
of 2, returns 0.*/
-static inline size_t
-get_bit_shift(size_t value)
+static inline unsigned get_bit_shift(size_t value)
{
- size_t shift;
+ unsigned shift;
if (value == 0)
return 0;
diff --git a/extra/mariabackup/ds_local.cc b/extra/mariabackup/ds_local.cc
index ddaa213491d..4c3016ec8f7 100644
--- a/extra/mariabackup/ds_local.cc
+++ b/extra/mariabackup/ds_local.cc
@@ -181,8 +181,8 @@ static void init_ibd_data(ds_local_file_t *local_file, const uchar *buf, size_t
return;
}
- ulint flags = mach_read_from_4(&buf[FIL_PAGE_DATA + FSP_SPACE_FLAGS]);
- ulint ssize = FSP_FLAGS_GET_PAGE_SSIZE(flags);
+ auto flags = mach_read_from_4(&buf[FIL_PAGE_DATA + FSP_SPACE_FLAGS]);
+ auto ssize = FSP_FLAGS_GET_PAGE_SSIZE(flags);
local_file->pagesize= ssize == 0 ? UNIV_PAGE_SIZE_ORIG : ((UNIV_ZIP_SIZE_MIN >> 1) << ssize);
local_file->compressed = fil_space_t::full_crc32(flags)
? fil_space_t::is_compressed(flags)
diff --git a/extra/mariabackup/encryption_plugin.h b/extra/mariabackup/encryption_plugin.h
deleted file mode 100644
index 16d74790254..00000000000
--- a/extra/mariabackup/encryption_plugin.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <mysql.h>
-#include <string>
-extern void encryption_plugin_backup_init(MYSQL *mysql);
-extern const char* encryption_plugin_get_config();
-extern void encryption_plugin_prepare_init(int argc, char **argv);
-
-//extern void encryption_plugin_init(int argc, char **argv);
diff --git a/extra/mariabackup/fil_cur.cc b/extra/mariabackup/fil_cur.cc
index 824fb4f4232..37d2fc5972d 100644
--- a/extra/mariabackup/fil_cur.cc
+++ b/extra/mariabackup/fil_cur.cc
@@ -232,8 +232,8 @@ xb_fil_cur_open(
mysql_mutex_unlock(&fil_system.mutex);
}
- cursor->space_size = (ulint)(cursor->statinfo.st_size
- / cursor->page_size);
+ cursor->space_size = uint32_t(cursor->statinfo.st_size
+ / cursor->page_size);
cursor->read_filter = read_filter;
cursor->read_filter->init(&cursor->read_filter_ctxt, cursor,
@@ -441,8 +441,8 @@ read_retry:
"corrupted.%s", cursor->abs_path, ignore_corruption_warn);
ut_print_buf(stderr, page, page_size);
if (opt_log_innodb_page_corruption) {
- corrupted_pages.add_page(cursor->node->name, cursor->node->space->id,
- page_no);
+ corrupted_pages.add_page(cursor->node->name,
+ {cursor->node->space->id, page_no});
retry_count = 1;
}
else {
@@ -465,8 +465,9 @@ read_retry:
unsigned corrupted_page_no =
static_cast<unsigned>(strtoul(dbug_val, NULL, 10));
if (page_no == corrupted_page_no)
- corrupted_pages.add_page(cursor->node->name, cursor->node->space->id,
- corrupted_page_no);
+ corrupted_pages.add_page(cursor->node->name,
+ {cursor->node->space->id,
+ corrupted_page_no});
});
cursor->buf_read += page_size;
cursor->buf_npages++;
diff --git a/extra/mariabackup/fil_cur.h b/extra/mariabackup/fil_cur.h
index 0027b7768e9..6b868bf3edd 100644
--- a/extra/mariabackup/fil_cur.h
+++ b/extra/mariabackup/fil_cur.h
@@ -56,8 +56,8 @@ struct xb_fil_cur_t {
unsigned buf_page_no; /*!< number of the first page in
buffer */
uint thread_n; /*!< thread number for diagnostics */
- ulint space_id; /*!< ID of tablespace */
- ulint space_size; /*!< space size in pages */
+ uint32_t space_id; /*!< ID of tablespace */
+ uint32_t space_size; /*!< space size in pages */
/** @return whether this is not a file-per-table tablespace */
bool is_system() const
diff --git a/extra/mariabackup/read_filt.h b/extra/mariabackup/read_filt.h
index 2cd52d3d581..51150705367 100644
--- a/extra/mariabackup/read_filt.h
+++ b/extra/mariabackup/read_filt.h
@@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
#include "changed_page_bitmap.h"
-typedef ulint space_id_t;
+typedef uint32_t space_id_t;
struct xb_fil_cur_t;
diff --git a/extra/mariabackup/write_filt.cc b/extra/mariabackup/write_filt.cc
index 8339286e1df..01e4d83e344 100644
--- a/extra/mariabackup/write_filt.cc
+++ b/extra/mariabackup/write_filt.cc
@@ -124,8 +124,8 @@ wf_incremental_process(xb_write_filt_ctxt_t *ctxt, ds_file_t *dstfile)
i++, page += page_size) {
if ((!cp->corrupted_pages ||
- !cp->corrupted_pages->contains(cursor->node->space->id,
- cursor->buf_page_no + i)) &&
+ !cp->corrupted_pages->contains({cursor->node->space->id,
+ cursor->buf_page_no + i})) &&
incremental_lsn >= mach_read_from_8(page + FIL_PAGE_LSN))
continue;
diff --git a/extra/mariabackup/encryption_plugin.cc b/extra/mariabackup/xb_plugin.cc
index dbaa67e1324..3384e1c07e5 100644
--- a/extra/mariabackup/encryption_plugin.cc
+++ b/extra/mariabackup/xb_plugin.cc
@@ -17,7 +17,7 @@
#include <mysqld.h>
#include <mysql.h>
#include <xtrabackup.h>
-#include <encryption_plugin.h>
+#include <xb_plugin.h>
#include <sql_plugin.h>
#include <sstream>
#include <vector>
@@ -28,7 +28,7 @@
extern struct st_maria_plugin *mysql_optional_plugins[];
extern struct st_maria_plugin *mysql_mandatory_plugins[];
-static void encryption_plugin_init(int argc, char **argv);
+static void xb_plugin_init(int argc, char **argv);
extern char *xb_plugin_load;
extern char *xb_plugin_dir;
@@ -39,9 +39,10 @@ std::vector<std::string> backup_plugins_args;
const char *QUERY_PLUGIN =
"SELECT plugin_name, plugin_library, @@plugin_dir"
" FROM information_schema.plugins WHERE plugin_type='ENCRYPTION'"
+" OR (plugin_type = 'DAEMON' AND plugin_name LIKE 'provider\\_%')"
" AND plugin_status='ACTIVE'";
-std::string encryption_plugin_config;
+std::string xb_plugin_config;
static void add_to_plugin_load_list(const char *plugin_def)
{
@@ -51,16 +52,16 @@ static void add_to_plugin_load_list(const char *plugin_def)
static char XTRABACKUP_EXE[] = "xtrabackup";
/*
- Read "plugin-load" value (encryption plugin) from backup-my.cnf during
- prepare phase.
+ Read "plugin-load" value from backup-my.cnf during prepare phase.
The value is stored during backup phase.
*/
-static std::string get_encryption_plugin_from_cnf()
+static std::string get_plugin_from_cnf(const char *dir)
{
- FILE *f = fopen("backup-my.cnf", "r");
+ std::string path = dir + std::string("/backup-my.cnf");
+ FILE *f = fopen(path.c_str(), "r");
if (!f)
{
- die("Can't open backup-my.cnf for reading");
+ die("Can't open %s for reading", path.c_str());
}
char line[512];
std::string plugin_load;
@@ -79,82 +80,90 @@ static std::string get_encryption_plugin_from_cnf()
}
-void encryption_plugin_backup_init(MYSQL *mysql)
+void xb_plugin_backup_init(MYSQL *mysql)
{
MYSQL_RES *result;
MYSQL_ROW row;
std::ostringstream oss;
char *argv[PLUGIN_MAX_ARGS];
+ char show_query[1024] = "";
+ std::string plugin_load;
int argc;
result = xb_mysql_query(mysql, QUERY_PLUGIN, true, true);
- row = mysql_fetch_row(result);
- if (!row)
+ while ((row = mysql_fetch_row(result)))
{
- mysql_free_result(result);
- return;
- }
-
- char *name= row[0];
- char *library= row[1];
- char *dir= row[2];
+ char *name= row[0];
+ char *library= row[1];
+ char *dir= row[2];
+ if (!plugin_load.length())
+ {
#ifdef _WIN32
- for (char *p = dir; *p; p++)
- if (*p == '\\') *p = '/';
+ for (char *p = dir; *p; p++)
+ if (*p == '\\') *p = '/';
#endif
+ strncpy(opt_plugin_dir, dir, FN_REFLEN - 1);
+ opt_plugin_dir[FN_REFLEN - 1] = '\0';
+ oss << "plugin_dir=" << '"' << dir << '"' << std::endl;
+ }
- std::string plugin_load(name);
- if (library)
- {
- /* Remove shared library suffixes, in case we'll prepare on different OS.*/
- const char *extensions[] = { ".dll", ".so", 0 };
- for (size_t i = 0; extensions[i]; i++)
+ plugin_load += std::string(";") + name;
+
+ if (library)
{
- const char *ext = extensions[i];
- if (ends_with(library, ext))
- library[strlen(library) - strlen(ext)] = 0;
+ /* Remove shared library suffixes, in case we'll prepare on different OS.*/
+ const char *extensions[] = { ".dll", ".so", 0 };
+ for (size_t i = 0; extensions[i]; i++)
+ {
+ const char *ext = extensions[i];
+ if (ends_with(library, ext))
+ library[strlen(library) - strlen(ext)] = 0;
+ }
+ plugin_load += std::string("=") + library;
}
- plugin_load += std::string("=") + library;
- }
- oss << "plugin_load=" << plugin_load << std::endl;
+ if (strncmp(name, "provider_", 9) == 0)
+ continue;
- /* Required to load the plugin later.*/
- add_to_plugin_load_list(plugin_load.c_str());
- strncpy(opt_plugin_dir, dir, FN_REFLEN - 1);
- opt_plugin_dir[FN_REFLEN - 1] = '\0';
+ /* Read plugin variables. */
+ snprintf(show_query, sizeof(show_query), "SHOW variables like '%s_%%'", name);
+ }
+ mysql_free_result(result);
+ if (!plugin_load.length())
+ return;
- oss << "plugin_dir=" << '"' << dir << '"' << std::endl;
+ oss << "plugin_load=" << plugin_load.c_str() + 1 << std::endl;
+ /* Required to load the plugin later.*/
+ add_to_plugin_load_list(plugin_load.c_str() + 1);
- /* Read plugin variables. */
- char query[1024];
- snprintf(query, 1024, "SHOW variables like '%s_%%'", name);
- mysql_free_result(result);
- result = xb_mysql_query(mysql, query, true, true);
- while ((row = mysql_fetch_row(result)))
+ if (*show_query)
{
- std::string arg("--");
- arg += row[0];
- arg += "=";
- arg += row[1];
- backup_plugins_args.push_back(arg);
- oss << row[0] << "=" << row[1] << std::endl;
- }
+ result = xb_mysql_query(mysql, show_query, true, true);
+ while ((row = mysql_fetch_row(result)))
+ {
+ std::string arg("--");
+ arg += row[0];
+ arg += "=";
+ arg += row[1];
+ backup_plugins_args.push_back(arg);
+ oss << row[0] << "=" << row[1] << std::endl;
+ }
- mysql_free_result(result);
+ mysql_free_result(result);
- /* Check whether to encrypt logs. */
- result = xb_mysql_query(mysql, "select @@innodb_encrypt_log", true, true);
- row = mysql_fetch_row(result);
- srv_encrypt_log = (row != 0 && row[0][0] == '1');
- oss << "innodb_encrypt_log=" << row[0] << std::endl;
+ /* Check whether to encrypt logs. */
+ result = xb_mysql_query(mysql, "select @@innodb_encrypt_log", true, true);
+ row = mysql_fetch_row(result);
+ srv_encrypt_log = (row != 0 && row[0][0] == '1');
+ oss << "innodb_encrypt_log=" << row[0] << std::endl;
- mysql_free_result(result);
+ mysql_free_result(result);
+ }
- encryption_plugin_config = oss.str();
+ xb_plugin_config = oss.str();
argc = 0;
argv[argc++] = XTRABACKUP_EXE;
@@ -166,23 +175,23 @@ void encryption_plugin_backup_init(MYSQL *mysql)
}
argv[argc] = 0;
- encryption_plugin_init(argc, argv);
+ xb_plugin_init(argc, argv);
}
-const char *encryption_plugin_get_config()
+const char *xb_plugin_get_config()
{
- return encryption_plugin_config.c_str();
+ return xb_plugin_config.c_str();
}
extern int finalize_encryption_plugin(st_plugin_int *plugin);
-void encryption_plugin_prepare_init(int argc, char **argv)
+void xb_plugin_prepare_init(int argc, char **argv, const char *dir)
{
- std::string plugin_load= get_encryption_plugin_from_cnf();
+ std::string plugin_load= get_plugin_from_cnf(dir ? dir : ".");
if (plugin_load.size())
{
- msg("Loading encryption plugin from %s", plugin_load.c_str());
+ msg("Loading plugins from %s", plugin_load.c_str());
}
else
{
@@ -198,23 +207,23 @@ void encryption_plugin_prepare_init(int argc, char **argv)
opt_plugin_dir[FN_REFLEN - 1] = '\0';
}
- char **new_argv = new char *[argc + 1];
+ char **new_argv = new char *[argc + 2];
new_argv[0] = XTRABACKUP_EXE;
memcpy(&new_argv[1], argv, argc*sizeof(char *));
- encryption_plugin_init(argc+1, new_argv);
+ xb_plugin_init(argc+1, new_argv);
delete[] new_argv;
}
-static void encryption_plugin_init(int argc, char **argv)
+static void xb_plugin_init(int argc, char **argv)
{
/* Patch optional and mandatory plugins, we only need to load the one in xb_plugin_load. */
mysql_optional_plugins[0] = mysql_mandatory_plugins[0] = 0;
plugin_maturity = MariaDB_PLUGIN_MATURITY_UNKNOWN; /* mariabackup accepts all plugins */
- msg("Loading encryption plugin");
+ msg("Loading plugins");
for (int i= 1; i < argc; i++)
- msg("\t Encryption plugin parameter : '%s'", argv[i]);
+ msg("\t Plugin parameter : '%s'", argv[i]);
plugin_init(&argc, argv, PLUGIN_INIT_SKIP_PLUGIN_TABLE);
}
diff --git a/extra/mariabackup/xb_plugin.h b/extra/mariabackup/xb_plugin.h
new file mode 100644
index 00000000000..fea24b6b052
--- /dev/null
+++ b/extra/mariabackup/xb_plugin.h
@@ -0,0 +1,5 @@
+#include <mysql.h>
+#include <string>
+extern void xb_plugin_backup_init(MYSQL *mysql);
+extern const char* xb_plugin_get_config();
+extern void xb_plugin_prepare_init(int argc, char **argv, const char *dir);
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index adb13a7c119..06c4eccd3d6 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -107,7 +107,7 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
#include "backup_mysql.h"
#include "backup_copy.h"
#include "backup_mysql.h"
-#include "encryption_plugin.h"
+#include "xb_plugin.h"
#include <sql_plugin.h>
#include <srv0srv.h>
#include <log.h>
@@ -419,45 +419,45 @@ CorruptedPages::CorruptedPages() { ut_a(!pthread_mutex_init(&m_mutex, NULL)); }
CorruptedPages::~CorruptedPages() { ut_a(!pthread_mutex_destroy(&m_mutex)); }
-void CorruptedPages::add_page_no_lock(const char *space_name, ulint space_id,
- unsigned page_no,
+void CorruptedPages::add_page_no_lock(const char *space_name,
+ page_id_t page_id,
bool convert_space_name)
{
- space_info_t &space_info = m_spaces[space_id];
+ space_info_t &space_info = m_spaces[page_id.space()];
if (space_info.space_name.empty())
space_info.space_name= convert_space_name
? filename_to_spacename(space_name, strlen(space_name))
: space_name;
- (void)space_info.pages.insert(page_no);
+ (void)space_info.pages.insert(page_id.page_no());
}
-void CorruptedPages::add_page(const char *file_name, ulint space_id,
- unsigned page_no)
+void CorruptedPages::add_page(const char *file_name, page_id_t page_id)
{
- ut_a(!pthread_mutex_lock(&m_mutex));
- add_page_no_lock(file_name, space_id, page_no, true);
- ut_a(!pthread_mutex_unlock(&m_mutex));
+ pthread_mutex_lock(&m_mutex);
+ add_page_no_lock(file_name, page_id, true);
+ pthread_mutex_unlock(&m_mutex);
}
-bool CorruptedPages::contains(ulint space_id, unsigned page_no) const
+bool CorruptedPages::contains(page_id_t page_id) const
{
bool result = false;
ut_a(!pthread_mutex_lock(&m_mutex));
- container_t::const_iterator space_it= m_spaces.find(space_id);
+ container_t::const_iterator space_it= m_spaces.find(page_id.space());
if (space_it != m_spaces.end())
- result = space_it->second.pages.count(page_no);
+ result = space_it->second.pages.count(page_id.page_no());
ut_a(!pthread_mutex_unlock(&m_mutex));
return result;
}
-void CorruptedPages::drop_space(ulint space_id)
+void CorruptedPages::drop_space(uint32_t space_id)
{
ut_a(!pthread_mutex_lock(&m_mutex));
m_spaces.erase(space_id);
ut_a(!pthread_mutex_unlock(&m_mutex));
}
-void CorruptedPages::rename_space(ulint space_id, const std::string &new_name)
+void CorruptedPages::rename_space(uint32_t space_id,
+ const std::string &new_name)
{
ut_a(!pthread_mutex_lock(&m_mutex));
container_t::iterator space_it = m_spaces.find(space_id);
@@ -518,7 +518,7 @@ void CorruptedPages::read_from_file(const char *file_name)
strerror(errno));
std::string line;
std::string space_name;
- ulint space_id;
+ uint32_t space_id;
ulint line_number= 0;
while (std::getline(infile, line))
{
@@ -538,7 +538,7 @@ void CorruptedPages::read_from_file(const char *file_name)
std::istringstream iss(line);
unsigned page_no;
while ((iss >> page_no))
- add_page_no_lock(space_name.c_str(), space_id, page_no, false);
+ add_page_no_lock(space_name.c_str(), {space_id, page_no}, false);
if (!iss.eof())
die("Corrupted pages file parse error on line number " ULINTPF,
line_number);
@@ -556,7 +556,7 @@ bool CorruptedPages::empty() const
static void xb_load_single_table_tablespace(const std::string &space_name,
bool set_size,
- ulint defer_space_id=0);
+ uint32_t defer_space_id=0);
static void xb_data_files_close();
static fil_space_t* fil_space_get_by_name(const char* name);
@@ -571,7 +571,7 @@ void CorruptedPages::zero_out_free_pages()
for (container_t::const_iterator space_it= m_spaces.begin();
space_it != m_spaces.end(); ++space_it)
{
- ulint space_id = space_it->first;
+ uint32_t space_id = space_it->first;
const std::string &space_name = space_it->second.space_name;
// There is no need to close tablespaces explixitly as they will be closed
// in innodb_shutdown().
@@ -634,7 +634,7 @@ typedef void (*process_single_tablespace_func_t)(const char *dirname,
const char *filname,
bool is_remote,
bool skip_node_page0,
- ulint defer_space_id);
+ uint32_t defer_space_id);
static dberr_t enumerate_ibd_files(process_single_tablespace_func_t callback);
/* ======== Datafiles iterator ======== */
@@ -824,7 +824,7 @@ static std::string filename_to_spacename(const void *filename, size_t len)
@param[in] len length of name, in bytes
@param[in] new_name new file name (NULL if not rename)
@param[in] new_len length of new_name, in bytes (0 if NULL) */
-static void backup_file_op(ulint space_id, int type,
+static void backup_file_op(uint32_t space_id, int type,
const byte* name, ulint len,
const byte* new_name, ulint new_len)
{
@@ -840,13 +840,13 @@ static void backup_file_op(ulint space_id, int type,
std::string space_name = filename_to_spacename(name, len);
ddl_tracker.id_to_name[space_id] = space_name;
ddl_tracker.delete_defer(space_id, space_name);
- msg("DDL tracking : create %zu \"%.*s\"", space_id, int(len), name);
+ msg("DDL tracking : create %u \"%.*s\"", space_id, int(len), name);
}
break;
case FILE_MODIFY:
ddl_tracker.insert_defer_id(
space_id, filename_to_spacename(name, len));
- msg("DDL tracking : modify %zu \"%.*s\"", space_id, int(len), name);
+ msg("DDL tracking : modify %u \"%.*s\"", space_id, int(len), name);
break;
case FILE_RENAME:
{
@@ -857,7 +857,7 @@ static void backup_file_op(ulint space_id, int type,
ddl_tracker.id_to_name[space_id] = new_space_name;
ddl_tracker.rename_defer(space_id, old_space_name,
new_space_name);
- msg("DDL tracking : rename %zu \"%.*s\",\"%.*s\"",
+ msg("DDL tracking : rename %u \"%.*s\",\"%.*s\"",
space_id, int(len), name, int(new_len), new_name);
}
break;
@@ -865,7 +865,7 @@ static void backup_file_op(ulint space_id, int type,
ddl_tracker.drops.insert(space_id);
ddl_tracker.delete_defer(
space_id, filename_to_spacename(name, len));
- msg("DDL tracking : delete %zu \"%.*s\"", space_id, int(len), name);
+ msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name);
break;
default:
ut_ad(0);
@@ -884,22 +884,22 @@ static void backup_file_op(ulint space_id, int type,
We will abort backup in this case.
*/
-static void backup_file_op_fail(ulint space_id, int type,
+static void backup_file_op_fail(uint32_t space_id, int type,
const byte* name, ulint len,
const byte* new_name, ulint new_len)
{
bool fail = false;
switch(type) {
case FILE_CREATE:
- msg("DDL tracking : create %zu \"%.*s\"", space_id, int(len), name);
+ msg("DDL tracking : create %u \"%.*s\"", space_id, int(len), name);
fail = !check_if_skip_table(
filename_to_spacename(name, len).c_str());
break;
case FILE_MODIFY:
- msg("DDL tracking : modify %zu \"%.*s\"", space_id, int(len), name);
+ msg("DDL tracking : modify %u \"%.*s\"", space_id, int(len), name);
break;
case FILE_RENAME:
- msg("DDL tracking : rename %zu \"%.*s\",\"%.*s\"",
+ msg("DDL tracking : rename %u \"%.*s\",\"%.*s\"",
space_id, int(len), name, int(new_len), new_name);
fail = !check_if_skip_table(
filename_to_spacename(name, len).c_str())
@@ -909,7 +909,7 @@ static void backup_file_op_fail(ulint space_id, int type,
case FILE_DELETE:
fail = !check_if_skip_table(
filename_to_spacename(name, len).c_str());
- msg("DDL tracking : delete %zu \"%.*s\"", space_id, int(len), name);
+ msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name);
break;
default:
ut_ad(0);
@@ -925,7 +925,7 @@ static void backup_file_op_fail(ulint space_id, int type,
/* Function to store the space id of page0 INIT_PAGE
@param space_id space id which has page0 init page */
-static void backup_first_page_op(ulint space_id)
+static void backup_first_page_op(space_id_t space_id)
{
first_page_init_ids.insert(space_id);
}
@@ -1652,7 +1652,7 @@ struct my_option xb_server_options[] =
{"innodb_undo_tablespaces", OPT_INNODB_UNDO_TABLESPACES,
"Number of undo tablespaces to use.",
(G_PTR*)&srv_undo_tablespaces, (G_PTR*)&srv_undo_tablespaces,
- 0, GET_ULONG, REQUIRED_ARG, 0, 0, 126, 0, 1, 0},
+ 0, GET_UINT, REQUIRED_ARG, 0, 0, 126, 0, 1, 0},
{"innodb_compression_level", OPT_INNODB_COMPRESSION_LEVEL,
"Compression level used for zlib compression.",
@@ -1664,10 +1664,10 @@ struct my_option xb_server_options[] =
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"plugin-dir", OPT_PLUGIN_DIR,
- "Server plugin directory. Used to load encryption plugin during 'prepare' phase."
- "Has no effect in the 'backup' phase (plugin directory during backup is the same as server's)",
- &xb_plugin_dir, &xb_plugin_dir,
- 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
+ "Server plugin directory. Used to load plugins during 'prepare' phase."
+ "Has no effect in the 'backup' phase (plugin directory during backup is the same as server's)",
+ &xb_plugin_dir, &xb_plugin_dir,
+ 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{"open_files_limit", OPT_OPEN_FILES_LIMIT, "the maximum number of file "
"descriptors to reserve with setrlimit().",
@@ -1723,7 +1723,7 @@ static std::set<std::string> tables_for_export;
static void append_export_table(const char *dbname, const char *tablename,
bool is_remote, bool skip_node_page0,
- ulint defer_space_id)
+ uint32_t defer_space_id)
{
if(dbname && tablename && !is_remote)
{
@@ -2059,7 +2059,7 @@ static bool innodb_init_param()
size_t n_shift = get_bit_shift(size_t(innobase_page_size));
if (n_shift >= 12 && n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX) {
- srv_page_size_shift = ulong(n_shift);
+ srv_page_size_shift = uint32_t(n_shift);
srv_page_size = 1U << n_shift;
msg("InnoDB: The universal page size of the "
"database is set to %lu.", srv_page_size);
@@ -2413,7 +2413,7 @@ xb_read_delta_metadata(const char *filepath, xb_delta_info_t *info)
/* set defaults */
ulint page_size = ULINT_UNDEFINED, zip_size = 0;
- info->space_id = ULINT_UNDEFINED;
+ info->space_id = UINT32_MAX;
fp = fopen(filepath, "r");
if (!fp) {
@@ -2428,7 +2428,8 @@ xb_read_delta_metadata(const char *filepath, xb_delta_info_t *info)
} else if (strcmp(key, "zip_size") == 0) {
zip_size = strtoul(value, NULL, 10);
} else if (strcmp(key, "space_id") == 0) {
- info->space_id = strtoul(value, NULL, 10);
+ info->space_id = static_cast<uint32_t>
+ (strtoul(value, NULL, 10));
}
}
}
@@ -2442,7 +2443,7 @@ xb_read_delta_metadata(const char *filepath, xb_delta_info_t *info)
info->page_size = zip_size ? zip_size : page_size;
}
- if (info->space_id == ULINT_UNDEFINED) {
+ if (info->space_id == UINT32_MAX) {
msg("mariabackup: Warning: This backup was taken with XtraBackup 2.0.1 "
"or earlier, some DDL operations between full and incremental "
"backups may be handled incorrectly");
@@ -2466,7 +2467,7 @@ xb_write_delta_metadata(const char *filename, const xb_delta_info_t *info)
snprintf(buf, sizeof(buf),
"page_size = " ULINTPF "\n"
"zip_size = " ULINTPF " \n"
- "space_id = " ULINTPF "\n",
+ "space_id = %u\n",
info->page_size,
info->zip_size,
info->space_id);
@@ -3331,7 +3332,7 @@ static void xb_load_single_table_tablespace(const char *dirname,
const char *filname,
bool is_remote,
bool skip_node_page0,
- ulint defer_space_id)
+ uint32_t defer_space_id)
{
ut_ad(srv_operation == SRV_OPERATION_BACKUP
|| srv_operation == SRV_OPERATION_RESTORE_DELTA
@@ -3428,7 +3429,8 @@ static void xb_load_single_table_tablespace(const char *dirname,
0, false, false);
node->deferred= defer;
mysql_mutex_lock(&fil_system.mutex);
- space->read_page0();
+ if (!space->read_page0())
+ err= DB_CANNOT_OPEN_FILE;
mysql_mutex_unlock(&fil_system.mutex);
if (srv_operation == SRV_OPERATION_RESTORE_DELTA
@@ -3448,7 +3450,7 @@ static void xb_load_single_table_tablespace(const char *dirname,
static void xb_load_single_table_tablespace(const std::string &space_name,
bool skip_node_page0,
- ulint defer_space_id)
+ uint32_t defer_space_id)
{
std::string name(space_name);
bool is_remote= access((name + ".ibd").c_str(), R_OK) != 0;
@@ -3827,9 +3829,9 @@ static dberr_t xb_assign_undo_space_start()
pfs_os_file_t file;
bool ret;
dberr_t error = DB_SUCCESS;
- ulint space;
+ uint32_t space;
+ uint32_t fsp_flags;
int n_retries = 5;
- ulint fsp_flags;
if (srv_undo_tablespaces == 0) {
return error;
@@ -3854,7 +3856,7 @@ static dberr_t xb_assign_undo_space_start()
}
fsp_flags = mach_read_from_4(
- page + FSP_HEADER_OFFSET + FSP_SPACE_FLAGS);
+ page + FSP_HEADER_OFFSET + FSP_SPACE_FLAGS);
retry:
if (os_file_read(IORequestRead, file, page,
TRX_SYS_PAGE_NO << srv_page_size_shift,
@@ -4509,7 +4511,7 @@ static bool xtrabackup_backup_func()
return(false);
}
msg("cd to %s", mysql_real_data_home);
- encryption_plugin_backup_init(mysql_connection);
+ xb_plugin_backup_init(mysql_connection);
msg("open files limit requested %lu, set to %lu",
xb_open_files_limit,
xb_set_max_open_files(xb_open_files_limit));
@@ -4875,7 +4877,7 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages)
iter++) {
const std::string name = iter->second;
- ulint id = iter->first;
+ uint32_t id = iter->first;
if (ddl_tracker.drops.find(id) != ddl_tracker.drops.end()) {
dropped_tables.insert(name);
@@ -4901,7 +4903,7 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages)
iter != ddl_tracker.id_to_name.end();
iter++) {
- ulint id = iter->first;
+ uint32_t id = iter->first;
std::string name = iter->second;
if (ddl_tracker.tables_in_backup.find(id) != ddl_tracker.tables_in_backup.end()) {
@@ -5049,8 +5051,8 @@ bool
xb_space_create_file(
/*==================*/
const char* path, /*!<in: path to tablespace */
- ulint space_id, /*!<in: space id */
- ulint flags, /*!<in: tablespace flags */
+ uint32_t space_id, /*!<in: space id */
+ uint32_t flags, /*!<in: tablespace flags */
pfs_os_file_t* file) /*!<out: file handle */
{
bool ret;
@@ -5113,7 +5115,7 @@ xb_delta_open_matching_space(
ut_a(dbname != NULL ||
!fil_is_user_tablespace_id(info.space_id) ||
- info.space_id == ULINT_UNDEFINED);
+ info.space_id == UINT32_MAX);
*success = false;
@@ -5189,14 +5191,14 @@ exit:
if (fil_space != NULL) {
if (fil_space->id == info.space_id
- || info.space_id == ULINT_UNDEFINED) {
+ || info.space_id == UINT32_MAX) {
/* we found matching space */
goto found;
} else {
char tmpname[FN_REFLEN];
- snprintf(tmpname, FN_REFLEN, "%s/xtrabackup_tmp_#" ULINTPF,
+ snprintf(tmpname, FN_REFLEN, "%s/xtrabackup_tmp_#%u",
dbname, fil_space->id);
msg("mariabackup: Renaming %s to %s.ibd",
@@ -5210,7 +5212,7 @@ exit:
}
}
- if (info.space_id == ULINT_UNDEFINED)
+ if (info.space_id == UINT32_MAX)
{
die("Can't handle DDL operation on tablespace "
"%s\n", dest_space_name);
@@ -5236,7 +5238,7 @@ exit:
}
/* No matching space found. create the new one. */
- const ulint flags = info.zip_size
+ const uint32_t flags = info.zip_size
? get_bit_shift(info.page_size
>> (UNIV_ZIP_SIZE_SHIFT_MIN - 1))
<< FSP_FLAGS_POS_ZIP_SSIZE
@@ -5930,7 +5932,7 @@ static bool xtrabackup_prepare_func(char** argv)
}
int argc; for (argc = 0; argv[argc]; argc++) {}
- encryption_plugin_prepare_init(argc, argv);
+ xb_plugin_prepare_init(argc, argv, xtrabackup_incremental_dir);
xtrabackup_target_dir= mysql_data_home_buff;
xtrabackup_target_dir[0]=FN_CURLIB; // all paths are relative from here
@@ -6531,12 +6533,17 @@ void handle_options(int argc, char **argv, char ***argv_server,
{
prepare= true;
}
- else if (!strncmp(argv[i], "--target-dir", optend - argv[i]) &&
+ else if (!strncmp(argv[i], "--incremental-dir", optend - argv[i]) &&
*optend)
{
target_dir= optend + 1;
}
- else if (!*optend && argv[i][0] != '-')
+ else if (!strncmp(argv[i], "--target-dir", optend - argv[i]) &&
+ *optend && !target_dir)
+ {
+ target_dir= optend + 1;
+ }
+ else if (!*optend && argv[i][0] != '-' && !target_dir)
{
target_dir= argv[i];
}
diff --git a/extra/mariabackup/xtrabackup.h b/extra/mariabackup/xtrabackup.h
index a8c4486b74c..b498d6f5a2e 100644
--- a/extra/mariabackup/xtrabackup.h
+++ b/extra/mariabackup/xtrabackup.h
@@ -29,12 +29,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
struct xb_delta_info_t
{
- xb_delta_info_t(ulint page_size, ulint zip_size, ulint space_id)
+ xb_delta_info_t(ulint page_size, ulint zip_size, uint32_t space_id)
: page_size(page_size), zip_size(zip_size), space_id(space_id) {}
ulint page_size;
ulint zip_size;
- ulint space_id;
+ uint32_t space_id;
};
class CorruptedPages
@@ -42,23 +42,23 @@ class CorruptedPages
public:
CorruptedPages();
~CorruptedPages();
- void add_page(const char *file_name, ulint space_id, unsigned page_no);
- bool contains(ulint space_id, unsigned page_no) const;
- void drop_space(ulint space_id);
- void rename_space(ulint space_id, const std::string &new_name);
+ void add_page(const char *file_name, page_id_t page_id);
+ bool contains(page_id_t page_id) const;
+ void drop_space(uint32_t space_id);
+ void rename_space(uint32_t space_id, const std::string &new_name);
bool print_to_file(const char *file_name) const;
void read_from_file(const char *file_name);
bool empty() const;
void zero_out_free_pages();
private:
- void add_page_no_lock(const char *space_name, ulint space_id,
- unsigned page_no, bool convert_space_name);
+ void add_page_no_lock(const char *space_name, page_id_t page_id,
+ bool convert_space_name);
struct space_info_t {
std::string space_name;
- std::set<unsigned> pages;
+ std::set<uint32_t> pages;
};
- typedef std::map<ulint, space_info_t> container_t;
+ typedef std::map<uint32_t, space_info_t> container_t;
mutable pthread_mutex_t m_mutex;
container_t m_spaces;
};
diff --git a/include/hash.h b/include/hash.h
index 00ffca503fc..c0a846ac120 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -64,8 +64,8 @@ typedef struct st_hash {
typedef uint HASH_SEARCH_STATE;
#define my_hash_init(A,B,C,D,E,F,G,H,I) my_hash_init2(A,B,0,C,D,E,F,G,0,H,I)
-my_bool my_hash_init2(PSI_memory_key psi_key, HASH *hash, uint growth_size,
- CHARSET_INFO *charset, ulong default_array_elements,
+my_bool my_hash_init2(PSI_memory_key psi_key, HASH *hash, size_t growth_size,
+ CHARSET_INFO *charset, size_t default_array_elements,
size_t key_offset, size_t key_length,
my_hash_get_key get_key, my_hash_function hash_function,
void (*free_element)(void*), uint flags);
diff --git a/include/ilist.h b/include/ilist.h
index 45c0bbf7d2c..265f0e2d57e 100644
--- a/include/ilist.h
+++ b/include/ilist.h
@@ -107,6 +107,10 @@ public:
}
reference operator*() noexcept { return *static_cast<pointer>(node_); }
+ const_reference operator*() const noexcept
+ {
+ return *static_cast<pointer>(node_);
+ }
pointer operator->() noexcept { return static_cast<pointer>(node_); }
friend bool operator==(const Iterator &lhs, const Iterator &rhs) noexcept
diff --git a/include/json_lib.h b/include/json_lib.h
index e570e2a9d17..ea7f102fd02 100644
--- a/include/json_lib.h
+++ b/include/json_lib.h
@@ -1,6 +1,8 @@
#ifndef JSON_LIB_INCLUDED
#define JSON_LIB_INCLUDED
+#include <my_sys.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -172,7 +174,7 @@ enum json_states {
enum json_value_types
{
- JSON_VALUE_UNINITALIZED=0,
+ JSON_VALUE_UNINITIALIZED=0,
JSON_VALUE_OBJECT=1,
JSON_VALUE_ARRAY=2,
JSON_VALUE_STRING=3,
@@ -432,6 +434,9 @@ int json_locate_key(const char *js, const char *js_end,
const char **key_start, const char **key_end,
int *comma_pos);
+int json_normalize(DYNAMIC_STRING *result,
+ const char *s, size_t size, CHARSET_INFO *cs);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/my_alloc.h b/include/my_alloc.h
index 181f637c093..944dcb6e1bd 100644
--- a/include/my_alloc.h
+++ b/include/my_alloc.h
@@ -20,7 +20,7 @@
#ifndef _my_alloc_h
#define _my_alloc_h
-#include <mysql/psi/psi_memory.h>
+#include "mysql/psi/psi_base.h"
#define ALLOC_MAX_BLOCK_TO_DROP 4096
#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10
@@ -50,11 +50,12 @@ typedef struct st_mem_root
first free block in queue test counter (if it exceed
MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list)
*/
- unsigned int first_block_usage;
+ unsigned short first_block_usage;
+ unsigned short flags;
void (*error_handler)(void);
- PSI_memory_key m_psi_key;
+ PSI_memory_key psi_key;
} MEM_ROOT;
#ifdef __cplusplus
diff --git a/include/my_bitmap.h b/include/my_bitmap.h
index f19254404c1..f88a6fe8d9d 100644
--- a/include/my_bitmap.h
+++ b/include/my_bitmap.h
@@ -28,12 +28,6 @@ typedef struct st_bitmap
{
my_bitmap_map *bitmap;
my_bitmap_map *last_word_ptr;
- /*
- mutex will be acquired for the duration of each bitmap operation if
- thread_safe flag in bitmap_init was set. Otherwise, we optimize by not
- acquiring the mutex
- */
- mysql_mutex_t *mutex;
my_bitmap_map last_word_mask;
uint32 n_bits; /* number of bits occupied by the above */
} MY_BITMAP;
@@ -42,15 +36,11 @@ typedef struct st_bitmap
extern "C" {
#endif
-/* compatibility functions */
-#define bitmap_init(A,B,C,D) my_bitmap_init(A,B,C,D)
-#define bitmap_free(A) my_bitmap_free(A)
/* Reset memory. Faster then doing a full bzero */
#define my_bitmap_clear(A) ((A)->bitmap= 0)
extern void create_last_word_mask(MY_BITMAP *map);
-extern my_bool my_bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
- my_bool thread_safe);
+extern my_bool my_bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits);
extern my_bool bitmap_is_clear_all(const MY_BITMAP *map);
extern my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size);
extern my_bool bitmap_is_set_all(const MY_BITMAP *map);
@@ -82,8 +72,6 @@ extern void bitmap_xor(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_invert(MY_BITMAP *map);
extern void bitmap_copy(MY_BITMAP *map, const MY_BITMAP *map2);
-extern uint bitmap_lock_set_next(MY_BITMAP *map);
-extern void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit);
/* Fast, not thread safe, bitmap functions */
#define bitmap_buffer_size(bits) (((bits)+31)/32)*4
#define no_bytes_in_map(map) (((map)->n_bits + 7)/8)
diff --git a/include/my_dbug.h b/include/my_dbug.h
index e25bfcf28a7..eb4536559f1 100644
--- a/include/my_dbug.h
+++ b/include/my_dbug.h
@@ -100,10 +100,7 @@ extern int (*dbug_sanity)(void);
do {if (_db_keyword_(0, (keyword), 0)) { a1 }} while(0)
#define DBUG_EXECUTE_IF(keyword,a1) \
do {if (_db_keyword_(0, (keyword), 1)) { a1 }} while(0)
-#define DBUG_EVALUATE(keyword,a1,a2) \
- (_db_keyword_(0,(keyword), 0) ? (a1) : (a2))
-#define DBUG_EVALUATE_IF(keyword,a1,a2) \
- (_db_keyword_(0,(keyword), 1) ? (a1) : (a2))
+#define DBUG_IF(keyword) _db_keyword_(0, (keyword), 1)
#define DBUG_PRINT(keyword,arglist) \
do if (_db_pargs_(__LINE__,keyword)) _db_doprnt_ arglist; while(0)
@@ -172,8 +169,7 @@ extern void _db_suicide_(void);
#define DBUG_VOID_RETURN do { return; } while(0)
#define DBUG_EXECUTE(keyword,a1) do { } while(0)
#define DBUG_EXECUTE_IF(keyword,a1) do { } while(0)
-#define DBUG_EVALUATE(keyword,a1,a2) (a2)
-#define DBUG_EVALUATE_IF(keyword,a1,a2) (a2)
+#define DBUG_IF(keyword) 0
#define DBUG_PRINT(keyword,arglist) do { } while(0)
#define DBUG_PUSH_EMPTY do { } while(0)
#define DBUG_POP_EMPTY do { } while(0)
@@ -199,7 +195,7 @@ extern void _db_suicide_(void);
#define DBUG_CRASH_ENTER(func)
#define DBUG_CRASH_RETURN(val) do { return(val); } while(0)
#define DBUG_CRASH_VOID_RETURN do { return; } while(0)
-#define DBUG_SUICIDE() do { } while(0)
+#define DBUG_SUICIDE() ((void) 0)
#ifdef DBUG_ASSERT_AS_PRINTF
extern void (*my_dbug_assert_failed)(const char *assert_expr, const char* file, unsigned long line);
diff --git a/include/my_dir.h b/include/my_dir.h
index 930d54ca72f..12cf5db149d 100644
--- a/include/my_dir.h
+++ b/include/my_dir.h
@@ -94,13 +94,13 @@ typedef struct fileinfo
typedef struct st_my_dir /* Struct returned from my_dir */
{
/*
- These members are just copies of parts of DYNAMIC_ARRAY structure,
+ These members are just copies of parts of DYNAMIC_ARRAY structure,
which is allocated right after the end of MY_DIR structure (MEM_ROOT
for storing names is also resides there). We've left them here because
we don't want to change code that uses my_dir.
*/
struct fileinfo *dir_entry;
- uint number_of_files;
+ size_t number_of_files;
} MY_DIR;
extern MY_DIR *my_dir(const char *path,myf MyFlags);
diff --git a/include/my_sys.h b/include/my_sys.h
index 7eda45b6cc2..6a0c92b4a07 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -94,6 +94,7 @@ C_MODE_START
#define MY_SYNC_DIR 32768U /* my_create/delete/rename: sync directory */
#define MY_SYNC_FILESIZE 65536U /* my_sync(): safe sync when file is extended */
#define MY_THREAD_SPECIFIC 0x10000U /* my_malloc(): thread specific */
+#define MY_ROOT_USE_MPROTECT 0x20000U /* init_alloc_root: read only segments */
/* Tree that should delete things automatically */
#define MY_TREE_WITH_DELETE 0x40000U
@@ -284,6 +285,7 @@ extern my_bool my_disable_async_io,
extern my_bool my_disable_sync, my_disable_copystat_in_redel;
extern char wild_many,wild_one,wild_prefix;
extern const char *charsets_dir;
+extern size_t my_system_page_size;
enum cache_type
{
@@ -343,9 +345,9 @@ typedef void (*FREE_FUNC)(void *);
typedef struct st_dynamic_array
{
uchar *buffer;
- uint elements,max_element;
- uint alloc_increment;
- uint size_of_element;
+ size_t elements, max_element;
+ size_t alloc_increment;
+ size_t size_of_element;
PSI_memory_key m_psi_key;
myf malloc_flags;
} DYNAMIC_ARRAY;
@@ -354,7 +356,7 @@ typedef struct st_my_tmpdir
{
DYNAMIC_ARRAY full_list;
char **list;
- uint cur, max;
+ size_t cur, max;
mysql_mutex_t mutex;
} MY_TMPDIR;
@@ -834,18 +836,18 @@ File create_temp_file(char *to, const char *dir, const char *pfx,
#define my_init_dynamic_array(A,B,C,D,E,F) init_dynamic_array2(A,B,C,NULL,D,E,F)
#define my_init_dynamic_array2(A,B,C,D,E,F,G) init_dynamic_array2(A,B,C,D,E,F,G)
extern my_bool init_dynamic_array2(PSI_memory_key psi_key, DYNAMIC_ARRAY *array,
- uint element_size, void *init_buffer,
- uint init_alloc, uint alloc_increment,
+ size_t element_size, void *init_buffer,
+ size_t init_alloc, size_t alloc_increment,
myf my_flags);
extern my_bool insert_dynamic(DYNAMIC_ARRAY *array, const void* element);
extern void *alloc_dynamic(DYNAMIC_ARRAY *array);
extern void *pop_dynamic(DYNAMIC_ARRAY*);
extern my_bool set_dynamic(DYNAMIC_ARRAY *array, const void *element,
- uint array_index);
-extern my_bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements);
-extern void get_dynamic(DYNAMIC_ARRAY *array, void *element, uint array_index);
+ size_t array_index);
+extern my_bool allocate_dynamic(DYNAMIC_ARRAY *array, size_t max_elements);
+extern void get_dynamic(DYNAMIC_ARRAY *array, void *element, size_t array_index);
extern void delete_dynamic(DYNAMIC_ARRAY *array);
-extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index);
+extern void delete_dynamic_element(DYNAMIC_ARRAY *array, size_t array_index);
extern void delete_dynamic_with_callback(DYNAMIC_ARRAY *array, FREE_FUNC f);
extern void freeze_size(DYNAMIC_ARRAY *array);
extern int get_index_dynamic(DYNAMIC_ARRAY *array, void *element);
@@ -887,7 +889,6 @@ extern void my_free_lock(void *ptr);
#define my_free_lock(A) my_free((A))
#endif
#define alloc_root_inited(A) ((A)->min_malloc != 0)
-#define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8)
#define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; (A)->min_malloc=0;} while(0)
extern void init_alloc_root(PSI_memory_key key, MEM_ROOT *mem_root,
size_t block_size, size_t pre_alloc_size,
@@ -898,6 +899,7 @@ extern void free_root(MEM_ROOT *root, myf MyFLAGS);
extern void set_prealloc_root(MEM_ROOT *root, char *ptr);
extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
size_t prealloc_size);
+extern void protect_root(MEM_ROOT *root, int prot);
extern char *strdup_root(MEM_ROOT *root,const char *str);
static inline char *safe_strdup_root(MEM_ROOT *root, const char *str)
{
@@ -1020,15 +1022,28 @@ int my_getpagesize(void);
int my_msync(int, void *, size_t, int);
#define MY_UUID_SIZE 16
-#define MY_UUID_STRING_LENGTH (8+1+4+1+4+1+4+1+12)
-#define MY_UUID_ORACLE_STRING_LENGTH (8+4+4+4+12)
+#define MY_UUID_BARE_STRING_LENGTH (8+4+4+4+12)
+#define MY_UUID_SEPARATORS 4
+#define MY_UUID_STRING_LENGTH (MY_UUID_BARE_STRING_LENGTH + MY_UUID_SEPARATORS)
void my_uuid_init(ulong seed1, ulong seed2);
void my_uuid(uchar *guid);
-void my_uuid2str(const uchar *guid, char *s);
-void my_uuid2str_oracle(const uchar *guid, char *s);
void my_uuid_end(void);
+static inline void my_uuid2str(const uchar *guid, char *s, int with_separators)
+{
+ int i;
+ int mask= with_separators ? ((1 << 3) | (1 << 5) | (1 << 7) | (1 << 9)) : 0;
+ for (i=0; i < MY_UUID_SIZE; i++, mask >>= 1)
+ {
+ *s++= _dig_vec_lower[guid[i] >>4];
+ *s++= _dig_vec_lower[guid[i] & 15];
+ if (mask & 1)
+ *s++= '-';
+ }
+}
+
+
const char *my_dlerror(const char *dlpath);
/* character sets */
diff --git a/include/mysql.h b/include/mysql.h
index 87def05dc7e..a42ae085e0c 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -140,6 +140,8 @@ typedef unsigned long long my_ulonglong;
#define ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN
#define ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN
#define ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS
+#define ER_KEY_COLUMN_DOES_NOT_EXITS ER_KEY_COLUMN_DOES_NOT_EXIST
+#define ER_DROP_PARTITION_NON_EXISTENT ER_PARTITION_DOES_NOT_EXIST
typedef struct st_mysql_rows {
struct st_mysql_rows *next; /* list of rows */
@@ -322,7 +324,15 @@ typedef struct st_mysql_res {
} MYSQL_RES;
-#if !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT)
+/*
+ We should not define MYSQL_CLIENT when the mysql.h is included
+ by the server or server plugins.
+ Now it is important only for the SQL service to work so we rely on
+ the MYSQL_SERVICE_SQL to check we're compiling the server/plugin
+ related file.
+*/
+
+#if !defined(MYSQL_SERVICE_SQL) && !defined(MYSQL_CLIENT)
#define MYSQL_CLIENT
#endif
@@ -354,7 +364,7 @@ typedef struct st_mysql_parameters
*/
#define MYSQL_WAIT_TIMEOUT 8
-#if !defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY)
+#if !defined(MYSQL_SERVICE_SQL)
#define max_allowed_packet (*mysql_get_parameters()->p_max_allowed_packet)
#define net_buffer_length (*mysql_get_parameters()->p_net_buffer_length)
#endif
diff --git a/include/mysql.h.pp b/include/mysql.h.pp
index 584276a7a08..81b6206ae3e 100644
--- a/include/mysql.h.pp
+++ b/include/mysql.h.pp
@@ -239,9 +239,6 @@ typedef char **MYSQL_ROW;
typedef unsigned int MYSQL_FIELD_OFFSET;
typedef unsigned long long my_ulonglong;
extern "C" {
-}
-extern "C" {
-struct PSI_thread;
typedef unsigned int PSI_memory_key;
}
extern "C" {
@@ -259,9 +256,10 @@ typedef struct st_mem_root
size_t min_malloc;
size_t block_size;
unsigned int block_num;
- unsigned int first_block_usage;
+ unsigned short first_block_usage;
+ unsigned short flags;
void (*error_handler)(void);
- PSI_memory_key m_psi_key;
+ PSI_memory_key psi_key;
} MEM_ROOT;
}
typedef struct st_typelib {
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index cc0943e4382..6ef0afb980b 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -77,7 +77,7 @@ typedef struct st_mysql_xid MYSQL_XID;
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0104
/* MariaDB plugin interface version */
-#define MARIA_PLUGIN_INTERFACE_VERSION 0x010e
+#define MARIA_PLUGIN_INTERFACE_VERSION 0x010f
/*
The allowable types of plugins
diff --git a/include/mysql/plugin_audit.h.pp b/include/mysql/plugin_audit.h.pp
index 2e0cdff4b50..fedfb5862b4 100644
--- a/include/mysql/plugin_audit.h.pp
+++ b/include/mysql/plugin_audit.h.pp
@@ -464,6 +464,26 @@ int json_escape_string(const char *str,const char *str_end,
int json_unescape_json(const char *json_str, const char *json_end,
char *res, char *res_end);
}
+extern "C" {
+extern struct sql_service_st {
+ MYSQL *(STDCALL *mysql_init_func)(MYSQL *mysql);
+ MYSQL *(*mysql_real_connect_local_func)(MYSQL *mysql);
+ MYSQL *(STDCALL *mysql_real_connect_func)(MYSQL *mysql, const char *host,
+ const char *user, const char *passwd, const char *db, unsigned int port,
+ const char *unix_socket, unsigned long clientflag);
+ unsigned int(STDCALL *mysql_errno_func)(MYSQL *mysql);
+ const char *(STDCALL *mysql_error_func)(MYSQL *mysql);
+ int (STDCALL *mysql_real_query_func)(MYSQL *mysql, const char *q,
+ unsigned long length);
+ my_ulonglong (STDCALL *mysql_affected_rows_func)(MYSQL *mysql);
+ my_ulonglong (STDCALL *mysql_num_rows_func)(MYSQL_RES *res);
+ MYSQL_RES *(STDCALL *mysql_store_result_func)(MYSQL *mysql);
+ void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
+ MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
+ void (STDCALL *mysql_close_func)(MYSQL *mysql);
+} *sql_service;
+MYSQL *mysql_real_connect_local(MYSQL *mysql);
+}
}
struct st_mysql_xid {
long formatID;
diff --git a/include/mysql/plugin_auth.h.pp b/include/mysql/plugin_auth.h.pp
index 464c5514acb..f4adae35ffd 100644
--- a/include/mysql/plugin_auth.h.pp
+++ b/include/mysql/plugin_auth.h.pp
@@ -464,6 +464,26 @@ int json_escape_string(const char *str,const char *str_end,
int json_unescape_json(const char *json_str, const char *json_end,
char *res, char *res_end);
}
+extern "C" {
+extern struct sql_service_st {
+ MYSQL *(STDCALL *mysql_init_func)(MYSQL *mysql);
+ MYSQL *(*mysql_real_connect_local_func)(MYSQL *mysql);
+ MYSQL *(STDCALL *mysql_real_connect_func)(MYSQL *mysql, const char *host,
+ const char *user, const char *passwd, const char *db, unsigned int port,
+ const char *unix_socket, unsigned long clientflag);
+ unsigned int(STDCALL *mysql_errno_func)(MYSQL *mysql);
+ const char *(STDCALL *mysql_error_func)(MYSQL *mysql);
+ int (STDCALL *mysql_real_query_func)(MYSQL *mysql, const char *q,
+ unsigned long length);
+ my_ulonglong (STDCALL *mysql_affected_rows_func)(MYSQL *mysql);
+ my_ulonglong (STDCALL *mysql_num_rows_func)(MYSQL_RES *res);
+ MYSQL_RES *(STDCALL *mysql_store_result_func)(MYSQL *mysql);
+ void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
+ MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
+ void (STDCALL *mysql_close_func)(MYSQL *mysql);
+} *sql_service;
+MYSQL *mysql_real_connect_local(MYSQL *mysql);
+}
}
struct st_mysql_xid {
long formatID;
diff --git a/include/mysql/plugin_data_type.h.pp b/include/mysql/plugin_data_type.h.pp
index cb256e00cd7..68333230b00 100644
--- a/include/mysql/plugin_data_type.h.pp
+++ b/include/mysql/plugin_data_type.h.pp
@@ -464,6 +464,26 @@ int json_escape_string(const char *str,const char *str_end,
int json_unescape_json(const char *json_str, const char *json_end,
char *res, char *res_end);
}
+extern "C" {
+extern struct sql_service_st {
+ MYSQL *(STDCALL *mysql_init_func)(MYSQL *mysql);
+ MYSQL *(*mysql_real_connect_local_func)(MYSQL *mysql);
+ MYSQL *(STDCALL *mysql_real_connect_func)(MYSQL *mysql, const char *host,
+ const char *user, const char *passwd, const char *db, unsigned int port,
+ const char *unix_socket, unsigned long clientflag);
+ unsigned int(STDCALL *mysql_errno_func)(MYSQL *mysql);
+ const char *(STDCALL *mysql_error_func)(MYSQL *mysql);
+ int (STDCALL *mysql_real_query_func)(MYSQL *mysql, const char *q,
+ unsigned long length);
+ my_ulonglong (STDCALL *mysql_affected_rows_func)(MYSQL *mysql);
+ my_ulonglong (STDCALL *mysql_num_rows_func)(MYSQL_RES *res);
+ MYSQL_RES *(STDCALL *mysql_store_result_func)(MYSQL *mysql);
+ void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
+ MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
+ void (STDCALL *mysql_close_func)(MYSQL *mysql);
+} *sql_service;
+MYSQL *mysql_real_connect_local(MYSQL *mysql);
+}
}
struct st_mysql_xid {
long formatID;
diff --git a/include/mysql/plugin_encryption.h.pp b/include/mysql/plugin_encryption.h.pp
index 11cd622861c..a7dca09334d 100644
--- a/include/mysql/plugin_encryption.h.pp
+++ b/include/mysql/plugin_encryption.h.pp
@@ -464,6 +464,26 @@ int json_escape_string(const char *str,const char *str_end,
int json_unescape_json(const char *json_str, const char *json_end,
char *res, char *res_end);
}
+extern "C" {
+extern struct sql_service_st {
+ MYSQL *(STDCALL *mysql_init_func)(MYSQL *mysql);
+ MYSQL *(*mysql_real_connect_local_func)(MYSQL *mysql);
+ MYSQL *(STDCALL *mysql_real_connect_func)(MYSQL *mysql, const char *host,
+ const char *user, const char *passwd, const char *db, unsigned int port,
+ const char *unix_socket, unsigned long clientflag);
+ unsigned int(STDCALL *mysql_errno_func)(MYSQL *mysql);
+ const char *(STDCALL *mysql_error_func)(MYSQL *mysql);
+ int (STDCALL *mysql_real_query_func)(MYSQL *mysql, const char *q,
+ unsigned long length);
+ my_ulonglong (STDCALL *mysql_affected_rows_func)(MYSQL *mysql);
+ my_ulonglong (STDCALL *mysql_num_rows_func)(MYSQL_RES *res);
+ MYSQL_RES *(STDCALL *mysql_store_result_func)(MYSQL *mysql);
+ void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
+ MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
+ void (STDCALL *mysql_close_func)(MYSQL *mysql);
+} *sql_service;
+MYSQL *mysql_real_connect_local(MYSQL *mysql);
+}
}
struct st_mysql_xid {
long formatID;
diff --git a/include/mysql/plugin_ftparser.h.pp b/include/mysql/plugin_ftparser.h.pp
index 9a798627518..3270f88defd 100644
--- a/include/mysql/plugin_ftparser.h.pp
+++ b/include/mysql/plugin_ftparser.h.pp
@@ -464,6 +464,26 @@ int json_escape_string(const char *str,const char *str_end,
int json_unescape_json(const char *json_str, const char *json_end,
char *res, char *res_end);
}
+extern "C" {
+extern struct sql_service_st {
+ MYSQL *(STDCALL *mysql_init_func)(MYSQL *mysql);
+ MYSQL *(*mysql_real_connect_local_func)(MYSQL *mysql);
+ MYSQL *(STDCALL *mysql_real_connect_func)(MYSQL *mysql, const char *host,
+ const char *user, const char *passwd, const char *db, unsigned int port,
+ const char *unix_socket, unsigned long clientflag);
+ unsigned int(STDCALL *mysql_errno_func)(MYSQL *mysql);
+ const char *(STDCALL *mysql_error_func)(MYSQL *mysql);
+ int (STDCALL *mysql_real_query_func)(MYSQL *mysql, const char *q,
+ unsigned long length);
+ my_ulonglong (STDCALL *mysql_affected_rows_func)(MYSQL *mysql);
+ my_ulonglong (STDCALL *mysql_num_rows_func)(MYSQL_RES *res);
+ MYSQL_RES *(STDCALL *mysql_store_result_func)(MYSQL *mysql);
+ void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
+ MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
+ void (STDCALL *mysql_close_func)(MYSQL *mysql);
+} *sql_service;
+MYSQL *mysql_real_connect_local(MYSQL *mysql);
+}
}
struct st_mysql_xid {
long formatID;
diff --git a/include/mysql/plugin_function.h.pp b/include/mysql/plugin_function.h.pp
index 4b2a0fc7082..4f0c15e74eb 100644
--- a/include/mysql/plugin_function.h.pp
+++ b/include/mysql/plugin_function.h.pp
@@ -464,6 +464,26 @@ int json_escape_string(const char *str,const char *str_end,
int json_unescape_json(const char *json_str, const char *json_end,
char *res, char *res_end);
}
+extern "C" {
+extern struct sql_service_st {
+ MYSQL *(STDCALL *mysql_init_func)(MYSQL *mysql);
+ MYSQL *(*mysql_real_connect_local_func)(MYSQL *mysql);
+ MYSQL *(STDCALL *mysql_real_connect_func)(MYSQL *mysql, const char *host,
+ const char *user, const char *passwd, const char *db, unsigned int port,
+ const char *unix_socket, unsigned long clientflag);
+ unsigned int(STDCALL *mysql_errno_func)(MYSQL *mysql);
+ const char *(STDCALL *mysql_error_func)(MYSQL *mysql);
+ int (STDCALL *mysql_real_query_func)(MYSQL *mysql, const char *q,
+ unsigned long length);
+ my_ulonglong (STDCALL *mysql_affected_rows_func)(MYSQL *mysql);
+ my_ulonglong (STDCALL *mysql_num_rows_func)(MYSQL_RES *res);
+ MYSQL_RES *(STDCALL *mysql_store_result_func)(MYSQL *mysql);
+ void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
+ MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
+ void (STDCALL *mysql_close_func)(MYSQL *mysql);
+} *sql_service;
+MYSQL *mysql_real_connect_local(MYSQL *mysql);
+}
}
struct st_mysql_xid {
long formatID;
diff --git a/include/mysql/plugin_password_validation.h b/include/mysql/plugin_password_validation.h
index 23d2c884012..94d6c63967f 100644
--- a/include/mysql/plugin_password_validation.h
+++ b/include/mysql/plugin_password_validation.h
@@ -30,7 +30,7 @@
extern "C" {
#endif
-#define MariaDB_PASSWORD_VALIDATION_INTERFACE_VERSION 0x0100
+#define MariaDB_PASSWORD_VALIDATION_INTERFACE_VERSION 0x0101
/**
Password validation plugin descriptor
@@ -43,7 +43,8 @@ struct st_mariadb_password_validation
and return 0 if the password has passed the validation.
*/
int (*validate_password)(const MYSQL_CONST_LEX_STRING *username,
- const MYSQL_CONST_LEX_STRING *password);
+ const MYSQL_CONST_LEX_STRING *password,
+ const MYSQL_CONST_LEX_STRING *hostname);
};
#ifdef __cplusplus
diff --git a/include/mysql/plugin_password_validation.h.pp b/include/mysql/plugin_password_validation.h.pp
index eae776a753b..d8dbd8b0dfe 100644
--- a/include/mysql/plugin_password_validation.h.pp
+++ b/include/mysql/plugin_password_validation.h.pp
@@ -464,6 +464,26 @@ int json_escape_string(const char *str,const char *str_end,
int json_unescape_json(const char *json_str, const char *json_end,
char *res, char *res_end);
}
+extern "C" {
+extern struct sql_service_st {
+ MYSQL *(STDCALL *mysql_init_func)(MYSQL *mysql);
+ MYSQL *(*mysql_real_connect_local_func)(MYSQL *mysql);
+ MYSQL *(STDCALL *mysql_real_connect_func)(MYSQL *mysql, const char *host,
+ const char *user, const char *passwd, const char *db, unsigned int port,
+ const char *unix_socket, unsigned long clientflag);
+ unsigned int(STDCALL *mysql_errno_func)(MYSQL *mysql);
+ const char *(STDCALL *mysql_error_func)(MYSQL *mysql);
+ int (STDCALL *mysql_real_query_func)(MYSQL *mysql, const char *q,
+ unsigned long length);
+ my_ulonglong (STDCALL *mysql_affected_rows_func)(MYSQL *mysql);
+ my_ulonglong (STDCALL *mysql_num_rows_func)(MYSQL_RES *res);
+ MYSQL_RES *(STDCALL *mysql_store_result_func)(MYSQL *mysql);
+ void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
+ MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
+ void (STDCALL *mysql_close_func)(MYSQL *mysql);
+} *sql_service;
+MYSQL *mysql_real_connect_local(MYSQL *mysql);
+}
}
struct st_mysql_xid {
long formatID;
@@ -629,6 +649,7 @@ struct st_mariadb_password_validation
{
int interface_version;
int (*validate_password)(const MYSQL_CONST_LEX_STRING *username,
- const MYSQL_CONST_LEX_STRING *password);
+ const MYSQL_CONST_LEX_STRING *password,
+ const MYSQL_CONST_LEX_STRING *hostname);
};
}
diff --git a/include/mysql/psi/psi_abi_v1.h.pp b/include/mysql/psi/psi_abi_v1.h.pp
index a1845ac62f6..ad2bf1d21dc 100644
--- a/include/mysql/psi/psi_abi_v1.h.pp
+++ b/include/mysql/psi/psi_abi_v1.h.pp
@@ -1,8 +1,8 @@
extern "C" {
+typedef unsigned int PSI_memory_key;
}
extern "C" {
struct PSI_thread;
-typedef unsigned int PSI_memory_key;
struct PSI_memory_info_v1
{
PSI_memory_key *m_key;
diff --git a/include/mysql/psi/psi_abi_v2.h.pp b/include/mysql/psi/psi_abi_v2.h.pp
index a670e53a8b7..9188954885f 100644
--- a/include/mysql/psi/psi_abi_v2.h.pp
+++ b/include/mysql/psi/psi_abi_v2.h.pp
@@ -1,8 +1,8 @@
extern "C" {
+typedef unsigned int PSI_memory_key;
}
extern "C" {
struct PSI_thread;
-typedef unsigned int PSI_memory_key;
struct PSI_memory_info_v2
{
int placeholder;
diff --git a/include/mysql/psi/psi_base.h b/include/mysql/psi/psi_base.h
index 7b4eaf80892..2bb1d8fc354 100644
--- a/include/mysql/psi/psi_base.h
+++ b/include/mysql/psi/psi_base.h
@@ -164,6 +164,13 @@ extern "C" {
/** @} */
+/**
+ Instrumented memory key.
+ To instrument memory, a memory key must be obtained using @c register_memory.
+ Using a zero key always disable the instrumentation.
+*/
+typedef unsigned int PSI_memory_key;
+
#ifdef __cplusplus
}
#endif
diff --git a/include/mysql/psi/psi_memory.h b/include/mysql/psi/psi_memory.h
index 9b968667d53..60d68f1a6dd 100644
--- a/include/mysql/psi/psi_memory.h
+++ b/include/mysql/psi/psi_memory.h
@@ -53,13 +53,6 @@ extern "C" {
struct PSI_thread;
-/**
- Instrumented memory key.
- To instrument memory, a memory key must be obtained using @c register_memory.
- Using a zero key always disable the instrumentation.
-*/
-typedef unsigned int PSI_memory_key;
-
#ifdef HAVE_PSI_1
/**
diff --git a/include/mysql/service_sql.h b/include/mysql/service_sql.h
new file mode 100644
index 00000000000..ef6de8b34ef
--- /dev/null
+++ b/include/mysql/service_sql.h
@@ -0,0 +1,104 @@
+/* Copyright (C) 2021 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 Foundation; version 2 of the License.
+
+ 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.
+
+ 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 02111-1301 USA */
+
+#ifndef MYSQL_SERVICE_SQL
+#define MYSQL_SERVICE_SQL
+
+#ifndef MYSQL_ABI_CHECK
+#include <mysql.h>
+#endif
+
+/**
+ @file
+ SQL service
+
+ Interface for plugins to execute SQL queries on the local server.
+
+ Functions of the service are the 'server-limited' client library:
+ mysql_init
+ mysql_real_connect_local
+ mysql_real_connect
+ mysql_errno
+ mysql_error
+ mysql_real_query
+ mysql_affected_rows
+ mysql_num_rows
+ mysql_store_result
+ mysql_free_result
+ mysql_fetch_row
+ mysql_close
+*/
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct sql_service_st {
+ MYSQL *(STDCALL *mysql_init_func)(MYSQL *mysql);
+ MYSQL *(*mysql_real_connect_local_func)(MYSQL *mysql);
+ MYSQL *(STDCALL *mysql_real_connect_func)(MYSQL *mysql, const char *host,
+ const char *user, const char *passwd, const char *db, unsigned int port,
+ const char *unix_socket, unsigned long clientflag);
+ unsigned int(STDCALL *mysql_errno_func)(MYSQL *mysql);
+ const char *(STDCALL *mysql_error_func)(MYSQL *mysql);
+ int (STDCALL *mysql_real_query_func)(MYSQL *mysql, const char *q,
+ unsigned long length);
+ my_ulonglong (STDCALL *mysql_affected_rows_func)(MYSQL *mysql);
+ my_ulonglong (STDCALL *mysql_num_rows_func)(MYSQL_RES *res);
+ MYSQL_RES *(STDCALL *mysql_store_result_func)(MYSQL *mysql);
+ void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
+ MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
+ void (STDCALL *mysql_close_func)(MYSQL *mysql);
+} *sql_service;
+
+#ifdef MYSQL_DYNAMIC_PLUGIN
+
+#define mysql_init(M) sql_service->mysql_init_func(M)
+#define mysql_real_connect_local(M) sql_service->mysql_real_connect_local_func(M)
+#define mysql_real_connect(M,H,U,PW,D,P,S,F) sql_service->mysql_real_connect_func(M,H,U,PW,D,P,S,F)
+#define mysql_errno(M) sql_service->mysql_errno_func(M)
+#define mysql_error(M) sql_service->mysql_error_func(M)
+#define mysql_real_query sql_service->mysql_real_query_func
+#define mysql_affected_rows(M) sql_service->mysql_affected_rows_func(M)
+#define mysql_num_rows(R) sql_service->mysql_num_rows_func(R)
+#define mysql_store_result(M) sql_service->mysql_store_result_func(M)
+#define mysql_free_result(R) sql_service->mysql_free_result_func(R)
+#define mysql_fetch_row(R) sql_service->mysql_fetch_row_func(R)
+#define mysql_close(M) sql_service->mysql_close_func(M)
+
+#else
+
+/*
+ Establishes the connection to the 'local' server that started the plugin.
+ Like the mysql_real_connect() does for the remote server.
+ The established connection has no user/host associated to it,
+ neither it has the current db, so the queries should have
+ database/table name specified.
+*/
+MYSQL *mysql_real_connect_local(MYSQL *mysql);
+
+/* The rest of the function declarations mest be taken from the mysql.h */
+
+#endif /*MYSQL_DYNAMIC_PLUGIN*/
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*MYSQL_SERVICE_SQL */
+
+
diff --git a/include/mysql/services.h b/include/mysql/services.h
index 2c3a0ae421b..94f7bb3b2da 100644
--- a/include/mysql/services.h
+++ b/include/mysql/services.h
@@ -41,6 +41,7 @@ extern "C" {
#include <mysql/service_thd_wait.h>
#include <mysql/service_json.h>
/*#include <mysql/service_wsrep.h>*/
+#include <mysql/service_sql.h>
#ifdef __cplusplus
}
diff --git a/include/providers/bzlib.h b/include/providers/bzlib.h
new file mode 100644
index 00000000000..b48c940bdbc
--- /dev/null
+++ b/include/providers/bzlib.h
@@ -0,0 +1,126 @@
+/**
+ @file bzlib.h
+ This service provides dynamic access to BZip2.
+*/
+
+#ifndef BZIP2_INCLUDED
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef MYSQL_ABI_CHECK
+#include <stdbool.h>
+#endif
+
+#ifndef MYSQL_DYNAMIC_PLUGIN
+#define provider_service_bzip2 provider_service_bzip2_static
+#endif
+
+#ifndef BZ_RUN
+#define BZ_RUN 0
+#define BZ_FINISH 2
+
+#define BZ_OK 0
+#define BZ_RUN_OK 1
+#define BZ_FINISH_OK 3
+#define BZ_STREAM_END 4
+
+typedef struct
+{
+ char *next_in;
+ unsigned int avail_in;
+ unsigned int total_in_lo32;
+ unsigned int total_in_hi32;
+
+ char *next_out;
+ unsigned int avail_out;
+ unsigned int total_out_lo32;
+ unsigned int total_out_hi32;
+
+ void *state;
+
+ void *(*bzalloc)(void *, int, int);
+ void (*bzfree)(void *, void *);
+ void *opaque;
+} bz_stream;
+
+#define BZ2_bzBuffToBuffCompress(...) provider_service_bzip2->BZ2_bzBuffToBuffCompress_ptr (__VA_ARGS__)
+#define BZ2_bzBuffToBuffDecompress(...) provider_service_bzip2->BZ2_bzBuffToBuffDecompress_ptr (__VA_ARGS__)
+#define BZ2_bzCompress(...) provider_service_bzip2->BZ2_bzCompress_ptr (__VA_ARGS__)
+#define BZ2_bzCompressEnd(...) provider_service_bzip2->BZ2_bzCompressEnd_ptr (__VA_ARGS__)
+#define BZ2_bzCompressInit(...) provider_service_bzip2->BZ2_bzCompressInit_ptr (__VA_ARGS__)
+#define BZ2_bzDecompress(...) provider_service_bzip2->BZ2_bzDecompress_ptr (__VA_ARGS__)
+#define BZ2_bzDecompressEnd(...) provider_service_bzip2->BZ2_bzDecompressEnd_ptr (__VA_ARGS__)
+#define BZ2_bzDecompressInit(...) provider_service_bzip2->BZ2_bzDecompressInit_ptr (__VA_ARGS__)
+#endif
+
+#define DEFINE_BZ2_bzBuffToBuffCompress(NAME) NAME( \
+ char *dest, \
+ unsigned int *destLen, \
+ char *source, \
+ unsigned int sourceLen, \
+ int blockSize100k, \
+ int verbosity, \
+ int workFactor \
+)
+
+#define DEFINE_BZ2_bzBuffToBuffDecompress(NAME) NAME( \
+ char *dest, \
+ unsigned int *destLen, \
+ char *source, \
+ unsigned int sourceLen, \
+ int small, \
+ int verbosity \
+)
+
+#define DEFINE_BZ2_bzCompress(NAME) NAME( \
+ bz_stream *strm, \
+ int action \
+)
+
+#define DEFINE_BZ2_bzCompressEnd(NAME) NAME( \
+ bz_stream *strm \
+)
+
+#define DEFINE_BZ2_bzCompressInit(NAME) NAME( \
+ bz_stream *strm, \
+ int blockSize100k, \
+ int verbosity, \
+ int workFactor \
+)
+
+#define DEFINE_BZ2_bzDecompress(NAME) NAME( \
+ bz_stream *strm \
+)
+
+#define DEFINE_BZ2_bzDecompressEnd(NAME) NAME( \
+ bz_stream *strm \
+)
+
+#define DEFINE_BZ2_bzDecompressInit(NAME) NAME( \
+ bz_stream *strm, \
+ int verbosity, \
+ int small \
+)
+
+struct provider_service_bzip2_st{
+ int DEFINE_BZ2_bzBuffToBuffCompress((*BZ2_bzBuffToBuffCompress_ptr));
+ int DEFINE_BZ2_bzBuffToBuffDecompress((*BZ2_bzBuffToBuffDecompress_ptr));
+ int DEFINE_BZ2_bzCompress((*BZ2_bzCompress_ptr));
+ int DEFINE_BZ2_bzCompressEnd((*BZ2_bzCompressEnd_ptr));
+ int DEFINE_BZ2_bzCompressInit((*BZ2_bzCompressInit_ptr));
+ int DEFINE_BZ2_bzDecompress((*BZ2_bzDecompress_ptr));
+ int DEFINE_BZ2_bzDecompressEnd((*BZ2_bzDecompressEnd_ptr));
+ int DEFINE_BZ2_bzDecompressInit((*BZ2_bzDecompressInit_ptr));
+
+ bool is_loaded;
+};
+
+extern struct provider_service_bzip2_st *provider_service_bzip2;
+
+#ifdef __cplusplus
+}
+#endif
+
+#define BZIP2_INCLUDED
+#endif
diff --git a/include/providers/lz4.h b/include/providers/lz4.h
new file mode 100644
index 00000000000..4ac6b2c8f0d
--- /dev/null
+++ b/include/providers/lz4.h
@@ -0,0 +1,63 @@
+/**
+ @file lz4.h
+ This service provides dynamic access to LZ4.
+*/
+
+#ifndef LZ4_INCLUDED
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef MYSQL_ABI_CHECK
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#endif
+
+#ifndef MYSQL_DYNAMIC_PLUGIN
+#define provider_service_lz4 provider_service_lz4_static
+#endif
+
+#ifndef LZ4_VERSION_NUMBER
+#define LZ4_MAX_INPUT_SIZE 0x7E000000
+
+#define LZ4_compressBound(...) provider_service_lz4->LZ4_compressBound_ptr (__VA_ARGS__)
+#define LZ4_compress_default(...) provider_service_lz4->LZ4_compress_default_ptr (__VA_ARGS__)
+#define LZ4_decompress_safe(...) provider_service_lz4->LZ4_decompress_safe_ptr (__VA_ARGS__)
+#endif
+
+#define DEFINE_LZ4_compressBound(NAME) NAME( \
+ int inputSize \
+)
+
+#define DEFINE_LZ4_compress_default(NAME) NAME( \
+ const char *src, \
+ char *dst, \
+ int srcSize, \
+ int dstCapacity \
+)
+
+#define DEFINE_LZ4_decompress_safe(NAME) NAME( \
+ const char *src, \
+ char *dst, \
+ int compressedSize, \
+ int dstCapacity \
+)
+
+struct provider_service_lz4_st
+{
+ int DEFINE_LZ4_compressBound((*LZ4_compressBound_ptr));
+ int DEFINE_LZ4_compress_default((*LZ4_compress_default_ptr));
+ int DEFINE_LZ4_decompress_safe((*LZ4_decompress_safe_ptr));
+
+ bool is_loaded;
+};
+
+extern struct provider_service_lz4_st *provider_service_lz4;
+
+#ifdef __cplusplus
+}
+#endif
+
+#define LZ4_INCLUDED
+#endif
diff --git a/include/providers/lzma.h b/include/providers/lzma.h
new file mode 100644
index 00000000000..8125bb8cb04
--- /dev/null
+++ b/include/providers/lzma.h
@@ -0,0 +1,102 @@
+/**
+ @file lzma.h
+ This service provides dynamic access to LZMA.
+*/
+
+#ifndef LZMA_INCLUDED
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef MYSQL_ABI_CHECK
+#include <stdbool.h>
+#include <stdint.h>
+#include <stddef.h>
+#endif
+
+#ifndef MYSQL_DYNAMIC_PLUGIN
+#define provider_service_lzma provider_service_lzma_static
+#endif
+
+#ifndef LZMA_VERSION
+typedef enum
+{
+ LZMA_OK = 0,
+ LZMA_STREAM_END = 1,
+ LZMA_NO_CHECK = 2,
+ LZMA_UNSUPPORTED_CHECK = 3,
+ LZMA_GET_CHECK = 4,
+ LZMA_MEM_ERROR = 5,
+ LZMA_MEMLIMIT_ERROR = 6,
+ LZMA_FORMAT_ERROR = 7,
+ LZMA_OPTIONS_ERROR = 8,
+ LZMA_DATA_ERROR = 9,
+ LZMA_BUF_ERROR = 10,
+ LZMA_PROG_ERROR = 11,
+} lzma_ret;
+
+typedef struct
+{
+ void *(*alloc)(void *opaque, size_t nmemb, size_t size);
+ void (*free)(void *opaque, void *ptr);
+ void *opaque;
+} lzma_allocator;
+
+typedef enum
+{
+ LZMA_CHECK_NONE = 0,
+ LZMA_CHECK_CRC32 = 1,
+ LZMA_CHECK_CRC64 = 4,
+ LZMA_CHECK_SHA256 = 10
+} lzma_check;
+
+#define lzma_stream_buffer_decode(...) provider_service_lzma->lzma_stream_buffer_decode_ptr (__VA_ARGS__)
+#define lzma_easy_buffer_encode(...) provider_service_lzma->lzma_easy_buffer_encode_ptr (__VA_ARGS__)
+#elif LZMA_VERSION < 50010030
+#define lzma_maybe_const
+#endif
+
+#ifndef lzma_maybe_const
+#define lzma_maybe_const const
+#endif
+
+#define DEFINE_lzma_stream_buffer_decode(NAME) NAME( \
+ uint64_t *memlimit, \
+ uint32_t flags, \
+ lzma_maybe_const lzma_allocator *allocator, \
+ const uint8_t *in, \
+ size_t *in_pos, \
+ size_t in_size, \
+ uint8_t *out, \
+ size_t *out_pos, \
+ size_t out_size \
+)
+
+#define DEFINE_lzma_easy_buffer_encode(NAME) NAME( \
+ uint32_t preset, \
+ lzma_check check, \
+ lzma_maybe_const lzma_allocator *allocator, \
+ const uint8_t *in, \
+ size_t in_size, \
+ uint8_t *out, \
+ size_t *out_pos, \
+ size_t out_size \
+)
+
+struct provider_service_lzma_st
+{
+ lzma_ret DEFINE_lzma_stream_buffer_decode((*lzma_stream_buffer_decode_ptr));
+ lzma_ret DEFINE_lzma_easy_buffer_encode((*lzma_easy_buffer_encode_ptr));
+
+ bool is_loaded;
+};
+
+extern struct provider_service_lzma_st *provider_service_lzma;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#define LZMA_INCLUDED
+#endif
diff --git a/include/providers/lzo/lzo1x.h b/include/providers/lzo/lzo1x.h
new file mode 100644
index 00000000000..93d1461f9cb
--- /dev/null
+++ b/include/providers/lzo/lzo1x.h
@@ -0,0 +1,62 @@
+/**
+ @file lzo/lzo1x.h
+ This service provides dynamic access to LZO.
+*/
+
+#ifndef LZO_INCLUDED
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef MYSQL_ABI_CHECK
+#include <stdbool.h>
+#endif
+
+#ifndef MYSQL_DYNAMIC_PLUGIN
+#define provider_service_lzo provider_service_lzo_static
+#endif
+
+#ifndef LZO_E_OK
+#define LZO_E_OK 0
+#define LZO_E_INTERNAL_ERROR (-99)
+
+#define LZO1X_1_15_MEM_COMPRESS ((unsigned int) (32768L * ((unsigned) sizeof(unsigned char *))))
+
+typedef size_t lzo_uint;
+
+#define lzo1x_1_15_compress(...) provider_service_lzo->lzo1x_1_15_compress_ptr (__VA_ARGS__)
+#define lzo1x_decompress_safe(...) provider_service_lzo->lzo1x_decompress_safe_ptr (__VA_ARGS__)
+#endif
+
+#define DEFINE_lzo1x_1_15_compress(NAME) NAME( \
+ const unsigned char *src, \
+ lzo_uint src_len, \
+ unsigned char *dst, \
+ lzo_uint *dst_len, \
+ void *wrkmem \
+)
+
+#define DEFINE_lzo1x_decompress_safe(NAME) NAME( \
+ const unsigned char *src, \
+ lzo_uint src_len, \
+ unsigned char *dst, \
+ lzo_uint *dst_len, \
+ void *wrkmem \
+)
+
+struct provider_service_lzo_st
+{
+ int DEFINE_lzo1x_1_15_compress((*lzo1x_1_15_compress_ptr));
+ int DEFINE_lzo1x_decompress_safe((*lzo1x_decompress_safe_ptr));
+
+ bool is_loaded;
+};
+
+extern struct provider_service_lzo_st *provider_service_lzo;
+
+#ifdef __cplusplus
+}
+#endif
+
+#define LZO_INCLUDED
+#endif
diff --git a/include/providers/snappy-c.h b/include/providers/snappy-c.h
new file mode 100644
index 00000000000..afc6aef274c
--- /dev/null
+++ b/include/providers/snappy-c.h
@@ -0,0 +1,75 @@
+/**
+ @file snappy-c.h
+ This service provides dynamic access to Snappy as a C header.
+*/
+
+#ifndef SNAPPY_C_INCLUDED
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef MYSQL_ABI_CHECK
+#include <stddef.h>
+#include <stdbool.h>
+#endif
+
+#ifndef MYSQL_DYNAMIC_PLUGIN
+#define provider_service_snappy provider_service_snappy_static
+#endif
+
+#ifndef SNAPPY_C
+typedef enum
+{
+ SNAPPY_OK = 0,
+ SNAPPY_INVALID_INPUT = 1,
+ SNAPPY_BUFFER_TOO_SMALL = 2
+} snappy_status;
+
+#define snappy_max_compressed_length(...) provider_service_snappy->snappy_max_compressed_length_ptr (__VA_ARGS__)
+#define snappy_compress(...) provider_service_snappy->snappy_compress_ptr (__VA_ARGS__)
+#define snappy_uncompressed_length(...) provider_service_snappy->snappy_uncompressed_length_ptr (__VA_ARGS__)
+#define snappy_uncompress(...) provider_service_snappy->snappy_uncompress_ptr (__VA_ARGS__)
+#endif
+
+#define DEFINE_snappy_max_compressed_length(NAME) NAME( \
+ size_t source_length \
+)
+
+#define DEFINE_snappy_compress(NAME) NAME( \
+ const char *input, \
+ size_t input_length, \
+ char *compressed, \
+ size_t *compressed_length \
+)
+
+#define DEFINE_snappy_uncompressed_length(NAME) NAME( \
+ const char *compressed, \
+ size_t compressed_length, \
+ size_t *result \
+)
+
+#define DEFINE_snappy_uncompress(NAME) NAME( \
+ const char *compressed, \
+ size_t compressed_length, \
+ char *uncompressed, \
+ size_t *uncompressed_length \
+)
+
+struct provider_service_snappy_st
+{
+ size_t DEFINE_snappy_max_compressed_length((*snappy_max_compressed_length_ptr));
+ snappy_status DEFINE_snappy_compress((*snappy_compress_ptr));
+ snappy_status DEFINE_snappy_uncompressed_length((*snappy_uncompressed_length_ptr));
+ snappy_status DEFINE_snappy_uncompress((*snappy_uncompress_ptr));
+
+ bool is_loaded;
+};
+
+extern struct provider_service_snappy_st *provider_service_snappy;
+
+#ifdef __cplusplus
+}
+#endif
+
+#define SNAPPY_C_INCLUDED
+#endif
diff --git a/include/service_versions.h b/include/service_versions.h
index 34e4952c94c..acc50e73cc6 100644
--- a/include/service_versions.h
+++ b/include/service_versions.h
@@ -44,3 +44,10 @@
#define VERSION_wsrep 0x0500
#define VERSION_json 0x0100
#define VERSION_thd_mdl 0x0100
+#define VERSION_sql_service 0x0100
+
+#define VERSION_provider_bzip2 0x0100
+#define VERSION_provider_lz4 0x0100
+#define VERSION_provider_lzma 0x0100
+#define VERSION_provider_lzo 0x0100
+#define VERSION_provider_snappy 0x0100
diff --git a/include/sql_common.h b/include/sql_common.h
index 9fc983616a0..ad5ab7e19af 100644
--- a/include/sql_common.h
+++ b/include/sql_common.h
@@ -61,13 +61,13 @@ typedef struct st_mysql_methods
MYSQL_ROW column, unsigned int field_count);
void (*flush_use_result)(MYSQL *mysql, my_bool flush_all_results);
int (*read_change_user_result)(MYSQL *mysql);
+ void (*on_close_free)(MYSQL *mysql);
#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
int (*stmt_execute)(MYSQL_STMT *stmt);
int (*read_binary_rows)(MYSQL_STMT *stmt);
int (*unbuffered_fetch)(MYSQL *mysql, char **row);
- void (*free_embedded_thd)(MYSQL *mysql);
const char *(*read_statistics)(MYSQL *mysql);
my_bool (*next_result)(MYSQL *mysql);
int (*read_rows_from_cursor)(MYSQL_STMT *stmt);
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt
index c8e75c897b9..afa1edff421 100644
--- a/libmysqld/CMakeLists.txt
+++ b/libmysqld/CMakeLists.txt
@@ -24,6 +24,7 @@ ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/tpool
${CMAKE_BINARY_DIR}/sql
${PCRE_INCLUDES}
+${LIBFMT_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR}
${SSL_INCLUDE_DIRS}
${SSL_INTERNAL_INCLUDE_DIRS}
@@ -86,7 +87,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/select_handler.cc
../sql/sql_show.cc ../sql/sql_state.c
../sql/sql_statistics.cc ../sql/sql_string.cc
- ../sql/sql_tablespace.cc ../sql/sql_table.cc ../sql/sql_test.cc
+ ../sql/sql_table.cc ../sql/sql_test.cc
../sql/ddl_log.cc
../sql/sql_trigger.cc ../sql/sql_udf.cc ../sql/sql_union.cc
../sql/sql_update.cc ../sql/sql_view.cc ../sql/sql_profile.cc
@@ -148,6 +149,9 @@ ADD_DEPENDENCIES(sql_embedded GenError GenServerSource)
IF(TARGET pcre2)
ADD_DEPENDENCIES(sql_embedded pcre2)
ENDIF()
+IF(TARGET libfmt)
+ ADD_DEPENDENCIES(sql_embedded libfmt)
+ENDIF()
# On Windows, static embedded server library is called mysqlserver.lib
# On Unix, it is libmysqld.a
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index b563d8ea2f4..5d78974c2d5 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -43,7 +43,7 @@ C_MODE_START
extern unsigned int mysql_server_last_errno;
extern char mysql_server_last_error[MYSQL_ERRMSG_SIZE];
static my_bool emb_read_query_result(MYSQL *mysql);
-static void emb_free_embedded_thd(MYSQL *mysql);
+static void free_embedded_thd(MYSQL *mysql);
static bool embedded_print_errors= 0;
extern "C" void unireg_clear(int exit_code)
@@ -121,7 +121,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
thd->killed= NOT_KILLED;
else
{
- emb_free_embedded_thd(mysql);
+ free_embedded_thd(mysql);
thd= 0;
}
}
@@ -430,7 +430,7 @@ int emb_unbuffered_fetch(MYSQL *mysql, char **row)
return 0;
}
-static void emb_free_embedded_thd(MYSQL *mysql)
+static void free_embedded_thd(MYSQL *mysql)
{
THD *thd= (THD*)mysql->thd;
server_threads.erase(thd);
@@ -453,12 +453,23 @@ static MYSQL_RES * emb_store_result(MYSQL *mysql)
return mysql_store_result(mysql);
}
-int emb_read_change_user_result(MYSQL *mysql)
+static int emb_read_change_user_result(MYSQL *mysql)
{
mysql->net.read_pos= (uchar*)""; // fake an OK packet
return mysql_errno(mysql) ? (int)packet_error : 1 /* length of the OK packet */;
}
+static void emb_on_close_free(MYSQL *mysql)
+{
+ my_free(mysql->info_buffer);
+ mysql->info_buffer= 0;
+ if (mysql->thd)
+ {
+ free_embedded_thd(mysql);
+ mysql->thd= 0;
+ }
+}
+
MYSQL_METHODS embedded_methods=
{
emb_read_query_result,
@@ -468,12 +479,12 @@ MYSQL_METHODS embedded_methods=
emb_fetch_lengths,
emb_flush_use_result,
emb_read_change_user_result,
+ emb_on_close_free,
emb_list_fields,
emb_read_prepare_result,
emb_stmt_execute,
emb_read_binary_rows,
emb_unbuffered_fetch,
- emb_free_embedded_thd,
emb_read_statistics,
emb_read_query_result,
emb_read_rows_from_cursor
diff --git a/libservices/CMakeLists.txt b/libservices/CMakeLists.txt
index 274c8ce6dac..8c559cb07f5 100644
--- a/libservices/CMakeLists.txt
+++ b/libservices/CMakeLists.txt
@@ -38,7 +38,13 @@ SET(MYSQLSERVICES_SOURCES
thd_wait_service.c
wsrep_service.c
json_service.c
- )
+ sql_service.c
+ provider_service_bzip2.c
+ provider_service_lz4.c
+ provider_service_lzma.c
+ provider_service_lzo.c
+ provider_service_snappy.c
+)
ADD_CONVENIENCE_LIBRARY(mysqlservices ${MYSQLSERVICES_SOURCES})
INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR} COMPONENT Development)
diff --git a/sql/sql_tablespace.h b/libservices/provider_service_bzip2.c
index 0760935edfc..f18ce55dd4e 100644
--- a/sql/sql_tablespace.h
+++ b/libservices/provider_service_bzip2.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (C) 2021 MariaDB
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
@@ -11,14 +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 St, Fifth Floor, Boston, MA 02110-1335 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
-#ifndef SQL_TABLESPACE_INCLUDED
-#define SQL_TABLESPACE_INCLUDED
-
-class THD;
-class st_alter_tablespace;
-
-int mysql_alter_tablespace(THD* thd, st_alter_tablespace *ts_info);
-
-#endif /* SQL_TABLESPACE_INCLUDED */
+#include <service_versions.h>
+SERVICE_VERSION provider_service_bzip2 = (void*) VERSION_provider_bzip2;
diff --git a/libservices/provider_service_lz4.c b/libservices/provider_service_lz4.c
new file mode 100644
index 00000000000..2653f86e26c
--- /dev/null
+++ b/libservices/provider_service_lz4.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2021 MariaDB
+ 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.
+ 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.
+ 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-1335 USA */
+
+#include <service_versions.h>
+SERVICE_VERSION provider_service_lz4 = (void*) VERSION_provider_lz4;
diff --git a/libservices/provider_service_lzma.c b/libservices/provider_service_lzma.c
new file mode 100644
index 00000000000..79fc982140d
--- /dev/null
+++ b/libservices/provider_service_lzma.c
@@ -0,0 +1,17 @@
+/* Copyright (C) 2021 MariaDB
+
+ 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.
+
+ 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.
+
+ 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-1335 USA */
+
+#include <service_versions.h>
+SERVICE_VERSION provider_service_lzma = (void*) VERSION_provider_lzma;
diff --git a/libservices/provider_service_lzo.c b/libservices/provider_service_lzo.c
new file mode 100644
index 00000000000..8b72ac017ea
--- /dev/null
+++ b/libservices/provider_service_lzo.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2021 MariaDB
+ 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.
+ 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.
+ 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-1335 USA */
+
+#include <service_versions.h>
+SERVICE_VERSION provider_service_lzo = (void*) VERSION_provider_lzo;
diff --git a/libservices/provider_service_snappy.c b/libservices/provider_service_snappy.c
new file mode 100644
index 00000000000..ac0415bad61
--- /dev/null
+++ b/libservices/provider_service_snappy.c
@@ -0,0 +1,17 @@
+/* Copyright (C) 2021 MariaDB
+
+ 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.
+
+ 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.
+
+ 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-1335 USA */
+
+#include <service_versions.h>
+SERVICE_VERSION provider_service_snappy= (void*) VERSION_provider_snappy;
diff --git a/libservices/sql_service.c b/libservices/sql_service.c
new file mode 100644
index 00000000000..5c0102bfadf
--- /dev/null
+++ b/libservices/sql_service.c
@@ -0,0 +1,19 @@
+
+/* Copyright (c) 2018, Monty Program Ab
+
+ 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.
+
+ 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.
+
+ 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
+*/
+
+#include <service_versions.h>
+SERVICE_VERSION sql_service= (void*)VERSION_sql_service;
diff --git a/man/mysql-stress-test.pl.1 b/man/mysql-stress-test.pl.1
index d69f6123488..a55c5a652a3 100644
--- a/man/mysql-stress-test.pl.1
+++ b/man/mysql-stress-test.pl.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL\-STRESS\-TE" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMYSQL\-STRESS\-TE" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql-test-run.pl.1 b/man/mysql-test-run.pl.1
index b13727c3298..8b2fb5f3a21 100644
--- a/man/mysql-test-run.pl.1
+++ b/man/mysql-test-run.pl.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL\-TEST\-RUN\" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMYSQL\-TEST\-RUN\" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql.1 b/man/mysql.1
index e58f4c8365b..dc93ef8092e 100644
--- a/man/mysql.1
+++ b/man/mysql.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql.server.1 b/man/mysql.server.1
index 4b99aadb0b3..4a5c24deda2 100644
--- a/man/mysql.server.1
+++ b/man/mysql.server.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL\&.SERVER\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMYSQL\&.SERVER\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_client_test.1 b/man/mysql_client_test.1
index 399cef3ae19..484cd566dee 100644
--- a/man/mysql_client_test.1
+++ b/man/mysql_client_test.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-CLIENT-TEST" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-CLIENT-TEST" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_config.1 b/man/mysql_config.1
index 90b09cb5d4b..5dbe2c2140c 100644
--- a/man/mysql_config.1
+++ b/man/mysql_config.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQL_CONFIG\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMYSQL_CONFIG\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_convert_table_format.1 b/man/mysql_convert_table_format.1
index e43a7436e9b..de2d5478fa3 100644
--- a/man/mysql_convert_table_format.1
+++ b/man/mysql_convert_table_format.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-CONVERT-TAB" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-CONVERT-TAB" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_find_rows.1 b/man/mysql_find_rows.1
index c8563d6097b..1a968aae5af 100644
--- a/man/mysql_find_rows.1
+++ b/man/mysql_find_rows.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-FIND-ROWS\F" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-FIND-ROWS\F" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_fix_extensions.1 b/man/mysql_fix_extensions.1
index 4c8f1b58f99..9321a6d6fbe 100644
--- a/man/mysql_fix_extensions.1
+++ b/man/mysql_fix_extensions.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-FIX-EXTENSI" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-FIX-EXTENSI" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_install_db.1 b/man/mysql_install_db.1
index f826b2b787f..547b568e3f9 100644
--- a/man/mysql_install_db.1
+++ b/man/mysql_install_db.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-INSTALL-DB\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-INSTALL-DB\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_ldb.1 b/man/mysql_ldb.1
index 2ef7bd3170e..24302e13139 100644
--- a/man/mysql_ldb.1
+++ b/man/mysql_ldb.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-LDB\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-LDB\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_plugin.1 b/man/mysql_plugin.1
index 62a0d2e09a1..3009fc1361f 100644
--- a/man/mysql_plugin.1
+++ b/man/mysql_plugin.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-PLUGIN\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-PLUGIN\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
diff --git a/man/mysql_secure_installation.1 b/man/mysql_secure_installation.1
index b1bcb5b06b2..88cd2a8944c 100644
--- a/man/mysql_secure_installation.1
+++ b/man/mysql_secure_installation.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-SECURE-INST" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-SECURE-INST" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_setpermission.1 b/man/mysql_setpermission.1
index e9cf8043606..33f8c58cb0e 100644
--- a/man/mysql_setpermission.1
+++ b/man/mysql_setpermission.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-SETPERMISSI" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-SETPERMISSI" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_tzinfo_to_sql.1 b/man/mysql_tzinfo_to_sql.1
index 4882d11c044..90e91431edb 100644
--- a/man/mysql_tzinfo_to_sql.1
+++ b/man/mysql_tzinfo_to_sql.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-TZINFO-TO-S" "1" "22 April 2022" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-TZINFO-TO-S" "1" "22 April 2022" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_upgrade.1 b/man/mysql_upgrade.1
index 1f21c4af90d..465c905ae6e 100644
--- a/man/mysql_upgrade.1
+++ b/man/mysql_upgrade.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-UPGRADE\FR" "1" "20 July 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-UPGRADE\FR" "1" "20 July 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysql_waitpid.1 b/man/mysql_waitpid.1
index 6c7b74faa3a..9a2dcb72acb 100644
--- a/man/mysql_waitpid.1
+++ b/man/mysql_waitpid.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-WAITPID\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-WAITPID\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqlaccess.1 b/man/mysqlaccess.1
index a38cd6c9e44..6c2ff84c777 100644
--- a/man/mysqlaccess.1
+++ b/man/mysqlaccess.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-ACCESS\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-ACCESS\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqladmin.1 b/man/mysqladmin.1
index ebd60e73c07..ae2fbf9ba8e 100644
--- a/man/mysqladmin.1
+++ b/man/mysqladmin.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-ADMIN\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-ADMIN\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqlbinlog.1 b/man/mysqlbinlog.1
index 9aae9798881..aed6925c787 100644
--- a/man/mysqlbinlog.1
+++ b/man/mysqlbinlog.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-BINLOG\FR" "1" "14 April 2021" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-BINLOG\FR" "1" "14 April 2021" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqlcheck.1 b/man/mysqlcheck.1
index 17217907c0c..b273dee9312 100644
--- a/man/mysqlcheck.1
+++ b/man/mysqlcheck.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-CHECK\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-CHECK\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqld.8 b/man/mysqld.8
index 83a4efb5895..8857c5961c4 100644
--- a/man/mysqld.8
+++ b/man/mysqld.8
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADBD\FR" "8" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADBD\FR" "8" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqld_multi.1 b/man/mysqld_multi.1
index 729df284595..3c5bca5a07b 100644
--- a/man/mysqld_multi.1
+++ b/man/mysqld_multi.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-MULTI\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-MULTI\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqld_safe.1 b/man/mysqld_safe.1
index c875d775278..36d6eb82faf 100644
--- a/man/mysqld_safe.1
+++ b/man/mysqld_safe.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-SAFE\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-SAFE\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqld_safe_helper.1 b/man/mysqld_safe_helper.1
index a94f3d98a17..93bea715a34 100644
--- a/man/mysqld_safe_helper.1
+++ b/man/mysqld_safe_helper.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-SAFE-HELPER\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-SAFE-HELPER\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqldump.1 b/man/mysqldump.1
index 58e56b382e7..8dcce60b0d9 100644
--- a/man/mysqldump.1
+++ b/man/mysqldump.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-DUMP\FR" "1" "24 October 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-DUMP\FR" "1" "24 October 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqldumpslow.1 b/man/mysqldumpslow.1
index 29340aae34e..f93bcfac979 100644
--- a/man/mysqldumpslow.1
+++ b/man/mysqldumpslow.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-DUMPSLOW\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-DUMPSLOW\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqlhotcopy.1 b/man/mysqlhotcopy.1
index 2199b45d942..eb8d8caa39c 100644
--- a/man/mysqlhotcopy.1
+++ b/man/mysqlhotcopy.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-HOTCOPY\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-HOTCOPY\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqlimport.1 b/man/mysqlimport.1
index 6e6649765cd..5c2a03df843 100644
--- a/man/mysqlimport.1
+++ b/man/mysqlimport.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-IMPORT\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-IMPORT\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqlshow.1 b/man/mysqlshow.1
index ba403c24ee8..15a4a2fa4d3 100644
--- a/man/mysqlshow.1
+++ b/man/mysqlshow.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-SHOW\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-SHOW\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqlslap.1 b/man/mysqlslap.1
index 5f7439442a4..1658fd7c2f0 100644
--- a/man/mysqlslap.1
+++ b/man/mysqlslap.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-SLAP\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-SLAP\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/man/mysqltest.1 b/man/mysqltest.1
index e641cf5b912..73a466370b4 100644
--- a/man/mysqltest.1
+++ b/man/mysqltest.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMARIADB-TEST\FR" "1" "15 May 2020" "MariaDB 10\&.6" "MariaDB Database System"
+.TH "\FBMARIADB-TEST\FR" "1" "15 May 2020" "MariaDB 10\&.7" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/mysql-test/collections/skip_list_ubsan.txt b/mysql-test/collections/skip_list_ubsan.txt
new file mode 100644
index 00000000000..dc178574293
--- /dev/null
+++ b/mysql-test/collections/skip_list_ubsan.txt
@@ -0,0 +1,3 @@
+binlog.binlog_truncate_active_log : MDEV-26919 - undefined value
+main.json_normalize : MDEV-27415 - out of bounds
+main.json_equals : MDEV-27415 - out of bounds
diff --git a/mysql-test/include/binlog_combinations.combinations b/mysql-test/include/binlog_combinations.combinations
new file mode 100644
index 00000000000..07042c2cbec
--- /dev/null
+++ b/mysql-test/include/binlog_combinations.combinations
@@ -0,0 +1,8 @@
+[row]
+binlog-format=row
+
+[stmt]
+binlog-format=statement
+
+[mix]
+binlog-format=mixed
diff --git a/mysql-test/include/binlog_combinations.inc b/mysql-test/include/binlog_combinations.inc
new file mode 100644
index 00000000000..2ddd787681a
--- /dev/null
+++ b/mysql-test/include/binlog_combinations.inc
@@ -0,0 +1,5 @@
+# The goal of including this file is to test with different
+# binlog combinations: row, stmt or mix
+# (see include/binlog_combinations.combinations)
+
+--source include/have_log_bin.inc
diff --git a/mysql-test/include/ctype_ascii_order.inc b/mysql-test/include/ctype_ascii_order.inc
index 93127a7195f..b85cab687ae 100644
--- a/mysql-test/include/ctype_ascii_order.inc
+++ b/mysql-test/include/ctype_ascii_order.inc
@@ -4,11 +4,16 @@ drop table if exists t1;
create table t1 select repeat('a',10) as c1;
delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
-SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1;
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
drop table t1;
+drop view v1;
diff --git a/mysql-test/include/lcase_names.combinations b/mysql-test/include/lcase_names.combinations
new file mode 100644
index 00000000000..7fd344eab3f
--- /dev/null
+++ b/mysql-test/include/lcase_names.combinations
@@ -0,0 +1,5 @@
+[lcase_def]
+[lcase1]
+lower_case_table_names=1
+[lcase2]
+lower_case_table_names=2
diff --git a/mysql-test/include/lcase_names.inc b/mysql-test/include/lcase_names.inc
new file mode 100644
index 00000000000..983e2678d29
--- /dev/null
+++ b/mysql-test/include/lcase_names.inc
@@ -0,0 +1,2 @@
+# The goal of including this file is to test with different
+# lower_case_table_names modes (see include/lcase_name.combinations)
diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql
index b330ff448a4..5d73d1f59f1 100644
--- a/mysql-test/include/mtr_check.sql
+++ b/mysql-test/include/mtr_check.sql
@@ -99,7 +99,8 @@ BEGIN
mysql.global_priv;
-- verify that no plugin changed its disabled/enabled state
- SELECT * FROM INFORMATION_SCHEMA.PLUGINS;
+ SELECT * FROM INFORMATION_SCHEMA.PLUGINS
+ WHERE PLUGIN_STATUS != 'INACTIVE';
select * from information_schema.session_variables
where variable_name = 'debug_sync';
diff --git a/mysql-test/include/show_slave_status.inc b/mysql-test/include/show_slave_status.inc
index ba2e1b0c48a..429ed8a5abd 100644
--- a/mysql-test/include/show_slave_status.inc
+++ b/mysql-test/include/show_slave_status.inc
@@ -102,6 +102,10 @@ if ($all_slaves_status)
if ($slave_name)
{
--let $_show_query=SHOW SLAVE $slave_name STATUS
+ if ($for_channel)
+ {
+ --let $_show_query=SHOW SLAVE STATUS for channel $slave_name
+ }
}
diff --git a/mysql-test/include/wait_for_sql_thread_read_all.inc b/mysql-test/include/wait_for_sql_thread_read_all.inc
index 1bbb006f3a8..1829591c5d1 100644
--- a/mysql-test/include/wait_for_sql_thread_read_all.inc
+++ b/mysql-test/include/wait_for_sql_thread_read_all.inc
@@ -1,6 +1,12 @@
+# This script ensures that a slave has executed everything in the relay log
+# files. This can be used to ensure slave is in a predicate place after
+# a FLUSH RELAY LOGS command.
+# Note that this script does not guarantee that the slave has read everything
+# from the master(s). If this is needed on should use the sync_with_master
+# command or the sync_with_master script.
+
--let $show_statement = show all slaves status
--let $field = Slave_SQL_State
--let $condition = = 'Slave has read all relay log; waiting for more updates'
--let $wait_for_all = 1
--source include/wait_show_condition.inc
-
diff --git a/mysql-test/main/alter_table.result b/mysql-test/main/alter_table.result
index 385fd4526a1..4a88aead022 100644
--- a/mysql-test/main/alter_table.result
+++ b/mysql-test/main/alter_table.result
@@ -3093,3 +3093,18 @@ drop table t1;
#
# End of 10.5 tests
#
+#
+# MDEV-26767 Server crashes when rename table and alter storage engine
+#
+alter table txxx engine=innodb, rename to tyyy;
+ERROR 42S02: Table 'test.txxx' doesn't exist
+#
+# MDEV-27048 UBSAN: runtime error: shift exponent 32 is too large for 32-bit type 'unsigned int'
+#
+CREATE TABLE t (a INT,b INT,c INT,x TEXT,y TEXT,z TEXT,id INT UNSIGNED AUTO_INCREMENT,i INT,KEY(id),UNIQUE KEY a (a,b,c));
+ALTER TABLE t ADD CONSTRAINT test UNIQUE (id) USING HASH;
+ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the USING HASH clause of `id`
+DROP TABLE t;
+#
+# End of 10.7 tests
+#
diff --git a/mysql-test/main/alter_table.test b/mysql-test/main/alter_table.test
index b339da5edb2..05e04f11f9e 100644
--- a/mysql-test/main/alter_table.test
+++ b/mysql-test/main/alter_table.test
@@ -1965,7 +1965,7 @@ show create table t1;
drop table t1;
create table t1 (a int, b int, c int, unique(a,b));
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop column a;
alter table t1 drop column a, drop index a;
show create table t1;
@@ -2379,3 +2379,21 @@ drop table t1;
--echo #
--echo # End of 10.5 tests
--echo #
+
+--echo #
+--echo # MDEV-26767 Server crashes when rename table and alter storage engine
+--echo #
+--error ER_NO_SUCH_TABLE
+alter table txxx engine=innodb, rename to tyyy;
+
+--echo #
+--echo # MDEV-27048 UBSAN: runtime error: shift exponent 32 is too large for 32-bit type 'unsigned int'
+--echo #
+CREATE TABLE t (a INT,b INT,c INT,x TEXT,y TEXT,z TEXT,id INT UNSIGNED AUTO_INCREMENT,i INT,KEY(id),UNIQUE KEY a (a,b,c));
+--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+ALTER TABLE t ADD CONSTRAINT test UNIQUE (id) USING HASH;
+DROP TABLE t;
+
+--echo #
+--echo # End of 10.7 tests
+--echo #
diff --git a/mysql-test/main/assign_key_cache.result b/mysql-test/main/assign_key_cache.result
index 4ed6170136b..32d7bc2c0b8 100644
--- a/mysql-test/main/assign_key_cache.result
+++ b/mysql-test/main/assign_key_cache.result
@@ -3,7 +3,7 @@ create table t1 (i int) engine=myisam partition by hash (i) partitions 2;
xa start 'xid';
cache index t1 partition (non_existing_partition) in my_cache;
Table Op Msg_type Msg_text
-test.t1 assign_to_keycache error Error in list of partitions to test.t1
+test.t1 assign_to_keycache error Wrong partition name or partition list
cache index t1 partition (p1) in my_cache;
Table Op Msg_type Msg_text
test.t1 assign_to_keycache status OK
diff --git a/mysql-test/main/count_distinct.result b/mysql-test/main/count_distinct.result
index 760b2710586..037674aa66a 100644
--- a/mysql-test/main/count_distinct.result
+++ b/mysql-test/main/count_distinct.result
@@ -1,4 +1,3 @@
-drop table if exists t1,t2,t3;
create table t1 (libname varchar(21) not null, city text, primary key (libname));
create table t2 (isbn varchar(21) not null, author text, title text, primary key (isbn));
create table t3 (isbn varchar(21) not null, libname varchar(21) not null, quantity int ,primary key (isbn,libname));
@@ -131,3 +130,16 @@ count(distinct a)
10
drop table t1;
set @@tmp_table_size = default;
+#
+# End of 5.5 tests
+#
+#
+# MDEV-26452 SIGSEGV in Item::cleanup from Item::cleanup_processor
+#
+create table t (a int,b date,primary key(a,b));
+select b,count(distinct a) from t group by b having b is null;
+b count(distinct a)
+drop table t;
+#
+# End of 10.7 tests
+#
diff --git a/mysql-test/main/count_distinct.test b/mysql-test/main/count_distinct.test
index 86045e862e7..9f682af3d63 100644
--- a/mysql-test/main/count_distinct.test
+++ b/mysql-test/main/count_distinct.test
@@ -2,10 +2,6 @@
# Problem with count(distinct)
#
---disable_warnings
-drop table if exists t1,t2,t3;
---enable_warnings
-
create table t1 (libname varchar(21) not null, city text, primary key (libname));
create table t2 (isbn varchar(21) not null, author text, title text, primary key (isbn));
create table t3 (isbn varchar(21) not null, libname varchar(21) not null, quantity int ,primary key (isbn,libname));
@@ -149,6 +145,17 @@ select count(distinct a) from t1;
drop table t1;
set @@tmp_table_size = default;
-#
-# End of 5.5 tests
-#
+--echo #
+--echo # End of 5.5 tests
+--echo #
+
+--echo #
+--echo # MDEV-26452 SIGSEGV in Item::cleanup from Item::cleanup_processor
+--echo #
+create table t (a int,b date,primary key(a,b));
+select b,count(distinct a) from t group by b having b is null;
+drop table t;
+
+--echo #
+--echo # End of 10.7 tests
+--echo #
diff --git a/mysql-test/main/create.test b/mysql-test/main/create.test
index 5f84e282570..a6364e5217e 100644
--- a/mysql-test/main/create.test
+++ b/mysql-test/main/create.test
@@ -741,7 +741,7 @@ create table t1 select * from t1;
--error ER_CANT_AGGREGATE_2COLLATIONS
create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin);
# Error during table creation
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
create table t1 (primary key(a)) select "b" as b;
# Error in select_create::prepare() which is not related to table creation
create table t1 (a int);
diff --git a/mysql-test/main/ctype_big5.result b/mysql-test/main/ctype_big5.result
index 81fb31df041..021ad6e76c0 100644
--- a/mysql-test/main/ctype_big5.result
+++ b/mysql-test/main/ctype_big5.result
@@ -246,14 +246,53 @@ DROP TABLE t1;
drop table if exists t1;
create table t1 select repeat('a',10) as c1;
delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
-SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1;
-GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 big5_chinese_ci
+name big5_chinese_ci
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
20
! 21
" 22
@@ -321,8 +360,9 @@ _ 5F
{ 7B
| 7C
} 7D
- 7F
+<7F> 7F
drop table t1;
+drop view v1;
SELECT strcmp('a','a '), strcmp('a ','a');
strcmp('a','a ') strcmp('a ','a')
0 0
@@ -479,6 +519,154 @@ a hex(b) c
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL
DROP TABLE t1;
+drop table if exists t1;
+create table t1 select repeat('a',10) as c1;
+delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 big5_bin
+name big5_bin
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
+ 20
+! 21
+" 22
+# 23
+$ 24
+% 25
+& 26
+' 27
+( 28
+) 29
+* 2A
++ 2B
+, 2C
+- 2D
+. 2E
+/ 2F
+0 30
+1 31
+2 32
+3 33
+4 34
+5 35
+6 36
+7 37
+8 38
+9 39
+: 3A
+; 3B
+< 3C
+= 3D
+> 3E
+? 3F
+@ 40
+A 41
+B 42
+C 43
+D 44
+E 45
+F 46
+G 47
+H 48
+I 49
+J 4A
+K 4B
+L 4C
+M 4D
+N 4E
+O 4F
+P 50
+Q 51
+R 52
+S 53
+T 54
+U 55
+V 56
+W 57
+X 58
+Y 59
+Z 5A
+[ 5B
+\ 5C
+] 5D
+^ 5E
+_ 5F
+` 60
+a 61
+b 62
+c 63
+d 64
+e 65
+f 66
+g 67
+h 68
+i 69
+j 6A
+k 6B
+l 6C
+m 6D
+n 6E
+o 6F
+p 70
+q 71
+r 72
+s 73
+t 74
+u 75
+v 76
+w 77
+x 78
+y 79
+z 7A
+{ 7B
+| 7C
+} 7D
+~ 7E
+<7F> 7F
+drop table t1;
+drop view v1;
SELECT strcmp('a','a '), strcmp('a ','a');
strcmp('a','a ') strcmp('a ','a')
0 0
diff --git a/mysql-test/main/ctype_big5.test b/mysql-test/main/ctype_big5.test
index 41991258886..385f1c21439 100644
--- a/mysql-test/main/ctype_big5.test
+++ b/mysql-test/main/ctype_big5.test
@@ -24,6 +24,7 @@ SET collation_connection='big5_bin';
-- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
+-- source include/ctype_ascii_order.inc
-- source include/ctype_pad_space.inc
#
diff --git a/mysql-test/main/ctype_cp932.result b/mysql-test/main/ctype_cp932.result
index 952130cf11c..ff1dd814970 100644
--- a/mysql-test/main/ctype_cp932.result
+++ b/mysql-test/main/ctype_cp932.result
@@ -598,6 +598,281 @@ SET DEFAULT_STORAGE_ENGINE=Default;
# End of 10.2 tests
#
#
+# General tests
+#
+SET NAMES cp932;
+drop table if exists t1;
+create table t1 select repeat('a',10) as c1;
+delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 cp932_japanese_ci
+name cp932_japanese_ci
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
+ 20
+! 21
+" 22
+# 23
+$ 24
+% 25
+& 26
+' 27
+( 28
+) 29
+* 2A
++ 2B
+, 2C
+- 2D
+. 2E
+/ 2F
+0 30
+1 31
+2 32
+3 33
+4 34
+5 35
+6 36
+7 37
+8 38
+9 39
+: 3A
+; 3B
+< 3C
+= 3D
+> 3E
+? 3F
+@ 40
+Aa 41,61
+Bb 42,62
+Cc 43,63
+Dd 44,64
+Ee 45,65
+Ff 46,66
+Gg 47,67
+Hh 48,68
+Ii 49,69
+Jj 4A,6A
+Kk 4B,6B
+Ll 4C,6C
+Mm 4D,6D
+Nn 4E,6E
+Oo 4F,6F
+Pp 50,70
+Qq 51,71
+Rr 52,72
+Ss 53,73
+Tt 54,74
+Uu 55,75
+Vv 56,76
+Ww 57,77
+Xx 58,78
+Yy 59,79
+Zz 5A,7A
+[ 5B
+\ 5C
+] 5D
+^ 5E
+_ 5F
+` 60
+{ 7B
+| 7C
+} 7D
+~ 7E
+<7F> 7F
+drop table t1;
+drop view v1;
+SET NAMES cp932 COLLATE cp932_bin;
+drop table if exists t1;
+create table t1 select repeat('a',10) as c1;
+delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 cp932_bin
+name cp932_bin
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
+ 20
+! 21
+" 22
+# 23
+$ 24
+% 25
+& 26
+' 27
+( 28
+) 29
+* 2A
++ 2B
+, 2C
+- 2D
+. 2E
+/ 2F
+0 30
+1 31
+2 32
+3 33
+4 34
+5 35
+6 36
+7 37
+8 38
+9 39
+: 3A
+; 3B
+< 3C
+= 3D
+> 3E
+? 3F
+@ 40
+A 41
+B 42
+C 43
+D 44
+E 45
+F 46
+G 47
+H 48
+I 49
+J 4A
+K 4B
+L 4C
+M 4D
+N 4E
+O 4F
+P 50
+Q 51
+R 52
+S 53
+T 54
+U 55
+V 56
+W 57
+X 58
+Y 59
+Z 5A
+[ 5B
+\ 5C
+] 5D
+^ 5E
+_ 5F
+` 60
+a 61
+b 62
+c 63
+d 64
+e 65
+f 66
+g 67
+h 68
+i 69
+j 6A
+k 6B
+l 6C
+m 6D
+n 6E
+o 6F
+p 70
+q 71
+r 72
+s 73
+t 74
+u 75
+v 76
+w 77
+x 78
+y 79
+z 7A
+{ 7B
+| 7C
+} 7D
+~ 7E
+<7F> 7F
+drop table t1;
+drop view v1;
+#
# Start of 10.5 tests
#
#
diff --git a/mysql-test/main/ctype_cp932.test b/mysql-test/main/ctype_cp932.test
index 0f5ff437d33..2ccbe8f1582 100644
--- a/mysql-test/main/ctype_cp932.test
+++ b/mysql-test/main/ctype_cp932.test
@@ -50,6 +50,15 @@ let $coll_pad='cp932_bin';
--echo #
+--echo # General tests
+--echo #
+SET NAMES cp932;
+-- source include/ctype_ascii_order.inc
+SET NAMES cp932 COLLATE cp932_bin;
+-- source include/ctype_ascii_order.inc
+
+
+--echo #
--echo # Start of 10.5 tests
--echo #
diff --git a/mysql-test/main/ctype_eucjpms.result b/mysql-test/main/ctype_eucjpms.result
index db445838102..a7688be6ad0 100644
--- a/mysql-test/main/ctype_eucjpms.result
+++ b/mysql-test/main/ctype_eucjpms.result
@@ -2,6 +2,281 @@ drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
drop table if exists t4;
+#
+# General tests
+#
+SET NAMES eucjpms;
+drop table if exists t1;
+create table t1 select repeat('a',10) as c1;
+delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 eucjpms_japanese_ci
+name eucjpms_japanese_ci
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
+ 20
+! 21
+" 22
+# 23
+$ 24
+% 25
+& 26
+' 27
+( 28
+) 29
+* 2A
++ 2B
+, 2C
+- 2D
+. 2E
+/ 2F
+0 30
+1 31
+2 32
+3 33
+4 34
+5 35
+6 36
+7 37
+8 38
+9 39
+: 3A
+; 3B
+< 3C
+= 3D
+> 3E
+? 3F
+@ 40
+Aa 41,61
+Bb 42,62
+Cc 43,63
+Dd 44,64
+Ee 45,65
+Ff 46,66
+Gg 47,67
+Hh 48,68
+Ii 49,69
+Jj 4A,6A
+Kk 4B,6B
+Ll 4C,6C
+Mm 4D,6D
+Nn 4E,6E
+Oo 4F,6F
+Pp 50,70
+Qq 51,71
+Rr 52,72
+Ss 53,73
+Tt 54,74
+Uu 55,75
+Vv 56,76
+Ww 57,77
+Xx 58,78
+Yy 59,79
+Zz 5A,7A
+[ 5B
+\ 5C
+] 5D
+^ 5E
+_ 5F
+` 60
+{ 7B
+| 7C
+} 7D
+~ 7E
+<7F> 7F
+drop table t1;
+drop view v1;
+SET NAMES eucjpms COLLATE eucjpms_bin;
+drop table if exists t1;
+create table t1 select repeat('a',10) as c1;
+delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 eucjpms_bin
+name eucjpms_bin
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
+ 20
+! 21
+" 22
+# 23
+$ 24
+% 25
+& 26
+' 27
+( 28
+) 29
+* 2A
++ 2B
+, 2C
+- 2D
+. 2E
+/ 2F
+0 30
+1 31
+2 32
+3 33
+4 34
+5 35
+6 36
+7 37
+8 38
+9 39
+: 3A
+; 3B
+< 3C
+= 3D
+> 3E
+? 3F
+@ 40
+A 41
+B 42
+C 43
+D 44
+E 45
+F 46
+G 47
+H 48
+I 49
+J 4A
+K 4B
+L 4C
+M 4D
+N 4E
+O 4F
+P 50
+Q 51
+R 52
+S 53
+T 54
+U 55
+V 56
+W 57
+X 58
+Y 59
+Z 5A
+[ 5B
+\ 5C
+] 5D
+^ 5E
+_ 5F
+` 60
+a 61
+b 62
+c 63
+d 64
+e 65
+f 66
+g 67
+h 68
+i 69
+j 6A
+k 6B
+l 6C
+m 6D
+n 6E
+o 6F
+p 70
+q 71
+r 72
+s 73
+t 74
+u 75
+v 76
+w 77
+x 78
+y 79
+z 7A
+{ 7B
+| 7C
+} 7D
+~ 7E
+<7F> 7F
+drop table t1;
+drop view v1;
set names eucjpms;
set character_set_database = eucjpms;
CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = eucjpms;
diff --git a/mysql-test/main/ctype_eucjpms.test b/mysql-test/main/ctype_eucjpms.test
index 6af72270853..393534182dc 100644
--- a/mysql-test/main/ctype_eucjpms.test
+++ b/mysql-test/main/ctype_eucjpms.test
@@ -8,6 +8,14 @@ drop table if exists t3;
drop table if exists t4;
--enable_warnings
+--echo #
+--echo # General tests
+--echo #
+SET NAMES eucjpms;
+-- source include/ctype_ascii_order.inc
+SET NAMES eucjpms COLLATE eucjpms_bin;
+-- source include/ctype_ascii_order.inc
+
set names eucjpms;
set character_set_database = eucjpms;
diff --git a/mysql-test/main/ctype_euckr.result b/mysql-test/main/ctype_euckr.result
index 37b7e86543f..f349b9c25e0 100644
--- a/mysql-test/main/ctype_euckr.result
+++ b/mysql-test/main/ctype_euckr.result
@@ -243,6 +243,128 @@ a hex(b) c
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL
DROP TABLE t1;
+drop table if exists t1;
+create table t1 select repeat('a',10) as c1;
+delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 euckr_korean_ci
+name euckr_korean_ci
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
+ 20
+! 21
+" 22
+# 23
+$ 24
+% 25
+& 26
+' 27
+( 28
+) 29
+* 2A
++ 2B
+, 2C
+- 2D
+. 2E
+/ 2F
+0 30
+1 31
+2 32
+3 33
+4 34
+5 35
+6 36
+7 37
+8 38
+9 39
+: 3A
+; 3B
+< 3C
+= 3D
+> 3E
+? 3F
+@ 40
+Aa 41,61
+Bb 42,62
+Cc 43,63
+Dd 44,64
+Ee 45,65
+Ff 46,66
+Gg 47,67
+Hh 48,68
+Ii 49,69
+Jj 4A,6A
+Kk 4B,6B
+Ll 4C,6C
+Mm 4D,6D
+Nn 4E,6E
+Oo 4F,6F
+Pp 50,70
+Qq 51,71
+Rr 52,72
+Ss 53,73
+Tt 54,74
+Uu 55,75
+Vv 56,76
+Ww 57,77
+Xx 58,78
+Yy 59,79
+Zz 5A,7A
+[ 5B
+\ 5C
+] 5D
+^ 5E
+_ 5F
+` 60
+{ 7B
+| 7C
+} 7D
+~ 7E
+<7F> 7F
+drop table t1;
+drop view v1;
SET collation_connection='euckr_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
@@ -384,6 +506,154 @@ a hex(b) c
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL
DROP TABLE t1;
+drop table if exists t1;
+create table t1 select repeat('a',10) as c1;
+delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 euckr_bin
+name euckr_bin
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
+ 20
+! 21
+" 22
+# 23
+$ 24
+% 25
+& 26
+' 27
+( 28
+) 29
+* 2A
++ 2B
+, 2C
+- 2D
+. 2E
+/ 2F
+0 30
+1 31
+2 32
+3 33
+4 34
+5 35
+6 36
+7 37
+8 38
+9 39
+: 3A
+; 3B
+< 3C
+= 3D
+> 3E
+? 3F
+@ 40
+A 41
+B 42
+C 43
+D 44
+E 45
+F 46
+G 47
+H 48
+I 49
+J 4A
+K 4B
+L 4C
+M 4D
+N 4E
+O 4F
+P 50
+Q 51
+R 52
+S 53
+T 54
+U 55
+V 56
+W 57
+X 58
+Y 59
+Z 5A
+[ 5B
+\ 5C
+] 5D
+^ 5E
+_ 5F
+` 60
+a 61
+b 62
+c 63
+d 64
+e 65
+f 66
+g 67
+h 68
+i 69
+j 6A
+k 6B
+l 6C
+m 6D
+n 6E
+o 6F
+p 70
+q 71
+r 72
+s 73
+t 74
+u 75
+v 76
+w 77
+x 78
+y 79
+z 7A
+{ 7B
+| 7C
+} 7D
+~ 7E
+<7F> 7F
+drop table t1;
+drop view v1;
SET NAMES euckr;
CREATE TABLE t1 (a text) character set euckr;
INSERT INTO t1 VALUES (0xA2E6),(0xFEF7);
diff --git a/mysql-test/main/ctype_euckr.test b/mysql-test/main/ctype_euckr.test
index 1154047fdb0..e4f07081dba 100644
--- a/mysql-test/main/ctype_euckr.test
+++ b/mysql-test/main/ctype_euckr.test
@@ -17,11 +17,13 @@ SET collation_connection='euckr_korean_ci';
-- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
+-- source include/ctype_ascii_order.inc
SET collation_connection='euckr_bin';
-- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
+-- source include/ctype_ascii_order.inc
#
# Bug#15377 Valid multibyte sequences are truncated on INSERT
diff --git a/mysql-test/main/ctype_gb2312.result b/mysql-test/main/ctype_gb2312.result
index 42a837b37e1..cdfe6370784 100644
--- a/mysql-test/main/ctype_gb2312.result
+++ b/mysql-test/main/ctype_gb2312.result
@@ -246,14 +246,53 @@ DROP TABLE t1;
drop table if exists t1;
create table t1 select repeat('a',10) as c1;
delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
-SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1;
-GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 gb2312_chinese_ci
+name gb2312_chinese_ci
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
20
! 21
" 22
@@ -322,8 +361,9 @@ _ 5F
{ 7B
| 7C
} 7D
- 7F
+<7F> 7F
drop table t1;
+drop view v1;
SET collation_connection='gb2312_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
@@ -465,6 +505,154 @@ a hex(b) c
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL
DROP TABLE t1;
+drop table if exists t1;
+create table t1 select repeat('a',10) as c1;
+delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 gb2312_bin
+name gb2312_bin
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
+ 20
+! 21
+" 22
+# 23
+$ 24
+% 25
+& 26
+' 27
+( 28
+) 29
+* 2A
++ 2B
+, 2C
+- 2D
+. 2E
+/ 2F
+0 30
+1 31
+2 32
+3 33
+4 34
+5 35
+6 36
+7 37
+8 38
+9 39
+: 3A
+; 3B
+< 3C
+= 3D
+> 3E
+? 3F
+@ 40
+A 41
+B 42
+C 43
+D 44
+E 45
+F 46
+G 47
+H 48
+I 49
+J 4A
+K 4B
+L 4C
+M 4D
+N 4E
+O 4F
+P 50
+Q 51
+R 52
+S 53
+T 54
+U 55
+V 56
+W 57
+X 58
+Y 59
+Z 5A
+[ 5B
+\ 5C
+] 5D
+^ 5E
+_ 5F
+` 60
+a 61
+b 62
+c 63
+d 64
+e 65
+f 66
+g 67
+h 68
+i 69
+j 6A
+k 6B
+l 6C
+m 6D
+n 6E
+o 6F
+p 70
+q 71
+r 72
+s 73
+t 74
+u 75
+v 76
+w 77
+x 78
+y 79
+z 7A
+{ 7B
+| 7C
+} 7D
+~ 7E
+<7F> 7F
+drop table t1;
+drop view v1;
SET NAMES gb2312;
CREATE TABLE t1 (a text) character set gb2312;
INSERT INTO t1 VALUES (0xA2A1),(0xD7FE);
diff --git a/mysql-test/main/ctype_gb2312.test b/mysql-test/main/ctype_gb2312.test
index 07460116ade..6224b8c1cf1 100644
--- a/mysql-test/main/ctype_gb2312.test
+++ b/mysql-test/main/ctype_gb2312.test
@@ -23,6 +23,7 @@ SET collation_connection='gb2312_bin';
-- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
+-- source include/ctype_ascii_order.inc
#
# Bug#15377 Valid multibyte sequences are truncated on INSERT
diff --git a/mysql-test/main/ctype_gbk.result b/mysql-test/main/ctype_gbk.result
index 169c37f8261..1c1fc4aef41 100644
--- a/mysql-test/main/ctype_gbk.result
+++ b/mysql-test/main/ctype_gbk.result
@@ -246,14 +246,53 @@ DROP TABLE t1;
drop table if exists t1;
create table t1 select repeat('a',10) as c1;
delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
-SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1;
-GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 gbk_chinese_ci
+name gbk_chinese_ci
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
20
! 21
" 22
@@ -322,8 +361,9 @@ _ 5F
{ 7B
| 7C
} 7D
- 7F
+<7F> 7F
drop table t1;
+drop view v1;
SET collation_connection='gbk_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
@@ -465,6 +505,154 @@ a hex(b) c
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL
DROP TABLE t1;
+drop table if exists t1;
+create table t1 select repeat('a',10) as c1;
+delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 gbk_bin
+name gbk_bin
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
+ 20
+! 21
+" 22
+# 23
+$ 24
+% 25
+& 26
+' 27
+( 28
+) 29
+* 2A
++ 2B
+, 2C
+- 2D
+. 2E
+/ 2F
+0 30
+1 31
+2 32
+3 33
+4 34
+5 35
+6 36
+7 37
+8 38
+9 39
+: 3A
+; 3B
+< 3C
+= 3D
+> 3E
+? 3F
+@ 40
+A 41
+B 42
+C 43
+D 44
+E 45
+F 46
+G 47
+H 48
+I 49
+J 4A
+K 4B
+L 4C
+M 4D
+N 4E
+O 4F
+P 50
+Q 51
+R 52
+S 53
+T 54
+U 55
+V 56
+W 57
+X 58
+Y 59
+Z 5A
+[ 5B
+\ 5C
+] 5D
+^ 5E
+_ 5F
+` 60
+a 61
+b 62
+c 63
+d 64
+e 65
+f 66
+g 67
+h 68
+i 69
+j 6A
+k 6B
+l 6C
+m 6D
+n 6E
+o 6F
+p 70
+q 71
+r 72
+s 73
+t 74
+u 75
+v 76
+w 77
+x 78
+y 79
+z 7A
+{ 7B
+| 7C
+} 7D
+~ 7E
+<7F> 7F
+drop table t1;
+drop view v1;
SET NAMES gbk;
CREATE TABLE t1 (a text) character set gbk;
INSERT INTO t1 VALUES (0xA3A0),(0xA1A1);
diff --git a/mysql-test/main/ctype_gbk.test b/mysql-test/main/ctype_gbk.test
index d68b78f847c..808bea53e42 100644
--- a/mysql-test/main/ctype_gbk.test
+++ b/mysql-test/main/ctype_gbk.test
@@ -23,6 +23,7 @@ SET collation_connection='gbk_bin';
-- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
+-- source include/ctype_ascii_order.inc
#
# Bug#11987 mysql will truncate the text when
diff --git a/mysql-test/main/ctype_sjis.result b/mysql-test/main/ctype_sjis.result
index 9650bd84cad..c055697d2cf 100644
--- a/mysql-test/main/ctype_sjis.result
+++ b/mysql-test/main/ctype_sjis.result
@@ -231,6 +231,128 @@ SELECT HEX(subject),HEX(pattern),STR_TO_DATE(subject, pattern) FROM t1;
HEX(subject) HEX(pattern) STR_TO_DATE(subject, pattern)
323030318180303181803031 25598180256D81802564 2001-01-01 00:00:00.000000
DROP TABLE t1;
+drop table if exists t1;
+create table t1 select repeat('a',10) as c1;
+delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 sjis_japanese_ci
+name sjis_japanese_ci
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
+ 20
+! 21
+" 22
+# 23
+$ 24
+% 25
+& 26
+' 27
+( 28
+) 29
+* 2A
++ 2B
+, 2C
+- 2D
+. 2E
+/ 2F
+0 30
+1 31
+2 32
+3 33
+4 34
+5 35
+6 36
+7 37
+8 38
+9 39
+: 3A
+; 3B
+< 3C
+= 3D
+> 3E
+? 3F
+@ 40
+Aa 41,61
+Bb 42,62
+Cc 43,63
+Dd 44,64
+Ee 45,65
+Ff 46,66
+Gg 47,67
+Hh 48,68
+Ii 49,69
+Jj 4A,6A
+Kk 4B,6B
+Ll 4C,6C
+Mm 4D,6D
+Nn 4E,6E
+Oo 4F,6F
+Pp 50,70
+Qq 51,71
+Rr 52,72
+Ss 53,73
+Tt 54,74
+Uu 55,75
+Vv 56,76
+Ww 57,77
+Xx 58,78
+Yy 59,79
+Zz 5A,7A
+[ 5B
+\ 5C
+] 5D
+^ 5E
+_ 5F
+` 60
+{ 7B
+| 7C
+} 7D
+~ 7E
+<7F> 7F
+drop table t1;
+drop view v1;
SET collation_connection='sjis_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
@@ -372,6 +494,154 @@ a hex(b) c
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL
DROP TABLE t1;
+drop table if exists t1;
+create table t1 select repeat('a',10) as c1;
+delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 sjis_bin
+name sjis_bin
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
+ 20
+! 21
+" 22
+# 23
+$ 24
+% 25
+& 26
+' 27
+( 28
+) 29
+* 2A
++ 2B
+, 2C
+- 2D
+. 2E
+/ 2F
+0 30
+1 31
+2 32
+3 33
+4 34
+5 35
+6 36
+7 37
+8 38
+9 39
+: 3A
+; 3B
+< 3C
+= 3D
+> 3E
+? 3F
+@ 40
+A 41
+B 42
+C 43
+D 44
+E 45
+F 46
+G 47
+H 48
+I 49
+J 4A
+K 4B
+L 4C
+M 4D
+N 4E
+O 4F
+P 50
+Q 51
+R 52
+S 53
+T 54
+U 55
+V 56
+W 57
+X 58
+Y 59
+Z 5A
+[ 5B
+\ 5C
+] 5D
+^ 5E
+_ 5F
+` 60
+a 61
+b 62
+c 63
+d 64
+e 65
+f 66
+g 67
+h 68
+i 69
+j 6A
+k 6B
+l 6C
+m 6D
+n 6E
+o 6F
+p 70
+q 71
+r 72
+s 73
+t 74
+u 75
+v 76
+w 77
+x 78
+y 79
+z 7A
+{ 7B
+| 7C
+} 7D
+~ 7E
+<7F> 7F
+drop table t1;
+drop view v1;
SET NAMES sjis;
SELECT HEX('²“‘@Œ\') FROM DUAL;
HEX('²“‘@Œ\')
diff --git a/mysql-test/main/ctype_sjis.test b/mysql-test/main/ctype_sjis.test
index ecb870242c5..f8622ab2996 100644
--- a/mysql-test/main/ctype_sjis.test
+++ b/mysql-test/main/ctype_sjis.test
@@ -70,11 +70,13 @@ SET collation_connection='sjis_japanese_ci';
-- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
-- source include/ctype_str_to_date.inc
+-- source include/ctype_ascii_order.inc
SET collation_connection='sjis_bin';
-- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
+-- source include/ctype_ascii_order.inc
# Check parsing of string literals in SJIS with multibyte characters that
# have an embedded \ in them. (Bug #8303)
diff --git a/mysql-test/main/ctype_tis620.result b/mysql-test/main/ctype_tis620.result
index 9c75bb7eb84..a6f2db38319 100644
--- a/mysql-test/main/ctype_tis620.result
+++ b/mysql-test/main/ctype_tis620.result
@@ -3042,14 +3042,53 @@ SELECT '\%b' LIKE '%\%';
drop table if exists t1;
create table t1 select repeat('a',10) as c1;
delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
-SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1;
-GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 tis620_thai_ci
+name tis620_thai_ci
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
20
! 21
" 22
@@ -3119,8 +3158,9 @@ Zz 5A,7A
| 7C
} 7D
~ 7E
- 7F
+<7F> 7F
drop table t1;
+drop view v1;
#
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
#
diff --git a/mysql-test/main/ctype_ujis.result b/mysql-test/main/ctype_ujis.result
index 8895770191d..bebe962fca4 100644
--- a/mysql-test/main/ctype_ujis.result
+++ b/mysql-test/main/ctype_ujis.result
@@ -1,5 +1,281 @@
drop table if exists t1;
set names ujis;
+#
+# General tests
+#
+SET NAMES ujis;
+drop table if exists t1;
+create table t1 select repeat('a',10) as c1;
+delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 ujis_japanese_ci
+name ujis_japanese_ci
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
+ 20
+! 21
+" 22
+# 23
+$ 24
+% 25
+& 26
+' 27
+( 28
+) 29
+* 2A
++ 2B
+, 2C
+- 2D
+. 2E
+/ 2F
+0 30
+1 31
+2 32
+3 33
+4 34
+5 35
+6 36
+7 37
+8 38
+9 39
+: 3A
+; 3B
+< 3C
+= 3D
+> 3E
+? 3F
+@ 40
+Aa 41,61
+Bb 42,62
+Cc 43,63
+Dd 44,64
+Ee 45,65
+Ff 46,66
+Gg 47,67
+Hh 48,68
+Ii 49,69
+Jj 4A,6A
+Kk 4B,6B
+Ll 4C,6C
+Mm 4D,6D
+Nn 4E,6E
+Oo 4F,6F
+Pp 50,70
+Qq 51,71
+Rr 52,72
+Ss 53,73
+Tt 54,74
+Uu 55,75
+Vv 56,76
+Ww 57,77
+Xx 58,78
+Yy 59,79
+Zz 5A,7A
+[ 5B
+\ 5C
+] 5D
+^ 5E
+_ 5F
+` 60
+{ 7B
+| 7C
+} 7D
+~ 7E
+<7F> 7F
+drop table t1;
+drop view v1;
+SET NAMES ujis COLLATE ujis_bin;
+drop table if exists t1;
+create table t1 select repeat('a',10) as c1;
+delete from t1;
+insert into t1 values (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07),(0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+insert into t1 values (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17),(0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+create view v1 as select c1, if(c1 < 0x20 OR c1=0x7F, concat('<',hex(c1),'>'),c1) as name from t1;
+select column_name, collation_name from information_schema.columns where table_schema=database() and table_name='v1';
+column_name collation_name
+c1 ujis_bin
+name ujis_bin
+SELECT GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM v1 GROUP BY c1;
+GROUP_CONCAT(name ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
+<00> 00
+<01> 01
+<02> 02
+<03> 03
+<04> 04
+<05> 05
+<06> 06
+<07> 07
+<08> 08
+<09> 09
+<0A> 0A
+<0B> 0B
+<0C> 0C
+<0D> 0D
+<0E> 0E
+<0F> 0F
+<10> 10
+<11> 11
+<12> 12
+<13> 13
+<14> 14
+<15> 15
+<16> 16
+<17> 17
+<18> 18
+<19> 19
+<1A> 1A
+<1B> 1B
+<1C> 1C
+<1D> 1D
+<1E> 1E
+<1F> 1F
+ 20
+! 21
+" 22
+# 23
+$ 24
+% 25
+& 26
+' 27
+( 28
+) 29
+* 2A
++ 2B
+, 2C
+- 2D
+. 2E
+/ 2F
+0 30
+1 31
+2 32
+3 33
+4 34
+5 35
+6 36
+7 37
+8 38
+9 39
+: 3A
+; 3B
+< 3C
+= 3D
+> 3E
+? 3F
+@ 40
+A 41
+B 42
+C 43
+D 44
+E 45
+F 46
+G 47
+H 48
+I 49
+J 4A
+K 4B
+L 4C
+M 4D
+N 4E
+O 4F
+P 50
+Q 51
+R 52
+S 53
+T 54
+U 55
+V 56
+W 57
+X 58
+Y 59
+Z 5A
+[ 5B
+\ 5C
+] 5D
+^ 5E
+_ 5F
+` 60
+a 61
+b 62
+c 63
+d 64
+e 65
+f 66
+g 67
+h 68
+i 69
+j 6A
+k 6B
+l 6C
+m 6D
+n 6E
+o 6F
+p 70
+q 71
+r 72
+s 73
+t 74
+u 75
+v 76
+w 77
+x 78
+y 79
+z 7A
+{ 7B
+| 7C
+} 7D
+~ 7E
+<7F> 7F
+drop table t1;
+drop view v1;
+SET NAMES ujis;
create table t1 (c text character set ujis);
insert into t1 values (0xa4a2),(0xa4a3);
select hex(left(c,1)) from t1 group by c;
diff --git a/mysql-test/main/ctype_ujis.test b/mysql-test/main/ctype_ujis.test
index 72a609edf39..7b77232738b 100644
--- a/mysql-test/main/ctype_ujis.test
+++ b/mysql-test/main/ctype_ujis.test
@@ -9,10 +9,20 @@ drop table if exists t1;
set names ujis;
+--echo #
+--echo # General tests
+--echo #
+
+SET NAMES ujis;
+-- source include/ctype_ascii_order.inc
+SET NAMES ujis COLLATE ujis_bin;
+-- source include/ctype_ascii_order.inc
+
#
# Test problem with LEFT()
#
+SET NAMES ujis;
create table t1 (c text character set ujis);
insert into t1 values (0xa4a2),(0xa4a3);
select hex(left(c,1)) from t1 group by c;
diff --git a/mysql-test/main/ctype_utf8.result b/mysql-test/main/ctype_utf8.result
index b7810dc6f2d..6eebc8f4cf2 100644
--- a/mysql-test/main/ctype_utf8.result
+++ b/mysql-test/main/ctype_utf8.result
@@ -11403,8 +11403,8 @@ DROP TABLE t1;
# MDEV-20890 Illegal mix of collations with UUID()
#
SET NAMES utf8 COLLATE utf8_unicode_ci;
-SELECT uuid()>'';
-uuid()>''
+SELECT sys_guid()>'';
+sys_guid()>''
1
#
# MDEV-8844 Unreadable control characters printed as is in warnings
diff --git a/mysql-test/main/ctype_utf8.test b/mysql-test/main/ctype_utf8.test
index 844e812acb3..63b75d8e263 100644
--- a/mysql-test/main/ctype_utf8.test
+++ b/mysql-test/main/ctype_utf8.test
@@ -2328,7 +2328,7 @@ DROP TABLE t1;
--echo #
SET NAMES utf8 COLLATE utf8_unicode_ci;
-SELECT uuid()>'';
+SELECT sys_guid()>'';
--echo #
diff --git a/mysql-test/main/ddl_i18n_koi8r.result b/mysql-test/main/ddl_i18n_koi8r.result
index 196b07a7dda..feeab292da0 100644
--- a/mysql-test/main/ddl_i18n_koi8r.result
+++ b/mysql-test/main/ddl_i18n_koi8r.result
@@ -1739,7 +1739,10 @@ CREATE TABLE `t1` (
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1),(0),(1);
+INSERT INTO `t1` VALUES
+(1),
+(0),
+(1);
ALTER DATABASE `mysqltest1` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -1818,7 +1821,10 @@ CREATE TABLE `t1` (
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1),(0),(1);
+INSERT INTO `t1` VALUES
+(1),
+(0),
+(1);
ALTER DATABASE `mysqltest2` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
diff --git a/mysql-test/main/ddl_i18n_utf8.result b/mysql-test/main/ddl_i18n_utf8.result
index cee281036f8..312c77988ee 100644
--- a/mysql-test/main/ddl_i18n_utf8.result
+++ b/mysql-test/main/ddl_i18n_utf8.result
@@ -1739,7 +1739,10 @@ CREATE TABLE `t1` (
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1),(0),(1);
+INSERT INTO `t1` VALUES
+(1),
+(0),
+(1);
ALTER DATABASE `mysqltest1` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
@@ -1818,7 +1821,10 @@ CREATE TABLE `t1` (
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1),(0),(1);
+INSERT INTO `t1` VALUES
+(1),
+(0),
+(1);
ALTER DATABASE `mysqltest2` CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
diff --git a/mysql-test/main/default.result b/mysql-test/main/default.result
index ad78183a6ff..d840731c79d 100644
--- a/mysql-test/main/default.result
+++ b/mysql-test/main/default.result
@@ -797,7 +797,7 @@ ERROR 42000: Invalid default value for 'a'
#
CREATE TABLE t1 (a INT DEFAULT '1 ');
Warnings:
-Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'a' at row 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -810,7 +810,7 @@ a
DROP TABLE t1;
CREATE TABLE t1 (a INT DEFAULT CONCAT('1 '));
Warnings:
-Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'a' at row 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -825,7 +825,7 @@ a
DROP TABLE t1;
CREATE TABLE t1 (a INT DEFAULT COALESCE('1 '));
Warnings:
-Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'a' at row 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/main/flush_read_lock_kill.test b/mysql-test/main/flush_read_lock_kill.test
index bd3efd7bdc4..8b76c065227 100644
--- a/mysql-test/main/flush_read_lock_kill.test
+++ b/mysql-test/main/flush_read_lock_kill.test
@@ -7,6 +7,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
+--source include/have_debug_sync.inc
# This test needs transactional engine as otherwise COMMIT
# won't block FLUSH TABLES WITH GLOBAL READ LOCK.
diff --git a/mysql-test/main/func_in.result b/mysql-test/main/func_in.result
index 51074650d29..569fdfe4cbf 100644
--- a/mysql-test/main/func_in.result
+++ b/mysql-test/main/func_in.result
@@ -784,7 +784,7 @@ SELECT 1 IN (YEAR(FROM_UNIXTIME(NULL)) ,1);
# Bug#13012483: EXPLAIN EXTENDED, PREPARED STATEMENT, CRASH IN CHECK_SIMPLE_EQUALITY
#
CREATE TABLE t1 (a INT);
-PREPARE s FROM "SELECT 1 FROM t1 WHERE 1 < ALL (SELECT @:= (1 IN (SELECT 1 FROM t1)) FROM t1)";
+PREPARE s FROM "SELECT 1 FROM t1 WHERE 1 < ALL (SELECT @a:= (1 IN (SELECT 1 FROM t1)) FROM t1)";
EXECUTE s;
1
DROP TABLE t1;
@@ -805,15 +805,6 @@ select * from t1 where IF(1,a,a)='2.1';
a b
drop table t1;
#
-# LP bug#992380 Crash when creating PS for a query with
-# subquery in WHERE (see also mysql bug#13012483)
-#
-CREATE TABLE t1 (a INT);
-PREPARE s FROM "SELECT 1 FROM t1 WHERE 1 < ALL (SELECT @:= (1 IN (SELECT 1 FROM t1)) FROM t1)";
-EXECUTE s;
-1
-DROP TABLE t1;
-#
# End of 5.3 tests
#
create table t1 (a int);
diff --git a/mysql-test/main/func_in.test b/mysql-test/main/func_in.test
index fb6f2036f20..86a54535a8b 100644
--- a/mysql-test/main/func_in.test
+++ b/mysql-test/main/func_in.test
@@ -567,7 +567,7 @@ SELECT 1 IN (YEAR(FROM_UNIXTIME(NULL)) ,1);
--echo #
CREATE TABLE t1 (a INT);
-PREPARE s FROM "SELECT 1 FROM t1 WHERE 1 < ALL (SELECT @:= (1 IN (SELECT 1 FROM t1)) FROM t1)";
+PREPARE s FROM "SELECT 1 FROM t1 WHERE 1 < ALL (SELECT @a:= (1 IN (SELECT 1 FROM t1)) FROM t1)";
EXECUTE s;
DROP TABLE t1;
@@ -595,15 +595,6 @@ select * from t1 where a='2.1';
select * from t1 where b='2.1';
select * from t1 where IF(1,a,a)='2.1';
drop table t1;
---echo #
---echo # LP bug#992380 Crash when creating PS for a query with
---echo # subquery in WHERE (see also mysql bug#13012483)
---echo #
-CREATE TABLE t1 (a INT);
-PREPARE s FROM "SELECT 1 FROM t1 WHERE 1 < ALL (SELECT @:= (1 IN (SELECT 1 FROM t1)) FROM t1)";
-EXECUTE s;
-
-DROP TABLE t1;
--echo #
--echo # End of 5.3 tests
diff --git a/mysql-test/main/func_json.result b/mysql-test/main/func_json.result
index bf6b2efaabc..f9845357d51 100644
--- a/mysql-test/main/func_json.result
+++ b/mysql-test/main/func_json.result
@@ -765,8 +765,8 @@ DROP TABLE t1;
#
# MDEV-16054 simple json functions flatline cpu on garbage input.
#
-select json_array(1,uuid(),compress(5.140264e+307));
-json_array(1,uuid(),compress(5.140264e+307))
+select json_array(1,user(),compress(5.140264e+307));
+json_array(1,user(),compress(5.140264e+307))
NULL
#
# MDEV-16869 String functions don't respect character set of JSON_VALUE.
diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test
index 0b1fce3a509..939f19b0b15 100644
--- a/mysql-test/main/func_json.test
+++ b/mysql-test/main/func_json.test
@@ -429,7 +429,7 @@ DROP TABLE t1;
--echo # MDEV-16054 simple json functions flatline cpu on garbage input.
--echo #
-select json_array(1,uuid(),compress(5.140264e+307));
+select json_array(1,user(),compress(5.140264e+307));
--echo #
--echo # MDEV-16869 String functions don't respect character set of JSON_VALUE.
diff --git a/mysql-test/main/func_misc.result b/mysql-test/main/func_misc.result
index b2c08989854..7597da95f3d 100644
--- a/mysql-test/main/func_misc.result
+++ b/mysql-test/main/func_misc.result
@@ -118,9 +118,12 @@ create table t1 as select uuid(), length(uuid());
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `uuid()` varchar(36) DEFAULT NULL,
+ `uuid()` uuid DEFAULT NULL,
`length(uuid())` int(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select length(`uuid()`) from t1;
+length(`uuid()`)
+36
drop table t1;
create table t1 select INET_ATON('255.255.0.1') as `a`;
show create table t1;
diff --git a/mysql-test/main/func_misc.test b/mysql-test/main/func_misc.test
index 56e7a996f94..5e8118d4cef 100644
--- a/mysql-test/main/func_misc.test
+++ b/mysql-test/main/func_misc.test
@@ -106,6 +106,7 @@ select export_set(3, _latin1'foo', _utf8'bar', ',', 4);
create table t1 as select uuid(), length(uuid());
--enable_warnings
show create table t1;
+select length(`uuid()`) from t1;
drop table t1;
#
diff --git a/mysql-test/main/func_sformat.result b/mysql-test/main/func_sformat.result
new file mode 100644
index 00000000000..b3a494d48a7
--- /dev/null
+++ b/mysql-test/main/func_sformat.result
@@ -0,0 +1,470 @@
+#
+# MDEV-25015 Custom formatting of strings in MariaDB queries
+#
+#
+# Normal Test Cases
+#
+select sformat('string test');
+sformat('string test')
+string test
+select sformat(0);
+sformat(0)
+0
+select sformat('C');
+sformat('C')
+C
+select sformat(-4.2);
+sformat(-4.2)
+-4.2
+select sformat(5, 5, 5);
+sformat(5, 5, 5)
+5
+select sformat('{} {}', 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, 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, 0, 0, 0, 0);
+sformat('{} {}', 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+0 0
+select sformat('{{{}}}', 0);
+sformat('{{{}}}', 0)
+{0}
+select sformat('{{{}{{', 0);
+sformat('{{{}{{', 0)
+{0{
+select sformat('{{{{{}{{', 'param1');
+sformat('{{{{{}{{', 'param1')
+{{param1{
+select sformat(' {{ {{ {} {{ ', 'param1');
+sformat(' {{ {{ {} {{ ', 'param1')
+ { { param1 {
+select sformat(' {{ {} {}', 'param1', 'param2');
+sformat(' {{ {} {}', 'param1', 'param2')
+ { param1 param2
+select sformat('A{}C{}E{}', 'B', 'D', 'F');
+sformat('A{}C{}E{}', 'B', 'D', 'F')
+ABCDEF
+select sformat('{} {}', FALSE, TRUE);
+sformat('{} {}', FALSE, TRUE)
+0 1
+select sformat('Add € != {} != {}?', '$', '£');
+sformat('Add € != {} != {}?', '$', '£')
+Add € != $ != £?
+select sformat('Check {} != {} != {}?', '€', '$', '£');
+sformat('Check {} != {} != {}?', '€', '$', '£')
+Check € != $ != £?
+select sformat('{}{}{}', 1, 2, 3);
+sformat('{}{}{}', 1, 2, 3)
+123
+select sformat('Float {} Boolean {} Number {}', 3.14159, True, -50);
+sformat('Float {} Boolean {} Number {}', 3.14159, True, -50)
+Float 3.14159 Boolean 1 Number -50
+select sformat('SUM {} + {} = {}', 2, 3, 2+3);
+sformat('SUM {} + {} = {}', 2, 3, 2+3)
+SUM 2 + 3 = 5
+select sformat('Numbers {} {} {}', 1, 1.11, 1.111);
+sformat('Numbers {} {} {}', 1, 1.11, 1.111)
+Numbers 1 1.11 1.111
+select sformat('what {} is {}?', 'time', 'it');
+sformat('what {} is {}?', 'time', 'it')
+what time is it?
+select sformat('{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}', 1, 2, 3, 4, 5, 6,
+7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
+58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
+83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
+106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120);
+sformat('{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
+ 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
+ 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
+ 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
+select sformat('{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}', '1', '2', '3 ',
+'4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20',
+'21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36',
+'37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52',
+'53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68',
+'69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84',
+'85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100',
+'101', '102', '103', '104', '105', '106', '107', '108', '109', '110', '111', '112', '113', '114',
+'115', '116', '117', '118', '119', '120');
+sformat('{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
+ 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
+ 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
+ 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
+#
+# Error Test Cases
+#
+select sformat('R={ }', 42);
+sformat('R={ }', 42)
+NULL
+Warnings:
+Warning 4183 SFORMAT error: invalid format string
+select sformat(NULL, 'Null', 'Test');
+sformat(NULL, 'Null', 'Test')
+NULL
+select sformat('Null Test {} {} ', 0, NULL);
+sformat('Null Test {} {} ', 0, NULL)
+NULL
+select sformat(NULL);
+sformat(NULL)
+NULL
+select sformat('My { Test');
+sformat('My { Test')
+NULL
+Warnings:
+Warning 4183 SFORMAT error: invalid format string
+select sformat('Test { {');
+sformat('Test { {')
+NULL
+Warnings:
+Warning 4183 SFORMAT error: invalid format string
+select sformat('A{}C{}E{}', 'B', 'D');
+sformat('A{}C{}E{}', 'B', 'D')
+NULL
+Warnings:
+Warning 4183 SFORMAT error: argument not found
+select sformat();
+ERROR 42000: Incorrect parameter count in the call to native function 'sformat'
+#
+# Table Test Cases
+#
+create table t1 (param1 text, param2 text, param3 int);
+insert into t1 values ('string: {}, number: {}', 'xyz', 123),
+('something {} went {} wrong {}', 'foo', 0),
+('Test case {} -> {}', 'Print', -32);
+select sformat(param1, param2, param3) from t1;
+sformat(param1, param2, param3)
+string: xyz, number: 123
+NULL
+Test case Print -> -32
+Warnings:
+Warning 4183 SFORMAT error: argument not found
+drop table t1;
+create table t2 (param1 FLOAT, param2 SMALLINT, param3 CHAR, param4 DATE);
+insert into t2 values (0.0025, 25, 'A', DATE('2020-06-29')),
+(0.0005, 5, 'B', DATE('2020-6-29')),
+(5.5555, -5, 'C', DATE('200629')),
+(-9, -9, 'D', DATE('20*06*29'));
+select sformat('p1 {:.4f} p2 {} p3 {} p4 {}', param1, param2, param3, param4) from t2;
+sformat('p1 {:.4f} p2 {} p3 {} p4 {}', param1, param2, param3, param4)
+p1 0.0025 p2 25 p3 A p4 2020-06-29
+p1 0.0005 p2 5 p3 B p4 2020-06-29
+p1 5.5555 p2 -5 p3 C p4 2020-06-29
+p1 -9.0000 p2 -9 p3 D p4 2020-06-29
+drop table t2;
+set names utf8;
+create table t3 (format_str text character set 'latin1',
+first_param text character set 'utf8',
+second_param text character set 'latin1');
+insert into t3 values ('test 1 {} {}', UNHEX('C3A5'), UNHEX('E5'));
+select sformat(format_str, first_param, second_param) from t3;
+sformat(format_str, first_param, second_param)
+test 1 å å
+select HEX(sformat(format_str, first_param, second_param)) from t3;
+HEX(sformat(format_str, first_param, second_param))
+74657374203120C3A520C3A5
+drop table t3;
+set names latin1;
+create table t4 (p1 bit(8), p2 boolean, p3 DECIMAL, p4 TIMESTAMP);
+insert into t4 values (42, TRUE, 42, '2021-08-18 16:50:07'),
+(24, FALSE, 24, '0000-00-00 00:00:00');
+select sformat('{}: {} {} {} {}', 'Data', p1, p2, p3, p4) from t4;
+sformat('{}: {} {} {} {}', 'Data', p1, p2, p3, p4)
+Data: 42 1 42 2021-08-18 16:50:07
+Data: 24 0 24 0000-00-00 00:00:00
+drop table t4;
+set names utf8;
+create table t5 (param text character SET utf8 COLLATE utf8_general_ci);
+insert into t5 values (UNHEX('C3A5')),(UNHEX('C5BB')),(UNHEX('e0b1bb')),
+(UNHEX('C38A')), (NULL);
+select sformat('{}', param) from t5;
+sformat('{}', param)
+Ã¥
+Å»
+à±»
+Ê
+NULL
+select HEX(sformat('{}', param)) from t5;
+HEX(sformat('{}', param))
+C3A5
+C5BB
+E0B1BB
+C38A
+NULL
+drop table t5;
+set names latin1;
+#
+# Format Test Cases
+#
+select sformat('Num {:L}', 13800000000);
+sformat('Num {:L}', 13800000000)
+Num 13,800,000,000
+select sformat('Num [{:20}]', 42);
+sformat('Num [{:20}]', 42)
+Num [ 42]
+select sformat('Number: {:*^{}}', 4, 5);
+sformat('Number: {:*^{}}', 4, 5)
+Number: **4**
+select sformat('{:02} - {:02} - {:02}', 1, 2, 3);
+sformat('{:02} - {:02} - {:02}', 1, 2, 3)
+01 - 02 - 03
+select sformat('Character {:c}', 104);
+sformat('Character {:c}', 104)
+Character h
+select sformat('String {:s}', 'hello');
+sformat('String {:s}', 'hello')
+String hello
+select sformat('Large {0:+010.4g}', 392.64);
+sformat('Large {0:+010.4g}', 392.64)
+Large +0000392.6
+select sformat('Large {:g}', 392.65);
+sformat('Large {:g}', 392.65)
+Large 392.65
+select sformat('Float {:.2f}', 42.0);
+sformat('Float {:.2f}', 42.0)
+Float 42.00
+select sformat('Float {:f}', 42.0);
+sformat('Float {:f}', 42.0)
+Float 42.000000
+select sformat('Number {:d}', 42);
+sformat('Number {:d}', 42)
+Number 42
+select sformat('Number {:{}}', 5, 5);
+sformat('Number {:{}}', 5, 5)
+Number 5
+select sformat('Number [{:10}]', 9999);
+sformat('Number [{:10}]', 9999)
+Number [ 9999]
+select sformat('Number {:.3}', 3.1416);
+sformat('Number {:.3}', 3.1416)
+Number 3.14
+select sformat('int: {0:d}; hex: {0:x}; oct: {0:o}', 42);
+sformat('int: {0:d}; hex: {0:x}; oct: {0:o}', 42)
+int: 42; hex: 2a; oct: 52
+select sformat('int: {0:d}; hex: {0:#x}; oct: {0:#o}', 42);
+sformat('int: {0:d}; hex: {0:#x}; oct: {0:#o}', 42)
+int: 42; hex: 0x2a; oct: 052
+select sformat('The Hexadecimal version of {0} is {0:X}', 255);
+sformat('The Hexadecimal version of {0} is {0:X}', 255)
+The Hexadecimal version of 255 is FF
+select sformat('The Hexadecimal version of {0} is {0:x}', 255);
+sformat('The Hexadecimal version of {0} is {0:x}', 255)
+The Hexadecimal version of 255 is ff
+select sformat('The octal version of {0} is {0:o}', 10);
+sformat('The octal version of {0} is {0:o}', 10)
+The octal version of 10 is 12
+select sformat('The binary version of {0} is {0:b}', 5);
+sformat('The binary version of {0} is {0:b}', 5)
+The binary version of 5 is 101
+select sformat('{:+f}; {:+f}', 3.14, -3.14);
+sformat('{:+f}; {:+f}', 3.14, -3.14)
++3.140000; -3.140000
+select sformat('{: f}; {: f}', 3.14, -3.14);
+sformat('{: f}; {: f}', 3.14, -3.14)
+ 3.140000; -3.140000
+select sformat('{:-f}; {:-f}', 3.14, -3.14);
+sformat('{:-f}; {:-f}', 3.14, -3.14)
+3.140000; -3.140000
+select sformat('The temperature is between {: } and {: } degrees celsius.', -3, 7);
+sformat('The temperature is between {: } and {: } degrees celsius.', -3, 7)
+The temperature is between -3 and 7 degrees celsius.
+select sformat('The temperature is between {:-} and {:-} degrees celsius.', -3, 7);
+sformat('The temperature is between {:-} and {:-} degrees celsius.', -3, 7)
+The temperature is between -3 and 7 degrees celsius.
+select sformat('The temperature is between {:+} and {:+} degrees celsius.', -3, 7);
+sformat('The temperature is between {:+} and {:+} degrees celsius.', -3, 7)
+The temperature is between -3 and +7 degrees celsius.
+select sformat('We have {:<8} chickens.', 49);
+sformat('We have {:<8} chickens.', 49)
+We have 49 chickens.
+select sformat('Center alimgn [{:*^10}]', 'data');
+sformat('Center alimgn [{:*^10}]', 'data')
+Center alimgn [***data***]
+select sformat('Center aling [{:^10}].', 'data');
+sformat('Center aling [{:^10}].', 'data')
+Center aling [ data ].
+select sformat('Right aling [{:>10}].', 'data');
+sformat('Right aling [{:>10}].', 'data')
+Right aling [ data].
+select sformat('Left align [{:<10}].', 'data');
+sformat('Left align [{:<10}].', 'data')
+Left align [data ].
+select sformat('{0}{1}{0}', 'abra', 'cad');
+sformat('{0}{1}{0}', 'abra', 'cad')
+abracadabra
+select sformat('Change Order {1} {0}', 'second', 'first');
+sformat('Change Order {1} {0}', 'second', 'first')
+Change Order first second
+#
+# Failed Format Test Cases
+#
+select sformat('Test {:c}', 'word');
+sformat('Test {:c}', 'word')
+NULL
+Warnings:
+Warning 4183 SFORMAT error: invalid type specifier
+select sformat('Test {one} {two} {three}', 1, 2, 3);
+sformat('Test {one} {two} {three}', 1, 2, 3)
+NULL
+Warnings:
+Warning 4183 SFORMAT error: argument not found
+select sformat('Number {:{<}', 8);
+sformat('Number {:{<}', 8)
+NULL
+Warnings:
+Warning 4183 SFORMAT error: invalid fill character '{'
+select sformat('Number {:10000000000}', 5);
+sformat('Number {:10000000000}', 5)
+NULL
+Warnings:
+Warning 4183 SFORMAT error: number is too big
+select sformat('1={1} 2={2} 0={0}', 0, 1);
+sformat('1={1} 2={2} 0={0}', 0, 1)
+NULL
+Warnings:
+Warning 4183 SFORMAT error: argument not found
+select sformat('Number {:.2d}', 42);
+sformat('Number {:.2d}', 42)
+NULL
+Warnings:
+Warning 4183 SFORMAT error: precision not allowed for this argument type
+select sformat('You scored {:.0%}', 0.25);
+sformat('You scored {:.0%}', 0.25)
+NULL
+Warnings:
+Warning 4183 SFORMAT error: invalid type specifier
+select sformat('You scored {:%}', 0.25);
+sformat('You scored {:%}', 0.25)
+NULL
+Warnings:
+Warning 4183 SFORMAT error: invalid type specifier
+select sformat('The price is {:f} dollars.', 45);
+sformat('The price is {:f} dollars.', 45)
+NULL
+Warnings:
+Warning 4183 SFORMAT error: invalid type specifier
+select sformat('The price is {:.2f} dollars.', 45);
+sformat('The price is {:.2f} dollars.', 45)
+NULL
+Warnings:
+Warning 4183 SFORMAT error: precision not allowed for this argument type
+select sformat('We have {:E} chickens.', 5);
+sformat('We have {:E} chickens.', 5)
+NULL
+Warnings:
+Warning 4183 SFORMAT error: invalid type specifier
+select sformat('We have {:e} chickens.', 5);
+sformat('We have {:e} chickens.', 5)
+NULL
+Warnings:
+Warning 4183 SFORMAT error: invalid type specifier
+select sformat('The universe is {:,} years old.', 13800000000);
+sformat('The universe is {:,} years old.', 13800000000)
+NULL
+Warnings:
+Warning 4183 SFORMAT error: invalid type specifier
+select sformat('The universe is {:_} years old.', 13800000000);
+sformat('The universe is {:_} years old.', 13800000000)
+NULL
+Warnings:
+Warning 4183 SFORMAT error: invalid type specifier
+select sformat('String {:-}', 'hello');
+sformat('String {:-}', 'hello')
+NULL
+Warnings:
+Warning 4183 SFORMAT error: format specifier requires numeric argument
+#
+# Table Format Test Cases
+#
+create table t1 (pformat text, data1 FLOAT, data2 INT,
+data3 VARCHAR(30));
+insert into t1 values ('{:.2f} {: } |{:*^15}', 1.11, 1, 'example I'),
+('{:.1f} {:-} |{:^15}', -2.22, -2, 'example II'),
+('{:.2f} {:+} |{:<15}', 3.33, 3, 'example III'),
+('{:.4f} {:d} |{:^15}', -4.44, -4, 'example IV');
+select sformat(pformat, data1, data2, data3) from t1;
+sformat(pformat, data1, data2, data3)
+1.11 1 |***example I***
+-2.2 -2 | example II
+3.33 +3 |example III
+-4.4400 -4 | example IV
+drop table t1;
+create table t2 (a double);
+insert into t2 values (3.14159265358979323846);
+select a, sformat('{:.15f}', a) from t2;
+a sformat('{:.15f}', a)
+3.141592653589793 3.141592653589793
+drop table t2;
+#
+# Unsupported/disabled features
+#
+select sformat('{:p}', '50');
+sformat('{:p}', '50')
+NULL
+Warnings:
+Warning 4183 SFORMAT error: invalid type specifier
+#
+# ucs2 test
+#
+select sformat('={}=', _ucs2 x'006100620063');
+sformat('={}=', _ucs2 x'006100620063')
+=abc=
+set names utf8;
+select sformat(_ucs2 x'003D007B007D003D', _ucs2 x'0442043504410442');
+sformat(_ucs2 x'003D007B007D003D', _ucs2 x'0442043504410442')
+=теÑÑ‚=
+select hex(sformat(_ucs2 x'003D007B007D003D', _ucs2 x'0442043504410442'));
+hex(sformat(_ucs2 x'003D007B007D003D', _ucs2 x'0442043504410442'))
+003D0442043504410442003D
+create table t1 as select sformat(_ucs2 x'003D007B007D003D', _ucs2 x'0442043504410442') as x;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` varchar(8) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+set names latin1;
+#
+# ps parameters
+#
+prepare s from 'select sformat("={:d}=", ?)';
+execute s using 100;
+sformat("={:d}=", ?)
+=100=
+execute s using 'abc';
+sformat("={:d}=", ?)
+NULL
+Warnings:
+Warning 4183 SFORMAT error: invalid type specifier
+#
+# MDEV-26691 SFORMAT: Pass down FLOAT as FLOAT, without upcast to DOUBLE
+#
+select sformat('{}', cast(1.1 as float));
+sformat('{}', cast(1.1 as float))
+1.1
+#
+# MDEV-26646 SFORMAT Does not allow @variable use
+#
+set names utf8;
+set @a=3.14;
+select sformat('{:f}', @a);
+sformat('{:f}', @a)
+3.140000
+set names latin1;
+#
+# End of 10.7 tests
+#
diff --git a/mysql-test/main/func_sformat.test b/mysql-test/main/func_sformat.test
new file mode 100644
index 00000000000..7c850fc2644
--- /dev/null
+++ b/mysql-test/main/func_sformat.test
@@ -0,0 +1,228 @@
+echo #;
+echo # MDEV-25015 Custom formatting of strings in MariaDB queries;
+echo #;
+
+# Description
+# -----------
+# Test cases for the sformat function
+
+echo #;
+echo # Normal Test Cases;
+echo #;
+select sformat('string test');
+select sformat(0);
+select sformat('C');
+select sformat(-4.2);
+select sformat(5, 5, 5);
+select sformat('{} {}', 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, 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, 0, 0, 0, 0);
+select sformat('{{{}}}', 0);
+select sformat('{{{}{{', 0);
+select sformat('{{{{{}{{', 'param1');
+select sformat(' {{ {{ {} {{ ', 'param1');
+select sformat(' {{ {} {}', 'param1', 'param2');
+select sformat('A{}C{}E{}', 'B', 'D', 'F');
+select sformat('{} {}', FALSE, TRUE);
+select sformat('Add € != {} != {}?', '$', '£');
+select sformat('Check {} != {} != {}?', '€', '$', '£');
+select sformat('{}{}{}', 1, 2, 3);
+select sformat('Float {} Boolean {} Number {}', 3.14159, True, -50);
+select sformat('SUM {} + {} = {}', 2, 3, 2+3);
+select sformat('Numbers {} {} {}', 1, 1.11, 1.111);
+select sformat('what {} is {}?', 'time', 'it');
+select sformat('{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}', 1, 2, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
+ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
+ 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120);
+select sformat('{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
+ {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}', '1', '2', '3 ',
+ '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20',
+ '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36',
+ '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52',
+ '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68',
+ '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84',
+ '85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100',
+ '101', '102', '103', '104', '105', '106', '107', '108', '109', '110', '111', '112', '113', '114',
+ '115', '116', '117', '118', '119', '120');
+
+echo #;
+echo # Error Test Cases;
+echo #;
+select sformat('R={ }', 42);
+select sformat(NULL, 'Null', 'Test');
+select sformat('Null Test {} {} ', 0, NULL);
+select sformat(NULL);
+select sformat('My { Test');
+select sformat('Test { {');
+select sformat('A{}C{}E{}', 'B', 'D');
+error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT;
+select sformat();
+error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT;
+echo #;
+echo # Table Test Cases;
+echo #;
+create table t1 (param1 text, param2 text, param3 int);
+insert into t1 values ('string: {}, number: {}', 'xyz', 123),
+ ('something {} went {} wrong {}', 'foo', 0),
+ ('Test case {} -> {}', 'Print', -32);
+select sformat(param1, param2, param3) from t1;
+drop table t1;
+
+create table t2 (param1 FLOAT, param2 SMALLINT, param3 CHAR, param4 DATE);
+insert into t2 values (0.0025, 25, 'A', DATE('2020-06-29')),
+ (0.0005, 5, 'B', DATE('2020-6-29')),
+ (5.5555, -5, 'C', DATE('200629')),
+ (-9, -9, 'D', DATE('20*06*29'));
+select sformat('p1 {:.4f} p2 {} p3 {} p4 {}', param1, param2, param3, param4) from t2;
+drop table t2;
+
+set names utf8;
+create table t3 (format_str text character set 'latin1',
+ first_param text character set 'utf8',
+ second_param text character set 'latin1');
+insert into t3 values ('test 1 {} {}', UNHEX('C3A5'), UNHEX('E5'));
+select sformat(format_str, first_param, second_param) from t3;
+select HEX(sformat(format_str, first_param, second_param)) from t3;
+drop table t3;
+set names latin1;
+
+create table t4 (p1 bit(8), p2 boolean, p3 DECIMAL, p4 TIMESTAMP);
+insert into t4 values (42, TRUE, 42, '2021-08-18 16:50:07'),
+ (24, FALSE, 24, '0000-00-00 00:00:00');
+select sformat('{}: {} {} {} {}', 'Data', p1, p2, p3, p4) from t4;
+drop table t4;
+
+set names utf8;
+create table t5 (param text character SET utf8 COLLATE utf8_general_ci);
+insert into t5 values (UNHEX('C3A5')),(UNHEX('C5BB')),(UNHEX('e0b1bb')),
+ (UNHEX('C38A')), (NULL);
+select sformat('{}', param) from t5;
+select HEX(sformat('{}', param)) from t5;
+drop table t5;
+set names latin1;
+
+echo #;
+echo # Format Test Cases;
+echo #;
+select sformat('Num {:L}', 13800000000);
+select sformat('Num [{:20}]', 42);
+select sformat('Number: {:*^{}}', 4, 5);
+select sformat('{:02} - {:02} - {:02}', 1, 2, 3);
+select sformat('Character {:c}', 104);
+select sformat('String {:s}', 'hello');
+select sformat('Large {0:+010.4g}', 392.64);
+select sformat('Large {:g}', 392.65);
+select sformat('Float {:.2f}', 42.0);
+select sformat('Float {:f}', 42.0);
+select sformat('Number {:d}', 42);
+select sformat('Number {:{}}', 5, 5);
+select sformat('Number [{:10}]', 9999);
+select sformat('Number {:.3}', 3.1416);
+select sformat('int: {0:d}; hex: {0:x}; oct: {0:o}', 42);
+select sformat('int: {0:d}; hex: {0:#x}; oct: {0:#o}', 42);
+select sformat('The Hexadecimal version of {0} is {0:X}', 255);
+select sformat('The Hexadecimal version of {0} is {0:x}', 255);
+select sformat('The octal version of {0} is {0:o}', 10);
+select sformat('The binary version of {0} is {0:b}', 5);
+select sformat('{:+f}; {:+f}', 3.14, -3.14);
+select sformat('{: f}; {: f}', 3.14, -3.14);
+select sformat('{:-f}; {:-f}', 3.14, -3.14);
+select sformat('The temperature is between {: } and {: } degrees celsius.', -3, 7);
+select sformat('The temperature is between {:-} and {:-} degrees celsius.', -3, 7);
+select sformat('The temperature is between {:+} and {:+} degrees celsius.', -3, 7);
+select sformat('We have {:<8} chickens.', 49);
+select sformat('Center alimgn [{:*^10}]', 'data');
+select sformat('Center aling [{:^10}].', 'data');
+select sformat('Right aling [{:>10}].', 'data');
+select sformat('Left align [{:<10}].', 'data');
+select sformat('{0}{1}{0}', 'abra', 'cad');
+select sformat('Change Order {1} {0}', 'second', 'first');
+
+echo #;
+echo # Failed Format Test Cases;
+echo #;
+select sformat('Test {:c}', 'word');
+select sformat('Test {one} {two} {three}', 1, 2, 3);
+select sformat('Number {:{<}', 8);
+select sformat('Number {:10000000000}', 5);
+select sformat('1={1} 2={2} 0={0}', 0, 1);
+select sformat('Number {:.2d}', 42);
+select sformat('You scored {:.0%}', 0.25);
+select sformat('You scored {:%}', 0.25);
+select sformat('The price is {:f} dollars.', 45);
+select sformat('The price is {:.2f} dollars.', 45);
+select sformat('We have {:E} chickens.', 5);
+select sformat('We have {:e} chickens.', 5);
+select sformat('The universe is {:,} years old.', 13800000000);
+select sformat('The universe is {:_} years old.', 13800000000);
+select sformat('String {:-}', 'hello');
+
+echo #;
+echo # Table Format Test Cases;
+echo #;
+create table t1 (pformat text, data1 FLOAT, data2 INT,
+ data3 VARCHAR(30));
+insert into t1 values ('{:.2f} {: } |{:*^15}', 1.11, 1, 'example I'),
+ ('{:.1f} {:-} |{:^15}', -2.22, -2, 'example II'),
+ ('{:.2f} {:+} |{:<15}', 3.33, 3, 'example III'),
+ ('{:.4f} {:d} |{:^15}', -4.44, -4, 'example IV');
+select sformat(pformat, data1, data2, data3) from t1;
+drop table t1;
+
+create table t2 (a double);
+insert into t2 values (3.14159265358979323846);
+select a, sformat('{:.15f}', a) from t2;
+drop table t2;
+
+echo #;
+echo # Unsupported/disabled features;
+echo #;
+select sformat('{:p}', '50');
+
+echo #;
+echo # ucs2 test;
+echo #;
+select sformat('={}=', _ucs2 x'006100620063');
+set names utf8;
+select sformat(_ucs2 x'003D007B007D003D', _ucs2 x'0442043504410442');
+select hex(sformat(_ucs2 x'003D007B007D003D', _ucs2 x'0442043504410442'));
+create table t1 as select sformat(_ucs2 x'003D007B007D003D', _ucs2 x'0442043504410442') as x;
+show create table t1;
+drop table t1;
+set names latin1;
+
+echo #;
+echo # ps parameters;
+echo #;
+prepare s from 'select sformat("={:d}=", ?)';
+execute s using 100;
+execute s using 'abc';
+
+echo #;
+echo # MDEV-26691 SFORMAT: Pass down FLOAT as FLOAT, without upcast to DOUBLE;
+echo #;
+
+select sformat('{}', cast(1.1 as float));
+
+echo #;
+echo # MDEV-26646 SFORMAT Does not allow @variable use;
+echo #;
+
+set names utf8;
+set @a=3.14;
+select sformat('{:f}', @a);
+set names latin1;
+
+echo #;
+echo # End of 10.7 tests;
+echo #;
diff --git a/mysql-test/main/func_time.result b/mysql-test/main/func_time.result
index d4b87340c35..60001aeb4ce 100644
--- a/mysql-test/main/func_time.result
+++ b/mysql-test/main/func_time.result
@@ -2798,7 +2798,7 @@ SET sql_mode=DEFAULT;
#
# MDEV-13972 crash in Item_func_sec_to_time::get_date
#
-DO TO_DAYS(SEC_TO_TIME(TIME(CEILING(UUID()))));
+DO TO_DAYS(SEC_TO_TIME(TIME(CEILING(SYS_GUID()))));
DO TO_DAYS(SEC_TO_TIME(MAKEDATE('',RAND(~('')))));
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: ''
diff --git a/mysql-test/main/func_time.test b/mysql-test/main/func_time.test
index 2ae79d41694..7135ae4cc87 100644
--- a/mysql-test/main/func_time.test
+++ b/mysql-test/main/func_time.test
@@ -1705,7 +1705,7 @@ SET sql_mode=DEFAULT;
# The below query can return warning sporadically
--disable_warnings
-DO TO_DAYS(SEC_TO_TIME(TIME(CEILING(UUID()))));
+DO TO_DAYS(SEC_TO_TIME(TIME(CEILING(SYS_GUID()))));
--enable_warnings
DO TO_DAYS(SEC_TO_TIME(MAKEDATE('',RAND(~('')))));
diff --git a/mysql-test/main/get_diagnostics.result b/mysql-test/main/get_diagnostics.result
index b00378d4ee9..47fd30f0dc7 100644
--- a/mysql-test/main/get_diagnostics.result
+++ b/mysql-test/main/get_diagnostics.result
@@ -628,7 +628,7 @@ v
NULL
Warnings:
Note 1050 Table 't1' already exists
-Error 1406 Data too long for column 'v' at row 1
+Error 1406 Data too long for column 'v' at row 0
DROP TABLE t1;
DROP PROCEDURE p1;
@@ -799,3 +799,1066 @@ CREATE TABLE t2 (a char(1)) VALUES ('a'),('b') UNION VALUES ('foo');
Warnings:
Warning 1406 Data too long for column 'a' at row 3
DROP TABLE t1, t2;
+#
+# End of 10.6 tests
+#
+#
+# MDEV-10075: Provide index of error causing error in array INSERT
+#
+#
+# INSERT STATEMENT
+#
+CREATE TABLE t1(id1 INT PRIMARY KEY, val1 VARCHAR(10), d1 DOUBLE);
+CREATE TABLE t2(id2 INT PRIMARY KEY, val2 VARCHAR(10), d2 DOUBLE, p2 POINT);
+# Simple INSERT statement
+INSERT INTO t1 VALUES(1,'a',1.00101), (2,'b',1.00102), (3,'c',1.00103);
+INSERT INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101),(2,'b',1.00102);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+GET DIAGNOSTICS CONDITION 1 @var1= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var2= ROW_NUMBER;
+Warnings:
+Error 1062 Duplicate entry '1' for key 'PRIMARY'
+Error 1758 Invalid condition number
+SELECT @var1, @var2;
+@var1 @var2
+2
+INSERT INTO t1 VALUES (5,'e',1.00105),(6,'f',1.79769313486232e+308);
+ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing
+GET DIAGNOSTICS CONDITION 1 @var3= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var4= ROW_NUMBER;
+Warnings:
+Error 1367 Illegal double '1.79769313486232e+308' value found during parsing
+Error 1758 Invalid condition number
+SELECT @var3, @var4;
+@var3 @var4
+2 NULL
+INSERT INTO t1 VALUES (7,'g',1.00107),(8,'h',1.00108),(9,'i'),(10,'j');
+ERROR 21S01: Column count doesn't match value count at row 3
+GET DIAGNOSTICS CONDITION 1 @var5= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var6= ROW_NUMBER;
+Warnings:
+Error 1136 Column count doesn't match value count at row 3
+Error 1758 Invalid condition number
+SELECT @var5, @var6;
+@var5 @var6
+3 NULL
+INSERT INTO t1 VALUES (8,8,8),(9,CAST(123 AS CHAR(1)),1.00109);
+Warnings:
+Warning 1292 Truncated incorrect CHAR(1) value: '123'
+GET DIAGNOSTICS CONDITION 1 @var7= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var8= ROW_NUMBER;
+Warnings:
+Warning 1292 Truncated incorrect CHAR(1) value: '123'
+Error 1758 Invalid condition number
+SELECT @var7, @var8;
+@var7 @var8
+2 NULL
+INSERT INTO t1 VALUES (10,10,10),('x','foo',1.0203);
+Warnings:
+Warning 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 2
+GET DIAGNOSTICS CONDITION 1 @var9= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var10= ROW_NUMBER;
+Warnings:
+Warning 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 2
+Error 1758 Invalid condition number
+SELECT @var9, @var10;
+@var9 @var10
+2 NULL
+INSERT INTO t1 VALUES (11,11,11),(12,12,(13,'m',1.0113));
+ERROR 21000: Operand should contain 1 column(s)
+GET DIAGNOSTICS CONDITION 1 @var11= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var12= ROW_NUMBER;
+Warnings:
+Error 1241 Operand should contain 1 column(s)
+Error 1758 Invalid condition number
+SELECT @var11, @var12;
+@var11 @var12
+2 NULL
+delete from t1 where id1=0;
+INSERT INTO t1 VALUES (14,'n',1.0114), (15,'o',1.0115), (16/0,'p',1.0116);
+Warnings:
+Warning 1365 Division by 0
+Warning 1048 Column 'id1' cannot be null
+GET DIAGNOSTICS CONDITION 1 @var13= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var14= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var15= ROW_NUMBER;
+Warnings:
+Warning 1365 Division by 0
+Warning 1048 Column 'id1' cannot be null
+Error 1758 Invalid condition number
+SELECT @var13, @var14, @var15;
+@var13 @var14 @var15
+3 3 NULL
+TRUNCATE TABLE t1;
+# INSERT ... IGNORE
+INSERT IGNORE INTO t1 VALUES(1,'a',1.00101), (2,'b',1.00102), (3,'c',1.00103);
+INSERT IGNORE INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101),(2,'b',1.00102);
+Warnings:
+Warning 1062 Duplicate entry '1' for key 'PRIMARY'
+Warning 1062 Duplicate entry '2' for key 'PRIMARY'
+GET DIAGNOSTICS CONDITION 1 @var16= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var17= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var18= ROW_NUMBER;
+Warnings:
+Warning 1062 Duplicate entry '1' for key 'PRIMARY'
+Warning 1062 Duplicate entry '2' for key 'PRIMARY'
+Error 1758 Invalid condition number
+SELECT @var16, @var17, @var18;
+@var16 @var17 @var18
+2 3 NULL
+INSERT IGNORE INTO t1 VALUES (5,'e',1.00105),(6,'f',1.79769313486232e+308);
+ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing
+GET DIAGNOSTICS CONDITION 1 @var19= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var20= ROW_NUMBER;
+Warnings:
+Error 1367 Illegal double '1.79769313486232e+308' value found during parsing
+Error 1758 Invalid condition number
+SELECT @var19, @var20;
+@var19 @var20
+2 NULL
+INSERT IGNORE INTO t1 VALUES (7,'g',1.00107),(8,'h',1.00108),(9,'i'),(10,'j');
+ERROR 21S01: Column count doesn't match value count at row 3
+GET DIAGNOSTICS CONDITION 1 @var21= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var22= ROW_NUMBER;
+Warnings:
+Error 1136 Column count doesn't match value count at row 3
+Error 1758 Invalid condition number
+SELECT @var21, @var22;
+@var21 @var22
+3 NULL
+INSERT IGNORE INTO t1 VALUES (8,8,8),(9,CAST(123 AS CHAR(1)),1.00109);
+Warnings:
+Warning 1292 Truncated incorrect CHAR(1) value: '123'
+GET DIAGNOSTICS CONDITION 1 @var23= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var24= ROW_NUMBER;
+Warnings:
+Warning 1292 Truncated incorrect CHAR(1) value: '123'
+Error 1758 Invalid condition number
+SELECT @var23, @var24;
+@var23 @var24
+2 NULL
+INSERT IGNORE INTO t1 VALUES (10,10,10),('x','foo',1.0203);
+Warnings:
+Warning 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 2
+GET DIAGNOSTICS CONDITION 1 @var25= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var26= ROW_NUMBER;
+Warnings:
+Warning 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 2
+Error 1758 Invalid condition number
+SELECT @var25, @var26;
+@var25 @var26
+2 NULL
+INSERT IGNORE INTO t1 VALUES (11,11,11),(12,12,(13,'m',1.0113));
+ERROR 21000: Operand should contain 1 column(s)
+GET DIAGNOSTICS CONDITION 1 @var27= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var28= ROW_NUMBER;
+Warnings:
+Error 1241 Operand should contain 1 column(s)
+Error 1758 Invalid condition number
+SELECT @var27, @var28;
+@var27 @var28
+2 NULL
+INSERT IGNORE INTO t1 VALUES (14,'n',1.0114), (15,'o',1.0115),
+(16/0,'p',1.0116);
+Warnings:
+Warning 1365 Division by 0
+Warning 1048 Column 'id1' cannot be null
+Warning 1062 Duplicate entry '0' for key 'PRIMARY'
+GET DIAGNOSTICS CONDITION 1 @var29= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var30= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var31= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 4 @var32= ROW_NUMBER;
+Warnings:
+Warning 1365 Division by 0
+Warning 1048 Column 'id1' cannot be null
+Warning 1062 Duplicate entry '0' for key 'PRIMARY'
+Error 1758 Invalid condition number
+SELECT @var29, @var30, @var31, @var32;
+@var29 @var30 @var31 @var32
+3 3 3 NULL
+TRUNCATE TABLE t1;
+# INSERT ... SET
+INSERT INTO t1 SET id1=1, val1='a', d1=1.00101;
+INSERT INTO t1 SET id1=2, val1='b', d1=1.00102;
+INSERT INTO t1 SET id1=3, val1='c', d1=1.00103;
+INSERT INTO t1 SET id1=1, val1='a', d1=1.00101;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+GET DIAGNOSTICS CONDITION 1 @var33= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var34= ROW_NUMBER;
+Warnings:
+Error 1062 Duplicate entry '1' for key 'PRIMARY'
+Error 1758 Invalid condition number
+SELECT @var33, @var34;
+@var33 @var34
+1 NULL
+INSERT INTO t1 SET id1=6, val1='f', d1=1.79769313486232e+308);
+ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing
+GET DIAGNOSTICS CONDITION 1 @var35= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var36= ROW_NUMBER;
+Warnings:
+Error 1367 Illegal double '1.79769313486232e+308' value found during parsing
+Error 1758 Invalid condition number
+SELECT @var35, @var36;
+@var35 @var36
+1 NULL
+INSERT INTO t1 SET id1=9, val1=CAST(123 AS CHAR(1)), d1=1.00109;
+ERROR 22007: Truncated incorrect CHAR(1) value: '123'
+GET DIAGNOSTICS CONDITION 1 @var37= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var38= ROW_NUMBER;
+Warnings:
+Error 1292 Truncated incorrect CHAR(1) value: '123'
+Error 1758 Invalid condition number
+SELECT @var37, @var38;
+@var37 @var38
+1 NULL
+INSERT INTO t1 SET id1='x', val1='foo', d1=1.0203;
+ERROR 22007: Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 1
+GET DIAGNOSTICS CONDITION 1 @var39= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var40= ROW_NUMBER;
+Warnings:
+Error 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 1
+Error 1758 Invalid condition number
+SELECT @var39, @var40;
+@var39 @var40
+1 NULL
+INSERT INTO t1 SET id1=3/0, val1='p', d1=1.0116;
+ERROR 22012: Division by 0
+GET DIAGNOSTICS CONDITION 1 @var41= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var42= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var43= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 4 @var44= ROW_NUMBER;
+Warnings:
+Error 1365 Division by 0
+Error 1048 Column 'id1' cannot be null
+Error 1105 Unknown error
+Error 1758 Invalid condition number
+SELECT @var41, @var42, @var43, @var44;
+@var41 @var42 @var43 @var44
+1 1 1 NULL
+TRUNCATE TABLE t1;
+# INSERT ... ON DUPLICATE KEY UPDATE
+INSERT INTO t1 VALUES(1,'a',1.00101), (2,'b',1.00102), (3,'c',1.00103);
+INSERT INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101)
+ON DUPLICATE KEY UPDATE val1='a', d1=1.00101;
+GET DIAGNOSTICS CONDITION 1 @var45= ROW_NUMBER;
+Warnings:
+Error 1758 Invalid condition number
+GET DIAGNOSTICS CONDITION 2 @var46= ROW_NUMBER;
+Warnings:
+Error 1758 Invalid condition number
+Error 1758 Invalid condition number
+SELECT @var45, @var46;
+@var45 @var46
+NULL NULL
+INSERT INTO t1 VALUES (5,'e',1.00105),(3,'f',1.79769313486232e+308)
+ON DUPLICATE KEY UPDATE val1='c';
+ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing
+GET DIAGNOSTICS CONDITION 1 @var47= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var48= ROW_NUMBER;
+Warnings:
+Error 1367 Illegal double '1.79769313486232e+308' value found during parsing
+Error 1758 Invalid condition number
+SELECT @var47, @var48;
+@var47 @var48
+2 NULL
+INSERT INTO t1 VALUES (5,'e',1.00105), (3,'i')
+ON DUPLICATE KEY UPDATE val1='c';
+ERROR 21S01: Column count doesn't match value count at row 2
+GET DIAGNOSTICS CONDITION 1 @var49= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var50= ROW_NUMBER;
+Warnings:
+Error 1136 Column count doesn't match value count at row 2
+Error 1758 Invalid condition number
+SELECT @var49, @var50;
+@var49 @var50
+2 NULL
+INSERT INTO t1 VALUES (3, CAST(123 AS CHAR(1)), 1.00103)
+ON DUPLICATE KEY UPDATE val1='c';
+ERROR 22007: Truncated incorrect CHAR(1) value: '123'
+GET DIAGNOSTICS CONDITION 1 @var51= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var52= ROW_NUMBER;
+Warnings:
+Error 1292 Truncated incorrect CHAR(1) value: '123'
+Error 1758 Invalid condition number
+SELECT @var51, @var52;
+@var51 @var52
+1 NULL
+INSERT INTO t1 VALUES (10,10,10),('x','foo',1.0203)
+ON DUPLICATE KEY UPDATE val1='c';
+Warnings:
+Warning 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 2
+GET DIAGNOSTICS CONDITION 1 @var53= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var54= ROW_NUMBER;
+Warnings:
+Warning 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 2
+Error 1758 Invalid condition number
+SELECT @var53, @var54;
+@var53 @var54
+2 NULL
+INSERT INTO t1 VALUES (11,11,11),(12,12,(13,'m',1.0113)) ON DUPLICATE KEY UPDATE val1='c';
+ERROR 21000: Operand should contain 1 column(s)
+GET DIAGNOSTICS CONDITION 1 @var55= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var56= ROW_NUMBER;
+Warnings:
+Error 1241 Operand should contain 1 column(s)
+Error 1758 Invalid condition number
+SELECT @var55, @var56;
+@var55 @var56
+2 NULL
+INSERT INTO t1 VALUES (14,'n',1.0114), (15,'o',1.0115), (2/0,'p',1.00102)
+ON DUPLICATE KEY UPDATE val1='b';
+Warnings:
+Warning 1365 Division by 0
+Warning 1048 Column 'id1' cannot be null
+GET DIAGNOSTICS CONDITION 1 @var57= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var58= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var59= ROW_NUMBER;
+Warnings:
+Warning 1365 Division by 0
+Warning 1048 Column 'id1' cannot be null
+Error 1758 Invalid condition number
+SELECT @var57, @var58, @var59;
+@var57 @var58 @var59
+3 3 NULL
+INSERT INTO t1 VALUES (1,'e',1.0),(5,'e',1.0),(5,'f',1.7)
+ON DUPLICATE KEY UPDATE id1='1';
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+GET DIAGNOSTICS CONDITION 1 @var60= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var61= ROW_NUMBER;
+Warnings:
+Error 1062 Duplicate entry '1' for key 'PRIMARY'
+Error 1758 Invalid condition number
+SELECT @var60, @var61;
+@var60 @var61
+3 NULL
+TRUNCATE TABLE t1;
+DROP TABLE t1;
+DROP TABLE t2;
+INSERT ... SELECT
+CREATE TABLE t1(id1 INT PRIMARY KEY, val1 VARCHAR(10), d1 DOUBLE);
+CREATE TABLE t2(id2 INT PRIMARY KEY, val2 VARCHAR(10), d2 DOUBLE, p2 POINT);
+INSERT INTO t2 VALUES(1,'a',1.00101,PointFromText('POINT(20 10)')),
+(2,'b',1.00102,PointFromText('POINT(20 10)')),
+(3,'c',1.00103,PointFromText('POINT(20 10)'));
+INSERT INTO t1 SELECT id2, val2, d2 FROM t2;
+INSERT INTO t1 SELECT id2, val2, d2 FROM t2 WHERE id2=1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+GET DIAGNOSTICS CONDITION 1 @var62= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var63= ROW_NUMBER;
+Warnings:
+Error 1062 Duplicate entry '1' for key 'PRIMARY'
+Error 1758 Invalid condition number
+SELECT @var62, @var63;
+@var62 @var63
+1 NULL
+INSERT INTO t1 SELECT id2, val2, p2 from t2;
+ERROR 22007: Incorrect double value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x004@\x00\x00\x00\x00\x00\x00$@' for column `test`.`t1`.`d1` at row 1
+GET DIAGNOSTICS CONDITION 1 @var64= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var65= ROW_NUMBER;
+Warnings:
+Error 1366 Incorrect double value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x004@\x00\x00\x00\x00\x00\x00$@' for column `test`.`t1`.`d1` at row 1
+Error 1758 Invalid condition number
+SELECT @var64, @var65;
+@var64 @var65
+1 NULL
+INSERT INTO t1 SELECT id2, val2 FROM t2;
+ERROR 21S01: Column count doesn't match value count at row 1
+GET DIAGNOSTICS CONDITION 1 @var66= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var67= ROW_NUMBER;
+Warnings:
+Error 1136 Column count doesn't match value count at row 1
+Error 1758 Invalid condition number
+SELECT @var66, @var67;
+@var66 @var67
+1 NULL
+INSERT INTO t2 VALUES(4,'a',1.00101,PointFromText('POINT(20 10)'));
+INSERT INTO t1 SELECT id2, CAST(123 AS CHAR(1)), d2 FROM t2 WHERE id2=4;
+ERROR 22007: Truncated incorrect CHAR(1) value: '123'
+GET DIAGNOSTICS CONDITION 1 @var68= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var69= ROW_NUMBER;
+Warnings:
+Error 1292 Truncated incorrect CHAR(1) value: '123'
+Error 1758 Invalid condition number
+SELECT @var68, @var69;
+@var68 @var69
+1 NULL
+INSERT INTO t1 SELECT id2, val2, 1.79769313486232e+308 FROM t2;
+ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing
+GET DIAGNOSTICS CONDITION 1 @var70= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var71= ROW_NUMBER;
+Warnings:
+Error 1367 Illegal double '1.79769313486232e+308' value found during parsing
+Error 1758 Invalid condition number
+SELECT @var70, @var71;
+@var70 @var71
+1 NULL
+INSERT INTO t1 SELECT id2/0, val2, d2 FROM t2;
+ERROR 22012: Division by 0
+GET DIAGNOSTICS CONDITION 1 @var72= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var73= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var74= ROW_NUMBER;
+Warnings:
+Error 1365 Division by 0
+Error 1048 Column 'id1' cannot be null
+Error 1758 Invalid condition number
+SELECT @var72, @var73, @var74;
+@var72 @var73 @var74
+1 1 NULL
+DROP TABLE t1,t2;
+# Checking ROW_NUMBER in STORED PROCEDURE for INSERT
+CREATE TABLE t1(id1 INT PRIMARY KEY);
+CREATE PROCEDURE proc1 ()
+BEGIN
+DECLARE var75 INT;
+DECLARE var76 INT;
+INSERT INTO t1 VALUES (1),(2);
+INSERT IGNORE INTO t1 VALUES(2);
+GET DIAGNOSTICS CONDITION 1 var75= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 var76= ROW_NUMBER;
+SELECT var75, var76;
+END;
+|
+CALL proc1();
+var75 var76
+1 NULL
+Warnings:
+Warning 1062 Duplicate entry '2' for key 'PRIMARY'
+Error 1758 Invalid condition number
+TRUNCATE TABLE t1;
+# Checking ROW_NUMBER in PREPARED STATEMENTS for INSERT
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT IGNORE INTO t1 VALUES(2),(3),(4);
+Warnings:
+Warning 1062 Duplicate entry '2' for key 'PRIMARY'
+Warning 1062 Duplicate entry '3' for key 'PRIMARY'
+PREPARE stmt1 FROM "GET DIAGNOSTICS CONDITION 2 @var77= ROW_NUMBER";
+EXECUTE stmt1;
+SELECT @var77;
+@var77
+2
+DROP PROCEDURE proc1;
+DROP PREPARE stmt1;
+DROP TABLE t1;
+#
+# REPLACE STATEMENT
+#
+CREATE TABLE t1(id1 INT PRIMARY KEY, val1 VARCHAR(10), d1 DOUBLE);
+CREATE TABLE t2(id2 INT PRIMARY KEY, val2 VARCHAR(10), d2 DOUBLE);
+# Simple REPLACE statement
+REPLACE INTO t1 VALUES(1,'a',1.00101), (2,'b',1.00102), (3,'c',1.00103);
+REPLACE INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101),(2,'b',1.00102);
+GET DIAGNOSTICS CONDITION 1 @var78= ROW_NUMBER;
+Warnings:
+Error 1758 Invalid condition number
+SELECT @var78;
+@var78
+NULL
+REPLACE INTO t1 VALUES (5,'e',1.00105),(6,'f',1.79769313486232e+308);
+ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing
+GET DIAGNOSTICS CONDITION 1 @var79= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var80= ROW_NUMBER;
+Warnings:
+Error 1367 Illegal double '1.79769313486232e+308' value found during parsing
+Error 1758 Invalid condition number
+SELECT @var79, @var80;
+@var79 @var80
+2 NULL
+REPLACE INTO t1 VALUES (7,'g',1.00107),(8,'h',1.00108),(9,'i'),(10,'j');
+ERROR 21S01: Column count doesn't match value count at row 3
+GET DIAGNOSTICS CONDITION 1 @var81= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var82= ROW_NUMBER;
+Warnings:
+Error 1136 Column count doesn't match value count at row 3
+Error 1758 Invalid condition number
+SELECT @var81, @var82;
+@var81 @var82
+3 NULL
+REPLACE INTO t1 VALUES (8,8,8),(9,CAST(123 AS CHAR(1)),1.00109);
+Warnings:
+Warning 1292 Truncated incorrect CHAR(1) value: '123'
+GET DIAGNOSTICS CONDITION 1 @var83= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var84= ROW_NUMBER;
+Warnings:
+Warning 1292 Truncated incorrect CHAR(1) value: '123'
+Error 1758 Invalid condition number
+SELECT @var83, @var84;
+@var83 @var84
+2 NULL
+REPLACE INTO t1 VALUES (10,10,10),('x','foo',1.0203);
+Warnings:
+Warning 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 2
+GET DIAGNOSTICS CONDITION 1 @var85= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var86= ROW_NUMBER;
+Warnings:
+Warning 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 2
+Error 1758 Invalid condition number
+SELECT @var85, @var86;
+@var85 @var86
+2 NULL
+REPLACE INTO t1 VALUES (11,11,11),(12,12,(13,'m',1.0113));
+ERROR 21000: Operand should contain 1 column(s)
+GET DIAGNOSTICS CONDITION 1 @var87= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var88= ROW_NUMBER;
+Warnings:
+Error 1241 Operand should contain 1 column(s)
+Error 1758 Invalid condition number
+SELECT @var87, @var88;
+@var87 @var88
+2 NULL
+REPLACE INTO t1 VALUES (14,'n',1.0114), (15,'o',1.0115), (16/0,'p',1.0116);
+Warnings:
+Warning 1365 Division by 0
+Warning 1048 Column 'id1' cannot be null
+GET DIAGNOSTICS CONDITION 1 @var89= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var90= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var91= ROW_NUMBER;
+Warnings:
+Warning 1365 Division by 0
+Warning 1048 Column 'id1' cannot be null
+Error 1758 Invalid condition number
+SELECT @var89, @var90, @var91;
+@var89 @var90 @var91
+3 3 NULL
+TRUNCATE TABLE t1;
+# REPLACE ... SET
+REPLACE INTO t1 SET id1=1, val1='a', d1=1.00101;
+REPLACE INTO t1 SET id1=2, val1='b', d1=1.00102;
+REPLACE INTO t1 SET id1=3, val1='c', d1=1.00103;
+REPLACE INTO t1 SET id1=1, val1='a', d1=1.00101;
+GET DIAGNOSTICS CONDITION 1 @var92= ROW_NUMBER;
+Warnings:
+Error 1758 Invalid condition number
+SELECT @var92;
+@var92
+NULL
+REPLACE INTO t1 SET id1=6, val1='f', d1=1.79769313486232e+308);
+ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing
+GET DIAGNOSTICS CONDITION 1 @var93= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var94= ROW_NUMBER;
+Warnings:
+Error 1367 Illegal double '1.79769313486232e+308' value found during parsing
+Error 1758 Invalid condition number
+SELECT @var93, @var94;
+@var93 @var94
+1 NULL
+REPLACE INTO t1 SET id1=9, val1=CAST(123 AS CHAR(1)), d1=1.00109;
+ERROR 22007: Truncated incorrect CHAR(1) value: '123'
+GET DIAGNOSTICS CONDITION 1 @var95= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var96= ROW_NUMBER;
+Warnings:
+Error 1292 Truncated incorrect CHAR(1) value: '123'
+Error 1758 Invalid condition number
+SELECT @var95, @var96;
+@var95 @var96
+1 NULL
+REPLACE INTO t1 SET id1='x', val1='foo', d1=1.0203;
+ERROR 22007: Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 1
+GET DIAGNOSTICS CONDITION 1 @var97= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var98= ROW_NUMBER;
+Warnings:
+Error 1366 Incorrect integer value: 'x' for column `test`.`t1`.`id1` at row 1
+Error 1758 Invalid condition number
+SELECT @var97, @var98;
+@var97 @var98
+1 NULL
+REPLACE INTO t1 SET id1=3/0, val1='p', d1=1.0116;
+ERROR 22012: Division by 0
+GET DIAGNOSTICS CONDITION 1 @var99= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var100= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var101= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 4 @var102= ROW_NUMBER;
+Warnings:
+Error 1365 Division by 0
+Error 1048 Column 'id1' cannot be null
+Error 1105 Unknown error
+Error 1758 Invalid condition number
+SELECT @var99, @var100, @var101, @var102;
+@var99 @var100 @var101 @var102
+1 1 1 NULL
+TRUNCATE TABLE t1;
+DROP TABLE t1;
+DROP TABLE t2;
+# REPLACE ... SELECT
+CREATE TABLE t1(id1 INT PRIMARY KEY, val1 VARCHAR(10), d1 DOUBLE);
+CREATE TABLE t2(id2 INT PRIMARY KEY, val2 VARCHAR(10), d2 DOUBLE, p2 POINT);
+INSERT INTO t2 VALUES(1,'a',1.00101,PointFromText('POINT(20 10)')),
+(2,'b',1.00102,PointFromText('POINT(20 10)')),
+(3,'c',1.00103,PointFromText('POINT(20 10)'));
+INSERT INTO t1 SELECT id2, val2, d2 FROM t2;
+INSERT INTO t1 SELECT id2, val2, d2 FROM t2 WHERE id2=1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+GET DIAGNOSTICS CONDITION 1 @var103= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var104= ROW_NUMBER;
+Warnings:
+Error 1062 Duplicate entry '1' for key 'PRIMARY'
+Error 1758 Invalid condition number
+SELECT @var103, @var104;
+@var103 @var104
+1 NULL
+INSERT INTO t1 SELECT id2, val2, p2 from t2;
+ERROR 22007: Incorrect double value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x004@\x00\x00\x00\x00\x00\x00$@' for column `test`.`t1`.`d1` at row 1
+GET DIAGNOSTICS CONDITION 1 @var105= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var106= ROW_NUMBER;
+Warnings:
+Error 1366 Incorrect double value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x004@\x00\x00\x00\x00\x00\x00$@' for column `test`.`t1`.`d1` at row 1
+Error 1758 Invalid condition number
+SELECT @var105, @var106;
+@var105 @var106
+1 NULL
+INSERT INTO t1 SELECT id2, val2 FROM t2;
+ERROR 21S01: Column count doesn't match value count at row 1
+GET DIAGNOSTICS CONDITION 1 @var107= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var108= ROW_NUMBER;
+Warnings:
+Error 1136 Column count doesn't match value count at row 1
+Error 1758 Invalid condition number
+SELECT @var107, @var108;
+@var107 @var108
+1 NULL
+INSERT INTO t2 VALUES(4,'a',1.00101,PointFromText('POINT(20 10)'));
+INSERT INTO t1 SELECT id2, CAST(123 AS CHAR(1)), d2 FROM t2 WHERE id2=4;
+ERROR 22007: Truncated incorrect CHAR(1) value: '123'
+GET DIAGNOSTICS CONDITION 1 @var109= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var110= ROW_NUMBER;
+Warnings:
+Error 1292 Truncated incorrect CHAR(1) value: '123'
+Error 1758 Invalid condition number
+SELECT @var109, @var110;
+@var109 @var110
+1 NULL
+INSERT INTO t1 SELECT id2, val2, 1.79769313486232e+308 FROM t2;
+ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing
+GET DIAGNOSTICS CONDITION 1 @var111= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var112= ROW_NUMBER;
+Warnings:
+Error 1367 Illegal double '1.79769313486232e+308' value found during parsing
+Error 1758 Invalid condition number
+SELECT @var111, @var112;
+@var111 @var112
+1 NULL
+INSERT INTO t1 SELECT id2/0, val2, d2 FROM t2;
+ERROR 22012: Division by 0
+GET DIAGNOSTICS CONDITION 1 @var113= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var114= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var115= ROW_NUMBER;
+Warnings:
+Error 1365 Division by 0
+Error 1048 Column 'id1' cannot be null
+Error 1758 Invalid condition number
+SELECT @var113, @var114, @var115;
+@var113 @var114 @var115
+1 1 NULL
+DROP TABLE t1,t2;
+# Checking ROW_NUMBER in STORED PROCEDURE
+CREATE TABLE t1(id1 INT PRIMARY KEY);
+CREATE PROCEDURE proc1 ()
+BEGIN
+DECLARE var116 INT;
+REPLACE INTO t1 VALUES (1),(2);
+GET DIAGNOSTICS CONDITION 1 var116= ROW_NUMBER;
+SELECT var116;
+END;
+|
+CALL proc1();
+var116
+NULL
+Warnings:
+Error 1758 Invalid condition number
+TRUNCATE TABLE t1;
+# Checking ROW_NUMBER in PREPARED STATEMENTS
+REPLACE INTO t1 VALUES (1), (2), (3);
+PREPARE stmt1 FROM "GET DIAGNOSTICS CONDITION 2 @var117= ROW_NUMBER";
+EXECUTE stmt1;
+Warnings:
+Error 1758 Invalid condition number
+SELECT @var117;
+@var117
+NULL
+DROP PROCEDURE proc1;
+DROP PREPARE stmt1;
+DROP TABLE t1;
+#
+# Checking that ROW_NUMBER is only for errors with rows/values
+#
+# INSERT STATEMENT
+CREATE TABLE t1(id1 INT);
+CREATE TABLE t2(id2 INT);
+CREATE VIEW v AS SELECT t1.id1 AS A, t2.id2 AS b FROM t1,t2;
+INSERT INTO t1(id1, id1) VALUES (1,1);
+ERROR 42000: Column 'id1' specified twice
+GET DIAGNOSTICS CONDITION 1 @var118= ROW_NUMBER;
+SELECT @var118;
+@var118
+0
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+INSERT INTO t1 VALUES (1);
+RETURN 1;
+END |
+INSERT INTO t1 VALUES (1), (f1());
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger
+GET DIAGNOSTICS CONDITION 1 @var119= ROW_NUMBER;
+SELECT @var119;
+@var119
+0
+INSERT INTO t1 VALUES (1) RETURNING id2;
+ERROR 42S22: Unknown column 'id2' in 'field list'
+GET DIAGNOSTICS CONDITION 1 @var120= ROW_NUMBER;
+SELECT @var120;
+@var120
+0
+INSERT INTO t1(id2) VALUES(1);
+ERROR 42S22: Unknown column 'id2' in 'field list'
+GET DIAGNOSTICS CONDITION 1 @var121= ROW_NUMBER;
+SELECT @var121;
+@var121
+0
+INSERT INTO v VALUES(1,2);
+ERROR HY000: Can not insert into join view 'test.v' without fields list
+GET DIAGNOSTICS CONDITION 1 @var122= ROW_NUMBER;
+SELECT @var122;
+@var122
+0
+INSERT INTO v(a,b) VALUES (1,2);
+ERROR HY000: Can not modify more than one base table through a join view 'test.v'
+GET DIAGNOSTICS CONDITION 1 @var123= ROW_NUMBER;
+SELECT @var123;
+@var123
+0
+# REPLACE STATEMENT
+REPLACE INTO t1(id1, id1) VALUES (1,1);
+ERROR 42000: Column 'id1' specified twice
+GET DIAGNOSTICS CONDITION 1 @var124= ROW_NUMBER;
+SELECT @var124;
+@var124
+0
+CREATE FUNCTION f2() RETURNS INT
+BEGIN
+REPLACE INTO t1 VALUES (1);
+RETURN 1;
+END |
+REPLACE INTO t1 VALUES (1), (f2());
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger
+GET DIAGNOSTICS CONDITION 1 @var125= ROW_NUMBER;
+SELECT @var125;
+@var125
+0
+REPLACE INTO t1 VALUES (1) RETURNING id2;
+ERROR 42S22: Unknown column 'id2' in 'field list'
+GET DIAGNOSTICS CONDITION 1 @var126= ROW_NUMBER;
+SELECT @var126;
+@var126
+0
+REPLACE INTO t1(id2) VALUES(1);
+ERROR 42S22: Unknown column 'id2' in 'field list'
+GET DIAGNOSTICS CONDITION 1 @var127= ROW_NUMBER;
+SELECT @var127;
+@var127
+0
+REPLACE INTO v VALUES(1,2);
+ERROR HY000: Can not insert into join view 'test.v' without fields list
+GET DIAGNOSTICS CONDITION 1 @var128= ROW_NUMBER;
+SELECT @var128;
+@var128
+0
+REPLACE INTO v(a,b) VALUES (1,2);
+ERROR HY000: Can not modify more than one base table through a join view 'test.v'
+GET DIAGNOSTICS CONDITION 1 @var129= ROW_NUMBER;
+SELECT @var129;
+@var129
+0
+DROP TABLE t1,t2;
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP VIEW v;
+#
+# MDEV-26606: ROW_NUMBER property value isn't passed from inside a
+# stored procedure
+#
+# Test 1: Without RESIGNAL
+CREATE OR REPLACE TABLE t1 (pk INT PRIMARY KEY);
+CREATE OR REPLACE PROCEDURE sp(a INT) INSERT INTO t1 VALUES (2),(a);
+SET @num=null, @msg=null;
+INSERT INTO t1 VALUES(1);
+CALL sp(1);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+GET DIAGNOSTICS CONDITION 1 @num = ROW_NUMBER, @msg = MESSAGE_TEXT;
+SELECT @num, @msg;
+@num @msg
+2 Duplicate entry '1' for key 'PRIMARY'
+DROP PROCEDURE sp;
+DROP TABLE t1;
+# Test 2: With RESIGNAL
+CREATE OR REPLACE TABLE t1 (pk INT PRIMARY KEY);
+CREATE OR REPLACE PROCEDURE sp(a INT)
+BEGIN
+DECLARE n INT;
+DECLARE m VARCHAR(255);
+DECLARE EXIT HANDLER FOR 1062
+BEGIN
+GET DIAGNOSTICS CONDITION 1 n = ROW_NUMBER, m = MESSAGE_TEXT;
+SELECT n, m;
+RESIGNAL;
+END;
+INSERT INTO t1 VALUES (2), (a);
+END |
+SET @num=null, @msg=null;
+INSERT INTO t1 VALUES (1);
+CALL sp(1);
+n m
+2 Duplicate entry '1' for key 'PRIMARY'
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+GET DIAGNOSTICS CONDITION 1 @num = ROW_NUMBER, @msg = MESSAGE_TEXT;
+SELECT @num, @msg;
+@num @msg
+2 Duplicate entry '1' for key 'PRIMARY'
+DROP PROCEDURE sp;
+DROP TABLE t1;
+# Checking more errors
+CREATE TABLE t1 (val1 TINYINT);
+CREATE PROCEDURE sp(a INT) INSERT INTO t1 VALUES (2),(a);
+INSERT INTO t1 VALUES(1);
+CALL sp(100000);
+Warnings:
+Warning 1264 Out of range value for column 'val1' at row 2
+GET DIAGNOSTICS CONDITION 1 @var1= ROW_NUMBER;
+SELECT @var1;
+@var1
+2
+DROP TABLE t1;
+DROP PROCEDURE sp;
+#
+# MDEV-26684: Unexpected ROW_NUMBER in a condition raised by a diagnostics statement
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+GET DIAGNOSTICS CONDITION 5 @msg = MESSAGE_TEXT;
+Warnings:
+Error 1758 Invalid condition number
+SHOW WARNINGS;
+Level Code Message
+Error 1758 Invalid condition number
+GET DIAGNOSTICS CONDITION 1 @ind = ROW_NUMBER, @msg = MESSAGE_TEXT;
+SELECT @ind, @msg;
+@ind @msg
+0 Invalid condition number
+INSERT INTO t1 VALUES (3),(4);
+GET DIAGNOSTICS CONDITION 1 @ind = ROW_NUMBER, @msg = MESSAGE_TEXT;
+Warnings:
+Error 1758 Invalid condition number
+SELECT @ind, @msg;
+@ind @msg
+0 Invalid condition number
+GET DIAGNOSTICS CONDITION 5 @ind = ROW_NUMBER, @msg = MESSAGE_TEXT;
+Warnings:
+Error 1758 Invalid condition number
+Error 1758 Invalid condition number
+SELECT @ind, @msg;
+@ind @msg
+0 Invalid condition number
+DROP TABLE t1;
+#
+# MDEV-26681: ROW_NUMBER is not available within compound statement blocks
+#
+CREATE OR REPLACE TABLE t1 (pk INT PRIMARY KEY, a CHAR(3));
+INSERT IGNORE INTO t1 VALUES (1,'foo'),(1,'bar'),(2,'foobar');
+Warnings:
+Warning 1062 Duplicate entry '1' for key 'PRIMARY'
+Warning 1265 Data truncated for column 'a' at row 3
+BEGIN NOT ATOMIC
+DECLARE i INT DEFAULT 0;
+DECLARE rnum INT DEFAULT -1;
+DECLARE msg VARCHAR(1024) DEFAULT '';
+DECLARE err INT DEFAULT -1;
+WHILE i < @@warning_count
+DO
+SET i = i + 1;
+GET DIAGNOSTICS CONDITION i rnum = ROW_NUMBER, msg = MESSAGE_TEXT, err = MYSQL_ERRNO;
+SELECT i, rnum, msg, err;
+END WHILE;
+END |
+i rnum msg err
+1 2 Duplicate entry '1' for key 'PRIMARY' 1062
+i rnum msg err
+2 3 Data truncated for column 'a' at row 3 1265
+GET DIAGNOSTICS CONDITION 1 @rnum = ROW_NUMBER, @msg = MESSAGE_TEXT, @err = MYSQL_ERRNO;
+select @rnum, @msg, @err;
+@rnum @msg @err
+2 Duplicate entry '1' for key 'PRIMARY' 1062
+GET DIAGNOSTICS CONDITION 2 @rnum = ROW_NUMBER, @msg = MESSAGE_TEXT, @err = MYSQL_ERRNO;
+SELECT @rnum, @msg, @err;
+@rnum @msg @err
+3 Data truncated for column 'a' at row 3 1265
+DROP TABLE t1;
+#
+# ROW_NUMBER differs from the number in the error message upon
+# ER_WARN_DATA_OUT_OF_RANGE
+#
+CREATE TABLE t (a INT);
+INSERT INTO t VALUES (1),(2);
+SELECT CAST(a AS DECIMAL(2,2)) AS f FROM t;
+f
+0.99
+0.99
+Warnings:
+Warning 1264 Out of range value for column 'f' at row 1
+Warning 1264 Out of range value for column 'f' at row 2
+GET DIAGNOSTICS CONDITION 2 @n= ROW_NUMBER, @m = MESSAGE_TEXT;
+SELECT @n, @m;
+@n @m
+2 Out of range value for column 'f' at row 2
+DROP TABLE t;
+#
+# MDEV-26832: ROW_NUMBER in SIGNAL/RESIGNAL causes a syntax error
+#
+# using signal
+CREATE PROCEDURE signal_syntax()
+BEGIN
+DECLARE errno INT DEFAULT 0;
+DECLARE msg TEXT DEFAULT "foo";
+DECLARE row_num INT DEFAULT 0;
+DECLARE cond CONDITION FOR SQLSTATE "01234";
+DECLARE CONTINUE HANDLER for 1012
+BEGIN
+GET DIAGNOSTICS CONDITION 1 errno = MYSQL_ERRNO, msg = MESSAGE_TEXT, row_num= ROW_NUMBER;
+END;
+SIGNAL cond SET MESSAGE_TEXT = "Signal message", MYSQL_ERRNO = 1012, ROW_NUMBER= 5;
+SELECT errno, msg, row_num;
+END|
+CALL signal_syntax();
+errno msg row_num
+1012 Signal message 5
+DROP PROCEDURE signal_syntax;
+# using resignal
+CREATE PROCEDURE resignal_syntax()
+BEGIN
+DECLARE CONTINUE HANDLER
+FOR 1146
+BEGIN
+RESIGNAL SET
+MESSAGE_TEXT = '`temptab` does not exist', ROW_NUMBER= 105;
+END;
+SELECT `c` FROM `temptab`;
+END|
+CALL resignal_syntax();
+ERROR 42S02: `temptab` does not exist
+GET DIAGNOSTICS CONDITION 1 @row_num= ROW_NUMBER;
+SELECT @row_num;
+@row_num
+105
+DROP PROCEDURE resignal_syntax;
+#
+# MDEV-26842: ROW_NUMBER is not set and differs from the message upon
+# WARN_DATA_TRUNCATED produced by inplace ALTER
+#
+CREATE TABLE t1 (a VARCHAR(64)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('foo'),(null);
+ALTER TABLE t1 ADD PRIMARY KEY(a), ALGORITHM=INPLACE;
+ERROR 01000: Data truncated for column 'a' at row 2
+GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER, @m= MESSAGE_TEXT;
+SELECT @n, @m;
+@n @m
+2 Data truncated for column 'a' at row 2
+DROP TABLE t1;
+#
+# MDEV-26841: ROW_NUMBER is not set and differs from the message upon
+# ER_WRONG_VALUE_COUNT_ON_ROW for the 1st row
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1,2),(3);
+ERROR 21S01: Column count doesn't match value count at row 1
+GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER, @m= MESSAGE_TEXT;
+SELECT @n, @m;
+@n @m
+1 Column count doesn't match value count at row 1
+INSERT INTO t1(a) VALUES(1,2), (3);
+ERROR 21S01: Column count doesn't match value count at row 1
+GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER, @m= MESSAGE_TEXT;
+SELECT @n, @m;
+@n @m
+1 Column count doesn't match value count at row 1
+DROP TABLE t1;
+#
+# MDEV-26830: Wrong ROW_NUMBER in diagnostics upon INSERT IGNORE with
+# CHECK violation
+#
+CREATE TABLE t1 (a INT, CHECK(a>0));
+INSERT IGNORE INTO t1 VALUES (1),(0),(2),(0);
+Warnings:
+Warning 4025 CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
+Warning 4025 CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
+GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER;
+SELECT @n;
+@n
+2
+GET DIAGNOSTICS CONDITION 2 @n= ROW_NUMBER;
+SELECT @n;
+@n
+4
+DROP TABLE t1;
+#
+# MDEV-26844: DELETE returns ROW_NUMBER=1 for every row upon
+# ER_TRUNCATED_WRONG_VALUE
+#
+# without ORDER BY
+CREATE TABLE t (a VARCHAR(8));
+INSERT INTO t VALUES ('val1'),('val2'),('100'),('val4');
+SELECT * FROM t;
+a
+val1
+val2
+100
+val4
+DELETE FROM t WHERE a = 100;
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'val1'
+Warning 1292 Truncated incorrect DOUBLE value: 'val2'
+Warning 1292 Truncated incorrect DOUBLE value: 'val4'
+SHOW WARNINGS;
+Level Code Message
+Warning 1292 Truncated incorrect DOUBLE value: 'val1'
+Warning 1292 Truncated incorrect DOUBLE value: 'val2'
+Warning 1292 Truncated incorrect DOUBLE value: 'val4'
+GET DIAGNOSTICS CONDITION 3 @n = ROW_NUMBER;
+SELECT @n;
+@n
+4
+DROP TABLE t;
+#
+# MDEV-26695: Number of an invalid row is not calculated for table value constructor
+#
+CREATE TABLE t1 (a CHAR(1)) VALUES ('a'),('b'),('foo');
+Warnings:
+Warning 1406 Data too long for column 'a' at row 3
+GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER;
+SELECT @n;
+@n
+3
+CREATE TABLE t2 (a CHAR(1)) VALUES ('a'),('b') UNION VALUES ('foo');
+Warnings:
+Warning 1406 Data too long for column 'a' at row 3
+GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER;
+SELECT @n;
+@n
+3
+DROP TABLE t1, t2;
+# Checking that CREATE ... SELECT works
+CREATE TABLE t1 (val1 CHAR(5));
+INSERT INTO t1 VALUES ('A'),('B'),('C'),('DEF');
+CREATE TABLE t2 (val2 CHAR(1)) SELECT val1 as val2 FROM t1;
+Warnings:
+Warning 1406 Data too long for column 'val2' at row 4
+GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER;
+SELECT @n;
+@n
+4
+SELECT * FROM t2;
+val2
+A
+B
+C
+D
+DROP TABLE t1,t2;
+#
+# End of 10.7 tests
+#
diff --git a/mysql-test/main/get_diagnostics.test b/mysql-test/main/get_diagnostics.test
index 3c2b435af7f..8576d2ed8c1 100644
--- a/mysql-test/main/get_diagnostics.test
+++ b/mysql-test/main/get_diagnostics.test
@@ -1,3 +1,5 @@
+--source include/have_innodb.inc
+
SET NAMES utf8;
--echo #
@@ -860,3 +862,870 @@ CREATE TABLE t1 (a CHAR(1)) VALUES ('a'),('b'),('foo');
CREATE TABLE t2 (a char(1)) VALUES ('a'),('b') UNION VALUES ('foo');
DROP TABLE t1, t2;
+
+--echo #
+--echo # End of 10.6 tests
+--echo #
+
+--echo #
+--echo # MDEV-10075: Provide index of error causing error in array INSERT
+--echo #
+
+--echo #
+--echo # INSERT STATEMENT
+--echo #
+
+CREATE TABLE t1(id1 INT PRIMARY KEY, val1 VARCHAR(10), d1 DOUBLE);
+CREATE TABLE t2(id2 INT PRIMARY KEY, val2 VARCHAR(10), d2 DOUBLE, p2 POINT);
+
+
+--echo # Simple INSERT statement
+
+INSERT INTO t1 VALUES(1,'a',1.00101), (2,'b',1.00102), (3,'c',1.00103);
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101),(2,'b',1.00102);
+GET DIAGNOSTICS CONDITION 1 @var1= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var2= ROW_NUMBER;
+SELECT @var1, @var2;
+
+--error ER_ILLEGAL_VALUE_FOR_TYPE
+INSERT INTO t1 VALUES (5,'e',1.00105),(6,'f',1.79769313486232e+308);
+GET DIAGNOSTICS CONDITION 1 @var3= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var4= ROW_NUMBER;
+SELECT @var3, @var4;
+
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t1 VALUES (7,'g',1.00107),(8,'h',1.00108),(9,'i'),(10,'j');
+GET DIAGNOSTICS CONDITION 1 @var5= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var6= ROW_NUMBER;
+SELECT @var5, @var6;
+
+INSERT INTO t1 VALUES (8,8,8),(9,CAST(123 AS CHAR(1)),1.00109);
+GET DIAGNOSTICS CONDITION 1 @var7= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var8= ROW_NUMBER;
+SELECT @var7, @var8;
+
+INSERT INTO t1 VALUES (10,10,10),('x','foo',1.0203);
+GET DIAGNOSTICS CONDITION 1 @var9= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var10= ROW_NUMBER;
+SELECT @var9, @var10;
+
+--error ER_OPERAND_COLUMNS
+INSERT INTO t1 VALUES (11,11,11),(12,12,(13,'m',1.0113));
+GET DIAGNOSTICS CONDITION 1 @var11= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var12= ROW_NUMBER;
+SELECT @var11, @var12;
+
+delete from t1 where id1=0;
+INSERT INTO t1 VALUES (14,'n',1.0114), (15,'o',1.0115), (16/0,'p',1.0116);
+GET DIAGNOSTICS CONDITION 1 @var13= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var14= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var15= ROW_NUMBER;
+SELECT @var13, @var14, @var15;
+
+TRUNCATE TABLE t1;
+
+--echo # INSERT ... IGNORE
+
+INSERT IGNORE INTO t1 VALUES(1,'a',1.00101), (2,'b',1.00102), (3,'c',1.00103);
+INSERT IGNORE INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101),(2,'b',1.00102);
+GET DIAGNOSTICS CONDITION 1 @var16= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var17= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var18= ROW_NUMBER;
+SELECT @var16, @var17, @var18;
+
+--error ER_ILLEGAL_VALUE_FOR_TYPE
+INSERT IGNORE INTO t1 VALUES (5,'e',1.00105),(6,'f',1.79769313486232e+308);
+GET DIAGNOSTICS CONDITION 1 @var19= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var20= ROW_NUMBER;
+SELECT @var19, @var20;
+
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT IGNORE INTO t1 VALUES (7,'g',1.00107),(8,'h',1.00108),(9,'i'),(10,'j');
+GET DIAGNOSTICS CONDITION 1 @var21= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var22= ROW_NUMBER;
+SELECT @var21, @var22;
+
+INSERT IGNORE INTO t1 VALUES (8,8,8),(9,CAST(123 AS CHAR(1)),1.00109);
+GET DIAGNOSTICS CONDITION 1 @var23= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var24= ROW_NUMBER;
+SELECT @var23, @var24;
+
+INSERT IGNORE INTO t1 VALUES (10,10,10),('x','foo',1.0203);
+GET DIAGNOSTICS CONDITION 1 @var25= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var26= ROW_NUMBER;
+SELECT @var25, @var26;
+
+--error ER_OPERAND_COLUMNS
+INSERT IGNORE INTO t1 VALUES (11,11,11),(12,12,(13,'m',1.0113));
+GET DIAGNOSTICS CONDITION 1 @var27= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var28= ROW_NUMBER;
+SELECT @var27, @var28;
+
+INSERT IGNORE INTO t1 VALUES (14,'n',1.0114), (15,'o',1.0115),
+(16/0,'p',1.0116);
+GET DIAGNOSTICS CONDITION 1 @var29= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var30= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var31= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 4 @var32= ROW_NUMBER;
+SELECT @var29, @var30, @var31, @var32;
+
+TRUNCATE TABLE t1;
+
+--echo # INSERT ... SET
+
+INSERT INTO t1 SET id1=1, val1='a', d1=1.00101;
+INSERT INTO t1 SET id1=2, val1='b', d1=1.00102;
+INSERT INTO t1 SET id1=3, val1='c', d1=1.00103;
+
+--error ER_DUP_ENTRY
+INSERT INTO t1 SET id1=1, val1='a', d1=1.00101;
+GET DIAGNOSTICS CONDITION 1 @var33= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var34= ROW_NUMBER;
+SELECT @var33, @var34;
+
+--error ER_ILLEGAL_VALUE_FOR_TYPE
+INSERT INTO t1 SET id1=6, val1='f', d1=1.79769313486232e+308);
+GET DIAGNOSTICS CONDITION 1 @var35= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var36= ROW_NUMBER;
+SELECT @var35, @var36;
+
+
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO t1 SET id1=9, val1=CAST(123 AS CHAR(1)), d1=1.00109;
+GET DIAGNOSTICS CONDITION 1 @var37= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var38= ROW_NUMBER;
+SELECT @var37, @var38;
+
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 SET id1='x', val1='foo', d1=1.0203;
+GET DIAGNOSTICS CONDITION 1 @var39= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var40= ROW_NUMBER;
+SELECT @var39, @var40;
+
+--error ER_DIVISION_BY_ZERO
+INSERT INTO t1 SET id1=3/0, val1='p', d1=1.0116;
+GET DIAGNOSTICS CONDITION 1 @var41= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var42= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var43= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 4 @var44= ROW_NUMBER;
+SELECT @var41, @var42, @var43, @var44;
+
+TRUNCATE TABLE t1;
+
+--echo # INSERT ... ON DUPLICATE KEY UPDATE
+
+INSERT INTO t1 VALUES(1,'a',1.00101), (2,'b',1.00102), (3,'c',1.00103);
+
+INSERT INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101)
+ON DUPLICATE KEY UPDATE val1='a', d1=1.00101;
+GET DIAGNOSTICS CONDITION 1 @var45= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var46= ROW_NUMBER;
+SELECT @var45, @var46;
+
+--error ER_ILLEGAL_VALUE_FOR_TYPE
+INSERT INTO t1 VALUES (5,'e',1.00105),(3,'f',1.79769313486232e+308)
+ON DUPLICATE KEY UPDATE val1='c';
+GET DIAGNOSTICS CONDITION 1 @var47= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var48= ROW_NUMBER;
+SELECT @var47, @var48;
+
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t1 VALUES (5,'e',1.00105), (3,'i')
+ON DUPLICATE KEY UPDATE val1='c';
+GET DIAGNOSTICS CONDITION 1 @var49= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var50= ROW_NUMBER;
+SELECT @var49, @var50;
+
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO t1 VALUES (3, CAST(123 AS CHAR(1)), 1.00103)
+ON DUPLICATE KEY UPDATE val1='c';
+GET DIAGNOSTICS CONDITION 1 @var51= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var52= ROW_NUMBER;
+SELECT @var51, @var52;
+
+INSERT INTO t1 VALUES (10,10,10),('x','foo',1.0203)
+ON DUPLICATE KEY UPDATE val1='c';
+GET DIAGNOSTICS CONDITION 1 @var53= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var54= ROW_NUMBER;
+SELECT @var53, @var54;
+
+--error ER_OPERAND_COLUMNS
+INSERT INTO t1 VALUES (11,11,11),(12,12,(13,'m',1.0113)) ON DUPLICATE KEY UPDATE val1='c';
+GET DIAGNOSTICS CONDITION 1 @var55= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var56= ROW_NUMBER;
+SELECT @var55, @var56;
+
+INSERT INTO t1 VALUES (14,'n',1.0114), (15,'o',1.0115), (2/0,'p',1.00102)
+ON DUPLICATE KEY UPDATE val1='b';
+GET DIAGNOSTICS CONDITION 1 @var57= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var58= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var59= ROW_NUMBER;
+SELECT @var57, @var58, @var59;
+
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1,'e',1.0),(5,'e',1.0),(5,'f',1.7)
+ON DUPLICATE KEY UPDATE id1='1';
+GET DIAGNOSTICS CONDITION 1 @var60= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var61= ROW_NUMBER;
+SELECT @var60, @var61;
+
+TRUNCATE TABLE t1;
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+--echo INSERT ... SELECT
+
+CREATE TABLE t1(id1 INT PRIMARY KEY, val1 VARCHAR(10), d1 DOUBLE);
+CREATE TABLE t2(id2 INT PRIMARY KEY, val2 VARCHAR(10), d2 DOUBLE, p2 POINT);
+
+INSERT INTO t2 VALUES(1,'a',1.00101,PointFromText('POINT(20 10)')),
+ (2,'b',1.00102,PointFromText('POINT(20 10)')),
+ (3,'c',1.00103,PointFromText('POINT(20 10)'));
+INSERT INTO t1 SELECT id2, val2, d2 FROM t2;
+
+--error ER_DUP_ENTRY
+INSERT INTO t1 SELECT id2, val2, d2 FROM t2 WHERE id2=1;
+GET DIAGNOSTICS CONDITION 1 @var62= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var63= ROW_NUMBER;
+SELECT @var62, @var63;
+
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 SELECT id2, val2, p2 from t2;
+GET DIAGNOSTICS CONDITION 1 @var64= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var65= ROW_NUMBER;
+SELECT @var64, @var65;
+
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t1 SELECT id2, val2 FROM t2;
+GET DIAGNOSTICS CONDITION 1 @var66= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var67= ROW_NUMBER;
+SELECT @var66, @var67;
+
+INSERT INTO t2 VALUES(4,'a',1.00101,PointFromText('POINT(20 10)'));
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO t1 SELECT id2, CAST(123 AS CHAR(1)), d2 FROM t2 WHERE id2=4;
+GET DIAGNOSTICS CONDITION 1 @var68= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var69= ROW_NUMBER;
+SELECT @var68, @var69;
+
+--error ER_ILLEGAL_VALUE_FOR_TYPE
+INSERT INTO t1 SELECT id2, val2, 1.79769313486232e+308 FROM t2;
+GET DIAGNOSTICS CONDITION 1 @var70= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var71= ROW_NUMBER;
+SELECT @var70, @var71;
+
+
+--error ER_DIVISION_BY_ZERO
+INSERT INTO t1 SELECT id2/0, val2, d2 FROM t2;
+GET DIAGNOSTICS CONDITION 1 @var72= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var73= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var74= ROW_NUMBER;
+SELECT @var72, @var73, @var74;
+
+DROP TABLE t1,t2;
+
+--echo # Checking ROW_NUMBER in STORED PROCEDURE for INSERT
+
+CREATE TABLE t1(id1 INT PRIMARY KEY);
+
+DELIMITER |;
+
+CREATE PROCEDURE proc1 ()
+BEGIN
+
+ DECLARE var75 INT;
+ DECLARE var76 INT;
+
+ INSERT INTO t1 VALUES (1),(2);
+ INSERT IGNORE INTO t1 VALUES(2);
+
+ GET DIAGNOSTICS CONDITION 1 var75= ROW_NUMBER;
+ GET DIAGNOSTICS CONDITION 2 var76= ROW_NUMBER;
+
+ SELECT var75, var76;
+
+END;
+|
+
+DELIMITER ;|
+
+CALL proc1();
+TRUNCATE TABLE t1;
+
+--echo # Checking ROW_NUMBER in PREPARED STATEMENTS for INSERT
+
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT IGNORE INTO t1 VALUES(2),(3),(4);
+
+PREPARE stmt1 FROM "GET DIAGNOSTICS CONDITION 2 @var77= ROW_NUMBER";
+EXECUTE stmt1;
+SELECT @var77;
+
+DROP PROCEDURE proc1;
+DROP PREPARE stmt1;
+DROP TABLE t1;
+
+--echo #
+--echo # REPLACE STATEMENT
+--echo #
+
+CREATE TABLE t1(id1 INT PRIMARY KEY, val1 VARCHAR(10), d1 DOUBLE);
+CREATE TABLE t2(id2 INT PRIMARY KEY, val2 VARCHAR(10), d2 DOUBLE);
+
+
+--echo # Simple REPLACE statement
+
+REPLACE INTO t1 VALUES(1,'a',1.00101), (2,'b',1.00102), (3,'c',1.00103);
+REPLACE INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101),(2,'b',1.00102);
+GET DIAGNOSTICS CONDITION 1 @var78= ROW_NUMBER;
+SELECT @var78;
+
+--error ER_ILLEGAL_VALUE_FOR_TYPE
+REPLACE INTO t1 VALUES (5,'e',1.00105),(6,'f',1.79769313486232e+308);
+GET DIAGNOSTICS CONDITION 1 @var79= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var80= ROW_NUMBER;
+SELECT @var79, @var80;
+
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+REPLACE INTO t1 VALUES (7,'g',1.00107),(8,'h',1.00108),(9,'i'),(10,'j');
+GET DIAGNOSTICS CONDITION 1 @var81= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var82= ROW_NUMBER;
+SELECT @var81, @var82;
+
+REPLACE INTO t1 VALUES (8,8,8),(9,CAST(123 AS CHAR(1)),1.00109);
+GET DIAGNOSTICS CONDITION 1 @var83= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var84= ROW_NUMBER;
+SELECT @var83, @var84;
+
+REPLACE INTO t1 VALUES (10,10,10),('x','foo',1.0203);
+GET DIAGNOSTICS CONDITION 1 @var85= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var86= ROW_NUMBER;
+SELECT @var85, @var86;
+
+--error ER_OPERAND_COLUMNS
+REPLACE INTO t1 VALUES (11,11,11),(12,12,(13,'m',1.0113));
+GET DIAGNOSTICS CONDITION 1 @var87= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var88= ROW_NUMBER;
+SELECT @var87, @var88;
+
+REPLACE INTO t1 VALUES (14,'n',1.0114), (15,'o',1.0115), (16/0,'p',1.0116);
+GET DIAGNOSTICS CONDITION 1 @var89= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var90= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var91= ROW_NUMBER;
+SELECT @var89, @var90, @var91;
+
+TRUNCATE TABLE t1;
+
+--echo # REPLACE ... SET
+
+REPLACE INTO t1 SET id1=1, val1='a', d1=1.00101;
+REPLACE INTO t1 SET id1=2, val1='b', d1=1.00102;
+REPLACE INTO t1 SET id1=3, val1='c', d1=1.00103;
+
+REPLACE INTO t1 SET id1=1, val1='a', d1=1.00101;
+GET DIAGNOSTICS CONDITION 1 @var92= ROW_NUMBER;
+SELECT @var92;
+
+--error ER_ILLEGAL_VALUE_FOR_TYPE
+REPLACE INTO t1 SET id1=6, val1='f', d1=1.79769313486232e+308);
+GET DIAGNOSTICS CONDITION 1 @var93= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var94= ROW_NUMBER;
+SELECT @var93, @var94;
+
+
+--error ER_TRUNCATED_WRONG_VALUE
+REPLACE INTO t1 SET id1=9, val1=CAST(123 AS CHAR(1)), d1=1.00109;
+GET DIAGNOSTICS CONDITION 1 @var95= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var96= ROW_NUMBER;
+SELECT @var95, @var96;
+
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+REPLACE INTO t1 SET id1='x', val1='foo', d1=1.0203;
+GET DIAGNOSTICS CONDITION 1 @var97= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var98= ROW_NUMBER;
+SELECT @var97, @var98;
+
+--error ER_DIVISION_BY_ZERO
+REPLACE INTO t1 SET id1=3/0, val1='p', d1=1.0116;
+GET DIAGNOSTICS CONDITION 1 @var99= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var100= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var101= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 4 @var102= ROW_NUMBER;
+SELECT @var99, @var100, @var101, @var102;
+
+TRUNCATE TABLE t1;
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+--echo # REPLACE ... SELECT
+
+CREATE TABLE t1(id1 INT PRIMARY KEY, val1 VARCHAR(10), d1 DOUBLE);
+CREATE TABLE t2(id2 INT PRIMARY KEY, val2 VARCHAR(10), d2 DOUBLE, p2 POINT);
+
+
+INSERT INTO t2 VALUES(1,'a',1.00101,PointFromText('POINT(20 10)')),
+ (2,'b',1.00102,PointFromText('POINT(20 10)')),
+ (3,'c',1.00103,PointFromText('POINT(20 10)'));
+INSERT INTO t1 SELECT id2, val2, d2 FROM t2;
+
+--error ER_DUP_ENTRY
+INSERT INTO t1 SELECT id2, val2, d2 FROM t2 WHERE id2=1;
+GET DIAGNOSTICS CONDITION 1 @var103= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var104= ROW_NUMBER;
+SELECT @var103, @var104;
+
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+INSERT INTO t1 SELECT id2, val2, p2 from t2;
+GET DIAGNOSTICS CONDITION 1 @var105= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var106= ROW_NUMBER;
+SELECT @var105, @var106;
+
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t1 SELECT id2, val2 FROM t2;
+GET DIAGNOSTICS CONDITION 1 @var107= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var108= ROW_NUMBER;
+SELECT @var107, @var108;
+
+INSERT INTO t2 VALUES(4,'a',1.00101,PointFromText('POINT(20 10)'));
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO t1 SELECT id2, CAST(123 AS CHAR(1)), d2 FROM t2 WHERE id2=4;
+GET DIAGNOSTICS CONDITION 1 @var109= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var110= ROW_NUMBER;
+SELECT @var109, @var110;
+
+--error ER_ILLEGAL_VALUE_FOR_TYPE
+INSERT INTO t1 SELECT id2, val2, 1.79769313486232e+308 FROM t2;
+GET DIAGNOSTICS CONDITION 1 @var111= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var112= ROW_NUMBER;
+SELECT @var111, @var112;
+
+
+--error ER_DIVISION_BY_ZERO
+INSERT INTO t1 SELECT id2/0, val2, d2 FROM t2;
+GET DIAGNOSTICS CONDITION 1 @var113= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 2 @var114= ROW_NUMBER;
+GET DIAGNOSTICS CONDITION 3 @var115= ROW_NUMBER;
+SELECT @var113, @var114, @var115;
+
+DROP TABLE t1,t2;
+
+--echo # Checking ROW_NUMBER in STORED PROCEDURE
+
+CREATE TABLE t1(id1 INT PRIMARY KEY);
+
+DELIMITER |;
+
+CREATE PROCEDURE proc1 ()
+BEGIN
+
+ DECLARE var116 INT;
+
+ REPLACE INTO t1 VALUES (1),(2);
+
+ GET DIAGNOSTICS CONDITION 1 var116= ROW_NUMBER;
+
+ SELECT var116;
+
+END;
+|
+
+DELIMITER ;|
+
+CALL proc1();
+TRUNCATE TABLE t1;
+
+--echo # Checking ROW_NUMBER in PREPARED STATEMENTS
+
+REPLACE INTO t1 VALUES (1), (2), (3);
+
+PREPARE stmt1 FROM "GET DIAGNOSTICS CONDITION 2 @var117= ROW_NUMBER";
+EXECUTE stmt1;
+SELECT @var117;
+
+DROP PROCEDURE proc1;
+DROP PREPARE stmt1;
+DROP TABLE t1;
+
+--echo #
+--echo # Checking that ROW_NUMBER is only for errors with rows/values
+--echo #
+
+--echo # INSERT STATEMENT
+
+CREATE TABLE t1(id1 INT);
+CREATE TABLE t2(id2 INT);
+CREATE VIEW v AS SELECT t1.id1 AS A, t2.id2 AS b FROM t1,t2;
+
+--error ER_FIELD_SPECIFIED_TWICE
+INSERT INTO t1(id1, id1) VALUES (1,1);
+GET DIAGNOSTICS CONDITION 1 @var118= ROW_NUMBER;
+SELECT @var118;
+
+delimiter |;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ INSERT INTO t1 VALUES (1);
+ RETURN 1;
+END |
+delimiter ;|
+
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+INSERT INTO t1 VALUES (1), (f1());
+GET DIAGNOSTICS CONDITION 1 @var119= ROW_NUMBER;
+SELECT @var119;
+
+--error ER_BAD_FIELD_ERROR
+INSERT INTO t1 VALUES (1) RETURNING id2;
+GET DIAGNOSTICS CONDITION 1 @var120= ROW_NUMBER;
+SELECT @var120;
+
+--error ER_BAD_FIELD_ERROR
+INSERT INTO t1(id2) VALUES(1);
+GET DIAGNOSTICS CONDITION 1 @var121= ROW_NUMBER;
+SELECT @var121;
+
+--error ER_VIEW_NO_INSERT_FIELD_LIST
+INSERT INTO v VALUES(1,2);
+GET DIAGNOSTICS CONDITION 1 @var122= ROW_NUMBER;
+SELECT @var122;
+
+--error ER_VIEW_MULTIUPDATE
+INSERT INTO v(a,b) VALUES (1,2);
+GET DIAGNOSTICS CONDITION 1 @var123= ROW_NUMBER;
+SELECT @var123;
+
+--echo # REPLACE STATEMENT
+
+--error ER_FIELD_SPECIFIED_TWICE
+REPLACE INTO t1(id1, id1) VALUES (1,1);
+GET DIAGNOSTICS CONDITION 1 @var124= ROW_NUMBER;
+SELECT @var124;
+
+delimiter |;
+CREATE FUNCTION f2() RETURNS INT
+BEGIN
+ REPLACE INTO t1 VALUES (1);
+ RETURN 1;
+END |
+delimiter ;|
+
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+REPLACE INTO t1 VALUES (1), (f2());
+GET DIAGNOSTICS CONDITION 1 @var125= ROW_NUMBER;
+SELECT @var125;
+
+--error ER_BAD_FIELD_ERROR
+REPLACE INTO t1 VALUES (1) RETURNING id2;
+GET DIAGNOSTICS CONDITION 1 @var126= ROW_NUMBER;
+SELECT @var126;
+
+--error ER_BAD_FIELD_ERROR
+REPLACE INTO t1(id2) VALUES(1);
+GET DIAGNOSTICS CONDITION 1 @var127= ROW_NUMBER;
+SELECT @var127;
+
+--error ER_VIEW_NO_INSERT_FIELD_LIST
+REPLACE INTO v VALUES(1,2);
+GET DIAGNOSTICS CONDITION 1 @var128= ROW_NUMBER;
+SELECT @var128;
+
+--error ER_VIEW_MULTIUPDATE
+REPLACE INTO v(a,b) VALUES (1,2);
+GET DIAGNOSTICS CONDITION 1 @var129= ROW_NUMBER;
+SELECT @var129;
+
+DROP TABLE t1,t2;
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP VIEW v;
+
+--echo #
+--echo # MDEV-26606: ROW_NUMBER property value isn't passed from inside a
+--echo # stored procedure
+--echo #
+
+--echo # Test 1: Without RESIGNAL
+
+CREATE OR REPLACE TABLE t1 (pk INT PRIMARY KEY);
+CREATE OR REPLACE PROCEDURE sp(a INT) INSERT INTO t1 VALUES (2),(a);
+SET @num=null, @msg=null;
+
+INSERT INTO t1 VALUES(1);
+
+--error ER_DUP_ENTRY
+CALL sp(1);
+GET DIAGNOSTICS CONDITION 1 @num = ROW_NUMBER, @msg = MESSAGE_TEXT;
+SELECT @num, @msg;
+
+DROP PROCEDURE sp;
+DROP TABLE t1;
+
+--echo # Test 2: With RESIGNAL
+
+CREATE OR REPLACE TABLE t1 (pk INT PRIMARY KEY);
+
+DELIMITER |;
+CREATE OR REPLACE PROCEDURE sp(a INT)
+BEGIN
+ DECLARE n INT;
+ DECLARE m VARCHAR(255);
+ DECLARE EXIT HANDLER FOR 1062
+ BEGIN
+ GET DIAGNOSTICS CONDITION 1 n = ROW_NUMBER, m = MESSAGE_TEXT;
+ SELECT n, m;
+ RESIGNAL;
+ END;
+ INSERT INTO t1 VALUES (2), (a);
+END |
+DELIMITER ;|
+
+SET @num=null, @msg=null;
+INSERT INTO t1 VALUES (1);
+
+--error ER_DUP_ENTRY
+CALL sp(1);
+GET DIAGNOSTICS CONDITION 1 @num = ROW_NUMBER, @msg = MESSAGE_TEXT;
+SELECT @num, @msg;
+
+DROP PROCEDURE sp;
+DROP TABLE t1;
+
+--echo # Checking more errors
+
+CREATE TABLE t1 (val1 TINYINT);
+
+CREATE PROCEDURE sp(a INT) INSERT INTO t1 VALUES (2),(a);
+
+INSERT INTO t1 VALUES(1);
+
+CALL sp(100000);
+GET DIAGNOSTICS CONDITION 1 @var1= ROW_NUMBER;
+SELECT @var1;
+
+DROP TABLE t1;
+DROP PROCEDURE sp;
+
+--echo #
+--echo # MDEV-26684: Unexpected ROW_NUMBER in a condition raised by a diagnostics statement
+--echo #
+
+CREATE TABLE t1 (a INT);
+
+INSERT INTO t1 VALUES (1),(2);
+
+GET DIAGNOSTICS CONDITION 5 @msg = MESSAGE_TEXT;
+SHOW WARNINGS;
+
+GET DIAGNOSTICS CONDITION 1 @ind = ROW_NUMBER, @msg = MESSAGE_TEXT;
+SELECT @ind, @msg;
+
+INSERT INTO t1 VALUES (3),(4);
+
+GET DIAGNOSTICS CONDITION 1 @ind = ROW_NUMBER, @msg = MESSAGE_TEXT;
+SELECT @ind, @msg;
+
+GET DIAGNOSTICS CONDITION 5 @ind = ROW_NUMBER, @msg = MESSAGE_TEXT;
+SELECT @ind, @msg;
+
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-26681: ROW_NUMBER is not available within compound statement blocks
+--echo #
+
+CREATE OR REPLACE TABLE t1 (pk INT PRIMARY KEY, a CHAR(3));
+INSERT IGNORE INTO t1 VALUES (1,'foo'),(1,'bar'),(2,'foobar');
+
+DELIMITER |;
+
+BEGIN NOT ATOMIC
+ DECLARE i INT DEFAULT 0;
+ DECLARE rnum INT DEFAULT -1;
+ DECLARE msg VARCHAR(1024) DEFAULT '';
+ DECLARE err INT DEFAULT -1;
+ WHILE i < @@warning_count
+ DO
+ SET i = i + 1;
+ GET DIAGNOSTICS CONDITION i rnum = ROW_NUMBER, msg = MESSAGE_TEXT, err = MYSQL_ERRNO;
+ SELECT i, rnum, msg, err;
+ END WHILE;
+END |
+
+DELIMITER ;|
+
+GET DIAGNOSTICS CONDITION 1 @rnum = ROW_NUMBER, @msg = MESSAGE_TEXT, @err = MYSQL_ERRNO;
+select @rnum, @msg, @err;
+
+GET DIAGNOSTICS CONDITION 2 @rnum = ROW_NUMBER, @msg = MESSAGE_TEXT, @err = MYSQL_ERRNO;
+SELECT @rnum, @msg, @err;
+
+DROP TABLE t1;
+
+--echo #
+--echo # ROW_NUMBER differs from the number in the error message upon
+--echo # ER_WARN_DATA_OUT_OF_RANGE
+--echo #
+CREATE TABLE t (a INT);
+INSERT INTO t VALUES (1),(2);
+SELECT CAST(a AS DECIMAL(2,2)) AS f FROM t;
+
+GET DIAGNOSTICS CONDITION 2 @n= ROW_NUMBER, @m = MESSAGE_TEXT;
+SELECT @n, @m;
+
+DROP TABLE t;
+
+--echo #
+--echo # MDEV-26832: ROW_NUMBER in SIGNAL/RESIGNAL causes a syntax error
+--echo #
+
+--echo # using signal
+
+DELIMITER |;
+CREATE PROCEDURE signal_syntax()
+BEGIN
+ DECLARE errno INT DEFAULT 0;
+ DECLARE msg TEXT DEFAULT "foo";
+ DECLARE row_num INT DEFAULT 0;
+ DECLARE cond CONDITION FOR SQLSTATE "01234";
+ DECLARE CONTINUE HANDLER for 1012
+ BEGIN
+ GET DIAGNOSTICS CONDITION 1 errno = MYSQL_ERRNO, msg = MESSAGE_TEXT, row_num= ROW_NUMBER;
+ END;
+
+ SIGNAL cond SET MESSAGE_TEXT = "Signal message", MYSQL_ERRNO = 1012, ROW_NUMBER= 5;
+
+ SELECT errno, msg, row_num;
+END|
+DELIMITER ;|
+
+CALL signal_syntax();
+
+DROP PROCEDURE signal_syntax;
+
+--echo # using resignal
+
+DELIMITER |;
+
+CREATE PROCEDURE resignal_syntax()
+BEGIN
+ DECLARE CONTINUE HANDLER
+ FOR 1146
+ BEGIN
+ RESIGNAL SET
+ MESSAGE_TEXT = '`temptab` does not exist', ROW_NUMBER= 105;
+ END;
+ SELECT `c` FROM `temptab`;
+END|
+
+DELIMITER ;|
+
+--error ER_NO_SUCH_TABLE
+CALL resignal_syntax();
+
+GET DIAGNOSTICS CONDITION 1 @row_num= ROW_NUMBER;
+SELECT @row_num;
+
+DROP PROCEDURE resignal_syntax;
+
+--echo #
+--echo # MDEV-26842: ROW_NUMBER is not set and differs from the message upon
+--echo # WARN_DATA_TRUNCATED produced by inplace ALTER
+--echo #
+
+CREATE TABLE t1 (a VARCHAR(64)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('foo'),(null);
+
+--error WARN_DATA_TRUNCATED
+ALTER TABLE t1 ADD PRIMARY KEY(a), ALGORITHM=INPLACE;
+
+GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER, @m= MESSAGE_TEXT;
+SELECT @n, @m;
+
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-26841: ROW_NUMBER is not set and differs from the message upon
+--echo # ER_WRONG_VALUE_COUNT_ON_ROW for the 1st row
+--echo #
+
+CREATE TABLE t1 (a INT);
+
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t1 VALUES (1,2),(3);
+
+GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER, @m= MESSAGE_TEXT;
+SELECT @n, @m;
+
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t1(a) VALUES(1,2), (3);
+
+GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER, @m= MESSAGE_TEXT;
+SELECT @n, @m;
+
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-26830: Wrong ROW_NUMBER in diagnostics upon INSERT IGNORE with
+--echo # CHECK violation
+--echo #
+
+CREATE TABLE t1 (a INT, CHECK(a>0));
+INSERT IGNORE INTO t1 VALUES (1),(0),(2),(0);
+GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER;
+SELECT @n;
+GET DIAGNOSTICS CONDITION 2 @n= ROW_NUMBER;
+SELECT @n;
+
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-26844: DELETE returns ROW_NUMBER=1 for every row upon
+--echo # ER_TRUNCATED_WRONG_VALUE
+--echo #
+
+--echo # without ORDER BY
+
+CREATE TABLE t (a VARCHAR(8));
+
+INSERT INTO t VALUES ('val1'),('val2'),('100'),('val4');
+SELECT * FROM t;
+
+DELETE FROM t WHERE a = 100;
+SHOW WARNINGS;
+
+GET DIAGNOSTICS CONDITION 3 @n = ROW_NUMBER;
+SELECT @n;
+
+DROP TABLE t;
+
+--echo #
+--echo # MDEV-26695: Number of an invalid row is not calculated for table value constructor
+--echo #
+
+CREATE TABLE t1 (a CHAR(1)) VALUES ('a'),('b'),('foo');
+GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER;
+SELECT @n;
+CREATE TABLE t2 (a CHAR(1)) VALUES ('a'),('b') UNION VALUES ('foo');
+GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER;
+SELECT @n;
+
+DROP TABLE t1, t2;
+
+--echo # Checking that CREATE ... SELECT works
+
+CREATE TABLE t1 (val1 CHAR(5));
+INSERT INTO t1 VALUES ('A'),('B'),('C'),('DEF');
+CREATE TABLE t2 (val2 CHAR(1)) SELECT val1 as val2 FROM t1;
+GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER;
+SELECT @n;
+SELECT * FROM t2;
+
+DROP TABLE t1,t2;
+
+--echo #
+--echo # End of 10.7 tests
+--echo #
+
diff --git a/mysql-test/main/handlersocket.result b/mysql-test/main/handlersocket.result
index 8ef9b289cd0..38027afc414 100644
--- a/mysql-test/main/handlersocket.result
+++ b/mysql-test/main/handlersocket.result
@@ -5,7 +5,7 @@ plugin_version 1.0
plugin_status ACTIVE
plugin_type DAEMON
plugin_library handlersocket.so
-plugin_library_version 1.14
+plugin_library_version 1.15
plugin_author higuchi dot akira at dena dot jp
plugin_description Direct access into InnoDB
plugin_license BSD
diff --git a/mysql-test/main/information_schema_part.result b/mysql-test/main/information_schema_part.result
index 4c0bb8908da..374c679789e 100644
--- a/mysql-test/main/information_schema_part.result
+++ b/mysql-test/main/information_schema_part.result
@@ -7,9 +7,9 @@ partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
select * from information_schema.partitions where table_schema="test"
and table_name="t1";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-def test t1 x1 NULL 1 NULL LIST NULL `b` * `a` NULL 1 0 0 0 # 1024 0 # # NULL NULL default ts1
-def test t1 x2 NULL 2 NULL LIST NULL `b` * `a` NULL 3,11,5,7 0 0 0 # 1024 0 # # NULL NULL default ts2
-def test t1 x3 NULL 3 NULL LIST NULL `b` * `a` NULL 16,8,24,27 0 0 0 # 1024 0 # # NULL NULL default ts3
+def test t1 x1 NULL 1 NULL LIST NULL `b` * `a` NULL 1 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t1 x2 NULL 2 NULL LIST NULL `b` * `a` NULL 3,11,5,7 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t1 x3 NULL 3 NULL LIST NULL `b` * `a` NULL 16,8,24,27 0 0 0 # 1024 0 # # NULL NULL default NULL
create table t2 (a int not null,b int not null,c int not null, primary key(a,b))
partition by range (a)
partitions 3
@@ -19,9 +19,9 @@ partition x3 values less than maxvalue tablespace ts3);
select * from information_schema.partitions where table_schema="test"
and table_name="t2";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-def test t2 x1 NULL 1 NULL RANGE NULL `a` NULL 5 0 0 0 # 1024 0 # # NULL NULL default ts1
-def test t2 x2 NULL 2 NULL RANGE NULL `a` NULL 10 0 0 0 # 1024 0 # # NULL NULL default ts2
-def test t2 x3 NULL 3 NULL RANGE NULL `a` NULL MAXVALUE 0 0 0 # 1024 0 # # NULL NULL default ts3
+def test t2 x1 NULL 1 NULL RANGE NULL `a` NULL 5 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t2 x2 NULL 2 NULL RANGE NULL `a` NULL 10 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t2 x3 NULL 3 NULL RANGE NULL `a` NULL MAXVALUE 0 0 0 # 1024 0 # # NULL NULL default NULL
create table t3 (f1 date)
partition by hash(month(f1))
partitions 3;
@@ -63,14 +63,14 @@ subpartition x22 tablespace t2)
);
select * from information_schema.partitions where table_schema="test" order by table_name, partition_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-def test t1 x1 x11 1 1 RANGE HASH `a` `a` + `b` 1 0 0 0 # 1024 0 # # NULL NULL default t1
-def test t1 x1 x12 1 2 RANGE HASH `a` `a` + `b` 1 0 0 0 # 1024 0 # # NULL NULL default t2
-def test t1 x2 x21 2 1 RANGE HASH `a` `a` + `b` 5 0 0 0 # 1024 0 # # NULL NULL default t1
-def test t1 x2 x22 2 2 RANGE HASH `a` `a` + `b` 5 0 0 0 # 1024 0 # # NULL NULL default t2
-def test t2 x1 x11 1 1 RANGE KEY `a` `a` 1 0 0 0 # 1024 0 # # NULL NULL default t1
-def test t2 x1 x12 1 2 RANGE KEY `a` `a` 1 0 0 0 # 1024 0 # # NULL NULL default t2
-def test t2 x2 x21 2 1 RANGE KEY `a` `a` 5 0 0 0 # 1024 0 # # NULL NULL default t1
-def test t2 x2 x22 2 2 RANGE KEY `a` `a` 5 0 0 0 # 1024 0 # # NULL NULL default t2
+def test t1 x1 x11 1 1 RANGE HASH `a` `a` + `b` 1 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t1 x1 x12 1 2 RANGE HASH `a` `a` + `b` 1 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t1 x2 x21 2 1 RANGE HASH `a` `a` + `b` 5 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t1 x2 x22 2 2 RANGE HASH `a` `a` + `b` 5 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t2 x1 x11 1 1 RANGE KEY `a` `a` 1 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t2 x1 x12 1 2 RANGE KEY `a` `a` 1 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t2 x2 x21 2 1 RANGE KEY `a` `a` 5 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t2 x2 x22 2 2 RANGE KEY `a` `a` 5 0 0 0 # 1024 0 # # NULL NULL default NULL
drop table t1,t2;
create table t1 (
a int not null,
@@ -88,10 +88,10 @@ subpartition x22 tablespace t2 nodegroup 1)
);
select * from information_schema.partitions where table_schema="test";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-def test t1 x1 x11 1 1 RANGE HASH `a` `a` + `b` 1 0 0 0 # 1024 0 # # NULL NULL 0 t1
-def test t1 x1 x12 1 2 RANGE HASH `a` `a` + `b` 1 0 0 0 # 1024 0 # # NULL NULL 1 t2
-def test t1 x2 x21 2 1 RANGE HASH `a` `a` + `b` 5 0 0 0 # 1024 0 # # NULL NULL 0 t1
-def test t1 x2 x22 2 2 RANGE HASH `a` `a` + `b` 5 0 0 0 # 1024 0 # # NULL NULL 1 t2
+def test t1 x1 x11 1 1 RANGE HASH `a` `a` + `b` 1 0 0 0 # 1024 0 # # NULL NULL 0 NULL
+def test t1 x1 x12 1 2 RANGE HASH `a` `a` + `b` 1 0 0 0 # 1024 0 # # NULL NULL 1 NULL
+def test t1 x2 x21 2 1 RANGE HASH `a` `a` + `b` 5 0 0 0 # 1024 0 # # NULL NULL 0 NULL
+def test t1 x2 x22 2 2 RANGE HASH `a` `a` + `b` 5 0 0 0 # 1024 0 # # NULL NULL 1 NULL
show tables;
Tables_in_test
t1
diff --git a/mysql-test/main/invisible_field_debug.test b/mysql-test/main/invisible_field_debug.test
index 3e844fc4521..b813481110f 100644
--- a/mysql-test/main/invisible_field_debug.test
+++ b/mysql-test/main/invisible_field_debug.test
@@ -201,7 +201,7 @@ drop table t1;
set debug_dbug= "+d,test_pseudo_invisible";
Create table t1( a int default(99) invisible, b int);
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
Create table t2( a int default(99) invisible, b int, unique(invisible));
set debug_dbug=@old_debug;
@@ -211,9 +211,9 @@ insert into t1 values(3);
insert into t1 values(4);
select * from t1 order by b;
select invisible, a, b from t1 order by b;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 add index(invisible);
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 add index(b,invisible);
show index from t1;
drop table t1;
@@ -223,7 +223,7 @@ drop table t1;
set debug_dbug= "+d,test_completely_invisible";
Create table t1( a int default(99) invisible, b int);
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
Create table t2( a int default(99) invisible, b int, unique(invisible));
insert into t1 values(1);
insert into t1 values(2);
@@ -233,9 +233,9 @@ select * from t1 order by b;
select invisible, a, b from t1 order by b;
set debug_dbug=@old_debug;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 add index(invisible);
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 add index(b,invisible);
show index from t1;
drop table t1;
@@ -262,7 +262,7 @@ select invisible, a ,b from t1;
set debug_dbug=@old_debug;
Show index from t1;
## Sytem Generated Index modification
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
create index a1 on t1(invisible);
set debug_dbug= "+d,test_completely_invisible,test_invisible_index";
## index does not exist for user
diff --git a/mysql-test/main/json_equals.result b/mysql-test/main/json_equals.result
new file mode 100644
index 00000000000..1fa13ec2cf8
--- /dev/null
+++ b/mysql-test/main/json_equals.result
@@ -0,0 +1,98 @@
+select json_equals("{}", "{}");
+json_equals("{}", "{}")
+1
+select json_equals("{}", "[]");
+json_equals("{}", "[]")
+0
+select json_equals("{}", NULL);
+json_equals("{}", NULL)
+NULL
+select json_equals("", "");
+json_equals("", "")
+NULL
+select json_equals("", 1);
+json_equals("", 1)
+NULL
+select json_equals(now(), now());
+json_equals(now(), now())
+NULL
+select json_equals('{"a":[1, 2, 3]}', '{"a":[1, 2, 3, 4]}');
+json_equals('{"a":[1, 2, 3]}', '{"a":[1, 2, 3, 4]}')
+0
+select json_equals('{"a":[1, 2, 3]}', '{"a":[1, 2, 3]}');
+json_equals('{"a":[1, 2, 3]}', '{"a":[1, 2, 3]}')
+1
+select json_equals('{"țanțoș":[1, 2, "ț", {"some uâ߀":"uâßr"}]}',
+'{"țanțoș":[1, 2, "ț", {"some uâ߀":"uâßr"}]}');
+json_equals('{"țanțoș":[1, 2, "ț", {"some uâ߀":"uâßr"}]}',
+'{"țanțoș":[1, 2, "ț", {"some uâ߀":"uâßr"}]}')
+1
+select json_equals('{"a" : [0.123456789123456789], "b" : [1, 2, 3]}',
+'{"b" : [1, 2, 3], "a" : [0.123456789123456789]}');
+json_equals('{"a" : [0.123456789123456789], "b" : [1, 2, 3]}',
+'{"b" : [1, 2, 3], "a" : [0.123456789123456789]}')
+1
+#
+# Test max json depth for json_equals.
+#
+with recursive rec_json (step, obj) as (
+select 1, cast('{"key":"value"}' as varchar(1000))
+union
+select r.step + 1, JSON_INSERT('{}', '$.obj', JSON_QUERY(r.obj, '$'))
+from rec_json r
+where r.step < 10
+)
+select step, obj, json_equals(obj, obj) from rec_json;
+step obj json_equals(obj, obj)
+1 {"key":"value"} 1
+2 {"obj": {"key": "value"}} 1
+3 {"obj": {"obj": {"key": "value"}}} 1
+4 {"obj": {"obj": {"obj": {"key": "value"}}}} 1
+5 {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}} 1
+6 {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}} 1
+7 {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}} 1
+8 {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}} 1
+9 {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}} 1
+10 {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}} 1
+#
+# 31 levels of nesting.
+#
+select json_equals('{"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}',
+'{"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}') as 31_levels;
+31_levels
+1
+#
+# 32 Levels of nesting. This should hit max json depth.
+#
+select json_equals('{"obj":{"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}',
+'{"obj":{"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}') as 32_levels;
+32_levels
+NULL
+#
+# test values from different charset
+# (UTF-8 two-bytes vs. latin1 single high-byte)
+#
+create table t1 (a varchar(200) character set latin1);
+create table t2 (a varchar(200) character set utf8);
+insert into t1 values (UNHEX('22CA22'));
+set names utf8;
+insert into t2 values (UNHEX('22C38A22'));
+select a from t1;
+a
+"Ê"
+select hex(a) from t1;
+hex(a)
+22CA22
+select a from t2;
+a
+"Ê"
+select hex(a) from t2;
+hex(a)
+22C38A22
+select t1.a, t2.a, t1.a = t2.a,
+json_valid(t1.a), json_valid(t2.a), json_equals(t1.a, t2.a)
+from t1, t2;
+a a t1.a = t2.a json_valid(t1.a) json_valid(t2.a) json_equals(t1.a, t2.a)
+"Ê" "Ê" 1 1 1 1
+drop table t1;
+drop table t2;
diff --git a/mysql-test/main/json_equals.test b/mysql-test/main/json_equals.test
new file mode 100644
index 00000000000..904d8a3f67d
--- /dev/null
+++ b/mysql-test/main/json_equals.test
@@ -0,0 +1,69 @@
+
+select json_equals("{}", "{}");
+
+select json_equals("{}", "[]");
+
+select json_equals("{}", NULL);
+
+select json_equals("", "");
+
+select json_equals("", 1);
+
+select json_equals(now(), now());
+
+select json_equals('{"a":[1, 2, 3]}', '{"a":[1, 2, 3, 4]}');
+
+select json_equals('{"a":[1, 2, 3]}', '{"a":[1, 2, 3]}');
+
+select json_equals('{"țanțoș":[1, 2, "ț", {"some uâ߀":"uâßr"}]}',
+ '{"țanțoș":[1, 2, "ț", {"some uâ߀":"uâßr"}]}');
+
+select json_equals('{"a" : [0.123456789123456789], "b" : [1, 2, 3]}',
+ '{"b" : [1, 2, 3], "a" : [0.123456789123456789]}');
+
+--echo #
+--echo # Test max json depth for json_equals.
+--echo #
+with recursive rec_json (step, obj) as (
+ select 1, cast('{"key":"value"}' as varchar(1000))
+ union
+ select r.step + 1, JSON_INSERT('{}', '$.obj', JSON_QUERY(r.obj, '$'))
+ from rec_json r
+ where r.step < 10
+)
+select step, obj, json_equals(obj, obj) from rec_json;
+
+--echo #
+--echo # 31 levels of nesting.
+--echo #
+select json_equals('{"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}',
+'{"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}') as 31_levels;
+
+--echo #
+--echo # 32 Levels of nesting. This should hit max json depth.
+--echo #
+select json_equals('{"obj":{"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}',
+'{"obj":{"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"obj": {"key": "value"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}') as 32_levels;
+
+
+--echo #
+--echo # test values from different charset
+--echo # (UTF-8 two-bytes vs. latin1 single high-byte)
+--echo #
+create table t1 (a varchar(200) character set latin1);
+create table t2 (a varchar(200) character set utf8);
+insert into t1 values (UNHEX('22CA22'));
+set names utf8;
+insert into t2 values (UNHEX('22C38A22'));
+
+select a from t1;
+select hex(a) from t1;
+select a from t2;
+select hex(a) from t2;
+
+select t1.a, t2.a, t1.a = t2.a,
+ json_valid(t1.a), json_valid(t2.a), json_equals(t1.a, t2.a)
+from t1, t2;
+
+drop table t1;
+drop table t2;
diff --git a/mysql-test/main/json_normalize.result b/mysql-test/main/json_normalize.result
new file mode 100644
index 00000000000..f88cadad189
--- /dev/null
+++ b/mysql-test/main/json_normalize.result
@@ -0,0 +1,77 @@
+set names utf8;
+create table t1 (json json);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`json`))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values
+('{ }'),
+('[ ]'),
+('{ "foo" : "bar" }'),
+('{ "foo" : "bar", "baz" : "whatever" }'),
+('[ 1.2, 0.0, "text", 0, null, true, false ]'),
+('[ "string", { "key" : "val", "a" : "b", "c" : [ 10, 9, 8, "seven", 11 ] }]'),
+('{ "ăț€": "val1", "âț€":"val2" }');
+select json, json_normalize(json) from t1
+order by json;
+json json_normalize(json)
+[ ] []
+[ "string", { "key" : "val", "a" : "b", "c" : [ 10, 9, 8, "seven", 11 ] }] ["string",{"a":"b","c":[1.0E1,9.0E0,8.0E0,"seven",1.1E1],"key":"val"}]
+[ 1.2, 0.0, "text", 0, null, true, false ] [1.2E0,0.0E0,"text",0.0E0,null,true,false]
+{ } {}
+{ "foo" : "bar" } {"foo":"bar"}
+{ "foo" : "bar", "baz" : "whatever" } {"baz":"whatever","foo":"bar"}
+{ "ăț€": "val1", "âț€":"val2" } {"âț€":"val2","ăț€":"val1"}
+create view v1 as (select json, json_normalize(json) norm_json from t1);
+show create view v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`json` AS `json`,json_normalize(`t1`.`json`) AS `norm_json` from `t1`) utf8mb3 utf8mb3_general_ci
+select * from v1
+order by json;
+json norm_json
+[ ] []
+[ "string", { "key" : "val", "a" : "b", "c" : [ 10, 9, 8, "seven", 11 ] }] ["string",{"a":"b","c":[1.0E1,9.0E0,8.0E0,"seven",1.1E1],"key":"val"}]
+[ 1.2, 0.0, "text", 0, null, true, false ] [1.2E0,0.0E0,"text",0.0E0,null,true,false]
+{ } {}
+{ "foo" : "bar" } {"foo":"bar"}
+{ "foo" : "bar", "baz" : "whatever" } {"baz":"whatever","foo":"bar"}
+{ "ăț€": "val1", "âț€":"val2" } {"âț€":"val2","ăț€":"val1"}
+select json_normalize(NULL);
+json_normalize(NULL)
+NULL
+select json_normalize('{ "invalid": "no_close"');
+json_normalize('{ "invalid": "no_close"')
+NULL
+drop table t1;
+drop view v1;
+create table t1 (text varchar(200) character set 'latin1');
+insert into t1 values (unhex('22E522'));
+create table t2 (text varchar(200) character set 'utf8mb4');
+insert into t2 SELECT * FROM t1;
+select t1.text, hex(t1.text) from t1;
+text hex(t1.text)
+"Ã¥" 22E522
+select t2.text, hex(t2.text) from t2;
+text hex(t2.text)
+"Ã¥" 22C3A522
+select t1.text
+, t2.text
+, replace(json_normalize(t1.text), unhex('C3A5'), unhex('C385'))
+, replace(json_normalize(t2.text), unhex('C3A5'), unhex('C385'))
+, hex(replace(json_normalize(t1.text), unhex('C3A5'), unhex('C385')))
+, hex(replace(json_normalize(t2.text), unhex('C3A5'), unhex('C385')))
+from t1, t2;
+text text replace(json_normalize(t1.text), unhex('C3A5'), unhex('C385')) replace(json_normalize(t2.text), unhex('C3A5'), unhex('C385')) hex(replace(json_normalize(t1.text), unhex('C3A5'), unhex('C385'))) hex(replace(json_normalize(t2.text), unhex('C3A5'), unhex('C385')))
+"Ã¥" "Ã¥" "Ã…" "Ã…" 22C38522 22C38522
+drop table t1;
+drop table t2;
+create table t1 (text varchar(1));
+insert into t1 values ('0');
+select concat_ws(' ', t1.text, t1.text) from t1;
+concat_ws(' ', t1.text, t1.text)
+0 0
+select concat_ws(' ', json_normalize(t1.text), json_normalize(t1.text)) from t1;
+concat_ws(' ', json_normalize(t1.text), json_normalize(t1.text))
+0.0E0 0.0E0
+drop table t1;
diff --git a/mysql-test/main/json_normalize.test b/mysql-test/main/json_normalize.test
new file mode 100644
index 00000000000..29faa514cca
--- /dev/null
+++ b/mysql-test/main/json_normalize.test
@@ -0,0 +1,58 @@
+set names utf8;
+
+create table t1 (json json);
+show create table t1;
+
+
+insert into t1 values
+('{ }'),
+('[ ]'),
+('{ "foo" : "bar" }'),
+('{ "foo" : "bar", "baz" : "whatever" }'),
+('[ 1.2, 0.0, "text", 0, null, true, false ]'),
+('[ "string", { "key" : "val", "a" : "b", "c" : [ 10, 9, 8, "seven", 11 ] }]'),
+('{ "ăț€": "val1", "âț€":"val2" }');
+
+select json, json_normalize(json) from t1
+order by json;
+
+
+create view v1 as (select json, json_normalize(json) norm_json from t1);
+show create view v1;
+
+select * from v1
+order by json;
+
+select json_normalize(NULL);
+select json_normalize('{ "invalid": "no_close"');
+
+drop table t1;
+drop view v1;
+
+create table t1 (text varchar(200) character set 'latin1');
+insert into t1 values (unhex('22E522'));
+
+create table t2 (text varchar(200) character set 'utf8mb4');
+insert into t2 SELECT * FROM t1;
+
+select t1.text, hex(t1.text) from t1;
+select t2.text, hex(t2.text) from t2;
+
+select t1.text
+ , t2.text
+ , replace(json_normalize(t1.text), unhex('C3A5'), unhex('C385'))
+ , replace(json_normalize(t2.text), unhex('C3A5'), unhex('C385'))
+ , hex(replace(json_normalize(t1.text), unhex('C3A5'), unhex('C385')))
+ , hex(replace(json_normalize(t2.text), unhex('C3A5'), unhex('C385')))
+from t1, t2;
+
+drop table t1;
+drop table t2;
+
+create table t1 (text varchar(1));
+insert into t1 values ('0');
+
+select concat_ws(' ', t1.text, t1.text) from t1;
+select concat_ws(' ', json_normalize(t1.text), json_normalize(t1.text)) from t1;
+
+drop table t1;
diff --git a/mysql-test/main/long_unique_bugs.test b/mysql-test/main/long_unique_bugs.test
index c5eb208d810..8e54782db30 100644
--- a/mysql-test/main/long_unique_bugs.test
+++ b/mysql-test/main/long_unique_bugs.test
@@ -173,7 +173,7 @@ ALTER TABLE t1 DROP KEY f, ADD INDEX idx1(f), ALGORITHM=INSTANT;
ALTER TABLE t1 ADD KEY idx2(f);
DROP TABLE t1;
CREATE TABLE t1(a blob , b blob , unique(a,b));
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop column b;
insert into t1 values(1,1);
--error ER_DUP_ENTRY
diff --git a/mysql-test/main/mdl_sync.test b/mysql-test/main/mdl_sync.test
index 557fbe261a2..3df19aca806 100644
--- a/mysql-test/main/mdl_sync.test
+++ b/mysql-test/main/mdl_sync.test
@@ -113,7 +113,7 @@ insert into t1 values (1), (1);
--echo # Check that SU lock is compatible with it. To do this use ALTER TABLE
--echo # which will fail when constructing .frm and thus obtaining SU metadata
--echo # lock.
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 add index (not_exist);
--echo # Check that SNW lock is compatible with it. To do this use ALTER TABLE
--echo # which will fail during copying the table and thus obtaining SNW metadata
@@ -190,7 +190,7 @@ insert into t1 values (1);
--echo # Check that SU lock is compatible with it. To do this use ALTER TABLE
--echo # which will fail when constructing .frm and thus obtaining SU metadata
--echo # lock.
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 add index (not_exist);
--echo # Check that SNW lock is compatible with it. To do this use ALTER TABLE
--echo # which will fail during copying the table and thus obtaining SNW metadata
@@ -309,7 +309,7 @@ insert into t1 values (1);
--echo # Check that SU lock is compatible with it. To do this use ALTER TABLE
--echo # which will fail when constructing .frm and thus obtaining SU metadata
--echo # lock.
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 add index (not_exist);
--echo # Check that SNW lock is compatible with it. To do this use ALTER TABLE
--echo # which will fail during copying the table and thus obtaining SNW metadata
@@ -418,7 +418,7 @@ insert into t1 values (1);
--echo # Check that SU lock is compatible with it. To do this use ALTER TABLE
--echo # which will fail when constructing .frm and thus obtaining SU metadata
--echo # lock.
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 add index (not_exist);
--echo # Check that SNW lock is not compatible with SW lock.
--echo # Again we use ALTER TABLE which fails during copying
diff --git a/mysql-test/main/metadata.result b/mysql-test/main/metadata.result
index 0704f5b8ae8..1d229643ade 100644
--- a/mysql-test/main/metadata.result
+++ b/mysql-test/main/metadata.result
@@ -553,19 +553,19 @@ d0l d09 d10
# MDEV-12862 Data type of @a:=1e0 depends on the session character set
#
SET NAMES utf8;
-CREATE TABLE t1 AS SELECT @:=1e0;
+CREATE TABLE t1 AS SELECT @a:=1e0;
SELECT * FROM t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def test t1 t1 @:=1e0 @:=1e0 5 3 1 N 36865 31 63
-@:=1e0
+def test t1 t1 @a:=1e0 @a:=1e0 5 3 1 N 36865 31 63
+@a:=1e0
1
DROP TABLE t1;
SET NAMES latin1;
-CREATE TABLE t1 AS SELECT @:=1e0;
+CREATE TABLE t1 AS SELECT @a:=1e0;
SELECT * FROM t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def test t1 t1 @:=1e0 @:=1e0 5 3 1 N 36865 31 63
-@:=1e0
+def test t1 t1 @a:=1e0 @a:=1e0 5 3 1 N 36865 31 63
+@a:=1e0
1
DROP TABLE t1;
#
diff --git a/mysql-test/main/metadata.test b/mysql-test/main/metadata.test
index 96189a9750a..6a03bc81546 100644
--- a/mysql-test/main/metadata.test
+++ b/mysql-test/main/metadata.test
@@ -345,11 +345,11 @@ SELECT
--echo #
--enable_metadata
SET NAMES utf8;
-CREATE TABLE t1 AS SELECT @:=1e0;
+CREATE TABLE t1 AS SELECT @a:=1e0;
SELECT * FROM t1;
DROP TABLE t1;
SET NAMES latin1;
-CREATE TABLE t1 AS SELECT @:=1e0;
+CREATE TABLE t1 AS SELECT @a:=1e0;
SELECT * FROM t1;
DROP TABLE t1;
--disable_metadata
diff --git a/mysql-test/main/mysql.result b/mysql-test/main/mysql.result
index f2dec7fe1a4..d889738bf6a 100644
--- a/mysql-test/main/mysql.result
+++ b/mysql-test/main/mysql.result
@@ -558,7 +558,9 @@ CREATE TABLE `a1\``b1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `a1\``b1` VALUES (1),(2);
+INSERT INTO `a1\``b1` VALUES
+(1),
+(2);
insert `a1\``b1` values (4),(5);
show create table `a1\``b1`;
Table Create Table
@@ -587,7 +589,9 @@ CREATE TABLE "a1\""b1" (
"a" int(11) DEFAULT NULL
);
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO "a1\""b1" VALUES (1),(2);
+INSERT INTO "a1\""b1" VALUES
+(1),
+(2);
insert "a1\""b1" values (4),(5);
show create table "a1\""b1";
Table Create Table
@@ -603,11 +607,11 @@ set sql_mode=default;
create table t1 (a text);
select count(*) from t1;
count(*)
-41
+43
truncate table t1;
select count(*) from t1;
count(*)
-41
+43
truncate table t1;
select count(*) from t1;
count(*)
@@ -619,7 +623,7 @@ count(*)
truncate table t1;
select count(*) from t1;
count(*)
-41
+43
truncate table t1;
select count(*) from t1;
count(*)
diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result
index 2a158151528..a8aa461c863 100644
--- a/mysql-test/main/mysqld--help.result
+++ b/mysql-test/main/mysqld--help.result
@@ -1709,7 +1709,7 @@ performance-schema-max-socket-classes 10
performance-schema-max-socket-instances -1
performance-schema-max-sql-text-length 1024
performance-schema-max-stage-classes 160
-performance-schema-max-statement-classes 222
+performance-schema-max-statement-classes 221
performance-schema-max-statement-stack 10
performance-schema-max-table-handles -1
performance-schema-max-table-instances -1
diff --git a/mysql-test/main/mysqld--help.test b/mysql-test/main/mysqld--help.test
index f918670d319..95ae49b5c89 100644
--- a/mysql-test/main/mysqld--help.test
+++ b/mysql-test/main/mysqld--help.test
@@ -27,14 +27,15 @@ perl;
large-files-support lower-case-file-system system-time-zone
collation-server character-set-server log-tc-size table-cache
table-open-cache table-open-cache-instances max-connections
- tls-version version.*/;
+ tls-version version.* password-reuse-check
+ password-reuse-check-interval/;
# Plugins which may or may not be there:
@plugins=qw/innodb archive blackhole federated partition s3
feedback debug temp-pool ssl des-key-file xtradb sequence
thread-concurrency super-large-pages mutex-deadlock-detector
connect null-audit aria oqgraph sphinx thread-handling
- test-sql-discovery query-cache-info
+ test-sql-discovery query-cache-info password-reuse-check
query-response-time metadata-lock-info locales unix-socket
wsrep file-key-management cracklib-password-check user-variables
thread-pool-groups thread-pool-queues thread-pool-stats thread-pool-waits/;
diff --git a/mysql-test/main/mysqldump-max.result b/mysql-test/main/mysqldump-max.result
index c1825814919..2e131d46f9b 100644
--- a/mysql-test/main/mysqldump-max.result
+++ b/mysql-test/main/mysqldump-max.result
@@ -102,7 +102,12 @@ CREATE TABLE `t1` (
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED IGNORE INTO `t1` VALUES
+(1,'first value'),
+(2,'first value'),
+(3,'first value'),
+(4,'first value'),
+(5,'first value');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
@@ -114,7 +119,12 @@ CREATE TABLE `t2` (
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
-INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED IGNORE INTO `t2` VALUES
+(1,'first value'),
+(2,'first value'),
+(3,'first value'),
+(4,'first value'),
+(5,'first value');
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `t3`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
@@ -126,7 +136,12 @@ CREATE TABLE `t3` (
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t3` DISABLE KEYS */;
-INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED IGNORE INTO `t3` VALUES
+(1,'first value'),
+(2,'first value'),
+(3,'first value'),
+(4,'first value'),
+(5,'first value');
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
DROP TABLE IF EXISTS `t4`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
@@ -138,7 +153,12 @@ CREATE TABLE `t4` (
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t4` DISABLE KEYS */;
-INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED IGNORE INTO `t4` VALUES
+(1,'first value'),
+(2,'first value'),
+(3,'first value'),
+(4,'first value'),
+(5,'first value');
/*!40000 ALTER TABLE `t4` ENABLE KEYS */;
DROP TABLE IF EXISTS `t5`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
@@ -150,7 +170,12 @@ CREATE TABLE `t5` (
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t5` DISABLE KEYS */;
-INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED IGNORE INTO `t5` VALUES
+(1,'first value'),
+(2,'first value'),
+(3,'first value'),
+(4,'first value'),
+(5,'first value');
/*!40000 ALTER TABLE `t5` ENABLE KEYS */;
DROP TABLE IF EXISTS `t6`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
@@ -162,7 +187,12 @@ CREATE TABLE `t6` (
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t6` DISABLE KEYS */;
-INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT IGNORE INTO `t6` VALUES
+(1,'first value'),
+(2,'first value'),
+(3,'first value'),
+(4,'first value'),
+(5,'first value');
/*!40000 ALTER TABLE `t6` ENABLE KEYS */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -199,7 +229,12 @@ CREATE TABLE `t1` (
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED INTO `t1` VALUES
+(1,'first value'),
+(2,'first value'),
+(3,'first value'),
+(4,'first value'),
+(5,'first value');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
@@ -211,7 +246,12 @@ CREATE TABLE `t2` (
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
-INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED INTO `t2` VALUES
+(1,'first value'),
+(2,'first value'),
+(3,'first value'),
+(4,'first value'),
+(5,'first value');
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `t3`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
@@ -223,7 +263,12 @@ CREATE TABLE `t3` (
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t3` DISABLE KEYS */;
-INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED INTO `t3` VALUES
+(1,'first value'),
+(2,'first value'),
+(3,'first value'),
+(4,'first value'),
+(5,'first value');
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
DROP TABLE IF EXISTS `t4`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
@@ -235,7 +280,12 @@ CREATE TABLE `t4` (
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t4` DISABLE KEYS */;
-INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED INTO `t4` VALUES
+(1,'first value'),
+(2,'first value'),
+(3,'first value'),
+(4,'first value'),
+(5,'first value');
/*!40000 ALTER TABLE `t4` ENABLE KEYS */;
DROP TABLE IF EXISTS `t5`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
@@ -247,7 +297,12 @@ CREATE TABLE `t5` (
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t5` DISABLE KEYS */;
-INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT DELAYED INTO `t5` VALUES
+(1,'first value'),
+(2,'first value'),
+(3,'first value'),
+(4,'first value'),
+(5,'first value');
/*!40000 ALTER TABLE `t5` ENABLE KEYS */;
DROP TABLE IF EXISTS `t6`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
@@ -259,7 +314,12 @@ CREATE TABLE `t6` (
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t6` DISABLE KEYS */;
-INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
+INSERT INTO `t6` VALUES
+(1,'first value'),
+(2,'first value'),
+(3,'first value'),
+(4,'first value'),
+(5,'first value');
/*!40000 ALTER TABLE `t6` ENABLE KEYS */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
diff --git a/mysql-test/main/mysqldump-system.result b/mysql-test/main/mysqldump-system.result
index 12b4c763f5d..bf2d60c698c 100644
--- a/mysql-test/main/mysqldump-system.result
+++ b/mysql-test/main/mysqldump-system.result
@@ -93,31 +93,39 @@ USE mysql;
LOCK TABLES `column_stats` WRITE;
/*!40000 ALTER TABLE `column_stats` DISABLE KEYS */;
-REPLACE INTO `column_stats` VALUES ('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\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\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿');
+REPLACE INTO `column_stats` VALUES
+('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\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\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿');
/*!40000 ALTER TABLE `column_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `index_stats` WRITE;
/*!40000 ALTER TABLE `index_stats` DISABLE KEYS */;
-REPLACE INTO `index_stats` VALUES ('mysql','tz','PRIMARY',1,98.2500);
+REPLACE INTO `index_stats` VALUES
+('mysql','tz','PRIMARY',1,98.2500);
/*!40000 ALTER TABLE `index_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `table_stats` WRITE;
/*!40000 ALTER TABLE `table_stats` DISABLE KEYS */;
-REPLACE INTO `table_stats` VALUES ('mysql','tz',393);
+REPLACE INTO `table_stats` VALUES
+('mysql','tz',393);
/*!40000 ALTER TABLE `table_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `innodb_index_stats` WRITE;
/*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */;
-REPLACE INTO `innodb_index_stats` VALUES ('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index');
+REPLACE INTO `innodb_index_stats` VALUES
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index');
/*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `innodb_table_stats` WRITE;
/*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */;
-REPLACE INTO `innodb_table_stats` VALUES ('mysql','tz','2019-12-31 21:00:00',393,1,0);
+REPLACE INTO `innodb_table_stats` VALUES
+('mysql','tz','2019-12-31 21:00:00',393,1,0);
/*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */;
UNLOCK TABLES;
@@ -125,31 +133,488 @@ USE mysql;
LOCK TABLES `time_zone` WRITE;
/*!40000 ALTER TABLE `time_zone` DISABLE KEYS */;
-REPLACE INTO `time_zone` VALUES (1,'N'),(2,'N'),(3,'N'),(4,'Y'),(5,'N');
+REPLACE INTO `time_zone` VALUES
+(1,'N'),
+(2,'N'),
+(3,'N'),
+(4,'Y'),
+(5,'N');
/*!40000 ALTER TABLE `time_zone` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `time_zone_name` WRITE;
/*!40000 ALTER TABLE `time_zone_name` DISABLE KEYS */;
-REPLACE INTO `time_zone_name` VALUES ('Europe/Moscow',3),('Japan',5),('leap/Europe/Moscow',4),('MET',1),('Universal',2),('UTC',2);
+REPLACE INTO `time_zone_name` VALUES
+('Europe/Moscow',3),
+('Japan',5),
+('leap/Europe/Moscow',4),
+('MET',1),
+('Universal',2),
+('UTC',2);
/*!40000 ALTER TABLE `time_zone_name` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `time_zone_leap_second` WRITE;
/*!40000 ALTER TABLE `time_zone_leap_second` DISABLE KEYS */;
-REPLACE INTO `time_zone_leap_second` VALUES (78796800,1),(94694401,2),(126230402,3),(157766403,4),(189302404,5),(220924805,6),(252460806,7),(283996807,8),(315532808,9),(362793609,10),(394329610,11),(425865611,12),(489024012,13),(567993613,14),(631152014,15),(662688015,16),(709948816,17),(741484817,18),(773020818,19),(820454419,20),(867715220,21),(915148821,22);
+REPLACE INTO `time_zone_leap_second` VALUES
+(78796800,1),
+(94694401,2),
+(126230402,3),
+(157766403,4),
+(189302404,5),
+(220924805,6),
+(252460806,7),
+(283996807,8),
+(315532808,9),
+(362793609,10),
+(394329610,11),
+(425865611,12),
+(489024012,13),
+(567993613,14),
+(631152014,15),
+(662688015,16),
+(709948816,17),
+(741484817,18),
+(773020818,19),
+(820454419,20),
+(867715220,21),
+(915148821,22);
/*!40000 ALTER TABLE `time_zone_leap_second` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `time_zone_transition` WRITE;
/*!40000 ALTER TABLE `time_zone_transition` DISABLE KEYS */;
-REPLACE INTO `time_zone_transition` VALUES (1,-1693706400,0),(1,-1680483600,1),(1,-1663455600,2),(1,-1650150000,3),(1,-1632006000,2),(1,-1618700400,3),(1,-938905200,2),(1,-857257200,3),(1,-844556400,2),(1,-828226800,3),(1,-812502000,2),(1,-796777200,3),(1,228877200,2),(1,243997200,3),(1,260326800,2),(1,276051600,3),(1,291776400,2),(1,307501200,3),(1,323830800,2),(1,338950800,3),(1,354675600,2),(1,370400400,3),(1,386125200,2),(1,401850000,3),(1,417574800,2),(1,433299600,3),(1,449024400,2),(1,465354000,3),(1,481078800,2),(1,496803600,3),(1,512528400,2),(1,528253200,3),(1,543978000,2),(1,559702800,3),(1,575427600,2),(1,591152400,3),(1,606877200,2),(1,622602000,3),(1,638326800,2),(1,654656400,3),(1,670381200,2),(1,686106000,3),(1,701830800,2),(1,717555600,3),(1,733280400,2),(1,749005200,3),(1,764730000,2),(1,780454800,3),(1,796179600,2),(1,811904400,3),(1,828234000,2),(1,846378000,3),(1,859683600,2),(1,877827600,3),(1,891133200,2),(1,909277200,3),(1,922582800,2),(1,941331600,3),(1,954032400,2),(1,972781200,3),(1,985482000,2),(1,1004230800,3),(1,1017536400,2),(1,1035680400,3),(1,1048986000,2),(1,1067130000,3),(1,1080435600,2),(1,1099184400,3),(1,1111885200,2),(1,1130634000,3),(1,1143334800,2),(1,1162083600,3),(1,1174784400,2),(1,1193533200,3),(1,1206838800,2),(1,1224982800,3),(1,1238288400,2),(1,1256432400,3),(1,1269738000,2),(1,1288486800,3),(1,1301187600,2),(1,1319936400,3),(1,1332637200,2),(1,1351386000,3),(1,1364691600,2),(1,1382835600,3),(1,1396141200,2),(1,1414285200,3),(1,1427590800,2),(1,1445734800,3),(1,1459040400,2),(1,1477789200,3),(1,1490490000,2),(1,1509238800,3),(1,1521939600,2),(1,1540688400,3),(1,1553994000,2),(1,1572138000,3),(1,1585443600,2),(1,1603587600,3),(1,1616893200,2),(1,1635642000,3),(1,1648342800,2),(1,1667091600,3),(1,1679792400,2),(1,1698541200,3),(1,1711846800,2),(1,1729990800,3),(1,1743296400,2),(1,1761440400,3),(1,1774746000,2),(1,1792890000,3),(1,1806195600,2),(1,1824944400,3),(1,1837645200,2),(1,1856394000,3),(1,1869094800,2),(1,1887843600,3),(1,1901149200,2),(1,1919293200,3),(1,1932598800,2),(1,1950742800,3),(1,1964048400,2),(1,1982797200,3),(1,1995498000,2),(1,2014246800,3),(1,2026947600,2),(1,2045696400,3),(1,2058397200,2),(1,2077146000,3),(1,2090451600,2),(1,2108595600,3),(1,2121901200,2),(1,2140045200,3),(3,-1688265000,2),(3,-1656819048,1),(3,-1641353448,2),(3,-1627965048,3),(3,-1618716648,1),(3,-1596429048,3),(3,-1593829848,5),(3,-1589860800,4),(3,-1542427200,5),(3,-1539493200,6),(3,-1525323600,5),(3,-1522728000,4),(3,-1491188400,7),(3,-1247536800,4),(3,354920400,5),(3,370728000,4),(3,386456400,5),(3,402264000,4),(3,417992400,5),(3,433800000,4),(3,449614800,5),(3,465346800,8),(3,481071600,9),(3,496796400,8),(3,512521200,9),(3,528246000,8),(3,543970800,9),(3,559695600,8),(3,575420400,9),(3,591145200,8),(3,606870000,9),(3,622594800,8),(3,638319600,9),(3,654649200,8),(3,670374000,10),(3,686102400,11),(3,695779200,8),(3,701812800,5),(3,717534000,4),(3,733273200,9),(3,748998000,8),(3,764722800,9),(3,780447600,8),(3,796172400,9),(3,811897200,8),(3,828226800,9),(3,846370800,8),(3,859676400,9),(3,877820400,8),(3,891126000,9),(3,909270000,8),(3,922575600,9),(3,941324400,8),(3,954025200,9),(3,972774000,8),(3,985474800,9),(3,1004223600,8),(3,1017529200,9),(3,1035673200,8),(3,1048978800,9),(3,1067122800,8),(3,1080428400,9),(3,1099177200,8),(3,1111878000,9),(3,1130626800,8),(3,1143327600,9),(3,1162076400,8),(3,1174777200,9),(3,1193526000,8),(3,1206831600,9),(3,1224975600,8),(3,1238281200,9),(3,1256425200,8),(3,1269730800,9),(3,1288479600,8),(3,1301180400,9),(3,1319929200,8),(3,1332630000,9),(3,1351378800,8),(3,1364684400,9),(3,1382828400,8),(3,1396134000,9),(3,1414278000,8),(3,1427583600,9),(3,1445727600,8),(3,1459033200,9),(3,1477782000,8),(3,1490482800,9),(3,1509231600,8),(3,1521932400,9),(3,1540681200,8),(3,1553986800,9),(3,1572130800,8),(3,1585436400,9),(3,1603580400,8),(3,1616886000,9),(3,1635634800,8),(3,1648335600,9),(3,1667084400,8),(3,1679785200,9),(3,1698534000,8),(3,1711839600,9),(3,1729983600,8),(3,1743289200,9),(3,1761433200,8),(3,1774738800,9),(3,1792882800,8),(3,1806188400,9),(3,1824937200,8),(3,1837638000,9),(3,1856386800,8),(3,1869087600,9),(3,1887836400,8),(3,1901142000,9),(3,1919286000,8),(3,1932591600,9),(3,1950735600,8),(3,1964041200,9),(3,1982790000,8),(3,1995490800,9),(3,2014239600,8),(3,2026940400,9),(3,2045689200,8),(3,2058390000,9),(3,2077138800,8),(3,2090444400,9),(3,2108588400,8),(3,2121894000,9),(3,2140038000,8),(4,-1688265000,2),(4,-1656819048,1),(4,-1641353448,2),(4,-1627965048,3),(4,-1618716648,1),(4,-1596429048,3),(4,-1593829848,5),(4,-1589860800,4),(4,-1542427200,5),(4,-1539493200,6),(4,-1525323600,5),(4,-1522728000,4),(4,-1491188400,7),(4,-1247536800,4),(4,354920409,5),(4,370728010,4),(4,386456410,5),(4,402264011,4),(4,417992411,5),(4,433800012,4),(4,449614812,5),(4,465346812,8),(4,481071612,9),(4,496796413,8),(4,512521213,9),(4,528246013,8),(4,543970813,9),(4,559695613,8),(4,575420414,9),(4,591145214,8),(4,606870014,9),(4,622594814,8),(4,638319615,9),(4,654649215,8),(4,670374016,10),(4,686102416,11),(4,695779216,8),(4,701812816,5),(4,717534017,4),(4,733273217,9),(4,748998018,8),(4,764722818,9),(4,780447619,8),(4,796172419,9),(4,811897219,8),(4,828226820,9),(4,846370820,8),(4,859676420,9),(4,877820421,8),(4,891126021,9),(4,909270021,8),(4,922575622,9),(4,941324422,8),(4,954025222,9),(4,972774022,8),(4,985474822,9),(4,1004223622,8),(4,1017529222,9),(4,1035673222,8),(4,1048978822,9),(4,1067122822,8),(4,1080428422,9),(4,1099177222,8),(4,1111878022,9),(4,1130626822,8),(4,1143327622,9),(4,1162076422,8),(4,1174777222,9),(4,1193526022,8),(4,1206831622,9),(4,1224975622,8),(4,1238281222,9),(4,1256425222,8),(4,1269730822,9),(4,1288479622,8),(4,1301180422,9),(4,1319929222,8),(4,1332630022,9),(4,1351378822,8),(4,1364684422,9),(4,1382828422,8),(4,1396134022,9),(4,1414278022,8),(4,1427583622,9),(4,1445727622,8),(4,1459033222,9),(4,1477782022,8),(4,1490482822,9),(4,1509231622,8),(4,1521932422,9),(4,1540681222,8),(4,1553986822,9),(4,1572130822,8),(4,1585436422,9),(4,1603580422,8),(4,1616886022,9),(4,1635634822,8),(4,1648335622,9),(4,1667084422,8),(4,1679785222,9),(4,1698534022,8),(4,1711839622,9),(4,1729983622,8),(4,1743289222,9),(4,1761433222,8),(4,1774738822,9),(4,1792882822,8),(4,1806188422,9),(4,1824937222,8),(4,1837638022,9),(4,1856386822,8),(4,1869087622,9),(4,1887836422,8),(4,1901142022,9),(4,1919286022,8),(4,1932591622,9),(4,1950735622,8),(4,1964041222,9),(4,1982790022,8),(4,1995490822,9),(4,2014239622,8),(4,2026940422,9),(4,2045689222,8),(4,2058390022,9),(4,2077138822,8),(4,2090444422,9),(4,2108588422,8),(4,2121894022,9),(4,2140038022,8),(5,-1009875600,1);
+REPLACE INTO `time_zone_transition` VALUES
+(1,-1693706400,0),
+(1,-1680483600,1),
+(1,-1663455600,2),
+(1,-1650150000,3),
+(1,-1632006000,2),
+(1,-1618700400,3),
+(1,-938905200,2),
+(1,-857257200,3),
+(1,-844556400,2),
+(1,-828226800,3),
+(1,-812502000,2),
+(1,-796777200,3),
+(1,228877200,2),
+(1,243997200,3),
+(1,260326800,2),
+(1,276051600,3),
+(1,291776400,2),
+(1,307501200,3),
+(1,323830800,2),
+(1,338950800,3),
+(1,354675600,2),
+(1,370400400,3),
+(1,386125200,2),
+(1,401850000,3),
+(1,417574800,2),
+(1,433299600,3),
+(1,449024400,2),
+(1,465354000,3),
+(1,481078800,2),
+(1,496803600,3),
+(1,512528400,2),
+(1,528253200,3),
+(1,543978000,2),
+(1,559702800,3),
+(1,575427600,2),
+(1,591152400,3),
+(1,606877200,2),
+(1,622602000,3),
+(1,638326800,2),
+(1,654656400,3),
+(1,670381200,2),
+(1,686106000,3),
+(1,701830800,2),
+(1,717555600,3),
+(1,733280400,2),
+(1,749005200,3),
+(1,764730000,2),
+(1,780454800,3),
+(1,796179600,2),
+(1,811904400,3),
+(1,828234000,2),
+(1,846378000,3),
+(1,859683600,2),
+(1,877827600,3),
+(1,891133200,2),
+(1,909277200,3),
+(1,922582800,2),
+(1,941331600,3),
+(1,954032400,2),
+(1,972781200,3),
+(1,985482000,2),
+(1,1004230800,3),
+(1,1017536400,2),
+(1,1035680400,3),
+(1,1048986000,2),
+(1,1067130000,3),
+(1,1080435600,2),
+(1,1099184400,3),
+(1,1111885200,2),
+(1,1130634000,3),
+(1,1143334800,2),
+(1,1162083600,3),
+(1,1174784400,2),
+(1,1193533200,3),
+(1,1206838800,2),
+(1,1224982800,3),
+(1,1238288400,2),
+(1,1256432400,3),
+(1,1269738000,2),
+(1,1288486800,3),
+(1,1301187600,2),
+(1,1319936400,3),
+(1,1332637200,2),
+(1,1351386000,3),
+(1,1364691600,2),
+(1,1382835600,3),
+(1,1396141200,2),
+(1,1414285200,3),
+(1,1427590800,2),
+(1,1445734800,3),
+(1,1459040400,2),
+(1,1477789200,3),
+(1,1490490000,2),
+(1,1509238800,3),
+(1,1521939600,2),
+(1,1540688400,3),
+(1,1553994000,2),
+(1,1572138000,3),
+(1,1585443600,2),
+(1,1603587600,3),
+(1,1616893200,2),
+(1,1635642000,3),
+(1,1648342800,2),
+(1,1667091600,3),
+(1,1679792400,2),
+(1,1698541200,3),
+(1,1711846800,2),
+(1,1729990800,3),
+(1,1743296400,2),
+(1,1761440400,3),
+(1,1774746000,2),
+(1,1792890000,3),
+(1,1806195600,2),
+(1,1824944400,3),
+(1,1837645200,2),
+(1,1856394000,3),
+(1,1869094800,2),
+(1,1887843600,3),
+(1,1901149200,2),
+(1,1919293200,3),
+(1,1932598800,2),
+(1,1950742800,3),
+(1,1964048400,2),
+(1,1982797200,3),
+(1,1995498000,2),
+(1,2014246800,3),
+(1,2026947600,2),
+(1,2045696400,3),
+(1,2058397200,2),
+(1,2077146000,3),
+(1,2090451600,2),
+(1,2108595600,3),
+(1,2121901200,2),
+(1,2140045200,3),
+(3,-1688265000,2),
+(3,-1656819048,1),
+(3,-1641353448,2),
+(3,-1627965048,3),
+(3,-1618716648,1),
+(3,-1596429048,3),
+(3,-1593829848,5),
+(3,-1589860800,4),
+(3,-1542427200,5),
+(3,-1539493200,6),
+(3,-1525323600,5),
+(3,-1522728000,4),
+(3,-1491188400,7),
+(3,-1247536800,4),
+(3,354920400,5),
+(3,370728000,4),
+(3,386456400,5),
+(3,402264000,4),
+(3,417992400,5),
+(3,433800000,4),
+(3,449614800,5),
+(3,465346800,8),
+(3,481071600,9),
+(3,496796400,8),
+(3,512521200,9),
+(3,528246000,8),
+(3,543970800,9),
+(3,559695600,8),
+(3,575420400,9),
+(3,591145200,8),
+(3,606870000,9),
+(3,622594800,8),
+(3,638319600,9),
+(3,654649200,8),
+(3,670374000,10),
+(3,686102400,11),
+(3,695779200,8),
+(3,701812800,5),
+(3,717534000,4),
+(3,733273200,9),
+(3,748998000,8),
+(3,764722800,9),
+(3,780447600,8),
+(3,796172400,9),
+(3,811897200,8),
+(3,828226800,9),
+(3,846370800,8),
+(3,859676400,9),
+(3,877820400,8),
+(3,891126000,9),
+(3,909270000,8),
+(3,922575600,9),
+(3,941324400,8),
+(3,954025200,9),
+(3,972774000,8),
+(3,985474800,9),
+(3,1004223600,8),
+(3,1017529200,9),
+(3,1035673200,8),
+(3,1048978800,9),
+(3,1067122800,8),
+(3,1080428400,9),
+(3,1099177200,8),
+(3,1111878000,9),
+(3,1130626800,8),
+(3,1143327600,9),
+(3,1162076400,8),
+(3,1174777200,9),
+(3,1193526000,8),
+(3,1206831600,9),
+(3,1224975600,8),
+(3,1238281200,9),
+(3,1256425200,8),
+(3,1269730800,9),
+(3,1288479600,8),
+(3,1301180400,9),
+(3,1319929200,8),
+(3,1332630000,9),
+(3,1351378800,8),
+(3,1364684400,9),
+(3,1382828400,8),
+(3,1396134000,9),
+(3,1414278000,8),
+(3,1427583600,9),
+(3,1445727600,8),
+(3,1459033200,9),
+(3,1477782000,8),
+(3,1490482800,9),
+(3,1509231600,8),
+(3,1521932400,9),
+(3,1540681200,8),
+(3,1553986800,9),
+(3,1572130800,8),
+(3,1585436400,9),
+(3,1603580400,8),
+(3,1616886000,9),
+(3,1635634800,8),
+(3,1648335600,9),
+(3,1667084400,8),
+(3,1679785200,9),
+(3,1698534000,8),
+(3,1711839600,9),
+(3,1729983600,8),
+(3,1743289200,9),
+(3,1761433200,8),
+(3,1774738800,9),
+(3,1792882800,8),
+(3,1806188400,9),
+(3,1824937200,8),
+(3,1837638000,9),
+(3,1856386800,8),
+(3,1869087600,9),
+(3,1887836400,8),
+(3,1901142000,9),
+(3,1919286000,8),
+(3,1932591600,9),
+(3,1950735600,8),
+(3,1964041200,9),
+(3,1982790000,8),
+(3,1995490800,9),
+(3,2014239600,8),
+(3,2026940400,9),
+(3,2045689200,8),
+(3,2058390000,9),
+(3,2077138800,8),
+(3,2090444400,9),
+(3,2108588400,8),
+(3,2121894000,9),
+(3,2140038000,8),
+(4,-1688265000,2),
+(4,-1656819048,1),
+(4,-1641353448,2),
+(4,-1627965048,3),
+(4,-1618716648,1),
+(4,-1596429048,3),
+(4,-1593829848,5),
+(4,-1589860800,4),
+(4,-1542427200,5),
+(4,-1539493200,6),
+(4,-1525323600,5),
+(4,-1522728000,4),
+(4,-1491188400,7),
+(4,-1247536800,4),
+(4,354920409,5),
+(4,370728010,4),
+(4,386456410,5),
+(4,402264011,4),
+(4,417992411,5),
+(4,433800012,4),
+(4,449614812,5),
+(4,465346812,8),
+(4,481071612,9),
+(4,496796413,8),
+(4,512521213,9),
+(4,528246013,8),
+(4,543970813,9),
+(4,559695613,8),
+(4,575420414,9),
+(4,591145214,8),
+(4,606870014,9),
+(4,622594814,8),
+(4,638319615,9),
+(4,654649215,8),
+(4,670374016,10),
+(4,686102416,11),
+(4,695779216,8),
+(4,701812816,5),
+(4,717534017,4),
+(4,733273217,9),
+(4,748998018,8),
+(4,764722818,9),
+(4,780447619,8),
+(4,796172419,9),
+(4,811897219,8),
+(4,828226820,9),
+(4,846370820,8),
+(4,859676420,9),
+(4,877820421,8),
+(4,891126021,9),
+(4,909270021,8),
+(4,922575622,9),
+(4,941324422,8),
+(4,954025222,9),
+(4,972774022,8),
+(4,985474822,9),
+(4,1004223622,8),
+(4,1017529222,9),
+(4,1035673222,8),
+(4,1048978822,9),
+(4,1067122822,8),
+(4,1080428422,9),
+(4,1099177222,8),
+(4,1111878022,9),
+(4,1130626822,8),
+(4,1143327622,9),
+(4,1162076422,8),
+(4,1174777222,9),
+(4,1193526022,8),
+(4,1206831622,9),
+(4,1224975622,8),
+(4,1238281222,9),
+(4,1256425222,8),
+(4,1269730822,9),
+(4,1288479622,8),
+(4,1301180422,9),
+(4,1319929222,8),
+(4,1332630022,9),
+(4,1351378822,8),
+(4,1364684422,9),
+(4,1382828422,8),
+(4,1396134022,9),
+(4,1414278022,8),
+(4,1427583622,9),
+(4,1445727622,8),
+(4,1459033222,9),
+(4,1477782022,8),
+(4,1490482822,9),
+(4,1509231622,8),
+(4,1521932422,9),
+(4,1540681222,8),
+(4,1553986822,9),
+(4,1572130822,8),
+(4,1585436422,9),
+(4,1603580422,8),
+(4,1616886022,9),
+(4,1635634822,8),
+(4,1648335622,9),
+(4,1667084422,8),
+(4,1679785222,9),
+(4,1698534022,8),
+(4,1711839622,9),
+(4,1729983622,8),
+(4,1743289222,9),
+(4,1761433222,8),
+(4,1774738822,9),
+(4,1792882822,8),
+(4,1806188422,9),
+(4,1824937222,8),
+(4,1837638022,9),
+(4,1856386822,8),
+(4,1869087622,9),
+(4,1887836422,8),
+(4,1901142022,9),
+(4,1919286022,8),
+(4,1932591622,9),
+(4,1950735622,8),
+(4,1964041222,9),
+(4,1982790022,8),
+(4,1995490822,9),
+(4,2014239622,8),
+(4,2026940422,9),
+(4,2045689222,8),
+(4,2058390022,9),
+(4,2077138822,8),
+(4,2090444422,9),
+(4,2108588422,8),
+(4,2121894022,9),
+(4,2140038022,8),
+(5,-1009875600,1);
/*!40000 ALTER TABLE `time_zone_transition` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `time_zone_transition_type` WRITE;
/*!40000 ALTER TABLE `time_zone_transition_type` DISABLE KEYS */;
-REPLACE INTO `time_zone_transition_type` VALUES (1,0,7200,1,'MEST'),(1,1,3600,0,'MET'),(1,2,7200,1,'MEST'),(1,3,3600,0,'MET'),(2,0,0,0,'UTC'),(3,0,9000,0,'MMT'),(3,1,12648,1,'MST'),(3,2,9048,0,'MMT'),(3,3,16248,1,'MDST'),(3,4,10800,0,'MSK'),(3,5,14400,1,'MSD'),(3,6,18000,1,'MSD'),(3,7,7200,0,'EET'),(3,8,10800,0,'MSK'),(3,9,14400,1,'MSD'),(3,10,10800,1,'EEST'),(3,11,7200,0,'EET'),(4,0,9000,0,'MMT'),(4,1,12648,1,'MST'),(4,2,9048,0,'MMT'),(4,3,16248,1,'MDST'),(4,4,10800,0,'MSK'),(4,5,14400,1,'MSD'),(4,6,18000,1,'MSD'),(4,7,7200,0,'EET'),(4,8,10800,0,'MSK'),(4,9,14400,1,'MSD'),(4,10,10800,1,'EEST'),(4,11,7200,0,'EET'),(5,0,32400,0,'CJT'),(5,1,32400,0,'JST');
+REPLACE INTO `time_zone_transition_type` VALUES
+(1,0,7200,1,'MEST'),
+(1,1,3600,0,'MET'),
+(1,2,7200,1,'MEST'),
+(1,3,3600,0,'MET'),
+(2,0,0,0,'UTC'),
+(3,0,9000,0,'MMT'),
+(3,1,12648,1,'MST'),
+(3,2,9048,0,'MMT'),
+(3,3,16248,1,'MDST'),
+(3,4,10800,0,'MSK'),
+(3,5,14400,1,'MSD'),
+(3,6,18000,1,'MSD'),
+(3,7,7200,0,'EET'),
+(3,8,10800,0,'MSK'),
+(3,9,14400,1,'MSD'),
+(3,10,10800,1,'EEST'),
+(3,11,7200,0,'EET'),
+(4,0,9000,0,'MMT'),
+(4,1,12648,1,'MST'),
+(4,2,9048,0,'MMT'),
+(4,3,16248,1,'MDST'),
+(4,4,10800,0,'MSK'),
+(4,5,14400,1,'MSD'),
+(4,6,18000,1,'MSD'),
+(4,7,7200,0,'EET'),
+(4,8,10800,0,'MSK'),
+(4,9,14400,1,'MSD'),
+(4,10,10800,1,'EEST'),
+(4,11,7200,0,'EET'),
+(5,0,32400,0,'CJT'),
+(5,1,32400,0,'JST');
/*!40000 ALTER TABLE `time_zone_transition_type` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -242,31 +707,39 @@ USE mysql;
LOCK TABLES `column_stats` WRITE;
/*!40000 ALTER TABLE `column_stats` DISABLE KEYS */;
-REPLACE INTO `column_stats` VALUES ('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\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\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿');
+REPLACE INTO `column_stats` VALUES
+('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\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\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿');
/*!40000 ALTER TABLE `column_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `index_stats` WRITE;
/*!40000 ALTER TABLE `index_stats` DISABLE KEYS */;
-REPLACE INTO `index_stats` VALUES ('mysql','tz','PRIMARY',1,98.2500);
+REPLACE INTO `index_stats` VALUES
+('mysql','tz','PRIMARY',1,98.2500);
/*!40000 ALTER TABLE `index_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `table_stats` WRITE;
/*!40000 ALTER TABLE `table_stats` DISABLE KEYS */;
-REPLACE INTO `table_stats` VALUES ('mysql','tz',393);
+REPLACE INTO `table_stats` VALUES
+('mysql','tz',393);
/*!40000 ALTER TABLE `table_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `innodb_index_stats` WRITE;
/*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */;
-REPLACE INTO `innodb_index_stats` VALUES ('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index');
+REPLACE INTO `innodb_index_stats` VALUES
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index');
/*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `innodb_table_stats` WRITE;
/*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */;
-REPLACE INTO `innodb_table_stats` VALUES ('mysql','tz','2019-12-31 21:00:00',393,1,0);
+REPLACE INTO `innodb_table_stats` VALUES
+('mysql','tz','2019-12-31 21:00:00',393,1,0);
/*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */;
UNLOCK TABLES;
@@ -274,31 +747,488 @@ USE mysql;
LOCK TABLES `time_zone` WRITE;
/*!40000 ALTER TABLE `time_zone` DISABLE KEYS */;
-REPLACE INTO `time_zone` VALUES (1,'N'),(2,'N'),(3,'N'),(4,'Y'),(5,'N');
+REPLACE INTO `time_zone` VALUES
+(1,'N'),
+(2,'N'),
+(3,'N'),
+(4,'Y'),
+(5,'N');
/*!40000 ALTER TABLE `time_zone` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `time_zone_name` WRITE;
/*!40000 ALTER TABLE `time_zone_name` DISABLE KEYS */;
-REPLACE INTO `time_zone_name` VALUES ('Europe/Moscow',3),('Japan',5),('leap/Europe/Moscow',4),('MET',1),('Universal',2),('UTC',2);
+REPLACE INTO `time_zone_name` VALUES
+('Europe/Moscow',3),
+('Japan',5),
+('leap/Europe/Moscow',4),
+('MET',1),
+('Universal',2),
+('UTC',2);
/*!40000 ALTER TABLE `time_zone_name` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `time_zone_leap_second` WRITE;
/*!40000 ALTER TABLE `time_zone_leap_second` DISABLE KEYS */;
-REPLACE INTO `time_zone_leap_second` VALUES (78796800,1),(94694401,2),(126230402,3),(157766403,4),(189302404,5),(220924805,6),(252460806,7),(283996807,8),(315532808,9),(362793609,10),(394329610,11),(425865611,12),(489024012,13),(567993613,14),(631152014,15),(662688015,16),(709948816,17),(741484817,18),(773020818,19),(820454419,20),(867715220,21),(915148821,22);
+REPLACE INTO `time_zone_leap_second` VALUES
+(78796800,1),
+(94694401,2),
+(126230402,3),
+(157766403,4),
+(189302404,5),
+(220924805,6),
+(252460806,7),
+(283996807,8),
+(315532808,9),
+(362793609,10),
+(394329610,11),
+(425865611,12),
+(489024012,13),
+(567993613,14),
+(631152014,15),
+(662688015,16),
+(709948816,17),
+(741484817,18),
+(773020818,19),
+(820454419,20),
+(867715220,21),
+(915148821,22);
/*!40000 ALTER TABLE `time_zone_leap_second` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `time_zone_transition` WRITE;
/*!40000 ALTER TABLE `time_zone_transition` DISABLE KEYS */;
-REPLACE INTO `time_zone_transition` VALUES (1,-1693706400,0),(1,-1680483600,1),(1,-1663455600,2),(1,-1650150000,3),(1,-1632006000,2),(1,-1618700400,3),(1,-938905200,2),(1,-857257200,3),(1,-844556400,2),(1,-828226800,3),(1,-812502000,2),(1,-796777200,3),(1,228877200,2),(1,243997200,3),(1,260326800,2),(1,276051600,3),(1,291776400,2),(1,307501200,3),(1,323830800,2),(1,338950800,3),(1,354675600,2),(1,370400400,3),(1,386125200,2),(1,401850000,3),(1,417574800,2),(1,433299600,3),(1,449024400,2),(1,465354000,3),(1,481078800,2),(1,496803600,3),(1,512528400,2),(1,528253200,3),(1,543978000,2),(1,559702800,3),(1,575427600,2),(1,591152400,3),(1,606877200,2),(1,622602000,3),(1,638326800,2),(1,654656400,3),(1,670381200,2),(1,686106000,3),(1,701830800,2),(1,717555600,3),(1,733280400,2),(1,749005200,3),(1,764730000,2),(1,780454800,3),(1,796179600,2),(1,811904400,3),(1,828234000,2),(1,846378000,3),(1,859683600,2),(1,877827600,3),(1,891133200,2),(1,909277200,3),(1,922582800,2),(1,941331600,3),(1,954032400,2),(1,972781200,3),(1,985482000,2),(1,1004230800,3),(1,1017536400,2),(1,1035680400,3),(1,1048986000,2),(1,1067130000,3),(1,1080435600,2),(1,1099184400,3),(1,1111885200,2),(1,1130634000,3),(1,1143334800,2),(1,1162083600,3),(1,1174784400,2),(1,1193533200,3),(1,1206838800,2),(1,1224982800,3),(1,1238288400,2),(1,1256432400,3),(1,1269738000,2),(1,1288486800,3),(1,1301187600,2),(1,1319936400,3),(1,1332637200,2),(1,1351386000,3),(1,1364691600,2),(1,1382835600,3),(1,1396141200,2),(1,1414285200,3),(1,1427590800,2),(1,1445734800,3),(1,1459040400,2),(1,1477789200,3),(1,1490490000,2),(1,1509238800,3),(1,1521939600,2),(1,1540688400,3),(1,1553994000,2),(1,1572138000,3),(1,1585443600,2),(1,1603587600,3),(1,1616893200,2),(1,1635642000,3),(1,1648342800,2),(1,1667091600,3),(1,1679792400,2),(1,1698541200,3),(1,1711846800,2),(1,1729990800,3),(1,1743296400,2),(1,1761440400,3),(1,1774746000,2),(1,1792890000,3),(1,1806195600,2),(1,1824944400,3),(1,1837645200,2),(1,1856394000,3),(1,1869094800,2),(1,1887843600,3),(1,1901149200,2),(1,1919293200,3),(1,1932598800,2),(1,1950742800,3),(1,1964048400,2),(1,1982797200,3),(1,1995498000,2),(1,2014246800,3),(1,2026947600,2),(1,2045696400,3),(1,2058397200,2),(1,2077146000,3),(1,2090451600,2),(1,2108595600,3),(1,2121901200,2),(1,2140045200,3),(3,-1688265000,2),(3,-1656819048,1),(3,-1641353448,2),(3,-1627965048,3),(3,-1618716648,1),(3,-1596429048,3),(3,-1593829848,5),(3,-1589860800,4),(3,-1542427200,5),(3,-1539493200,6),(3,-1525323600,5),(3,-1522728000,4),(3,-1491188400,7),(3,-1247536800,4),(3,354920400,5),(3,370728000,4),(3,386456400,5),(3,402264000,4),(3,417992400,5),(3,433800000,4),(3,449614800,5),(3,465346800,8),(3,481071600,9),(3,496796400,8),(3,512521200,9),(3,528246000,8),(3,543970800,9),(3,559695600,8),(3,575420400,9),(3,591145200,8),(3,606870000,9),(3,622594800,8),(3,638319600,9),(3,654649200,8),(3,670374000,10),(3,686102400,11),(3,695779200,8),(3,701812800,5),(3,717534000,4),(3,733273200,9),(3,748998000,8),(3,764722800,9),(3,780447600,8),(3,796172400,9),(3,811897200,8),(3,828226800,9),(3,846370800,8),(3,859676400,9),(3,877820400,8),(3,891126000,9),(3,909270000,8),(3,922575600,9),(3,941324400,8),(3,954025200,9),(3,972774000,8),(3,985474800,9),(3,1004223600,8),(3,1017529200,9),(3,1035673200,8),(3,1048978800,9),(3,1067122800,8),(3,1080428400,9),(3,1099177200,8),(3,1111878000,9),(3,1130626800,8),(3,1143327600,9),(3,1162076400,8),(3,1174777200,9),(3,1193526000,8),(3,1206831600,9),(3,1224975600,8),(3,1238281200,9),(3,1256425200,8),(3,1269730800,9),(3,1288479600,8),(3,1301180400,9),(3,1319929200,8),(3,1332630000,9),(3,1351378800,8),(3,1364684400,9),(3,1382828400,8),(3,1396134000,9),(3,1414278000,8),(3,1427583600,9),(3,1445727600,8),(3,1459033200,9),(3,1477782000,8),(3,1490482800,9),(3,1509231600,8),(3,1521932400,9),(3,1540681200,8),(3,1553986800,9),(3,1572130800,8),(3,1585436400,9),(3,1603580400,8),(3,1616886000,9),(3,1635634800,8),(3,1648335600,9),(3,1667084400,8),(3,1679785200,9),(3,1698534000,8),(3,1711839600,9),(3,1729983600,8),(3,1743289200,9),(3,1761433200,8),(3,1774738800,9),(3,1792882800,8),(3,1806188400,9),(3,1824937200,8),(3,1837638000,9),(3,1856386800,8),(3,1869087600,9),(3,1887836400,8),(3,1901142000,9),(3,1919286000,8),(3,1932591600,9),(3,1950735600,8),(3,1964041200,9),(3,1982790000,8),(3,1995490800,9),(3,2014239600,8),(3,2026940400,9),(3,2045689200,8),(3,2058390000,9),(3,2077138800,8),(3,2090444400,9),(3,2108588400,8),(3,2121894000,9),(3,2140038000,8),(4,-1688265000,2),(4,-1656819048,1),(4,-1641353448,2),(4,-1627965048,3),(4,-1618716648,1),(4,-1596429048,3),(4,-1593829848,5),(4,-1589860800,4),(4,-1542427200,5),(4,-1539493200,6),(4,-1525323600,5),(4,-1522728000,4),(4,-1491188400,7),(4,-1247536800,4),(4,354920409,5),(4,370728010,4),(4,386456410,5),(4,402264011,4),(4,417992411,5),(4,433800012,4),(4,449614812,5),(4,465346812,8),(4,481071612,9),(4,496796413,8),(4,512521213,9),(4,528246013,8),(4,543970813,9),(4,559695613,8),(4,575420414,9),(4,591145214,8),(4,606870014,9),(4,622594814,8),(4,638319615,9),(4,654649215,8),(4,670374016,10),(4,686102416,11),(4,695779216,8),(4,701812816,5),(4,717534017,4),(4,733273217,9),(4,748998018,8),(4,764722818,9),(4,780447619,8),(4,796172419,9),(4,811897219,8),(4,828226820,9),(4,846370820,8),(4,859676420,9),(4,877820421,8),(4,891126021,9),(4,909270021,8),(4,922575622,9),(4,941324422,8),(4,954025222,9),(4,972774022,8),(4,985474822,9),(4,1004223622,8),(4,1017529222,9),(4,1035673222,8),(4,1048978822,9),(4,1067122822,8),(4,1080428422,9),(4,1099177222,8),(4,1111878022,9),(4,1130626822,8),(4,1143327622,9),(4,1162076422,8),(4,1174777222,9),(4,1193526022,8),(4,1206831622,9),(4,1224975622,8),(4,1238281222,9),(4,1256425222,8),(4,1269730822,9),(4,1288479622,8),(4,1301180422,9),(4,1319929222,8),(4,1332630022,9),(4,1351378822,8),(4,1364684422,9),(4,1382828422,8),(4,1396134022,9),(4,1414278022,8),(4,1427583622,9),(4,1445727622,8),(4,1459033222,9),(4,1477782022,8),(4,1490482822,9),(4,1509231622,8),(4,1521932422,9),(4,1540681222,8),(4,1553986822,9),(4,1572130822,8),(4,1585436422,9),(4,1603580422,8),(4,1616886022,9),(4,1635634822,8),(4,1648335622,9),(4,1667084422,8),(4,1679785222,9),(4,1698534022,8),(4,1711839622,9),(4,1729983622,8),(4,1743289222,9),(4,1761433222,8),(4,1774738822,9),(4,1792882822,8),(4,1806188422,9),(4,1824937222,8),(4,1837638022,9),(4,1856386822,8),(4,1869087622,9),(4,1887836422,8),(4,1901142022,9),(4,1919286022,8),(4,1932591622,9),(4,1950735622,8),(4,1964041222,9),(4,1982790022,8),(4,1995490822,9),(4,2014239622,8),(4,2026940422,9),(4,2045689222,8),(4,2058390022,9),(4,2077138822,8),(4,2090444422,9),(4,2108588422,8),(4,2121894022,9),(4,2140038022,8),(5,-1009875600,1);
+REPLACE INTO `time_zone_transition` VALUES
+(1,-1693706400,0),
+(1,-1680483600,1),
+(1,-1663455600,2),
+(1,-1650150000,3),
+(1,-1632006000,2),
+(1,-1618700400,3),
+(1,-938905200,2),
+(1,-857257200,3),
+(1,-844556400,2),
+(1,-828226800,3),
+(1,-812502000,2),
+(1,-796777200,3),
+(1,228877200,2),
+(1,243997200,3),
+(1,260326800,2),
+(1,276051600,3),
+(1,291776400,2),
+(1,307501200,3),
+(1,323830800,2),
+(1,338950800,3),
+(1,354675600,2),
+(1,370400400,3),
+(1,386125200,2),
+(1,401850000,3),
+(1,417574800,2),
+(1,433299600,3),
+(1,449024400,2),
+(1,465354000,3),
+(1,481078800,2),
+(1,496803600,3),
+(1,512528400,2),
+(1,528253200,3),
+(1,543978000,2),
+(1,559702800,3),
+(1,575427600,2),
+(1,591152400,3),
+(1,606877200,2),
+(1,622602000,3),
+(1,638326800,2),
+(1,654656400,3),
+(1,670381200,2),
+(1,686106000,3),
+(1,701830800,2),
+(1,717555600,3),
+(1,733280400,2),
+(1,749005200,3),
+(1,764730000,2),
+(1,780454800,3),
+(1,796179600,2),
+(1,811904400,3),
+(1,828234000,2),
+(1,846378000,3),
+(1,859683600,2),
+(1,877827600,3),
+(1,891133200,2),
+(1,909277200,3),
+(1,922582800,2),
+(1,941331600,3),
+(1,954032400,2),
+(1,972781200,3),
+(1,985482000,2),
+(1,1004230800,3),
+(1,1017536400,2),
+(1,1035680400,3),
+(1,1048986000,2),
+(1,1067130000,3),
+(1,1080435600,2),
+(1,1099184400,3),
+(1,1111885200,2),
+(1,1130634000,3),
+(1,1143334800,2),
+(1,1162083600,3),
+(1,1174784400,2),
+(1,1193533200,3),
+(1,1206838800,2),
+(1,1224982800,3),
+(1,1238288400,2),
+(1,1256432400,3),
+(1,1269738000,2),
+(1,1288486800,3),
+(1,1301187600,2),
+(1,1319936400,3),
+(1,1332637200,2),
+(1,1351386000,3),
+(1,1364691600,2),
+(1,1382835600,3),
+(1,1396141200,2),
+(1,1414285200,3),
+(1,1427590800,2),
+(1,1445734800,3),
+(1,1459040400,2),
+(1,1477789200,3),
+(1,1490490000,2),
+(1,1509238800,3),
+(1,1521939600,2),
+(1,1540688400,3),
+(1,1553994000,2),
+(1,1572138000,3),
+(1,1585443600,2),
+(1,1603587600,3),
+(1,1616893200,2),
+(1,1635642000,3),
+(1,1648342800,2),
+(1,1667091600,3),
+(1,1679792400,2),
+(1,1698541200,3),
+(1,1711846800,2),
+(1,1729990800,3),
+(1,1743296400,2),
+(1,1761440400,3),
+(1,1774746000,2),
+(1,1792890000,3),
+(1,1806195600,2),
+(1,1824944400,3),
+(1,1837645200,2),
+(1,1856394000,3),
+(1,1869094800,2),
+(1,1887843600,3),
+(1,1901149200,2),
+(1,1919293200,3),
+(1,1932598800,2),
+(1,1950742800,3),
+(1,1964048400,2),
+(1,1982797200,3),
+(1,1995498000,2),
+(1,2014246800,3),
+(1,2026947600,2),
+(1,2045696400,3),
+(1,2058397200,2),
+(1,2077146000,3),
+(1,2090451600,2),
+(1,2108595600,3),
+(1,2121901200,2),
+(1,2140045200,3),
+(3,-1688265000,2),
+(3,-1656819048,1),
+(3,-1641353448,2),
+(3,-1627965048,3),
+(3,-1618716648,1),
+(3,-1596429048,3),
+(3,-1593829848,5),
+(3,-1589860800,4),
+(3,-1542427200,5),
+(3,-1539493200,6),
+(3,-1525323600,5),
+(3,-1522728000,4),
+(3,-1491188400,7),
+(3,-1247536800,4),
+(3,354920400,5),
+(3,370728000,4),
+(3,386456400,5),
+(3,402264000,4),
+(3,417992400,5),
+(3,433800000,4),
+(3,449614800,5),
+(3,465346800,8),
+(3,481071600,9),
+(3,496796400,8),
+(3,512521200,9),
+(3,528246000,8),
+(3,543970800,9),
+(3,559695600,8),
+(3,575420400,9),
+(3,591145200,8),
+(3,606870000,9),
+(3,622594800,8),
+(3,638319600,9),
+(3,654649200,8),
+(3,670374000,10),
+(3,686102400,11),
+(3,695779200,8),
+(3,701812800,5),
+(3,717534000,4),
+(3,733273200,9),
+(3,748998000,8),
+(3,764722800,9),
+(3,780447600,8),
+(3,796172400,9),
+(3,811897200,8),
+(3,828226800,9),
+(3,846370800,8),
+(3,859676400,9),
+(3,877820400,8),
+(3,891126000,9),
+(3,909270000,8),
+(3,922575600,9),
+(3,941324400,8),
+(3,954025200,9),
+(3,972774000,8),
+(3,985474800,9),
+(3,1004223600,8),
+(3,1017529200,9),
+(3,1035673200,8),
+(3,1048978800,9),
+(3,1067122800,8),
+(3,1080428400,9),
+(3,1099177200,8),
+(3,1111878000,9),
+(3,1130626800,8),
+(3,1143327600,9),
+(3,1162076400,8),
+(3,1174777200,9),
+(3,1193526000,8),
+(3,1206831600,9),
+(3,1224975600,8),
+(3,1238281200,9),
+(3,1256425200,8),
+(3,1269730800,9),
+(3,1288479600,8),
+(3,1301180400,9),
+(3,1319929200,8),
+(3,1332630000,9),
+(3,1351378800,8),
+(3,1364684400,9),
+(3,1382828400,8),
+(3,1396134000,9),
+(3,1414278000,8),
+(3,1427583600,9),
+(3,1445727600,8),
+(3,1459033200,9),
+(3,1477782000,8),
+(3,1490482800,9),
+(3,1509231600,8),
+(3,1521932400,9),
+(3,1540681200,8),
+(3,1553986800,9),
+(3,1572130800,8),
+(3,1585436400,9),
+(3,1603580400,8),
+(3,1616886000,9),
+(3,1635634800,8),
+(3,1648335600,9),
+(3,1667084400,8),
+(3,1679785200,9),
+(3,1698534000,8),
+(3,1711839600,9),
+(3,1729983600,8),
+(3,1743289200,9),
+(3,1761433200,8),
+(3,1774738800,9),
+(3,1792882800,8),
+(3,1806188400,9),
+(3,1824937200,8),
+(3,1837638000,9),
+(3,1856386800,8),
+(3,1869087600,9),
+(3,1887836400,8),
+(3,1901142000,9),
+(3,1919286000,8),
+(3,1932591600,9),
+(3,1950735600,8),
+(3,1964041200,9),
+(3,1982790000,8),
+(3,1995490800,9),
+(3,2014239600,8),
+(3,2026940400,9),
+(3,2045689200,8),
+(3,2058390000,9),
+(3,2077138800,8),
+(3,2090444400,9),
+(3,2108588400,8),
+(3,2121894000,9),
+(3,2140038000,8),
+(4,-1688265000,2),
+(4,-1656819048,1),
+(4,-1641353448,2),
+(4,-1627965048,3),
+(4,-1618716648,1),
+(4,-1596429048,3),
+(4,-1593829848,5),
+(4,-1589860800,4),
+(4,-1542427200,5),
+(4,-1539493200,6),
+(4,-1525323600,5),
+(4,-1522728000,4),
+(4,-1491188400,7),
+(4,-1247536800,4),
+(4,354920409,5),
+(4,370728010,4),
+(4,386456410,5),
+(4,402264011,4),
+(4,417992411,5),
+(4,433800012,4),
+(4,449614812,5),
+(4,465346812,8),
+(4,481071612,9),
+(4,496796413,8),
+(4,512521213,9),
+(4,528246013,8),
+(4,543970813,9),
+(4,559695613,8),
+(4,575420414,9),
+(4,591145214,8),
+(4,606870014,9),
+(4,622594814,8),
+(4,638319615,9),
+(4,654649215,8),
+(4,670374016,10),
+(4,686102416,11),
+(4,695779216,8),
+(4,701812816,5),
+(4,717534017,4),
+(4,733273217,9),
+(4,748998018,8),
+(4,764722818,9),
+(4,780447619,8),
+(4,796172419,9),
+(4,811897219,8),
+(4,828226820,9),
+(4,846370820,8),
+(4,859676420,9),
+(4,877820421,8),
+(4,891126021,9),
+(4,909270021,8),
+(4,922575622,9),
+(4,941324422,8),
+(4,954025222,9),
+(4,972774022,8),
+(4,985474822,9),
+(4,1004223622,8),
+(4,1017529222,9),
+(4,1035673222,8),
+(4,1048978822,9),
+(4,1067122822,8),
+(4,1080428422,9),
+(4,1099177222,8),
+(4,1111878022,9),
+(4,1130626822,8),
+(4,1143327622,9),
+(4,1162076422,8),
+(4,1174777222,9),
+(4,1193526022,8),
+(4,1206831622,9),
+(4,1224975622,8),
+(4,1238281222,9),
+(4,1256425222,8),
+(4,1269730822,9),
+(4,1288479622,8),
+(4,1301180422,9),
+(4,1319929222,8),
+(4,1332630022,9),
+(4,1351378822,8),
+(4,1364684422,9),
+(4,1382828422,8),
+(4,1396134022,9),
+(4,1414278022,8),
+(4,1427583622,9),
+(4,1445727622,8),
+(4,1459033222,9),
+(4,1477782022,8),
+(4,1490482822,9),
+(4,1509231622,8),
+(4,1521932422,9),
+(4,1540681222,8),
+(4,1553986822,9),
+(4,1572130822,8),
+(4,1585436422,9),
+(4,1603580422,8),
+(4,1616886022,9),
+(4,1635634822,8),
+(4,1648335622,9),
+(4,1667084422,8),
+(4,1679785222,9),
+(4,1698534022,8),
+(4,1711839622,9),
+(4,1729983622,8),
+(4,1743289222,9),
+(4,1761433222,8),
+(4,1774738822,9),
+(4,1792882822,8),
+(4,1806188422,9),
+(4,1824937222,8),
+(4,1837638022,9),
+(4,1856386822,8),
+(4,1869087622,9),
+(4,1887836422,8),
+(4,1901142022,9),
+(4,1919286022,8),
+(4,1932591622,9),
+(4,1950735622,8),
+(4,1964041222,9),
+(4,1982790022,8),
+(4,1995490822,9),
+(4,2014239622,8),
+(4,2026940422,9),
+(4,2045689222,8),
+(4,2058390022,9),
+(4,2077138822,8),
+(4,2090444422,9),
+(4,2108588422,8),
+(4,2121894022,9),
+(4,2140038022,8),
+(5,-1009875600,1);
/*!40000 ALTER TABLE `time_zone_transition` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `time_zone_transition_type` WRITE;
/*!40000 ALTER TABLE `time_zone_transition_type` DISABLE KEYS */;
-REPLACE INTO `time_zone_transition_type` VALUES (1,0,7200,1,'MEST'),(1,1,3600,0,'MET'),(1,2,7200,1,'MEST'),(1,3,3600,0,'MET'),(2,0,0,0,'UTC'),(3,0,9000,0,'MMT'),(3,1,12648,1,'MST'),(3,2,9048,0,'MMT'),(3,3,16248,1,'MDST'),(3,4,10800,0,'MSK'),(3,5,14400,1,'MSD'),(3,6,18000,1,'MSD'),(3,7,7200,0,'EET'),(3,8,10800,0,'MSK'),(3,9,14400,1,'MSD'),(3,10,10800,1,'EEST'),(3,11,7200,0,'EET'),(4,0,9000,0,'MMT'),(4,1,12648,1,'MST'),(4,2,9048,0,'MMT'),(4,3,16248,1,'MDST'),(4,4,10800,0,'MSK'),(4,5,14400,1,'MSD'),(4,6,18000,1,'MSD'),(4,7,7200,0,'EET'),(4,8,10800,0,'MSK'),(4,9,14400,1,'MSD'),(4,10,10800,1,'EEST'),(4,11,7200,0,'EET'),(5,0,32400,0,'CJT'),(5,1,32400,0,'JST');
+REPLACE INTO `time_zone_transition_type` VALUES
+(1,0,7200,1,'MEST'),
+(1,1,3600,0,'MET'),
+(1,2,7200,1,'MEST'),
+(1,3,3600,0,'MET'),
+(2,0,0,0,'UTC'),
+(3,0,9000,0,'MMT'),
+(3,1,12648,1,'MST'),
+(3,2,9048,0,'MMT'),
+(3,3,16248,1,'MDST'),
+(3,4,10800,0,'MSK'),
+(3,5,14400,1,'MSD'),
+(3,6,18000,1,'MSD'),
+(3,7,7200,0,'EET'),
+(3,8,10800,0,'MSK'),
+(3,9,14400,1,'MSD'),
+(3,10,10800,1,'EEST'),
+(3,11,7200,0,'EET'),
+(4,0,9000,0,'MMT'),
+(4,1,12648,1,'MST'),
+(4,2,9048,0,'MMT'),
+(4,3,16248,1,'MDST'),
+(4,4,10800,0,'MSK'),
+(4,5,14400,1,'MSD'),
+(4,6,18000,1,'MSD'),
+(4,7,7200,0,'EET'),
+(4,8,10800,0,'MSK'),
+(4,9,14400,1,'MSD'),
+(4,10,10800,1,'EEST'),
+(4,11,7200,0,'EET'),
+(5,0,32400,0,'CJT'),
+(5,1,32400,0,'JST');
/*!40000 ALTER TABLE `time_zone_transition_type` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -368,31 +1298,39 @@ USE mysql;
LOCK TABLES `column_stats` WRITE;
/*!40000 ALTER TABLE `column_stats` DISABLE KEYS */;
-INSERT IGNORE INTO `column_stats` VALUES ('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\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\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿');
+INSERT IGNORE INTO `column_stats` VALUES
+('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,254,'DOUBLE_PREC_HB','\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\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿');
/*!40000 ALTER TABLE `column_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `index_stats` WRITE;
/*!40000 ALTER TABLE `index_stats` DISABLE KEYS */;
-INSERT IGNORE INTO `index_stats` VALUES ('mysql','tz','PRIMARY',1,98.2500);
+INSERT IGNORE INTO `index_stats` VALUES
+('mysql','tz','PRIMARY',1,98.2500);
/*!40000 ALTER TABLE `index_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `table_stats` WRITE;
/*!40000 ALTER TABLE `table_stats` DISABLE KEYS */;
-INSERT IGNORE INTO `table_stats` VALUES ('mysql','tz',393);
+INSERT IGNORE INTO `table_stats` VALUES
+('mysql','tz',393);
/*!40000 ALTER TABLE `table_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `innodb_index_stats` WRITE;
/*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */;
-INSERT IGNORE INTO `innodb_index_stats` VALUES ('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index');
+INSERT IGNORE INTO `innodb_index_stats` VALUES
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index');
/*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `innodb_table_stats` WRITE;
/*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */;
-INSERT IGNORE INTO `innodb_table_stats` VALUES ('mysql','tz','2019-12-31 21:00:00',393,1,0);
+INSERT IGNORE INTO `innodb_table_stats` VALUES
+('mysql','tz','2019-12-31 21:00:00',393,1,0);
/*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */;
UNLOCK TABLES;
@@ -400,31 +1338,488 @@ USE mysql;
LOCK TABLES `time_zone` WRITE;
/*!40000 ALTER TABLE `time_zone` DISABLE KEYS */;
-INSERT IGNORE INTO `time_zone` VALUES (1,'N'),(2,'N'),(3,'N'),(4,'Y'),(5,'N');
+INSERT IGNORE INTO `time_zone` VALUES
+(1,'N'),
+(2,'N'),
+(3,'N'),
+(4,'Y'),
+(5,'N');
/*!40000 ALTER TABLE `time_zone` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `time_zone_name` WRITE;
/*!40000 ALTER TABLE `time_zone_name` DISABLE KEYS */;
-INSERT IGNORE INTO `time_zone_name` VALUES ('Europe/Moscow',3),('Japan',5),('leap/Europe/Moscow',4),('MET',1),('Universal',2),('UTC',2);
+INSERT IGNORE INTO `time_zone_name` VALUES
+('Europe/Moscow',3),
+('Japan',5),
+('leap/Europe/Moscow',4),
+('MET',1),
+('Universal',2),
+('UTC',2);
/*!40000 ALTER TABLE `time_zone_name` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `time_zone_leap_second` WRITE;
/*!40000 ALTER TABLE `time_zone_leap_second` DISABLE KEYS */;
-INSERT IGNORE INTO `time_zone_leap_second` VALUES (78796800,1),(94694401,2),(126230402,3),(157766403,4),(189302404,5),(220924805,6),(252460806,7),(283996807,8),(315532808,9),(362793609,10),(394329610,11),(425865611,12),(489024012,13),(567993613,14),(631152014,15),(662688015,16),(709948816,17),(741484817,18),(773020818,19),(820454419,20),(867715220,21),(915148821,22);
+INSERT IGNORE INTO `time_zone_leap_second` VALUES
+(78796800,1),
+(94694401,2),
+(126230402,3),
+(157766403,4),
+(189302404,5),
+(220924805,6),
+(252460806,7),
+(283996807,8),
+(315532808,9),
+(362793609,10),
+(394329610,11),
+(425865611,12),
+(489024012,13),
+(567993613,14),
+(631152014,15),
+(662688015,16),
+(709948816,17),
+(741484817,18),
+(773020818,19),
+(820454419,20),
+(867715220,21),
+(915148821,22);
/*!40000 ALTER TABLE `time_zone_leap_second` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `time_zone_transition` WRITE;
/*!40000 ALTER TABLE `time_zone_transition` DISABLE KEYS */;
-INSERT IGNORE INTO `time_zone_transition` VALUES (1,-1693706400,0),(1,-1680483600,1),(1,-1663455600,2),(1,-1650150000,3),(1,-1632006000,2),(1,-1618700400,3),(1,-938905200,2),(1,-857257200,3),(1,-844556400,2),(1,-828226800,3),(1,-812502000,2),(1,-796777200,3),(1,228877200,2),(1,243997200,3),(1,260326800,2),(1,276051600,3),(1,291776400,2),(1,307501200,3),(1,323830800,2),(1,338950800,3),(1,354675600,2),(1,370400400,3),(1,386125200,2),(1,401850000,3),(1,417574800,2),(1,433299600,3),(1,449024400,2),(1,465354000,3),(1,481078800,2),(1,496803600,3),(1,512528400,2),(1,528253200,3),(1,543978000,2),(1,559702800,3),(1,575427600,2),(1,591152400,3),(1,606877200,2),(1,622602000,3),(1,638326800,2),(1,654656400,3),(1,670381200,2),(1,686106000,3),(1,701830800,2),(1,717555600,3),(1,733280400,2),(1,749005200,3),(1,764730000,2),(1,780454800,3),(1,796179600,2),(1,811904400,3),(1,828234000,2),(1,846378000,3),(1,859683600,2),(1,877827600,3),(1,891133200,2),(1,909277200,3),(1,922582800,2),(1,941331600,3),(1,954032400,2),(1,972781200,3),(1,985482000,2),(1,1004230800,3),(1,1017536400,2),(1,1035680400,3),(1,1048986000,2),(1,1067130000,3),(1,1080435600,2),(1,1099184400,3),(1,1111885200,2),(1,1130634000,3),(1,1143334800,2),(1,1162083600,3),(1,1174784400,2),(1,1193533200,3),(1,1206838800,2),(1,1224982800,3),(1,1238288400,2),(1,1256432400,3),(1,1269738000,2),(1,1288486800,3),(1,1301187600,2),(1,1319936400,3),(1,1332637200,2),(1,1351386000,3),(1,1364691600,2),(1,1382835600,3),(1,1396141200,2),(1,1414285200,3),(1,1427590800,2),(1,1445734800,3),(1,1459040400,2),(1,1477789200,3),(1,1490490000,2),(1,1509238800,3),(1,1521939600,2),(1,1540688400,3),(1,1553994000,2),(1,1572138000,3),(1,1585443600,2),(1,1603587600,3),(1,1616893200,2),(1,1635642000,3),(1,1648342800,2),(1,1667091600,3),(1,1679792400,2),(1,1698541200,3),(1,1711846800,2),(1,1729990800,3),(1,1743296400,2),(1,1761440400,3),(1,1774746000,2),(1,1792890000,3),(1,1806195600,2),(1,1824944400,3),(1,1837645200,2),(1,1856394000,3),(1,1869094800,2),(1,1887843600,3),(1,1901149200,2),(1,1919293200,3),(1,1932598800,2),(1,1950742800,3),(1,1964048400,2),(1,1982797200,3),(1,1995498000,2),(1,2014246800,3),(1,2026947600,2),(1,2045696400,3),(1,2058397200,2),(1,2077146000,3),(1,2090451600,2),(1,2108595600,3),(1,2121901200,2),(1,2140045200,3),(3,-1688265000,2),(3,-1656819048,1),(3,-1641353448,2),(3,-1627965048,3),(3,-1618716648,1),(3,-1596429048,3),(3,-1593829848,5),(3,-1589860800,4),(3,-1542427200,5),(3,-1539493200,6),(3,-1525323600,5),(3,-1522728000,4),(3,-1491188400,7),(3,-1247536800,4),(3,354920400,5),(3,370728000,4),(3,386456400,5),(3,402264000,4),(3,417992400,5),(3,433800000,4),(3,449614800,5),(3,465346800,8),(3,481071600,9),(3,496796400,8),(3,512521200,9),(3,528246000,8),(3,543970800,9),(3,559695600,8),(3,575420400,9),(3,591145200,8),(3,606870000,9),(3,622594800,8),(3,638319600,9),(3,654649200,8),(3,670374000,10),(3,686102400,11),(3,695779200,8),(3,701812800,5),(3,717534000,4),(3,733273200,9),(3,748998000,8),(3,764722800,9),(3,780447600,8),(3,796172400,9),(3,811897200,8),(3,828226800,9),(3,846370800,8),(3,859676400,9),(3,877820400,8),(3,891126000,9),(3,909270000,8),(3,922575600,9),(3,941324400,8),(3,954025200,9),(3,972774000,8),(3,985474800,9),(3,1004223600,8),(3,1017529200,9),(3,1035673200,8),(3,1048978800,9),(3,1067122800,8),(3,1080428400,9),(3,1099177200,8),(3,1111878000,9),(3,1130626800,8),(3,1143327600,9),(3,1162076400,8),(3,1174777200,9),(3,1193526000,8),(3,1206831600,9),(3,1224975600,8),(3,1238281200,9),(3,1256425200,8),(3,1269730800,9),(3,1288479600,8),(3,1301180400,9),(3,1319929200,8),(3,1332630000,9),(3,1351378800,8),(3,1364684400,9),(3,1382828400,8),(3,1396134000,9),(3,1414278000,8),(3,1427583600,9),(3,1445727600,8),(3,1459033200,9),(3,1477782000,8),(3,1490482800,9),(3,1509231600,8),(3,1521932400,9),(3,1540681200,8),(3,1553986800,9),(3,1572130800,8),(3,1585436400,9),(3,1603580400,8),(3,1616886000,9),(3,1635634800,8),(3,1648335600,9),(3,1667084400,8),(3,1679785200,9),(3,1698534000,8),(3,1711839600,9),(3,1729983600,8),(3,1743289200,9),(3,1761433200,8),(3,1774738800,9),(3,1792882800,8),(3,1806188400,9),(3,1824937200,8),(3,1837638000,9),(3,1856386800,8),(3,1869087600,9),(3,1887836400,8),(3,1901142000,9),(3,1919286000,8),(3,1932591600,9),(3,1950735600,8),(3,1964041200,9),(3,1982790000,8),(3,1995490800,9),(3,2014239600,8),(3,2026940400,9),(3,2045689200,8),(3,2058390000,9),(3,2077138800,8),(3,2090444400,9),(3,2108588400,8),(3,2121894000,9),(3,2140038000,8),(4,-1688265000,2),(4,-1656819048,1),(4,-1641353448,2),(4,-1627965048,3),(4,-1618716648,1),(4,-1596429048,3),(4,-1593829848,5),(4,-1589860800,4),(4,-1542427200,5),(4,-1539493200,6),(4,-1525323600,5),(4,-1522728000,4),(4,-1491188400,7),(4,-1247536800,4),(4,354920409,5),(4,370728010,4),(4,386456410,5),(4,402264011,4),(4,417992411,5),(4,433800012,4),(4,449614812,5),(4,465346812,8),(4,481071612,9),(4,496796413,8),(4,512521213,9),(4,528246013,8),(4,543970813,9),(4,559695613,8),(4,575420414,9),(4,591145214,8),(4,606870014,9),(4,622594814,8),(4,638319615,9),(4,654649215,8),(4,670374016,10),(4,686102416,11),(4,695779216,8),(4,701812816,5),(4,717534017,4),(4,733273217,9),(4,748998018,8),(4,764722818,9),(4,780447619,8),(4,796172419,9),(4,811897219,8),(4,828226820,9),(4,846370820,8),(4,859676420,9),(4,877820421,8),(4,891126021,9),(4,909270021,8),(4,922575622,9),(4,941324422,8),(4,954025222,9),(4,972774022,8),(4,985474822,9),(4,1004223622,8),(4,1017529222,9),(4,1035673222,8),(4,1048978822,9),(4,1067122822,8),(4,1080428422,9),(4,1099177222,8),(4,1111878022,9),(4,1130626822,8),(4,1143327622,9),(4,1162076422,8),(4,1174777222,9),(4,1193526022,8),(4,1206831622,9),(4,1224975622,8),(4,1238281222,9),(4,1256425222,8),(4,1269730822,9),(4,1288479622,8),(4,1301180422,9),(4,1319929222,8),(4,1332630022,9),(4,1351378822,8),(4,1364684422,9),(4,1382828422,8),(4,1396134022,9),(4,1414278022,8),(4,1427583622,9),(4,1445727622,8),(4,1459033222,9),(4,1477782022,8),(4,1490482822,9),(4,1509231622,8),(4,1521932422,9),(4,1540681222,8),(4,1553986822,9),(4,1572130822,8),(4,1585436422,9),(4,1603580422,8),(4,1616886022,9),(4,1635634822,8),(4,1648335622,9),(4,1667084422,8),(4,1679785222,9),(4,1698534022,8),(4,1711839622,9),(4,1729983622,8),(4,1743289222,9),(4,1761433222,8),(4,1774738822,9),(4,1792882822,8),(4,1806188422,9),(4,1824937222,8),(4,1837638022,9),(4,1856386822,8),(4,1869087622,9),(4,1887836422,8),(4,1901142022,9),(4,1919286022,8),(4,1932591622,9),(4,1950735622,8),(4,1964041222,9),(4,1982790022,8),(4,1995490822,9),(4,2014239622,8),(4,2026940422,9),(4,2045689222,8),(4,2058390022,9),(4,2077138822,8),(4,2090444422,9),(4,2108588422,8),(4,2121894022,9),(4,2140038022,8),(5,-1009875600,1);
+INSERT IGNORE INTO `time_zone_transition` VALUES
+(1,-1693706400,0),
+(1,-1680483600,1),
+(1,-1663455600,2),
+(1,-1650150000,3),
+(1,-1632006000,2),
+(1,-1618700400,3),
+(1,-938905200,2),
+(1,-857257200,3),
+(1,-844556400,2),
+(1,-828226800,3),
+(1,-812502000,2),
+(1,-796777200,3),
+(1,228877200,2),
+(1,243997200,3),
+(1,260326800,2),
+(1,276051600,3),
+(1,291776400,2),
+(1,307501200,3),
+(1,323830800,2),
+(1,338950800,3),
+(1,354675600,2),
+(1,370400400,3),
+(1,386125200,2),
+(1,401850000,3),
+(1,417574800,2),
+(1,433299600,3),
+(1,449024400,2),
+(1,465354000,3),
+(1,481078800,2),
+(1,496803600,3),
+(1,512528400,2),
+(1,528253200,3),
+(1,543978000,2),
+(1,559702800,3),
+(1,575427600,2),
+(1,591152400,3),
+(1,606877200,2),
+(1,622602000,3),
+(1,638326800,2),
+(1,654656400,3),
+(1,670381200,2),
+(1,686106000,3),
+(1,701830800,2),
+(1,717555600,3),
+(1,733280400,2),
+(1,749005200,3),
+(1,764730000,2),
+(1,780454800,3),
+(1,796179600,2),
+(1,811904400,3),
+(1,828234000,2),
+(1,846378000,3),
+(1,859683600,2),
+(1,877827600,3),
+(1,891133200,2),
+(1,909277200,3),
+(1,922582800,2),
+(1,941331600,3),
+(1,954032400,2),
+(1,972781200,3),
+(1,985482000,2),
+(1,1004230800,3),
+(1,1017536400,2),
+(1,1035680400,3),
+(1,1048986000,2),
+(1,1067130000,3),
+(1,1080435600,2),
+(1,1099184400,3),
+(1,1111885200,2),
+(1,1130634000,3),
+(1,1143334800,2),
+(1,1162083600,3),
+(1,1174784400,2),
+(1,1193533200,3),
+(1,1206838800,2),
+(1,1224982800,3),
+(1,1238288400,2),
+(1,1256432400,3),
+(1,1269738000,2),
+(1,1288486800,3),
+(1,1301187600,2),
+(1,1319936400,3),
+(1,1332637200,2),
+(1,1351386000,3),
+(1,1364691600,2),
+(1,1382835600,3),
+(1,1396141200,2),
+(1,1414285200,3),
+(1,1427590800,2),
+(1,1445734800,3),
+(1,1459040400,2),
+(1,1477789200,3),
+(1,1490490000,2),
+(1,1509238800,3),
+(1,1521939600,2),
+(1,1540688400,3),
+(1,1553994000,2),
+(1,1572138000,3),
+(1,1585443600,2),
+(1,1603587600,3),
+(1,1616893200,2),
+(1,1635642000,3),
+(1,1648342800,2),
+(1,1667091600,3),
+(1,1679792400,2),
+(1,1698541200,3),
+(1,1711846800,2),
+(1,1729990800,3),
+(1,1743296400,2),
+(1,1761440400,3),
+(1,1774746000,2),
+(1,1792890000,3),
+(1,1806195600,2),
+(1,1824944400,3),
+(1,1837645200,2),
+(1,1856394000,3),
+(1,1869094800,2),
+(1,1887843600,3),
+(1,1901149200,2),
+(1,1919293200,3),
+(1,1932598800,2),
+(1,1950742800,3),
+(1,1964048400,2),
+(1,1982797200,3),
+(1,1995498000,2),
+(1,2014246800,3),
+(1,2026947600,2),
+(1,2045696400,3),
+(1,2058397200,2),
+(1,2077146000,3),
+(1,2090451600,2),
+(1,2108595600,3),
+(1,2121901200,2),
+(1,2140045200,3),
+(3,-1688265000,2),
+(3,-1656819048,1),
+(3,-1641353448,2),
+(3,-1627965048,3),
+(3,-1618716648,1),
+(3,-1596429048,3),
+(3,-1593829848,5),
+(3,-1589860800,4),
+(3,-1542427200,5),
+(3,-1539493200,6),
+(3,-1525323600,5),
+(3,-1522728000,4),
+(3,-1491188400,7),
+(3,-1247536800,4),
+(3,354920400,5),
+(3,370728000,4),
+(3,386456400,5),
+(3,402264000,4),
+(3,417992400,5),
+(3,433800000,4),
+(3,449614800,5),
+(3,465346800,8),
+(3,481071600,9),
+(3,496796400,8),
+(3,512521200,9),
+(3,528246000,8),
+(3,543970800,9),
+(3,559695600,8),
+(3,575420400,9),
+(3,591145200,8),
+(3,606870000,9),
+(3,622594800,8),
+(3,638319600,9),
+(3,654649200,8),
+(3,670374000,10),
+(3,686102400,11),
+(3,695779200,8),
+(3,701812800,5),
+(3,717534000,4),
+(3,733273200,9),
+(3,748998000,8),
+(3,764722800,9),
+(3,780447600,8),
+(3,796172400,9),
+(3,811897200,8),
+(3,828226800,9),
+(3,846370800,8),
+(3,859676400,9),
+(3,877820400,8),
+(3,891126000,9),
+(3,909270000,8),
+(3,922575600,9),
+(3,941324400,8),
+(3,954025200,9),
+(3,972774000,8),
+(3,985474800,9),
+(3,1004223600,8),
+(3,1017529200,9),
+(3,1035673200,8),
+(3,1048978800,9),
+(3,1067122800,8),
+(3,1080428400,9),
+(3,1099177200,8),
+(3,1111878000,9),
+(3,1130626800,8),
+(3,1143327600,9),
+(3,1162076400,8),
+(3,1174777200,9),
+(3,1193526000,8),
+(3,1206831600,9),
+(3,1224975600,8),
+(3,1238281200,9),
+(3,1256425200,8),
+(3,1269730800,9),
+(3,1288479600,8),
+(3,1301180400,9),
+(3,1319929200,8),
+(3,1332630000,9),
+(3,1351378800,8),
+(3,1364684400,9),
+(3,1382828400,8),
+(3,1396134000,9),
+(3,1414278000,8),
+(3,1427583600,9),
+(3,1445727600,8),
+(3,1459033200,9),
+(3,1477782000,8),
+(3,1490482800,9),
+(3,1509231600,8),
+(3,1521932400,9),
+(3,1540681200,8),
+(3,1553986800,9),
+(3,1572130800,8),
+(3,1585436400,9),
+(3,1603580400,8),
+(3,1616886000,9),
+(3,1635634800,8),
+(3,1648335600,9),
+(3,1667084400,8),
+(3,1679785200,9),
+(3,1698534000,8),
+(3,1711839600,9),
+(3,1729983600,8),
+(3,1743289200,9),
+(3,1761433200,8),
+(3,1774738800,9),
+(3,1792882800,8),
+(3,1806188400,9),
+(3,1824937200,8),
+(3,1837638000,9),
+(3,1856386800,8),
+(3,1869087600,9),
+(3,1887836400,8),
+(3,1901142000,9),
+(3,1919286000,8),
+(3,1932591600,9),
+(3,1950735600,8),
+(3,1964041200,9),
+(3,1982790000,8),
+(3,1995490800,9),
+(3,2014239600,8),
+(3,2026940400,9),
+(3,2045689200,8),
+(3,2058390000,9),
+(3,2077138800,8),
+(3,2090444400,9),
+(3,2108588400,8),
+(3,2121894000,9),
+(3,2140038000,8),
+(4,-1688265000,2),
+(4,-1656819048,1),
+(4,-1641353448,2),
+(4,-1627965048,3),
+(4,-1618716648,1),
+(4,-1596429048,3),
+(4,-1593829848,5),
+(4,-1589860800,4),
+(4,-1542427200,5),
+(4,-1539493200,6),
+(4,-1525323600,5),
+(4,-1522728000,4),
+(4,-1491188400,7),
+(4,-1247536800,4),
+(4,354920409,5),
+(4,370728010,4),
+(4,386456410,5),
+(4,402264011,4),
+(4,417992411,5),
+(4,433800012,4),
+(4,449614812,5),
+(4,465346812,8),
+(4,481071612,9),
+(4,496796413,8),
+(4,512521213,9),
+(4,528246013,8),
+(4,543970813,9),
+(4,559695613,8),
+(4,575420414,9),
+(4,591145214,8),
+(4,606870014,9),
+(4,622594814,8),
+(4,638319615,9),
+(4,654649215,8),
+(4,670374016,10),
+(4,686102416,11),
+(4,695779216,8),
+(4,701812816,5),
+(4,717534017,4),
+(4,733273217,9),
+(4,748998018,8),
+(4,764722818,9),
+(4,780447619,8),
+(4,796172419,9),
+(4,811897219,8),
+(4,828226820,9),
+(4,846370820,8),
+(4,859676420,9),
+(4,877820421,8),
+(4,891126021,9),
+(4,909270021,8),
+(4,922575622,9),
+(4,941324422,8),
+(4,954025222,9),
+(4,972774022,8),
+(4,985474822,9),
+(4,1004223622,8),
+(4,1017529222,9),
+(4,1035673222,8),
+(4,1048978822,9),
+(4,1067122822,8),
+(4,1080428422,9),
+(4,1099177222,8),
+(4,1111878022,9),
+(4,1130626822,8),
+(4,1143327622,9),
+(4,1162076422,8),
+(4,1174777222,9),
+(4,1193526022,8),
+(4,1206831622,9),
+(4,1224975622,8),
+(4,1238281222,9),
+(4,1256425222,8),
+(4,1269730822,9),
+(4,1288479622,8),
+(4,1301180422,9),
+(4,1319929222,8),
+(4,1332630022,9),
+(4,1351378822,8),
+(4,1364684422,9),
+(4,1382828422,8),
+(4,1396134022,9),
+(4,1414278022,8),
+(4,1427583622,9),
+(4,1445727622,8),
+(4,1459033222,9),
+(4,1477782022,8),
+(4,1490482822,9),
+(4,1509231622,8),
+(4,1521932422,9),
+(4,1540681222,8),
+(4,1553986822,9),
+(4,1572130822,8),
+(4,1585436422,9),
+(4,1603580422,8),
+(4,1616886022,9),
+(4,1635634822,8),
+(4,1648335622,9),
+(4,1667084422,8),
+(4,1679785222,9),
+(4,1698534022,8),
+(4,1711839622,9),
+(4,1729983622,8),
+(4,1743289222,9),
+(4,1761433222,8),
+(4,1774738822,9),
+(4,1792882822,8),
+(4,1806188422,9),
+(4,1824937222,8),
+(4,1837638022,9),
+(4,1856386822,8),
+(4,1869087622,9),
+(4,1887836422,8),
+(4,1901142022,9),
+(4,1919286022,8),
+(4,1932591622,9),
+(4,1950735622,8),
+(4,1964041222,9),
+(4,1982790022,8),
+(4,1995490822,9),
+(4,2014239622,8),
+(4,2026940422,9),
+(4,2045689222,8),
+(4,2058390022,9),
+(4,2077138822,8),
+(4,2090444422,9),
+(4,2108588422,8),
+(4,2121894022,9),
+(4,2140038022,8),
+(5,-1009875600,1);
/*!40000 ALTER TABLE `time_zone_transition` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `time_zone_transition_type` WRITE;
/*!40000 ALTER TABLE `time_zone_transition_type` DISABLE KEYS */;
-INSERT IGNORE INTO `time_zone_transition_type` VALUES (1,0,7200,1,'MEST'),(1,1,3600,0,'MET'),(1,2,7200,1,'MEST'),(1,3,3600,0,'MET'),(2,0,0,0,'UTC'),(3,0,9000,0,'MMT'),(3,1,12648,1,'MST'),(3,2,9048,0,'MMT'),(3,3,16248,1,'MDST'),(3,4,10800,0,'MSK'),(3,5,14400,1,'MSD'),(3,6,18000,1,'MSD'),(3,7,7200,0,'EET'),(3,8,10800,0,'MSK'),(3,9,14400,1,'MSD'),(3,10,10800,1,'EEST'),(3,11,7200,0,'EET'),(4,0,9000,0,'MMT'),(4,1,12648,1,'MST'),(4,2,9048,0,'MMT'),(4,3,16248,1,'MDST'),(4,4,10800,0,'MSK'),(4,5,14400,1,'MSD'),(4,6,18000,1,'MSD'),(4,7,7200,0,'EET'),(4,8,10800,0,'MSK'),(4,9,14400,1,'MSD'),(4,10,10800,1,'EEST'),(4,11,7200,0,'EET'),(5,0,32400,0,'CJT'),(5,1,32400,0,'JST');
+INSERT IGNORE INTO `time_zone_transition_type` VALUES
+(1,0,7200,1,'MEST'),
+(1,1,3600,0,'MET'),
+(1,2,7200,1,'MEST'),
+(1,3,3600,0,'MET'),
+(2,0,0,0,'UTC'),
+(3,0,9000,0,'MMT'),
+(3,1,12648,1,'MST'),
+(3,2,9048,0,'MMT'),
+(3,3,16248,1,'MDST'),
+(3,4,10800,0,'MSK'),
+(3,5,14400,1,'MSD'),
+(3,6,18000,1,'MSD'),
+(3,7,7200,0,'EET'),
+(3,8,10800,0,'MSK'),
+(3,9,14400,1,'MSD'),
+(3,10,10800,1,'EEST'),
+(3,11,7200,0,'EET'),
+(4,0,9000,0,'MMT'),
+(4,1,12648,1,'MST'),
+(4,2,9048,0,'MMT'),
+(4,3,16248,1,'MDST'),
+(4,4,10800,0,'MSK'),
+(4,5,14400,1,'MSD'),
+(4,6,18000,1,'MSD'),
+(4,7,7200,0,'EET'),
+(4,8,10800,0,'MSK'),
+(4,9,14400,1,'MSD'),
+(4,10,10800,1,'EEST'),
+(4,11,7200,0,'EET'),
+(5,0,32400,0,'CJT'),
+(5,1,32400,0,'JST');
/*!40000 ALTER TABLE `time_zone_transition_type` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
diff --git a/mysql-test/main/mysqldump-utf8mb4.result b/mysql-test/main/mysqldump-utf8mb4.result
index 50c23c5efa9..904771302f8 100644
--- a/mysql-test/main/mysqldump-utf8mb4.result
+++ b/mysql-test/main/mysqldump-utf8mb4.result
@@ -56,7 +56,8 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES ('01f300','🌀','U+1F300 CYCLONE');
+INSERT INTO `t1` VALUES
+('01f300','🌀','U+1F300 CYCLONE');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
diff --git a/mysql-test/main/mysqldump.result b/mysql-test/main/mysqldump.result
index ed94dcaa7d4..1b4c8775448 100644
--- a/mysql-test/main/mysqldump.result
+++ b/mysql-test/main/mysqldump.result
@@ -37,7 +37,9 @@ CREATE TABLE `t1` (
`a` decimal(64,20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1234567890123456789012345678901234567890.00000000000000000000),(987654321098765432109876543210987654321.00000000000000000000);
+INSERT INTO `t1` VALUES
+(1234567890123456789012345678901234567890.00000000000000000000),
+(987654321098765432109876543210987654321.00000000000000000000);
DROP TABLE t1;
#
# Bug#2055 mysqldump should replace "-inf" numeric field values with "NULL"
@@ -52,7 +54,8 @@ CREATE TABLE `t1` (
`a` double DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (-1.7976931348623157e308);
+INSERT INTO `t1` VALUES
+(-1.7976931348623157e308);
DROP TABLE t1;
#
# Bug#3361 mysqldump quotes DECIMAL values inconsistently
@@ -74,7 +77,12 @@ CREATE TABLE `t1` (
`b` float DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456);
+INSERT INTO `t1` VALUES
+(1.23450,2.3456),
+(1.23450,2.3456),
+(1.23450,2.3456),
+(1.23450,2.3456),
+(1.23450,2.3456);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` (
@@ -82,7 +90,12 @@ CREATE TABLE `t1` (
`b` float DEFAULT NULL
);
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456);
+INSERT INTO `t1` VALUES
+(1.23450,2.3456),
+(1.23450,2.3456),
+(1.23450,2.3456),
+(1.23450,2.3456),
+(1.23450,2.3456);
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -105,7 +118,12 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456);
+INSERT INTO `t1` VALUES
+(1.23450,2.3456),
+(1.23450,2.3456),
+(1.23450,2.3456),
+(1.23450,2.3456),
+(1.23450,2.3456);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -132,7 +150,12 @@ CREATE TABLE `t1` (
);
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456);
+INSERT INTO `t1` VALUES
+(1.23450,2.3456),
+(1.23450,2.3456),
+(1.23450,2.3456),
+(1.23450,2.3456),
+(1.23450,2.3456);
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -248,7 +271,9 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (1),(2);
+INSERT INTO `t1` VALUES
+(1),
+(2);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -271,7 +296,9 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (1),(2);
+INSERT INTO `t1` VALUES
+(1),
+(2);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -534,7 +561,8 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES ('ÄÖÜß');
+INSERT INTO `t1` VALUES
+('ÄÖÜß');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -567,7 +595,8 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES ('Ž™šá');
+INSERT INTO `t1` VALUES
+('Ž™šá');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -590,7 +619,8 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES ('Ž™šá');
+INSERT INTO `t1` VALUES
+('Ž™šá');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -613,7 +643,8 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES ('ÄÖÜß');
+INSERT INTO `t1` VALUES
+('ÄÖÜß');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -652,7 +683,10 @@ CREATE TABLE `t2` (
LOCK TABLES `t2` WRITE;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
-INSERT INTO `t2` VALUES (4),(5),(6);
+INSERT INTO `t2` VALUES
+(4),
+(5),
+(6);
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -734,7 +768,13 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
+INSERT IGNORE INTO `t1` VALUES
+(1),
+(2),
+(3),
+(4),
+(5),
+(6);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -767,7 +807,13 @@ CREATE TABLE `t1` (
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
+INSERT DELAYED IGNORE INTO `t1` VALUES
+(1),
+(2),
+(3),
+(4),
+(5),
+(6);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -1512,7 +1558,10 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (1),(2),(3);
+INSERT INTO `t1` VALUES
+(1),
+(2),
+(3);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -1731,13 +1780,20 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (NULL),(10),(20);
+INSERT INTO `t1` VALUES
+(NULL),
+(10),
+(20);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `t2` WRITE;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
-INSERT INTO `t2` VALUES (1,NULL,NULL,NULL,NULL,NULL),(2,10,NULL,NULL,NULL,NULL),(3,NULL,'twenty',NULL,NULL,NULL),(4,30,'thirty',NULL,NULL,NULL);
+INSERT INTO `t2` VALUES
+(1,NULL,NULL,NULL,NULL,NULL),
+(2,10,NULL,NULL,NULL,NULL),
+(3,NULL,'twenty',NULL,NULL,NULL),
+(4,30,'thirty',NULL,NULL,NULL);
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -1770,7 +1826,10 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (NULL),(10),(20);
+INSERT INTO `t1` VALUES
+(NULL),
+(10),
+(20);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `t2`;
@@ -1789,7 +1848,11 @@ CREATE TABLE `t2` (
LOCK TABLES `t2` WRITE;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
-INSERT INTO `t2` VALUES (1,NULL,NULL,NULL,NULL,NULL),(2,10,NULL,NULL,NULL,NULL),(3,NULL,'twenty',NULL,NULL,NULL),(4,30,'thirty',NULL,NULL,NULL);
+INSERT INTO `t2` VALUES
+(1,NULL,NULL,NULL,NULL,NULL),
+(2,10,NULL,NULL,NULL,NULL),
+(3,NULL,'twenty',NULL,NULL,NULL),
+(4,30,'thirty',NULL,NULL,NULL);
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -1975,7 +2038,8 @@ CREATE TABLE "t1" (
LOCK TABLES "t1" WRITE;
/*!40000 ALTER TABLE "t1" DISABLE KEYS */;
-INSERT INTO "t1" VALUES (815,4711,2006);
+INSERT INTO "t1" VALUES
+(815,4711,2006);
/*!40000 ALTER TABLE "t1" ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -2009,7 +2073,8 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (815,4711,2006);
+INSERT INTO `t1` VALUES
+(815,4711,2006);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -2061,7 +2126,12 @@ CREATE TABLE `t2` (
LOCK TABLES `t2` WRITE;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
-INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon');
+INSERT INTO `t2` VALUES
+('alfred'),
+('angie'),
+('bingo'),
+('waffle'),
+('lemon');
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `v2`;
@@ -2229,7 +2299,12 @@ CREATE TABLE `t2` (
LOCK TABLES `t2` WRITE;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
-INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon');
+INSERT INTO `t2` VALUES
+('alfred'),
+('angie'),
+('bingo'),
+('waffle'),
+('lemon');
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `v2`;
@@ -2295,7 +2370,8 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES ('\'');
+INSERT INTO `t1` VALUES
+('\'');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -2343,7 +2419,10 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (1,2,'one'),(2,4,'two'),(3,6,'three');
+INSERT INTO `t1` VALUES
+(1,2,'one'),
+(2,4,'two'),
+(3,6,'three');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `v1`;
@@ -2501,7 +2580,11 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (1,NULL),(2,NULL),(4,NULL),(11,NULL);
+INSERT INTO `t1` VALUES
+(1,NULL),
+(2,NULL),
+(4,NULL),
+(11,NULL);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
@@ -2630,7 +2713,11 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (1,NULL),(2,NULL),(4,NULL),(11,NULL);
+INSERT INTO `t1` VALUES
+(1,NULL),
+(2,NULL),
+(4,NULL),
+(11,NULL);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `t2`;
@@ -2776,7 +2863,12 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (1),(2),(3),(4),(5);
+INSERT INTO `t1` VALUES
+(1),
+(2),
+(3),
+(4),
+(5);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
@@ -2928,7 +3020,9 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES ('2003-10-25 22:00:00'),('2003-10-25 23:00:00');
+INSERT INTO `t1` VALUES
+('2003-10-25 22:00:00'),
+('2003-10-25 23:00:00');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -2965,7 +3059,9 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES ('2003-10-26 02:00:00'),('2003-10-26 02:00:00');
+INSERT INTO `t1` VALUES
+('2003-10-26 02:00:00'),
+('2003-10-26 02:00:00');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
@@ -3017,7 +3113,10 @@ CREATE TABLE "t1 test" (
LOCK TABLES "t1 test" WRITE;
/*!40000 ALTER TABLE "t1 test" DISABLE KEYS */;
-INSERT INTO "t1 test" VALUES (1),(2),(3);
+INSERT INTO "t1 test" VALUES
+(1),
+(2),
+(3);
/*!40000 ALTER TABLE "t1 test" ENABLE KEYS */;
UNLOCK TABLES;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
@@ -3046,7 +3145,10 @@ CREATE TABLE "t2 test" (
LOCK TABLES "t2 test" WRITE;
/*!40000 ALTER TABLE "t2 test" DISABLE KEYS */;
-INSERT INTO "t2 test" VALUES (1),(2),(3);
+INSERT INTO "t2 test" VALUES
+(1),
+(2),
+(3);
/*!40000 ALTER TABLE "t2 test" ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -3102,7 +3204,10 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (1,'first value','xxxx'),(2,'second value','tttt'),(3,'third value','vvv vvv');
+INSERT INTO `t1` VALUES
+(1,'first value','xxxx'),
+(2,'second value','tttt'),
+(3,'third value','vvv vvv');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `v0`;
@@ -3326,7 +3431,8 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (0x00,'');
+INSERT INTO `t1` VALUES
+(0x00,'');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -3504,7 +3610,11 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (1232131),(4711),(3231),(815);
+INSERT INTO `t1` VALUES
+(1232131),
+(4711),
+(3231),
+(815);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `v1`;
@@ -3888,7 +3998,8 @@ CREATE TABLE `t1` (
`c2` longblob DEFAULT NULL
);
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (11,0x7171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171);
+INSERT INTO `t1` VALUES
+(11,0x7171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171);
DROP TABLE t1;
#
# Bug#28524 mysqldump --skip-add-drop-table is not
@@ -4121,7 +4232,11 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-REPLACE INTO `t1` VALUES (1,1),(2,3),(3,4),(4,5);
+REPLACE INTO `t1` VALUES
+(1,1),
+(2,3),
+(3,4),
+(4,5);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -4395,7 +4510,11 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (1232131),(4711),(3231),(815);
+INSERT INTO `t1` VALUES
+(1232131),
+(4711),
+(3231),
+(815);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `v1`;
@@ -5487,7 +5606,9 @@ CREATE TABLE `basetable` (
`id` smallint(6) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `basetable` VALUES (5),(6);
+INSERT INTO `basetable` VALUES
+(5),
+(6);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `nonunique_table_name` (
@@ -5511,14 +5632,18 @@ CREATE TABLE `nonunique_table_name` (
UNIQUE KEY `i1` (`i1`)
) ENGINE=MEMORY AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `nonunique_table_name` VALUES (1),(2);
+INSERT INTO `nonunique_table_name` VALUES
+(1),
+(2);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `nonunique_table_view_name` (
`i2` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `nonunique_table_view_name` VALUES (3),(4);
+INSERT INTO `nonunique_table_view_name` VALUES
+(3),
+(4);
USE `db1`;
/*!50001 DROP TABLE IF EXISTS `nonunique_table_view_name`*/;
@@ -5547,14 +5672,18 @@ CREATE TABLE `nonunique_table_name` (
UNIQUE KEY `i1` (`i1`)
) ENGINE=MEMORY AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `nonunique_table_name` VALUES (1),(2);
+INSERT INTO `nonunique_table_name` VALUES
+(1),
+(2);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `nonunique_table_view_name` (
`i2` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `nonunique_table_view_name` VALUES (3),(4);
+INSERT INTO `nonunique_table_view_name` VALUES
+(3),
+(4);
##################################################
# --compact --delayed-insert --no-data-med=0 --databases db2 db1
@@ -5569,14 +5698,18 @@ CREATE TABLE `nonunique_table_name` (
UNIQUE KEY `i1` (`i1`)
) ENGINE=MEMORY AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT DELAYED INTO `nonunique_table_name` VALUES (1),(2);
+INSERT DELAYED INTO `nonunique_table_name` VALUES
+(1),
+(2);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `nonunique_table_view_name` (
`i2` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `nonunique_table_view_name` VALUES (3),(4);
+INSERT INTO `nonunique_table_view_name` VALUES
+(3),
+(4);
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 */;
@@ -5587,14 +5720,18 @@ CREATE TABLE `basetable` (
`id` smallint(6) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT DELAYED INTO `basetable` VALUES (5),(6);
+INSERT DELAYED INTO `basetable` VALUES
+(5),
+(6);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `nonunique_table_name` (
`i3` smallint(6) DEFAULT NULL
) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8mb3 INSERT_METHOD=LAST UNION=(`basetable`);
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `nonunique_table_name` VALUES (5),(6);
+INSERT INTO `nonunique_table_name` VALUES
+(5),
+(6);
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `nonunique_table_view_name` (
@@ -6060,7 +6197,8 @@ CREATE TABLE `t1` (
`b` int(11) INVISIBLE DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` (`a`, `b`) VALUES (1,NULL),(1,2);
+INSERT INTO `t1` (`a`, `b`) VALUES (1,NULL),
+(1,2);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t2` (
@@ -6068,7 +6206,9 @@ CREATE TABLE `t2` (
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t2` VALUES (1,2),(1,2);
+INSERT INTO `t2` VALUES
+(1,2),
+(1,2);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t3` (
@@ -6077,14 +6217,18 @@ CREATE TABLE `t3` (
`ds=~!@ \# $% ^ & * ( ) _ - = +` int(11) INVISIBLE DEFAULT 5
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t3` (`invisible`, `a b c & $!@#$%^&*( )`, `ds=~!@ \# $% ^ & * ( ) _ - = +`) VALUES (1,4,5),(5,4,5),(2,4,5),(1,2,3);
+INSERT INTO `t3` (`invisible`, `a b c & $!@#$%^&*( )`, `ds=~!@ \# $% ^ & * ( ) _ - = +`) VALUES (1,4,5),
+(5,4,5),
+(2,4,5),
+(1,2,3);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t4` (
`ËÃÃŒÃÎËÃ1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t4` VALUES (1);
+INSERT INTO `t4` VALUES
+(1);
#Check side effect on --complete insert
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -6093,7 +6237,8 @@ CREATE TABLE `t1` (
`b` int(11) INVISIBLE DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` (`a`, `b`) VALUES (1,NULL),(1,2);
+INSERT INTO `t1` (`a`, `b`) VALUES (1,NULL),
+(1,2);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t2` (
@@ -6101,7 +6246,8 @@ CREATE TABLE `t2` (
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t2` (`a`, `b`) VALUES (1,2),(1,2);
+INSERT INTO `t2` (`a`, `b`) VALUES (1,2),
+(1,2);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t3` (
@@ -6110,7 +6256,10 @@ CREATE TABLE `t3` (
`ds=~!@ \# $% ^ & * ( ) _ - = +` int(11) INVISIBLE DEFAULT 5
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t3` (`invisible`, `a b c & $!@#$%^&*( )`, `ds=~!@ \# $% ^ & * ( ) _ - = +`) VALUES (1,4,5),(5,4,5),(2,4,5),(1,2,3);
+INSERT INTO `t3` (`invisible`, `a b c & $!@#$%^&*( )`, `ds=~!@ \# $% ^ & * ( ) _ - = +`) VALUES (1,4,5),
+(5,4,5),
+(2,4,5),
+(1,2,3);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t4` (
diff --git a/mysql-test/main/natural_sort_key.result b/mysql-test/main/natural_sort_key.result
new file mode 100644
index 00000000000..2b45addd1c6
--- /dev/null
+++ b/mysql-test/main/natural_sort_key.result
@@ -0,0 +1,214 @@
+SET NAMES utf8mb4;
+SELECT NATURAL_SORT_KEY(NULL);
+NATURAL_SORT_KEY(NULL)
+NULL
+SELECT NATURAL_SORT_KEY(repeat('a1',@@max_allowed_packet/2-1));
+NATURAL_SORT_KEY(repeat('a1',@@max_allowed_packet/2-1))
+NULL
+Warnings:
+Warning 1301 Result of natural_sort_key() was larger than max_allowed_packet (16777216) - truncated
+SELECT NATURAL_SORT_KEY(repeat('1',@@max_allowed_packet-1));
+NATURAL_SORT_KEY(repeat('1',@@max_allowed_packet-1))
+NULL
+Warnings:
+Warning 1301 Result of natural_sort_key() was larger than max_allowed_packet (16777216) - truncated
+CREATE TABLE t1(
+c VARCHAR(30) CHARACTER SET latin1 COLLATE latin1_bin,
+k VARCHAR(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS (NATURAL_SORT_KEY(CONVERT(c USING utf8mb4))) VIRTUAL INVISIBLE);
+INSERT INTO t1 values
+('A1'),('a1'),('A100'),('a100'),('A2'),('ä2'),('a2'),('A99'),
+('äb'),('B1'),('B100'),('B9'),('C'),('100');
+#Natural sort order.
+SELECT c FROM t1 ORDER BY k,c;
+c
+100
+A1
+a1
+A2
+a2
+ä2
+A99
+A100
+a100
+äb
+B1
+B9
+B100
+C
+#Unnatural but unicode aware) sort order
+SELECT c FROM t1 ORDER BY CONVERT(c USING utf8mb4) COLLATE utf8mb4_unicode_ci,c;
+c
+100
+A1
+a1
+A100
+a100
+A2
+a2
+ä2
+A99
+äb
+B1
+B100
+B9
+C
+CREATE TABLE t2 AS SELECT c, NATURAL_SORT_KEY(c) FROM t1 WHERE 0;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c` varchar(30) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
+ `NATURAL_SORT_KEY(c)` varchar(45) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1,t2;
+CREATE TABLE t1(c VARCHAR(1), k VARCHAR(2) AS (NATURAL_SORT_KEY(c)) STORED);
+ERROR HY000: Function or expression 'natural_sort_key()' cannot be used in the GENERATED ALWAYS AS clause of `k`
+SELECT RPAD(val,28,' ') value , RPAD(NATURAL_SORT_KEY(val),36,' ') sortkey , LENGTH(NATURAL_SORT_KEY(val)) - LENGTH(val) encoding_overhead
+FROM
+(
+SELECT '0' val
+UNION SELECT seq FROM seq_1_to_9
+UNION SELECT CONCAT('1',repeat('0',seq)) FROM seq_1_to_27
+) AS numbers ORDER BY sortkey;
+value sortkey encoding_overhead
+0 00 1
+1 01 1
+2 02 1
+3 03 1
+4 04 1
+5 05 1
+6 06 1
+7 07 1
+8 08 1
+9 09 1
+10 110 1
+100 2100 1
+1000 31000 1
+10000 410000 1
+100000 5100000 1
+1000000 61000000 1
+10000000 710000000 1
+100000000 8100000000 1
+1000000000 901000000000 2
+10000000000 9110000000000 2
+100000000000 92100000000000 2
+1000000000000 931000000000000 2
+10000000000000 9410000000000000 2
+100000000000000 95100000000000000 2
+1000000000000000 961000000000000000 2
+10000000000000000 9710000000000000000 2
+100000000000000000 98100000000000000000 2
+1000000000000000000 9901000000000000000000 3
+10000000000000000000 99110000000000000000000 3
+100000000000000000000 992100000000000000000000 3
+1000000000000000000000 9931000000000000000000000 3
+10000000000000000000000 99410000000000000000000000 3
+100000000000000000000000 995100000000000000000000000 3
+1000000000000000000000000 9961000000000000000000000000 3
+10000000000000000000000000 99710000000000000000000000000 3
+100000000000000000000000000 998100000000000000000000000000 3
+1000000000000000000000000000 99901271000000000000000000000000000 7
+SELECT natural_sort_key('1') = natural_sort_key('0001');
+natural_sort_key('1') = natural_sort_key('0001')
+1
+SELECT natural_sort_key('1.1') = natural_sort_key('1.00001');
+natural_sort_key('1.1') = natural_sort_key('1.00001')
+1
+SELECT RPAD(val,20,' ') value, NATURAL_SORT_KEY(val) FROM
+(SELECT '' val WHERE 0 UNION VALUES
+('fred'),
+('pic2'),
+('pic100a'),
+('pic120'),
+('pic121'),
+('jane'),
+('tom'),
+('pic02a'),
+('pic3'),
+('pic4'),
+('1-20'),
+('pic100'),
+('pic02000'),
+('10-20'),
+('1-02'),
+('1-2'),
+('pic01'),
+('pic02'),
+('pic 6'),
+('pic 7'),
+('pic 5'),
+('pic05'),
+('pic 5 '),
+('pic 5 something'),
+('pic 4 else'),
+('2000-1-10'),
+('1999-12-25'),
+('1999-3-3'),
+('2000-3-23'),
+('2000-1-2'),
+('100.200.300.400'),
+('100.50.60.70'),
+('100.8.9.0'),
+('a1b1'),
+('a01b2'),
+('a1b2'),
+('a01b3')
+)AS data ORDER BY 2,1;
+value NATURAL_SORT_KEY(val)
+1-02 01-02
+1-2 01-02
+1-20 01-120
+10-20 110-120
+100.8.9.0 2100.08.09.00
+100.50.60.70 2100.150.160.170
+100.200.300.400 2100.2200.2300.2400
+1999-3-3 31999-03-03
+1999-12-25 31999-112-125
+2000-1-2 32000-01-02
+2000-1-10 32000-01-110
+2000-3-23 32000-03-123
+a1b1 a01b01
+a01b2 a01b02
+a1b2 a01b02
+a01b3 a01b03
+fred fred
+jane jane
+pic 7 pic 07
+pic 4 else pic 04 else
+pic 5 pic 05
+pic 5 something pic 05 something
+pic 6 pic 06
+pic01 pic01
+pic02 pic02
+pic2 pic02
+pic02a pic02a
+pic3 pic03
+pic4 pic04
+pic05 pic05
+pic100 pic2100
+pic100a pic2100a
+pic120 pic2120
+pic121 pic2121
+pic02000 pic32000
+tom tom
+create table t (a varchar(8), b varchar(8) as (natural_sort_key(a)));
+insert into t (a) values ('a2'),(NULL),('a11');
+select * from t order by b;
+a b
+NULL NULL
+a2 a02
+a11 a111
+select a, b from t order by b;
+a b
+NULL NULL
+a2 a02
+a11 a111
+drop table t;
+select natural_sort_key(_utf16 0x0031),natural_sort_key(_ucs2 0x0031), natural_sort_key(_utf32 0x00000031);
+natural_sort_key(_utf16 0x0031) natural_sort_key(_ucs2 0x0031) natural_sort_key(_utf32 0x00000031)
+01 01 01
+select get_lock('a', 0);
+get_lock('a', 0)
+1
+select natural_sort_key(release_lock('a'));
+natural_sort_key(release_lock('a'))
+01
diff --git a/mysql-test/main/natural_sort_key.test b/mysql-test/main/natural_sort_key.test
new file mode 100644
index 00000000000..811f937750c
--- /dev/null
+++ b/mysql-test/main/natural_sort_key.test
@@ -0,0 +1,102 @@
+--source include/have_sequence.inc
+
+SET NAMES utf8mb4;
+SELECT NATURAL_SORT_KEY(NULL);
+
+#Test that max packet overflow produces NULL plus warning
+SELECT NATURAL_SORT_KEY(repeat('a1',@@max_allowed_packet/2-1));
+SELECT NATURAL_SORT_KEY(repeat('1',@@max_allowed_packet-1));
+
+#Test with virtual
+CREATE TABLE t1(
+ c VARCHAR(30) CHARACTER SET latin1 COLLATE latin1_bin,
+ k VARCHAR(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS (NATURAL_SORT_KEY(CONVERT(c USING utf8mb4))) VIRTUAL INVISIBLE);
+
+INSERT INTO t1 values
+ ('A1'),('a1'),('A100'),('a100'),('A2'),('ä2'),('a2'),('A99'),
+ ('äb'),('B1'),('B100'),('B9'),('C'),('100');
+
+-- echo #Natural sort order.
+# We sort by 2 colums, for stable sort,as we do not currenly have a case and accent insensitive Unicode collation.
+SELECT c FROM t1 ORDER BY k,c;
+-- echo #Unnatural but unicode aware) sort order
+SELECT c FROM t1 ORDER BY CONVERT(c USING utf8mb4) COLLATE utf8mb4_unicode_ci,c;
+# CREATE TABLE AS SELECT, to see that length of the column is correct.
+CREATE TABLE t2 AS SELECT c, NATURAL_SORT_KEY(c) FROM t1 WHERE 0;
+SHOW CREATE TABLE t2;
+DROP TABLE t1,t2;
+
+#Virtual STORED is temporarily disabled
+--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+CREATE TABLE t1(c VARCHAR(1), k VARCHAR(2) AS (NATURAL_SORT_KEY(c)) STORED);
+
+#Show encoding of numbers.
+SELECT RPAD(val,28,' ') value , RPAD(NATURAL_SORT_KEY(val),36,' ') sortkey , LENGTH(NATURAL_SORT_KEY(val)) - LENGTH(val) encoding_overhead
+FROM
+(
+SELECT '0' val
+UNION SELECT seq FROM seq_1_to_9
+UNION SELECT CONCAT('1',repeat('0',seq)) FROM seq_1_to_27
+) AS numbers ORDER BY sortkey;
+
+# leading zeros ignored
+SELECT natural_sort_key('1') = natural_sort_key('0001');
+SELECT natural_sort_key('1.1') = natural_sort_key('1.00001');
+
+# Some examples from https://github.com/sourcefrog/natsort/
+# words
+SELECT RPAD(val,20,' ') value, NATURAL_SORT_KEY(val) FROM
+(SELECT '' val WHERE 0 UNION VALUES
+('fred'),
+('pic2'),
+('pic100a'),
+('pic120'),
+('pic121'),
+('jane'),
+('tom'),
+('pic02a'),
+('pic3'),
+('pic4'),
+('1-20'),
+('pic100'),
+('pic02000'),
+('10-20'),
+('1-02'),
+('1-2'),
+('pic01'),
+('pic02'),
+('pic 6'),
+('pic 7'),
+('pic 5'),
+('pic05'),
+('pic 5 '),
+('pic 5 something'),
+('pic 4 else'),
+('2000-1-10'),
+('1999-12-25'),
+('1999-3-3'),
+('2000-3-23'),
+('2000-1-2'),
+('100.200.300.400'),
+('100.50.60.70'),
+('100.8.9.0'),
+('a1b1'),
+('a01b2'),
+('a1b2'),
+('a01b3')
+)AS data ORDER BY 2,1;
+
+# MDEV-27686 (null value indicator not always reset)
+create table t (a varchar(8), b varchar(8) as (natural_sort_key(a)));
+insert into t (a) values ('a2'),(NULL),('a11');
+select * from t order by b;
+select a, b from t order by b;
+drop table t;
+
+# MDEV-26796 Natural sort does not work for utf32/utf16/ucs2
+select natural_sort_key(_utf16 0x0031),natural_sort_key(_ucs2 0x0031), natural_sort_key(_utf32 0x00000031);
+
+# MDEV-26806 Server crash in Charset::charset / Item_func_natural_sort_key::val_str
+select get_lock('a', 0);
+select natural_sort_key(release_lock('a'));
+
diff --git a/mysql-test/main/openssl_1.result b/mysql-test/main/openssl_1.result
index 96b1895d57b..a9264b3ed2c 100644
--- a/mysql-test/main/openssl_1.result
+++ b/mysql-test/main/openssl_1.result
@@ -98,7 +98,9 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (1),(2);
+INSERT INTO `t1` VALUES
+(1),
+(2);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -132,7 +134,9 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (1),(2);
+INSERT INTO `t1` VALUES
+(1),
+(2);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -166,7 +170,9 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (1),(2);
+INSERT INTO `t1` VALUES
+(1),
+(2);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
diff --git a/mysql-test/main/partition.result b/mysql-test/main/partition.result
index 109e6b8993a..58d0464b86f 100644
--- a/mysql-test/main/partition.result
+++ b/mysql-test/main/partition.result
@@ -2643,7 +2643,7 @@ Note 1517 Duplicate partition name p5
alter table t1 drop partition if exists p5;
alter table t1 drop partition if exists p5;
Warnings:
-Note 1507 Error in list of partitions to DROP
+Note 1507 Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE=MyISAM PARTITION BY RANGE(a) (PARTITION p1 VALUES LESS THAN (0));
ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES LESS THAN (1));
diff --git a/mysql-test/main/partition_alter.result b/mysql-test/main/partition_alter.result
index 997a5cf97fa..d233486b427 100644
--- a/mysql-test/main/partition_alter.result
+++ b/mysql-test/main/partition_alter.result
@@ -201,3 +201,67 @@ pk
delete from t1;
drop table t1;
# End of 10.3 tests
+create or replace table t1 (x int primary key)
+partition by range(x) (
+p1 values less than (10),
+partition p2 values less than (20),
+p3 values less than (30),
+partition p4 values less than (40),
+p5 values less than (50),
+pn values less than maxvalue);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+create or replace table t1 (x int)
+partition by list(x) (
+partition p1 values in (2, 3, 4),
+partition p2 values in (12, 13, 14),
+partition p3 values in (22, 23, 24),
+p4 values in (32, 33, 34),
+p5 values in (42, 43, 44),
+pn values in (52, 53, 54));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY LIST (`x`)
+(PARTITION `p1` VALUES IN (2,3,4) ENGINE = MyISAM,
+ PARTITION `p2` VALUES IN (12,13,14) ENGINE = MyISAM,
+ PARTITION `p3` VALUES IN (22,23,24) ENGINE = MyISAM,
+ PARTITION `p4` VALUES IN (32,33,34) ENGINE = MyISAM,
+ PARTITION `p5` VALUES IN (42,43,44) ENGINE = MyISAM,
+ PARTITION `pn` VALUES IN (52,53,54) ENGINE = MyISAM)
+create or replace table t1 (x int)
+partition by list(x) (
+partition partition p1 values in (2, 3, 4),
+pn values in (52, 53, 54));
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'partition p1 values in (2, 3, 4),
+pn values in (52, 53, 54))' at line 3
+create or replace table t1 (x int)
+partition by list(x) (
+partition partition values in (2, 3, 4),
+pn values in (52, 53, 54));
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'partition values in (2, 3, 4),
+pn values in (52, 53, 54))' at line 3
+create or replace table t1 (x int)
+partition by list(x) (
+partition values in (2, 3, 4),
+pn values in (52, 53, 54));
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'in (2, 3, 4),
+pn values in (52, 53, 54))' at line 3
+create or replace table t1 (x int)
+partition by list(x) (
+partitio values in (2, 3, 4),
+pn values in (52, 53, 54));
+drop table t1;
diff --git a/mysql-test/main/partition_alter.test b/mysql-test/main/partition_alter.test
index 804b43dc3c2..782089087ae 100644
--- a/mysql-test/main/partition_alter.test
+++ b/mysql-test/main/partition_alter.test
@@ -186,3 +186,50 @@ delete from t1;
drop table t1;
--echo # End of 10.3 tests
+
+create or replace table t1 (x int primary key)
+partition by range(x) (
+ p1 values less than (10),
+ partition p2 values less than (20),
+ p3 values less than (30),
+ partition p4 values less than (40),
+ p5 values less than (50),
+ pn values less than maxvalue);
+
+show create table t1;
+
+create or replace table t1 (x int)
+partition by list(x) (
+ partition p1 values in (2, 3, 4),
+ partition p2 values in (12, 13, 14),
+ partition p3 values in (22, 23, 24),
+ p4 values in (32, 33, 34),
+ p5 values in (42, 43, 44),
+ pn values in (52, 53, 54));
+
+show create table t1;
+
+--error ER_PARSE_ERROR
+create or replace table t1 (x int)
+partition by list(x) (
+ partition partition p1 values in (2, 3, 4),
+ pn values in (52, 53, 54));
+
+--error ER_PARSE_ERROR
+create or replace table t1 (x int)
+partition by list(x) (
+ partition partition values in (2, 3, 4),
+ pn values in (52, 53, 54));
+
+--error ER_PARSE_ERROR
+create or replace table t1 (x int)
+partition by list(x) (
+ partition values in (2, 3, 4),
+ pn values in (52, 53, 54));
+
+create or replace table t1 (x int)
+partition by list(x) (
+ partitio values in (2, 3, 4),
+ pn values in (52, 53, 54));
+
+drop table t1;
diff --git a/mysql-test/main/partition_binlog.result b/mysql-test/main/partition_binlog.result
index 3e6100b51d8..45cd636c1f9 100644
--- a/mysql-test/main/partition_binlog.result
+++ b/mysql-test/main/partition_binlog.result
@@ -11,20 +11,20 @@ INSERT INTO t1 VALUES (1), (10), (100), (1000);
ALTER TABLE t1 TRUNCATE PARTITION p1;
ERROR HY000: Unknown partition 'p1' in table 't1'
ALTER TABLE t1 DROP PARTITION p1;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
# No error returned, output in table format instead:
ALTER TABLE t1 ANALYZE PARTITION p1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
ALTER TABLE t1 CHECK PARTITION p1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
ALTER TABLE t1 OPTIMIZE PARTITION p1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
ALTER TABLE t1 REPAIR PARTITION p1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
ALTER TABLE t1 ANALYZE PARTITION p0;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
diff --git a/mysql-test/main/partition_binlog.test b/mysql-test/main/partition_binlog.test
index d6986c86ebe..665293d4881 100644
--- a/mysql-test/main/partition_binlog.test
+++ b/mysql-test/main/partition_binlog.test
@@ -22,7 +22,7 @@ INSERT INTO t1 VALUES (1), (10), (100), (1000);
--error ER_UNKNOWN_PARTITION
ALTER TABLE t1 TRUNCATE PARTITION p1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION p1;
--echo # No error returned, output in table format instead:
diff --git a/mysql-test/main/partition_error.result b/mysql-test/main/partition_error.result
index b6cd903ccca..4e12b6ade8e 100644
--- a/mysql-test/main/partition_error.result
+++ b/mysql-test/main/partition_error.result
@@ -29,7 +29,7 @@ INSERT INTO t1 VALUES (5,3),(5,6);
ALTER TABLE t1 PARTITION BY KEY(b) PARTITIONS 3 ;
ALTER TABLE t1 REPAIR PARTITION p1, p3;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
ALTER TABLE t1 ORDER BY b;
DROP TABLE t1;
#
@@ -43,7 +43,7 @@ PARTITION p1 VALUES LESS THAN MAXVALUE ) ;
ALTER TABLE t1 DROP PARTITION p1;
ALTER TABLE t1 ANALYZE PARTITION p0, p1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
ALTER TABLE t1 COMMENT 'altered';
DROP TABLE t1;
#
@@ -765,7 +765,7 @@ ERROR HY000: Field 'c' is of a not allowed type for this type of partitioning
#
CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
CREATE TEMPORARY TABLE tmp_t1 LIKE t1;
-ERROR HY000: Partitioned tables do not support CREATE TEMPORARY TABLE
+ERROR HY000: Table storage engine 'partition' does not support the create option 'TEMPORARY'
DROP TABLE t1;
#
# Bug#42954: SQL MODE 'NO_DIR_IN_CREATE' does not work with
diff --git a/mysql-test/main/partition_error.test b/mysql-test/main/partition_error.test
index edfe7c827be..b8d07e595e5 100644
--- a/mysql-test/main/partition_error.test
+++ b/mysql-test/main/partition_error.test
@@ -800,7 +800,7 @@ PARTITION BY HASH (c) PARTITIONS 4;
--echo # with temporary table and partitions
--echo #
CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
---error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING
+--error ER_ILLEGAL_HA_CREATE_OPTION
CREATE TEMPORARY TABLE tmp_t1 LIKE t1;
DROP TABLE t1;
--echo #
diff --git a/mysql-test/main/partition_exchange.result b/mysql-test/main/partition_exchange.result
index ac1b8c99cf7..09404e44527 100644
--- a/mysql-test/main/partition_exchange.result
+++ b/mysql-test/main/partition_exchange.result
@@ -1306,7 +1306,6 @@ ALTER TABLE t1 ADD PARTITION (PARTITION pm TABLESPACE = `innodb_file_per_table`)
CREATE TABLE t2 like t1;
ALTER TABLE t2 REMOVE PARTITIONING;
ALTER TABLE t1 EXCHANGE PARTITION pm WITH TABLE t2;
-ERROR HY000: Non matching attribute 'TABLESPACE' between partition and table
DROP TABLE t1, t2;
#
# MDEV-14642 Assertion `table->s->db_create_options == part_table->s->db_create_options' failed in compare_table_with_partition
diff --git a/mysql-test/main/partition_exchange.test b/mysql-test/main/partition_exchange.test
index 09629a52add..8e0be49b5ab 100644
--- a/mysql-test/main/partition_exchange.test
+++ b/mysql-test/main/partition_exchange.test
@@ -533,7 +533,7 @@ CREATE TABLE t1 (a VARCHAR(200)) PARTITION BY KEY(a) partitions 10;
ALTER TABLE t1 ADD PARTITION (PARTITION pm TABLESPACE = `innodb_file_per_table`);
CREATE TABLE t2 like t1;
ALTER TABLE t2 REMOVE PARTITIONING;
---error ER_PARTITION_EXCHANGE_DIFFERENT_OPTION
+# The following works as table spaces are not checked anymore
ALTER TABLE t1 EXCHANGE PARTITION pm WITH TABLE t2;
DROP TABLE t1, t2;
diff --git a/mysql-test/main/partition_mgm_err.result b/mysql-test/main/partition_mgm_err.result
index e3c4bbf2af7..22bd225b528 100644
--- a/mysql-test/main/partition_mgm_err.result
+++ b/mysql-test/main/partition_mgm_err.result
@@ -16,13 +16,13 @@ ALTER TABLE t1 REORGANIZE PARTITION x0,x1 INTO
PARTITION x11 VALUES LESS THAN (5));
ERROR HY000: Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range
ALTER TABLE t1 DROP PARTITION x0, x1, x2, x3, x3;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION x0, x1, x2, x10;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION x10, x1, x2, x1;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION x10, x1, x2, x3;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 REORGANIZE PARTITION x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10 INTO
(PARTITION x11 VALUES LESS THAN (22));
ERROR HY000: More partitions to reorganize than there are partitions
@@ -34,7 +34,7 @@ ALTER TABLE t1 REORGANIZE PARTITION x0, x2 INTO
ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
ALTER TABLE t1 REORGANIZE PARTITION x0, x1, x1 INTO
(PARTITION x11 VALUES LESS THAN (4));
-ERROR HY000: Error in list of partitions to REORGANIZE
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 REORGANIZE PARTITION x0,x1 INTO
(PARTITION x01 VALUES LESS THAN (5));
ERROR HY000: Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range
@@ -113,7 +113,7 @@ PARTITION x1 VALUES LESS THAN (8));
ALTER TABLE t1 ADD PARTITION PARTITIONS 1;
ERROR HY000: For RANGE partitions each partition must be defined
ALTER TABLE t1 DROP PARTITION x2;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 COALESCE PARTITION 1;
ERROR HY000: COALESCE PARTITION can only be used on HASH/KEY partitions
ALTER TABLE t1 DROP PARTITION x1;
diff --git a/mysql-test/main/partition_mgm_err.test b/mysql-test/main/partition_mgm_err.test
index 0987c427fc7..82b9db7bbe1 100644
--- a/mysql-test/main/partition_mgm_err.test
+++ b/mysql-test/main/partition_mgm_err.test
@@ -29,16 +29,16 @@ ALTER TABLE t1 REORGANIZE PARTITION x0,x1 INTO
(PARTITION x01 VALUES LESS THAN (2),
PARTITION x11 VALUES LESS THAN (5));
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION x0, x1, x2, x3, x3;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION x0, x1, x2, x10;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION x10, x1, x2, x1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION x10, x1, x2, x3;
--error ER_REORG_PARTITION_NOT_EXIST
@@ -53,7 +53,7 @@ ALTER TABLE t1 REORGANIZE PARTITION x0,x1,x2 INTO
ALTER TABLE t1 REORGANIZE PARTITION x0, x2 INTO
(PARTITION x11 VALUES LESS THAN (2));
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 REORGANIZE PARTITION x0, x1, x1 INTO
(PARTITION x11 VALUES LESS THAN (4));
@@ -167,7 +167,7 @@ PARTITION BY RANGE (a)
--error ER_PARTITIONS_MUST_BE_DEFINED_ERROR
ALTER TABLE t1 ADD PARTITION PARTITIONS 1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION x2;
--error ER_COALESCE_ONLY_ON_HASH_PARTITION
diff --git a/mysql-test/main/partition_range.result b/mysql-test/main/partition_range.result
index ac8d34c71a2..7384def5c85 100644
--- a/mysql-test/main/partition_range.result
+++ b/mysql-test/main/partition_range.result
@@ -294,9 +294,9 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY RANGE (`a`)
-(PARTITION `x1` VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM,
- PARTITION `x2` VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM,
- PARTITION `x3` VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM)
+(PARTITION `x1` VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION `x2` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `x3` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
ALTER TABLE t1
partition by range (a)
partitions 3
@@ -318,9 +318,9 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY RANGE (`a`)
-(PARTITION `x1` VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM,
- PARTITION `x2` VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM,
- PARTITION `x3` VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM)
+(PARTITION `x1` VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION `x2` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `x3` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
drop table if exists t1;
CREATE TABLE t1 (
a int not null,
diff --git a/mysql-test/main/partition_sync.result b/mysql-test/main/partition_sync.result
index badcb10e5da..149eadf257b 100644
--- a/mysql-test/main/partition_sync.result
+++ b/mysql-test/main/partition_sync.result
@@ -15,7 +15,7 @@ a
1
connection default;
ALTER TABLE t1 DROP PARTITION p3;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
connection con1;
# This failed with deadlock and should not do so.
SELECT * FROM t1;
diff --git a/mysql-test/main/partition_sync.test b/mysql-test/main/partition_sync.test
index 22ca7df7e62..9b75ab79edd 100644
--- a/mysql-test/main/partition_sync.test
+++ b/mysql-test/main/partition_sync.test
@@ -1,5 +1,6 @@
--source include/have_partition.inc
--source include/have_debug.inc
+--source include/have_debug_sync.inc
# Save the initial number of concurrent sessions.
--source include/count_sessions.inc
@@ -21,7 +22,7 @@ BEGIN;
SELECT * FROM t1;
connection default;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION p3;
connection con1;
diff --git a/mysql-test/main/plugin.result b/mysql-test/main/plugin.result
index a8f4be6eb93..cd1cf28c28e 100644
--- a/mysql-test/main/plugin.result
+++ b/mysql-test/main/plugin.result
@@ -12,7 +12,7 @@ PLUGIN_STATUS ACTIVE
PLUGIN_TYPE STORAGE ENGINE
PLUGIN_TYPE_VERSION #
PLUGIN_LIBRARY ha_example.so
-PLUGIN_LIBRARY_VERSION 1.14
+PLUGIN_LIBRARY_VERSION 1.15
PLUGIN_AUTHOR Brian Aker, MySQL AB
PLUGIN_DESCRIPTION Example storage engine
PLUGIN_LICENSE GPL
@@ -25,7 +25,7 @@ PLUGIN_STATUS ACTIVE
PLUGIN_TYPE DAEMON
PLUGIN_TYPE_VERSION #
PLUGIN_LIBRARY ha_example.so
-PLUGIN_LIBRARY_VERSION 1.14
+PLUGIN_LIBRARY_VERSION 1.15
PLUGIN_AUTHOR Sergei Golubchik
PLUGIN_DESCRIPTION Unusable Daemon
PLUGIN_LICENSE GPL
@@ -68,7 +68,7 @@ PLUGIN_STATUS DELETED
PLUGIN_TYPE STORAGE ENGINE
PLUGIN_TYPE_VERSION #
PLUGIN_LIBRARY ha_example.so
-PLUGIN_LIBRARY_VERSION 1.14
+PLUGIN_LIBRARY_VERSION 1.15
PLUGIN_AUTHOR Brian Aker, MySQL AB
PLUGIN_DESCRIPTION Example storage engine
PLUGIN_LICENSE GPL
diff --git a/mysql-test/main/ps.result b/mysql-test/main/ps.result
index 1dd04636d49..bb4132d5c31 100644
--- a/mysql-test/main/ps.result
+++ b/mysql-test/main/ps.result
@@ -5241,13 +5241,13 @@ DECLARE a DATETIME;
CALL p1(a);
END;
$$
-ERROR 22007: Incorrect datetime value: '10' for column ``.``.`a` at row 1
+ERROR 22007: Incorrect datetime value: '10' for column ``.``.`a` at row 0
BEGIN NOT ATOMIC
DECLARE a DATETIME;
EXECUTE IMMEDIATE 'CALL p1(?)' USING a;
END;
$$
-ERROR 22007: Incorrect datetime value: '10' for column ``.``.`a` at row 1
+ERROR 22007: Incorrect datetime value: '10' for column ``.``.`a` at row 0
BEGIN NOT ATOMIC
DECLARE a DATETIME;
PREPARE stmt FROM 'CALL p1(?)';
@@ -5255,7 +5255,7 @@ EXECUTE stmt USING a;
DEALLOCATE PREPARE stmt;
END;
$$
-ERROR 22007: Incorrect datetime value: '10' for column ``.``.`a` at row 1
+ERROR 22007: Incorrect datetime value: '10' for column ``.``.`a` at row 0
DROP PROCEDURE p1;
#
# MDEV-14454 Binary protocol returns wrong collation ID for SP OUT parameters
diff --git a/mysql-test/main/ps_missed_cmds.result b/mysql-test/main/ps_missed_cmds.result
index d1a15f5504b..d377a359666 100644
--- a/mysql-test/main/ps_missed_cmds.result
+++ b/mysql-test/main/ps_missed_cmds.result
@@ -771,27 +771,4 @@ EXECUTE stmt_2;
DROP TABLE t1;
DEALLOCATE PREPARE stmt_1;
DEALLOCATE PREPARE stmt_2;
-# Test Test case 25: Check the statements 'CREATE/ALTER/DROP TABLEPSPACE'
-# can be executed as a prepared statement
-PREPARE stmt_1 FROM "CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' ENGINE=InnoDB";
-PREPARE stmt_2 FROM "ALTER TABLESPACE ts1 ADD DATAFILE 'ts1_1.ibd' ENGINE=InnoDB";
-PREPARE stmt_3 FROM "DROP TABLESPACE ts1 ENGINE=InnoDB";
-EXECUTE stmt_1;
-# Execute the same prepared statement the second time to check that
-# no internal structures used for handling the 'CREATE TABLESPACE'
-# statement were damaged.
-EXECUTE stmt_1;
-EXECUTE stmt_2;
-# Execute the same prepared statement the second time to check that
-# no internal structures used for handling the 'ALTER TABLESPACE'
-# statement were damaged.
-EXECUTE stmt_2;
-EXECUTE stmt_3;
-# Execute the same prepared statement the second time to check that
-# no internal structures used for handling the 'DROP TABLESPACE'
-# statement were damaged.
-EXECUTE stmt_3;
-DEALLOCATE PREPARE stmt_1;
-DEALLOCATE PREPARE stmt_2;
-DEALLOCATE PREPARE stmt_3;
SET default_storage_engine= @save_storage_engine;
diff --git a/mysql-test/main/ps_missed_cmds.test b/mysql-test/main/ps_missed_cmds.test
index 1546b064d89..632457209f2 100644
--- a/mysql-test/main/ps_missed_cmds.test
+++ b/mysql-test/main/ps_missed_cmds.test
@@ -585,50 +585,5 @@ DROP TABLE t1;
DEALLOCATE PREPARE stmt_1;
DEALLOCATE PREPARE stmt_2;
---echo # Test Test case 25: Check the statements 'CREATE/ALTER/DROP TABLEPSPACE'
---echo # can be executed as a prepared statement
-
-PREPARE stmt_1 FROM "CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' ENGINE=InnoDB";
-PREPARE stmt_2 FROM "ALTER TABLESPACE ts1 ADD DATAFILE 'ts1_1.ibd' ENGINE=InnoDB";
-PREPARE stmt_3 FROM "DROP TABLESPACE ts1 ENGINE=InnoDB";
-
-# Since MariaDB supports for tablespaces only on syntax level disable warnings
-# before run CREATE/ALTER/DROP TABLESPACE statements in order to exclude
-# the following in result output
-# Warning 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE
---disable_warnings
-
-EXECUTE stmt_1;
---echo # Execute the same prepared statement the second time to check that
---echo # no internal structures used for handling the 'CREATE TABLESPACE'
---echo # statement were damaged.
-# Since the 'CREATE TABLESPACE' statement is supported by MariaDB on syntax
-# level only the second invocation of the CREATE TABLESPACE statement for
-# the same tablespace name doesn't lead to error.
-EXECUTE stmt_1;
-
-EXECUTE stmt_2;
---echo # Execute the same prepared statement the second time to check that
---echo # no internal structures used for handling the 'ALTER TABLESPACE'
---echo # statement were damaged.
-EXECUTE stmt_2;
-
-EXECUTE stmt_3;
---echo # Execute the same prepared statement the second time to check that
---echo # no internal structures used for handling the 'DROP TABLESPACE'
---echo # statement were damaged.
-
-# Since the 'DROP TABLESPACE' statement is supported by MariaDB on syntax
-# level only the second invocation of the DROP TABLESPACE statement for
-# the same tablespace name doesn't lead to an error that tablespace
-# doesn't exist.
-EXECUTE stmt_3;
-
---enable_warnings
-
-DEALLOCATE PREPARE stmt_1;
-DEALLOCATE PREPARE stmt_2;
-DEALLOCATE PREPARE stmt_3;
-
--enable_ps_protocol
SET default_storage_engine= @save_storage_engine;
diff --git a/mysql-test/main/ps_missed_cmds_bin_prot.result b/mysql-test/main/ps_missed_cmds_bin_prot.result
index d27159354f5..a56371565a6 100644
--- a/mysql-test/main/ps_missed_cmds_bin_prot.result
+++ b/mysql-test/main/ps_missed_cmds_bin_prot.result
@@ -236,9 +236,4 @@ SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT='Hello, world!';
ERROR 45000: Hello, world!
RESIGNAL SET MESSAGE_TEXT = 'New error message';
ERROR 0K000: RESIGNAL when handler not active
-# Test Test case 29: Check the statements 'CREATE/ALTER/DROP TABLEPSPACE'
-# can be executed as a prepared statement
-CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' ENGINE=InnoDB;
-ALTER TABLESPACE ts1 ADD DATAFILE 'ts1_1.ibd' ENGINE=InnoDB;
-DROP TABLESPACE ts1 ENGINE=InnoDB;
SET default_storage_engine= @save_storage_engine;
diff --git a/mysql-test/main/ps_missed_cmds_bin_prot.test b/mysql-test/main/ps_missed_cmds_bin_prot.test
index f36385cc079..f10ee9a3b55 100644
--- a/mysql-test/main/ps_missed_cmds_bin_prot.test
+++ b/mysql-test/main/ps_missed_cmds_bin_prot.test
@@ -251,19 +251,6 @@ SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT='Hello, world!';
--error ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER
RESIGNAL SET MESSAGE_TEXT = 'New error message';
---echo # Test Test case 29: Check the statements 'CREATE/ALTER/DROP TABLEPSPACE'
---echo # can be executed as a prepared statement
-
-# Since MariaDB supports for tablespaces only on syntax level disable warnings
-# before run CREATE/ALTER/DROP TABLESPACE statements in order to exclude
-# the following in result output
-# Warning 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE
---disable_warnings
-
-CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' ENGINE=InnoDB;
-ALTER TABLESPACE ts1 ADD DATAFILE 'ts1_1.ibd' ENGINE=InnoDB;
-DROP TABLESPACE ts1 ENGINE=InnoDB;
-
--enable_warnings
SET default_storage_engine= @save_storage_engine;
diff --git a/mysql-test/main/show_explain.test b/mysql-test/main/show_explain.test
index 415a892c0ec..6cbd92ce44b 100644
--- a/mysql-test/main/show_explain.test
+++ b/mysql-test/main/show_explain.test
@@ -2,6 +2,7 @@
# Tests for SHOW EXPLAIN FOR functionality
#
--source include/have_debug.inc
+--source include/have_debug_sync.inc
--source include/have_innodb.inc
# Using valgrind can cause 'reap' to fail. See comment below
--source include/not_valgrind.inc
diff --git a/mysql-test/main/show_explain_non_select.test b/mysql-test/main/show_explain_non_select.test
index 505e9296222..92b3c9788c9 100644
--- a/mysql-test/main/show_explain_non_select.test
+++ b/mysql-test/main/show_explain_non_select.test
@@ -2,6 +2,7 @@
# SHOW EXPLAIN tests for non-select subqueries
#
--source include/have_debug.inc
+--source include/have_debug_sync.inc
--source include/have_innodb.inc
--source include/not_embedded.inc
diff --git a/mysql-test/main/signal_code.result b/mysql-test/main/signal_code.result
index 32192251fe9..2ea3a7e56b2 100644
--- a/mysql-test/main/signal_code.result
+++ b/mysql-test/main/signal_code.result
@@ -20,16 +20,16 @@ return 0;
end $$
show procedure code signal_proc;
Pos Instruction
-0 stmt 130 "SIGNAL foo"
-1 stmt 130 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
-2 stmt 131 "RESIGNAL foo"
-3 stmt 131 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
+0 stmt 129 "SIGNAL foo"
+1 stmt 129 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
+2 stmt 130 "RESIGNAL foo"
+3 stmt 130 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
drop procedure signal_proc;
show function code signal_func;
Pos Instruction
-0 stmt 130 "SIGNAL foo"
-1 stmt 130 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
-2 stmt 131 "RESIGNAL foo"
-3 stmt 131 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
+0 stmt 129 "SIGNAL foo"
+1 stmt 129 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
+2 stmt 130 "RESIGNAL foo"
+3 stmt 130 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
4 freturn int 0
drop function signal_func;
diff --git a/mysql-test/main/signal_sqlmode.result b/mysql-test/main/signal_sqlmode.result
index db7ac68041c..cb9bd4a8bba 100644
--- a/mysql-test/main/signal_sqlmode.result
+++ b/mysql-test/main/signal_sqlmode.result
@@ -32,7 +32,7 @@ call p;
length(utf8_var) utf8_var
128 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Warnings:
-Warning 1265 Data truncated for column 'utf8_var' at row 1
+Warning 1265 Data truncated for column 'utf8_var' at row 0
call p2;
length(msg) msg
129 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
@@ -71,7 +71,7 @@ table_name = name;
end
$$
call p;
-ERROR 22001: Data too long for column 'utf8_var' at row 1
+ERROR 22001: Data too long for column 'utf8_var' at row 0
call p2;
length(msg) msg
513 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
diff --git a/mysql-test/main/sp-anchor-type.result b/mysql-test/main/sp-anchor-type.result
index 9d339b8235c..ac867bd5ca3 100644
--- a/mysql-test/main/sp-anchor-type.result
+++ b/mysql-test/main/sp-anchor-type.result
@@ -62,7 +62,7 @@ CALL p1();
a b
127 200
Warnings:
-Warning 1264 Out of range value for column 'a' at row 1
+Warning 1264 Out of range value for column 'a' at row 0
DROP PROCEDURE p1;
DROP TABLE t1;
SET sql_mode=DEFAULT;
diff --git a/mysql-test/main/sp-cursor.result b/mysql-test/main/sp-cursor.result
index 230bf8c66ef..aa23d808352 100644
--- a/mysql-test/main/sp-cursor.result
+++ b/mysql-test/main/sp-cursor.result
@@ -167,12 +167,12 @@ CALL p1('1b');
v_a
1
Warnings:
-Warning 1265 Data truncated for column 'p_a' at row 1
+Warning 1265 Data truncated for column 'p_a' at row 0
CALL p1('b1');
v_a
0
Warnings:
-Warning 1366 Incorrect integer value: 'b1' for column ``.``.`p_a` at row 1
+Warning 1366 Incorrect integer value: 'b1' for column ``.``.`p_a` at row 0
DROP PROCEDURE p1;
SET sql_mode=DEFAULT;
#
diff --git a/mysql-test/main/sp-error.result b/mysql-test/main/sp-error.result
index 3832d63c073..c77f58b6a66 100644
--- a/mysql-test/main/sp-error.result
+++ b/mysql-test/main/sp-error.result
@@ -2780,7 +2780,7 @@ END|
CALL p1()|
Warnings:
-Warning 1366 Incorrect integer value: 'string' for column ``.``.`var1` at row 1
+Warning 1366 Incorrect integer value: 'string' for column ``.``.`var1` at row 0
SET sql_mode = DEFAULT|
CREATE PROCEDURE p2()
diff --git a/mysql-test/main/sp-vars.result b/mysql-test/main/sp-vars.result
index a755f8e739f..de30156c602 100644
--- a/mysql-test/main/sp-vars.result
+++ b/mysql-test/main/sp-vars.result
@@ -110,7 +110,7 @@ v7 v8 v9 v10 v11 v12 v13 v14 v15 v16
v17 v18 v19 v20
12.00 12.12 12.00 12.12
Warnings:
-Note 1265 Data truncated for column 'v20' at row 1
+Note 1265 Data truncated for column 'v20' at row 0
CALL sp_vars_check_assignment();
i1 i2 i3 i4
127 -128 127 -128
@@ -130,22 +130,22 @@ SELECT sp_vars_check_ret1();
sp_vars_check_ret1()
127
Warnings:
-Warning 1264 Out of range value for column 'sp_vars_check_ret1()' at row 1
+Warning 1264 Out of range value for column 'sp_vars_check_ret1()' at row 0
SELECT sp_vars_check_ret2();
sp_vars_check_ret2()
127
Warnings:
-Warning 1264 Out of range value for column 'sp_vars_check_ret2()' at row 1
+Warning 1264 Out of range value for column 'sp_vars_check_ret2()' at row 0
SELECT sp_vars_check_ret3();
sp_vars_check_ret3()
0
Warnings:
-Warning 1366 Incorrect integer value: 'Hello, world' for column ``.``.`sp_vars_check_ret3()` at row 1
+Warning 1366 Incorrect integer value: 'Hello, world' for column ``.``.`sp_vars_check_ret3()` at row 0
SELECT sp_vars_check_ret4();
sp_vars_check_ret4()
154.12
Warnings:
-Note 1265 Data truncated for column 'sp_vars_check_ret4()' at row 1
+Note 1265 Data truncated for column 'sp_vars_check_ret4()' at row 0
SELECT sp_vars_div_zero();
sp_vars_div_zero()
NULL
@@ -165,7 +165,7 @@ v7 v8 v9 v10 v11 v12 v13 v14 v15 v16
v17 v18 v19 v20
12.00 12.12 12.00 12.12
Warnings:
-Note 1265 Data truncated for column 'v20' at row 1
+Note 1265 Data truncated for column 'v20' at row 0
CALL sp_vars_check_assignment();
i1 i2 i3 i4
127 -128 127 -128
@@ -185,22 +185,22 @@ SELECT sp_vars_check_ret1();
sp_vars_check_ret1()
127
Warnings:
-Warning 1264 Out of range value for column 'sp_vars_check_ret1()' at row 1
+Warning 1264 Out of range value for column 'sp_vars_check_ret1()' at row 0
SELECT sp_vars_check_ret2();
sp_vars_check_ret2()
127
Warnings:
-Warning 1264 Out of range value for column 'sp_vars_check_ret2()' at row 1
+Warning 1264 Out of range value for column 'sp_vars_check_ret2()' at row 0
SELECT sp_vars_check_ret3();
sp_vars_check_ret3()
0
Warnings:
-Warning 1366 Incorrect integer value: 'Hello, world' for column ``.``.`sp_vars_check_ret3()` at row 1
+Warning 1366 Incorrect integer value: 'Hello, world' for column ``.``.`sp_vars_check_ret3()` at row 0
SELECT sp_vars_check_ret4();
sp_vars_check_ret4()
154.12
Warnings:
-Note 1265 Data truncated for column 'sp_vars_check_ret4()' at row 1
+Note 1265 Data truncated for column 'sp_vars_check_ret4()' at row 0
SELECT sp_vars_div_zero();
sp_vars_div_zero()
NULL
@@ -306,20 +306,20 @@ Calling the routines, created in TRADITIONAL mode.
---------------------------------------------------------------
CALL sp_vars_check_dflt();
-ERROR 22003: Out of range value for column 'v1' at row 1
+ERROR 22003: Out of range value for column 'v1' at row 0
CALL sp_vars_check_assignment();
-ERROR 22003: Out of range value for column 'i1' at row 1
+ERROR 22003: Out of range value for column 'i1' at row 0
SELECT sp_vars_check_ret1();
-ERROR 22003: Out of range value for column 'sp_vars_check_ret1()' at row 1
+ERROR 22003: Out of range value for column 'sp_vars_check_ret1()' at row 0
SELECT sp_vars_check_ret2();
-ERROR 22003: Out of range value for column 'sp_vars_check_ret2()' at row 1
+ERROR 22003: Out of range value for column 'sp_vars_check_ret2()' at row 0
SELECT sp_vars_check_ret3();
-ERROR 22007: Incorrect integer value: 'Hello, world' for column ``.``.`sp_vars_check_ret3()` at row 1
+ERROR 22007: Incorrect integer value: 'Hello, world' for column ``.``.`sp_vars_check_ret3()` at row 0
SELECT sp_vars_check_ret4();
sp_vars_check_ret4()
154.12
Warnings:
-Note 1265 Data truncated for column 'sp_vars_check_ret4()' at row 1
+Note 1265 Data truncated for column 'sp_vars_check_ret4()' at row 0
SELECT sp_vars_div_zero();
ERROR 22012: Division by 0
SET @@sql_mode = 'ansi';
@@ -385,7 +385,7 @@ FF
HEX(v10)
FF
Warnings:
-Warning 1264 Out of range value for column 'v5' at row 1
+Warning 1264 Out of range value for column 'v5' at row 0
DROP PROCEDURE p1;
---------------------------------------------------------------
@@ -602,7 +602,7 @@ CALL p1('alpha', 'abcdef');
x y
alpha abc
Warnings:
-Warning 1265 Data truncated for column 'y' at row 1
+Warning 1265 Data truncated for column 'y' at row 0
DROP PROCEDURE p1;
---------------------------------------------------------------
@@ -628,7 +628,7 @@ t1 CREATE TABLE "t1" (
"x" datetime DEFAULT NULL
)
Warnings:
-Warning 1265 Data truncated for column 'x' at row 1
+Warning 1265 Data truncated for column 'x' at row 0
DROP PROCEDURE p1;
---------------------------------------------------------------
@@ -777,17 +777,17 @@ SET var := arg;
SELECT arg, var;
END|
CALL p1();
-ERROR 22003: Out of range value for column 'v' at row 1
+ERROR 22003: Out of range value for column 'v' at row 0
CALL p2();
-ERROR 22003: Out of range value for column 'v' at row 1
+ERROR 22003: Out of range value for column 'v' at row 0
CALL p3();
-ERROR 22001: Data too long for column 'v' at row 1
+ERROR 22001: Data too long for column 'v' at row 0
CALL p4('aaa');
-ERROR 22001: Data too long for column 'arg' at row 1
+ERROR 22001: Data too long for column 'arg' at row 0
CALL p5('aa');
-ERROR 22001: Data too long for column 'var' at row 1
+ERROR 22001: Data too long for column 'var' at row 0
CALL p6(10);
-ERROR 22003: Out of range value for column 'var' at row 1
+ERROR 22003: Out of range value for column 'var' at row 0
SET @@sql_mode = 'ansi';
DROP PROCEDURE p1;
DROP PROCEDURE p2;
@@ -817,7 +817,7 @@ CALL p1(1929.003);
var
1929.00
Warnings:
-Note 1265 Data truncated for column 'arg' at row 1
+Note 1265 Data truncated for column 'arg' at row 0
DROP PROCEDURE p1;
---------------------------------------------------------------
@@ -950,17 +950,17 @@ CALL p1('c');
arg
Warnings:
-Warning 1265 Data truncated for column 'arg' at row 1
+Warning 1265 Data truncated for column 'arg' at row 0
CALL p2('a');
arg var
a
Warnings:
-Warning 1265 Data truncated for column 'var' at row 1
+Warning 1265 Data truncated for column 'var' at row 0
SELECT f1('a');
f1('a')
Warnings:
-Warning 1265 Data truncated for column 'f1('a')' at row 1
+Warning 1265 Data truncated for column 'f1('a')' at row 0
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP FUNCTION f1;
diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result
index 1d6ce57ceae..bddb41c0730 100644
--- a/mysql-test/main/sp.result
+++ b/mysql-test/main/sp.result
@@ -3073,14 +3073,14 @@ select bug9775('a'),bug9775('b'),bug9775('c')|
bug9775('a') bug9775('b') bug9775('c')
a b
Warnings:
-Warning 1265 Data truncated for column 'bug9775('c')' at row 1
+Warning 1265 Data truncated for column 'bug9775('c')' at row 0
drop function bug9775|
create function bug9775(v1 int) returns enum('a','b') return v1|
select bug9775(1),bug9775(2),bug9775(3)|
bug9775(1) bug9775(2) bug9775(3)
a b
Warnings:
-Warning 1265 Data truncated for column 'bug9775(3)' at row 1
+Warning 1265 Data truncated for column 'bug9775(3)' at row 0
drop function bug9775|
create function bug9775(v1 char(1)) returns set('a','b') return v1|
select bug9775('a'),bug9775('b'),bug9775('a,b'),bug9775('c')|
@@ -3088,14 +3088,14 @@ bug9775('a') bug9775('b') bug9775('a,b') bug9775('c')
a b a
Warnings:
Warning 1265 Data truncated for column 'v1' at row 1
-Warning 1265 Data truncated for column 'bug9775('c')' at row 1
+Warning 1265 Data truncated for column 'bug9775('c')' at row 0
drop function bug9775|
create function bug9775(v1 int) returns set('a','b') return v1|
select bug9775(1),bug9775(2),bug9775(3),bug9775(4)|
bug9775(1) bug9775(2) bug9775(3) bug9775(4)
a b a,b
Warnings:
-Warning 1265 Data truncated for column 'bug9775(4)' at row 1
+Warning 1265 Data truncated for column 'bug9775(4)' at row 0
drop function bug9775|
drop function if exists bug8861|
create function bug8861(v1 int) returns year return v1|
@@ -3118,10 +3118,10 @@ create procedure bug9004_2(x char(16))
call bug9004_1(x)|
call bug9004_1('12345678901234567')|
Warnings:
-Warning 1265 Data truncated for column 'x' at row 1
+Warning 1265 Data truncated for column 'x' at row 0
call bug9004_2('12345678901234567890')|
Warnings:
-Warning 1265 Data truncated for column 'x' at row 1
+Warning 1265 Data truncated for column 'x' at row 0
delete from t1|
drop procedure bug9004_1|
drop procedure bug9004_2|
@@ -4591,7 +4591,7 @@ call bug15231_3()|
Result
Missed it (correct)
Level Code Message
-Warning 1366 Incorrect decimal value: 'zap' for column ``.``.`x` at row 1
+Warning 1366 Incorrect decimal value: 'zap' for column ``.``.`x` at row 0
Result
Caught it (correct)
call bug15231_5()|
@@ -6438,7 +6438,7 @@ DROP TABLE t1;
CALL p1('text');
Warnings:
-Warning 1265 Data truncated for column 'v' at row 1
+Warning 1265 Data truncated for column 'v' at row 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -6458,7 +6458,7 @@ DROP TABLE t1;
CALL p2('text');
Warnings:
-Warning 1366 Incorrect integer value: 'text' for column ``.``.`v` at row 1
+Warning 1366 Incorrect integer value: 'text' for column ``.``.`v` at row 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -7070,10 +7070,10 @@ CALL p1(4, 'a');
1
1
Warnings:
-Warning 1265 Data truncated for column 'b' at row 1
-Warning 1265 Data truncated for column 'b' at row 1
-Warning 1265 Data truncated for column 'b' at row 1
-Warning 1265 Data truncated for column 'b' at row 1
+Warning 1265 Data truncated for column 'b' at row 0
+Warning 1265 Data truncated for column 'b' at row 0
+Warning 1265 Data truncated for column 'b' at row 0
+Warning 1265 Data truncated for column 'b' at row 0
SET @@max_sp_recursion_depth= @save_max_sp_recursion;
DROP PROCEDURE p1;
DROP PROCEDURE IF EXISTS p1;
@@ -7091,7 +7091,7 @@ CAST('10 ' as UNSIGNED INTEGER)
1
1
Warnings:
-Warning 1265 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 0
Note 1292 Truncated incorrect INTEGER value: '10 '
DROP PROCEDURE p1;
DROP PROCEDURE IF EXISTS p1;
@@ -7144,7 +7144,7 @@ SELECT f1();
f1()
a
Warnings:
-Warning 1265 Data truncated for column 'f4()' at row 1
+Warning 1265 Data truncated for column 'f4()' at row 0
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP FUNCTION f3;
@@ -8932,3 +8932,15 @@ ERROR 42000: PROCEDURE does not support subqueries or stored functions
DROP TABLE t1;
# End of 10.4 tests
#
+#
+# MDEV-28129: MariaDB UAF issue at lex_end_nops(LEX*)
+#
+CREATE PROCEDURE sp() SELECT 1 INTO @;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
+CREATE PROCEDURE sp() SET @=1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=1' at line 1
+CREATE PROCEDURE sp() SELECT @;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
+#
+# End of 10.7 tests
+#
diff --git a/mysql-test/main/sp.test b/mysql-test/main/sp.test
index fd076ee9efe..9d0e05e4d1d 100644
--- a/mysql-test/main/sp.test
+++ b/mysql-test/main/sp.test
@@ -10506,3 +10506,20 @@ DROP TABLE t1;
--echo # End of 10.4 tests
--echo #
+
+--echo #
+--echo # MDEV-28129: MariaDB UAF issue at lex_end_nops(LEX*)
+--echo #
+
+--error ER_PARSE_ERROR
+CREATE PROCEDURE sp() SELECT 1 INTO @;
+
+--error ER_PARSE_ERROR
+CREATE PROCEDURE sp() SET @=1;
+
+--error ER_PARSE_ERROR
+CREATE PROCEDURE sp() SELECT @;
+
+--echo #
+--echo # End of 10.7 tests
+--echo #
diff --git a/mysql-test/main/trigger.result b/mysql-test/main/trigger.result
index a58986dc88a..d07be1b868f 100644
--- a/mysql-test/main/trigger.result
+++ b/mysql-test/main/trigger.result
@@ -2308,18 +2308,20 @@ DROP TABLE t1, t2;
set time_zone="+00:00";
SET TIMESTAMP=UNIX_TIMESTAMP('2001-01-01 10:20:30');
SET @@session.sql_mode = 'STRICT_ALL_TABLES,STRICT_TRANS_TABLES';
+set @rpt=1;
CREATE TABLE t1 (c CHAR(1) NOT NULL);
CREATE TRIGGER t1_bi
BEFORE INSERT
ON t1
FOR EACH ROW
BEGIN
-SET NEW.c = 'www';
+SET NEW.c = repeat(@rpt,@rpt);
+set @rpt=@rpt+1;
END;
|
SET @@session.sql_mode = default;
-INSERT INTO t1 VALUES ('a');
-ERROR 22001: Data too long for column 'c' at row 1
+INSERT INTO t1 VALUES ('a'),('b');
+ERROR 22001: Data too long for column 'c' at row 0
show create trigger t1_bi;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created
t1_bi STRICT_TRANS_TABLES,STRICT_ALL_TABLES CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi
@@ -2327,7 +2329,8 @@ BEFORE INSERT
ON t1
FOR EACH ROW
BEGIN
-SET NEW.c = 'www';
+SET NEW.c = repeat(@rpt,@rpt);
+set @rpt=@rpt+1;
END latin1 latin1_swedish_ci latin1_swedish_ci 2001-01-01 10:20:30.00
DROP TRIGGER t1_bi;
DROP TABLE t1;
diff --git a/mysql-test/main/trigger.test b/mysql-test/main/trigger.test
index 32827975e14..ef89f86590c 100644
--- a/mysql-test/main/trigger.test
+++ b/mysql-test/main/trigger.test
@@ -2627,6 +2627,7 @@ DROP TABLE t1, t2;
set time_zone="+00:00";
SET TIMESTAMP=UNIX_TIMESTAMP('2001-01-01 10:20:30');
SET @@session.sql_mode = 'STRICT_ALL_TABLES,STRICT_TRANS_TABLES';
+set @rpt=1;
CREATE TABLE t1 (c CHAR(1) NOT NULL);
DELIMITER |;
CREATE TRIGGER t1_bi
@@ -2634,13 +2635,14 @@ CREATE TRIGGER t1_bi
ON t1
FOR EACH ROW
BEGIN
- SET NEW.c = 'www';
+ SET NEW.c = repeat(@rpt,@rpt);
+ set @rpt=@rpt+1;
END;
|
DELIMITER ;|
SET @@session.sql_mode = default;
--error ER_DATA_TOO_LONG
-INSERT INTO t1 VALUES ('a');
+INSERT INTO t1 VALUES ('a'),('b'); # this is a BUG, must be "at row 2"
show create trigger t1_bi;
DROP TRIGGER t1_bi;
DROP TABLE t1;
diff --git a/mysql-test/main/truncate_notembedded.result b/mysql-test/main/truncate_notembedded.result
index 67beb79707c..e8bf6c2575b 100644
--- a/mysql-test/main/truncate_notembedded.result
+++ b/mysql-test/main/truncate_notembedded.result
@@ -5,7 +5,7 @@
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
LOCK TABLE t1 READ;
connect con1,localhost,root,,test;
-SET SESSION max_session_mem_used= 45500;
+SET SESSION max_session_mem_used= 8192;
LOCK TABLE t1 WRITE;
connection default;
SELECT * FROM t1;
@@ -13,6 +13,7 @@ a
UNLOCK TABLES;
connection con1;
TRUNCATE TABLE t1;
+ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement
disconnect con1;
connection default;
DROP TABLE t1;
diff --git a/mysql-test/main/truncate_notembedded.test b/mysql-test/main/truncate_notembedded.test
index 8b6d2becfa9..70da48f5a4f 100644
--- a/mysql-test/main/truncate_notembedded.test
+++ b/mysql-test/main/truncate_notembedded.test
@@ -9,7 +9,7 @@ CREATE TABLE t1 (a INT) ENGINE=MyISAM;
LOCK TABLE t1 READ;
--connect (con1,localhost,root,,test)
-SET SESSION max_session_mem_used= 45500;
+SET SESSION max_session_mem_used= 8192;
--send
LOCK TABLE t1 WRITE;
@@ -20,10 +20,7 @@ UNLOCK TABLES;
--connection con1
--error 0,ER_OPTION_PREVENTS_STATEMENT
--reap
-# This may work or fail as different servers uses different amount of
-# memory and the statement may work or not. What is important is that we
-# don't get a crash here!
---error 0,ER_OPTION_PREVENTS_STATEMENT
+--error ER_OPTION_PREVENTS_STATEMENT
TRUNCATE TABLE t1;
--disconnect con1
diff --git a/mysql-test/main/type_date.result b/mysql-test/main/type_date.result
index ae3a51c96da..950e2a7951a 100644
--- a/mysql-test/main/type_date.result
+++ b/mysql-test/main/type_date.result
@@ -391,7 +391,7 @@ call test5041();
d
2013-09-21
Warnings:
-Note 1265 Data truncated for column 'd' at row 1
+Note 1265 Data truncated for column 'd' at row 0
drop procedure test5041;
SET @@timestamp=DEFAULT;
#
diff --git a/mysql-test/main/type_datetime.result b/mysql-test/main/type_datetime.result
index 3c1baf82167..77d77d218f0 100644
--- a/mysql-test/main/type_datetime.result
+++ b/mysql-test/main/type_datetime.result
@@ -199,7 +199,7 @@ CAST(CAST('10:11:12.098700' AS TIME(6)) AS DECIMAL(20,6))
set @org_mode=@@sql_mode;
create table t1 (da date default '1962-03-03 23:33:34', dt datetime default '1962-03-03');
Warnings:
-Note 1265 Data truncated for column 'da' at row 1
+Note 1265 Data truncated for column 'da' at row 0
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -595,7 +595,7 @@ End of 5.0 tests
set @org_mode=@@sql_mode;
create table t1 (da date default '1962-03-03 23:33:34', dt datetime default '1962-03-03');
Warnings:
-Note 1265 Data truncated for column 'da' at row 1
+Note 1265 Data truncated for column 'da' at row 0
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/main/type_decimal.result b/mysql-test/main/type_decimal.result
index 0228652f74c..7bf3b52970a 100644
--- a/mysql-test/main/type_decimal.result
+++ b/mysql-test/main/type_decimal.result
@@ -1091,7 +1091,7 @@ a
Warnings:
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated
Warning 1292 Truncated incorrect DECIMAL value: '.00000000000000000000000000000000000001e111111111111111111111'
-Warning 1264 Out of range value for column 'a' at row 1
+Warning 1264 Out of range value for column 'a' at row 0
CREATE TABLE t1 (str VARCHAR(128), comment VARCHAR(128));
INSERT INTO t1 VALUES
('0e111111111111111111111', 'Zero mantissa and a huge positive exponent'),
@@ -1152,13 +1152,13 @@ CAST(str AS DECIMAL(38,0))
Level Code Message
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated
Warning 1292 Truncated incorrect DECIMAL value: '1e111111111111111111111'
-Warning 1264 Out of range value for column 'CAST(str AS DECIMAL(38,0))' at row 1
+Warning 1264 Out of range value for column 'CAST(str AS DECIMAL(38,0))' at row 2
CAST(CONCAT(str,'garbage') AS DECIMAL(38,0))
99999999999999999999999999999999999999
Level Code Message
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated
Warning 1292 Truncated incorrect DECIMAL value: '1e111111111111111111111garbage'
-Warning 1264 Out of range value for column 'CAST(CONCAT(str,'garbage') AS DECIMAL(38,0))' at row 1
+Warning 1264 Out of range value for column 'CAST(CONCAT(str,'garbage') AS DECIMAL(38,0))' at row 2
DROP TABLE t1;
#
# End of 10.2 tests
diff --git a/mysql-test/main/type_newdecimal.result b/mysql-test/main/type_newdecimal.result
index b76ba029ad6..8b04b750e69 100644
--- a/mysql-test/main/type_newdecimal.result
+++ b/mysql-test/main/type_newdecimal.result
@@ -956,14 +956,14 @@ f6 decimal unsigned not null default 199.91,
f7 decimal unsigned not null default 999.9,
f8 decimal unsigned not null default 9999.99);
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
-Note 1265 Data truncated for column 'f2' at row 1
-Note 1265 Data truncated for column 'f3' at row 1
-Note 1265 Data truncated for column 'f4' at row 1
-Note 1265 Data truncated for column 'f5' at row 1
-Note 1265 Data truncated for column 'f6' at row 1
-Note 1265 Data truncated for column 'f7' at row 1
-Note 1265 Data truncated for column 'f8' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
+Note 1265 Data truncated for column 'f2' at row 0
+Note 1265 Data truncated for column 'f3' at row 0
+Note 1265 Data truncated for column 'f4' at row 0
+Note 1265 Data truncated for column 'f5' at row 0
+Note 1265 Data truncated for column 'f6' at row 0
+Note 1265 Data truncated for column 'f7' at row 0
+Note 1265 Data truncated for column 'f8' at row 0
insert into t1 (f1) values (1);
select * from t1;
f1 f2 f3 f4 f5 f6 f7 f8
@@ -1458,8 +1458,8 @@ cast(a as DECIMAL(3,2))
9.99
Warnings:
Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
-Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
-Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 2
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 3
select cast(a as DECIMAL(3,2)), count(*)
from (select 11.1233 as a
UNION select 11.1234
@@ -1470,8 +1470,8 @@ cast(a as DECIMAL(3,2)) count(*)
Warnings:
Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
-Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
-Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 2
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 3
create table t1 (s varchar(100));
insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875);
drop table t1;
@@ -2292,7 +2292,7 @@ a
DROP TABLE t1;
CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '1e-10000');
Warnings:
-Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'a' at row 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -2301,7 +2301,7 @@ t1 CREATE TABLE `t1` (
DROP TABLE t1;
CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '0.1 ');
Warnings:
-Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'a' at row 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -2310,7 +2310,7 @@ t1 CREATE TABLE `t1` (
DROP TABLE t1;
CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '0.10001 ');
Warnings:
-Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'a' at row 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -2319,7 +2319,7 @@ t1 CREATE TABLE `t1` (
DROP TABLE t1;
CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT '0.10001');
Warnings:
-Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'a' at row 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -2328,7 +2328,7 @@ t1 CREATE TABLE `t1` (
DROP TABLE t1;
CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 0.10001);
Warnings:
-Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'a' at row 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -2337,7 +2337,7 @@ t1 CREATE TABLE `t1` (
DROP TABLE t1;
CREATE TABLE t1 (a DECIMAL(2,1) DEFAULT 0.10001e0);
Warnings:
-Note 1265 Data truncated for column 'a' at row 1
+Note 1265 Data truncated for column 'a' at row 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/main/type_time_hires.result b/mysql-test/main/type_time_hires.result
index c7fecbef76b..661ca0e98f5 100644
--- a/mysql-test/main/type_time_hires.result
+++ b/mysql-test/main/type_time_hires.result
@@ -271,8 +271,8 @@ create table t1 (a time(6), b time(6));
create procedure foo(x time, y time(4)) insert into t1 values (x, y);
call foo('2010-02-03 4:5:6.789123', '2010-02-03 4:5:6.789123');
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
-Note 1265 Data truncated for column 'y' at row 1
+Note 1265 Data truncated for column 'x' at row 0
+Note 1265 Data truncated for column 'y' at row 0
select * from t1;
a b
04:05:06.000000 04:05:06.789100
@@ -284,7 +284,7 @@ insert t1 values (b, c + interval a microsecond);
end|
call bar(1111111, '2011-01-02 3:4:5.123456');
Warnings:
-Note 1265 Data truncated for column 'c' at row 1
+Note 1265 Data truncated for column 'c' at row 0
select * from t1;
a b
04:05:06.000000 04:05:06.789100
@@ -297,7 +297,7 @@ select xyz('1:1:1.010101');
xyz('1:1:1.010101')
11:11:11.1111
Warnings:
-Note 1265 Data truncated for column 'xyz('1:1:1.010101')' at row 1
+Note 1265 Data truncated for column 'xyz('1:1:1.010101')' at row 0
drop function xyz;
create view v1 as select * from t1 group by a,b;
select * from v1;
diff --git a/mysql-test/main/type_varchar.result b/mysql-test/main/type_varchar.result
index e42a363a2c2..cfc8218b8ab 100644
--- a/mysql-test/main/type_varchar.result
+++ b/mysql-test/main/type_varchar.result
@@ -710,14 +710,14 @@ CREATE TABLE t1 (c VARCHAR(1) DEFAULT 'foo');
ERROR 42000: Invalid default value for 'c'
SHOW WARNINGS;
Level Code Message
-Warning 1265 Data truncated for column 'c' at row 1
+Warning 1265 Data truncated for column 'c' at row 0
Error 1067 Invalid default value for 'c'
SET sql_mode='STRICT_ALL_TABLES';
CREATE TABLE t1 (c VARCHAR(1) DEFAULT 'foo');
ERROR 42000: Invalid default value for 'c'
SHOW WARNINGS;
Level Code Message
-Warning 1265 Data truncated for column 'c' at row 1
+Warning 1265 Data truncated for column 'c' at row 0
Error 1067 Invalid default value for 'c'
CREATE TABLE t1 (c VARCHAR(1));
SET sql_mode='';
@@ -725,14 +725,14 @@ ALTER TABLE t1 ALTER column c SET DEFAULT 'foo';
ERROR 42000: Invalid default value for 'c'
SHOW WARNINGS;
Level Code Message
-Warning 1265 Data truncated for column 'c' at row 1
+Warning 1265 Data truncated for column 'c' at row 0
Error 1067 Invalid default value for 'c'
SET sql_mode='STRICT_ALL_TABLES';
ALTER TABLE t1 ALTER column c SET DEFAULT 'foo';
ERROR 42000: Invalid default value for 'c'
SHOW WARNINGS;
Level Code Message
-Warning 1265 Data truncated for column 'c' at row 1
+Warning 1265 Data truncated for column 'c' at row 0
Error 1067 Invalid default value for 'c'
DROP TABLE t1;
SET sql_mode=DEFAULT;
diff --git a/mysql-test/main/union.test b/mysql-test/main/union.test
index a34e76591ec..6c0203f2a5f 100644
--- a/mysql-test/main/union.test
+++ b/mysql-test/main/union.test
@@ -1896,7 +1896,7 @@ set @save_default_storage_engine=@@default_storage_engine;
SET @@default_storage_engine=MEMORY;
CREATE TABLE t1 SELECT NULL UNION SELECT NULL;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
ALTER TABLE t1 ADD INDEX (`PRIMARY`);
CREATE TABLE t2 SELECT NULL;
diff --git a/mysql-test/main/view_debug.test b/mysql-test/main/view_debug.test
index 0e448ae2721..bf8074ddeb1 100644
--- a/mysql-test/main/view_debug.test
+++ b/mysql-test/main/view_debug.test
@@ -1,5 +1,6 @@
--source include/have_debug.inc
+--source include/have_debug_sync.inc
--echo #
--echo #MDEV-8087:Server crashed in Time_and_counter_tracker::incr_loops
diff --git a/mysql-test/suite/atomic/alter_partition,innodb.rdiff b/mysql-test/suite/atomic/alter_partition,innodb.rdiff
new file mode 100644
index 00000000000..571136eb626
--- /dev/null
+++ b/mysql-test/suite/atomic/alter_partition,innodb.rdiff
@@ -0,0 +1,525 @@
+--- alter_partition.result
++++ alter_partition,innodb.reject
+@@ -17,12 +17,9 @@
+ end $
+ # QUERY: ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
+ # CRASH: crash_create_before_create_frm
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -38,12 +35,9 @@
+ 12
+ 22
+ # CRASH: crash_alter_partition_after_create_frm
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -59,12 +53,9 @@
+ 12
+ 22
+ # CRASH: crash_alter_partition_after_write_frm
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -80,12 +71,9 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_1
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -101,12 +89,9 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_2
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -122,12 +107,9 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_3
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -143,12 +125,9 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_4
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -164,12 +143,9 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_5
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -185,12 +161,9 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_6
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -206,12 +179,9 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_7
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -227,12 +197,9 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_8
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ Table Create Table
+@@ -248,15 +215,12 @@
+ 12
+ 22
+ # CRASH: crash_convert_partition_9
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp1.MYD
+-tp1.MYI
+ tp1.frm
++tp1.ibd
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+@@ -275,15 +239,12 @@
+ x
+ 12
+ # CRASH: crash_convert_partition_10
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp1.MYD
+-tp1.MYI
+ tp1.frm
++tp1.ibd
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+@@ -302,15 +263,12 @@
+ x
+ 12
+ # CRASH: crash_convert_partition_11
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp1.MYD
+-tp1.MYI
+ tp1.frm
++tp1.ibd
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+@@ -330,14 +288,10 @@
+ 12
+ # QUERY: ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+ # NO CRASH: crash_create_before_create_frm
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#p2.MYD
+-t1#P#p2.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#p2.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+@@ -357,14 +311,10 @@
+ 32
+ 39
+ # NO CRASH: crash_alter_partition_after_create_frm
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#p2.MYD
+-t1#P#p2.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#p2.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+@@ -384,14 +334,10 @@
+ 32
+ 39
+ # NO CRASH: crash_alter_partition_after_write_frm
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#p2.MYD
+-t1#P#p2.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#p2.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+@@ -411,17 +357,13 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_1
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp2.MYD
+-tp2.MYI
+ tp2.frm
++tp2.ibd
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+@@ -442,17 +384,13 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_2
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp2.MYD
+-tp2.MYI
+ tp2.frm
++tp2.ibd
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+@@ -473,17 +411,13 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_3
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp2.MYD
+-tp2.MYI
+ tp2.frm
++tp2.ibd
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+@@ -504,17 +438,13 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_4
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp2.MYD
+-tp2.MYI
+ tp2.frm
++tp2.ibd
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+@@ -535,17 +465,13 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_5
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp2.MYD
+-tp2.MYI
+ tp2.frm
++tp2.ibd
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+@@ -566,17 +492,13 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_6
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp2.MYD
+-tp2.MYI
+ tp2.frm
++tp2.ibd
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+@@ -597,17 +519,13 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_7
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp2.MYD
+-tp2.MYI
+ tp2.frm
++tp2.ibd
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+@@ -628,17 +546,13 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_8
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+-tp2.MYD
+-tp2.MYI
+ tp2.frm
++tp2.ibd
+ Table Create Table
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+@@ -659,14 +573,10 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_9
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#p2.MYD
+-t1#P#p2.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#p2.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+@@ -686,14 +596,10 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_10
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#p2.MYD
+-t1#P#p2.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#p2.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+@@ -713,14 +619,10 @@
+ 32
+ 39
+ # CRASH: crash_convert_partition_11
+-t1#P#p0.MYD
+-t1#P#p0.MYI
+-t1#P#p1.MYD
+-t1#P#p1.MYI
+-t1#P#p2.MYD
+-t1#P#p2.MYI
+-t1#P#pn.MYD
+-t1#P#pn.MYI
++t1#P#p0.ibd
++t1#P#p1.ibd
++t1#P#p2.ibd
++t1#P#pn.ibd
+ t1.frm
+ t1.par
+ master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
diff --git a/mysql-test/suite/atomic/alter_partition.combinations b/mysql-test/suite/atomic/alter_partition.combinations
new file mode 100644
index 00000000000..898d2f2f332
--- /dev/null
+++ b/mysql-test/suite/atomic/alter_partition.combinations
@@ -0,0 +1,6 @@
+[innodb]
+innodb
+
+[myisam]
+
+[aria]
diff --git a/mysql-test/suite/atomic/alter_partition.result b/mysql-test/suite/atomic/alter_partition.result
new file mode 100644
index 00000000000..250aa56b7a1
--- /dev/null
+++ b/mysql-test/suite/atomic/alter_partition.result
@@ -0,0 +1,743 @@
+# Crash recovery
+create or replace procedure prepare_table(r int)
+begin
+create or replace table t1 (x int)
+with system versioning
+partition by range(x) (
+partition p0 values less than (10),
+partition p1 values less than (20),
+partition pn values less than (30));
+insert into t1 values (2), (12), (22);
+if r > 1 then
+create or replace table tp2 (x int)
+with system versioning;
+insert into tp2 values (32), (39);
+end if;
+flush tables;
+end $
+# QUERY: ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
+# CRASH: crash_create_before_create_frm
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_alter_partition_after_create_frm
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_alter_partition_after_write_frm
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_1
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_2
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_3
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_4
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_5
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_6
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_7
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_8
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+# CRASH: crash_convert_partition_9
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp1.MYD
+tp1.MYI
+tp1.frm
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+22
+Table Create Table
+tp1 CREATE TABLE `tp1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+x
+12
+# CRASH: crash_convert_partition_10
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp1.MYD
+tp1.MYI
+tp1.frm
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+22
+Table Create Table
+tp1 CREATE TABLE `tp1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+x
+12
+# CRASH: crash_convert_partition_11
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp1.MYD
+tp1.MYI
+tp1.frm
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+22
+Table Create Table
+tp1 CREATE TABLE `tp1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+x
+12
+# QUERY: ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+# NO CRASH: crash_create_before_create_frm
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+32
+39
+# NO CRASH: crash_alter_partition_after_create_frm
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+32
+39
+# NO CRASH: crash_alter_partition_after_write_frm
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+32
+39
+# CRASH: crash_convert_partition_1
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+x
+32
+39
+# CRASH: crash_convert_partition_2
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+x
+32
+39
+# CRASH: crash_convert_partition_3
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+x
+32
+39
+# CRASH: crash_convert_partition_4
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+x
+32
+39
+# CRASH: crash_convert_partition_5
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+x
+32
+39
+# CRASH: crash_convert_partition_6
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+x
+32
+39
+# CRASH: crash_convert_partition_7
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+x
+32
+39
+# CRASH: crash_convert_partition_8
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+x
+32
+39
+# CRASH: crash_convert_partition_9
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+32
+39
+# CRASH: crash_convert_partition_10
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+32
+39
+# CRASH: crash_convert_partition_11
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p1` VALUES LESS THAN (20) ENGINE = DEFAULT_ENGINE,
+ PARTITION `pn` VALUES LESS THAN (30) ENGINE = DEFAULT_ENGINE,
+ PARTITION `p2` VALUES LESS THAN (40) ENGINE = DEFAULT_ENGINE)
+x
+2
+12
+22
+32
+39
+Warnings:
+Note 1051 Unknown table 'test.t1'
diff --git a/mysql-test/suite/atomic/alter_partition.test b/mysql-test/suite/atomic/alter_partition.test
new file mode 100644
index 00000000000..23b996cf5a1
--- /dev/null
+++ b/mysql-test/suite/atomic/alter_partition.test
@@ -0,0 +1,174 @@
+--source include/have_partition.inc
+--source include/have_debug.inc
+--source include/have_sequence.inc
+--source include/binlog_combinations.inc
+--source include/have_binlog_format_row_or_statement.inc
+--source include/not_valgrind.inc
+
+let $default_engine=InnoDB;
+let $extra_option=;
+let $save_debug=`select @@debug_dbug`;
+
+if ($MTR_COMBINATION_MYISAM)
+{
+ let $default_engine=MyISAM;
+}
+if ($MTR_COMBINATION_ARIA)
+{
+ let $default_engine=Aria;
+ let $extra_option=transactional=1;
+}
+
+if ($MTR_COMBINATION_STMT)
+{
+ let $binlog_format=include/set_binlog_format_statement.sql;
+}
+if ($MTR_COMBINATION_ROW)
+{
+ let $binlog_format=include/set_binlog_format_row.sql;
+}
+
+--disable_query_log
+--eval set @@default_storage_engine=$default_engine
+--enable_query_log
+
+--echo # Crash recovery
+
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+
+let $crash_count= 14;
+let $crash_points='crash_create_before_create_frm',
+ 'crash_alter_partition_after_create_frm',
+ 'crash_alter_partition_after_write_frm',
+ 'crash_convert_partition_1',
+ 'crash_convert_partition_2',
+ 'crash_convert_partition_3',
+ 'crash_convert_partition_4',
+ 'crash_convert_partition_5',
+ 'crash_convert_partition_6',
+ 'crash_convert_partition_7',
+ 'crash_convert_partition_8',
+ 'crash_convert_partition_9',
+ 'crash_convert_partition_10',
+ 'crash_convert_partition_11';
+
+#let $crash_count= 1;
+#let $crash_points= 'crash_convert_partition_10';
+
+let $statement_count= 2;
+let $statements= 'ALTER TABLE t1 CONVERT PARTITION p1 TO TABLE tp1',
+ 'ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)';
+
+#let $statement_count= 1;
+#let $statements= 'ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 values less than (40)';
+
+--delimiter $
+create or replace procedure prepare_table(r int)
+begin
+ create or replace table t1 (x int)
+ with system versioning
+ partition by range(x) (
+ partition p0 values less than (10),
+ partition p1 values less than (20),
+ partition pn values less than (30));
+ insert into t1 values (2), (12), (22);
+
+ if r > 1 then
+ create or replace table tp2 (x int)
+ with system versioning;
+ insert into tp2 values (32), (39);
+ end if;
+
+ flush tables;
+end $
+--delimiter ;
+
+let $old_debug=`select @@debug_dbug`;
+
+let $keep_include_silent=1;
+let $grep_script=ALTER;
+--disable_query_log
+
+let $r=0;
+while ($r < $statement_count)
+{
+ inc $r;
+ let $statement=`select ELT($r, $statements)`;
+ --echo # QUERY: $statement
+
+ let $c=0;
+ while ($c < $crash_count)
+ {
+ inc $c;
+ let $crash=`select ELT($c, $crash_points)`;
+
+ --eval set @@default_storage_engine=$default_engine
+ eval call prepare_table($r);
+ if (!$c)
+ {
+ lock tables t1 write;
+ }
+
+ --source $binlog_format
+
+ RESET MASTER;
+ --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+ --disable_reconnect
+ --eval set @@debug_dbug="+d,$crash"
+ let $errno=0;
+ --error 0,2013
+ --eval $statement;
+ let $error=$errno;
+ --enable_reconnect
+ --source include/wait_until_connected_again.inc
+ --disable_query_log
+ --eval set @@debug_dbug="$old_debug"
+
+ if ($error == 0)
+ {
+ --echo # NO CRASH: $crash
+ }
+ if ($error)
+ {
+ --echo # CRASH: $crash
+ }
+ # Check which tables still exists
+ --replace_result MAI MYI MAD MYD
+ --list_files $MYSQLD_DATADIR/test t*
+ --replace_regex /backup-\d+/backup/
+ --list_files $MYSQLD_DATADIR/test *sql*
+ --remove_files_wildcard $MYSQLD_DATADIR/test *sql-backup-*
+
+ --let $binlog_file=master-bin.000001
+ --source include/show_binlog_events.inc
+ if ($error)
+ {
+ --let $binlog_file=master-bin.000002
+ --source include/show_binlog_events.inc
+ }
+
+ --replace_result $default_engine DEFAULT_ENGINE ' PAGE_CHECKSUM=1' ''
+ show create table t1;
+ select * from t1;
+ --replace_result $default_engine DEFAULT_ENGINE ' PAGE_CHECKSUM=1' ''
+ --error 0, ER_NO_SUCH_TABLE
+ show create table tp1;
+ --error 0, ER_NO_SUCH_TABLE
+ select * from tp1;
+ --replace_result $default_engine DEFAULT_ENGINE ' PAGE_CHECKSUM=1' ''
+ --error 0, ER_NO_SUCH_TABLE
+ show create table tp2;
+ --error 0, ER_NO_SUCH_TABLE
+ select * from tp2;
+ # Drop the tables. The warnings will show what was dropped
+ --disable_warnings
+ drop table t1;
+ drop table if exists tp1;
+ --enable_warnings
+ }
+}
+drop table if exists t1;
+drop procedure prepare_table;
+--eval set @@debug_dbug="$save_debug"
+
+--enable_query_log
diff --git a/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.result b/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.result
index 936f604be2e..71332034b15 100644
--- a/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.result
+++ b/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.result
@@ -41,16 +41,16 @@ select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
ROW ROW
CREATE TABLE t1 (a varchar(100));
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+prepare stmt1 from 'insert into t1 select concat(SYS_GUID(),?)';
set @string="emergency_1_";
insert into t1 values("work_2_");
execute stmt1 using @string;
deallocate prepare stmt1;
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_3_"));
+insert into t1 values(concat(SYS_GUID(),"work_3_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_4_",UUID()));
+insert into t1 values(concat("for_4_",SYS_GUID()));
insert into t1 select "yesterday_5_";
create temporary table tmp(a char(100));
insert into tmp values("see_6_");
@@ -116,43 +116,43 @@ set binlog_format=default;
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
MIXED MIXED
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+prepare stmt1 from 'insert into t1 select concat(SYS_GUID(),?)';
set @string="emergency_17_";
insert into t1 values("work_18_");
execute stmt1 using @string;
deallocate prepare stmt1;
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_19_"));
+insert into t1 values(concat(SYS_GUID(),"work_19_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_20_",UUID()));
+insert into t1 values(concat("for_20_",SYS_GUID()));
insert into t1 select "yesterday_21_";
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_22_"));
+insert into t1 values(concat(SYS_GUID(),"work_22_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_23_",UUID()));
+insert into t1 values(concat("for_23_",SYS_GUID()));
insert into t1 select "yesterday_24_";
-create table t2 ENGINE=MyISAM select rpad(UUID(),100,' ');
-create table t3 select 1 union select UUID();
+create table t2 ENGINE=MyISAM select rpad(SYS_GUID(),100,' ');
+create table t3 select 1 union select SYS_GUID();
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
-create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
+create table t4 select * from t1 where 3 in (select 1 union select 2 union select SYS_GUID() union select 3);
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
Warnings:
Warning 1292 Truncated incorrect datetime value: '3'
-insert ignore into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
+insert ignore into t5 select SYS_GUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
create procedure foo()
begin
insert into t1 values("work_25_");
-insert into t1 values(concat("for_26_",UUID()));
+insert into t1 values(concat("for_26_",SYS_GUID()));
insert into t1 select "yesterday_27_";
end|
create procedure foo2()
begin
-insert into t1 values(concat("emergency_28_",UUID()));
+insert into t1 values(concat("emergency_28_",SYS_GUID()));
insert into t1 values("work_29_");
-insert into t1 values(concat("for_30_",UUID()));
+insert into t1 values(concat("for_30_",SYS_GUID()));
set session binlog_format=row; # accepted for stored procs
insert into t1 values("more work_31_");
set session binlog_format=mixed;
@@ -171,7 +171,7 @@ end|
call foo();
call foo2();
call foo4("hello");
-call foo4(UUID());
+call foo4(SYS_GUID());
call foo4("world");
select foo3();
ERROR HY000: Cannot change the binary logging format inside a stored function or trigger
@@ -207,7 +207,7 @@ foo4()
deallocate prepare stmt1;
create function foo5() returns bigint unsigned
begin
-insert into t2 select UUID();
+insert into t2 select SYS_GUID();
return 100;
end|
select foo5();
@@ -229,18 +229,18 @@ end|
select foo6("foo6_1_");
foo6("foo6_1_")
100
-select foo6(concat("foo6_2_",UUID()));
-foo6(concat("foo6_2_",UUID()))
+select foo6(concat("foo6_2_",SYS_GUID()));
+foo6(concat("foo6_2_",SYS_GUID()))
100
-prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))';
+prepare stmt1 from 'select foo6(concat("foo6_3_",SYS_GUID()))';
execute stmt1;
-foo6(concat("foo6_3_",UUID()))
+foo6(concat("foo6_3_",SYS_GUID()))
100
execute stmt1;
-foo6(concat("foo6_3_",UUID()))
+foo6(concat("foo6_3_",SYS_GUID()))
100
deallocate prepare stmt1;
-create view v1 as select uuid();
+create view v1 as select SYS_GUID();
create table t11 (data varchar(255));
insert into t11 select * from v1;
insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11');
@@ -250,11 +250,11 @@ execute stmt1;
deallocate prepare stmt1;
create trigger t11_bi before insert on t11 for each row
begin
-set NEW.data = concat(NEW.data,UUID());
+set NEW.data = concat(NEW.data,SYS_GUID());
end|
insert into t11 values("try_560_");
insert delayed into t2 values("delay_1_");
-insert delayed into t2 values(concat("delay_2_",UUID()));
+insert delayed into t2 values(concat("delay_2_",SYS_GUID()));
insert delayed into t2 values("delay_6_");
insert delayed into t2 values(rand());
set @a=2.345;
@@ -356,7 +356,7 @@ alter table t1 modify a int, drop primary key;
insert into t1 values(null,"try_57_");
connection slave;
connection master;
-CREATE TEMPORARY TABLE t15 SELECT UUID();
+CREATE TEMPORARY TABLE t15 SELECT SYS_GUID();
create table t16 like t15;
INSERT INTO t16 SELECT * FROM t15;
insert into t16 values("try_65_");
@@ -427,7 +427,7 @@ DROP TABLE IF EXISTS t12;
SET SESSION BINLOG_FORMAT=MIXED;
CREATE TABLE t12 (data LONG);
LOCK TABLES t12 WRITE;
-INSERT INTO t12 VALUES(UUID());
+INSERT INTO t12 VALUES(SYS_GUID());
UNLOCK TABLES;
connection slave;
connection master;
diff --git a/mysql-test/suite/compat/oracle/r/sp-cursor.result b/mysql-test/suite/compat/oracle/r/sp-cursor.result
index 2e0c43c8b87..d7e88430bc7 100644
--- a/mysql-test/suite/compat/oracle/r/sp-cursor.result
+++ b/mysql-test/suite/compat/oracle/r/sp-cursor.result
@@ -454,12 +454,12 @@ CALL p1('1b');
msg
Fetched a record a=1
Warnings:
-Warning 1265 Data truncated for column 'p_a' at row 1
+Warning 1265 Data truncated for column 'p_a' at row 0
CALL p1('b1');
msg
Fetched a record a=0
Warnings:
-Warning 1366 Incorrect integer value: 'b1' for column ``.``.`p_a` at row 1
+Warning 1366 Incorrect integer value: 'b1' for column ``.``.`p_a` at row 0
DROP PROCEDURE p1;
#
# One parameter in SELECT list + subselect
diff --git a/mysql-test/suite/compat/oracle/r/sp-param.result b/mysql-test/suite/compat/oracle/r/sp-param.result
index 2f119e62189..ec7fe445c92 100644
--- a/mysql-test/suite/compat/oracle/r/sp-param.result
+++ b/mysql-test/suite/compat/oracle/r/sp-param.result
@@ -152,7 +152,7 @@ begin
call p1(w,'0123456789');
end;
/
-ERROR 22001: Data too long for column 'pinout' at row 1
+ERROR 22001: Data too long for column 'pinout' at row 0
declare w varchar(20);
begin
w:='aaa';
@@ -165,7 +165,7 @@ w:='aaa';
call p1(w,'0123456789');
end;
/
-ERROR 22001: Data too long for column 'pinout' at row 1
+ERROR 22001: Data too long for column 'pinout' at row 0
declare str varchar(6000);
pout varchar(6000);
begin
@@ -184,7 +184,7 @@ call p1(pout,str);
select length(pout);
end;
/
-ERROR 22001: Data too long for column 'pinout' at row 1
+ERROR 22001: Data too long for column 'pinout' at row 0
declare str varchar(40000);
pout varchar(60000);
begin
@@ -203,7 +203,7 @@ call p1(pout,str);
select length(pout);
end;
/
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
declare str text(80000);
pout text(80000);
begin
@@ -240,7 +240,7 @@ CALL p2(11);
LENGTH(pinout)
10
Warnings:
-Warning 1265 Data truncated for column 'pinout' at row 1
+Warning 1265 Data truncated for column 'pinout' at row 0
DROP PROCEDURE p1;
DROP PROCEDURE p2;
SET sql_mode=ORACLE;
@@ -261,12 +261,12 @@ CALL p2(65535);
LENGTH(f1(str,padlen))
65532
Warnings:
-Warning 1265 Data truncated for column 'pin' at row 1
+Warning 1265 Data truncated for column 'pin' at row 0
CALL p2(65536);
LENGTH(f1(str,padlen))
65532
Warnings:
-Warning 1265 Data truncated for column 'pin' at row 1
+Warning 1265 Data truncated for column 'pin' at row 0
DROP PROCEDURE p2;
DROP FUNCTION f1;
SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
@@ -290,9 +290,9 @@ CALL p2(21844);
length(pout)
21844
CALL p2(21845);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(21846);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
DROP PROCEDURE p2;
DROP PROCEDURE p1;
SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
@@ -316,9 +316,9 @@ CALL p2(21844);
length(pout)
21844
CALL p2(21845);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(21846);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
DROP PROCEDURE p2;
DROP PROCEDURE p1;
SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
@@ -339,13 +339,13 @@ CALL p2(65532);
LENGTH(f1(str,padlen))
65532
CALL p2(65533);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(65534);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(65535);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(65536);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
DROP PROCEDURE p2;
DROP FUNCTION f1;
SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
@@ -366,9 +366,9 @@ CALL p2(21844);
LENGTH(f1(str,padlen))
21844
CALL p2(21845);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(21846);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
DROP PROCEDURE p2;
DROP FUNCTION f1;
SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
@@ -389,9 +389,9 @@ CALL p2(21844);
LENGTH(f1(str,padlen))
21844
CALL p2(21845);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(21846);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
DROP PROCEDURE p2;
DROP FUNCTION f1;
SET sql_mode='ORACLE,STRICT_TRANS_TABLES';
@@ -412,12 +412,12 @@ CALL p2(65532);
LENGTH(f1(str,padlen))
65532
CALL p2(65533);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(65534);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(65535);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
CALL p2(65536);
-ERROR 22001: Data too long for column 'pin' at row 1
+ERROR 22001: Data too long for column 'pin' at row 0
DROP PROCEDURE p2;
DROP FUNCTION f1;
diff --git a/mysql-test/suite/compat/oracle/r/sp.result b/mysql-test/suite/compat/oracle/r/sp.result
index 961872d5746..44092c0be30 100644
--- a/mysql-test/suite/compat/oracle/r/sp.result
+++ b/mysql-test/suite/compat/oracle/r/sp.result
@@ -1286,7 +1286,7 @@ CALL p1();
a b
127 200
Warnings:
-Warning 1264 Out of range value for column 'a' at row 1
+Warning 1264 Out of range value for column 'a' at row 0
DROP PROCEDURE p1;
DROP TABLE t1;
#
diff --git a/mysql-test/suite/encryption/r/corrupted_during_recovery.result b/mysql-test/suite/encryption/r/corrupted_during_recovery.result
index 356dce64f8d..2b29bf260e1 100644
--- a/mysql-test/suite/encryption/r/corrupted_during_recovery.result
+++ b/mysql-test/suite/encryption/r/corrupted_during_recovery.result
@@ -9,7 +9,7 @@ INSERT INTO t2 VALUES(2);
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
SELECT * FROM t1;
-ERROR 42S02: Table 'test.t1' doesn't exist in engine
+ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
SELECT * FROM t2;
a
2
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change.result b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
index 1ca9d784d57..e2034f14e31 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
@@ -1,10 +1,10 @@
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` (has an unreadable root page|is corrupted)");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` has an unreadable root page");
+call mtr.add_suppression("Table .*t[12].* 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[12]\\.ibd' cannot be decrypted; key_version=1");
call mtr.add_suppression("failed to read \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t1.ibd looks corrupted; key_version=1");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` is corrupted");
call mtr.add_suppression("File '.*mysql-test.std_data.keysbad3\\.txt' not found");
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
# Start server with keys2.txt
@@ -46,29 +46,29 @@ INSERT INTO t2 VALUES ('foobar',1,2);
SELECT * FROM t2;
ERROR 42S02: Table 'test.t2' doesn't exist in engine
SELECT * FROM t2 where id = 1;
-ERROR 42S02: Table 'test.t2' doesn't exist in engine
+ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
SELECT * FROM t2 where b = 1;
-ERROR 42S02: Table 'test.t2' doesn't exist in engine
+ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
INSERT INTO t2 VALUES ('tmp',3,3);
-ERROR 42S02: Table 'test.t2' doesn't exist in engine
+ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
DELETE FROM t2 where b = 3;
-ERROR 42S02: Table 'test.t2' doesn't exist in engine
+ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
DELETE FROM t2 where id = 3;
-ERROR 42S02: Table 'test.t2' doesn't exist in engine
+ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
UPDATE t2 set b = b +1;
-ERROR 42S02: Table 'test.t2' doesn't exist in engine
+ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
OPTIMIZE TABLE t2;
Table Op Msg_type Msg_text
-test.t2 optimize Error Table 'test.t2' doesn't exist in engine
-test.t2 optimize status Operation failed
+test.t2 optimize Error Table test/t2 is corrupted. Please drop the table and recreate.
+test.t2 optimize error Corrupt
ALTER TABLE t2 ADD COLUMN d INT;
-ERROR 42S02: Table 'test.t2' doesn't exist in engine
+ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
-test.t2 analyze Error Table 'test.t2' doesn't exist in engine
-test.t2 analyze status Operation failed
+test.t2 analyze Error Table test/t2 is corrupted. Please drop the table and recreate.
+test.t2 analyze error Corrupt
TRUNCATE TABLE t2;
-ERROR 42S02: Table 'test.t2' doesn't exist in engine
+ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
DROP TABLE t2;
# Start server with keys2.txt
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 1c19525638f..d2ea45dc949 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
@@ -1,9 +1,9 @@
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted|does not exist.*is trying to rename)");
+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("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("InnoDB: Table `test`\\.`t1` is corrupted");
+call mtr.add_suppression("Table .*t1.* is corrupted");
call mtr.add_suppression("InnoDB: Cannot delete tablespace .* because it is not found in the tablespace memory cache");
call mtr.add_suppression("InnoDB: ALTER TABLE `test`\\.`t1` DISCARD TABLESPACE failed to find tablespace");
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
@@ -19,20 +19,20 @@ SHOW WARNINGS;
Level Code Message
Error 1932 Table 'test.t1' doesn't exist in engine
ALTER TABLE t1 ENGINE=InnoDB;
-ERROR 42S02: Table 'test.t1' doesn't exist in engine
+ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
SHOW WARNINGS;
Level Code Message
-Error 1932 Table 'test.t1' doesn't exist in engine
+Error 1877 Table test/t1 is corrupted. Please drop the table and recreate.
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
-test.t1 optimize Error Table 'test.t1' doesn't exist in engine
-test.t1 optimize status Operation failed
+test.t1 optimize Error Table test/t1 is corrupted. Please drop the table and recreate.
+test.t1 optimize error Corrupt
SHOW WARNINGS;
Level Code Message
CHECK TABLE t1;
Table Op Msg_type Msg_text
-test.t1 check Error Table 'test.t1' doesn't exist in engine
-test.t1 check status Operation failed
+test.t1 check Error Table test/t1 is corrupted. Please drop the table and recreate.
+test.t1 check error Corrupt
SHOW WARNINGS;
Level Code Message
# restart: --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
@@ -65,5 +65,5 @@ t1 CREATE TABLE `t1` (
RENAME TABLE t1 TO t1new;
ERROR HY000: Error on rename of './test/t1' to './test/t1new' (errno: 155 "The table does not exist in the storage engine")
ALTER TABLE t1 RENAME TO t1new;
-ERROR 42S02: Table 'test.t1' doesn't exist in engine
+ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
DROP TABLE t1;
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 7d90b3b42ae..a5a6d65e4a2 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
@@ -1,8 +1,8 @@
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)");
+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("Couldn't load plugins from 'file_key_management");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
+call mtr.add_suppression("Table .*t1.* is corrupted");
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
# restart: --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
SET GLOBAL innodb_file_per_table = ON;
@@ -18,8 +18,8 @@ SHOW WARNINGS;
Level Code Message
CHECK TABLE t1;
Table Op Msg_type Msg_text
-test.t1 check Error Table 'test.t1' doesn't exist in engine
-test.t1 check status Operation failed
+test.t1 check Error Table test/t1 is corrupted. Please drop the table and recreate.
+test.t1 check error Corrupt
SHOW WARNINGS;
Level Code Message
# restart: --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
diff --git a/mysql-test/suite/encryption/r/innodb-missing-key.result b/mysql-test/suite/encryption/r/innodb-missing-key.result
index ecb4ad2c40e..c8aadfd5172 100644
--- a/mysql-test/suite/encryption/r/innodb-missing-key.result
+++ b/mysql-test/suite/encryption/r/innodb-missing-key.result
@@ -1,8 +1,8 @@
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)");
+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: 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("InnoDB: Table `test`\\.`t1` is corrupted");
+call mtr.add_suppression("Table .*t1.* is corrupted");
# Start server with keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
CREATE TABLE t1(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=19;
@@ -40,9 +40,9 @@ COUNT(1)
SELECT COUNT(1) FROM t2,t1 where t2.a = t1.a;
ERROR 42S02: Table 'test.t1' doesn't exist in engine
SELECT COUNT(1) FROM t1 where b = 'ab';
-ERROR 42S02: Table 'test.t1' doesn't exist in engine
+ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
SELECT COUNT(1) FROM t1;
-ERROR 42S02: Table 'test.t1' doesn't exist in engine
+ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
# Start server with keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
diff --git a/mysql-test/suite/encryption/t/corrupted_during_recovery.test b/mysql-test/suite/encryption/t/corrupted_during_recovery.test
index 70650d0f746..f838ea04c28 100644
--- a/mysql-test/suite/encryption/t/corrupted_during_recovery.test
+++ b/mysql-test/suite/encryption/t/corrupted_during_recovery.test
@@ -6,7 +6,7 @@ call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed read of file '.*test.t1\\.ibd' page");
-call mtr.add_suppression("InnoDB: Failed to read page [123] from file '.*test.t1\\.ibd': Table is encrypted but decrypt failed");
+call mtr.add_suppression("InnoDB: Failed to read page [123] from file '.*test.t1\\.ibd': Table is compressed or encrypted but uncompress or decrypt failed");
call mtr.add_suppression("InnoDB: The page \\[page id: space=\\d+, page number=3\\] in file '.*test.t1\\.ibd' cannot be decrypted");
call mtr.add_suppression("InnoDB: Table in tablespace \\d+ encrypted. However key management plugin or used key_version \\d+ is not found or used encryption algorithm or method does not match. Can't continue opening the table.");
--enable_query_log
@@ -54,12 +54,12 @@ EOF
SELECT * FROM t1;
--disable_query_log
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t[1].ibd looks corrupted; key_version=");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted. Please drop the table and recreate.");
+call mtr.add_suppression("Table .*t1.* is corrupted. Please drop the table and recreate.");
--enable_query_log
let $restart_parameters=--innodb_force_recovery=1 --skip-innodb-buffer-pool-load-at-startup;
--source include/restart_mysqld.inc
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
SELECT * FROM t1;
SELECT * FROM t2;
CHECK TABLE t2;
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change.test b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
index 30beff4bd85..05a3b5f4d06 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
@@ -10,11 +10,11 @@
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` (has an unreadable root page|is corrupted)");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` has an unreadable root page");
+call mtr.add_suppression("Table .*t[12].* 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[12]\\.ibd' cannot be decrypted; key_version=1");
call mtr.add_suppression("failed to read \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t1.ibd looks corrupted; key_version=1");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` is corrupted");
call mtr.add_suppression("File '.*mysql-test.std_data.keysbad3\\.txt' not found");
# for innodb_checksum_algorithm=full_crc32 only
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
@@ -75,32 +75,32 @@ INSERT INTO t2 VALUES ('foobar',1,2);
--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT * FROM t2;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
SELECT * FROM t2 where id = 1;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
SELECT * FROM t2 where b = 1;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
INSERT INTO t2 VALUES ('tmp',3,3);
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
DELETE FROM t2 where b = 3;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
DELETE FROM t2 where id = 3;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
UPDATE t2 set b = b +1;
OPTIMIZE TABLE t2;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
ALTER TABLE t2 ADD COLUMN d INT;
ANALYZE TABLE t2;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
TRUNCATE TABLE t2;
DROP TABLE t2;
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 58787c65ef1..8a3ecf9deb0 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
@@ -8,13 +8,13 @@
# MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys
# MDEV-8727: Server/InnoDB hangs on shutdown after trying to read an encrypted table with a wrong key
#
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted|does not exist.*is trying to rename)");
+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]*\\]");
# 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\\.");
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
+call mtr.add_suppression("Table .*t1.* is corrupted");
call mtr.add_suppression("InnoDB: Cannot delete tablespace .* because it is not found in the tablespace memory cache");
call mtr.add_suppression("InnoDB: ALTER TABLE `test`\\.`t1` DISCARD TABLESPACE failed to find tablespace");
# for innodb_checksum_algorithm=full_crc32 only
@@ -36,7 +36,7 @@ INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
SELECT * FROM t1;
--replace_regex /key_id [1-9][0-9]*/\1 /
SHOW WARNINGS;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
ALTER TABLE t1 ENGINE=InnoDB;
--replace_regex /key_id [1-9][0-9]*/\1 /
SHOW WARNINGS;
@@ -97,7 +97,7 @@ SHOW CREATE TABLE t1;
--error ER_ERROR_ON_RENAME
RENAME TABLE t1 TO t1new;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
ALTER TABLE t1 RENAME TO t1new;
-# Drop should pass even with incorrect keys
+# Drop should succeed even with incorrect keys
DROP TABLE t1;
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 fdcffa25428..3b4dfb8c1f2 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
@@ -7,12 +7,12 @@
# MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys
#
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)");
+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]*\\]");
# 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: Table `test`\\.`t1` is corrupted");
+call mtr.add_suppression("Table .*t1.* is corrupted");
# for innodb_checksum_algorithm=full_crc32 only
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
diff --git a/mysql-test/suite/encryption/t/innodb-missing-key.test b/mysql-test/suite/encryption/t/innodb-missing-key.test
index 0b81d37ac50..7935ea00efa 100644
--- a/mysql-test/suite/encryption/t/innodb-missing-key.test
+++ b/mysql-test/suite/encryption/t/innodb-missing-key.test
@@ -7,11 +7,11 @@
# MDEV-11004: Unable to start (Segfault or os error 2) when encryption key missing
#
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)");
+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: 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("InnoDB: Table `test`\\.`t1` is corrupted");
+call mtr.add_suppression("Table .*t1.* is corrupted");
--echo # Start server with keys2.txt
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
@@ -48,9 +48,9 @@ SELECT COUNT(1) FROM t3;
SELECT COUNT(1) FROM t2;
--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT COUNT(1) FROM t2,t1 where t2.a = t1.a;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
SELECT COUNT(1) FROM t1 where b = 'ab';
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
SELECT COUNT(1) FROM t1;
--echo
diff --git a/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result
index 936f604be2e..71332034b15 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result
@@ -41,16 +41,16 @@ select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
ROW ROW
CREATE TABLE t1 (a varchar(100));
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+prepare stmt1 from 'insert into t1 select concat(SYS_GUID(),?)';
set @string="emergency_1_";
insert into t1 values("work_2_");
execute stmt1 using @string;
deallocate prepare stmt1;
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_3_"));
+insert into t1 values(concat(SYS_GUID(),"work_3_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_4_",UUID()));
+insert into t1 values(concat("for_4_",SYS_GUID()));
insert into t1 select "yesterday_5_";
create temporary table tmp(a char(100));
insert into tmp values("see_6_");
@@ -116,43 +116,43 @@ set binlog_format=default;
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
MIXED MIXED
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+prepare stmt1 from 'insert into t1 select concat(SYS_GUID(),?)';
set @string="emergency_17_";
insert into t1 values("work_18_");
execute stmt1 using @string;
deallocate prepare stmt1;
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_19_"));
+insert into t1 values(concat(SYS_GUID(),"work_19_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_20_",UUID()));
+insert into t1 values(concat("for_20_",SYS_GUID()));
insert into t1 select "yesterday_21_";
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_22_"));
+insert into t1 values(concat(SYS_GUID(),"work_22_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_23_",UUID()));
+insert into t1 values(concat("for_23_",SYS_GUID()));
insert into t1 select "yesterday_24_";
-create table t2 ENGINE=MyISAM select rpad(UUID(),100,' ');
-create table t3 select 1 union select UUID();
+create table t2 ENGINE=MyISAM select rpad(SYS_GUID(),100,' ');
+create table t3 select 1 union select SYS_GUID();
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
-create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
+create table t4 select * from t1 where 3 in (select 1 union select 2 union select SYS_GUID() union select 3);
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
Warnings:
Warning 1292 Truncated incorrect datetime value: '3'
-insert ignore into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
+insert ignore into t5 select SYS_GUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
create procedure foo()
begin
insert into t1 values("work_25_");
-insert into t1 values(concat("for_26_",UUID()));
+insert into t1 values(concat("for_26_",SYS_GUID()));
insert into t1 select "yesterday_27_";
end|
create procedure foo2()
begin
-insert into t1 values(concat("emergency_28_",UUID()));
+insert into t1 values(concat("emergency_28_",SYS_GUID()));
insert into t1 values("work_29_");
-insert into t1 values(concat("for_30_",UUID()));
+insert into t1 values(concat("for_30_",SYS_GUID()));
set session binlog_format=row; # accepted for stored procs
insert into t1 values("more work_31_");
set session binlog_format=mixed;
@@ -171,7 +171,7 @@ end|
call foo();
call foo2();
call foo4("hello");
-call foo4(UUID());
+call foo4(SYS_GUID());
call foo4("world");
select foo3();
ERROR HY000: Cannot change the binary logging format inside a stored function or trigger
@@ -207,7 +207,7 @@ foo4()
deallocate prepare stmt1;
create function foo5() returns bigint unsigned
begin
-insert into t2 select UUID();
+insert into t2 select SYS_GUID();
return 100;
end|
select foo5();
@@ -229,18 +229,18 @@ end|
select foo6("foo6_1_");
foo6("foo6_1_")
100
-select foo6(concat("foo6_2_",UUID()));
-foo6(concat("foo6_2_",UUID()))
+select foo6(concat("foo6_2_",SYS_GUID()));
+foo6(concat("foo6_2_",SYS_GUID()))
100
-prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))';
+prepare stmt1 from 'select foo6(concat("foo6_3_",SYS_GUID()))';
execute stmt1;
-foo6(concat("foo6_3_",UUID()))
+foo6(concat("foo6_3_",SYS_GUID()))
100
execute stmt1;
-foo6(concat("foo6_3_",UUID()))
+foo6(concat("foo6_3_",SYS_GUID()))
100
deallocate prepare stmt1;
-create view v1 as select uuid();
+create view v1 as select SYS_GUID();
create table t11 (data varchar(255));
insert into t11 select * from v1;
insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11');
@@ -250,11 +250,11 @@ execute stmt1;
deallocate prepare stmt1;
create trigger t11_bi before insert on t11 for each row
begin
-set NEW.data = concat(NEW.data,UUID());
+set NEW.data = concat(NEW.data,SYS_GUID());
end|
insert into t11 values("try_560_");
insert delayed into t2 values("delay_1_");
-insert delayed into t2 values(concat("delay_2_",UUID()));
+insert delayed into t2 values(concat("delay_2_",SYS_GUID()));
insert delayed into t2 values("delay_6_");
insert delayed into t2 values(rand());
set @a=2.345;
@@ -356,7 +356,7 @@ alter table t1 modify a int, drop primary key;
insert into t1 values(null,"try_57_");
connection slave;
connection master;
-CREATE TEMPORARY TABLE t15 SELECT UUID();
+CREATE TEMPORARY TABLE t15 SELECT SYS_GUID();
create table t16 like t15;
INSERT INTO t16 SELECT * FROM t15;
insert into t16 values("try_65_");
@@ -427,7 +427,7 @@ DROP TABLE IF EXISTS t12;
SET SESSION BINLOG_FORMAT=MIXED;
CREATE TABLE t12 (data LONG);
LOCK TABLES t12 WRITE;
-INSERT INTO t12 VALUES(UUID());
+INSERT INTO t12 VALUES(SYS_GUID());
UNLOCK TABLES;
connection slave;
connection master;
diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_reorg_divide.result b/mysql-test/suite/engines/funcs/r/tc_partition_reorg_divide.result
index 22463593106..1553f7b4fbb 100644
--- a/mysql-test/suite/engines/funcs/r/tc_partition_reorg_divide.result
+++ b/mysql-test/suite/engines/funcs/r/tc_partition_reorg_divide.result
@@ -51,7 +51,7 @@ t1 CREATE TABLE `t1` (
PARTITION `p2` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION s2;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -132,7 +132,7 @@ t1 CREATE TABLE `t1` (
PARTITION `p2` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION s2;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -213,7 +213,7 @@ t1 CREATE TABLE `t1` (
PARTITION `p2` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION s2;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -294,7 +294,7 @@ t1 CREATE TABLE `t1` (
PARTITION `p2` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION s2;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -375,7 +375,7 @@ t1 CREATE TABLE `t1` (
PARTITION `p2` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION s2;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -456,7 +456,7 @@ t1 CREATE TABLE `t1` (
PARTITION `p2` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION s2;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
c1 c2
diff --git a/mysql-test/suite/engines/funcs/r/tc_partition_reorg_merge.result b/mysql-test/suite/engines/funcs/r/tc_partition_reorg_merge.result
index 89681d5ec65..a0c078dc0fb 100644
--- a/mysql-test/suite/engines/funcs/r/tc_partition_reorg_merge.result
+++ b/mysql-test/suite/engines/funcs/r/tc_partition_reorg_merge.result
@@ -46,7 +46,7 @@ t1 CREATE TABLE `t1` (
PARTITION `m0` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION m1;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -117,7 +117,7 @@ t1 CREATE TABLE `t1` (
PARTITION `m0` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION m1;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -188,7 +188,7 @@ t1 CREATE TABLE `t1` (
PARTITION `m0` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION m1;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -259,7 +259,7 @@ t1 CREATE TABLE `t1` (
PARTITION `m0` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION m1;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -330,7 +330,7 @@ t1 CREATE TABLE `t1` (
PARTITION `m0` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION m1;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
c1 c2
@@ -401,7 +401,7 @@ t1 CREATE TABLE `t1` (
PARTITION `m0` VALUES LESS THAN (30) ENGINE = ENGINE,
PARTITION `p3` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 DROP PARTITION m1;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
c1 c2
diff --git a/mysql-test/suite/engines/funcs/t/tc_partition_reorg_divide.test b/mysql-test/suite/engines/funcs/t/tc_partition_reorg_divide.test
index 89a75bb06af..03f4ccb23df 100644
--- a/mysql-test/suite/engines/funcs/t/tc_partition_reorg_divide.test
+++ b/mysql-test/suite/engines/funcs/t/tc_partition_reorg_divide.test
@@ -21,7 +21,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION s2;
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
@@ -52,7 +52,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION s2;
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
@@ -83,7 +83,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION s2;
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
@@ -114,7 +114,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION s2;
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
@@ -145,7 +145,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION s2;
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
@@ -176,7 +176,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION s2;
ALTER TABLE t1 DROP PARTITION s1;
SELECT * FROM t1 ORDER BY c1;
diff --git a/mysql-test/suite/engines/funcs/t/tc_partition_reorg_merge.test b/mysql-test/suite/engines/funcs/t/tc_partition_reorg_merge.test
index fe9b0ba108f..e2059ff6336 100644
--- a/mysql-test/suite/engines/funcs/t/tc_partition_reorg_merge.test
+++ b/mysql-test/suite/engines/funcs/t/tc_partition_reorg_merge.test
@@ -18,7 +18,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION m1;
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
@@ -46,7 +46,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION m1;
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
@@ -74,7 +74,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION m1;
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
@@ -102,7 +102,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION m1;
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
@@ -130,7 +130,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION m1;
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
@@ -158,7 +158,7 @@ SHOW TABLES;
let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`;
--replace_result $ENGINE ENGINE
SHOW CREATE TABLE t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
ALTER TABLE t1 DROP PARTITION m1;
ALTER TABLE t1 DROP PARTITION m0;
SELECT * FROM t1 ORDER BY c1;
diff --git a/mysql-test/suite/federated/error_row_number.result b/mysql-test/suite/federated/error_row_number.result
new file mode 100644
index 00000000000..a53f3a87a17
--- /dev/null
+++ b/mysql-test/suite/federated/error_row_number.result
@@ -0,0 +1,26 @@
+#
+# MDEV-26654 ROW_NUMBER is wrong upon INSERT into Federated table
+#
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
+CREATE DATABASE federated;
+connection slave;
+CREATE DATABASE federated;
+connection master;
+create table t (pk int primary key);
+create table tfed engine=FEDERATED connection='mysql://root@localhost:$MASTER_MYPORT/test/t';
+insert into tfed values (1),(2),(1);
+ERROR 23000: Can't write; duplicate key in table 'tfed'
+get diagnostics condition 1 @val = row_number;
+# federated is doing bulk insert here, the exact row number is unknown
+select @val;
+@val
+0
+drop table tfed, t;
+connection master;
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE IF EXISTS federated;
+connection slave;
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/error_row_number.test b/mysql-test/suite/federated/error_row_number.test
new file mode 100644
index 00000000000..8d943589e07
--- /dev/null
+++ b/mysql-test/suite/federated/error_row_number.test
@@ -0,0 +1,18 @@
+--echo #
+--echo # MDEV-26654 ROW_NUMBER is wrong upon INSERT into Federated table
+--echo #
+
+--source suite/federated/have_federatedx.inc
+--source include/federated.inc
+--connection master
+
+create table t (pk int primary key);
+--evalp create table tfed engine=FEDERATED connection='mysql://root@localhost:$MASTER_MYPORT/test/t'
+--error ER_DUP_KEY
+insert into tfed values (1),(2),(1);
+get diagnostics condition 1 @val = row_number;
+--echo # federated is doing bulk insert here, the exact row number is unknown
+select @val;
+
+drop table tfed, t;
+--source include/federated_cleanup.inc
diff --git a/mysql-test/suite/funcs_1/r/innodb_func_view.result b/mysql-test/suite/funcs_1/r/innodb_func_view.result
index 445a9101a37..c87cdde72ca 100644
--- a/mysql-test/suite/funcs_1/r/innodb_func_view.result
+++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result
@@ -3322,9 +3322,9 @@ NULL NULL 1
-3333.33 -3333.3333 30
Warnings:
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated
-Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 2
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated
-Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 3
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as decimal(37,2)) AS `CAST(my_double AS DECIMAL(37,2))`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_0102.result b/mysql-test/suite/funcs_1/r/innodb_trig_0102.result
index 36115ecad83..b44ef1fdee2 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_0102.result
@@ -55,9 +55,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5.1.1:
------------------
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03.result b/mysql-test/suite/funcs_1/r/innodb_trig_03.result
index 31fc4407dce..92cbff3fafb 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_03.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase 3.5.3:
---------------
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_0407.result b/mysql-test/suite/funcs_1/r/innodb_trig_0407.result
index fb5d105448f..d551575960e 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_0407.result
@@ -57,9 +57,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5:
--------------
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_08.result b/mysql-test/suite/funcs_1/r/innodb_trig_08.result
index 98613a20b49..2a57496800e 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_08.result
@@ -57,9 +57,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5:
--------------
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_09.result b/mysql-test/suite/funcs_1/r/innodb_trig_09.result
index 6664994543b..89815594a7e 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_09.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_09.result
@@ -55,9 +55,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result b/mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result
index f4a6d75fbc0..e8276a60451 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result
@@ -55,9 +55,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_innodb.result b/mysql-test/suite/funcs_1/r/is_columns_innodb.result
index fbca906a9fb..beb8ad88de1 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_innodb.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_innodb.result
@@ -63,19 +63,19 @@ f57 numeric (0) not null DEFAULT 99,
f58 numeric (64) not null DEFAULT 99
) engine = innodb;
Warnings:
-Note 1265 Data truncated for column 'f36' at row 1
-Note 1265 Data truncated for column 'f37' at row 1
-Note 1265 Data truncated for column 'f38' at row 1
-Note 1265 Data truncated for column 'f39' at row 1
-Note 1265 Data truncated for column 'f40' at row 1
-Note 1265 Data truncated for column 'f41' at row 1
-Note 1265 Data truncated for column 'f42' at row 1
-Note 1265 Data truncated for column 'f43' at row 1
-Note 1265 Data truncated for column 'f44' at row 1
-Note 1265 Data truncated for column 'f45' at row 1
-Note 1265 Data truncated for column 'f47' at row 1
-Note 1265 Data truncated for column 'f49' at row 1
-Note 1265 Data truncated for column 'f51' at row 1
+Note 1265 Data truncated for column 'f36' at row 0
+Note 1265 Data truncated for column 'f37' at row 0
+Note 1265 Data truncated for column 'f38' at row 0
+Note 1265 Data truncated for column 'f39' at row 0
+Note 1265 Data truncated for column 'f40' at row 0
+Note 1265 Data truncated for column 'f41' at row 0
+Note 1265 Data truncated for column 'f42' at row 0
+Note 1265 Data truncated for column 'f43' at row 0
+Note 1265 Data truncated for column 'f44' at row 0
+Note 1265 Data truncated for column 'f45' at row 0
+Note 1265 Data truncated for column 'f47' at row 0
+Note 1265 Data truncated for column 'f49' at row 0
+Note 1265 Data truncated for column 'f51' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb1.txt'
into table tb1;
drop table if exists tb2 ;
@@ -198,9 +198,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = innodb;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb3.txt'
into table tb3;
drop table if exists tb4;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_memory.result b/mysql-test/suite/funcs_1/r/is_columns_memory.result
index 5eaa5b08cc2..b33d6a28efb 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_memory.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_memory.result
@@ -56,22 +56,22 @@ f57 numeric (0) not null DEFAULT 99,
f58 numeric (64) not null DEFAULT 99
) engine = memory;
Warnings:
-Note 1265 Data truncated for column 'f33' at row 1
-Note 1265 Data truncated for column 'f34' at row 1
-Note 1265 Data truncated for column 'f35' at row 1
-Note 1265 Data truncated for column 'f36' at row 1
-Note 1265 Data truncated for column 'f37' at row 1
-Note 1265 Data truncated for column 'f38' at row 1
-Note 1265 Data truncated for column 'f39' at row 1
-Note 1265 Data truncated for column 'f40' at row 1
-Note 1265 Data truncated for column 'f41' at row 1
-Note 1265 Data truncated for column 'f42' at row 1
-Note 1265 Data truncated for column 'f43' at row 1
-Note 1265 Data truncated for column 'f44' at row 1
-Note 1265 Data truncated for column 'f45' at row 1
-Note 1265 Data truncated for column 'f47' at row 1
-Note 1265 Data truncated for column 'f49' at row 1
-Note 1265 Data truncated for column 'f51' at row 1
+Note 1265 Data truncated for column 'f33' at row 0
+Note 1265 Data truncated for column 'f34' at row 0
+Note 1265 Data truncated for column 'f35' at row 0
+Note 1265 Data truncated for column 'f36' at row 0
+Note 1265 Data truncated for column 'f37' at row 0
+Note 1265 Data truncated for column 'f38' at row 0
+Note 1265 Data truncated for column 'f39' at row 0
+Note 1265 Data truncated for column 'f40' at row 0
+Note 1265 Data truncated for column 'f41' at row 0
+Note 1265 Data truncated for column 'f42' at row 0
+Note 1265 Data truncated for column 'f43' at row 0
+Note 1265 Data truncated for column 'f44' at row 0
+Note 1265 Data truncated for column 'f45' at row 0
+Note 1265 Data truncated for column 'f47' at row 0
+Note 1265 Data truncated for column 'f49' at row 0
+Note 1265 Data truncated for column 'f51' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb1.txt'
into table tb1;
drop table if exists tb2 ;
@@ -188,9 +188,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = memory;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
drop table if exists tb4 ;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam.result b/mysql-test/suite/funcs_1/r/is_columns_myisam.result
index 4426583ac4c..e7a8a176188 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_myisam.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_myisam.result
@@ -64,22 +64,22 @@ f57 numeric (0) not null DEFAULT 99,
f58 numeric (64) not null DEFAULT 99
) engine = myisam;
Warnings:
-Note 1265 Data truncated for column 'f33' at row 1
-Note 1265 Data truncated for column 'f34' at row 1
-Note 1265 Data truncated for column 'f35' at row 1
-Note 1265 Data truncated for column 'f36' at row 1
-Note 1265 Data truncated for column 'f37' at row 1
-Note 1265 Data truncated for column 'f38' at row 1
-Note 1265 Data truncated for column 'f39' at row 1
-Note 1265 Data truncated for column 'f40' at row 1
-Note 1265 Data truncated for column 'f41' at row 1
-Note 1265 Data truncated for column 'f42' at row 1
-Note 1265 Data truncated for column 'f43' at row 1
-Note 1265 Data truncated for column 'f44' at row 1
-Note 1265 Data truncated for column 'f45' at row 1
-Note 1265 Data truncated for column 'f47' at row 1
-Note 1265 Data truncated for column 'f49' at row 1
-Note 1265 Data truncated for column 'f51' at row 1
+Note 1265 Data truncated for column 'f33' at row 0
+Note 1265 Data truncated for column 'f34' at row 0
+Note 1265 Data truncated for column 'f35' at row 0
+Note 1265 Data truncated for column 'f36' at row 0
+Note 1265 Data truncated for column 'f37' at row 0
+Note 1265 Data truncated for column 'f38' at row 0
+Note 1265 Data truncated for column 'f39' at row 0
+Note 1265 Data truncated for column 'f40' at row 0
+Note 1265 Data truncated for column 'f41' at row 0
+Note 1265 Data truncated for column 'f42' at row 0
+Note 1265 Data truncated for column 'f43' at row 0
+Note 1265 Data truncated for column 'f44' at row 0
+Note 1265 Data truncated for column 'f45' at row 0
+Note 1265 Data truncated for column 'f47' at row 0
+Note 1265 Data truncated for column 'f49' at row 0
+Note 1265 Data truncated for column 'f51' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb1.txt'
into table tb1;
drop table if exists tb2 ;
@@ -210,9 +210,9 @@ f174 numeric (0),
f175 numeric (64)
) Engine = myisam;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb3.txt'
into table tb3;
drop table if exists tb4 ;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
index 6faa8d7b51a..d44732f5dd5 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
@@ -64,22 +64,22 @@ f57 numeric (0) not null DEFAULT 99,
f58 numeric (64) not null DEFAULT 99
) engine = myisam;
Warnings:
-Note 1265 Data truncated for column 'f33' at row 1
-Note 1265 Data truncated for column 'f34' at row 1
-Note 1265 Data truncated for column 'f35' at row 1
-Note 1265 Data truncated for column 'f36' at row 1
-Note 1265 Data truncated for column 'f37' at row 1
-Note 1265 Data truncated for column 'f38' at row 1
-Note 1265 Data truncated for column 'f39' at row 1
-Note 1265 Data truncated for column 'f40' at row 1
-Note 1265 Data truncated for column 'f41' at row 1
-Note 1265 Data truncated for column 'f42' at row 1
-Note 1265 Data truncated for column 'f43' at row 1
-Note 1265 Data truncated for column 'f44' at row 1
-Note 1265 Data truncated for column 'f45' at row 1
-Note 1265 Data truncated for column 'f47' at row 1
-Note 1265 Data truncated for column 'f49' at row 1
-Note 1265 Data truncated for column 'f51' at row 1
+Note 1265 Data truncated for column 'f33' at row 0
+Note 1265 Data truncated for column 'f34' at row 0
+Note 1265 Data truncated for column 'f35' at row 0
+Note 1265 Data truncated for column 'f36' at row 0
+Note 1265 Data truncated for column 'f37' at row 0
+Note 1265 Data truncated for column 'f38' at row 0
+Note 1265 Data truncated for column 'f39' at row 0
+Note 1265 Data truncated for column 'f40' at row 0
+Note 1265 Data truncated for column 'f41' at row 0
+Note 1265 Data truncated for column 'f42' at row 0
+Note 1265 Data truncated for column 'f43' at row 0
+Note 1265 Data truncated for column 'f44' at row 0
+Note 1265 Data truncated for column 'f45' at row 0
+Note 1265 Data truncated for column 'f47' at row 0
+Note 1265 Data truncated for column 'f49' at row 0
+Note 1265 Data truncated for column 'f51' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb1.txt'
into table tb1;
drop table if exists tb2 ;
@@ -210,9 +210,9 @@ f174 numeric (0),
f175 numeric (64)
) Engine = myisam;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb3.txt'
into table tb3;
drop table if exists tb4 ;
diff --git a/mysql-test/suite/funcs_1/r/is_routines_embedded.result b/mysql-test/suite/funcs_1/r/is_routines_embedded.result
index 19e9494386e..62f306f6d6a 100644
--- a/mysql-test/suite/funcs_1/r/is_routines_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_routines_embedded.result
@@ -197,7 +197,7 @@ sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NUL
SELECT * FROM db_datadict_2.res_6_408002_2;
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
-check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'THREAD_POOL_SIZE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert') AND TRIGGER_SCHEMA != 'sys'; SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA != 'sys'; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
+check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'THREAD_POOL_SIZE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert') AND TRIGGER_SCHEMA != 'sys'; SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA != 'sys'; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_STATUS != 'INACTIVE'; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
AddGeometryColumn def mysql AddGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin
set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss mariadb.sys@localhost latin1 latin1_swedish_ci latin1_swedish_ci
@@ -213,7 +213,7 @@ sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NUL
SELECT * FROM db_datadict_2.res_6_408002_2;
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
-check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'THREAD_POOL_SIZE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert') AND TRIGGER_SCHEMA != 'sys'; SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA != 'sys'; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
+check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'THREAD_POOL_SIZE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert') AND TRIGGER_SCHEMA != 'sys'; SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA != 'sys'; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_STATUS != 'INACTIVE'; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
AddGeometryColumn def mysql AddGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin
set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss mariadb.sys@localhost latin1 latin1_swedish_ci latin1_swedish_ci
@@ -229,7 +229,7 @@ sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NUL
SELECT * FROM db_datadict_2.res_6_408002_2;
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
-check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'THREAD_POOL_SIZE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert') AND TRIGGER_SCHEMA != 'sys'; SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA != 'sys'; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
+check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'THREAD_POOL_SIZE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert') AND TRIGGER_SCHEMA != 'sys'; SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA != 'sys'; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_STATUS != 'INACTIVE'; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
AddGeometryColumn def mysql AddGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin
set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss mariadb.sys@localhost latin1 latin1_swedish_ci latin1_swedish_ci
diff --git a/mysql-test/suite/funcs_1/r/memory_func_view.result b/mysql-test/suite/funcs_1/r/memory_func_view.result
index 961c140f856..6dd12ddc11c 100644
--- a/mysql-test/suite/funcs_1/r/memory_func_view.result
+++ b/mysql-test/suite/funcs_1/r/memory_func_view.result
@@ -3323,9 +3323,9 @@ NULL NULL 1
-3333.33 -3333.3333 30
Warnings:
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated
-Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 2
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated
-Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 3
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as decimal(37,2)) AS `CAST(my_double AS DECIMAL(37,2))`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_0102.result b/mysql-test/suite/funcs_1/r/memory_trig_0102.result
index 4608fc8302a..975c014512f 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_0102.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5.1.1:
------------------
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03.result b/mysql-test/suite/funcs_1/r/memory_trig_03.result
index 87f26acff46..68969afc97f 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_03.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase 3.5.3:
---------------
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_0407.result b/mysql-test/suite/funcs_1/r/memory_trig_0407.result
index 7228c4cffd9..ceae360946c 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_0407.result
@@ -57,9 +57,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5:
--------------
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_08.result b/mysql-test/suite/funcs_1/r/memory_trig_08.result
index 32324600ad5..c9d6454dc5b 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_08.result
@@ -57,9 +57,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5:
--------------
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_09.result b/mysql-test/suite/funcs_1/r/memory_trig_09.result
index 7579418dc1f..b3e5e109b82 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_09.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_09.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_1011ext.result b/mysql-test/suite/funcs_1/r/memory_trig_1011ext.result
index 63b8b643820..fa767e51eb5 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_1011ext.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_1011ext.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
diff --git a/mysql-test/suite/funcs_1/r/myisam_func_view.result b/mysql-test/suite/funcs_1/r/myisam_func_view.result
index 961c140f856..6dd12ddc11c 100644
--- a/mysql-test/suite/funcs_1/r/myisam_func_view.result
+++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result
@@ -3323,9 +3323,9 @@ NULL NULL 1
-3333.33 -3333.3333 30
Warnings:
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated
-Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 2
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated
-Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
+Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 3
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as decimal(37,2)) AS `CAST(my_double AS DECIMAL(37,2))`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_0102.result b/mysql-test/suite/funcs_1/r/myisam_trig_0102.result
index 4608fc8302a..975c014512f 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_0102.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_0102.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5.1.1:
------------------
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03.result b/mysql-test/suite/funcs_1/r/myisam_trig_03.result
index 87f26acff46..68969afc97f 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_03.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase 3.5.3:
---------------
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_0407.result b/mysql-test/suite/funcs_1/r/myisam_trig_0407.result
index 7228c4cffd9..ceae360946c 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_0407.result
@@ -57,9 +57,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5:
--------------
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_08.result b/mysql-test/suite/funcs_1/r/myisam_trig_08.result
index 32324600ad5..c9d6454dc5b 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_08.result
@@ -57,9 +57,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
Testcase: 3.5:
--------------
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_09.result b/mysql-test/suite/funcs_1/r/myisam_trig_09.result
index 7579418dc1f..b3e5e109b82 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_09.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_09.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result b/mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result
index e73e0413469..72e5dc938e3 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result
@@ -56,9 +56,9 @@ f174 numeric (0),
f175 numeric (64)
) engine = <engine_to_be_used>;
Warnings:
-Note 1265 Data truncated for column 'f150' at row 1
-Note 1265 Data truncated for column 'f151' at row 1
-Note 1265 Data truncated for column 'f152' at row 1
+Note 1265 Data truncated for column 'f150' at row 0
+Note 1265 Data truncated for column 'f151' at row 0
+Note 1265 Data truncated for column 'f152' at row 0
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
into table tb3;
diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result
index 1d6b631ce04..d2cc9353518 100644
--- a/mysql-test/suite/funcs_1/r/storedproc.result
+++ b/mysql-test/suite/funcs_1/r/storedproc.result
@@ -106,7 +106,7 @@ CALL sp1( 34 );
@v1
3
Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
+Warning 1265 Data truncated for column 'f1' at row 0
SHOW PROCEDURE STATUS WHERE db = 'db_storedproc';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
db_storedproc sp1 PROCEDURE root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
@@ -1430,7 +1430,7 @@ f1
value1
Warnings:
Note 1291 Column 'f1' has duplicated value 'value1' in SET
-Warning 1265 Data truncated for column 'f1' at row 1
+Warning 1265 Data truncated for column 'f1' at row 0
SHOW PROCEDURE STATUS WHERE db = 'db_storedproc';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
db_storedproc sp1 PROCEDURE root@localhost <modified> <created> INVOKER this is simple latin1 latin1_swedish_ci latin1_swedish_ci
@@ -7110,7 +7110,7 @@ CALL sp1();
x y z
000 000 000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
+Warning 1264 Out of range value for column 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7148,7 +7148,7 @@ CALL sp1();
x y z
00000 00000 00000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
+Warning 1264 Out of range value for column 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7186,7 +7186,7 @@ CALL sp1();
x y z
00000000 00000000 00000000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
+Warning 1264 Out of range value for column 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7224,7 +7224,7 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
+Warning 1264 Out of range value for column 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7262,7 +7262,7 @@ CALL sp1();
x y z
00000000000000000000 00000000000000000000 00000000000000000000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
+Warning 1264 Out of range value for column 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7282,7 +7282,7 @@ CALL sp1();
x y z
-9999999999 -9999999999 -9999999999
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
+Warning 1264 Out of range value for column 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7293,7 +7293,7 @@ CALL sp1();
x y z
0 0 0
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
+Note 1265 Data truncated for column 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7304,7 +7304,7 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Warning 1264 Out of range value for column 'x' at row 1
+Warning 1264 Out of range value for column 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7315,7 +7315,7 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
+Note 1265 Data truncated for column 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7326,7 +7326,7 @@ CALL sp1();
x y z
0 0 0
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
+Note 1265 Data truncated for column 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7337,7 +7337,7 @@ CALL sp1();
x y z
0 0 0
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
+Note 1265 Data truncated for column 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7348,7 +7348,7 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
+Note 1265 Data truncated for column 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -7359,7 +7359,7 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
-Note 1265 Data truncated for column 'x' at row 1
+Note 1265 Data truncated for column 'x' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@@ -13769,7 +13769,7 @@ CALL sp1();
@xx
0
Warnings:
-Warning 1366 Incorrect integer value: 'asd' for column ``.``.`xx` at row 1
+Warning 1366 Incorrect integer value: 'asd' for column ``.``.`xx` at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
BEGIN
@@ -13797,7 +13797,7 @@ set @xx = xx;
END//
CALL sp1();
Warnings:
-Warning 1265 Data truncated for column 'xx' at row 1
+Warning 1265 Data truncated for column 'xx' at row 0
SELECT @xx;
@xx
t
@@ -13818,7 +13818,7 @@ CALL sp1();
xx
0
Warnings:
-Warning 1366 Incorrect double value: 'asd' for column ``.``.`xx` at row 1
+Warning 1366 Incorrect double value: 'asd' for column ``.``.`xx` at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
BEGIN
@@ -13846,7 +13846,7 @@ CALL sp1();
xx
0000-00-00 00:00:00
Warnings:
-Warning 1265 Data truncated for column 'xx' at row 1
+Warning 1265 Data truncated for column 'xx' at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
BEGIN
@@ -13890,7 +13890,7 @@ CALL sp1();
xx
0
Warnings:
-Warning 1366 Incorrect integer value: 'asd' for column ``.``.`xx` at row 1
+Warning 1366 Incorrect integer value: 'asd' for column ``.``.`xx` at row 0
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
BEGIN
@@ -17290,8 +17290,8 @@ CALL sp7(99999999999);
f1
9999999999
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp8;
CREATE PROCEDURE sp8( f1 decimal (0) unsigned zerofill)
BEGIN
@@ -17302,7 +17302,7 @@ CALL sp8(999999999);
f1
1000000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp9;
CREATE PROCEDURE sp9( f1 decimal (0) zerofill)
BEGIN
@@ -17313,8 +17313,8 @@ CALL sp9(-1.00e+09);
f1
0000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp10;
CREATE PROCEDURE sp10( f1 decimal (0, 0))
BEGIN
@@ -17334,8 +17334,8 @@ CALL sp11(99999999999);
f1
9999999999
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp12;
CREATE PROCEDURE sp12( f1 decimal (0, 0) unsigned zerofill)
BEGIN
@@ -17346,7 +17346,7 @@ CALL sp12(999999999);
f1
1000000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp13;
CREATE PROCEDURE sp13( f1 decimal (0, 0) zerofill)
BEGIN
@@ -17357,8 +17357,8 @@ CALL sp13(-1.00e+09);
f1
0000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp14;
CREATE PROCEDURE sp14( f1 decimal (63, 30))
BEGIN
@@ -17396,8 +17396,8 @@ CALL sp17(-1.00e+21);
f1
000000000000000000000000000000010.000000000000000000000000000000
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp18_d;
CREATE PROCEDURE sp18_d( f1 decimal (64))
BEGIN
@@ -17456,7 +17456,7 @@ CALL sp21(1.00e+00);
f1
0000000000000000000000000000000000000000000000000000000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp22;
CREATE PROCEDURE sp22( f1 decimal unsigned)
BEGIN
@@ -17467,7 +17467,7 @@ CALL sp22(1.00e+00);
f1
10
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp23;
CREATE PROCEDURE sp23( f1 decimal unsigned zerofill)
BEGIN
@@ -17478,7 +17478,7 @@ CALL sp23(1.00e+00);
f1
0000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp24;
CREATE PROCEDURE sp24( f1 decimal zerofill)
BEGIN
@@ -17489,8 +17489,8 @@ CALL sp24(-1.00e+09);
f1
0000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp25;
CREATE PROCEDURE sp25( f1 double)
BEGIN
@@ -17510,7 +17510,7 @@ CALL sp26(1.00e+00);
f1
10
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp27;
CREATE PROCEDURE sp27( f1 double unsigned zerofill)
BEGIN
@@ -17521,7 +17521,7 @@ CALL sp27(1.00e+00);
f1
0000000000000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp28;
CREATE PROCEDURE sp28( f1 double zerofill)
BEGIN
@@ -17532,7 +17532,7 @@ CALL sp28(1.00e+00);
f1
0000000000000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp29;
CREATE PROCEDURE sp29( f1 float)
BEGIN
@@ -17552,7 +17552,7 @@ CALL sp30(1.00e+00);
f1
10
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp31;
CREATE PROCEDURE sp31( f1 float unsigned zerofill)
BEGIN
@@ -17563,7 +17563,7 @@ CALL sp31(1.00e+00);
f1
000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp32;
CREATE PROCEDURE sp32( f1 float zerofill)
BEGIN
@@ -17574,7 +17574,7 @@ CALL sp32(1.00e+00);
f1
000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp33;
CREATE PROCEDURE sp33( f1 float(0))
BEGIN
@@ -17594,7 +17594,7 @@ CALL sp34(1.00e+00);
f1
10
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp35;
CREATE PROCEDURE sp35( f1 float(0) unsigned zerofill)
BEGIN
@@ -17605,7 +17605,7 @@ CALL sp35(1.00e+00);
f1
000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp36;
CREATE PROCEDURE sp36( f1 float(0) zerofill)
BEGIN
@@ -17616,7 +17616,7 @@ CALL sp36(1.00e+00);
f1
000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp37;
CREATE PROCEDURE sp37( f1 float(23))
BEGIN
@@ -17636,7 +17636,7 @@ CALL sp38(1.00e+00);
f1
10
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp39;
CREATE PROCEDURE sp39( f1 float(23) unsigned zerofill)
BEGIN
@@ -17647,7 +17647,7 @@ CALL sp39(1.00e+00);
f1
000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp40;
CREATE PROCEDURE sp40( f1 float(23) zerofill)
BEGIN
@@ -17658,7 +17658,7 @@ CALL sp40(1.00e+00);
f1
000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp41;
CREATE PROCEDURE sp41( f1 float(24))
BEGIN
@@ -17678,7 +17678,7 @@ CALL sp42(1.00e+00);
f1
10
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp43;
CREATE PROCEDURE sp43( f1 float(24) unsigned zerofill)
BEGIN
@@ -17689,7 +17689,7 @@ CALL sp43(1.00e+00);
f1
000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp44;
CREATE PROCEDURE sp44( f1 float(24) zerofill)
BEGIN
@@ -17700,7 +17700,7 @@ CALL sp44(1.00e+00);
f1
000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp45;
CREATE PROCEDURE sp45( f1 float(53))
BEGIN
@@ -17720,7 +17720,7 @@ CALL sp46(1.00e+00);
f1
10
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp47;
CREATE PROCEDURE sp47( f1 float(53) unsigned zerofill)
BEGIN
@@ -17731,7 +17731,7 @@ CALL sp47(1.00e+00);
f1
0000000000000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp48;
CREATE PROCEDURE sp48( f1 float(53) zerofill)
BEGIN
@@ -17742,7 +17742,7 @@ CALL sp48(1.00e+00);
f1
0000000000000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp49;
CREATE PROCEDURE sp49( f1 int)
BEGIN
@@ -17753,8 +17753,8 @@ CALL sp49(-2.15e+09);
f1
-2147483638
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp50;
CREATE PROCEDURE sp50( f1 int unsigned)
BEGIN
@@ -17792,7 +17792,7 @@ CALL sp53(-8388600);
f1
-8388598
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp54;
CREATE PROCEDURE sp54( f1 mediumint unsigned)
BEGIN
@@ -17829,7 +17829,7 @@ CALL sp57(-999999999);
f1
-1000000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp58;
CREATE PROCEDURE sp58( f1 numeric (0))
BEGIN
@@ -17840,7 +17840,7 @@ CALL sp58(-999999999);
f1
-1000000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp59;
CREATE PROCEDURE sp59( f1 numeric (0) unsigned)
BEGIN
@@ -17851,7 +17851,7 @@ CALL sp59(9999999999);
f1
9999999999
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp60;
CREATE PROCEDURE sp60( f1 numeric (0) unsigned zerofill)
BEGIN
@@ -17862,7 +17862,7 @@ CALL sp60(99999999);
f1
0100000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp61;
CREATE PROCEDURE sp61( f1 numeric (0) zerofill)
BEGIN
@@ -17873,8 +17873,8 @@ CALL sp61(-99999999);
f1
0000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp62;
CREATE PROCEDURE sp62( f1 numeric (0, 0))
BEGIN
@@ -17885,7 +17885,7 @@ CALL sp62(-999999999);
f1
-1000000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp63;
CREATE PROCEDURE sp63( f1 numeric (0, 0) unsigned)
BEGIN
@@ -17896,7 +17896,7 @@ CALL sp63(9999999999);
f1
9999999999
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp64;
CREATE PROCEDURE sp64( f1 numeric (0, 0) unsigned zerofill)
BEGIN
@@ -17907,7 +17907,7 @@ CALL sp64(99999999);
f1
0100000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp65;
CREATE PROCEDURE sp65( f1 numeric (0, 0) zerofill)
BEGIN
@@ -17918,8 +17918,8 @@ CALL sp65(-99999999);
f1
0000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp66_n;
CREATE PROCEDURE sp66_n( f1 numeric (63, 30))
BEGIN
@@ -17930,14 +17930,14 @@ CALL sp66_n(-1e+36);
f1
-999999999999999999999999999999989.999999999999999999999999999999
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
CALL sp66_n( -1000000000000000000000000000000000000 );
f1
-999999999999999999999999999999989.999999999999999999999999999999
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp67_nu;
CREATE PROCEDURE sp67_nu( f1 numeric (63, 30) unsigned)
BEGIN
@@ -17948,14 +17948,14 @@ CALL sp67_nu(1e+36);
f1
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
CALL sp67_nu( 1000000000000000000000000000000000000 );
f1
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp68_nuz;
CREATE PROCEDURE sp68_nuz( f1 numeric (63, 30) unsigned zerofill)
BEGIN
@@ -17966,14 +17966,14 @@ CALL sp68_nuz(1e+36);
f1
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
CALL sp68_nuz( 1000000000000000000000000000000000000 );
f1
999999999999999999999999999999999.999999999999999999999999999999
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp69_n_z;
CREATE PROCEDURE sp69_n_z( f1 numeric (63, 30) zerofill)
BEGIN
@@ -17984,14 +17984,14 @@ CALL sp69_n_z(-1e+36);
f1
000000000000000000000000000000010.000000000000000000000000000000
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
CALL sp69_n_z( -1000000000000000000000000000000000000 );
f1
000000000000000000000000000000010.000000000000000000000000000000
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp70_n;
CREATE PROCEDURE sp70_n( f1 numeric (64))
BEGIN
@@ -18050,7 +18050,7 @@ CALL sp74(999999999);
f1
1000000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp75;
CREATE PROCEDURE sp75( f1 numeric unsigned zerofill)
BEGIN
@@ -18061,7 +18061,7 @@ CALL sp75(999999999);
f1
1000000000
Warnings:
-Note 1265 Data truncated for column 'f1' at row 1
+Note 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp76;
CREATE PROCEDURE sp76( f1 numeric zerofill)
BEGIN
@@ -18072,8 +18072,8 @@ CALL sp76(-999999999);
f1
0000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp77;
CREATE PROCEDURE sp77( f1 real)
BEGIN
@@ -18093,7 +18093,7 @@ CALL sp78(1.1);
f1
10
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp79;
CREATE PROCEDURE sp79( f1 real unsigned zerofill)
BEGIN
@@ -18104,7 +18104,7 @@ CALL sp79(1.1);
f1
0000000000000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp80;
CREATE PROCEDURE sp80( f1 real zerofill)
BEGIN
@@ -18115,7 +18115,7 @@ CALL sp80(1.1);
f1
0000000000000000000010
Warnings:
-Warning 1264 Out of range value for column 'f1' at row 1
+Warning 1264 Out of range value for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp81;
CREATE PROCEDURE sp81( f1 smallint)
BEGIN
@@ -18235,7 +18235,7 @@ CALL sp94( 'h');
f1
a
Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
+Warning 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp95;
CREATE PROCEDURE sp95( f1 char ascii)
BEGIN
@@ -18246,7 +18246,7 @@ CALL sp95( 'h');
f1
a
Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
+Warning 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp96;
CREATE PROCEDURE sp96( f1 char binary)
BEGIN
@@ -18257,7 +18257,7 @@ CALL sp96( 'h');
f1
a
Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
+Warning 1265 Data truncated for column 'f1' at row 0
DROP PROCEDURE IF EXISTS sp97;
CREATE PROCEDURE sp97( f1 longtext)
BEGIN
@@ -18358,7 +18358,7 @@ CALL sp107(2.00e+13);
f1
returned
Warnings:
-returned 1265 Data truncated for column 'f1' at row 1
+returned 1265 Data truncated for column 'f1' at row 0
USE db_storedproc;
DROP DATABASE db1;
DROP DATABASE IF EXISTS db1;
diff --git a/mysql-test/suite/galera/include/have_wsrep_replicate_myisam.inc b/mysql-test/suite/galera/include/have_wsrep_replicate_myisam.inc
deleted file mode 100644
index 726fc6e2b18..00000000000
--- a/mysql-test/suite/galera/include/have_wsrep_replicate_myisam.inc
+++ /dev/null
@@ -1,4 +0,0 @@
---require suite/galera/r/have_wsrep_replicate_myisam.require
-disable_query_log;
-SHOW VARIABLES LIKE 'wsrep_replicate_myisam';
-enable_query_log;
diff --git a/mysql-test/suite/galera/r/MDEV-27001.result b/mysql-test/suite/galera/r/MDEV-27001.result
new file mode 100644
index 00000000000..f2dc6a9a937
--- /dev/null
+++ b/mysql-test/suite/galera/r/MDEV-27001.result
@@ -0,0 +1,6 @@
+connection node_2;
+connection node_1;
+CREATE TABLE t3 (c INT) PARTITION BY RANGE (c) (PARTITION p1 VALUES LESS THAN (1000));
+CREATE TABLE tp2 (c INT);
+ALTER TABLE t3 CONVERT TABLE tp2 TO PARTITION p2 VALUES LESS THAN (2000);
+DROP TABLE t3;
diff --git a/mysql-test/suite/galera/r/MW-416.result b/mysql-test/suite/galera/r/MW-416.result
index ae95b832802..98a72c8d46b 100644
--- a/mysql-test/suite/galera/r/MW-416.result
+++ b/mysql-test/suite/galera/r/MW-416.result
@@ -10,16 +10,12 @@ ALTER EVENT ev1 RENAME TO ev2;
ERROR 42000: Access denied for user 'userMW416'@'localhost' to database 'test'
ALTER FUNCTION fun1 COMMENT 'foo';
ERROR 42000: alter routine command denied to user 'userMW416'@'localhost' for routine 'test.fun1'
-ALTER LOGFILE GROUP lfg ADD UNDOFILE 'file' ENGINE=InnoDB;
-Got one of the listed errors
ALTER PROCEDURE proc1 COMMENT 'foo';
Got one of the listed errors
ALTER SERVER srv OPTIONS (USER 'sally');
Got one of the listed errors
ALTER TABLE tbl DROP COLUMN col;
Got one of the listed errors
-ALTER TABLESPACE tblspc DROP DATAFILE 'file' ENGINE=innodb;
-Got one of the listed errors
ALTER VIEW vw AS SELECT 1;
Got one of the listed errors
CREATE DATABASE db;
@@ -34,14 +30,10 @@ CREATE PROCEDURE proc1() BEGIN END;
Got one of the listed errors
CREATE INDEX idx ON tbl(id);
Got one of the listed errors
-CREATE LOGFILE GROUP lfg ADD UNDOFILE 'undofile' ENGINE innodb;
-Got one of the listed errors
CREATE SERVER srv FOREIGN DATA WRAPPER 'fdw' OPTIONS (USER 'user');
Got one of the listed errors
CREATE TABLE t (i int);
Got one of the listed errors
-CREATE TABLESPACE tblspc ADD DATAFILE 'file' ENGINE=innodb;
-Got one of the listed errors
CREATE TRIGGER trg BEFORE UPDATE ON t FOR EACH ROW BEGIN END;
Got one of the listed errors
CREATE VIEW vw AS SELECT 1;
@@ -54,16 +46,12 @@ DROP FUNCTION fun1;
Got one of the listed errors
DROP INDEX idx ON t0;
Got one of the listed errors
-DROP LOGFILE GROUP lfg;
-Got one of the listed errors
DROP PROCEDURE proc1;
Got one of the listed errors
DROP SERVEr srv;
Got one of the listed errors
DROP TABLE t0;
Got one of the listed errors
-DROP TABLESPACE tblspc;
-Got one of the listed errors
DROP TRIGGER trg;
Got one of the listed errors
DROP VIEW vw;
diff --git a/mysql-test/suite/galera/r/galera_defaults.result b/mysql-test/suite/galera/r/galera_defaults.result
index bc9927b21d9..d6bbcbae680 100644
--- a/mysql-test/suite/galera/r/galera_defaults.result
+++ b/mysql-test/suite/galera/r/galera_defaults.result
@@ -1,9 +1,9 @@
connection node_2;
connection node_1;
# Correct Galera library found
-SELECT COUNT(*) `expect 51` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
-expect 51
-51
+SELECT COUNT(*) `expect 50` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
+expect 50
+49
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME LIKE 'wsrep_%'
@@ -47,7 +47,6 @@ WSREP_ON ON
WSREP_OSU_METHOD TOI
WSREP_RECOVER OFF
WSREP_REJECT_QUERIES NONE
-WSREP_REPLICATE_MYISAM OFF
WSREP_RESTART_SLAVE OFF
WSREP_RETRY_AUTOCOMMIT 1
WSREP_SLAVE_FK_CHECKS ON
@@ -58,7 +57,6 @@ WSREP_SST_AUTH
WSREP_SST_DONOR
WSREP_SST_DONOR_REJECTS_QUERIES OFF
WSREP_SST_METHOD rsync
-WSREP_STRICT_DDL OFF
WSREP_SYNC_WAIT 15
WSREP_TRX_FRAGMENT_SIZE 0
WSREP_TRX_FRAGMENT_UNIT bytes
diff --git a/mysql-test/suite/galera/r/galera_myisam_transactions.result b/mysql-test/suite/galera/r/galera_myisam_transactions.result
index 04f68c29305..6afcda47a23 100644
--- a/mysql-test/suite/galera/r/galera_myisam_transactions.result
+++ b/mysql-test/suite/galera/r/galera_myisam_transactions.result
@@ -38,9 +38,7 @@ COUNT(*) = 0
1
DROP TABLE t1, t2, t3;
SET SESSION lock_wait_timeout=2;
-SET GLOBAL wsrep_replicate_myisam= ON;
-Warnings:
-Warning 1287 '@@wsrep_replicate_myisam' is deprecated and will be removed in a future release. Please use '@@wsrep_mode=REPLICATE_MYISAM' instead
+SET GLOBAL wsrep_mode = REPLICATE_MYISAM;
CREATE TEMPORARY TABLE t1 (i INT, PRIMARY KEY pk (i)) ENGINE=MyISAM;
Warnings:
Warning 1280 Name 'pk' ignored for PRIMARY key.
@@ -49,6 +47,4 @@ INSERT INTO t1 VALUES(4);
DEALLOCATE PREPARE stmt;
COMMIT;
DROP TABLE t1;
-SET GLOBAL wsrep_replicate_myisam=OFF;
-Warnings:
-Warning 1287 '@@wsrep_replicate_myisam' is deprecated and will be removed in a future release. Please use '@@wsrep_mode=REPLICATE_MYISAM' instead
+SET GLOBAL wsrep_mode = DEFAULT;
diff --git a/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result b/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result
index 48625b3ba4a..a15b0c7df69 100644
--- a/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result
+++ b/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result
@@ -10,31 +10,31 @@ INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
connection node_2a;
SET SESSION wsrep_sync_wait=0;
-SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committing%';
-COUNT(*) = 1
+SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committing%' or STATE = 'Waiting for certification');
+EXPECT_1
1
-SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%';
-COUNT(*) = 1
-1
-SELECT COUNT(*) = 0 FROM t1;
-COUNT(*) = 0
-1
-SELECT COUNT(*) = 0 FROM t2;
-COUNT(*) = 0
+SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%';
+EXPECT_1
1
+SELECT COUNT(*) AS EXPECT_0 FROM t1;
+EXPECT_0
+0
+SELECT COUNT(*) AS EXPECT_0 FROM t2;
+EXPECT_0
+0
connection node_2;
UNLOCK TABLES;
connection node_2a;
SET SESSION wsrep_sync_wait = 15;;
-SELECT COUNT(*) = 1 FROM t1;
-COUNT(*) = 1
-1
-SELECT COUNT(*) = 1 FROM t2;
-COUNT(*) = 1
+SELECT COUNT(*) AS EXPECT_1 FROM t1;
+EXPECT_1
1
-SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committed%';
-COUNT(*) = 2
+SELECT COUNT(*) AS EXPECT_1 FROM t2;
+EXPECT_1
1
+SELECT COUNT(*) AS EXPECT_2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committed%' or STATE = 'Waiting for certification');
+EXPECT_2
+2
SET GLOBAL wsrep_slave_threads = 1;;
DROP TABLE t1;
DROP TABLE t2;
diff --git a/mysql-test/suite/galera/r/galera_var_wsrep_strict_ddl.result b/mysql-test/suite/galera/r/galera_var_wsrep_strict_ddl.result
deleted file mode 100644
index d53708b3504..00000000000
--- a/mysql-test/suite/galera/r/galera_var_wsrep_strict_ddl.result
+++ /dev/null
@@ -1,26 +0,0 @@
-connection node_2;
-connection node_1;
-SELECT @@global.wsrep_mode;
-@@global.wsrep_mode
-
-SELECT @@global.wsrep_strict_ddl;
-@@global.wsrep_strict_ddl
-0
-SET @@global.wsrep_strict_ddl=ON;
-Warnings:
-Warning 1287 '@@wsrep_strict_ddl' is deprecated and will be removed in a future release. Please use '@@wsrep_mode=STRICT_REPLICATION' instead
-SELECT @@global.wsrep_mode;
-@@global.wsrep_mode
-STRICT_REPLICATION
-SELECT @@global.wsrep_strict_ddl;
-@@global.wsrep_strict_ddl
-1
-SET @@global.wsrep_strict_ddl=OFF;
-Warnings:
-Warning 1287 '@@wsrep_strict_ddl' is deprecated and will be removed in a future release. Please use '@@wsrep_mode=STRICT_REPLICATION' instead
-SELECT @@global.wsrep_mode;
-@@global.wsrep_mode
-
-SELECT @@global.wsrep_strict_ddl;
-@@global.wsrep_strict_ddl
-0
diff --git a/mysql-test/suite/galera/t/MDEV-27001.opt b/mysql-test/suite/galera/t/MDEV-27001.opt
new file mode 100644
index 00000000000..c62d74cb249
--- /dev/null
+++ b/mysql-test/suite/galera/t/MDEV-27001.opt
@@ -0,0 +1 @@
+--partition=ON \ No newline at end of file
diff --git a/mysql-test/suite/galera/t/MDEV-27001.test b/mysql-test/suite/galera/t/MDEV-27001.test
new file mode 100644
index 00000000000..fb5f57f53e5
--- /dev/null
+++ b/mysql-test/suite/galera/t/MDEV-27001.test
@@ -0,0 +1,7 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t3 (c INT) PARTITION BY RANGE (c) (PARTITION p1 VALUES LESS THAN (1000));
+CREATE TABLE tp2 (c INT);
+ALTER TABLE t3 CONVERT TABLE tp2 TO PARTITION p2 VALUES LESS THAN (2000);
+DROP TABLE t3; \ No newline at end of file
diff --git a/mysql-test/suite/galera/t/MW-416.test b/mysql-test/suite/galera/t/MW-416.test
index f9a1b47e2ff..f86ffcbf512 100644
--- a/mysql-test/suite/galera/t/MW-416.test
+++ b/mysql-test/suite/galera/t/MW-416.test
@@ -19,16 +19,12 @@ ALTER EVENT ev1 RENAME TO ev2;
ALTER FUNCTION fun1 COMMENT 'foo';
#--error 1044,1227
#ALTER INSTANCE ROTATE INNODB MASTER KEY;
---error 1044,1227
-ALTER LOGFILE GROUP lfg ADD UNDOFILE 'file' ENGINE=InnoDB;
--error 1044,1227,1370
ALTER PROCEDURE proc1 COMMENT 'foo';
--error 1044,1227,1370
ALTER SERVER srv OPTIONS (USER 'sally');
--error 1044,1142,1227,1370
ALTER TABLE tbl DROP COLUMN col;
---error 1044,1227,1370
-ALTER TABLESPACE tblspc DROP DATAFILE 'file' ENGINE=innodb;
--error 1044,1142,1227,1370
ALTER VIEW vw AS SELECT 1;
@@ -45,14 +41,10 @@ CREATE PROCEDURE proc1() BEGIN END;
--error 1044,1142,1227,1370
CREATE INDEX idx ON tbl(id);
--error 1044,1142,1227,1370
-CREATE LOGFILE GROUP lfg ADD UNDOFILE 'undofile' ENGINE innodb;
---error 1044,1142,1227,1370
CREATE SERVER srv FOREIGN DATA WRAPPER 'fdw' OPTIONS (USER 'user');
--error 1044,1142,1227,1370
CREATE TABLE t (i int);
--error 1044,1142,1227,1370
-CREATE TABLESPACE tblspc ADD DATAFILE 'file' ENGINE=innodb;
---error 1044,1142,1227,1370
CREATE TRIGGER trg BEFORE UPDATE ON t FOR EACH ROW BEGIN END;
--error 1044,1142,1227,1370
CREATE VIEW vw AS SELECT 1;
@@ -67,16 +59,12 @@ DROP EVENT ev;
DROP FUNCTION fun1;
--error 1044,1142,1227,1370
DROP INDEX idx ON t0;
---error 1044,1142,1227,1370,1064
-DROP LOGFILE GROUP lfg;
--error 1044,1142,1227,1370
DROP PROCEDURE proc1;
--error 1044,1142,1227,1370
DROP SERVEr srv;
--error 1044,1142,1227,1370
DROP TABLE t0;
---error 1044,1142,1227,1370,1064
-DROP TABLESPACE tblspc;
--error 1044,1142,1227,1360,1370
DROP TRIGGER trg;
--error 1044,1142,1227,1370
diff --git a/mysql-test/suite/galera/t/galera_backup_stage.test b/mysql-test/suite/galera/t/galera_backup_stage.test
index 31d76816355..20ce6036d0d 100644
--- a/mysql-test/suite/galera/t/galera_backup_stage.test
+++ b/mysql-test/suite/galera/t/galera_backup_stage.test
@@ -56,7 +56,7 @@ ALTER TABLE t1 ADD COLUMN (f4 int(10));
# reach commit stage. In the unlikely case the interleaving is different, the
# result of the test should not change.
--connection node_1c
---let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE State='Commit' AND ID=$insert_id
+--let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE (State='Commit' OR State='Waiting for certification') AND ID=$insert_id
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.metadata_lock_info WHERE TABLE_NAME='t1' AND THREAD_ID=$insert_id
--source include/wait_condition.inc
@@ -83,11 +83,11 @@ ALTER TABLE t1 ADD COLUMN (f4 int(10));
# wait for insert to get blocked
--connection node_1c
---let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE State='Commit' AND ID=$insert_id
+--let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.processlist WHERE (State='Commit' OR State='Waiting for certification') AND ID=$insert_id
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*)=1 FROM information_schema.metadata_lock_info WHERE TABLE_NAME='t1' AND THREAD_ID=$insert_id
--source include/wait_condition.inc
---let $wait_condition = SELECT COUNT(*)=2 FROM information_schema.processlist WHERE Info like 'INSERT INTO t1 (f1) values("node1%")' AND State = 'Commit'
+--let $wait_condition = SELECT COUNT(*)=2 FROM information_schema.processlist WHERE Info like 'INSERT INTO t1 (f1) values("node1%")' AND (State = 'Commit' OR State='Waiting for certification')
--source include/wait_condition.inc
# nothing after BLOCK_DDL is applied
diff --git a/mysql-test/suite/galera/t/galera_defaults.test b/mysql-test/suite/galera/t/galera_defaults.test
index 96389e44d3f..6b76473d6a6 100644
--- a/mysql-test/suite/galera/t/galera_defaults.test
+++ b/mysql-test/suite/galera/t/galera_defaults.test
@@ -18,7 +18,7 @@ source ../wsrep/include/check_galera_version.inc;
# Global Variables
-SELECT COUNT(*) `expect 51` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
+SELECT COUNT(*) `expect 50` FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
diff --git a/mysql-test/suite/galera/t/galera_myisam_transactions.test b/mysql-test/suite/galera/t/galera_myisam_transactions.test
index 30677ddbe4d..808aebdcbe4 100644
--- a/mysql-test/suite/galera/t/galera_myisam_transactions.test
+++ b/mysql-test/suite/galera/t/galera_myisam_transactions.test
@@ -39,11 +39,11 @@ DROP TABLE t1, t2, t3;
# MDEV-25201 : Assertion `thd->wsrep_trx_meta.gtid.seqno == (-1)' failed in int wsrep_to_isolation_begin(THD*, const char*, const char*, const TABLE_LIST*, Alter_info*)
#
SET SESSION lock_wait_timeout=2;
-SET GLOBAL wsrep_replicate_myisam= ON;
+SET GLOBAL wsrep_mode = REPLICATE_MYISAM;
CREATE TEMPORARY TABLE t1 (i INT, PRIMARY KEY pk (i)) ENGINE=MyISAM;
PREPARE stmt FROM "INSERT INTO t1 (id) SELECT * FROM (SELECT 4 AS i) AS y";
INSERT INTO t1 VALUES(4);
DEALLOCATE PREPARE stmt;
COMMIT;
DROP TABLE t1;
-SET GLOBAL wsrep_replicate_myisam=OFF;
+SET GLOBAL wsrep_mode = DEFAULT;
diff --git a/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test b/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test
index 5a33c16c86e..2e9f05cb4af 100644
--- a/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test
+++ b/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test
@@ -32,19 +32,19 @@ INSERT INTO t2 VALUES (1);
--connection node_2a
--sleep 1
SET SESSION wsrep_sync_wait=0;
-SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committing%';
-SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%';
-SELECT COUNT(*) = 0 FROM t1;
-SELECT COUNT(*) = 0 FROM t2;
+SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committing%' or STATE = 'Waiting for certification');
+SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%';
+SELECT COUNT(*) AS EXPECT_0 FROM t1;
+SELECT COUNT(*) AS EXPECT_0 FROM t2;
--connection node_2
UNLOCK TABLES;
--connection node_2a
--eval SET SESSION wsrep_sync_wait = $wsrep_sync_wait_orig;
-SELECT COUNT(*) = 1 FROM t1;
-SELECT COUNT(*) = 1 FROM t2;
-SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committed%';
+SELECT COUNT(*) AS EXPECT_1 FROM t1;
+SELECT COUNT(*) AS EXPECT_1 FROM t2;
+SELECT COUNT(*) AS EXPECT_2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committed%' or STATE = 'Waiting for certification');
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_var_wsrep_strict_ddl.test b/mysql-test/suite/galera/t/galera_var_wsrep_strict_ddl.test
deleted file mode 100644
index 2aa76d46f82..00000000000
--- a/mysql-test/suite/galera/t/galera_var_wsrep_strict_ddl.test
+++ /dev/null
@@ -1,13 +0,0 @@
---source include/galera_cluster.inc
-
-SELECT @@global.wsrep_mode;
-SELECT @@global.wsrep_strict_ddl;
-
-SET @@global.wsrep_strict_ddl=ON;
-SELECT @@global.wsrep_mode;
-SELECT @@global.wsrep_strict_ddl;
-
-SET @@global.wsrep_strict_ddl=OFF;
-SELECT @@global.wsrep_mode;
-SELECT @@global.wsrep_strict_ddl;
-
diff --git a/mysql-test/suite/galera_3nodes/r/GCF-363.result b/mysql-test/suite/galera_3nodes/r/GCF-363.result
index d7078227ec3..fb235aceb77 100644
--- a/mysql-test/suite/galera_3nodes/r/GCF-363.result
+++ b/mysql-test/suite/galera_3nodes/r/GCF-363.result
@@ -1,8 +1,9 @@
connection node_2;
connection node_1;
-connection node_1;
+connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connection node_1;
connection node_2;
+connection node_3;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) ENGINE=InnoDB;
SET GLOBAL wsrep_on=OFF;
@@ -12,7 +13,6 @@ connection node_2;
SET GLOBAL wsrep_on=OFF;
INSERT INTO t1 VALUES (1, 'a');
SET GLOBAL wsrep_on=ON;
-connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connection node_3;
INSERT INTO t1 VALUES (1, 'b');
SET SESSION wsrep_sync_wait = 0;
diff --git a/mysql-test/suite/galera_3nodes/t/GCF-363.test b/mysql-test/suite/galera_3nodes/t/GCF-363.test
index 5867247e6ee..17c510e7c9c 100644
--- a/mysql-test/suite/galera_3nodes/t/GCF-363.test
+++ b/mysql-test/suite/galera_3nodes/t/GCF-363.test
@@ -5,10 +5,12 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
---connection node_1
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+
# Save original auto_increment_offset values.
--let $node_1=node_1
--let $node_2=node_2
+--let $node_3=node_3
--source ../galera/include/auto_increment_offset_save.inc
--connection node_1
@@ -26,7 +28,6 @@ SET GLOBAL wsrep_on=OFF;
INSERT INTO t1 VALUES (1, 'a');
SET GLOBAL wsrep_on=ON;
---connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connection node_3
INSERT INTO t1 VALUES (1, 'b');
SET SESSION wsrep_sync_wait = 0;
@@ -72,4 +73,3 @@ CALL mtr.add_suppression("Plugin 'InnoDB' will be forced to shutdown");
--connection node_1
# Restore original auto_increment_offset values.
--source ../galera/include/auto_increment_offset_restore.inc
-
diff --git a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc
index 31923f25f01..646dc1abc7b 100644
--- a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc
+++ b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc
@@ -150,7 +150,7 @@ drop table t2;
--echo FK options
create table t1(a int, b int as (a % 2), c int as (a) stored);
create table t2 (a int);
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 add constraint foreign key fk(d) references t2(a);
if ($support_virtual_foreign)
{
diff --git a/mysql-test/suite/gcol/r/gcol_keys_innodb.result b/mysql-test/suite/gcol/r/gcol_keys_innodb.result
index edb20af7f1a..c2027d21442 100644
--- a/mysql-test/suite/gcol/r/gcol_keys_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_keys_innodb.result
@@ -695,7 +695,7 @@ a b c
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
ALTER TABLE t ADD UNIQUE INDEX (c(1));
Warnings:
-Warning 1264 Out of range value for column 'b' at row 1
+Warning 1264 Out of range value for column 'b' at row 0
SELECT * FROM t WHERE c = '0';
a b c
1 127 0
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_index.result b/mysql-test/suite/gcol/r/innodb_virtual_index.result
index aafe65b7fa3..34a0b0c66e8 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_index.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_index.result
@@ -280,7 +280,7 @@ INSERT IGNORE INTO t1 (id, a) VALUES (NULL, -1);
Warnings:
Warning 1264 Out of range value for column 'va' at row 1
ALTER TABLE t1 FORCE;
-ERROR 22003: Out of range value for column 'va' at row 1
+ERROR 22003: Out of range value for column 'va' at row 0
DROP TABLE t1;
#
# MDEV-24713 Assertion `dict_table_is_comp(index->table)' failed
diff --git a/mysql-test/suite/innodb/include/have_innodb_bzip2.opt b/mysql-test/suite/innodb/include/have_innodb_bzip2.opt
new file mode 100644
index 00000000000..64680f7b988
--- /dev/null
+++ b/mysql-test/suite/innodb/include/have_innodb_bzip2.opt
@@ -0,0 +1 @@
+--plugin-load-add=$PROVIDER_BZIP2_SO
diff --git a/mysql-test/suite/innodb/include/have_innodb_lz4.opt b/mysql-test/suite/innodb/include/have_innodb_lz4.opt
new file mode 100644
index 00000000000..eac86deee3a
--- /dev/null
+++ b/mysql-test/suite/innodb/include/have_innodb_lz4.opt
@@ -0,0 +1,2 @@
+--plugin-load-add=$PROVIDER_LZ4_SO
+
diff --git a/mysql-test/suite/innodb/include/have_innodb_lzma.opt b/mysql-test/suite/innodb/include/have_innodb_lzma.opt
new file mode 100644
index 00000000000..ecb6bd7a614
--- /dev/null
+++ b/mysql-test/suite/innodb/include/have_innodb_lzma.opt
@@ -0,0 +1,2 @@
+--plugin-load-add=$PROVIDER_LZMA_SO
+
diff --git a/mysql-test/suite/innodb/include/have_innodb_lzo.opt b/mysql-test/suite/innodb/include/have_innodb_lzo.opt
new file mode 100644
index 00000000000..6033fc5d81c
--- /dev/null
+++ b/mysql-test/suite/innodb/include/have_innodb_lzo.opt
@@ -0,0 +1,2 @@
+--plugin-load-add=$PROVIDER_LZO_SO
+
diff --git a/mysql-test/suite/innodb/include/have_innodb_snappy.opt b/mysql-test/suite/innodb/include/have_innodb_snappy.opt
new file mode 100644
index 00000000000..80c3325a6aa
--- /dev/null
+++ b/mysql-test/suite/innodb/include/have_innodb_snappy.opt
@@ -0,0 +1,2 @@
+--plugin-load-add=$PROVIDER_SNAPPY_SO
+
diff --git a/mysql-test/suite/innodb/r/alter_kill.result b/mysql-test/suite/innodb/r/alter_kill.result
index 36b582c6d76..0283d1079e1 100644
--- a/mysql-test/suite/innodb/r/alter_kill.result
+++ b/mysql-test/suite/innodb/r/alter_kill.result
@@ -17,7 +17,7 @@ disconnect con1;
SELECT COUNT(*) FROM bug16720368;
ERROR 42S02: Table 'test.bug16720368' doesn't exist in engine
INSERT INTO bug16720368 VALUES(1);
-ERROR 42S02: Table 'test.bug16720368' doesn't exist in engine
+ERROR HY000: Table test/bug16720368 is corrupted. Please drop the table and recreate.
INSERT INTO bug16720368_1 VALUES(1);
# Shut down the server to uncorrupt the data.
# restart
diff --git a/mysql-test/suite/innodb/r/compression_providers_loaded,lz4.rdiff b/mysql-test/suite/innodb/r/compression_providers_loaded,lz4.rdiff
new file mode 100644
index 00000000000..b729890c354
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_loaded,lz4.rdiff
@@ -0,0 +1,19 @@
+--- suite/innodb/r/compression_providers_loaded.result
++++ suite/innodb/r/compression_providers_loaded.reject
+@@ -1,10 +1,10 @@
+ #
+-# Testing unloaded compression provider: bzip2
++# Testing unloaded compression provider: lz4
+ #
+-# Innodb_have_bzip2 reflects that the provider is loaded
+-SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
++# Innodb_have_lz4 reflects that the provider is loaded
++SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_lz4";
+ Variable_name Value
+-Innodb_have_bzip2 ON
+-# Innodb_compression_algorithm can be set to bzip2
+-SET GLOBAL Innodb_compression_algorithm = bzip2;
++Innodb_have_lz4 ON
++# Innodb_compression_algorithm can be set to lz4
++SET GLOBAL Innodb_compression_algorithm = lz4;
+ SET GLOBAL Innodb_compression_algorithm = zlib;
diff --git a/mysql-test/suite/innodb/r/compression_providers_loaded,lzma.rdiff b/mysql-test/suite/innodb/r/compression_providers_loaded,lzma.rdiff
new file mode 100644
index 00000000000..caba4283977
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_loaded,lzma.rdiff
@@ -0,0 +1,19 @@
+--- suite/innodb/r/compression_providers_loaded.result
++++ suite/innodb/r/compression_providers_loaded.reject
+@@ -1,10 +1,10 @@
+ #
+-# Testing unloaded compression provider: bzip2
++# Testing unloaded compression provider: lzma
+ #
+-# Innodb_have_bzip2 reflects that the provider is loaded
+-SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
++# Innodb_have_lzma reflects that the provider is loaded
++SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_lzma";
+ Variable_name Value
+-Innodb_have_bzip2 ON
+-# Innodb_compression_algorithm can be set to bzip2
+-SET GLOBAL Innodb_compression_algorithm = bzip2;
++Innodb_have_lzma ON
++# Innodb_compression_algorithm can be set to lzma
++SET GLOBAL Innodb_compression_algorithm = lzma;
+ SET GLOBAL Innodb_compression_algorithm = zlib;
diff --git a/mysql-test/suite/innodb/r/compression_providers_loaded,lzo.rdiff b/mysql-test/suite/innodb/r/compression_providers_loaded,lzo.rdiff
new file mode 100644
index 00000000000..8a1a5403fc2
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_loaded,lzo.rdiff
@@ -0,0 +1,19 @@
+--- suite/innodb/r/compression_providers_loaded.result
++++ suite/innodb/r/compression_providers_loaded.reject
+@@ -1,10 +1,10 @@
+ #
+-# Testing unloaded compression provider: bzip2
++# Testing unloaded compression provider: lzo
+ #
+-# Innodb_have_bzip2 reflects that the provider is loaded
+-SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
++# Innodb_have_lzo reflects that the provider is loaded
++SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_lzo";
+ Variable_name Value
+-Innodb_have_bzip2 ON
+-# Innodb_compression_algorithm can be set to bzip2
+-SET GLOBAL Innodb_compression_algorithm = bzip2;
++Innodb_have_lzo ON
++# Innodb_compression_algorithm can be set to lzo
++SET GLOBAL Innodb_compression_algorithm = lzo;
+ SET GLOBAL Innodb_compression_algorithm = zlib;
diff --git a/mysql-test/suite/innodb/r/compression_providers_loaded,snappy.rdiff b/mysql-test/suite/innodb/r/compression_providers_loaded,snappy.rdiff
new file mode 100644
index 00000000000..4a1261d45d2
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_loaded,snappy.rdiff
@@ -0,0 +1,19 @@
+--- suite/innodb/r/compression_providers_loaded.result
++++ suite/innodb/r/compression_providers_loaded.reject
+@@ -1,10 +1,10 @@
+ #
+-# Testing unloaded compression provider: bzip2
++# Testing unloaded compression provider: snappy
+ #
+-# Innodb_have_bzip2 reflects that the provider is loaded
+-SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
++# Innodb_have_snappy reflects that the provider is loaded
++SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_snappy";
+ Variable_name Value
+-Innodb_have_bzip2 ON
+-# Innodb_compression_algorithm can be set to bzip2
+-SET GLOBAL Innodb_compression_algorithm = bzip2;
++Innodb_have_snappy ON
++# Innodb_compression_algorithm can be set to snappy
++SET GLOBAL Innodb_compression_algorithm = snappy;
+ SET GLOBAL Innodb_compression_algorithm = zlib;
diff --git a/mysql-test/suite/innodb/r/compression_providers_loaded.result b/mysql-test/suite/innodb/r/compression_providers_loaded.result
new file mode 100644
index 00000000000..2d1700c2ae2
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_loaded.result
@@ -0,0 +1,10 @@
+#
+# Testing unloaded compression provider: bzip2
+#
+# Innodb_have_bzip2 reflects that the provider is loaded
+SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
+Variable_name Value
+Innodb_have_bzip2 ON
+# Innodb_compression_algorithm can be set to bzip2
+SET GLOBAL Innodb_compression_algorithm = bzip2;
+SET GLOBAL Innodb_compression_algorithm = zlib;
diff --git a/mysql-test/suite/innodb/r/compression_providers_unloaded,lz4.rdiff b/mysql-test/suite/innodb/r/compression_providers_unloaded,lz4.rdiff
new file mode 100644
index 00000000000..e849fb5c474
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_unloaded,lz4.rdiff
@@ -0,0 +1,26 @@
+--- suite/innodb/r/compression_providers_unloaded.result
++++ suite/innodb/r/compression_providers_unloaded.reject
+@@ -1,14 +1,14 @@
+ #
+-# Testing unloaded compression provider: bzip2
++# Testing unloaded compression provider: lz4
+ #
+-# Innodb_have_bzip2 reflects that the provider is not loaded
+-SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
++# Innodb_have_lz4 reflects that the provider is not loaded
++SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_lz4";
+ Variable_name Value
+-Innodb_have_bzip2 OFF
+-# Innodb_compression_algorithm cannot be set to bzip2
+-SET GLOBAL Innodb_compression_algorithm = bzip2;
+-ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
++Innodb_have_lz4 OFF
++# Innodb_compression_algorithm cannot be set to lz4
++SET GLOBAL Innodb_compression_algorithm = lz4;
++ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'lz4'
+ show warnings;
+ Level Code Message
+-Warning 138 InnoDB: compression algorithm bzip2 (5) is not available. Please, load the corresponding provider plugin.
+-Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
++Warning 138 InnoDB: compression algorithm lz4 (2) is not available. Please, load the corresponding provider plugin.
++Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'lz4'
diff --git a/mysql-test/suite/innodb/r/compression_providers_unloaded,lzma.rdiff b/mysql-test/suite/innodb/r/compression_providers_unloaded,lzma.rdiff
new file mode 100644
index 00000000000..466fb37c3fb
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_unloaded,lzma.rdiff
@@ -0,0 +1,26 @@
+--- suite/innodb/r/compression_providers_unloaded.result
++++ suite/innodb/r/compression_providers_unloaded.reject
+@@ -1,14 +1,14 @@
+ #
+-# Testing unloaded compression provider: bzip2
++# Testing unloaded compression provider: lzma
+ #
+-# Innodb_have_bzip2 reflects that the provider is not loaded
+-SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
++# Innodb_have_lzma reflects that the provider is not loaded
++SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_lzma";
+ Variable_name Value
+-Innodb_have_bzip2 OFF
+-# Innodb_compression_algorithm cannot be set to bzip2
+-SET GLOBAL Innodb_compression_algorithm = bzip2;
+-ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
++Innodb_have_lzma OFF
++# Innodb_compression_algorithm cannot be set to lzma
++SET GLOBAL Innodb_compression_algorithm = lzma;
++ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'lzma'
+ show warnings;
+ Level Code Message
+-Warning 138 InnoDB: compression algorithm bzip2 (5) is not available. Please, load the corresponding provider plugin.
+-Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
++Warning 138 InnoDB: compression algorithm lzma (4) is not available. Please, load the corresponding provider plugin.
++Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'lzma'
diff --git a/mysql-test/suite/innodb/r/compression_providers_unloaded,lzo.rdiff b/mysql-test/suite/innodb/r/compression_providers_unloaded,lzo.rdiff
new file mode 100644
index 00000000000..dec0becf71e
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_unloaded,lzo.rdiff
@@ -0,0 +1,26 @@
+--- suite/innodb/r/compression_providers_unloaded.result
++++ suite/innodb/r/compression_providers_unloaded.reject
+@@ -1,14 +1,14 @@
+ #
+-# Testing unloaded compression provider: bzip2
++# Testing unloaded compression provider: lzo
+ #
+-# Innodb_have_bzip2 reflects that the provider is not loaded
+-SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
++# Innodb_have_lzo reflects that the provider is not loaded
++SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_lzo";
+ Variable_name Value
+-Innodb_have_bzip2 OFF
+-# Innodb_compression_algorithm cannot be set to bzip2
+-SET GLOBAL Innodb_compression_algorithm = bzip2;
+-ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
++Innodb_have_lzo OFF
++# Innodb_compression_algorithm cannot be set to lzo
++SET GLOBAL Innodb_compression_algorithm = lzo;
++ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'lzo'
+ show warnings;
+ Level Code Message
+-Warning 138 InnoDB: compression algorithm bzip2 (5) is not available. Please, load the corresponding provider plugin.
+-Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
++Warning 138 InnoDB: compression algorithm lzo (3) is not available. Please, load the corresponding provider plugin.
++Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'lzo'
diff --git a/mysql-test/suite/innodb/r/compression_providers_unloaded,snappy.rdiff b/mysql-test/suite/innodb/r/compression_providers_unloaded,snappy.rdiff
new file mode 100644
index 00000000000..273ff4e2131
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_unloaded,snappy.rdiff
@@ -0,0 +1,26 @@
+--- suite/innodb/r/compression_providers_unloaded.result
++++ suite/innodb/r/compression_providers_unloaded.reject
+@@ -1,14 +1,14 @@
+ #
+-# Testing unloaded compression provider: bzip2
++# Testing unloaded compression provider: snappy
+ #
+-# Innodb_have_bzip2 reflects that the provider is not loaded
+-SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
++# Innodb_have_snappy reflects that the provider is not loaded
++SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_snappy";
+ Variable_name Value
+-Innodb_have_bzip2 OFF
+-# Innodb_compression_algorithm cannot be set to bzip2
+-SET GLOBAL Innodb_compression_algorithm = bzip2;
+-ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
++Innodb_have_snappy OFF
++# Innodb_compression_algorithm cannot be set to snappy
++SET GLOBAL Innodb_compression_algorithm = snappy;
++ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'snappy'
+ show warnings;
+ Level Code Message
+-Warning 138 InnoDB: compression algorithm bzip2 (5) is not available. Please, load the corresponding provider plugin.
+-Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
++Warning 138 InnoDB: compression algorithm snappy (6) is not available. Please, load the corresponding provider plugin.
++Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'snappy'
diff --git a/mysql-test/suite/innodb/r/compression_providers_unloaded.result b/mysql-test/suite/innodb/r/compression_providers_unloaded.result
new file mode 100644
index 00000000000..d4ac9cdb41c
--- /dev/null
+++ b/mysql-test/suite/innodb/r/compression_providers_unloaded.result
@@ -0,0 +1,14 @@
+#
+# Testing unloaded compression provider: bzip2
+#
+# Innodb_have_bzip2 reflects that the provider is not loaded
+SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_bzip2";
+Variable_name Value
+Innodb_have_bzip2 OFF
+# Innodb_compression_algorithm cannot be set to bzip2
+SET GLOBAL Innodb_compression_algorithm = bzip2;
+ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
+show warnings;
+Level Code Message
+Warning 138 InnoDB: compression algorithm bzip2 (5) is not available. Please, load the corresponding provider plugin.
+Error 1231 Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
diff --git a/mysql-test/suite/innodb/r/corrupted_during_recovery.result b/mysql-test/suite/innodb/r/corrupted_during_recovery.result
index 951233ced3c..d67dc8a63d8 100644
--- a/mysql-test/suite/innodb/r/corrupted_during_recovery.result
+++ b/mysql-test/suite/innodb/r/corrupted_during_recovery.result
@@ -9,7 +9,7 @@ INSERT INTO t2 VALUES(1);
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
SELECT * FROM t1;
-ERROR 42S02: Table 'test.t1' doesn't exist in engine
+ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
SELECT * FROM t2;
a
1
diff --git a/mysql-test/suite/innodb/r/innodb-alter.result b/mysql-test/suite/innodb/r/innodb-alter.result
index 5eee3ce50ce..a25b072cd53 100644
--- a/mysql-test/suite/innodb/r/innodb-alter.result
+++ b/mysql-test/suite/innodb/r/innodb-alter.result
@@ -1068,7 +1068,7 @@ ALTER TABLE t1 ADD b TIME NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
-Note 1265 Data truncated for column 'b' at row 1
+Note 1265 Data truncated for column 'b' at row 0
SELECT * FROM t1;
a b
10 10:20:30
diff --git a/mysql-test/suite/innodb/r/innodb-online-alter-gis.result b/mysql-test/suite/innodb/r/innodb-online-alter-gis.result
index 509d4cd03fb..65dc23ddf2c 100644
--- a/mysql-test/suite/innodb/r/innodb-online-alter-gis.result
+++ b/mysql-test/suite/innodb/r/innodb-online-alter-gis.result
@@ -42,7 +42,7 @@ drop table t1;
#
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
ALTER TABLE t1 ADD COLUMN b LINESTRING DEFAULT POINT(1,1);
-ERROR 22007: Incorrect LINESTRING value: 'POINT(1 1)' for column ``.``.`b` at row 1
+ERROR 22007: Incorrect LINESTRING value: 'POINT(1 1)' for column ``.``.`b` at row 0
DESCRIBE t1;
Field Type Null Key Default Extra
a int(11) YES NULL
diff --git a/mysql-test/suite/innodb/r/insert_into_empty.result b/mysql-test/suite/innodb/r/insert_into_empty.result
index b35b508fa7f..cc532de90ab 100644
--- a/mysql-test/suite/innodb/r/insert_into_empty.result
+++ b/mysql-test/suite/innodb/r/insert_into_empty.result
@@ -182,3 +182,102 @@ CREATE TABLE t (i INT) ENGINE=InnoDB PARTITION BY HASH (i) PARTITIONS 2;
INSERT INTO t VALUES (0);
INSERT INTO t VALUES (1),(0),(1);
DROP TABLE t;
+#
+# MDEV-26947 UNIQUE column checks fail in InnoDB resulting
+# in table corruption
+#
+CREATE TABLE t (c1 INT KEY,c2 INT UNIQUE) ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t VALUES (1,0),(2,0);
+ERROR HY000: Got error 1 "Operation not permitted" during COMMIT
+CHECK TABLE t;
+Table Op Msg_type Msg_text
+test.t check status OK
+COMMIT;
+DROP TABLE t;
+CREATE TABLE t (i INT UNIQUE)ENGINE=InnoDB;
+INSERT INTO t VALUES (0),(0);
+ERROR HY000: Got error 1 "Operation not permitted" during COMMIT
+CHECK TABLE t;
+Table Op Msg_type Msg_text
+test.t check status OK
+DROP TABLE t;
+CREATE TABLE t (c INT PRIMARY KEY,c2 CHAR(1) UNIQUE)ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t VALUES(1, ''),(2, '');
+ERROR HY000: Got error 1 "Operation not permitted" during COMMIT
+SELECT * FROM t;
+c c2
+DELETE FROM t;
+COMMIT;
+DROP TABLE t;
+#
+# MDEV-26956 LeakSanitizer/Valgrind errors in
+# trx_mod_table_time_t::start_bulk_insert
+# upon adding system versioning
+#
+CREATE TABLE t1(id INT, s DATE, e DATE, PERIOD FOR p(s,e),
+PRIMARY KEY(id, p WITHOUT OVERLAPS)) ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN row_start BIGINT UNSIGNED AS ROW START,
+ADD COLUMN row_end BIGINT UNSIGNED AS ROW END,
+ADD PERIOD FOR SYSTEM_TIME(row_start,row_end), WITH SYSTEM VERSIONING;
+DROP TABLE t1;
+#
+# MDEV-27316 Assertion `!(index)->is_spatial()' failed.
+#
+CREATE TABLE t (c POINT NOT NULL, SPATIAL INDEX(c)) ENGINE=InnoDB;
+INSERT INTO t VALUES (POINT(1, 1));
+SELECT COUNT(*) FROM t WHERE MBRWithin(t.c, POINT(1,1));
+COUNT(*)
+1
+DROP TABLE t;
+#
+# MDEV-27318 Assertion data_size < srv_sort_buf_size failed in row_merge_bulk_buf_add
+#
+CREATE TABLE t1(f1 MEDIUMTEXT)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(REPEAT(1, 8459264));
+SELECT length(f1) FROM t1;
+length(f1)
+8459264
+DROP TABLE t1;
+#
+# MDEV-27858 Assertion `page_dir_get_n_heap(new_page) == 2U' failed in PageBulk::init
+#
+CREATE TABLE t1 (c INT) ENGINE=InnoDB;
+CREATE TABLE t2 (c INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+LOCK TABLES t1 WRITE,t2 WRITE;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+DROP TABLE t2, t1;
+#
+# MDEV-28138 MariaDB Assertion Failed in mtr_buf_t::has_space
+#
+CREATE TABLE t1(
+f1 SERIAL,
+f2 LINESTRING NOT NULL DEFAULT LineFromText('LINESTRING(1 1,2 2,3 3)'),
+SPATIAL INDEX(f2))ENGINE=InnoDB;
+INSERT INTO t1(f1) VALUES(0), (1), (2);
+ERROR 23000: Duplicate entry '1' for key 'f1'
+DROP TABLE t1;
+#
+# MDEV-28237 Assertion `0' failed in row_upd_sec_index_entry on DELETE
+#
+CREATE TABLE t1 (c0 YEAR UNIQUE) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (0),(0),(0),(0),(0),(0),(0);
+ERROR HY000: Got error 1 "Operation not permitted" during COMMIT
+DELETE FROM t1;
+DROP TABLE t1;
+#
+# MDEV-28037 Assertion `trx->bulk_insert' failed in innodb_prepare_commit_versioned
+#
+CREATE TABLE t1 (c INT) ENGINE=InnoDB;
+CREATE TABLE t2 (c INT) ENGINE=InnoDB;
+CREATE TRIGGER tr AFTER INSERT ON t1 FOR EACH ROW UPDATE t2 SET c=1;
+INSERT INTO t1 VALUES (0);
+SELECT * FROM t1;
+c
+0
+SELECT * FROM t2;
+c
+DROP TABLE t2, t1;
diff --git a/mysql-test/suite/innodb/r/instant_alter.result b/mysql-test/suite/innodb/r/instant_alter.result
index df3be4b18be..9d14aca0c9d 100644
--- a/mysql-test/suite/innodb/r/instant_alter.result
+++ b/mysql-test/suite/innodb/r/instant_alter.result
@@ -314,12 +314,12 @@ ALTER TABLE t3 ADD COLUMN c7 TIME NOT NULL DEFAULT current_timestamp();
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
-Note 1265 Data truncated for column 'c7' at row 1
+Note 1265 Data truncated for column 'c7' at row 0
ALTER TABLE t3 ADD COLUMN c8 DATE NOT NULL DEFAULT current_timestamp();
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
-Note 1265 Data truncated for column 'c8' at row 1
+Note 1265 Data truncated for column 'c8' at row 0
SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8 FROM t3;
id c2 c3 c4 c5 c6 c7 c8
1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
@@ -1248,12 +1248,12 @@ ALTER TABLE t3 ADD COLUMN c7 TIME NOT NULL DEFAULT current_timestamp();
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
-Note 1265 Data truncated for column 'c7' at row 1
+Note 1265 Data truncated for column 'c7' at row 0
ALTER TABLE t3 ADD COLUMN c8 DATE NOT NULL DEFAULT current_timestamp();
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
-Note 1265 Data truncated for column 'c8' at row 1
+Note 1265 Data truncated for column 'c8' at row 0
SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8 FROM t3;
id c2 c3 c4 c5 c6 c7 c8
1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
@@ -2182,12 +2182,12 @@ ALTER TABLE t3 ADD COLUMN c7 TIME NOT NULL DEFAULT current_timestamp();
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
-Note 1265 Data truncated for column 'c7' at row 1
+Note 1265 Data truncated for column 'c7' at row 0
ALTER TABLE t3 ADD COLUMN c8 DATE NOT NULL DEFAULT current_timestamp();
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
-Note 1265 Data truncated for column 'c8' at row 1
+Note 1265 Data truncated for column 'c8' at row 0
SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8 FROM t3;
id c2 c3 c4 c5 c6 c7 c8
1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
diff --git a/mysql-test/suite/innodb/t/alter_kill.test b/mysql-test/suite/innodb/t/alter_kill.test
index a371a77971d..277d9b4e71b 100644
--- a/mysql-test/suite/innodb/t/alter_kill.test
+++ b/mysql-test/suite/innodb/t/alter_kill.test
@@ -15,11 +15,10 @@ call mtr.add_suppression("InnoDB: Operating system error.*in a file operation");
call mtr.add_suppression("InnoDB: \(The error means\|If you are\)");
call mtr.add_suppression("InnoDB: Ignoring tablespace `test/bug16720368` because it could not be opened");
call mtr.add_suppression("InnoDB: Tablespace .* was not found at.*bug16735660");
-call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace.");
call mtr.add_suppression("InnoDB: Plugin initialization aborted*");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error.");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
-call mtr.add_suppression("InnoDB: Table `test`\\.`bug16720368` is corrupted");
+call mtr.add_suppression("Table .*bug16720368.* is corrupted");
-- enable_query_log
-- echo #
@@ -79,7 +78,7 @@ EOF
--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT COUNT(*) FROM bug16720368;
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
INSERT INTO bug16720368 VALUES(1);
INSERT INTO bug16720368_1 VALUES(1);
diff --git a/mysql-test/suite/innodb/t/compression_providers_loaded.combinations b/mysql-test/suite/innodb/t/compression_providers_loaded.combinations
new file mode 100644
index 00000000000..d2a413f3902
--- /dev/null
+++ b/mysql-test/suite/innodb/t/compression_providers_loaded.combinations
@@ -0,0 +1,19 @@
+[bzip2]
+innodb
+plugin-load-add=$PROVIDER_BZIP2_SO
+
+[lz4]
+innodb
+plugin-load-add=$PROVIDER_LZ4_SO
+
+[lzma]
+innodb
+plugin-load-add=$PROVIDER_LZMA_SO
+
+[lzo]
+innodb
+plugin-load-add=$PROVIDER_LZO_SO
+
+[snappy]
+innodb
+plugin-load-add=$PROVIDER_SNAPPY_SO
diff --git a/mysql-test/suite/innodb/t/compression_providers_loaded.test b/mysql-test/suite/innodb/t/compression_providers_loaded.test
new file mode 100644
index 00000000000..1b6c348ccfa
--- /dev/null
+++ b/mysql-test/suite/innodb/t/compression_providers_loaded.test
@@ -0,0 +1,18 @@
+let $alg = $MTR_COMBINATIONS;
+
+if (`SELECT COUNT(*) = 0 FROM information_schema.plugins WHERE plugin_name = "provider_$alg" AND plugin_status = "active"`)
+{
+ skip Needs provider_$alg plugin;
+}
+
+--echo #
+--echo # Testing unloaded compression provider: $alg
+--echo #
+
+--echo # Innodb_have_$alg reflects that the provider is loaded
+eval SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_$alg";
+
+--echo # Innodb_compression_algorithm can be set to $alg
+let $innodb_compression_algorithm_orig = `SELECT @@Innodb_compression_algorithm`;
+eval SET GLOBAL Innodb_compression_algorithm = $alg;
+eval SET GLOBAL Innodb_compression_algorithm = $innodb_compression_algorithm_orig;
diff --git a/mysql-test/suite/innodb/t/compression_providers_unloaded.combinations b/mysql-test/suite/innodb/t/compression_providers_unloaded.combinations
new file mode 100644
index 00000000000..20c49960390
--- /dev/null
+++ b/mysql-test/suite/innodb/t/compression_providers_unloaded.combinations
@@ -0,0 +1,14 @@
+[bzip2]
+innodb
+
+[lz4]
+innodb
+
+[lzma]
+innodb
+
+[lzo]
+innodb
+
+[snappy]
+innodb
diff --git a/mysql-test/suite/innodb/t/compression_providers_unloaded.test b/mysql-test/suite/innodb/t/compression_providers_unloaded.test
new file mode 100644
index 00000000000..84bcce59729
--- /dev/null
+++ b/mysql-test/suite/innodb/t/compression_providers_unloaded.test
@@ -0,0 +1,13 @@
+let $alg = $MTR_COMBINATIONS;
+
+--echo #
+--echo # Testing unloaded compression provider: $alg
+--echo #
+
+--echo # Innodb_have_$alg reflects that the provider is not loaded
+eval SHOW GLOBAL STATUS WHERE Variable_name = "Innodb_have_$alg";
+
+--echo # Innodb_compression_algorithm cannot be set to $alg
+error ER_WRONG_VALUE_FOR_VAR;
+eval SET GLOBAL Innodb_compression_algorithm = $alg;
+show warnings;
diff --git a/mysql-test/suite/innodb/t/corrupted_during_recovery.test b/mysql-test/suite/innodb/t/corrupted_during_recovery.test
index 345c86badb2..a7858dd1e26 100644
--- a/mysql-test/suite/innodb/t/corrupted_during_recovery.test
+++ b/mysql-test/suite/innodb/t/corrupted_during_recovery.test
@@ -6,7 +6,7 @@ call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed read of file '.*test.t1\\.ibd' page");
call mtr.add_suppression("InnoDB: Failed to read page 3 from file '.*test.t1\\.ibd': Page read from tablespace is corrupted.");
-call mtr.add_suppression("InnoDB: Table `test`.`t1` is corrupted. Please drop the table and recreate.");
+call mtr.add_suppression("Table test/t1 is corrupted. Please drop the table and recreate\\.");
call mtr.add_suppression("InnoDB: File '.*test/t1\\.ibd' is corrupted");
--enable_query_log
@@ -57,7 +57,7 @@ SELECT * FROM t1;
let $restart_parameters=--innodb_force_recovery=1;
--source include/restart_mysqld.inc
---error ER_NO_SUCH_TABLE_IN_ENGINE
+--error ER_TABLE_CORRUPT
SELECT * FROM t1;
SELECT * FROM t2;
CHECK TABLE t2;
diff --git a/mysql-test/suite/innodb/t/innodb-alter.test b/mysql-test/suite/innodb/t/innodb-alter.test
index 60af7c9df80..78550763a9f 100644
--- a/mysql-test/suite/innodb/t/innodb-alter.test
+++ b/mysql-test/suite/innodb/t/innodb-alter.test
@@ -317,9 +317,9 @@ ALTER TABLE t1n CHANGE c2 c1 INT, CHANGE ct c2 INT, CHANGE c1 ct TEXT,
ALGORITHM=COPY;
SHOW CREATE TABLE t1n;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
ALTER TABLE t1n ADD INDEX(c2), CHANGE c2 c4 INT, ALGORITHM=INPLACE;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
ALTER TABLE t1n ADD INDEX(c2), CHANGE c2 c4 INT, ALGORITHM=COPY;
ALTER TABLE t1n ADD INDEX(c4), CHANGE c2 c4 INT, ALGORITHM=INPLACE;
SHOW CREATE TABLE t1n;
diff --git a/mysql-test/suite/innodb/t/innodb-index-online-fk.test b/mysql-test/suite/innodb/t/innodb-index-online-fk.test
index 5c8954064ce..5423516c4b5 100644
--- a/mysql-test/suite/innodb/t/innodb-index-online-fk.test
+++ b/mysql-test/suite/innodb/t/innodb-index-online-fk.test
@@ -245,7 +245,7 @@ CREATE INDEX tb ON child(a2);
SET foreign_key_checks = 0;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
ALTER TABLE child CHANGE a2 a3 INT,
ADD CONSTRAINT fk_1 FOREIGN KEY (a2) REFERENCES parent(b)
ON DELETE SET NULL ON UPDATE CASCADE,
diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test
index 9350672bee9..c7aa6250da5 100644
--- a/mysql-test/suite/innodb/t/innodb-index.test
+++ b/mysql-test/suite/innodb/t/innodb-index.test
@@ -666,7 +666,7 @@ SET GLOBAL innodb_monitor_reset = module_ddl;
--echo # Skip sort
--echo # Change PK from (f1,f2,f5,f6) to (f1,f2,f5)
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop column f6;
--enable_info
alter table t1 drop column f6, drop primary key, add primary key(f1,f2,f5);
@@ -692,7 +692,7 @@ SET GLOBAL innodb_monitor_reset = module_ddl;
--echo # Must sort
--echo # Change PK from (f1,f2,f5) to (f1,f5)
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop column f2;
--enable_info
alter table t1 drop column f2, drop primary key, add primary key(f1,f5);
@@ -908,9 +908,9 @@ drop table t1;
create table t1(f1 int not null, f2 int not null,
primary key (f1), unique key(f1, f2))engine=innodb;
insert into t1 values(1,3), (2,2);
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop column f1;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop column f1, drop primary key;
# DROP PRIMARY KEY is implied for a single-column PRIMARY KEY
alter table t1 drop column f1, drop key f1;
@@ -1012,7 +1012,7 @@ drop table t1;
# pk(o1,o2,o3) to pk(o2,o3) by drop o1
create table t1(o1 int, o2 int, o3 int, primary key(o1,o2,o3)) engine = innodb;
insert into t1 values(1,2,2),(2,1,1);
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop o1, lock=none;
alter table t1 drop o1, drop primary key, add primary key(o2,o3), lock=none;
drop table t1;
@@ -1020,7 +1020,7 @@ drop table t1;
# pk(o1,o2,o3) to pk(o1,o3) by drop o2
create table t1(o1 int, o2 int, o3 int, primary key(o1,o2,o3)) engine = innodb;
insert into t1 values(1,1,2),(1,2,1);
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop o2, lock=none;
alter table t1 drop o2, drop primary key, add primary key(o1,o3), lock=none;
drop table t1;
@@ -1028,7 +1028,7 @@ drop table t1;
# pk(o1,o2,o3) to pk(o3) by drop o1,o2
create table t1(o1 int, o2 int, o3 int, primary key(o1,o2,o3)) engine = innodb;
insert into t1 values(1,2,2),(2,1,1);
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop o1, drop o2, lock=none;
alter table t1 drop o1, drop o2,drop primary key,add primary key(o3),lock=none;
drop table t1;
@@ -1196,7 +1196,6 @@ DROP TABLE t;
--disable_query_log
call mtr.add_suppression("InnoDB: Tablespace .* was not found at .*t[12].ibd.");
-call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
diff --git a/mysql-test/suite/innodb/t/innodb-table-online.test b/mysql-test/suite/innodb/t/innodb-table-online.test
index 8e80c3fe8a3..03f4b58ab73 100644
--- a/mysql-test/suite/innodb/t/innodb-table-online.test
+++ b/mysql-test/suite/innodb/t/innodb-table-online.test
@@ -313,7 +313,7 @@ SELECT
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5));
UPDATE t1 SET c3 = NULL WHERE c3 = '';
SET lock_wait_timeout = 1;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
ALTER TABLE t1 DROP COLUMN c22f, ADD PRIMARY KEY c3p5(c3(5));
# NULL -> NOT NULL is only allowed INPLACE without IGNORE.
# Adding a PRIMARY KEY will add NOT NULL implicitly!
diff --git a/mysql-test/suite/innodb/t/innodb-wl5980-alter.test b/mysql-test/suite/innodb/t/innodb-wl5980-alter.test
index 8f58bc6ce48..09c54db644f 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5980-alter.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5980-alter.test
@@ -528,9 +528,9 @@ ALGORITHM=COPY;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
SHOW CREATE TABLE t1n;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
ALTER TABLE t1n ADD INDEX(c2), CHANGE c2 c4 INT, ALGORITHM=INPLACE;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
ALTER TABLE t1n ADD INDEX(c2), CHANGE c2 c4 INT, ALGORITHM=COPY;
ALTER TABLE t1n ADD INDEX(c4), CHANGE c2 c4 INT, ALGORITHM=INPLACE;
diff --git a/mysql-test/suite/innodb/t/innodb_bug44571.test b/mysql-test/suite/innodb/t/innodb_bug44571.test
index e27ed0b9bf8..08f41ed8fd8 100644
--- a/mysql-test/suite/innodb/t/innodb_bug44571.test
+++ b/mysql-test/suite/innodb/t/innodb_bug44571.test
@@ -12,7 +12,7 @@ ALTER TABLE bug44571 CHANGE foo bar INT;
# because the CHANGE foo bar is successful. And
# the column name change would communicate to
# InnoDB with the fix from bug #47621
--- error ER_KEY_COLUMN_DOES_NOT_EXITS
+-- error ER_KEY_COLUMN_DOES_NOT_EXIST
ALTER TABLE bug44571 ADD INDEX bug44571b (foo);
# The following create indexes should succeed,
# indirectly confirm the CHANGE foo bar is successful.
diff --git a/mysql-test/suite/innodb/t/insert_into_empty.test b/mysql-test/suite/innodb/t/insert_into_empty.test
index 8b885cb5b4f..0af5a9b97ba 100644
--- a/mysql-test/suite/innodb/t/insert_into_empty.test
+++ b/mysql-test/suite/innodb/t/insert_into_empty.test
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
+
--source include/have_sequence.inc
--source include/maybe_debug.inc
--source include/have_partition.inc
@@ -193,3 +194,101 @@ CREATE TABLE t (i INT) ENGINE=InnoDB PARTITION BY HASH (i) PARTITIONS 2;
INSERT INTO t VALUES (0);
INSERT INTO t VALUES (1),(0),(1);
DROP TABLE t;
+
+--echo #
+--echo # MDEV-26947 UNIQUE column checks fail in InnoDB resulting
+--echo # in table corruption
+--echo #
+
+CREATE TABLE t (c1 INT KEY,c2 INT UNIQUE) ENGINE=InnoDB;
+BEGIN;
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t VALUES (1,0),(2,0);
+CHECK TABLE t;
+COMMIT;
+DROP TABLE t;
+
+CREATE TABLE t (i INT UNIQUE)ENGINE=InnoDB;
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t VALUES (0),(0);
+CHECK TABLE t;
+DROP TABLE t;
+
+CREATE TABLE t (c INT PRIMARY KEY,c2 CHAR(1) UNIQUE)ENGINE=InnoDB;
+BEGIN;
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t VALUES(1, ''),(2, '');
+SELECT * FROM t;
+DELETE FROM t;
+COMMIT;
+DROP TABLE t;
+
+--echo #
+--echo # MDEV-26956 LeakSanitizer/Valgrind errors in
+--echo # trx_mod_table_time_t::start_bulk_insert
+--echo # upon adding system versioning
+--echo #
+CREATE TABLE t1(id INT, s DATE, e DATE, PERIOD FOR p(s,e),
+ PRIMARY KEY(id, p WITHOUT OVERLAPS)) ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN row_start BIGINT UNSIGNED AS ROW START,
+ ADD COLUMN row_end BIGINT UNSIGNED AS ROW END,
+ ADD PERIOD FOR SYSTEM_TIME(row_start,row_end), WITH SYSTEM VERSIONING;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-27316 Assertion `!(index)->is_spatial()' failed.
+--echo #
+CREATE TABLE t (c POINT NOT NULL, SPATIAL INDEX(c)) ENGINE=InnoDB;
+INSERT INTO t VALUES (POINT(1, 1));
+SELECT COUNT(*) FROM t WHERE MBRWithin(t.c, POINT(1,1));
+DROP TABLE t;
+
+--echo #
+--echo # MDEV-27318 Assertion data_size < srv_sort_buf_size failed in row_merge_bulk_buf_add
+--echo #
+CREATE TABLE t1(f1 MEDIUMTEXT)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(REPEAT(1, 8459264));
+SELECT length(f1) FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-27858 Assertion `page_dir_get_n_heap(new_page) == 2U' failed in PageBulk::init
+--echo #
+CREATE TABLE t1 (c INT) ENGINE=InnoDB;
+CREATE TABLE t2 (c INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+LOCK TABLES t1 WRITE,t2 WRITE;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+DROP TABLE t2, t1;
+
+--echo #
+--echo # MDEV-28138 MariaDB Assertion Failed in mtr_buf_t::has_space
+--echo #
+CREATE TABLE t1(
+ f1 SERIAL,
+ f2 LINESTRING NOT NULL DEFAULT LineFromText('LINESTRING(1 1,2 2,3 3)'),
+SPATIAL INDEX(f2))ENGINE=InnoDB;
+--error ER_DUP_ENTRY
+INSERT INTO t1(f1) VALUES(0), (1), (2);
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-28237 Assertion `0' failed in row_upd_sec_index_entry on DELETE
+--echo #
+CREATE TABLE t1 (c0 YEAR UNIQUE) ENGINE=InnoDB;
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 VALUES (0),(0),(0),(0),(0),(0),(0);
+DELETE FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-28037 Assertion `trx->bulk_insert' failed in innodb_prepare_commit_versioned
+--echo #
+CREATE TABLE t1 (c INT) ENGINE=InnoDB;
+CREATE TABLE t2 (c INT) ENGINE=InnoDB;
+CREATE TRIGGER tr AFTER INSERT ON t1 FOR EACH ROW UPDATE t2 SET c=1;
+INSERT INTO t1 VALUES (0);
+SELECT * FROM t1;
+SELECT * FROM t2;
+DROP TABLE t2, t1;
diff --git a/mysql-test/suite/innodb/t/log_corruption.test b/mysql-test/suite/innodb/t/log_corruption.test
index b9162be99db..4e9ea9fa698 100644
--- a/mysql-test/suite/innodb/t/log_corruption.test
+++ b/mysql-test/suite/innodb/t/log_corruption.test
@@ -16,7 +16,7 @@ call mtr.add_suppression("InnoDB: Log scan aborted at LSN");
call mtr.add_suppression("InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42\\r?$");
call mtr.add_suppression("InnoDB: Obtaining redo log encryption key version 1 failed");
call mtr.add_suppression("InnoDB: Decrypting checkpoint failed");
-call mtr.add_suppression("InnoDB: Are you sure you are using the right ib_logfile0 to start up the database\\? Log sequence number in the ib_logfile0 is 1213964,");
+call mtr.add_suppression("InnoDB: Are you sure you are using the right ib_logfile0 to start up the database\\? The checkpoint is 1213964,");
call mtr.add_suppression("InnoDB: Log file .*ib_logfile1 is of different size 1048576 bytes than other log files 2097152 bytes!");
--enable_query_log
diff --git a/mysql-test/suite/innodb/t/log_file_name.test b/mysql-test/suite/innodb/t/log_file_name.test
index 2a7ed7b494d..895e945f4e3 100644
--- a/mysql-test/suite/innodb/t/log_file_name.test
+++ b/mysql-test/suite/innodb/t/log_file_name.test
@@ -152,7 +152,6 @@ call mtr.add_suppression("InnoDB: The file '.*t0\.ibd' already exists");
call mtr.add_suppression("InnoDB: Cannot open datafile for read-write: '.*t2\.ibd'");
# The following are for aborted startup without --innodb-force-recovery:
call mtr.add_suppression("InnoDB: Tablespace .* was not found at .*test");
-call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace");
call mtr.add_suppression("InnoDB: Cannot read first page of '.*test.[tu]2.ibd': I/O error");
call mtr.add_suppression("InnoDB: Cannot apply log to \\[page id: space=[1-9][0-9]*, page number=3\\] of corrupted file './test/t2\\.ibd'");
call mtr.add_suppression("InnoDB: Datafile '.*test.*ibd' is corrupted");
diff --git a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
index 2f016327858..ae9dd47233b 100644
--- a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
+++ b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
@@ -779,7 +779,7 @@ SET timestamp=default;
create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
set timestamp=10;
alter table t1 add column i int;
-ERROR 22007: Incorrect POINT value: 'LINESTRING(0 0,1 1)' for column `test`.`t1`.`p` at row 1
+ERROR 22007: Incorrect POINT value: 'LINESTRING(0 0,1 1)' for column `test`.`t1`.`p` at row 0
drop table t1;
SET timestamp=default;
CREATE OR REPLACE TABLE t1 (a INT) ENGINE=InnoDB;
diff --git a/mysql-test/suite/mariabackup/compression_providers_loaded,lz4.rdiff b/mysql-test/suite/mariabackup/compression_providers_loaded,lz4.rdiff
new file mode 100644
index 00000000000..2202a51119e
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_loaded,lz4.rdiff
@@ -0,0 +1,13 @@
+--- suite/mariabackup/compression_providers_loaded.result
++++ suite/mariabackup/compression_providers_loaded.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing mariabackup with bzip2 compression
++# Testing mariabackup with lz4 compression
+ #
+ # Creating table
+-set global innodb_compression_algorithm = bzip2;
++set global innodb_compression_algorithm = lz4;
+ create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
diff --git a/mysql-test/suite/mariabackup/compression_providers_loaded,lzma.rdiff b/mysql-test/suite/mariabackup/compression_providers_loaded,lzma.rdiff
new file mode 100644
index 00000000000..e6b52d3ac07
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_loaded,lzma.rdiff
@@ -0,0 +1,13 @@
+--- suite/mariabackup/compression_providers_loaded.result
++++ suite/mariabackup/compression_providers_loaded.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing mariabackup with bzip2 compression
++# Testing mariabackup with lzma compression
+ #
+ # Creating table
+-set global innodb_compression_algorithm = bzip2;
++set global innodb_compression_algorithm = lzma;
+ create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
diff --git a/mysql-test/suite/mariabackup/compression_providers_loaded,lzo.rdiff b/mysql-test/suite/mariabackup/compression_providers_loaded,lzo.rdiff
new file mode 100644
index 00000000000..75e9519d680
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_loaded,lzo.rdiff
@@ -0,0 +1,13 @@
+--- suite/mariabackup/compression_providers_loaded.result
++++ suite/mariabackup/compression_providers_loaded.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing mariabackup with bzip2 compression
++# Testing mariabackup with lzo compression
+ #
+ # Creating table
+-set global innodb_compression_algorithm = bzip2;
++set global innodb_compression_algorithm = lzo;
+ create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
diff --git a/mysql-test/suite/mariabackup/compression_providers_loaded,snappy.rdiff b/mysql-test/suite/mariabackup/compression_providers_loaded,snappy.rdiff
new file mode 100644
index 00000000000..da281efffc4
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_loaded,snappy.rdiff
@@ -0,0 +1,13 @@
+--- suite/mariabackup/compression_providers_loaded.result
++++ suite/mariabackup/compression_providers_loaded.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing mariabackup with bzip2 compression
++# Testing mariabackup with snappy compression
+ #
+ # Creating table
+-set global innodb_compression_algorithm = bzip2;
++set global innodb_compression_algorithm = snappy;
+ create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
diff --git a/mysql-test/suite/mariabackup/compression_providers_loaded.combinations b/mysql-test/suite/mariabackup/compression_providers_loaded.combinations
new file mode 100644
index 00000000000..3287917fd5e
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_loaded.combinations
@@ -0,0 +1,14 @@
+[bzip2]
+plugin-load-add=$PROVIDER_BZIP2_SO
+
+[lz4]
+plugin-load-add=$PROVIDER_LZ4_SO
+
+[lzma]
+plugin-load-add=$PROVIDER_LZMA_SO
+
+[lzo]
+plugin-load-add=$PROVIDER_LZO_SO
+
+[snappy]
+plugin-load-add=$PROVIDER_SNAPPY_SO
diff --git a/mysql-test/suite/mariabackup/compression_providers_loaded.result b/mysql-test/suite/mariabackup/compression_providers_loaded.result
new file mode 100644
index 00000000000..6cd928b02f7
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_loaded.result
@@ -0,0 +1,27 @@
+#
+# Testing mariabackup with bzip2 compression
+#
+# Creating table
+set global innodb_compression_algorithm = bzip2;
+create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+insert t1 (a, b) values (0, repeat("abc", 100));
+insert t1 (a, b) values (1, repeat("def", 1000));
+insert t1 (a, b) values (2, repeat("ghi", 10000));
+select a, left(b, 9), length(b) from t1;
+a left(b, 9) length(b)
+0 abcabcabc 300
+1 defdefdef 3000
+2 ghighighi 30000
+# restart
+# xtrabackup backup
+# xtrabackup prepare;
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart
+select a, left(b, 9), length(b) from t1;
+a left(b, 9) length(b)
+0 abcabcabc 300
+1 defdefdef 3000
+2 ghighighi 30000
+drop table t1;
diff --git a/mysql-test/suite/mariabackup/compression_providers_loaded.test b/mysql-test/suite/mariabackup/compression_providers_loaded.test
new file mode 100644
index 00000000000..aad21ff01a4
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_loaded.test
@@ -0,0 +1,38 @@
+let $alg = $MTR_COMBINATIONS;
+
+if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'provider_$alg' and plugin_status='active'`)
+{
+ skip "Needs provider_$alg plugin";
+}
+
+--echo #
+--echo # Testing mariabackup with $alg compression
+--echo #
+
+--echo # Creating table
+eval set global innodb_compression_algorithm = $alg;
+eval create table t1 (a int, b text $column_params) engine = innodb page_compressed = 1;
+insert t1 (a, b) values (0, repeat("abc", 100));
+insert t1 (a, b) values (1, repeat("def", 1000));
+insert t1 (a, b) values (2, repeat("ghi", 10000));
+select a, left(b, 9), length(b) from t1;
+
+--source include/restart_mysqld.inc
+
+--echo # xtrabackup backup
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+
+disable_result_log;
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
+enable_result_log;
+
+--echo # xtrabackup prepare;
+disable_result_log;
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+source include/restart_and_restore.inc;
+enable_result_log;
+
+select a, left(b, 9), length(b) from t1;
+
+drop table t1;
+rmdir $targetdir;
diff --git a/mysql-test/suite/mariabackup/compression_providers_unloaded,lz4.rdiff b/mysql-test/suite/mariabackup/compression_providers_unloaded,lz4.rdiff
new file mode 100644
index 00000000000..4b874403830
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_unloaded,lz4.rdiff
@@ -0,0 +1,22 @@
+--- suite/mariabackup/compression_providers_unloaded.result
++++ suite/mariabackup/compression_providers_unloaded.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing mariabackup with bzip2 compression
++# Testing mariabackup with lz4 compression
+ #
+-# Create table with bzip2 compression
+-set global innodb_compression_algorithm = bzip2;
++# Create table with lz4 compression
++set global innodb_compression_algorithm = lz4;
+ create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
+@@ -14,6 +14,6 @@
+ 2 ghighighi 30000
+ # Restart server without plugin
+ call mtr.add_suppression("mariadbd: MariaDB tried to use the \\w+ compression, but its provider plugin is not loaded");
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-lz4
+ # xtrabackup backup
+ drop table t1;
diff --git a/mysql-test/suite/mariabackup/compression_providers_unloaded,lzma.rdiff b/mysql-test/suite/mariabackup/compression_providers_unloaded,lzma.rdiff
new file mode 100644
index 00000000000..ff57834f624
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_unloaded,lzma.rdiff
@@ -0,0 +1,22 @@
+--- suite/mariabackup/compression_providers_unloaded.result
++++ suite/mariabackup/compression_providers_unloaded.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing mariabackup with bzip2 compression
++# Testing mariabackup with lzma compression
+ #
+-# Create table with bzip2 compression
+-set global innodb_compression_algorithm = bzip2;
++# Create table with lzma compression
++set global innodb_compression_algorithm = lzma;
+ create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
+@@ -14,6 +14,6 @@
+ 2 ghighighi 30000
+ # Restart server without plugin
+ call mtr.add_suppression("mariadbd: MariaDB tried to use the \\w+ compression, but its provider plugin is not loaded");
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-lzma
+ # xtrabackup backup
+ drop table t1;
diff --git a/mysql-test/suite/mariabackup/compression_providers_unloaded,lzo.rdiff b/mysql-test/suite/mariabackup/compression_providers_unloaded,lzo.rdiff
new file mode 100644
index 00000000000..5308fc4333e
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_unloaded,lzo.rdiff
@@ -0,0 +1,22 @@
+--- suite/mariabackup/compression_providers_unloaded.result
++++ suite/mariabackup/compression_providers_unloaded.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing mariabackup with bzip2 compression
++# Testing mariabackup with lzo compression
+ #
+-# Create table with bzip2 compression
+-set global innodb_compression_algorithm = bzip2;
++# Create table with lzo compression
++set global innodb_compression_algorithm = lzo;
+ create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
+@@ -14,6 +14,6 @@
+ 2 ghighighi 30000
+ # Restart server without plugin
+ call mtr.add_suppression("mariadbd: MariaDB tried to use the \\w+ compression, but its provider plugin is not loaded");
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-lzo
+ # xtrabackup backup
+ drop table t1;
diff --git a/mysql-test/suite/mariabackup/compression_providers_unloaded,snappy.rdiff b/mysql-test/suite/mariabackup/compression_providers_unloaded,snappy.rdiff
new file mode 100644
index 00000000000..b7b5e2b51c2
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_unloaded,snappy.rdiff
@@ -0,0 +1,22 @@
+--- suite/mariabackup/compression_providers_unloaded.result
++++ suite/mariabackup/compression_providers_unloaded.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing mariabackup with bzip2 compression
++# Testing mariabackup with snappy compression
+ #
+-# Create table with bzip2 compression
+-set global innodb_compression_algorithm = bzip2;
++# Create table with snappy compression
++set global innodb_compression_algorithm = snappy;
+ create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
+@@ -14,6 +14,6 @@
+ 2 ghighighi 30000
+ # Restart server without plugin
+ call mtr.add_suppression("mariadbd: MariaDB tried to use the \\w+ compression, but its provider plugin is not loaded");
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-snappy
+ # xtrabackup backup
+ drop table t1;
diff --git a/mysql-test/suite/mariabackup/compression_providers_unloaded.combinations b/mysql-test/suite/mariabackup/compression_providers_unloaded.combinations
new file mode 100644
index 00000000000..3287917fd5e
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_unloaded.combinations
@@ -0,0 +1,14 @@
+[bzip2]
+plugin-load-add=$PROVIDER_BZIP2_SO
+
+[lz4]
+plugin-load-add=$PROVIDER_LZ4_SO
+
+[lzma]
+plugin-load-add=$PROVIDER_LZMA_SO
+
+[lzo]
+plugin-load-add=$PROVIDER_LZO_SO
+
+[snappy]
+plugin-load-add=$PROVIDER_SNAPPY_SO
diff --git a/mysql-test/suite/mariabackup/compression_providers_unloaded.result b/mysql-test/suite/mariabackup/compression_providers_unloaded.result
new file mode 100644
index 00000000000..ccf3e0355a4
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_unloaded.result
@@ -0,0 +1,22 @@
+call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+call mtr.add_suppression("Refusing to load corrupted table");
+#
+# Testing mariabackup with bzip2 compression
+#
+# Create table with bzip2 compression
+set global innodb_compression_algorithm = bzip2;
+create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+insert t1 (a, b) values (0, repeat("abc", 100));
+insert t1 (a, b) values (1, repeat("def", 1000));
+insert t1 (a, b) values (2, repeat("ghi", 10000));
+select a, left(b, 9), length(b) from t1;
+a left(b, 9) length(b)
+0 abcabcabc 300
+1 defdefdef 3000
+2 ghighighi 30000
+# Restart server without plugin
+call mtr.add_suppression("mariadbd: MariaDB tried to use the \\w+ compression, but its provider plugin is not loaded");
+# restart: --disable-provider-bzip2
+# xtrabackup backup
+drop table t1;
diff --git a/mysql-test/suite/mariabackup/compression_providers_unloaded.test b/mysql-test/suite/mariabackup/compression_providers_unloaded.test
new file mode 100644
index 00000000000..673c16d03cf
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compression_providers_unloaded.test
@@ -0,0 +1,35 @@
+let $alg = $MTR_COMBINATIONS;
+call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+call mtr.add_suppression("Refusing to load corrupted table");
+
+if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'provider_$alg' and plugin_status='active'`)
+{
+ skip "Needs provider_$alg plugin";
+}
+
+--echo #
+--echo # Testing mariabackup with $alg compression
+--echo #
+
+--echo # Create table with $alg compression
+eval set global innodb_compression_algorithm = $alg;
+eval create table t1 (a int, b text $column_params) engine = innodb page_compressed = 1;
+insert t1 (a, b) values (0, repeat("abc", 100));
+insert t1 (a, b) values (1, repeat("def", 1000));
+insert t1 (a, b) values (2, repeat("ghi", 10000));
+select a, left(b, 9), length(b) from t1;
+
+--echo # Restart server without plugin
+call mtr.add_suppression("mariadbd: MariaDB tried to use the \\w+ compression, but its provider plugin is not loaded");
+let $restart_parameters = --disable-provider-$alg;
+source include/restart_mysqld.inc;
+
+--echo # xtrabackup backup
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+
+error 1;
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
+
+drop table t1;
+rmdir $targetdir;
diff --git a/mysql-test/suite/mariabackup/incremental_compressed.result b/mysql-test/suite/mariabackup/incremental_compressed.result
new file mode 100644
index 00000000000..eb059cdc769
--- /dev/null
+++ b/mysql-test/suite/mariabackup/incremental_compressed.result
@@ -0,0 +1,13 @@
+#
+# MDEV-26794 MariaBackup does not recognize added providers upon prepare of incremental backup
+#
+CREATE TABLE t (a INT) ENGINE=InnoDB;
+INSERT INTO t VALUES (1),(2);
+INSTALL SONAME 'provider_snappy';
+SET GLOBAL innodb_compression_algorithm= snappy;
+CREATE TABLE t_snappy (a INT) ENGINE=InnoDB page_compressed=1;
+INSERT INTO t_snappy VALUES (3),(4);
+# restart: --innodb_buffer_pool_load_at_startup=0
+# Prepare initial backup
+# Prepare incremental backup
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/incremental_compressed.test b/mysql-test/suite/mariabackup/incremental_compressed.test
new file mode 100644
index 00000000000..f6ec26cfb46
--- /dev/null
+++ b/mysql-test/suite/mariabackup/incremental_compressed.test
@@ -0,0 +1,38 @@
+--echo #
+--echo # MDEV-26794 MariaBackup does not recognize added providers upon prepare of incremental backup
+--echo #
+
+if (!$PROVIDER_SNAPPY_SO) {
+ skip "Needs provider_snappy plugin";
+}
+
+--source include/have_innodb.inc
+
+--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
+--let $incdir=$MYSQLTEST_VARDIR/tmp/inc
+
+CREATE TABLE t (a INT) ENGINE=InnoDB;
+INSERT INTO t VALUES (1),(2);
+
+--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir
+
+INSTALL SONAME 'provider_snappy';
+
+SET GLOBAL innodb_compression_algorithm= snappy;
+
+CREATE TABLE t_snappy (a INT) ENGINE=InnoDB page_compressed=1;
+INSERT INTO t_snappy VALUES (3),(4);
+
+# disable buffer pool load to avoid MDEV-26794 warnings
+--let $restart_parameters= --innodb_buffer_pool_load_at_startup=0
+--source include/restart_mysqld.inc
+
+--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --incremental-basedir=$targetdir --target-dir=$incdir
+
+--echo # Prepare initial backup
+--exec $XTRABACKUP --prepare --target-dir=$targetdir
+
+--echo # Prepare incremental backup
+--exec $XTRABACKUP --prepare --target-dir=$targetdir --incremental-dir=$incdir > $MYSQLTEST_VARDIR/prepare.log 2>&1
+
+DROP TABLE t;
diff --git a/mysql-test/suite/multi_source/change_master.result b/mysql-test/suite/multi_source/change_master.result
new file mode 100644
index 00000000000..9fd84e51364
--- /dev/null
+++ b/mysql-test/suite/multi_source/change_master.result
@@ -0,0 +1,8 @@
+RESET MASTER;
+connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
+change master 'abc1' to relay_log_file='';
+ERROR HY000: Failed initializing relay log position: Could not find target log during relay log initialization
+change master 'abc1' to relay_log_file='';
+ERROR HY000: Failed initializing relay log position: Could not find target log during relay log initialization
+disconnect slave;
+connection default;
diff --git a/mysql-test/suite/multi_source/change_master.test b/mysql-test/suite/multi_source/change_master.test
new file mode 100644
index 00000000000..08e6909694f
--- /dev/null
+++ b/mysql-test/suite/multi_source/change_master.test
@@ -0,0 +1,13 @@
+--source include/not_embedded.inc
+
+RESET MASTER;
+
+--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
+
+--error ER_RELAY_LOG_INIT
+change master 'abc1' to relay_log_file='';
+--error ER_RELAY_LOG_INIT
+change master 'abc1' to relay_log_file='';
+--disconnect slave
+--connection default
+
diff --git a/mysql-test/suite/multi_source/multisource_for_channel.result b/mysql-test/suite/multi_source/multisource_for_channel.result
new file mode 100644
index 00000000000..f96a5a93b97
--- /dev/null
+++ b/mysql-test/suite/multi_source/multisource_for_channel.result
@@ -0,0 +1,366 @@
+RESET MASTER;
+connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
+change master to relay_log_file='' for channel 'abc1';
+ERROR HY000: Failed initializing relay log position: Could not find target log during relay log initialization
+change master to master_host='' for channel 'abc2';
+ERROR HY000: Incorrect arguments to MASTER_HOST
+change master to
+master_port=MYPORT_1,
+master_host='127.0.0.1',
+master_user='root'
+for channel 'master1';
+start slave for channel 'master1';
+set default_master_connection = 'master1';
+include/wait_for_slave_to_start.inc
+connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
+connection slave;
+#
+# Checking SHOW SLAVE 'master1' STATUS
+#
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000002'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+#
+# Checking SHOW SLAVE STATUS
+#
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000002'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+#
+# Checking SHOW ALL SLAVES STATUS
+#
+Connection_name = 'master1'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000002'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+Slave_heartbeat_period = '60.000'
+#
+connection master1;
+drop database if exists db1;
+create database db1;
+use db1;
+create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM;
+Warnings:
+Warning 1280 Name 'pk' ignored for PRIMARY key.
+insert into t1 (f1) values ('one'),('two');
+connection slave;
+select * from db1.t1;
+i f1
+1 one
+2 two
+# List of relay log files in the datadir
+mysqld-relay-bin-master1.000001
+mysqld-relay-bin-master1.000002
+mysqld-relay-bin-master1.index
+include/show_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-relay-bin-master1.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+mysqld-relay-bin-master1.000001 # Rotate # # mysqld-relay-bin-master1.000002;pos=4
+include/show_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-relay-bin-master1.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+mysqld-relay-bin-master1.000002 # Rotate # # master-bin.000001;pos=POS
+mysqld-relay-bin-master1.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+mysqld-relay-bin-master1.000002 # Gtid_list # # []
+mysqld-relay-bin-master1.000002 # Binlog_checkpoint # # master-bin.000001
+mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
+mysqld-relay-bin-master1.000002 # Query # # drop database if exists db1
+mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
+mysqld-relay-bin-master1.000002 # Query # # create database db1
+mysqld-relay-bin-master1.000002 # Gtid # # GTID #-#-#
+mysqld-relay-bin-master1.000002 # Query # # use `db1`; create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM
+mysqld-relay-bin-master1.000002 # Gtid # # BEGIN GTID #-#-#
+mysqld-relay-bin-master1.000002 # Intvar # # INSERT_ID=1
+mysqld-relay-bin-master1.000002 # Query # # use `db1`; insert into t1 (f1) values ('one'),('two')
+mysqld-relay-bin-master1.000002 # Query # # COMMIT
+change master to
+master_port=MYPORT_2,
+master_host='127.0.0.1',
+master_user='root'
+for channel 'master1';
+ERROR HY000: This operation cannot be performed as you have a running slave 'master1'; run STOP SLAVE 'master1' first
+change master to
+master_port=MYPORT_2,
+master_host='127.0.0.1',
+master_user='root';
+ERROR HY000: This operation cannot be performed as you have a running slave 'master1'; run STOP SLAVE 'master1' first
+change master to
+master_port=MYPORT_1,
+master_host='127.0.0.1',
+master_user='root' for channel 'master2';
+ERROR HY000: Connection 'master2' conflicts with existing connection 'master1'
+set default_master_connection = '';
+change master to
+master_port=MYPORT_2,
+master_host='127.0.0.1',
+master_user='root';
+start slave;
+include/wait_for_slave_to_start.inc
+#
+# Checking SHOW ALL SLAVES STATUS
+#
+Connection_name = ''
+Connection_name = 'master1'
+Master_Port = 'MYPORT_2'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin.000002'
+Relay_Log_File = 'mysqld-relay-bin-master1.000002'
+Slave_IO_Running = 'Yes'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+Last_SQL_Errno = '0'
+Slave_heartbeat_period = '60.000'
+Slave_heartbeat_period = '60.000'
+#
+connection master1;
+insert into t1 (f1) values ('three');
+connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
+drop database if exists db2;
+create database db2;
+use db2;
+create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB;
+begin;
+insert into t1 (f1) values (1),(2);
+connection slave;
+connection master2;
+connection slave;
+select * from db1.t1;
+i f1
+1 one
+2 two
+3 three
+select * from db2.t1;
+pk f1
+connection master2;
+commit;
+connection slave;
+select * from db2.t1;
+pk f1
+1 1
+2 2
+connection master1;
+flush logs;
+connection slave;
+connection master1;
+purge binary logs to 'master-bin.000002';
+show binary logs;
+Log_name File_size
+master-bin.000002 filesize
+insert into t1 (f1) values ('four');
+create table db1.t3 (f1 int) engine=InnoDB;
+connection slave;
+#
+# Checking SHOW ALL SLAVES STATUS
+#
+Connection_name = ''
+Connection_name = 'master1'
+Master_Port = 'MYPORT_2'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin.000002'
+Relay_Log_File = 'mysqld-relay-bin-master1.000004'
+Slave_IO_Running = 'Yes'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+Last_SQL_Errno = '0'
+Slave_heartbeat_period = '60.000'
+Slave_heartbeat_period = '60.000'
+#
+#
+# MDEV:16437: merge 5.7 P_S replication instrumentation and tables
+#
+SELECT * FROM performance_schema.replication_applier_status_by_coordinator;
+CHANNEL_NAME master1
+THREAD_ID #
+SERVICE_STATE ON
+LAST_ERROR_NUMBER 0
+LAST_ERROR_MESSAGE
+LAST_ERROR_TIMESTAMP 0000-00-00 00:00:00
+LAST_SEEN_TRANSACTION 0-1-7
+LAST_TRANS_RETRY_COUNT 0
+CHANNEL_NAME
+THREAD_ID #
+SERVICE_STATE ON
+LAST_ERROR_NUMBER 0
+LAST_ERROR_MESSAGE
+LAST_ERROR_TIMESTAMP 0000-00-00 00:00:00
+LAST_SEEN_TRANSACTION 0-2-4
+LAST_TRANS_RETRY_COUNT 0
+select * from db1.t1;
+i f1
+1 one
+2 two
+3 three
+4 four
+include/show_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-relay-bin.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+mysqld-relay-bin.000001 # Rotate # # mysqld-relay-bin.000002;pos=4
+include/show_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+mysqld-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS
+mysqld-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+mysqld-relay-bin.000002 # Gtid_list # # []
+mysqld-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001
+mysqld-relay-bin.000002 # Gtid # # GTID #-#-#
+mysqld-relay-bin.000002 # Query # # drop database if exists db2
+mysqld-relay-bin.000002 # Gtid # # GTID #-#-#
+mysqld-relay-bin.000002 # Query # # create database db2
+mysqld-relay-bin.000002 # Gtid # # GTID #-#-#
+mysqld-relay-bin.000002 # Query # # use `db2`; create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB
+mysqld-relay-bin.000002 # Gtid # # BEGIN GTID #-#-#
+mysqld-relay-bin.000002 # Intvar # # INSERT_ID=1
+mysqld-relay-bin.000002 # Query # # use `db2`; insert into t1 (f1) values (1),(2)
+mysqld-relay-bin.000002 # Xid # # COMMIT /* XID */
+disconnect slave;
+connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
+stop slave io_thread;
+show status like 'Slave_running';
+Variable_name Value
+Slave_running OFF
+set default_master_connection = 'master1';
+show status like 'Slave_running';
+Variable_name Value
+Slave_running ON
+
+#
+# syntax compatible test
+#
+
+#
+# show relaylog events
+#
+SHOW RELAYLOG EVENTS for channel 'master1';
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-relay-bin-master1.000003 4 Format_desc 3 256 Server ver: Version
+mysqld-relay-bin-master1.000003 256 Rotate 1 1358 master-bin.000002;pos=4
+mysqld-relay-bin-master1.000003 304 Rotate 3 366 mysqld-relay-bin-master1.000004;pos=4
+
+show slave status for channel 'master1'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000004'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+
+#
+# stop slave
+#
+STOP SLAVE for channel 'master1';
+
+show slave status for channel 'master1'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000004'
+Slave_IO_Running = 'No'
+Slave_SQL_Running = 'No'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+
+#
+# start slave
+#
+START SLAVE for channel 'master1';
+include/wait_for_slave_to_start.inc
+
+show slave status for channel 'master1'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000005'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+
+#
+# flush relay logs
+#
+FLUSH RELAY LOGS for channel 'master1';
+
+show slave status for channel 'master1'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000006'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+
+#
+# stop slave
+#
+STOP SLAVE for channel 'master1';
+
+show slave status for channel 'master1'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = 'mysqld-relay-bin-master1.000006'
+Slave_IO_Running = 'No'
+Slave_SQL_Running = 'No'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+
+#
+# reset slave
+#
+RESET SLAVE for channel 'master1';
+
+show slave status for channel 'master1'
+Master_Port = 'MYPORT_1'
+Relay_Log_File = ''
+Slave_IO_Running = 'No'
+Slave_SQL_Running = 'No'
+Last_Errno = '0'
+Last_SQL_Errno = '0'
+
+#
+# show relaylog events after reset slave
+#
+SHOW RELAYLOG EVENTS for channel 'master1';
+Log_name Pos Event_type Server_id End_log_pos Info
+
+#
+# check error syntax
+#
+RESET SLAVE 'master1' for channel 'mmaster2';
+ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME)
+STOP SLAVE 'master1' for channel 'master2';
+ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME)
+FLUSH RELAY LOGS 'master1' for channel 'master2';
+ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME)
+START SLAVE 'master1' for channel 'master2';
+ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME)
+SHOW RELAYLOG 'master1' EVENTS for channel 'master2';
+ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME)
+SHOW SLAVE 'master1' STATUS for channel 'master2';
+ERROR HY000: Incorrect arguments to CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME)
+
+drop database db1;
+drop database db2;
+include/reset_master_slave.inc
+disconnect slave;
+connection master1;
+drop database db1;
+include/reset_master_slave.inc
+disconnect master1;
+connection master2;
+drop database db2;
+include/reset_master_slave.inc
+disconnect master2;
+connection default;
+CREATE TABLE channel (channel int);
+DROP TABLE channel;
diff --git a/mysql-test/suite/multi_source/multisource_for_channel.test b/mysql-test/suite/multi_source/multisource_for_channel.test
new file mode 100644
index 00000000000..9b74ea97742
--- /dev/null
+++ b/mysql-test/suite/multi_source/multisource_for_channel.test
@@ -0,0 +1,429 @@
+#
+# This is the basic test of support mysql syntax "for channel" used for
+# multi-source replication
+#
+# Test basic replication functionality in multi-source setup
+#
+
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+--source include/have_perfschema.inc
+--source include/binlog_start_pos.inc
+--let $rpl_server_count= 0
+
+RESET MASTER;
+
+--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
+
+# MDEV-3984: crash/read of freed memory when changing master with named connection
+# This fails after adding the new master 'abc1', check we do not free twice.
+--error ER_RELAY_LOG_INIT
+change master to relay_log_file='' for channel 'abc1';
+# This fails before adding the new master, check that we do free it.
+--error ER_WRONG_ARGUMENTS
+change master to master_host='' for channel 'abc2';
+
+# Start replication from the first master
+
+--replace_result $SERVER_MYPORT_1 MYPORT_1
+eval change master to
+master_port=$SERVER_MYPORT_1,
+master_host='127.0.0.1',
+master_user='root'
+for channel 'master1';
+
+start slave for channel 'master1';
+set default_master_connection = 'master1';
+--source include/wait_for_slave_to_start.inc
+
+--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1)
+--save_master_pos
+
+--connection slave
+--sync_with_master 0,'master1'
+
+# Here and further: add an extra check on SQL thread status
+# as the normal sync is not always enough
+--source include/wait_for_sql_thread_read_all.inc
+
+# each of the 3 commands should produce
+# 'master1' status
+
+let $wait_for_all= 1;
+let $show_statement= SHOW ALL SLAVES STATUS;
+let $field= Slave_IO_State;
+let $condition= = 'Waiting for master to send event';
+--source include/wait_show_condition.inc
+
+--echo #
+--echo # Checking SHOW SLAVE 'master1' STATUS
+--echo #
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
+--let $slave_name= 'master1'
+--let for_channel= 1
+--source include/show_slave_status.inc
+--let $slave_name=
+--let for_channel=
+
+--echo #
+--echo # Checking SHOW SLAVE STATUS
+--echo #
+--source include/show_slave_status.inc
+
+--echo #
+--echo # Checking SHOW ALL SLAVES STATUS
+--echo #
+--let $all_slaves_status= 1
+--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
+--source include/show_slave_status.inc
+--let $all_slaves_status=
+--echo #
+
+
+# Check that replication actually works
+
+--connection master1
+
+--disable_warnings
+drop database if exists db1;
+--enable_warnings
+create database db1;
+use db1;
+create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM;
+insert into t1 (f1) values ('one'),('two');
+--save_master_pos
+
+--connection slave
+--sync_with_master 0,'master1'
+
+--sorted_result
+select * from db1.t1;
+
+--let $datadir = `SELECT @@datadir`
+
+--echo # List of relay log files in the datadir
+--list_files $datadir mysqld-relay-bin-master1.*
+
+# Check that relay logs are recognizable
+
+let binlog_start=4;
+let binlog_file=;
+source include/show_relaylog_events.inc;
+let binlog_file= mysqld-relay-bin-master1.000002;
+source include/show_relaylog_events.inc;
+
+# Try to configure connection with the same name again,
+# should get an error because the slave is running
+
+--replace_result $SERVER_MYPORT_2 MYPORT_2
+--error ER_SLAVE_MUST_STOP
+eval change master to
+master_port=$SERVER_MYPORT_2,
+master_host='127.0.0.1',
+master_user='root'
+for channel 'master1';
+
+# Try to configure using the default connection name
+# (which is 'master1' at the moment),
+# again, should get an error
+
+--replace_result $SERVER_MYPORT_2 MYPORT_2
+--error ER_SLAVE_MUST_STOP
+eval change master to
+master_port=$SERVER_MYPORT_2,
+master_host='127.0.0.1',
+master_user='root';
+
+# Try to configure a connection with the same master
+# using a different name, should get a conflict
+
+--replace_result $SERVER_MYPORT_1 MYPORT_1
+--error ER_CONNECTION_ALREADY_EXISTS
+eval change master to
+master_port=$SERVER_MYPORT_1,
+master_host='127.0.0.1',
+master_user='root' for channel 'master2';
+
+
+# Set up a proper 'default' connection to master2
+
+set default_master_connection = '';
+
+--replace_result $SERVER_MYPORT_2 MYPORT_2
+eval change master to
+master_port=$SERVER_MYPORT_2,
+master_host='127.0.0.1',
+master_user='root';
+
+start slave;
+--source include/wait_for_slave_to_start.inc
+
+--source include/wait_for_sql_thread_read_all.inc
+
+# See both connections in the same status output
+
+let $wait_for_all= 1;
+let $show_statement= SHOW ALL SLAVES STATUS;
+let $field= Slave_IO_State;
+let $condition= = 'Waiting for master to send event';
+--source include/wait_show_condition.inc
+
+--echo #
+--echo # Checking SHOW ALL SLAVES STATUS
+--echo #
+--let $all_slaves_status= 1
+--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/
+--source include/show_slave_status.inc
+--let $all_slaves_status=
+--echo #
+
+# Check that replication from two servers actually works
+
+--connection master1
+
+insert into t1 (f1) values ('three');
+--save_master_pos
+
+--connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2)
+
+--disable_warnings
+drop database if exists db2;
+--enable_warnings
+create database db2;
+use db2;
+create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB;
+begin;
+insert into t1 (f1) values (1),(2);
+
+--connection slave
+--sync_with_master 0,'master1'
+
+--connection master2
+--save_master_pos
+
+--connection slave
+--sync_with_master 0
+--sorted_result
+select * from db1.t1;
+select * from db2.t1;
+
+--connection master2
+commit;
+--save_master_pos
+
+--connection slave
+--sync_with_master 0
+--sorted_result
+select * from db2.t1;
+
+# Flush and purge logs on one master,
+# make sure slaves don't get confused
+
+--connection master1
+flush logs;
+--source include/wait_for_binlog_checkpoint.inc
+--save_master_pos
+--connection slave
+--sync_with_master 0, 'master1'
+
+--connection master1
+purge binary logs to 'master-bin.000002';
+# Additional events: 43 (Gtid_list) + 2 x 44 (Binlog_checkpoint) = 131
+let filesize=`select $binlog_start_pos+131`;
+--replace_result $filesize filesize
+show binary logs;
+insert into t1 (f1) values ('four');
+create table db1.t3 (f1 int) engine=InnoDB;
+--save_master_pos
+
+--connection slave
+--sync_with_master 0,'master1'
+
+--source include/wait_for_sql_thread_read_all.inc
+
+let $wait_for_all= 1;
+let $show_statement= SHOW ALL SLAVES STATUS;
+let $field= Slave_IO_State;
+let $condition= = 'Waiting for master to send event';
+--source include/wait_show_condition.inc
+
+--echo #
+--echo # Checking SHOW ALL SLAVES STATUS
+--echo #
+--let $all_slaves_status= 1
+--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/
+--source include/show_slave_status.inc
+--let $all_slaves_status=
+--echo #
+
+--echo #
+--echo # MDEV:16437: merge 5.7 P_S replication instrumentation and tables
+--echo #
+--replace_column 2 #
+query_vertical SELECT * FROM performance_schema.replication_applier_status_by_coordinator;
+
+--sorted_result
+select * from db1.t1;
+
+# This should show relay log events for the default master
+# (the one with the empty name)
+let binlog_file=;
+source include/show_relaylog_events.inc;
+let binlog_file= mysqld-relay-bin.000002;
+source include/show_relaylog_events.inc;
+
+# Make sure we don't lose control over replication connections
+# after reconnecting to the slave
+
+--disconnect slave
+--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
+
+stop slave io_thread;
+show status like 'Slave_running';
+set default_master_connection = 'master1';
+show status like 'Slave_running';
+
+--echo
+--echo #
+--echo # syntax compatible test
+--echo #
+--echo
+--echo #
+--echo # show relaylog events
+--echo #
+--replace_regex /Server ver:.*/Server ver: Version/
+SHOW RELAYLOG EVENTS for channel 'master1';
+
+--echo
+--echo show slave status for channel 'master1'
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
+--let $slave_name= 'master1'
+--let $for_channel= 1
+--source include/show_slave_status.inc
+
+--echo
+--echo #
+--echo # stop slave
+--echo #
+STOP SLAVE for channel 'master1';
+
+--echo
+--echo show slave status for channel 'master1'
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
+--let $slave_name= 'master1'
+--let $for_channel= 1
+--source include/show_slave_status.inc
+
+--echo
+--echo #
+--echo # start slave
+--echo #
+START SLAVE for channel 'master1';
+--source include/wait_for_slave_to_start.inc
+
+--echo
+--echo show slave status for channel 'master1'
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /Preparing/Yes/
+--let $slave_name= 'master1'
+--let $for_channel= 1
+--source include/show_slave_status.inc
+
+--echo
+--echo #
+--echo # flush relay logs
+--echo #
+FLUSH RELAY LOGS for channel 'master1';
+--source include/wait_for_sql_thread_read_all.inc
+
+--echo
+--echo show slave status for channel 'master1'
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
+--let $slave_name= 'master1'
+--let $for_channel= 1
+--source include/show_slave_status.inc
+
+--echo
+--echo #
+--echo # stop slave
+--echo #
+STOP SLAVE for channel 'master1';
+
+--echo
+--echo show slave status for channel 'master1'
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
+--let $slave_name= 'master1'
+--let $for_channel= 1
+--source include/show_slave_status.inc
+
+--echo
+--echo #
+--echo # reset slave
+--echo #
+RESET SLAVE for channel 'master1';
+
+--echo
+--echo show slave status for channel 'master1'
+--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
+--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
+--let $slave_name= 'master1'
+--let $for_channel= 1
+--source include/show_slave_status.inc
+
+--echo
+--echo #
+--echo # show relaylog events after reset slave
+--echo #
+SHOW RELAYLOG EVENTS for channel 'master1';
+
+--let $slave_name=
+--let for_channel=
+
+--echo
+--echo #
+--echo # check error syntax
+--echo #
+--error ER_WRONG_ARGUMENTS
+RESET SLAVE 'master1' for channel 'mmaster2';
+--error ER_WRONG_ARGUMENTS
+STOP SLAVE 'master1' for channel 'master2';
+--error ER_WRONG_ARGUMENTS
+FLUSH RELAY LOGS 'master1' for channel 'master2';
+--error ER_WRONG_ARGUMENTS
+START SLAVE 'master1' for channel 'master2';
+--error ER_WRONG_ARGUMENTS
+SHOW RELAYLOG 'master1' EVENTS for channel 'master2';
+--error ER_WRONG_ARGUMENTS
+SHOW SLAVE 'master1' STATUS for channel 'master2';
+
+--echo
+# Cleanup
+drop database db1;
+drop database db2;
+
+--source include/reset_master_slave.inc
+--disconnect slave
+
+--connection master1
+drop database db1;
+--source include/reset_master_slave.inc
+--disconnect master1
+
+--connection master2
+drop database db2;
+--source include/reset_master_slave.inc
+--disconnect master2
+
+#
+# Check channel as a keyword
+#
+--connection default
+CREATE TABLE channel (channel int);
+DROP TABLE channel;
diff --git a/mysql-test/suite/parts/inc/engines.combinations b/mysql-test/suite/parts/inc/engines.combinations
new file mode 100644
index 00000000000..17e01265006
--- /dev/null
+++ b/mysql-test/suite/parts/inc/engines.combinations
@@ -0,0 +1,8 @@
+[innodb]
+default-storage-engine=innodb
+
+[myisam]
+default-storage-engine=myisam
+
+[aria]
+default-storage-engine=aria
diff --git a/mysql-test/suite/parts/inc/engines.inc b/mysql-test/suite/parts/inc/engines.inc
new file mode 100644
index 00000000000..b8995ef08ec
--- /dev/null
+++ b/mysql-test/suite/parts/inc/engines.inc
@@ -0,0 +1,4 @@
+--source include/have_innodb.inc
+
+let $engine= `select @@default_storage_engine`;
+
diff --git a/mysql-test/suite/parts/inc/partition.pre b/mysql-test/suite/parts/inc/partition.pre
index fba909687a0..3c9bbe9a6a6 100644
--- a/mysql-test/suite/parts/inc/partition.pre
+++ b/mysql-test/suite/parts/inc/partition.pre
@@ -51,7 +51,7 @@ let $ER_PARSE_ERROR= 1064;
let $ER_TOO_MANY_PARTITIONS_ERROR= 1499;
let $ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF= 1503;
let $ER_NO_PARTS_ERROR= 1504;
-let $ER_DROP_PARTITION_NON_EXISTENT= 1507;
+let $ER_PARTITION_DOES_NOT_EXIST= 1507;
let $ER_SAME_NAME_PARTITION= 1517;
let $ER_NO_PARTITION_FOR_GIVEN_VALUE= 1526;
diff --git a/mysql-test/suite/parts/inc/partition_alter_1.inc b/mysql-test/suite/parts/inc/partition_alter_1.inc
index b62efd24072..a348407ac60 100644
--- a/mysql-test/suite/parts/inc/partition_alter_1.inc
+++ b/mysql-test/suite/parts/inc/partition_alter_1.inc
@@ -40,7 +40,7 @@ eval $insert_first_half;
# 0
# 1030: ER_GET_ERRNO
# 1502: ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
-# 1506: ER_DROP_PARTITION_NON_EXISTENT
+# 1506: ER_PARTITION_DOES_NOT_EXIST
--disable_abort_on_error
eval $alter;
--enable_abort_on_error
@@ -52,10 +52,10 @@ eval SET @my_errno = $mysql_errno;
let $run_test= `SELECT @my_errno = 0`;
if (`SELECT @my_errno NOT IN (0,$ER_GET_ERRNO,
$ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF,
- $ER_DROP_PARTITION_NON_EXISTENT)`);
+ $ER_PARTITION_DOES_NOT_EXIST)`);
{
--echo # The last command got an unexepected error response.
- --echo # Expected/handled SQL codes are 0,$ER_GET_ERRNO,$ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF,$ER_DROP_PARTITION_NON_EXISTENT
+ --echo # Expected/handled SQL codes are 0,$ER_GET_ERRNO,$ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF,$ER_PARTITION_DOES_NOT_EXIST
SELECT '# SQL code we got was: ' AS "", @my_errno AS "";
--echo # Sorry, have to abort.
--echo # Please check the error name to number mapping in inc/partition.pre.
diff --git a/mysql-test/suite/parts/inc/partition_fail.inc b/mysql-test/suite/parts/inc/partition_fail.inc
index dd79cdf1dc8..bbe5924e358 100644
--- a/mysql-test/suite/parts/inc/partition_fail.inc
+++ b/mysql-test/suite/parts/inc/partition_fail.inc
@@ -2,8 +2,10 @@
--eval $create_statement
--eval $insert_statement
---echo # State before failure
+--let $dbug_flag= `select @@session.debug_dbug`
+--echo # $dbug_flag: BEFORE failure
--replace_result #p# #P# #sp# #SP#
+--let $DATADIR= `select @@datadir`
--list_files $DATADIR/test
SHOW CREATE TABLE t1;
--sorted_result
@@ -11,7 +13,7 @@ SELECT * FROM t1;
--disable_abort_on_error
--eval $fail_statement
--enable_abort_on_error
---echo # State after failure
+--echo # $dbug_flag: AFTER failure
--replace_result #p# #P# #sp# #SP#
--list_files $DATADIR/test
SHOW CREATE TABLE t1;
@@ -19,10 +21,9 @@ SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
---echo # Same test under LOCK TABLE
--eval $create_statement
--eval $insert_statement
---echo # State before failure
+--echo # $dbug_flag: BEFORE failure (under LOCK TABLE)
--replace_result #p# #P# #sp# #SP#
--list_files $DATADIR/test
SHOW CREATE TABLE t1;
@@ -32,7 +33,7 @@ LOCK TABLE t1 WRITE;
--disable_abort_on_error
--eval $fail_statement
--enable_abort_on_error
---echo # State after failure
+--echo # $dbug_flag: AFTER failure (under LOCK TABLE)
--replace_result #p# #P# #sp# #SP#
--list_files $DATADIR/test
SHOW CREATE TABLE t1;
diff --git a/mysql-test/suite/parts/inc/partition_fail_t2.inc b/mysql-test/suite/parts/inc/partition_fail_t2.inc
index 492e6d5a71b..301fb005255 100644
--- a/mysql-test/suite/parts/inc/partition_fail_t2.inc
+++ b/mysql-test/suite/parts/inc/partition_fail_t2.inc
@@ -2,30 +2,40 @@
# To be used with WL#4445: EXCHANGE PARTITION WITH TABLE.
--eval $create_statement2
--eval $insert_statement2
-SHOW CREATE TABLE t2;
---sorted_result
-SELECT * FROM t2;
--eval $create_statement
--eval $insert_statement
---echo # State before failure
+--let $dbug_flag= `select @@session.debug_dbug`
+--echo # $dbug_flag: BEFORE failure
--replace_result #p# #P#
+if (!$DATADIR)
+{
+ --let $DATADIR= `SELECT @@datadir;`
+}
--list_files $DATADIR/test
SHOW CREATE TABLE t1;
--sorted_result
SELECT * FROM t1;
+SHOW CREATE TABLE t2;
+--sorted_result
+SELECT * FROM t2;
# accept all errors
--disable_abort_on_error
--replace_regex /#sql-exchange-[0-9a-f_\-]*/#sql-exchange/i
--eval $fail_statement
--enable_abort_on_error
---echo # State after failure
+--echo # $dbug_flag: AFTER failure
--replace_result #p# #P#
--list_files $DATADIR/test
SHOW CREATE TABLE t1;
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
+--error 0, ER_NO_SUCH_TABLE
SHOW CREATE TABLE t2;
--sorted_result
+--error 0, ER_NO_SUCH_TABLE
SELECT * FROM t2;
+# TODO: everything fails with ER_NO_SUCH_TABLE
+# but DROP TABLE fails with ER_BAD_TABLE_ERROR! Why?
+--error 0, ER_BAD_TABLE_ERROR
DROP TABLE t2;
diff --git a/mysql-test/suite/parts/r/alter_table,list.rdiff b/mysql-test/suite/parts/r/alter_table,list.rdiff
new file mode 100644
index 00000000000..090eb42de84
--- /dev/null
+++ b/mysql-test/suite/parts/r/alter_table,list.rdiff
@@ -0,0 +1,87 @@
+--- alter_table.result
++++ alter_table,list.reject
+@@ -62,13 +62,13 @@
+ partition pn values less than maxvalue);
+ ERROR HY000: Partitioned tables do not support CREATE TEMPORARY TABLE
+ create or replace table t1 (x int)
+-partition by range(x) (
+-partition p1 values less than (10),
+-partition p2 values less than (20),
+-partition p3 values less than (30),
+-partition p4 values less than (40),
+-partition p5 values less than (50),
+-partition pn values less than maxvalue);
++partition by list(x) (
++partition p1 values in (2, 3, 4),
++partition p2 values in (12, 13, 14),
++partition p3 values in (22, 23, 24),
++partition p4 values in (32, 33, 34),
++partition p5 values in (42, 43, 44),
++partition pn values in (52, 53, 54));
+ insert into t1 values (2), (12), (22), (32), (42), (52);
+ create or replace table tp2 (y int);
+ insert tp2 values (88);
+@@ -108,12 +108,12 @@
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+ ) ENGINE=X DEFAULT CHARSET=latin1
+- PARTITION BY RANGE (`x`)
+-(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+- PARTITION `p3` VALUES LESS THAN (30) ENGINE = X,
+- PARTITION `p4` VALUES LESS THAN (40) ENGINE = X,
+- PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+- PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
++ PARTITION BY LIST (`x`)
++(PARTITION `p1` VALUES IN (2,3,4) ENGINE = X,
++ PARTITION `p3` VALUES IN (22,23,24) ENGINE = X,
++ PARTITION `p4` VALUES IN (32,33,34) ENGINE = X,
++ PARTITION `p5` VALUES IN (42,43,44) ENGINE = X,
++ PARTITION `pn` VALUES IN (52,53,54) ENGINE = X)
+ select * from t1 order by x;
+ x
+ 2
+@@ -138,11 +138,11 @@
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+ ) ENGINE=X DEFAULT CHARSET=latin1
+- PARTITION BY RANGE (`x`)
+-(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+- PARTITION `p4` VALUES LESS THAN (40) ENGINE = X,
+- PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+- PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
++ PARTITION BY LIST (`x`)
++(PARTITION `p1` VALUES IN (2,3,4) ENGINE = X,
++ PARTITION `p4` VALUES IN (32,33,34) ENGINE = X,
++ PARTITION `p5` VALUES IN (42,43,44) ENGINE = X,
++ PARTITION `pn` VALUES IN (52,53,54) ENGINE = X)
+ select * from t1 order by x;
+ x
+ 2
+@@ -168,10 +168,10 @@
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+ ) ENGINE=X DEFAULT CHARSET=latin1
+- PARTITION BY RANGE (`x`)
+-(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+- PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+- PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
++ PARTITION BY LIST (`x`)
++(PARTITION `p1` VALUES IN (2,3,4) ENGINE = X,
++ PARTITION `p5` VALUES IN (42,43,44) ENGINE = X,
++ PARTITION `pn` VALUES IN (52,53,54) ENGINE = X)
+ select * from t1 order by x;
+ x
+ 2
+@@ -193,9 +193,9 @@
+ t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+ ) ENGINE=X DEFAULT CHARSET=latin1
+- PARTITION BY RANGE (`x`)
+-(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+- PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
++ PARTITION BY LIST (`x`)
++(PARTITION `p1` VALUES IN (2,3,4) ENGINE = X,
++ PARTITION `pn` VALUES IN (52,53,54) ENGINE = X)
+ select * from t1 order by x;
+ x
+ 2
diff --git a/mysql-test/suite/parts/r/alter_table.result b/mysql-test/suite/parts/r/alter_table.result
index 94100b83118..7f81eb17944 100644
--- a/mysql-test/suite/parts/r/alter_table.result
+++ b/mysql-test/suite/parts/r/alter_table.result
@@ -28,3 +28,319 @@ ALTER TABLE v1 EXCHANGE PARTITION p2 WITH TABLE t2 ;
ERROR 42000: Can't open table
DROP VIEW v1;
DROP TABLE t1, t2;
+#
+# MDEV-22165 CONVERT PARTITION: move in partition from existing table
+#
+create or replace table tp1 (a int);
+create or replace table t1 (a int)
+partition by hash (a) partitions 2;
+alter table t1 convert table tp1 to partition p2;
+ERROR HY000: CONVERT TABLE TO PARTITION can only be used on RANGE/LIST partitions
+create or replace table t1 (a int)
+partition by range (a)
+(partition p0 values less than (0));
+alter table t1 convert table non_existent to partition p1 values less than (10);
+ERROR 42S02: Table 'test.non_existent' doesn't exist
+alter table t1 convert table tp1 to partition p1 values less than (10);
+show create table tp1;
+ERROR 42S02: Table 'test.tp1' doesn't exist
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`a`)
+(PARTITION `p0` VALUES LESS THAN (0) ENGINE = X,
+ PARTITION `p1` VALUES LESS THAN (10) ENGINE = X)
+create table tp2 (x int);
+alter table t1 convert table tp2 to partition p2 values less than (20);
+ERROR HY000: Tables have different definitions
+show create table tp2;
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`a`)
+(PARTITION `p0` VALUES LESS THAN (0) ENGINE = X,
+ PARTITION `p1` VALUES LESS THAN (10) ENGINE = X)
+create or replace table tp2 (a int);
+insert tp2 values (1), (15), (17);
+alter table t1 convert table tp2 to partition p2 values less than (20);
+ERROR HY000: Found a row that does not match the partition
+delete from tp2;
+insert tp2 values (15), (1), (17);
+alter table t1 convert table tp2 to partition p2 values less than (20);
+ERROR HY000: Found a row that does not match the partition
+delete from tp2;
+insert tp2 values (15), (17), (1);
+alter table t1 convert table tp2 to partition p2 values less than (20);
+ERROR HY000: Found a row that does not match the partition
+delete from tp2;
+insert tp2 values (15), (17);
+alter table t1 convert table tp2 to partition p2 values less than (20);
+show create table tp2;
+ERROR 42S02: Table 'test.tp2' doesn't exist
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`a`)
+(PARTITION `p0` VALUES LESS THAN (0) ENGINE = X,
+ PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = X)
+select * from t1 partition (p2);
+a
+15
+17
+create or replace table t1 (a int)
+partition by range (a) (
+p0 values less than (0),
+pn values less than (30));
+insert into t1 values (1);
+create or replace table tp1 (a int);
+insert into tp1 values (2);
+alter table t1 convert table tp1 to partition p1 values less than (10);
+ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
+drop tables t1, tp1;
+#
+# MDEV-22166 CONVERT PARTITION: move out partition into a table
+#
+create or replace table t1 (x int);
+alter table t1 convert partition p1 to table tp1;
+ERROR HY000: Partition management on a not partitioned table is not possible
+create or replace table t1 (x int)
+partition by hash(x) partitions 2;
+alter table t1 convert partition p1 to table tp1;
+ERROR HY000: CONVERT PARTITION can only be used on RANGE/LIST partitions
+create or replace table t1 (x int)
+partition by key(x) partitions 2;
+alter table t1 convert partition p1 to table tp1;
+ERROR HY000: CONVERT PARTITION can only be used on RANGE/LIST partitions
+create or replace table t1 (x int)
+partition by range(x)
+subpartition by hash(x) subpartitions 3 (
+partition p1 values less than (10),
+partition pn values less than maxvalue);
+alter table t1 convert partition p1 to table p1;
+ERROR HY000: Convert partition is not supported for subpartitioned table.
+alter table t1 convert partition p1sp0 to table p1;
+ERROR HY000: Wrong partition name or partition list
+create or replace table t1 (x int)
+partition by range(x) (
+partition p1 values less than (10));
+alter table t1 convert partition p1 to table tp1;
+ERROR HY000: Cannot remove all partitions, use DROP TABLE instead
+create or replace temporary table t1 (x int)
+partition by range(x) (
+partition p0 values less than (10),
+partition pn values less than maxvalue);
+ERROR HY000: Partitioned tables do not support CREATE TEMPORARY TABLE
+create or replace table t1 (x int)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+create or replace table tp2 (y int);
+insert tp2 values (88);
+alter table t1 convert partition p2 to table tp2, drop partition p3;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' drop partition p3' at line 1
+alter table t1 convert partition p00 to table tp00;
+ERROR HY000: Wrong partition name or partition list
+alter table t1 convert partition p00 to table tp2;
+ERROR 42S01: Table 'tp2' already exists
+alter table t1 convert partition p2 to table tp2;
+ERROR 42S01: Table 'tp2' already exists
+create trigger tr1 before update on t1 for each row
+begin
+alter table t1 convert partition p2 to table tp2;
+end$
+ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger
+create function f1() returns int
+begin
+alter table t1 convert partition p2 to table tp2;
+end$
+ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger
+select * from tp2;
+y
+88
+drop table tp2;
+alter table t1 convert partition p2 to table tp2;
+show create table tp2;
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1
+select * from tp2;
+x
+12
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = X,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = X,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+select * from t1 order by x;
+x
+2
+22
+32
+42
+52
+alter table t1 convert partition p3 to table inexistent.tp3;
+ERROR 42000: Unknown database 'inexistent'
+create database EXISTENT;
+alter table t1 convert partition p3 to table EXISTENT.TP3;
+show create table EXISTENT.TP3;
+Table Create Table
+TP3 CREATE TABLE `TP3`-ok (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1
+select * from EXISTENT.TP3 order by x;
+x
+22
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = X,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+select * from t1 order by x;
+x
+2
+32
+42
+52
+# LOCK TABLES
+lock tables t1 write;
+alter table t1 convert partition p4 to table tp4;
+show create table tp4;
+ERROR HY000: Table 'tp4' was not locked with LOCK TABLES
+unlock tables;
+show create table tp4;
+Table Create Table
+tp4 CREATE TABLE `tp4` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1
+select * from tp4;
+x
+32
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+select * from t1 order by x;
+x
+2
+42
+52
+# PS
+prepare stmt from 'alter table t1 convert partition p5 to table tp5';
+execute stmt;
+show create table tp5;
+Table Create Table
+tp5 CREATE TABLE `tp5` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1
+select * from tp5;
+x
+42
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+select * from t1 order by x;
+x
+2
+52
+drop table tp5;
+execute stmt;
+ERROR HY000: Wrong partition name or partition list
+execute stmt;
+ERROR HY000: Wrong partition name or partition list
+drop prepare stmt;
+# Privileges
+create user alan;
+grant usage on *.* to alan;
+grant create, insert, drop on test.* to alan;
+connect alan,localhost,alan,,test;
+show grants for current_user;
+Grants for alan@%
+GRANT USAGE ON *.* TO `alan`@`%`
+GRANT INSERT, CREATE, DROP ON `test`.* TO `alan`@`%`
+alter table t1 convert partition p1 to table tp1;
+ERROR 42000: ALTER command denied to user 'alan'@'localhost' for table 't1'
+connection default;
+revoke all on test.* from alan;
+grant create, insert, alter on test.* to alan;
+connection alan;
+use test;
+show grants for current_user;
+Grants for alan@%
+GRANT USAGE ON *.* TO `alan`@`%`
+GRANT INSERT, CREATE, ALTER ON `test`.* TO `alan`@`%`
+alter table t1 convert partition p1 to table tp1;
+ERROR 42000: DROP command denied to user 'alan'@'localhost' for table 't1'
+connection default;
+revoke all on test.* from alan;
+grant create, drop, alter on test.* to alan;
+connection alan;
+use test;
+show grants for current_user;
+Grants for alan@%
+GRANT USAGE ON *.* TO `alan`@`%`
+GRANT CREATE, DROP, ALTER ON `test`.* TO `alan`@`%`
+alter table t1 convert partition p1 to table tp1;
+ERROR 42000: INSERT command denied to user 'alan'@'localhost' for table 'tp1'
+connection default;
+revoke all on test.* from alan;
+grant insert, drop, alter on test.* to alan;
+connection alan;
+use test;
+show grants for current_user;
+Grants for alan@%
+GRANT USAGE ON *.* TO `alan`@`%`
+GRANT INSERT, DROP, ALTER ON `test`.* TO `alan`@`%`
+alter table t1 convert partition p1 to table tp1;
+ERROR 42000: CREATE command denied to user 'alan'@'localhost' for table 'tp1'
+connection default;
+grant create, insert, drop, alter on test.* to alan;
+connection alan;
+use test;
+show grants for current_user;
+Grants for alan@%
+GRANT USAGE ON *.* TO `alan`@`%`
+GRANT INSERT, CREATE, DROP, ALTER ON `test`.* TO `alan`@`%`
+alter table t1 convert partition p1 to table tp1;
+disconnect alan;
+connection default;
+drop database EXISTENT;
+drop user alan;
+drop tables t1, tp1, tp2, tp4;
diff --git a/mysql-test/suite/parts/r/debug_innodb_fail.result b/mysql-test/suite/parts/r/debug_innodb_fail.result
index 3409d162f1c..65d13feec62 100644
--- a/mysql-test/suite/parts/r/debug_innodb_fail.result
+++ b/mysql-test/suite/parts/r/debug_innodb_fail.result
@@ -19,7 +19,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_1: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -47,7 +47,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_1: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -73,14 +73,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_1: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -109,7 +108,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_1: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -144,7 +143,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_2: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -172,7 +171,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_2: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -198,14 +197,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_2: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -234,7 +232,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_2: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -269,7 +267,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_3: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -297,7 +295,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_3: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -323,14 +321,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_3: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -359,7 +356,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_3: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -394,7 +391,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_4: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -422,7 +419,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_4: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -448,14 +445,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_4: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -484,7 +480,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_4: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -519,7 +515,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_5: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -547,7 +543,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_5: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -573,14 +569,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_5: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -609,7 +604,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_5: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -644,7 +639,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_6: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -672,7 +667,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_6: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -698,14 +693,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_6: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -734,7 +728,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_6: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -769,7 +763,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_7: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -797,7 +791,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_7: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -823,14 +817,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_7: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -859,7 +852,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_7: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -894,7 +887,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_8: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -922,7 +915,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_8: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -950,14 +943,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_8: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -986,7 +978,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_8: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1023,7 +1015,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_9: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1051,7 +1043,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_9: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1079,14 +1071,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_9: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1115,7 +1106,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_9: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1152,7 +1143,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_10: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1180,7 +1171,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_10: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1208,14 +1199,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_10: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1244,7 +1234,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_10: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1283,7 +1273,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_1: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1310,7 +1300,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_1: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1336,14 +1326,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_1: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1371,7 +1360,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_1: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1406,7 +1395,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_2: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1433,7 +1422,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_2: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1459,14 +1448,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_2: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1494,7 +1482,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_2: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1529,7 +1517,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_3: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1556,7 +1544,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_3: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1582,14 +1570,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_3: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1617,7 +1604,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_3: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1652,7 +1639,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_4: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1679,7 +1666,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_4: AFTER failure
db.opt
t1#P#p0.ibd
t1.frm
@@ -1699,14 +1686,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_4: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1734,7 +1720,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_4: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1.frm
@@ -1763,7 +1749,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_5: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1790,7 +1776,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_5: AFTER failure
db.opt
t1#P#p0.ibd
t1.frm
@@ -1810,14 +1796,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_5: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1845,7 +1830,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_5: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1.frm
@@ -1874,7 +1859,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_6: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1901,7 +1886,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_6: AFTER failure
db.opt
t1#P#p0.ibd
t1.frm
@@ -1921,14 +1906,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_6: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -1956,7 +1940,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_6: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1.frm
@@ -1985,7 +1969,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_7: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2012,7 +1996,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_7: AFTER failure
db.opt
t1#P#p0.ibd
t1.frm
@@ -2032,14 +2016,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_7: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2067,7 +2050,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_7: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1.frm
@@ -2096,7 +2079,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_8: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2123,7 +2106,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_8: AFTER failure
db.opt
t1#P#p0.ibd
t1.frm
@@ -2143,14 +2126,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_8: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2178,7 +2160,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_8: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1.frm
@@ -2207,7 +2189,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_9: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2234,7 +2216,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_9: AFTER failure
db.opt
t1#P#p0.ibd
t1.frm
@@ -2254,14 +2236,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_9: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2289,7 +2270,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_9: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1.frm
@@ -2321,7 +2302,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_1: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2350,7 +2331,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_1: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2376,14 +2357,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_1: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2413,7 +2393,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_1: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2448,7 +2428,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_2: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2477,7 +2457,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_2: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2503,14 +2483,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_2: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2540,7 +2519,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_2: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2575,7 +2554,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_3: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2604,7 +2583,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_3: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2630,14 +2609,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_3: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2667,7 +2645,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_3: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2702,7 +2680,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_4: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2731,7 +2709,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_4: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2757,14 +2735,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_4: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2794,7 +2771,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_4: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2829,7 +2806,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_5: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2858,7 +2835,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_5: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2884,14 +2861,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_5: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2921,7 +2897,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_5: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2956,7 +2932,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_6: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -2985,7 +2961,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_6: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3011,14 +2987,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_6: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3048,7 +3023,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_6: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3083,7 +3058,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_7: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3112,7 +3087,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_7: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3140,14 +3115,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_7: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3177,7 +3151,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_7: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3214,7 +3188,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_8: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3243,7 +3217,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_8: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3271,14 +3245,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_8: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3308,7 +3281,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_8: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3345,7 +3318,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_9: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3374,7 +3347,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_9: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3402,14 +3375,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_9: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3439,7 +3411,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_9: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3476,7 +3448,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_10: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3505,7 +3477,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_10: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3533,14 +3505,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_10: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3570,7 +3541,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_10: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3607,7 +3578,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_11: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3636,7 +3607,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_11: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3664,14 +3635,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_11: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3701,7 +3671,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_11: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3738,7 +3708,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_12: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3767,7 +3737,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_12: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3795,14 +3765,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'InnoDB'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_12: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
@@ -3832,7 +3801,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_12: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.ibd
t1#P#p10.ibd
diff --git a/mysql-test/suite/parts/r/debug_myisam_fail.result b/mysql-test/suite/parts/r/debug_myisam_fail.result
index 304d49daf06..509cffe4384 100644
--- a/mysql-test/suite/parts/r/debug_myisam_fail.result
+++ b/mysql-test/suite/parts/r/debug_myisam_fail.result
@@ -16,7 +16,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_1: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -46,7 +46,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_1: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -74,14 +74,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_1: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -112,7 +111,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_1: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -149,7 +148,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_2: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -179,7 +178,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_2: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -207,14 +206,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_2: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -245,7 +243,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_2: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -282,7 +280,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_3: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -312,7 +310,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_3: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -340,14 +338,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_3: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -378,7 +375,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_3: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -415,7 +412,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_4: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -445,7 +442,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_4: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -473,14 +470,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_4: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -511,7 +507,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_4: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -548,7 +544,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_5: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -578,7 +574,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_5: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -606,14 +602,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_5: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -644,7 +639,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_5: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -681,7 +676,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_6: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -711,7 +706,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_6: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -739,14 +734,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_6: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -777,7 +771,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_6: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -814,7 +808,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_7: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -844,7 +838,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_7: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -872,14 +866,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_7: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -910,7 +903,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_7: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -947,7 +940,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_8: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -977,7 +970,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_8: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1008,14 +1001,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_8: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1046,7 +1038,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_8: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1086,7 +1078,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_9: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1116,7 +1108,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_9: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1147,14 +1139,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_9: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1185,7 +1176,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_9: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1225,7 +1216,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_10: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1255,7 +1246,7 @@ a b
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_10: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1286,14 +1277,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_add_partition_10: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1324,7 +1314,7 @@ LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_add_partition_10: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1366,7 +1356,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_1: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1395,7 +1385,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_1: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1423,14 +1413,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_1: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1460,7 +1449,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_1: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1497,7 +1486,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_2: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1526,7 +1515,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_2: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1554,14 +1543,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_2: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1591,7 +1579,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_2: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1628,7 +1616,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_3: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1657,7 +1645,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_3: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1685,14 +1673,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_3: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1722,7 +1709,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_3: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1759,7 +1746,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_4: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1788,7 +1775,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_4: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1809,14 +1796,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_4: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1846,7 +1832,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_4: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1876,7 +1862,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_5: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1905,7 +1891,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_5: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1926,14 +1912,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_5: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1963,7 +1948,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_5: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1993,7 +1978,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_6: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2022,7 +2007,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_6: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2043,14 +2028,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_6: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2080,7 +2064,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_6: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2110,7 +2094,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_7: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2139,7 +2123,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_7: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2160,14 +2144,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_7: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2197,7 +2180,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_7: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2227,7 +2210,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_8: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2256,7 +2239,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_8: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2277,14 +2260,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_8: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2314,7 +2296,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_8: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2344,7 +2326,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_9: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2373,7 +2355,7 @@ a b
4 Original from partition p0
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_9: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2394,14 +2376,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_drop_partition_9: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2431,7 +2412,7 @@ a b
LOCK TABLE t1 WRITE;
ALTER TABLE t1 DROP PARTITION p10;
ERROR HY000: Unknown error
-# State after failure
+# d,fail_drop_partition_9: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2464,7 +2445,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_1: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2495,7 +2476,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_1: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2523,14 +2504,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_1: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2562,7 +2542,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_1: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2599,7 +2579,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_2: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2630,7 +2610,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_2: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2658,14 +2638,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_2: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2697,7 +2676,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_2: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2734,7 +2713,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_3: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2765,7 +2744,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_3: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2793,14 +2772,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_3: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2832,7 +2810,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_3: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2869,7 +2847,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_4: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2900,7 +2878,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_4: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2928,14 +2906,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_4: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -2967,7 +2944,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_4: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3004,7 +2981,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_5: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3035,7 +3012,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_5: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3063,14 +3040,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_5: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3102,7 +3078,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_5: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3139,7 +3115,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_6: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3170,7 +3146,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_6: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3198,14 +3174,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_6: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3237,7 +3212,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_6: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3274,7 +3249,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_7: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3305,7 +3280,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_7: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3336,14 +3311,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_7: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3375,7 +3349,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_7: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3415,7 +3389,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_8: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3446,7 +3420,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_8: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3477,14 +3451,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_8: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3516,7 +3489,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_8: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3556,7 +3529,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_9: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3587,7 +3560,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_9: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3618,14 +3591,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_9: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3657,7 +3629,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_9: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3697,7 +3669,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_10: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3728,7 +3700,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_10: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3759,14 +3731,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_10: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3798,7 +3769,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_10: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3838,7 +3809,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_11: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3869,7 +3840,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_11: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3900,14 +3871,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_11: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3939,7 +3909,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_11: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -3979,7 +3949,7 @@ PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_12: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -4010,7 +3980,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_12: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -4041,14 +4011,13 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
-# Same test under LOCK TABLE
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = 'MyISAM'
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
-# State before failure
+# d,fail_change_partition_12: BEFORE failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -4080,7 +4049,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Unknown error
-# State after failure
+# d,fail_change_partition_12: AFTER failure (under LOCK TABLE)
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
diff --git a/mysql-test/suite/parts/r/partition_alter4_innodb.result b/mysql-test/suite/parts/r/partition_alter4_innodb.result
index d88bdfcbe00..6cfa4c13781 100644
--- a/mysql-test/suite/parts/r/partition_alter4_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter4_innodb.result
@@ -7592,7 +7592,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8052,7 +8052,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8523,7 +8523,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8995,7 +8995,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -9461,7 +9461,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -9933,7 +9933,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -10410,7 +10410,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -10885,7 +10885,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -11350,7 +11350,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -11810,7 +11810,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -12281,7 +12281,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -12753,7 +12753,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -13219,7 +13219,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -13691,7 +13691,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -14168,7 +14168,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -14643,7 +14643,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -26393,7 +26393,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -26853,7 +26853,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -27324,7 +27324,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -27796,7 +27796,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -28262,7 +28262,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -28734,7 +28734,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -29211,7 +29211,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -29686,7 +29686,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -30151,7 +30151,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -30611,7 +30611,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -31082,7 +31082,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -31554,7 +31554,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -32020,7 +32020,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -32492,7 +32492,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -32969,7 +32969,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -33444,7 +33444,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -45202,7 +45202,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -45662,7 +45662,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -46133,7 +46133,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -46605,7 +46605,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -47071,7 +47071,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -47543,7 +47543,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -48020,7 +48020,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -48495,7 +48495,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -48960,7 +48960,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -49420,7 +49420,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -49891,7 +49891,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -50363,7 +50363,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -50829,7 +50829,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -51301,7 +51301,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -51778,7 +51778,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -52253,7 +52253,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -63970,7 +63970,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -63985,7 +63985,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64008,7 +64008,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64029,7 +64029,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64048,7 +64048,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64071,7 +64071,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64094,7 +64094,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64113,7 +64113,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
# 4.4 ALTER ... REBUILD PARTITION part_1,part_1,part_1;
DROP TABLE IF EXISTS t1;
@@ -64130,7 +64130,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64145,7 +64145,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64168,7 +64168,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64189,7 +64189,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64208,7 +64208,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64231,7 +64231,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64254,7 +64254,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -64273,7 +64273,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
# 4.5 ALTER ... REBUILD PARTITION ALL;
DROP TABLE IF EXISTS t1;
@@ -75552,7 +75552,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -76012,7 +76012,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -76483,7 +76483,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -76955,7 +76955,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -77421,7 +77421,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -77893,7 +77893,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -78370,7 +78370,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -78845,7 +78845,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -79310,7 +79310,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -79770,7 +79770,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -80241,7 +80241,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -80713,7 +80713,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -81179,7 +81179,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -81651,7 +81651,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -82128,7 +82128,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -82603,7 +82603,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
diff --git a/mysql-test/suite/parts/r/partition_alter4_myisam.result b/mysql-test/suite/parts/r/partition_alter4_myisam.result
index 90edd1b2210..a3921ea0977 100644
--- a/mysql-test/suite/parts/r/partition_alter4_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter4_myisam.result
@@ -7888,7 +7888,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8357,7 +8357,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -8843,7 +8843,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -9336,7 +9336,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -9819,7 +9819,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -10312,7 +10312,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -10810,7 +10810,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -11306,7 +11306,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -11794,7 +11794,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -12263,7 +12263,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -12749,7 +12749,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -13242,7 +13242,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -13725,7 +13725,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -14218,7 +14218,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -14716,7 +14716,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -15212,7 +15212,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 analyze error Error in list of partitions to test.t1
+test.t1 analyze error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -27429,7 +27429,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -27898,7 +27898,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -28384,7 +28384,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -28877,7 +28877,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -29360,7 +29360,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -29853,7 +29853,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -30351,7 +30351,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -30847,7 +30847,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -31335,7 +31335,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -31804,7 +31804,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -32290,7 +32290,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -32783,7 +32783,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -33266,7 +33266,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -33759,7 +33759,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -34257,7 +34257,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -34753,7 +34753,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 check error Error in list of partitions to test.t1
+test.t1 check error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -46962,7 +46962,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -47431,7 +47431,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -47917,7 +47917,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -48410,7 +48410,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -48893,7 +48893,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -49386,7 +49386,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -49884,7 +49884,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -50380,7 +50380,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -50868,7 +50868,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -51337,7 +51337,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -51823,7 +51823,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -52316,7 +52316,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -52799,7 +52799,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -53292,7 +53292,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -53790,7 +53790,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -54286,7 +54286,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 optimize error Error in list of partitions to test.t1
+test.t1 optimize error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -66462,7 +66462,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66477,7 +66477,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66500,7 +66500,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66521,7 +66521,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66540,7 +66540,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66563,7 +66563,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66586,7 +66586,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66605,7 +66605,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
# 4.4 ALTER ... REBUILD PARTITION part_1,part_1,part_1;
DROP TABLE IF EXISTS t1;
@@ -66622,7 +66622,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66637,7 +66637,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66660,7 +66660,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66681,7 +66681,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66700,7 +66700,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66723,7 +66723,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66746,7 +66746,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
CREATE TABLE t1 (
f_int1 INTEGER DEFAULT 0,
@@ -66765,7 +66765,7 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
-ERROR HY000: Error in list of partitions to REBUILD
+ERROR HY000: Wrong partition name or partition list
DROP TABLE t1;
# 4.5 ALTER ... REBUILD PARTITION ALL;
DROP TABLE IF EXISTS t1;
@@ -78488,7 +78488,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -78957,7 +78957,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -79443,7 +79443,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -79936,7 +79936,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -80419,7 +80419,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -80912,7 +80912,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -81410,7 +81410,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -81906,7 +81906,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -82394,7 +82394,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -82863,7 +82863,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -83349,7 +83349,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -83842,7 +83842,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -84325,7 +84325,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -84818,7 +84818,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -85316,7 +85316,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
@@ -85812,7 +85812,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
Table Op Msg_type Msg_text
-test.t1 repair error Error in list of partitions to test.t1
+test.t1 repair error Wrong partition name or partition list
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
diff --git a/mysql-test/suite/parts/r/partition_debug.result b/mysql-test/suite/parts/r/partition_debug.result
index 571ab329bc2..5afb2b45926 100644
--- a/mysql-test/suite/parts/r/partition_debug.result
+++ b/mysql-test/suite/parts/r/partition_debug.result
@@ -1025,23 +1025,11 @@ SET @save_dbug=@@debug_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_1";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_1: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1075,9 +1063,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_1: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1129,23 +1129,11 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_2";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_2: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1179,9 +1167,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_2: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1233,23 +1233,11 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_3";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_3: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1283,9 +1271,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error on rename of './test/t2' to './test/#sql-exchange' (errno: 0 "Internal error/check (Not system error)")
-# State after failure
+# d,exchange_partition_fail_3: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1337,23 +1337,11 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_4";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_4: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1387,9 +1375,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_4: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1441,23 +1441,11 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_5";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_5: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1491,9 +1479,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error on rename of './test/t1#P#p0' to './test/t2' (errno: 0 "Internal error/check (Not system error)")
-# State after failure
+# d,exchange_partition_fail_5: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1545,23 +1545,11 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_6";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_6: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1595,9 +1583,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_6: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1649,23 +1649,11 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_7";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_7: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1699,9 +1687,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error on rename of './test/#sql-exchange' to './test/t1#P#p0' (errno: 0 "Internal error/check (Not system error)")
-# State after failure
+# d,exchange_partition_fail_7: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1753,23 +1753,11 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_8";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_8: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1803,9 +1791,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_8: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1857,23 +1857,11 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_9";
CREATE TABLE t2 (a INT, b VARCHAR(64));
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64)) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_9: BEFORE failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1907,9 +1895,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_9: AFTER failure
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
@@ -1958,3 +1958,3229 @@ a b
4 Original from partition p0
DROP TABLE t2;
SET SESSION debug_dbug=@save_dbug;
+#
+# MDEV-22165 CONVERT PARTITION: move in partition from existing table
+#
+set @save_dbug=@@debug_dbug;
+set session debug_dbug="+d,fail_convert_partition_1";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_1: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_1: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_2";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_2: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_2: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_3";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_3: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_3: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_4";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_4: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_4: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_5";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_5: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_5: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_6";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_6: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_6: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_7";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_7: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_7: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_8";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_8: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_8: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_9";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_9: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_9: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_11";
+create or replace table t2 (x int primary key);
+insert into t2 values (32), (42), (52);
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30));
+insert into t1 values (2), (12), (22);
+# d,fail_convert_partition_11: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1.frm
+t1.par
+t2.MYD
+t2.MYI
+t2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+x
+32
+42
+52
+alter table t1 convert table t2 to partition pn values less than maxvalue;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_11: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t2;
+set session debug_dbug=@save_dbug;
+#
+# MDEV-22166 CONVERT PARTITION: move out partition into a table
+#
+set @save_dbug=@@debug_dbug;
+set session debug_dbug="+d,fail_create_before_create_frm";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_create_before_create_frm: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_create_before_create_frm: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_create_before_create_frm: BEFORE failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_create_before_create_frm: AFTER failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_alter_partition_after_write_frm";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_alter_partition_after_write_frm: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_alter_partition_after_write_frm: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_alter_partition_after_write_frm: BEFORE failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_alter_partition_after_write_frm: AFTER failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,error_convert_partition_00";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,error_convert_partition_00: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Error on rename of './test/t1#P#p2' to './test/tp2' (errno: 137 "No more records (read after end of file)")
+# d,error_convert_partition_00: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,error_convert_partition_00: BEFORE failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Error on rename of './test/t1#P#p2' to './test/tp2' (errno: 137 "No more records (read after end of file)")
+# d,error_convert_partition_00: AFTER failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_1";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_1: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_1: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_1: BEFORE failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_1: AFTER failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_2";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_2: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_2: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_2: BEFORE failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_2: AFTER failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_3";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_3: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_3: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_3: BEFORE failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_3: AFTER failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_4";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_4: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_4: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_4: BEFORE failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_4: AFTER failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_5";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_5: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_5: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_5: BEFORE failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_5: AFTER failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_6";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_6: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_6: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_6: BEFORE failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_6: AFTER failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_7";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_7: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_7: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_7: BEFORE failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_7: AFTER failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_8";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_8: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_8: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_8: BEFORE failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_8: AFTER failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_9";
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_9: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_9: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_9: BEFORE failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_9: AFTER failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_11";
+# Already finished DDL logging, so tp2 now exists:
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_11: BEFORE failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Unknown error
+# d,fail_convert_partition_11: AFTER failure
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+2
+22
+32
+42
+52
+DROP TABLE t1;
+create or replace table t1 (x int primary key)
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+# d,fail_convert_partition_11: BEFORE failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+LOCK TABLE t1 WRITE;
+alter table t1 convert partition p2 to table tp2;
+ERROR 42S01: Table 'tp2' already exists
+# d,fail_convert_partition_11: AFTER failure (under LOCK TABLE)
+db.opt
+t1#P#p1.MYD
+t1#P#p1.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1#P#p3.MYD
+t1#P#p3.MYI
+t1#P#p4.MYD
+t1#P#p4.MYI
+t1#P#p5.MYD
+t1#P#p5.MYI
+t1#P#pn.MYD
+t1#P#pn.MYI
+t1.frm
+t1.par
+tp2.MYD
+tp2.MYI
+tp2.frm
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+SELECT * FROM t1;
+x
+12
+2
+22
+32
+42
+52
+UNLOCK TABLES;
+DROP TABLE t1;
+set session debug_dbug=@save_dbug;
+show create table tp2;
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from tp2;
+x
+12
+drop table tp2;
diff --git a/mysql-test/suite/parts/r/partition_debug_innodb.result b/mysql-test/suite/parts/r/partition_debug_innodb.result
index 15d670ff416..db88e714872 100644
--- a/mysql-test/suite/parts/r/partition_debug_innodb.result
+++ b/mysql-test/suite/parts/r/partition_debug_innodb.result
@@ -961,25 +961,13 @@ SET @save_dbug=@@debug_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_1";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_1: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1010,9 +998,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_1: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1061,25 +1061,13 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_2";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_2: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1110,9 +1098,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_2: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1161,25 +1161,13 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_3";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_3: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1210,9 +1198,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error on rename of './test/t2' to './test/#sql-exchange' (errno: 0 "Internal error/check (Not system error)")
-# State after failure
+# d,exchange_partition_fail_3: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1261,25 +1261,13 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_4";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_4: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1310,9 +1298,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_4: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1361,25 +1361,13 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_5";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_5: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1410,9 +1398,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error on rename of './test/t1#P#p0' to './test/t2' (errno: 0 "Internal error/check (Not system error)")
-# State after failure
+# d,exchange_partition_fail_5: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1461,25 +1461,13 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_6";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_6: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1510,9 +1498,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_6: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1561,25 +1561,13 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_7";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_7: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1610,9 +1598,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error on rename of './test/#sql-exchange' to './test/t1#P#p0' (errno: 0 "Internal error/check (Not system error)")
-# State after failure
+# d,exchange_partition_fail_7: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1661,25 +1661,13 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_8";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_8: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1710,9 +1698,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_8: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1761,25 +1761,13 @@ SET SESSION debug_dbug=@save_dbug;
SET SESSION debug_dbug="+d,exchange_partition_fail_9";
CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- `b` varchar(64) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SELECT * FROM t2;
-a b
-5 Original from table t2
-6 Original from table t2
-7 Original from table t2
-8 Original from table t2
CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
-# State before failure
+# d,exchange_partition_fail_9: BEFORE failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
@@ -1810,9 +1798,21 @@ a b
24 Original from partition p1
3 Original from partition p0
4 Original from partition p0
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+a b
+5 Original from table t2
+6 Original from table t2
+7 Original from table t2
+8 Original from table t2
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Error in DDL log
-# State after failure
+# d,exchange_partition_fail_9: AFTER failure
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
diff --git a/mysql-test/suite/parts/t/alter_table.combinations b/mysql-test/suite/parts/t/alter_table.combinations
new file mode 100644
index 00000000000..d4feae10f19
--- /dev/null
+++ b/mysql-test/suite/parts/t/alter_table.combinations
@@ -0,0 +1,2 @@
+[range]
+[list]
diff --git a/mysql-test/suite/parts/t/alter_table.test b/mysql-test/suite/parts/t/alter_table.test
index 53b61806acb..741a9450c8e 100644
--- a/mysql-test/suite/parts/t/alter_table.test
+++ b/mysql-test/suite/parts/t/alter_table.test
@@ -1,9 +1,8 @@
-#
-# General errors with ALTER TABLE and partitions that doesn't have to be run
-# on all engines
-#
-
+# Permissions don't work with embedded
+--source include/not_embedded.inc
--source include/have_partition.inc
+--source include/lcase_names.inc
+--source suite/parts/inc/engines.inc
#
# MDEV-22649 SIGSEGV in ha_partition::create_partitioning_metadata on ALTER
@@ -38,3 +37,267 @@ CREATE TABLE t2 (i INT);
ALTER TABLE v1 EXCHANGE PARTITION p2 WITH TABLE t2 ;
DROP VIEW v1;
DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-22165 CONVERT PARTITION: move in partition from existing table
+--echo #
+create or replace table tp1 (a int);
+create or replace table t1 (a int)
+partition by hash (a) partitions 2;
+--error ER_ONLY_ON_RANGE_LIST_PARTITION
+alter table t1 convert table tp1 to partition p2;
+
+create or replace table t1 (a int)
+partition by range (a)
+(partition p0 values less than (0));
+
+--error ER_NO_SUCH_TABLE
+alter table t1 convert table non_existent to partition p1 values less than (10);
+alter table t1 convert table tp1 to partition p1 values less than (10);
+--error ER_NO_SUCH_TABLE
+show create table tp1;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+
+create table tp2 (x int);
+--error ER_TABLES_DIFFERENT_METADATA
+alter table t1 convert table tp2 to partition p2 values less than (20);
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table tp2;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+
+create or replace table tp2 (a int);
+insert tp2 values (1), (15), (17);
+--error ER_ROW_DOES_NOT_MATCH_PARTITION
+alter table t1 convert table tp2 to partition p2 values less than (20);
+delete from tp2;
+insert tp2 values (15), (1), (17);
+--error ER_ROW_DOES_NOT_MATCH_PARTITION
+alter table t1 convert table tp2 to partition p2 values less than (20);
+delete from tp2;
+insert tp2 values (15), (17), (1);
+--error ER_ROW_DOES_NOT_MATCH_PARTITION
+alter table t1 convert table tp2 to partition p2 values less than (20);
+delete from tp2;
+insert tp2 values (15), (17);
+alter table t1 convert table tp2 to partition p2 values less than (20);
+--error ER_NO_SUCH_TABLE
+show create table tp2;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 partition (p2);
+
+create or replace table t1 (a int)
+partition by range (a) (
+p0 values less than (0),
+pn values less than (30));
+insert into t1 values (1);
+create or replace table tp1 (a int);
+insert into tp1 values (2);
+# TODO: would be good to automatically detect order of partitions,
+# as well as move the data from succeeding partitions (ADD PARTITION FR).
+--error ER_RANGE_NOT_INCREASING_ERROR
+alter table t1 convert table tp1 to partition p1 values less than (10);
+
+drop tables t1, tp1;
+
+
+--echo #
+--echo # MDEV-22166 CONVERT PARTITION: move out partition into a table
+--echo #
+
+create or replace table t1 (x int);
+--error ER_PARTITION_MGMT_ON_NONPARTITIONED
+alter table t1 convert partition p1 to table tp1;
+
+create or replace table t1 (x int)
+partition by hash(x) partitions 2;
+--error ER_ONLY_ON_RANGE_LIST_PARTITION
+alter table t1 convert partition p1 to table tp1;
+
+create or replace table t1 (x int)
+partition by key(x) partitions 2;
+--error ER_ONLY_ON_RANGE_LIST_PARTITION
+alter table t1 convert partition p1 to table tp1;
+
+create or replace table t1 (x int)
+partition by range(x)
+subpartition by hash(x) subpartitions 3 (
+ partition p1 values less than (10),
+ partition pn values less than maxvalue);
+--error ER_PARTITION_CONVERT_SUBPARTITIONED
+alter table t1 convert partition p1 to table p1;
+--error ER_PARTITION_DOES_NOT_EXIST
+alter table t1 convert partition p1sp0 to table p1;
+
+create or replace table t1 (x int)
+partition by range(x) (
+ partition p1 values less than (10));
+--error ER_DROP_LAST_PARTITION
+alter table t1 convert partition p1 to table tp1;
+
+--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING
+create or replace temporary table t1 (x int)
+partition by range(x) (
+ partition p0 values less than (10),
+ partition pn values less than maxvalue);
+
+if ($MTR_COMBINATION_RANGE)
+{
+ create or replace table t1 (x int)
+ partition by range(x) (
+ partition p1 values less than (10),
+ partition p2 values less than (20),
+ partition p3 values less than (30),
+ partition p4 values less than (40),
+ partition p5 values less than (50),
+ partition pn values less than maxvalue);
+}
+
+if ($MTR_COMBINATION_LIST)
+{
+ create or replace table t1 (x int)
+ partition by list(x) (
+ partition p1 values in (2, 3, 4),
+ partition p2 values in (12, 13, 14),
+ partition p3 values in (22, 23, 24),
+ partition p4 values in (32, 33, 34),
+ partition p5 values in (42, 43, 44),
+ partition pn values in (52, 53, 54));
+}
+
+insert into t1 values (2), (12), (22), (32), (42), (52);
+
+create or replace table tp2 (y int);
+insert tp2 values (88);
+# Multiple ALTER PARTITION statements are not possible
+--error ER_PARSE_ERROR
+alter table t1 convert partition p2 to table tp2, drop partition p3;
+# TODO: probably no need in such specific codes, should be ER_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
+alter table t1 convert partition p00 to table tp00;
+# Better error here is ER_PARTITION_DOES_NOT_EXIST,
+# but mysql_alter_table() works checks new table before anything else.
+# So, looks like no big reason to change anything here.
+--error ER_TABLE_EXISTS_ERROR
+alter table t1 convert partition p00 to table tp2;
+--error ER_TABLE_EXISTS_ERROR
+alter table t1 convert partition p2 to table tp2;
+--delimiter $
+--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+create trigger tr1 before update on t1 for each row
+begin
+ alter table t1 convert partition p2 to table tp2;
+end$
+--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+create function f1() returns int
+begin
+ alter table t1 convert partition p2 to table tp2;
+end$
+--delimiter ;
+select * from tp2;
+drop table tp2;
+alter table t1 convert partition p2 to table tp2;
+
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table tp2;
+select * from tp2;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 order by x;
+
+--error ER_BAD_DB_ERROR
+alter table t1 convert partition p3 to table inexistent.tp3;
+create database EXISTENT;
+alter table t1 convert partition p3 to table EXISTENT.TP3;
+
+# The only way to put `` into var...
+--let $tp3=`select '`TP3`'`
+if ($MTR_COMBINATION_LCASE1)
+{
+ --let $tp3= `select '`tp3`'`
+}
+--replace_result $engine X ' PAGE_CHECKSUM=1' '' $tp3 `TP3`-ok
+show create table EXISTENT.TP3;
+select * from EXISTENT.TP3 order by x;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 order by x;
+
+--echo # LOCK TABLES
+lock tables t1 write;
+alter table t1 convert partition p4 to table tp4;
+# TODO: lock table tp4 in ALTER TABLE, otherwise there is no
+# guarantee in data consistency between t1 and tp4
+--error ER_TABLE_NOT_LOCKED
+show create table tp4;
+
+unlock tables;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table tp4;
+select * from tp4;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 order by x;
+
+--echo # PS
+prepare stmt from 'alter table t1 convert partition p5 to table tp5';
+execute stmt;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table tp5;
+select * from tp5;
+--replace_result $engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 order by x;
+drop table tp5;
+--error ER_PARTITION_DOES_NOT_EXIST
+execute stmt;
+--error ER_PARTITION_DOES_NOT_EXIST
+execute stmt;
+drop prepare stmt;
+
+--echo # Privileges
+create user alan;
+grant usage on *.* to alan;
+grant create, insert, drop on test.* to alan;
+--connect alan,localhost,alan,,test
+show grants for current_user;
+--error ER_TABLEACCESS_DENIED_ERROR
+alter table t1 convert partition p1 to table tp1;
+--connection default
+revoke all on test.* from alan;
+grant create, insert, alter on test.* to alan;
+--connection alan
+use test;
+show grants for current_user;
+--error ER_TABLEACCESS_DENIED_ERROR
+alter table t1 convert partition p1 to table tp1;
+--connection default
+revoke all on test.* from alan;
+grant create, drop, alter on test.* to alan;
+--connection alan
+use test;
+show grants for current_user;
+--error ER_TABLEACCESS_DENIED_ERROR
+alter table t1 convert partition p1 to table tp1;
+--connection default
+revoke all on test.* from alan;
+grant insert, drop, alter on test.* to alan;
+--connection alan
+use test;
+show grants for current_user;
+--error ER_TABLEACCESS_DENIED_ERROR
+alter table t1 convert partition p1 to table tp1;
+--connection default
+grant create, insert, drop, alter on test.* to alan;
+--connection alan
+use test;
+show grants for current_user;
+alter table t1 convert partition p1 to table tp1;
+--disconnect alan
+--connection default
+
+drop database EXISTENT;
+drop user alan;
+drop tables t1, tp1, tp2, tp4;
diff --git a/mysql-test/suite/parts/t/partition_debug.test b/mysql-test/suite/parts/t/partition_debug.test
index 6d7cf3ae8b3..2f8994705f3 100644
--- a/mysql-test/suite/parts/t/partition_debug.test
+++ b/mysql-test/suite/parts/t/partition_debug.test
@@ -50,3 +50,114 @@ let $crash_statement= ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
--source suite/parts/inc/partition_crash_exchange.inc
let $fail_statement= $crash_statement;
--source suite/parts/inc/partition_fail_exchange.inc
+
+--echo #
+--echo # MDEV-22165 CONVERT PARTITION: move in partition from existing table
+--echo #
+let $create_statement= create or replace table t1 (x int primary key)
+ partition by range(x) (
+ partition p1 values less than (10),
+ partition p2 values less than (20),
+ partition p3 values less than (30));
+
+let $create_statement2= create or replace table t2 (x int primary key);
+let $insert_statement= insert into t1 values (2), (12), (22);
+let $insert_statement2= insert into t2 values (32), (42), (52);
+
+let $fail_statement= alter table t1 convert table t2 to partition pn values less than maxvalue;
+
+set @save_dbug=@@debug_dbug;
+set session debug_dbug="+d,fail_convert_partition_1";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_2";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_3";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_4";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_5";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_6";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_7";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_8";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_9";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_11";
+--source suite/parts/inc/partition_fail_t2.inc
+set session debug_dbug=@save_dbug;
+
+
+--echo #
+--echo # MDEV-22166 CONVERT PARTITION: move out partition into a table
+--echo #
+let $create_statement= create or replace table t1 (x int primary key)
+ partition by range(x) (
+ partition p1 values less than (10),
+ partition p2 values less than (20),
+ partition p3 values less than (30),
+ partition p4 values less than (40),
+ partition p5 values less than (50),
+ partition pn values less than maxvalue);
+
+let $insert_statement= insert into t1 values (2), (12), (22), (32), (42), (52);
+let $fail_statement= alter table t1 convert partition p2 to table tp2;
+
+set @save_dbug=@@debug_dbug;
+set session debug_dbug="+d,fail_create_before_create_frm";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_alter_partition_after_write_frm";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,error_convert_partition_00";
+--source suite/parts/inc/partition_fail.inc
+#set session debug_dbug=@save_dbug;
+#set session debug_dbug="+d,fail_convert_partition_01";
+#--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_1";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_2";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_3";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_4";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_5";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_6";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_7";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_8";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_9";
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+set session debug_dbug="+d,fail_convert_partition_11";
+--echo # Already finished DDL logging, so tp2 now exists:
+--source suite/parts/inc/partition_fail.inc
+set session debug_dbug=@save_dbug;
+show create table tp2;
+select * from tp2;
+drop table tp2;
diff --git a/mysql-test/suite/perfschema/r/digest_view.result b/mysql-test/suite/perfschema/r/digest_view.result
index d3988f99727..a5996cc0083 100644
--- a/mysql-test/suite/perfschema/r/digest_view.result
+++ b/mysql-test/suite/perfschema/r/digest_view.result
@@ -191,17 +191,17 @@ SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR
FROM performance_schema.events_statements_summary_by_digest
ORDER BY DIGEST_TEXT;
SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR
-test 3bcc75e0f4658692e16837ead0c455ca EXPLAIN SELECT * FROM `test` . `v1` 1
-test cc55af8221ef0bc8873e75cc704489ba EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 1
-test bc0498551a492bd7c0ca92906bf86fb4 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 1
-test 76923336b6f4ffffd0d5854761ae1aec EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 1
-test a65d479062ffbfe374b4cd823016a260 EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 1
-test d44b1e50ebfd05accacef4167534ad65 SELECT * FROM `test` . `v1` 1
-test 0608cde507ef8fe35d1f68730e78f1e4 SELECT * FROM `test` . `v1` WHERE `a` = ? 1
-test 5e241fdb866faef138cc81b26203ddff SELECT * FROM `test` . `v1` WHERE `b` > ? 1
-test 74fa770ce44994b3fe7b534d504f2d6d SELECT `a` , `b` FROM `test` . `v1` 1
-test 45ca2a985d179d98395b238cf253bbe2 SELECT `b` , `a` FROM `test` . `v1` 1
-test 1cfa171590aa40ba23e14c92d6940ffc TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
+test 27a9ab161a63050c84a63c6f77ebeb33 EXPLAIN SELECT * FROM `test` . `v1` 1
+test ab0ab27c04f3a294feb86bede4331f86 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 1
+test 2e722346a5c2ef820946bcd04ccac208 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 1
+test 07baf2264db30b6b25302603436ebe82 EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 1
+test 3a7dbc963635ab0de6e160e0a4212bce EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 1
+test 6b845c2e3a7421997e3b610d14b5c842 SELECT * FROM `test` . `v1` 1
+test cb2ee099edbf6e0e5ee6ae14f3b1498a SELECT * FROM `test` . `v1` WHERE `a` = ? 1
+test e2dc5a300d2ba54ebb987a2ca6b90d93 SELECT * FROM `test` . `v1` WHERE `b` > ? 1
+test c68e0f99323f7bb7732c7b5cf32c0ec2 SELECT `a` , `b` FROM `test` . `v1` 1
+test 43c5de955c9a72d2bb6f49db5c0ad3e7 SELECT `b` , `a` FROM `test` . `v1` 1
+test 1678258ba15f7ccc63fd7b833763914a TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
DROP TABLE test.v1;
CREATE VIEW test.v1 AS SELECT * FROM test.t1;
EXPLAIN SELECT * from test.v1;
@@ -248,19 +248,19 @@ SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR
FROM performance_schema.events_statements_summary_by_digest
ORDER BY DIGEST_TEXT;
SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR
-test 630a0b16be33fcf549f4f467de557940 CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1
-test efa438aa8b4ddbf4c19f9e4b345781b5 DROP TABLE `test` . `v1` 1
-test 3bcc75e0f4658692e16837ead0c455ca EXPLAIN SELECT * FROM `test` . `v1` 2
-test cc55af8221ef0bc8873e75cc704489ba EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 2
-test bc0498551a492bd7c0ca92906bf86fb4 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 2
-test 76923336b6f4ffffd0d5854761ae1aec EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 2
-test a65d479062ffbfe374b4cd823016a260 EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 2
-test d44b1e50ebfd05accacef4167534ad65 SELECT * FROM `test` . `v1` 2
-test 0608cde507ef8fe35d1f68730e78f1e4 SELECT * FROM `test` . `v1` WHERE `a` = ? 2
-test 5e241fdb866faef138cc81b26203ddff SELECT * FROM `test` . `v1` WHERE `b` > ? 2
-test a3788cc4bc96d260cfb5c3ebdfc65c6d SELECT SCHEMA_NAME , `DIGEST` , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1
-test 74fa770ce44994b3fe7b534d504f2d6d SELECT `a` , `b` FROM `test` . `v1` 2
-test 45ca2a985d179d98395b238cf253bbe2 SELECT `b` , `a` FROM `test` . `v1` 2
-test 1cfa171590aa40ba23e14c92d6940ffc TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
+test 342cd5e41944d5f857f92b1e374857de CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1
+test 2653f30030efcb6125121daa8eadf418 DROP TABLE `test` . `v1` 1
+test 27a9ab161a63050c84a63c6f77ebeb33 EXPLAIN SELECT * FROM `test` . `v1` 2
+test ab0ab27c04f3a294feb86bede4331f86 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 2
+test 2e722346a5c2ef820946bcd04ccac208 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 2
+test 07baf2264db30b6b25302603436ebe82 EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 2
+test 3a7dbc963635ab0de6e160e0a4212bce EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 2
+test 6b845c2e3a7421997e3b610d14b5c842 SELECT * FROM `test` . `v1` 2
+test cb2ee099edbf6e0e5ee6ae14f3b1498a SELECT * FROM `test` . `v1` WHERE `a` = ? 2
+test e2dc5a300d2ba54ebb987a2ca6b90d93 SELECT * FROM `test` . `v1` WHERE `b` > ? 2
+test a13cfeda6d474d29546719d76dcfa831 SELECT SCHEMA_NAME , `DIGEST` , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1
+test c68e0f99323f7bb7732c7b5cf32c0ec2 SELECT `a` , `b` FROM `test` . `v1` 2
+test 43c5de955c9a72d2bb6f49db5c0ad3e7 SELECT `b` , `a` FROM `test` . `v1` 2
+test 1678258ba15f7ccc63fd7b833763914a TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
DROP VIEW test.v1;
DROP TABLE test.t1;
diff --git a/mysql-test/suite/perfschema/r/max_program_zero.result b/mysql-test/suite/perfschema/r/max_program_zero.result
index 5435efb34ae..f236f149a77 100644
--- a/mysql-test/suite/perfschema/r/max_program_zero.result
+++ b/mysql-test/suite/perfschema/r/max_program_zero.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 1
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/misc.result b/mysql-test/suite/perfschema/r/misc.result
index 83ca6d5cf3f..b1fa4f6c765 100644
--- a/mysql-test/suite/perfschema/r/misc.result
+++ b/mysql-test/suite/perfschema/r/misc.result
@@ -174,3 +174,16 @@ select object_type, object_schema, object_name
from performance_schema.objects_summary_global_by_type
where object_schema="test";
object_type object_schema object_name
+#
+# MDEV-28344: sys.ps_setup_save and dependent procedures fail
+# with ER_ILLEGAL_HA_CREATE_OPTION
+#
+CREATE TEMPORARY TABLE t1 (t int) ENGINE = PERFORMANCE_SCHEMA;
+ERROR HY000: Table storage engine 'PERFORMANCE_SCHEMA' does not support the create option 'TEMPORARY'
+CREATE TEMPORARY TABLE t1 LIKE performance_schema.setup_actors;
+ERROR HY000: Table storage engine 'PERFORMANCE_SCHEMA' does not support the create option 'TEMPORARY'
+SET @default_storage_engine_old = @@default_storage_engine;
+SET default_storage_engine = performance_schema;
+CREATE TEMPORARY TABLE t1 (t int);
+ERROR HY000: Table storage engine 'PERFORMANCE_SCHEMA' does not support the create option 'TEMPORARY'
+SET @@default_storage_engine = @default_storage_engine_old;
diff --git a/mysql-test/suite/perfschema/r/ortho_iter.result b/mysql-test/suite/perfschema/r/ortho_iter.result
index 9489c1049e5..4224c3e520d 100644
--- a/mysql-test/suite/perfschema/r/ortho_iter.result
+++ b/mysql-test/suite/perfschema/r/ortho_iter.result
@@ -255,7 +255,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result
index 94cc2b33b49..ab0d18e3227 100644
--- a/mysql-test/suite/perfschema/r/privilege_table_io.result
+++ b/mysql-test/suite/perfschema/r/privilege_table_io.result
@@ -57,7 +57,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_idle.result b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
index bfc49fd3480..fda05bf6df5 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_idle.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_stages.result b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
index e9f20398467..7db242f237f 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_stages.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_statements.result b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
index ffb45f4f55f..31ddb4eb3cd 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_statements.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_transactions.result b/mysql-test/suite/perfschema/r/start_server_disable_transactions.result
index e271d5a10e6..2a2d42f4d51 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_transactions.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_transactions.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_waits.result b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
index 833da22583e..2115c747755 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_waits.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_innodb.result b/mysql-test/suite/perfschema/r/start_server_innodb.result
index e3ff0f514a7..25b8a7b9c1f 100644
--- a/mysql-test/suite/perfschema/r/start_server_innodb.result
+++ b/mysql-test/suite/perfschema/r/start_server_innodb.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result b/mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result
index a2d84753331..13b51569b60 100644
--- a/mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result
+++ b/mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result
@@ -8,5 +8,5 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
####################################
SELECT event_name, digest, digest_text, sql_text FROM events_statements_history_long;
event_name digest digest_text sql_text
-statement/sql/select 70a97f8223477a66e716cfcc317193e2 SELECT ? + ? + SELECT ...
-statement/sql/truncate ac4c7fc23914b333e9f40ce317816b8e TRUNCATE TABLE truncat...
+statement/sql/select 1fd0cdb6b5aa22bd0809a39b2dc2ac70 SELECT ? + ? + SELECT ...
+statement/sql/truncate 0a9c405cebde6df4be315dae86ff398a TRUNCATE TABLE truncat...
diff --git a/mysql-test/suite/perfschema/r/start_server_low_index.result b/mysql-test/suite/perfschema/r/start_server_low_index.result
index ffdf9d65b87..b34f86da89f 100644
--- a/mysql-test/suite/perfschema/r/start_server_low_index.result
+++ b/mysql-test/suite/perfschema/r/start_server_low_index.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_low_table_lock.result b/mysql-test/suite/perfschema/r/start_server_low_table_lock.result
index dbb404f6129..e8bf9f48da8 100644
--- a/mysql-test/suite/perfschema/r/start_server_low_table_lock.result
+++ b/mysql-test/suite/perfschema/r/start_server_low_table_lock.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_account.result b/mysql-test/suite/perfschema/r/start_server_no_account.result
index f92b0e6bec6..021ff9f9e3d 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_account.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_account.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
index fefad55c209..0a7f1c601ef 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
index 0c2f65f6ac9..de4ff2f5a72 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_class.result b/mysql-test/suite/perfschema/r/start_server_no_file_class.result
index c3f06b53425..997220d3169 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_file_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_class.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
index fd39807d567..de81943afe8 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_host.result b/mysql-test/suite/perfschema/r/start_server_no_host.result
index 43111c5ec40..ce156302b22 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_host.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_host.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_index.result b/mysql-test/suite/perfschema/r/start_server_no_index.result
index 15d1184bcbe..d46095841c2 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_index.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_index.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mdl.result b/mysql-test/suite/perfschema/r/start_server_no_mdl.result
index b8de90453ce..c1f7e656dc6 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mdl.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mdl.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_memory_class.result b/mysql-test/suite/perfschema/r/start_server_no_memory_class.result
index 60066264c90..94c8a7da85a 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_memory_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_memory_class.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
index 3353b46bbcb..e44307fdbe6 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
index d41da361733..6647def50c1 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result b/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result
index 4919de6bb6c..9b5ad931858 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
index 02a119bdc68..fdd3fe48bf3 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
index ead01ce2d0e..09faadaa4ce 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
index a99f1c0f9be..2d93be52186 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
index 7c148889412..e9eff67712f 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
index dec0680c511..f5b00a114dd 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 0
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
index 20adf1a9f64..d1b3e14d349 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 0
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
index 044f9475041..136c54885bf 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 0
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
index 350f2c6637d..3e2d7acf4ec 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
index d2d7063c32f..5db6987834b 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
index 8bcb3c56a00..69a69986a72 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
index 2a2bf5d3f7c..2f68483cfae 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
index ec6e40acc00..3d131f1a2e0 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 0
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
index b3f1e4cbcf2..95f8f226c41 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 0
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_lock.result b/mysql-test/suite/perfschema/r/start_server_no_table_lock.result
index baf9f761358..b54d6c762e1 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_lock.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_lock.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
index cd204f3d811..9182677d8b8 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
index d083484cd7c..ff90c471599 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result b/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result
index f5a12e5473d..4535bcd02ed 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result
index 76ae9d5fa4e..f3eefb98a43 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_user.result b/mysql-test/suite/perfschema/r/start_server_no_user.result
index 4bd472a22a9..9ca79837845 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_user.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_user.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
index f59b156ce1e..ee22d5b5bed 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
index cc70572c7ef..adbad8d166f 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_off.result b/mysql-test/suite/perfschema/r/start_server_off.result
index a53d591938c..022f7d1096e 100644
--- a/mysql-test/suite/perfschema/r/start_server_off.result
+++ b/mysql-test/suite/perfschema/r/start_server_off.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_on.result b/mysql-test/suite/perfschema/r/start_server_on.result
index e3ff0f514a7..25b8a7b9c1f 100644
--- a/mysql-test/suite/perfschema/r/start_server_on.result
+++ b/mysql-test/suite/perfschema/r/start_server_on.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/start_server_variables.result b/mysql-test/suite/perfschema/r/start_server_variables.result
index 7d1d1e05375..65d3a7b55b5 100644
--- a/mysql-test/suite/perfschema/r/start_server_variables.result
+++ b/mysql-test/suite/perfschema/r/start_server_variables.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 10
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/r/statement_program_lost_inst.result b/mysql-test/suite/perfschema/r/statement_program_lost_inst.result
index 05ec7b0b2b5..264778c06e4 100644
--- a/mysql-test/suite/perfschema/r/statement_program_lost_inst.result
+++ b/mysql-test/suite/perfschema/r/statement_program_lost_inst.result
@@ -135,7 +135,7 @@ performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_sql_text_length 1024
performance_schema_max_stage_classes 160
-performance_schema_max_statement_classes 222
+performance_schema_max_statement_classes 221
performance_schema_max_statement_stack 2
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
diff --git a/mysql-test/suite/perfschema/t/misc.test b/mysql-test/suite/perfschema/t/misc.test
index 848be3beea1..79c23c65616 100644
--- a/mysql-test/suite/perfschema/t/misc.test
+++ b/mysql-test/suite/perfschema/t/misc.test
@@ -298,3 +298,23 @@ drop tables t1;
select object_type, object_schema, object_name
from performance_schema.objects_summary_global_by_type
where object_schema="test";
+
+--echo #
+--echo # MDEV-28344: sys.ps_setup_save and dependent procedures fail
+--echo # with ER_ILLEGAL_HA_CREATE_OPTION
+--echo #
+
+# It is not allowed to create temporary tables with performance schema
+--error ER_ILLEGAL_HA_CREATE_OPTION
+CREATE TEMPORARY TABLE t1 (t int) ENGINE = PERFORMANCE_SCHEMA;
+
+--error ER_ILLEGAL_HA_CREATE_OPTION
+CREATE TEMPORARY TABLE t1 LIKE performance_schema.setup_actors;
+
+SET @default_storage_engine_old = @@default_storage_engine;
+SET default_storage_engine = performance_schema;
+
+--error ER_ILLEGAL_HA_CREATE_OPTION
+CREATE TEMPORARY TABLE t1 (t int);
+
+SET @@default_storage_engine = @default_storage_engine_old; \ No newline at end of file
diff --git a/mysql-test/suite/plugins/r/auth_ed25519.result b/mysql-test/suite/plugins/r/auth_ed25519.result
index 6769d867167..f5d1ce2497d 100644
--- a/mysql-test/suite/plugins/r/auth_ed25519.result
+++ b/mysql-test/suite/plugins/r/auth_ed25519.result
@@ -27,7 +27,7 @@ PLUGIN_STATUS ACTIVE
PLUGIN_TYPE AUTHENTICATION
PLUGIN_TYPE_VERSION 2.2
PLUGIN_LIBRARY auth_ed25519.so
-PLUGIN_LIBRARY_VERSION 1.14
+PLUGIN_LIBRARY_VERSION 1.15
PLUGIN_AUTHOR Sergei Golubchik
PLUGIN_DESCRIPTION Elliptic curve ED25519 based authentication
PLUGIN_LICENSE GPL
diff --git a/mysql-test/suite/plugins/r/compression,innodb-lz4.rdiff b/mysql-test/suite/plugins/r/compression,innodb-lz4.rdiff
new file mode 100644
index 00000000000..06fdb0bd4f0
--- /dev/null
+++ b/mysql-test/suite/plugins/r/compression,innodb-lz4.rdiff
@@ -0,0 +1,24 @@
+--- suite/plugins/r/compression.result
++++ suite/plugins/r/compression.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing bzip2 compression provider with innodb
++# Testing lz4 compression provider with innodb
+ #
+ call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded");
+-set global innodb_compression_algorithm = bzip2;
++set global innodb_compression_algorithm = lz4;
+ call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+ call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+ call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table");
+@@ -15,8 +15,8 @@
+ 0 abcabcabc 300
+ 1 defdefdef 3000
+ 2 ghighighi 30000
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-lz4
+ select a, left(b, 9), length(b) from t1;
+-ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table
++ERROR HY000: Table test/t1 is compressed with lz4, which is not currently loaded. Please load the lz4 provider plugin to open the table
+ drop table t1;
+ # restart
diff --git a/mysql-test/suite/plugins/r/compression,innodb-lzma.rdiff b/mysql-test/suite/plugins/r/compression,innodb-lzma.rdiff
new file mode 100644
index 00000000000..ee348934a54
--- /dev/null
+++ b/mysql-test/suite/plugins/r/compression,innodb-lzma.rdiff
@@ -0,0 +1,24 @@
+--- suite/plugins/r/compression.result
++++ suite/plugins/r/compression.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing bzip2 compression provider with innodb
++# Testing lzma compression provider with innodb
+ #
+ call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded");
+-set global innodb_compression_algorithm = bzip2;
++set global innodb_compression_algorithm = lzma;
+ call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+ call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+ call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table");
+@@ -15,8 +15,8 @@
+ 0 abcabcabc 300
+ 1 defdefdef 3000
+ 2 ghighighi 30000
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-lzma
+ select a, left(b, 9), length(b) from t1;
+-ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table
++ERROR HY000: Table test/t1 is compressed with lzma, which is not currently loaded. Please load the lzma provider plugin to open the table
+ drop table t1;
+ # restart
diff --git a/mysql-test/suite/plugins/r/compression,innodb-lzo.rdiff b/mysql-test/suite/plugins/r/compression,innodb-lzo.rdiff
new file mode 100644
index 00000000000..d7cdc41092a
--- /dev/null
+++ b/mysql-test/suite/plugins/r/compression,innodb-lzo.rdiff
@@ -0,0 +1,24 @@
+--- suite/plugins/r/compression.result
++++ suite/plugins/r/compression.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing bzip2 compression provider with innodb
++# Testing lzo compression provider with innodb
+ #
+ call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded");
+-set global innodb_compression_algorithm = bzip2;
++set global innodb_compression_algorithm = lzo;
+ call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+ call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+ call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table");
+@@ -15,8 +15,8 @@
+ 0 abcabcabc 300
+ 1 defdefdef 3000
+ 2 ghighighi 30000
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-lzo
+ select a, left(b, 9), length(b) from t1;
+-ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table
++ERROR HY000: Table test/t1 is compressed with lzo, which is not currently loaded. Please load the lzo provider plugin to open the table
+ drop table t1;
+ # restart
diff --git a/mysql-test/suite/plugins/r/compression,innodb-snappy.rdiff b/mysql-test/suite/plugins/r/compression,innodb-snappy.rdiff
new file mode 100644
index 00000000000..e9c7485d118
--- /dev/null
+++ b/mysql-test/suite/plugins/r/compression,innodb-snappy.rdiff
@@ -0,0 +1,24 @@
+--- suite/plugins/r/compression.result
++++ suite/plugins/r/compression.reject
+@@ -1,8 +1,8 @@
+ #
+-# Testing bzip2 compression provider with innodb
++# Testing snappy compression provider with innodb
+ #
+ call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded");
+-set global innodb_compression_algorithm = bzip2;
++set global innodb_compression_algorithm = snappy;
+ call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+ call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+ call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table");
+@@ -15,8 +15,8 @@
+ 0 abcabcabc 300
+ 1 defdefdef 3000
+ 2 ghighighi 30000
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-snappy
+ select a, left(b, 9), length(b) from t1;
+-ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table
++ERROR HY000: Table test/t1 is compressed with snappy, which is not currently loaded. Please load the snappy provider plugin to open the table
+ drop table t1;
+ # restart
diff --git a/mysql-test/suite/plugins/r/compression,mroonga-lz4.rdiff b/mysql-test/suite/plugins/r/compression,mroonga-lz4.rdiff
new file mode 100644
index 00000000000..9b155ff3a1d
--- /dev/null
+++ b/mysql-test/suite/plugins/r/compression,mroonga-lz4.rdiff
@@ -0,0 +1,40 @@
+--- suite/plugins/r/compression.result
++++ suite/plugins/r/compression.reject
+@@ -1,12 +1,8 @@
+ #
+-# Testing bzip2 compression provider with innodb
++# Testing lz4 compression provider with mroonga
+ #
+ call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded");
+-set global innodb_compression_algorithm = bzip2;
+-call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+-call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+-call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table");
+-create table t1 (a int, b text ) engine = innodb page_compressed = 1;
++create table t1 (a int, b text COMMENT 'FLAGS "COLUMN_SCALAR|COMPRESS_LZ4"') engine = mroonga charset = utf8;
+ insert t1 (a, b) values (0, repeat("abc", 100));
+ insert t1 (a, b) values (1, repeat("def", 1000));
+ insert t1 (a, b) values (2, repeat("ghi", 10000));
+@@ -14,8 +11,20 @@
+ 0 abcabcabc 300
+ 1 defdefdef 3000
+ 2 ghighighi 30000
+-# restart: --disable-provider-bzip2
++# restart: --disable-provider-lz4
+ select a, left(b, 9), length(b) from t1;
+-ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table
++a left(b, 9) length(b)
++0 0
++1 0
++2 0
++Warnings:
++Warning 4185 MariaDB tried to use the LZ4 compression, but its provider plugin is not loaded
++select a, left(b, 9), length(b) from t1;
++a left(b, 9) length(b)
++0 0
++1 0
++2 0
++Warnings:
++Warning 4185 MariaDB tried to use the LZ4 compression, but its provider plugin is not loaded
+ drop table t1;
+ # restart
diff --git a/mysql-test/suite/plugins/r/compression.result b/mysql-test/suite/plugins/r/compression.result
new file mode 100644
index 00000000000..dd267f282c5
--- /dev/null
+++ b/mysql-test/suite/plugins/r/compression.result
@@ -0,0 +1,22 @@
+#
+# Testing bzip2 compression provider with innodb
+#
+call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded");
+set global innodb_compression_algorithm = bzip2;
+call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table");
+create table t1 (a int, b text ) engine = innodb page_compressed = 1;
+insert t1 (a, b) values (0, repeat("abc", 100));
+insert t1 (a, b) values (1, repeat("def", 1000));
+insert t1 (a, b) values (2, repeat("ghi", 10000));
+select a, left(b, 9), length(b) from t1;
+a left(b, 9) length(b)
+0 abcabcabc 300
+1 defdefdef 3000
+2 ghighighi 30000
+# restart: --disable-provider-bzip2
+select a, left(b, 9), length(b) from t1;
+ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table
+drop table t1;
+# restart
diff --git a/mysql-test/suite/plugins/r/compression_load.result b/mysql-test/suite/plugins/r/compression_load.result
new file mode 100644
index 00000000000..a23037edc17
--- /dev/null
+++ b/mysql-test/suite/plugins/r/compression_load.result
@@ -0,0 +1,33 @@
+select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4';
+plugin_name plugin_status
+set global innodb_compression_algorithm = lz4;
+ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'lz4'
+install plugin provider_lz4 soname 'provider_lz4';
+select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4';
+plugin_name plugin_status
+provider_lz4 ACTIVE
+set global innodb_compression_algorithm = lz4;
+create table t1 (a int, b text) engine=innodb page_compressed=1;
+insert t1 (a, b) values (0, repeat("abc", 100));
+insert t1 (a, b) values (1, repeat("def", 1000));
+insert t1 (a, b) values (2, repeat("ghi", 10000));
+select a, left(b, 9), length(b) from t1;
+a left(b, 9) length(b)
+0 abcabcabc 300
+1 defdefdef 3000
+2 ghighighi 30000
+uninstall plugin provider_lz4;
+Warnings:
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4';
+plugin_name plugin_status
+provider_lz4 INACTIVE
+set global innodb_compression_algorithm = default;
+set global innodb_compression_algorithm = lz4;
+set global innodb_compression_algorithm = default;
+select a, left(b, 9), length(b) from t1;
+a left(b, 9) length(b)
+0 abcabcabc 300
+1 defdefdef 3000
+2 ghighighi 30000
+drop table t1;
diff --git a/mysql-test/suite/plugins/r/cracklib_password_check.result b/mysql-test/suite/plugins/r/cracklib_password_check.result
index 1194e6eef5a..fb24ec142b8 100644
--- a/mysql-test/suite/plugins/r/cracklib_password_check.result
+++ b/mysql-test/suite/plugins/r/cracklib_password_check.result
@@ -4,9 +4,9 @@ PLUGIN_NAME cracklib_password_check
PLUGIN_VERSION 1.0
PLUGIN_STATUS ACTIVE
PLUGIN_TYPE PASSWORD VALIDATION
-PLUGIN_TYPE_VERSION 1.0
+PLUGIN_TYPE_VERSION 1.1
PLUGIN_LIBRARY cracklib_password_check.so
-PLUGIN_LIBRARY_VERSION 1.14
+PLUGIN_LIBRARY_VERSION 1.15
PLUGIN_AUTHOR Sergei Golubchik
PLUGIN_DESCRIPTION Password validation via CrackLib
PLUGIN_LICENSE GPL
@@ -37,6 +37,18 @@ 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
+grant select on *.* to foocar@localhost identified by 'localhost';
+ERROR HY000: Your password does not satisfy the current policy requirements
+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
+grant select on *.* to foocar@localhost identified by 'foocar@localhost';
+ERROR HY000: Your password does not satisfy the current policy requirements
+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
grant select on *.* to foobar identified by 'q$%^&*rty';
drop user foobar;
#
diff --git a/mysql-test/suite/plugins/r/password_reuse_check.result b/mysql-test/suite/plugins/r/password_reuse_check.result
new file mode 100644
index 00000000000..a9b79cf34fc
--- /dev/null
+++ b/mysql-test/suite/plugins/r/password_reuse_check.result
@@ -0,0 +1,74 @@
+install soname "password_reuse_check";
+set global password_reuse_check_interval= 0;
+# Default value (sould be unlimited i.e. 0)
+SHOW GLOBAL VARIABLES like "password_reuse_check%";
+Variable_name Value
+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
+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
+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 1396 Operation ALTER USER failed for 'user_name'@'localhost'
+# check exparation
+set global password_reuse_check_interval= 10;
+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 1396 Operation ALTER USER failed for 'user_name'@'localhost'
+select hex(hash) from mysql.password_reuse_check_history;
+hex(hash)
+6276C87127F2B65FC6B24E94E324A02FF0D393D7FB7DEAF6F5F49F0A8AB006711D5C6EF67E36A251AB6337E7E20D312F9ED66D70EB699A6EC85B1E0BC7F376C0
+# emulate old password
+update mysql.password_reuse_check_history set time= date_sub(now(), interval
+11 day);
+alter user user_name@localhost identified by 'test_pwd';
+show warnings;
+Level Code Message
+drop user user_name@localhost;
+show create table mysql.password_reuse_check_history;
+Table Create Table
+password_reuse_check_history CREATE TABLE `password_reuse_check_history` (
+ `hash` binary(64) NOT NULL,
+ `time` timestamp NOT NULL DEFAULT current_timestamp(),
+ PRIMARY KEY (`hash`),
+ KEY `tm` (`time`)
+) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
+select count(*) from mysql.password_reuse_check_history;
+count(*)
+1
+drop table mysql.password_reuse_check_history;
+# test error messages
+set global password_reuse_check_interval= 0;
+drop table if exists mysql.password_reuse_check_history;
+Warnings:
+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
+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
+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
+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
+drop table mysql.password_reuse_check_history;
+uninstall plugin password_reuse_check;
diff --git a/mysql-test/suite/plugins/r/show_all_plugins.result b/mysql-test/suite/plugins/r/show_all_plugins.result
index 3bdaf39d0d0..ebd5b6cc198 100644
--- a/mysql-test/suite/plugins/r/show_all_plugins.result
+++ b/mysql-test/suite/plugins/r/show_all_plugins.result
@@ -4,8 +4,8 @@ Variable_name Value
Opened_plugin_libraries 0
select * from information_schema.all_plugins where plugin_library='ha_example.so';
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_TYPE_VERSION PLUGIN_LIBRARY PLUGIN_LIBRARY_VERSION PLUGIN_AUTHOR PLUGIN_DESCRIPTION PLUGIN_LICENSE LOAD_OPTION PLUGIN_MATURITY PLUGIN_AUTH_VERSION
-EXAMPLE 0.1 NOT INSTALLED STORAGE ENGINE MYSQL_VERSION_ID ha_example.so 1.14 Brian Aker, MySQL AB Example storage engine GPL OFF Experimental 0.1
-UNUSABLE 3.14 NOT INSTALLED DAEMON MYSQL_VERSION_ID ha_example.so 1.14 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926
+EXAMPLE 0.1 NOT INSTALLED STORAGE ENGINE MYSQL_VERSION_ID ha_example.so 1.15 Brian Aker, MySQL AB Example storage engine GPL OFF Experimental 0.1
+UNUSABLE 3.14 NOT INSTALLED DAEMON MYSQL_VERSION_ID ha_example.so 1.15 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926
show status like '%libraries%';
Variable_name Value
Opened_plugin_libraries 1
diff --git a/mysql-test/suite/plugins/r/simple_password_check.result b/mysql-test/suite/plugins/r/simple_password_check.result
index b3712ee22d2..0617e7872aa 100644
--- a/mysql-test/suite/plugins/r/simple_password_check.result
+++ b/mysql-test/suite/plugins/r/simple_password_check.result
@@ -4,9 +4,9 @@ PLUGIN_NAME simple_password_check
PLUGIN_VERSION 1.0
PLUGIN_STATUS ACTIVE
PLUGIN_TYPE PASSWORD VALIDATION
-PLUGIN_TYPE_VERSION 1.0
+PLUGIN_TYPE_VERSION 1.1
PLUGIN_LIBRARY simple_password_check.so
-PLUGIN_LIBRARY_VERSION 1.14
+PLUGIN_LIBRARY_VERSION 1.15
PLUGIN_AUTHOR Sergei Golubchik
PLUGIN_DESCRIPTION Simple password strength checks
PLUGIN_LICENSE GPL
diff --git a/mysql-test/suite/plugins/r/test_sql_service.result b/mysql-test/suite/plugins/r/test_sql_service.result
index af414d6c6e7..00f0411b665 100644
--- a/mysql-test/suite/plugins/r/test_sql_service.result
+++ b/mysql-test/suite/plugins/r/test_sql_service.result
@@ -1,8 +1,70 @@
install plugin test_sql_service soname 'test_sql_service';
+show status like 'test_sql_service_passed';
+Variable_name Value
+Test_sql_service_passed 1
set global test_sql_service_run_test= 1;
-show status like 'test_sql_service%';
+show status like 'test_sql_service_passed';
+Variable_name Value
+Test_sql_service_passed 1
+set global test_sql_service_execute_sql_local= 'create table test.t1(id int)';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query affected 0 rows.
+set global test_sql_service_execute_sql_local= 'insert into test.t1 values (1), (2)';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query affected 2 rows.
+set global test_sql_service_execute_sql_local= 'select * from test.t1';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query returned 2 rows.
+set global test_sql_service_execute_sql_local= 'drop table test.t1';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query affected 0 rows.
+set global test_sql_service_execute_sql_local= 'drop table test.t1';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Error 1051 returned. Unknown table 'test.t1'
+set global test_sql_service_execute_sql_global= 'create table test.t1(id int)';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query affected 0 rows.
+set global test_sql_service_execute_sql_global= 'insert into test.t1 values (1), (2)';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query affected 2 rows.
+set global test_sql_service_execute_sql_global= 'select * from test.t1';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query returned 2 rows.
+set global test_sql_service_execute_sql_global= 'drop table test.t1';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query affected 0 rows.
+set global test_sql_service_execute_sql_global= 'drop table test.t1';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Error 1051 returned. Unknown table 'test.t1'
+create table t1 (id int, time timestamp);
+insert into t1 values (1, NULL), (2, NULL), (3, NULL), (4, NULL), (5, NULL);
+set global test_sql_service_execute_sql_global= 'select * FROM test.t1 WHERE time < DATE_SUB(NOW(), interval 5 minute)';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query returned 0 rows.
+set global test_sql_service_execute_sql_global= 'select * FROM test.t1 WHERE time <= NOW()';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query returned 5 rows.
+set global test_sql_service_execute_sql_local= 'select * FROM test.t1 WHERE time < DATE_SUB(NOW(), interval 5 minute)';
+show status like 'test_sql_query_result';
+Variable_name Value
+Test_sql_query_result Query returned 0 rows.
+set global test_sql_service_execute_sql_local= 'select * FROM test.t1 WHERE time <= NOW()';
+show status like 'test_sql_query_result';
Variable_name Value
-Test_sql_service_passed 0
+Test_sql_query_result Query returned 5 rows.
+drop table t1;
uninstall plugin test_sql_service;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
diff --git a/mysql-test/suite/plugins/t/compression.combinations b/mysql-test/suite/plugins/t/compression.combinations
new file mode 100644
index 00000000000..645ca60e5f0
--- /dev/null
+++ b/mysql-test/suite/plugins/t/compression.combinations
@@ -0,0 +1,29 @@
+[innodb-bzip2]
+innodb
+plugin-load-add=$PROVIDER_BZIP2_SO
+loose-provider-bzip2
+
+[innodb-lz4]
+innodb
+plugin-load-add=$PROVIDER_LZ4_SO
+loose-provider-lz4
+
+[innodb-lzma]
+innodb
+plugin-load-add=$PROVIDER_LZMA_SO
+loose-provider-lzma
+
+[innodb-lzo]
+innodb
+plugin-load-add=$PROVIDER_LZO_SO
+loose-provider-lzo
+
+[innodb-snappy]
+innodb
+plugin-load-add=$PROVIDER_SNAPPY_SO
+loose-provider-snappy
+
+[mroonga-lz4]
+plugin-load-add=$HA_MROONGA_SO
+plugin-load-add=$PROVIDER_LZ4_SO
+loose-provider-lz4
diff --git a/mysql-test/suite/plugins/t/compression.test b/mysql-test/suite/plugins/t/compression.test
new file mode 100644
index 00000000000..c97c5725e1d
--- /dev/null
+++ b/mysql-test/suite/plugins/t/compression.test
@@ -0,0 +1,52 @@
+let $engine=`select regexp_replace('$MTR_COMBINATIONS', '-.*', '')`;
+let $alg=`select regexp_replace('$MTR_COMBINATIONS', '.*-', '')`;
+
+if (`select count(*) = 0 from information_schema.plugins where plugin_name = '$engine' and plugin_status='active'`)
+{
+ skip Needs $engine engine;
+}
+
+if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'provider_$alg' and plugin_status='active'`)
+{
+ skip Needs provider_$alg plugin;
+}
+
+--echo #
+--echo # Testing $alg compression provider with $engine
+--echo #
+
+call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded");
+if ($engine == "innodb") {
+ eval set global innodb_compression_algorithm = $alg;
+ let $table_params = page_compressed = 1;
+ call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt");
+ call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed");
+ call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table");
+}
+if ($engine == "mroonga") {
+ let $column_params = `select upper('COMMENT \'flags "COLUMN_SCALAR|COMPRESS_$alg"\'')`;
+ let $table_params = charset = utf8;
+}
+
+eval create table t1 (a int, b text $column_params) engine = $engine $table_params;
+
+insert t1 (a, b) values (0, repeat("abc", 100));
+insert t1 (a, b) values (1, repeat("def", 1000));
+insert t1 (a, b) values (2, repeat("ghi", 10000));
+select a, left(b, 9), length(b) from t1;
+
+let $restart_parameters = --disable-provider-$alg;
+source include/restart_mysqld.inc;
+
+if ($engine == "innodb") {
+ error ER_PROVIDER_NOT_LOADED;
+ select a, left(b, 9), length(b) from t1;
+}
+if ($engine == "mroonga"){
+ select a, left(b, 9), length(b) from t1;
+ select a, left(b, 9), length(b) from t1; # a warning once per statement
+}
+drop table t1;
+
+let $restart_parameters =;
+source include/restart_mysqld.inc;
diff --git a/mysql-test/suite/plugins/t/compression_load.test b/mysql-test/suite/plugins/t/compression_load.test
new file mode 100644
index 00000000000..d67c204e75f
--- /dev/null
+++ b/mysql-test/suite/plugins/t/compression_load.test
@@ -0,0 +1,24 @@
+source include/have_innodb.inc;
+
+if (!$PROVIDER_LZ4_SO) {
+ skip Requires provider_lz4 plugin;
+}
+
+select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4';
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_compression_algorithm = lz4;
+install plugin provider_lz4 soname 'provider_lz4';
+select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4';
+set global innodb_compression_algorithm = lz4;
+create table t1 (a int, b text) engine=innodb page_compressed=1;
+insert t1 (a, b) values (0, repeat("abc", 100));
+insert t1 (a, b) values (1, repeat("def", 1000));
+insert t1 (a, b) values (2, repeat("ghi", 10000));
+select a, left(b, 9), length(b) from t1;
+uninstall plugin provider_lz4;
+select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4';
+set global innodb_compression_algorithm = default;
+set global innodb_compression_algorithm = lz4;
+set global innodb_compression_algorithm = default;
+select a, left(b, 9), length(b) from t1;
+drop table t1;
diff --git a/mysql-test/suite/plugins/t/cracklib_password_check.test b/mysql-test/suite/plugins/t/cracklib_password_check.test
index 89b53b656d6..0fbef757e30 100644
--- a/mysql-test/suite/plugins/t/cracklib_password_check.test
+++ b/mysql-test/suite/plugins/t/cracklib_password_check.test
@@ -27,6 +27,14 @@ show warnings;
grant select on *.* to foobar identified by 'qwerty';
show warnings;
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to foocar@localhost identified by 'localhost';
+show warnings;
+
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to foocar@localhost identified by 'foocar@localhost';
+show warnings;
+
grant select on *.* to foobar identified by 'q$%^&*rty';
drop user foobar;
diff --git a/mysql-test/suite/plugins/t/password_reuse_check.test b/mysql-test/suite/plugins/t/password_reuse_check.test
new file mode 100644
index 00000000000..85811df4a2e
--- /dev/null
+++ b/mysql-test/suite/plugins/t/password_reuse_check.test
@@ -0,0 +1,73 @@
+--source include/not_embedded.inc
+
+if (!$PASSWORD_REUSE_CHECK_SO) {
+ skip No PASSWORD_REUSE_CHECK plugin;
+}
+
+install soname "password_reuse_check";
+
+set global password_reuse_check_interval= 0;
+
+--echo # Default value (sould be unlimited i.e. 0)
+SHOW GLOBAL VARIABLES like "password_reuse_check%";
+
+--echo # insert user
+grant select on *.* to user_name@localhost identified by 'test_pwd';
+
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to user_name@localhost identified by 'test_pwd';
+show warnings;
+
+--error ER_CANNOT_USER
+alter user user_name@localhost identified by 'test_pwd';
+show warnings;
+
+# Plugin does not work for it
+#--error ER_NOT_VALID_PASSWORD
+#SET PASSWORD FOR user_name@localhost = PASSWORD('test_pwd');
+
+--echo # check exparation
+
+set global password_reuse_check_interval= 10;
+
+--error ER_CANNOT_USER
+alter user user_name@localhost identified by 'test_pwd';
+show warnings;
+select hex(hash) from mysql.password_reuse_check_history;
+
+--echo # emulate old password
+update mysql.password_reuse_check_history set time= date_sub(now(), interval
+11 day);
+
+alter user user_name@localhost identified by 'test_pwd';
+show warnings;
+
+drop user user_name@localhost;
+
+show create table mysql.password_reuse_check_history;
+select count(*) from mysql.password_reuse_check_history;
+
+drop table mysql.password_reuse_check_history;
+
+--echo # test error messages
+
+set global password_reuse_check_interval= 0;
+
+drop table if exists mysql.password_reuse_check_history;
+
+--echo # test error messages
+
+create table mysql.password_reuse_check_history (wrong_structure int);
+
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to user_name@localhost identified by 'test_pwd';
+show warnings;
+
+set global password_reuse_check_interval= 10;
+
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to user_name@localhost identified by 'test_pwd';
+show warnings;
+
+drop table mysql.password_reuse_check_history;
+uninstall plugin password_reuse_check;
diff --git a/mysql-test/suite/plugins/t/test_sql_service.test b/mysql-test/suite/plugins/t/test_sql_service.test
index 9b9e29c6913..b80d78fe6e5 100644
--- a/mysql-test/suite/plugins/t/test_sql_service.test
+++ b/mysql-test/suite/plugins/t/test_sql_service.test
@@ -9,9 +9,52 @@ let count_sessions= 1;
source include/wait_until_count_sessions.inc;
install plugin test_sql_service soname 'test_sql_service';
+show status like 'test_sql_service_passed';
set global test_sql_service_run_test= 1;
-show status like 'test_sql_service%';
+show status like 'test_sql_service_passed';
+
+set global test_sql_service_execute_sql_local= 'create table test.t1(id int)';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_local= 'insert into test.t1 values (1), (2)';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_local= 'select * from test.t1';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_local= 'drop table test.t1';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_local= 'drop table test.t1';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_global= 'create table test.t1(id int)';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_global= 'insert into test.t1 values (1), (2)';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_global= 'select * from test.t1';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_global= 'drop table test.t1';
+show status like 'test_sql_query_result';
+
+set global test_sql_service_execute_sql_global= 'drop table test.t1';
+show status like 'test_sql_query_result';
+
+create table t1 (id int, time timestamp);
+insert into t1 values (1, NULL), (2, NULL), (3, NULL), (4, NULL), (5, NULL);
+set global test_sql_service_execute_sql_global= 'select * FROM test.t1 WHERE time < DATE_SUB(NOW(), interval 5 minute)';
+show status like 'test_sql_query_result';
+set global test_sql_service_execute_sql_global= 'select * FROM test.t1 WHERE time <= NOW()';
+show status like 'test_sql_query_result';
+set global test_sql_service_execute_sql_local= 'select * FROM test.t1 WHERE time < DATE_SUB(NOW(), interval 5 minute)';
+show status like 'test_sql_query_result';
+set global test_sql_service_execute_sql_local= 'select * FROM test.t1 WHERE time <= NOW()';
+show status like 'test_sql_query_result';
+drop table t1;
uninstall plugin test_sql_service;
diff --git a/mysql-test/suite/roles/definer.result b/mysql-test/suite/roles/definer.result
index fc110940a92..a83a42a0c67 100644
--- a/mysql-test/suite/roles/definer.result
+++ b/mysql-test/suite/roles/definer.result
@@ -326,7 +326,9 @@ CREATE TABLE `t1` (
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1,10,100),(2,20,200);
+INSERT INTO `t1` VALUES
+(1,10,100),
+(2,20,200);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t2` (
@@ -335,7 +337,8 @@ CREATE TABLE `t2` (
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t2` VALUES (2,20,200);
+INSERT INTO `t2` VALUES
+(2,20,200);
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
diff --git a/mysql-test/suite/rpl/include/rpl_extra_col_master.test b/mysql-test/suite/rpl/include/rpl_extra_col_master.test
index 02645a577f5..0d397b7e3ba 100644
--- a/mysql-test/suite/rpl/include/rpl_extra_col_master.test
+++ b/mysql-test/suite/rpl/include/rpl_extra_col_master.test
@@ -825,7 +825,7 @@ SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
--echo *****************
--echo
connection slave;
-# 1072 = ER_KEY_COLUMN_DOES_NOT_EXITS
+# 1072 = ER_KEY_COLUMN_DOES_NOT_EXIST
--let $slave_sql_errno= 1072
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
index bb1a2c173de..e9e1fd512b4 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
@@ -29,7 +29,7 @@ INSERT INTO t2 VALUES(1, 't2, text 1');
--echo
--echo ******************** DELETE ********************
DELETE FROM t1 WHERE a = 1;
-DELETE FROM t2 WHERE b <> UUID();
+DELETE FROM t2 WHERE b <> SYS_GUID();
--source suite/rpl/include/rpl_mixed_check_select.inc
--source suite/rpl/include/rpl_mixed_clear_tables.inc
@@ -37,7 +37,7 @@ DELETE FROM t2 WHERE b <> UUID();
--echo
--echo ******************** INSERT ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
-INSERT INTO t1 VALUES(2, UUID());
+INSERT INTO t1 VALUES(2, SYS_GUID());
INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t2 VALUES (1, 't1, text 1') ON DUPLICATE KEY UPDATE b = 't2, text 1';
DELETE FROM t1 WHERE a = 2;
@@ -60,7 +60,7 @@ INSERT INTO t1 VALUES(1, 't1, text 1');
INSERT INTO t1 VALUES(2, 't1, text 2');
INSERT INTO t1 VALUES(3, 't1, text 3');
REPLACE INTO t1 VALUES(1, 't1, text 11');
-REPLACE INTO t1 VALUES(2, UUID());
+REPLACE INTO t1 VALUES(2, SYS_GUID());
REPLACE INTO t1 SET a=3, b='t1, text 33';
DELETE FROM t1 WHERE a = 2;
--source suite/rpl/include/rpl_mixed_check_select.inc
@@ -70,7 +70,7 @@ DELETE FROM t1 WHERE a = 2;
--echo
--echo ******************** SELECT ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
-SELECT * FROM t1 WHERE b <> UUID() ORDER BY a;
+SELECT * FROM t1 WHERE b <> SYS_GUID() ORDER BY a;
--source suite/rpl/include/rpl_mixed_clear_tables.inc
# JOIN
@@ -89,7 +89,7 @@ SELECT * FROM t1 INNER JOIN t2 ON t1.b = t2.b ORDER BY t1.a,t2.a;
--echo ******************** UNION ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
INSERT INTO t2 VALUES(1, 't2, text 1');
-SELECT * FROM t1 UNION SELECT * FROM t2 WHERE t2.b <> UUID();
+SELECT * FROM t1 UNION SELECT * FROM t2 WHERE t2.b <> SYS_GUID();
--source suite/rpl/include/rpl_mixed_clear_tables.inc
# TRUNCATE
@@ -144,7 +144,7 @@ START TRANSACTION;
INSERT INTO t1 VALUES (5, 'before savepoint s2');
SAVEPOINT s2;
INSERT INTO t1 VALUES (6, 'after savepoint s2');
-INSERT INTO t1 VALUES (7, CONCAT('with UUID() ',UUID()));
+INSERT INTO t1 VALUES (7, CONCAT('with SYS_GUID() ',SYS_GUID()));
RELEASE SAVEPOINT s2;
COMMIT;
DELETE FROM t1 WHERE a = 7;
@@ -257,7 +257,7 @@ BEGIN
END|
CREATE PROCEDURE p2 ()
BEGIN
- UPDATE t1 SET b = UUID() WHERE a = 202;
+ UPDATE t1 SET b = SYS_GUID() WHERE a = 202;
END|
DELIMITER ;|
INSERT INTO t1 VALUES(201, 'test 201');
@@ -309,7 +309,7 @@ DROP EVENT e2;
INSERT INTO t1 VALUES(1, 'test1');
INSERT INTO t1 VALUES(2, 'test2');
CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = 1;
-CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> UUID();
+CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> SYS_GUID();
--source suite/rpl/include/rpl_mixed_check_view.inc
ALTER VIEW v1 AS SELECT * FROM t1 WHERE a = 2;
--source suite/rpl/include/rpl_mixed_check_view.inc
@@ -323,7 +323,7 @@ DROP VIEW v2;
--echo ******************** SHOW BINLOG EVENTS ********************
--source include/show_binlog_events.inc
sync_slave_with_master;
-# as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID
+# as we're using SYS_GUID we don't SELECT but use "diff" like in rpl_row_SYS_GUID
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test_rpl > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test_rpl > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
diff --git a/mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc b/mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc
index 31b80732c60..d814a257711 100644
--- a/mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc
+++ b/mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc
@@ -10,7 +10,7 @@
# - Master is switching explicitly between STATEMENT, ROW, and MIXED
# binlog format showing when it is possible and when not.
# - Master switching from MIXED to RBR implicitly listing all use
-# cases, e.g a query invokes UUID(), thereafter to serve as the
+# cases, e.g a query invokes SYS_GUID(), thereafter to serve as the
# definition of MIXED binlog format
# - correctness of execution
@@ -56,18 +56,18 @@ select @@global.binlog_format, @@session.binlog_format;
CREATE TABLE t1 (a varchar(100));
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+prepare stmt1 from 'insert into t1 select concat(SYS_GUID(),?)';
set @string="emergency_1_";
insert into t1 values("work_2_");
execute stmt1 using @string;
deallocate prepare stmt1;
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_3_"));
+insert into t1 values(concat(SYS_GUID(),"work_3_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_4_",UUID()));
+insert into t1 values(concat("for_4_",SYS_GUID()));
insert into t1 select "yesterday_5_";
# verify that temp tables prevent a switch to SBR
@@ -129,41 +129,41 @@ select @@global.binlog_format, @@session.binlog_format;
set binlog_format=default;
select @@global.binlog_format, @@session.binlog_format;
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+prepare stmt1 from 'insert into t1 select concat(SYS_GUID(),?)';
set @string="emergency_17_";
insert into t1 values("work_18_");
execute stmt1 using @string;
deallocate prepare stmt1;
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_19_"));
+insert into t1 values(concat(SYS_GUID(),"work_19_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_20_",UUID()));
+insert into t1 values(concat("for_20_",SYS_GUID()));
insert into t1 select "yesterday_21_";
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_22_"));
+insert into t1 values(concat(SYS_GUID(),"work_22_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_23_",UUID()));
+insert into t1 values(concat("for_23_",SYS_GUID()));
insert into t1 select "yesterday_24_";
# Test of CREATE TABLE SELECT
-create table t2 ENGINE=MyISAM select rpad(UUID(),100,' ');
-create table t3 select 1 union select UUID();
+create table t2 ENGINE=MyISAM select rpad(SYS_GUID(),100,' ');
+create table t3 select 1 union select SYS_GUID();
--disable_warnings
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
-create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
+create table t4 select * from t1 where 3 in (select 1 union select 2 union select SYS_GUID() union select 3);
--enable_warnings
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
-# what if UUID() is first:
+# what if SYS_GUID() is first:
--disable_warnings
-insert ignore into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
+insert ignore into t5 select SYS_GUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
--enable_warnings
# inside a stored procedure
@@ -172,14 +172,14 @@ delimiter |;
create procedure foo()
begin
insert into t1 values("work_25_");
-insert into t1 values(concat("for_26_",UUID()));
+insert into t1 values(concat("for_26_",SYS_GUID()));
insert into t1 select "yesterday_27_";
end|
create procedure foo2()
begin
-insert into t1 values(concat("emergency_28_",UUID()));
+insert into t1 values(concat("emergency_28_",SYS_GUID()));
insert into t1 values("work_29_");
-insert into t1 values(concat("for_30_",UUID()));
+insert into t1 values(concat("for_30_",SYS_GUID()));
set session binlog_format=row; # accepted for stored procs
insert into t1 values("more work_31_");
set session binlog_format=mixed;
@@ -199,7 +199,7 @@ delimiter ;|
call foo();
call foo2();
call foo4("hello");
-call foo4(UUID());
+call foo4(SYS_GUID());
call foo4("world");
# test that can't SET in a stored function
@@ -249,7 +249,7 @@ deallocate prepare stmt1;
delimiter |;
create function foo5() returns bigint unsigned
begin
- insert into t2 select UUID();
+ insert into t2 select SYS_GUID();
return 100;
end|
delimiter ;|
@@ -260,7 +260,7 @@ execute stmt1;
execute stmt1;
deallocate prepare stmt1;
-# A simple stored function where UUID() is in the argument
+# A simple stored function where SYS_GUID() is in the argument
delimiter |;
create function foo6(x varchar(100)) returns bigint unsigned
begin
@@ -269,17 +269,17 @@ begin
end|
delimiter ;|
select foo6("foo6_1_");
-select foo6(concat("foo6_2_",UUID()));
+select foo6(concat("foo6_2_",SYS_GUID()));
-prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))';
+prepare stmt1 from 'select foo6(concat("foo6_3_",SYS_GUID()))';
execute stmt1;
execute stmt1;
deallocate prepare stmt1;
-# Test of views using UUID()
+# Test of views using SYS_GUID()
-create view v1 as select uuid();
+create view v1 as select SYS_GUID();
create table t11 (data varchar(255));
insert into t11 select * from v1;
# Test of querying INFORMATION_SCHEMA which parses the view's body,
@@ -291,18 +291,18 @@ execute stmt1;
execute stmt1;
deallocate prepare stmt1;
-# Test of triggers with UUID()
+# Test of triggers with SYS_GUID()
delimiter |;
create trigger t11_bi before insert on t11 for each row
begin
- set NEW.data = concat(NEW.data,UUID());
+ set NEW.data = concat(NEW.data,SYS_GUID());
end|
delimiter ;|
insert into t11 values("try_560_");
# Test that INSERT DELAYED works in mixed mode (BUG#20649)
insert delayed into t2 values("delay_1_");
-insert delayed into t2 values(concat("delay_2_",UUID()));
+insert delayed into t2 values(concat("delay_2_",SYS_GUID()));
insert delayed into t2 values("delay_6_");
# Test for BUG#20633 (INSERT DELAYED RAND()/user_variable does not
@@ -482,7 +482,7 @@ sync_slave_with_master;
# Test for BUG#20499 "mixed mode with temporary table breaks binlog"
# Slave used to have only 2 rows instead of 3.
connection master;
-CREATE TEMPORARY TABLE t15 SELECT UUID();
+CREATE TEMPORARY TABLE t15 SELECT SYS_GUID();
create table t16 like t15;
INSERT INTO t16 SELECT * FROM t15;
# we'll verify that this one is done RBB
@@ -546,7 +546,7 @@ DROP TABLE IF EXISTS t12;
SET SESSION BINLOG_FORMAT=MIXED;
CREATE TABLE t12 (data LONG);
LOCK TABLES t12 WRITE;
-INSERT INTO t12 VALUES(UUID());
+INSERT INTO t12 VALUES(SYS_GUID());
UNLOCK TABLES;
sync_slave_with_master;
@@ -587,7 +587,7 @@ INSERT INTO t13 VALUES (my_current_user());
sync_slave_with_master;
-# as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID
+# as we're using SYS_GUID we don't SELECT but use "diff" like in rpl_row_UUID
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
index 7dd3907f102..513bc26a1cc 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
@@ -33,7 +33,7 @@ INSERT INTO t2 VALUES(1, 't2, text 1');
******************** DELETE ********************
DELETE FROM t1 WHERE a = 1;
-DELETE FROM t2 WHERE b <> UUID();
+DELETE FROM t2 WHERE b <> SYS_GUID();
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -64,7 +64,7 @@ DELETE FROM t2;
******************** INSERT ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
-INSERT INTO t1 VALUES(2, UUID());
+INSERT INTO t1 VALUES(2, SYS_GUID());
INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t2 VALUES (1, 't1, text 1') ON DUPLICATE KEY UPDATE b = 't2, text 1';
DELETE FROM t1 WHERE a = 2;
@@ -143,7 +143,7 @@ INSERT INTO t1 VALUES(1, 't1, text 1');
INSERT INTO t1 VALUES(2, 't1, text 2');
INSERT INTO t1 VALUES(3, 't1, text 3');
REPLACE INTO t1 VALUES(1, 't1, text 11');
-REPLACE INTO t1 VALUES(2, UUID());
+REPLACE INTO t1 VALUES(2, SYS_GUID());
REPLACE INTO t1 SET a=3, b='t1, text 33';
DELETE FROM t1 WHERE a = 2;
SELECT COUNT(*) FROM t1;
@@ -178,7 +178,7 @@ DELETE FROM t2;
******************** SELECT ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
-SELECT * FROM t1 WHERE b <> UUID() ORDER BY a;
+SELECT * FROM t1 WHERE b <> SYS_GUID() ORDER BY a;
a b
1 t1, text 1
DELETE FROM t1;
@@ -203,7 +203,7 @@ DELETE FROM t2;
******************** UNION ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
INSERT INTO t2 VALUES(1, 't2, text 1');
-SELECT * FROM t1 UNION SELECT * FROM t2 WHERE t2.b <> UUID();
+SELECT * FROM t1 UNION SELECT * FROM t2 WHERE t2.b <> SYS_GUID();
a b
1 t1, text 1
1 t2, text 1
@@ -430,7 +430,7 @@ START TRANSACTION;
INSERT INTO t1 VALUES (5, 'before savepoint s2');
SAVEPOINT s2;
INSERT INTO t1 VALUES (6, 'after savepoint s2');
-INSERT INTO t1 VALUES (7, CONCAT('with UUID() ',UUID()));
+INSERT INTO t1 VALUES (7, CONCAT('with SYS_GUID() ',SYS_GUID()));
RELEASE SAVEPOINT s2;
COMMIT;
DELETE FROM t1 WHERE a = 7;
@@ -598,7 +598,7 @@ UPDATE t1 SET b = 'test' WHERE a = 201;
END|
CREATE PROCEDURE p2 ()
BEGIN
-UPDATE t1 SET b = UUID() WHERE a = 202;
+UPDATE t1 SET b = SYS_GUID() WHERE a = 202;
END|
INSERT INTO t1 VALUES(201, 'test 201');
CALL p1();
@@ -790,7 +790,7 @@ DELETE FROM t2;
INSERT INTO t1 VALUES(1, 'test1');
INSERT INTO t1 VALUES(2, 'test2');
CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = 1;
-CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> UUID();
+CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> SYS_GUID();
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`a` = 1 latin1 latin1_swedish_ci
@@ -850,7 +850,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 WHERE a = 1
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Annotate_rows # # DELETE FROM t2 WHERE b <> UUID()
+master-bin.000001 # Annotate_rows # # DELETE FROM t2 WHERE b <> SYS_GUID()
master-bin.000001 # Table_map # # table_id: # (test_rpl.t2)
master-bin.000001 # Delete_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -864,7 +864,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES(2, UUID())
+master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES(2, SYS_GUID())
master-bin.000001 # Table_map # # table_id: # (test_rpl.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -912,7 +912,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; REPLACE INTO t1 VALUES(1, 't1, text 11')
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Annotate_rows # # REPLACE INTO t1 VALUES(2, UUID())
+master-bin.000001 # Annotate_rows # # REPLACE INTO t1 VALUES(2, SYS_GUID())
master-bin.000001 # Table_map # # table_id: # (test_rpl.t1)
master-bin.000001 # Update_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -1007,7 +1007,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (5, 'before savepoint s2')
master-bin.000001 # Query # # SAVEPOINT `s2`
master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (6, 'after savepoint s2')
-master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (7, CONCAT('with UUID() ',UUID()))
+master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (7, CONCAT('with SYS_GUID() ',SYS_GUID()))
master-bin.000001 # Table_map # # table_id: # (test_rpl.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -1049,7 +1049,7 @@ END
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`()
BEGIN
-UPDATE t1 SET b = UUID() WHERE a = 202;
+UPDATE t1 SET b = SYS_GUID() WHERE a = 202;
END
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(201, 'test 201')
@@ -1061,7 +1061,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(202, 'test 202')
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Annotate_rows # # UPDATE t1 SET b = UUID() WHERE a = 202
+master-bin.000001 # Annotate_rows # # UPDATE t1 SET b = SYS_GUID() WHERE a = 202
master-bin.000001 # Table_map # # table_id: # (test_rpl.t1)
master-bin.000001 # Update_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@@ -1124,7 +1124,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS SELECT * FROM t1 WHERE a = 1
master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # use `test_rpl`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS SELECT * FROM t1 WHERE b <> UUID()
+master-bin.000001 # Query # # use `test_rpl`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS SELECT * FROM t1 WHERE b <> SYS_GUID()
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS SELECT * FROM t1 WHERE a = 2
master-bin.000001 # Gtid # # GTID #-#-#
diff --git a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
index 936f604be2e..71332034b15 100644
--- a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
+++ b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
@@ -41,16 +41,16 @@ select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
ROW ROW
CREATE TABLE t1 (a varchar(100));
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+prepare stmt1 from 'insert into t1 select concat(SYS_GUID(),?)';
set @string="emergency_1_";
insert into t1 values("work_2_");
execute stmt1 using @string;
deallocate prepare stmt1;
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_3_"));
+insert into t1 values(concat(SYS_GUID(),"work_3_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_4_",UUID()));
+insert into t1 values(concat("for_4_",SYS_GUID()));
insert into t1 select "yesterday_5_";
create temporary table tmp(a char(100));
insert into tmp values("see_6_");
@@ -116,43 +116,43 @@ set binlog_format=default;
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
MIXED MIXED
-prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
+prepare stmt1 from 'insert into t1 select concat(SYS_GUID(),?)';
set @string="emergency_17_";
insert into t1 values("work_18_");
execute stmt1 using @string;
deallocate prepare stmt1;
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_19_"));
+insert into t1 values(concat(SYS_GUID(),"work_19_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_20_",UUID()));
+insert into t1 values(concat("for_20_",SYS_GUID()));
insert into t1 select "yesterday_21_";
prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values(concat(UUID(),"work_22_"));
+insert into t1 values(concat(SYS_GUID(),"work_22_"));
execute stmt1 using @string;
deallocate prepare stmt1;
-insert into t1 values(concat("for_23_",UUID()));
+insert into t1 values(concat("for_23_",SYS_GUID()));
insert into t1 select "yesterday_24_";
-create table t2 ENGINE=MyISAM select rpad(UUID(),100,' ');
-create table t3 select 1 union select UUID();
+create table t2 ENGINE=MyISAM select rpad(SYS_GUID(),100,' ');
+create table t3 select 1 union select SYS_GUID();
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
-create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
+create table t4 select * from t1 where 3 in (select 1 union select 2 union select SYS_GUID() union select 3);
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
Warnings:
Warning 1292 Truncated incorrect datetime value: '3'
-insert ignore into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
+insert ignore into t5 select SYS_GUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
create procedure foo()
begin
insert into t1 values("work_25_");
-insert into t1 values(concat("for_26_",UUID()));
+insert into t1 values(concat("for_26_",SYS_GUID()));
insert into t1 select "yesterday_27_";
end|
create procedure foo2()
begin
-insert into t1 values(concat("emergency_28_",UUID()));
+insert into t1 values(concat("emergency_28_",SYS_GUID()));
insert into t1 values("work_29_");
-insert into t1 values(concat("for_30_",UUID()));
+insert into t1 values(concat("for_30_",SYS_GUID()));
set session binlog_format=row; # accepted for stored procs
insert into t1 values("more work_31_");
set session binlog_format=mixed;
@@ -171,7 +171,7 @@ end|
call foo();
call foo2();
call foo4("hello");
-call foo4(UUID());
+call foo4(SYS_GUID());
call foo4("world");
select foo3();
ERROR HY000: Cannot change the binary logging format inside a stored function or trigger
@@ -207,7 +207,7 @@ foo4()
deallocate prepare stmt1;
create function foo5() returns bigint unsigned
begin
-insert into t2 select UUID();
+insert into t2 select SYS_GUID();
return 100;
end|
select foo5();
@@ -229,18 +229,18 @@ end|
select foo6("foo6_1_");
foo6("foo6_1_")
100
-select foo6(concat("foo6_2_",UUID()));
-foo6(concat("foo6_2_",UUID()))
+select foo6(concat("foo6_2_",SYS_GUID()));
+foo6(concat("foo6_2_",SYS_GUID()))
100
-prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))';
+prepare stmt1 from 'select foo6(concat("foo6_3_",SYS_GUID()))';
execute stmt1;
-foo6(concat("foo6_3_",UUID()))
+foo6(concat("foo6_3_",SYS_GUID()))
100
execute stmt1;
-foo6(concat("foo6_3_",UUID()))
+foo6(concat("foo6_3_",SYS_GUID()))
100
deallocate prepare stmt1;
-create view v1 as select uuid();
+create view v1 as select SYS_GUID();
create table t11 (data varchar(255));
insert into t11 select * from v1;
insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11');
@@ -250,11 +250,11 @@ execute stmt1;
deallocate prepare stmt1;
create trigger t11_bi before insert on t11 for each row
begin
-set NEW.data = concat(NEW.data,UUID());
+set NEW.data = concat(NEW.data,SYS_GUID());
end|
insert into t11 values("try_560_");
insert delayed into t2 values("delay_1_");
-insert delayed into t2 values(concat("delay_2_",UUID()));
+insert delayed into t2 values(concat("delay_2_",SYS_GUID()));
insert delayed into t2 values("delay_6_");
insert delayed into t2 values(rand());
set @a=2.345;
@@ -356,7 +356,7 @@ alter table t1 modify a int, drop primary key;
insert into t1 values(null,"try_57_");
connection slave;
connection master;
-CREATE TEMPORARY TABLE t15 SELECT UUID();
+CREATE TEMPORARY TABLE t15 SELECT SYS_GUID();
create table t16 like t15;
INSERT INTO t16 SELECT * FROM t15;
insert into t16 values("try_65_");
@@ -427,7 +427,7 @@ DROP TABLE IF EXISTS t12;
SET SESSION BINLOG_FORMAT=MIXED;
CREATE TABLE t12 (data LONG);
LOCK TABLES t12 WRITE;
-INSERT INTO t12 VALUES(UUID());
+INSERT INTO t12 VALUES(SYS_GUID());
UNLOCK TABLES;
connection slave;
connection master;
diff --git a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
index b9c636fa582..639b107abd6 100644
--- a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
+++ b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
@@ -4,7 +4,7 @@ include/master-slave.inc
connection master;
CREATE TABLE t1 (a CHAR(48));
CREATE TEMPORARY TABLE t1_tmp1(a INT);
-INSERT INTO t1 VALUES (UUID());
+INSERT INTO t1 VALUES (SYS_GUID());
connection slave;
==== Verify results on slave ====
SHOW STATUS LIKE "Slave_open_temp_tables";
@@ -121,12 +121,12 @@ master-bin.000001 # Query # # COMMIT
BEGIN;
DROP TEMPORARY TABLE t1;
# The rows event will binlogged after 'INSERT INTO t1 VALUES(1)'
-INSERT IGNORE INTO t1 VALUES(uuid()+0);
+INSERT IGNORE INTO t1 VALUES(SYS_GUID()+0);
COMMIT;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Annotate_rows # # INSERT IGNORE INTO t1 VALUES(uuid()+0)
+master-bin.000001 # Annotate_rows # # INSERT IGNORE INTO t1 VALUES(SYS_GUID()+0)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
diff --git a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
index d864e615f7a..766acb14c3d 100644
--- a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
+++ b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
@@ -4,7 +4,7 @@
# This test case will test the condition of the bug#40013.
# The test step is:
# 1: create temp table on connection 'master';
-# 2: switch to ROW format using 'INSERT INTO t1 VALUES (UUID());'
+# 2: switch to ROW format using 'INSERT INTO t1 VALUES (SYS_GUID());'
# 3: disconnect 'master' and connect to a new connection 'master1';
# 4: sync to slave and check the number of temp tables on slave.
#
@@ -19,7 +19,7 @@ source include/master-slave.inc;
CREATE TABLE t1 (a CHAR(48));
CREATE TEMPORARY TABLE t1_tmp1(a INT);
-INSERT INTO t1 VALUES (UUID());
+INSERT INTO t1 VALUES (SYS_GUID());
sync_slave_with_master;
@@ -188,7 +188,7 @@ DROP TEMPORARY TABLE t1;
--echo # The rows event will binlogged after 'INSERT INTO t1 VALUES(1)'
--disable_warnings
-INSERT IGNORE INTO t1 VALUES(uuid()+0);
+INSERT IGNORE INTO t1 VALUES(SYS_GUID()+0);
--enable_warnings
COMMIT;
diff --git a/mysql-test/suite/s3/mysqldump.result b/mysql-test/suite/s3/mysqldump.result
index af9882615c3..7a14b0aac9a 100644
--- a/mysql-test/suite/s3/mysqldump.result
+++ b/mysql-test/suite/s3/mysqldump.result
@@ -23,7 +23,11 @@ CREATE TABLE `t1` (
PRIMARY KEY (`pk`)
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1,1),(2,2),(3,3),(4,4);
+INSERT INTO `t1` VALUES
+(1,1),
+(2,2),
+(3,3),
+(4,4);
ALTER TABLE `t1` ENGINE=S3;
#####
# mysqldump with --copy-s3-tables=1 XML
diff --git a/mysql-test/suite/sql_sequence/mysqldump.result b/mysql-test/suite/sql_sequence/mysqldump.result
index fb023cc5e36..7da48a917ca 100644
--- a/mysql-test/suite/sql_sequence/mysqldump.result
+++ b/mysql-test/suite/sql_sequence/mysqldump.result
@@ -14,7 +14,9 @@ CREATE TABLE `t1` (
KEY `a` (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1),(2);
+INSERT INTO `t1` VALUES
+(1),
+(2);
# dump by tables order 1
CREATE SEQUENCE `a1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=Aria;
SELECT SETVAL(`a1`, 1, 0);
@@ -27,7 +29,9 @@ CREATE TABLE `t1` (
KEY `a` (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1),(2);
+INSERT INTO `t1` VALUES
+(1),
+(2);
# dump by tables order 2
CREATE SEQUENCE `a1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=Aria;
SELECT SETVAL(`a1`, 1, 0);
@@ -40,7 +44,9 @@ CREATE TABLE `t1` (
KEY `a` (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1),(2);
+INSERT INTO `t1` VALUES
+(1),
+(2);
# dump by tables only tables
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -49,7 +55,9 @@ CREATE TABLE `t1` (
KEY `a` (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (1),(2);
+INSERT INTO `t1` VALUES
+(1),
+(2);
# dump by tables only sequences
CREATE SEQUENCE `a1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=Aria;
SELECT SETVAL(`a1`, 1, 0);
diff --git a/mysql-test/suite/sys_vars/r/default_tmp_storage_engine_rocksdb.result b/mysql-test/suite/sys_vars/r/default_tmp_storage_engine_rocksdb.result
new file mode 100644
index 00000000000..9ec7b900ccf
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/default_tmp_storage_engine_rocksdb.result
@@ -0,0 +1,102 @@
+#
+# MDEV-12914: Engine for temporary tables which are implicitly
+# created as RocksDB is substitued siliently with MyIsam
+SET default_tmp_storage_engine = engine_doesnt_exist;
+ERROR 42000: Unknown storage engine 'engine_doesnt_exist'
+SET default_tmp_storage_engine = rocksdb;
+ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
+SET default_tmp_storage_engine = CONCAT('rocks','db');
+ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
+CREATE TABLE t1 (i int) ENGINE = RocksDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+CREATE TEMPORARY TABLE t2 LIKE t1;
+ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
+DROP TABLE t1;
+SET default_storage_engine = DEFAULT;
+SET default_tmp_storage_engine = DEFAULT;
+CREATE TABLE t1 (t int);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `t` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE TEMPORARY TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TEMPORARY TABLE `t2` (
+ `t` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1, t2;
+SET default_storage_engine = rocksdb;
+SET default_tmp_storage_engine = default;
+CREATE TABLE t1 (t int);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `t` int(11) DEFAULT NULL
+) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
+CREATE TEMPORARY TABLE t2 LIKE t1;
+ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
+CREATE TEMPORARY TABLE t2 (t int);
+ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
+SET default_tmp_storage_engine = aria;
+CREATE TEMPORARY TABLE t2 (t int);
+DROP TABLE t2;
+CREATE TEMPORARY TABLE t2 LIKE t1;
+ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
+DROP TABLE t1;
+#
+# MDEV-26242: Assertion `i >= 0' failed on setting
+# default_tmp_storage_engine to 'DEFAULT' in 10.7
+#
+SHOW VARIABLES like '%storage_engine';
+Variable_name Value
+default_storage_engine ROCKSDB
+default_tmp_storage_engine Aria
+enforce_storage_engine
+storage_engine ROCKSDB
+SELECT @@GLOBAL.default_tmp_storage_engine, @@GLOBAL.default_storage_engine, @@GLOBAL.storage_engine, @@SESSION.default_tmp_storage_engine, @@SESSION.default_storage_engine, @@SESSION.storage_engine;
+@@GLOBAL.default_tmp_storage_engine @@GLOBAL.default_storage_engine @@GLOBAL.storage_engine @@SESSION.default_tmp_storage_engine @@SESSION.default_storage_engine @@SESSION.storage_engine
+NULL MyISAM MyISAM Aria ROCKSDB ROCKSDB
+SELECT @@GLOBAL.table_type;
+ERROR HY000: Unknown system variable 'table_type'
+SET default_storage_engine=DEFAULT;
+SET default_tmp_storage_engine=innodb;
+SELECT @@GLOBAL.default_tmp_storage_engine, @@GLOBAL.default_storage_engine, @@GLOBAL.storage_engine, @@SESSION.default_tmp_storage_engine, @@SESSION.default_storage_engine, @@SESSION.storage_engine;
+@@GLOBAL.default_tmp_storage_engine @@GLOBAL.default_storage_engine @@GLOBAL.storage_engine @@SESSION.default_tmp_storage_engine @@SESSION.default_storage_engine @@SESSION.storage_engine
+NULL MyISAM MyISAM InnoDB MyISAM MyISAM
+CREATE TABLE t (t int);
+CREATE TEMPORARY TABLE t1 (t int);
+SHOW CREATE TABLE t;
+Table Create Table
+t CREATE TABLE `t` (
+ `t` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TEMPORARY TABLE `t1` (
+ `t` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1, t;
+SET GLOBAL default_tmp_storage_engine='default';
+SELECT @@GLOBAL.default_tmp_storage_engine, @@GLOBAL.default_storage_engine, @@GLOBAL.storage_engine, @@SESSION.default_tmp_storage_engine, @@SESSION.default_storage_engine, @@SESSION.storage_engine;
+@@GLOBAL.default_tmp_storage_engine @@GLOBAL.default_storage_engine @@GLOBAL.storage_engine @@SESSION.default_tmp_storage_engine @@SESSION.default_storage_engine @@SESSION.storage_engine
+MyISAM MyISAM MyISAM InnoDB MyISAM MyISAM
+CREATE TABLE t (t int);
+CREATE TEMPORARY TABLE t1 (t int);
+SHOW CREATE TABLE t;
+Table Create Table
+t CREATE TABLE `t` (
+ `t` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TEMPORARY TABLE `t1` (
+ `t` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1, t;
+SET GLOBAL default_tmp_storage_engine=NULL;
diff --git a/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result b/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result
index 2cb697acb6d..68d3d40091a 100644
--- a/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result
@@ -6,9 +6,27 @@ SELECT COUNT(@@innodb_purge_threads);
COUNT(@@innodb_purge_threads)
1
1 Expected
+SET @save_threads = @@GLOBAL.innodb_purge_threads;
+SET @@GLOBAL.innodb_purge_threads=-1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_purge_threads value: '-1'
+SELECT @@GLOBAL.innodb_purge_threads;
+@@GLOBAL.innodb_purge_threads
+1
+SET @@GLOBAL.innodb_purge_threads=0;
+Warnings:
+Warning 1292 Truncated incorrect innodb_purge_threads value: '0'
+SELECT @@GLOBAL.innodb_purge_threads;
+@@GLOBAL.innodb_purge_threads
+1
+SET @@GLOBAL.innodb_purge_threads=33;
+Warnings:
+Warning 1292 Truncated incorrect innodb_purge_threads value: '33'
+SELECT @@GLOBAL.innodb_purge_threads;
+@@GLOBAL.innodb_purge_threads
+32
SET @@GLOBAL.innodb_purge_threads=1;
-ERROR HY000: Variable 'innodb_purge_threads' is a read only variable
-Expected error 'Read-only variable'
+SET @@GLOBAL.innodb_purge_threads=32;
SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads;
ERROR 42S22: Unknown column 'innodb_purge_threads' in 'field list'
Expected error 'Read-only variable'
@@ -38,4 +56,5 @@ SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME = 'innodb_purge_threads';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_PURGE_THREADS 4
+INNODB_PURGE_THREADS 32
+SET GLOBAL innodb_purge_threads = @save_threads;
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
index 7a524ba2c16..2a7bd72a700 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
@@ -354,12 +354,3 @@
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1729,7 +1729,7 @@
- SESSION_VALUE NULL
- DEFAULT_VALUE 0
- VARIABLE_SCOPE GLOBAL
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Number of undo tablespaces to use.
- NUMERIC_MIN_VALUE 0
- NUMERIC_MAX_VALUE 127
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
index 8727d66f59b..5a52b2e4251 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -1325,7 +1325,7 @@ NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 32
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
-READ_ONLY YES
+READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_RANDOM_READ_AHEAD
SESSION_VALUE NULL
@@ -1679,7 +1679,7 @@ VARIABLE_NAME INNODB_UNDO_TABLESPACES
SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Number of undo tablespaces to use.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 127
diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
index 6bea1a88caa..bc1f49195b5 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
@@ -526,21 +526,6 @@ ENUM_VALUE_LIST NONE,ALL,ALL_KILL
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
GLOBAL_VALUE_PATH NULL
-VARIABLE_NAME WSREP_REPLICATE_MYISAM
-SESSION_VALUE NULL
-GLOBAL_VALUE OFF
-GLOBAL_VALUE_ORIGIN COMPILE-TIME
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT To enable myisam replication
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
-GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_RESTART_SLAVE
SESSION_VALUE NULL
GLOBAL_VALUE OFF
@@ -721,21 +706,6 @@ ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
-VARIABLE_NAME WSREP_STRICT_DDL
-SESSION_VALUE NULL
-GLOBAL_VALUE OFF
-GLOBAL_VALUE_ORIGIN COMPILE-TIME
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT If set, reject DDL on affected tables not supporting Galera replication
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
-GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_SYNC_WAIT
SESSION_VALUE 0
GLOBAL_VALUE 0
diff --git a/mysql-test/suite/sys_vars/t/default_tmp_storage_engine_rocksdb.test b/mysql-test/suite/sys_vars/t/default_tmp_storage_engine_rocksdb.test
new file mode 100644
index 00000000000..3454e5d6fc4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/default_tmp_storage_engine_rocksdb.test
@@ -0,0 +1,86 @@
+--echo #
+--echo # MDEV-12914: Engine for temporary tables which are implicitly
+--echo # created as RocksDB is substitued siliently with MyIsam
+
+--source include/have_rocksdb.inc
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+
+--error ER_UNKNOWN_STORAGE_ENGINE
+SET default_tmp_storage_engine = engine_doesnt_exist;
+--error ER_ILLEGAL_HA_CREATE_OPTION
+SET default_tmp_storage_engine = rocksdb;
+--error ER_ILLEGAL_HA_CREATE_OPTION
+SET default_tmp_storage_engine = CONCAT('rocks','db');
+
+CREATE TABLE t1 (i int) ENGINE = RocksDB;
+SHOW CREATE TABLE t1;
+
+--error ER_ILLEGAL_HA_CREATE_OPTION
+CREATE TEMPORARY TABLE t2 LIKE t1;
+
+DROP TABLE t1;
+
+SET default_storage_engine = DEFAULT;
+SET default_tmp_storage_engine = DEFAULT;
+
+CREATE TABLE t1 (t int);
+SHOW CREATE TABLE t1;
+CREATE TEMPORARY TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+
+DROP TABLE t1, t2;
+
+SET default_storage_engine = rocksdb;
+# setting default or null for tmp SE should use default SE
+SET default_tmp_storage_engine = default;
+
+CREATE TABLE t1 (t int);
+SHOW CREATE TABLE t1;
+
+--error ER_ILLEGAL_HA_CREATE_OPTION
+CREATE TEMPORARY TABLE t2 LIKE t1;
+
+--error ER_ILLEGAL_HA_CREATE_OPTION
+CREATE TEMPORARY TABLE t2 (t int);
+
+SET default_tmp_storage_engine = aria;
+CREATE TEMPORARY TABLE t2 (t int);
+DROP TABLE t2;
+
+--error ER_ILLEGAL_HA_CREATE_OPTION
+CREATE TEMPORARY TABLE t2 LIKE t1;
+
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-26242: Assertion `i >= 0' failed on setting
+--echo # default_tmp_storage_engine to 'DEFAULT' in 10.7
+--echo #
+
+
+SHOW VARIABLES like '%storage_engine';
+SELECT @@GLOBAL.default_tmp_storage_engine, @@GLOBAL.default_storage_engine, @@GLOBAL.storage_engine, @@SESSION.default_tmp_storage_engine, @@SESSION.default_storage_engine, @@SESSION.storage_engine;
+--error ER_UNKNOWN_SYSTEM_VARIABLE
+SELECT @@GLOBAL.table_type;
+
+SET default_storage_engine=DEFAULT;
+SET default_tmp_storage_engine=innodb;
+SELECT @@GLOBAL.default_tmp_storage_engine, @@GLOBAL.default_storage_engine, @@GLOBAL.storage_engine, @@SESSION.default_tmp_storage_engine, @@SESSION.default_storage_engine, @@SESSION.storage_engine;
+
+CREATE TABLE t (t int);
+CREATE TEMPORARY TABLE t1 (t int);
+SHOW CREATE TABLE t;
+SHOW CREATE TABLE t1;
+DROP TABLE t1, t;
+
+SET GLOBAL default_tmp_storage_engine='default';
+SELECT @@GLOBAL.default_tmp_storage_engine, @@GLOBAL.default_storage_engine, @@GLOBAL.storage_engine, @@SESSION.default_tmp_storage_engine, @@SESSION.default_storage_engine, @@SESSION.storage_engine;
+
+CREATE TABLE t (t int);
+CREATE TEMPORARY TABLE t1 (t int);
+SHOW CREATE TABLE t;
+SHOW CREATE TABLE t1;
+DROP TABLE t1, t;
+
+SET GLOBAL default_tmp_storage_engine=NULL; \ No newline at end of file
diff --git a/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test b/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test
index 4d039601e40..1156fa40a4a 100644
--- a/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test
@@ -11,9 +11,17 @@ SELECT COUNT(@@GLOBAL.innodb_purge_threads);
SELECT COUNT(@@innodb_purge_threads);
--echo 1 Expected
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @save_threads = @@GLOBAL.innodb_purge_threads;
+
+SET @@GLOBAL.innodb_purge_threads=-1;
+SELECT @@GLOBAL.innodb_purge_threads;
+SET @@GLOBAL.innodb_purge_threads=0;
+SELECT @@GLOBAL.innodb_purge_threads;
+SET @@GLOBAL.innodb_purge_threads=33;
+SELECT @@GLOBAL.innodb_purge_threads;
+
SET @@GLOBAL.innodb_purge_threads=1;
---echo Expected error 'Read-only variable'
+SET @@GLOBAL.innodb_purge_threads=32;
--Error ER_BAD_FIELD_ERROR
SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads;
@@ -51,3 +59,5 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME = 'innodb_purge_threads';
--enable_warnings
+
+SET GLOBAL innodb_purge_threads = @save_threads;
diff --git a/mysql-test/suite/sysschema/r/pr_statement_performance_analyzer.result b/mysql-test/suite/sysschema/r/pr_statement_performance_analyzer.result
index df084f8c1a5..c7bb029da39 100644
--- a/mysql-test/suite/sysschema/r/pr_statement_performance_analyzer.result
+++ b/mysql-test/suite/sysschema/r/pr_statement_performance_analyzer.result
@@ -131,7 +131,7 @@ CALL sys.statement_performance_analyzer('do magic', NULL, NULL);
ERROR 45000: Unknown action. Supported actions are: cleanup, create_table, create_tmp, delta, overall, save, snapshot
SET SESSION sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
CALL sys.statement_performance_analyzer('do magic', NULL, NULL);
-ERROR 01000: Data truncated for column 'in_action' at row 1
+ERROR 01000: Data truncated for column 'in_action' at row 0
CALL sys.statement_performance_analyzer('create_tmp', 'sys.tmp_digests', NULL);
ERROR 45000: Invalid value for in_table: `sys`.`tmp_digests` is reserved table name.
CALL sys.statement_performance_analyzer('create_tmp', 'sys.tmp_digests_delta', NULL);
@@ -187,7 +187,7 @@ DROP TEMPORARY TABLE sys.tmp_digests_delta;
ERROR 42S02: Unknown table 'sys.tmp_digests_delta'
SET @identifier := REPEAT('a', 65);
CALL sys.statement_performance_analyzer('snapshot', CONCAT(@identifier, '.', @identifier), NULL);
-ERROR 22001: Data too long for column 'in_table' at row 1
+ERROR 22001: Data too long for column 'in_table' at row 0
DROP TEMPORARY TABLE test.tmp_digests_ini;
DROP TEMPORARY TABLE test.tmp_digests;
DROP TABLE test.tmp_unsupported;
diff --git a/mysql-test/suite/sysschema/r/pr_table_exists.result b/mysql-test/suite/sysschema/r/pr_table_exists.result
index 88917418f67..76085bd72dd 100644
--- a/mysql-test/suite/sysschema/r/pr_table_exists.result
+++ b/mysql-test/suite/sysschema/r/pr_table_exists.result
@@ -40,7 +40,7 @@ SET @identifier := REPEAT('a', 65);
CALL sys.table_exists(@identifier, 't1', @exists);
ERROR 22001: Data too long for column 'in_db' at row 1
CALL sys.table_exists('test', @identifier, @exists);
-ERROR 22001: Data too long for column 'in_table' at row 1
+ERROR 22001: Data too long for column 'in_table' at row 0
SET @identifier := NULL;
#
# MDEV-28391: table_exists procedure fails with
diff --git a/mysql-test/suite/vcol/r/binlog.result b/mysql-test/suite/vcol/r/binlog.result
index 519877e9bc0..97d0aabb315 100644
--- a/mysql-test/suite/vcol/r/binlog.result
+++ b/mysql-test/suite/vcol/r/binlog.result
@@ -88,7 +88,7 @@ CREATE TEMPORARY TABLE t1 SELECT UUID();
show create table t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
- `UUID()` varchar(36) DEFAULT NULL
+ `UUID()` uuid DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 (a INT PRIMARY KEY, b TEXT, c INT GENERATED ALWAYS AS(b));
INSERT INTO t2 (a,b) VALUES (1,1);
diff --git a/mysql-test/suite/versioning/r/data.result b/mysql-test/suite/versioning/r/data.result
new file mode 100644
index 00000000000..873f7297ad5
--- /dev/null
+++ b/mysql-test/suite/versioning/r/data.result
@@ -0,0 +1,59 @@
+#
+# MDEV-16355 Add option for mysqldump to read data as of specific timestamp from system-versioned tables
+#
+create or replace table t1 (x int) with system versioning;
+set timestamp=unix_timestamp('1990-01-01 00:00');
+insert t1 (x) values (1),(2),(3);
+set timestamp=unix_timestamp('1990-08-03 00:00');
+delete from t1 where x=1;
+set timestamp=unix_timestamp('1991-01-02 00:00');
+delete from t1 where x=2;
+set timestamp=default;
+#MYSQL_DUMP --compact test
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `t1` VALUES
+(3);
+#MYSQL_DUMP --compact --as-of="1990-01-02 00:00" test
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `t1` VALUES
+(1),
+(2),
+(3);
+#MYSQL_DUMP --compact --as-of="1990-08-02 00:00" --databases test
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
+
+USE `test`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `t1` VALUES
+(1),
+(2),
+(3);
+#MYSQL_DUMP --compact --as-of="1990-08-04 00:00" test t1
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING;
+/*!40101 SET character_set_client = @saved_cs_client */;
+INSERT INTO `t1` VALUES
+(2),
+(3);
+#MYSQL_DUMP --compact --as-of="1990-08-04 00:00' where 'abc" test 2>&1
+mysqldump: Incorrect DATETIME value: '1990-08-04 00:00' where 'abc'
+drop tables t1;
diff --git a/mysql-test/suite/versioning/r/partition,heap.rdiff b/mysql-test/suite/versioning/r/partition,heap.rdiff
new file mode 100644
index 00000000000..8ce72b5954a
--- /dev/null
+++ b/mysql-test/suite/versioning/r/partition,heap.rdiff
@@ -0,0 +1,88 @@
+--- suite/versioning/r/partition.result 2022-05-10 13:02:50.307581925 +0200
++++ suite/versioning/r/partition,heap.reject 2022-05-10 13:05:19.288575863 +0200
+@@ -1957,85 +1957,6 @@
+ (PARTITION `p0` HISTORY ENGINE = X,
+ PARTITION `pn` CURRENT ENGINE = X)
+ drop tables t1, tp1;
+-# Complex table
+-create or replace table t1 (
+-x int primary key auto_increment,
+-t timestamp(6) default '2001-11-11 11:11:11',
+-b blob(4096) compressed null,
+-c varchar(1033) character set utf8 not null,
+-u int,
+-unique key (x, u),
+-m enum('a', 'b', 'c') not null default 'a' comment 'absolute',
+-i1 tinyint, i2 smallint, i3 bigint,
+-index three(i1, i2, i3),
+-v1 timestamp(6) generated always as (t + interval 1 day),
+-v2 timestamp(6) generated always as (t + interval 1 month) stored,
+-s timestamp(6) as row start,
+-e timestamp(6) as row end,
+-period for system_time (s, e),
+-ps date, pe date,
+-period for app_time (ps, pe),
+-constraint check_constr check (u > -1))
+-with system versioning default charset=ucs2
+-partition by range(x) (
+-partition p0 values less than (10),
+-partition p1 values less than (20),
+-partition pn values less than maxvalue);
+-alter table t1 convert partition p1 to table tp1;
+-show create table tp1;
+-Table Create Table
+-tp1 CREATE TABLE `tp1` (
+- `x` int(11) NOT NULL AUTO_INCREMENT,
+- `t` timestamp(6) NOT NULL DEFAULT '2001-11-11 11:11:11.000000',
+- `b` blob /*!100301 COMPRESSED*/ DEFAULT NULL,
+- `c` varchar(1033) CHARACTER SET utf8mb3 NOT NULL,
+- `u` int(11) DEFAULT NULL,
+- `m` enum('a','b','c') NOT NULL DEFAULT 'a' COMMENT 'absolute',
+- `i1` tinyint(4) DEFAULT NULL,
+- `i2` smallint(6) DEFAULT NULL,
+- `i3` bigint(20) DEFAULT NULL,
+- `v1` timestamp(6) GENERATED ALWAYS AS (`t` + interval 1 day) VIRTUAL,
+- `v2` timestamp(6) GENERATED ALWAYS AS (`t` + interval 1 month) STORED,
+- `s` timestamp(6) GENERATED ALWAYS AS ROW START,
+- `e` timestamp(6) GENERATED ALWAYS AS ROW END,
+- `ps` date NOT NULL,
+- `pe` date NOT NULL,
+- PERIOD FOR `app_time` (`ps`, `pe`),
+- PRIMARY KEY (`x`,`e`),
+- UNIQUE KEY `x` (`x`,`u`,`e`),
+- KEY `three` (`i1`,`i2`,`i3`),
+- PERIOD FOR SYSTEM_TIME (`s`, `e`),
+- CONSTRAINT `check_constr` CHECK (`u` > -1)
+-) ENGINE=X DEFAULT CHARSET=ucs2 WITH SYSTEM VERSIONING
+-show create table t1;
+-Table Create Table
+-t1 CREATE TABLE `t1` (
+- `x` int(11) NOT NULL AUTO_INCREMENT,
+- `t` timestamp(6) NOT NULL DEFAULT '2001-11-11 11:11:11.000000',
+- `b` blob /*!100301 COMPRESSED*/ DEFAULT NULL,
+- `c` varchar(1033) CHARACTER SET utf8mb3 NOT NULL,
+- `u` int(11) DEFAULT NULL,
+- `m` enum('a','b','c') NOT NULL DEFAULT 'a' COMMENT 'absolute',
+- `i1` tinyint(4) DEFAULT NULL,
+- `i2` smallint(6) DEFAULT NULL,
+- `i3` bigint(20) DEFAULT NULL,
+- `v1` timestamp(6) GENERATED ALWAYS AS (`t` + interval 1 day) VIRTUAL,
+- `v2` timestamp(6) GENERATED ALWAYS AS (`t` + interval 1 month) STORED,
+- `s` timestamp(6) GENERATED ALWAYS AS ROW START,
+- `e` timestamp(6) GENERATED ALWAYS AS ROW END,
+- `ps` date NOT NULL,
+- `pe` date NOT NULL,
+- PERIOD FOR `app_time` (`ps`, `pe`),
+- PRIMARY KEY (`x`,`e`),
+- UNIQUE KEY `x` (`x`,`u`,`e`),
+- KEY `three` (`i1`,`i2`,`i3`),
+- PERIOD FOR SYSTEM_TIME (`s`, `e`),
+- CONSTRAINT `check_constr` CHECK (`u` > -1)
+-) ENGINE=X DEFAULT CHARSET=ucs2 WITH SYSTEM VERSIONING
+- PARTITION BY RANGE (`x`)
+-(PARTITION `p0` VALUES LESS THAN (10) ENGINE = X,
+- PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+-drop tables t1, tp1;
+ #
+ # End of 10.7 tests
+ #
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
index 5a23dd24bb9..4ce3b4ef281 100644
--- a/mysql-test/suite/versioning/r/partition.result
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -253,7 +253,7 @@ t1 CREATE TABLE `t1` (
PARTITION BY SYSTEM_TIME LIMIT 2
PARTITIONS 3
alter table t1 drop partition non_existent;
-ERROR HY000: Error in list of partitions to DROP
+ERROR HY000: Wrong partition name or partition list
insert into t1 values (1), (2), (3), (4), (5), (6);
select * from t1 partition (pn);
x
@@ -1639,6 +1639,7 @@ drop tables t1;
#
# MDEV-22155 ALTER add default history partitions name clash on non-default partitions
#
+set timestamp= default;
create or replace table t1 (x int) with system versioning
partition by system_time limit 1
(partition p2 history, partition p8 history, partition pn current);
@@ -1681,4 +1682,373 @@ drop tables t1;
#
# End of 10.5 tests
#
+#
+# MDEV-22166 MIGRATE PARTITION: move out partition into a table
+#
+create or replace table t1 (x int)
+with system versioning
+partition by range(x) (
+partition p1 values less than (10),
+partition p2 values less than (20),
+partition p3 values less than (30),
+partition p4 values less than (40),
+partition p5 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (2), (12), (22), (32), (42), (52);
+update t1 set x= x + 1;
+alter table t1 convert partition p2 to table tp2;
+show create table tp2;
+Table Create Table
+tp2 CREATE TABLE `tp2` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select * from tp2;
+x
+13
+select * from tp2 for system_time all order by x;
+x
+12
+13
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = X,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = X,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+select * from t1 order by x;
+x
+3
+23
+33
+43
+53
+select * from t1 for system_time all order by x;
+x
+2
+3
+22
+23
+32
+33
+42
+43
+52
+53
+# SP
+create or replace procedure sp()
+alter table t1 convert partition p3 to table tp3;
+call sp;
+show create table tp3;
+Table Create Table
+tp3 CREATE TABLE `tp3` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select * from tp3;
+x
+23
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = X,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+select * from t1 order by x;
+x
+3
+33
+43
+53
+drop table tp3;
+call sp;
+ERROR HY000: Wrong partition name or partition list
+call sp;
+ERROR HY000: Wrong partition name or partition list
+drop procedure sp;
+# LOCK TABLES, PS, SP
+create or replace procedure sp()
+alter table t1 convert partition p4 to table tp4;
+lock tables t1 write;
+prepare stmt from 'call sp';
+execute stmt;
+unlock tables;
+show create table tp4;
+Table Create Table
+tp4 CREATE TABLE `tp4` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select * from tp4;
+x
+33
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+select * from t1 order by x;
+x
+3
+43
+53
+drop table tp4;
+lock tables t1 write;
+execute stmt;
+ERROR HY000: Wrong partition name or partition list
+call sp;
+ERROR HY000: Wrong partition name or partition list
+drop prepare stmt;
+unlock tables;
+drop procedure sp;
+unlock tables;
+drop tables t1, tp2;
+# System-versioned tables (SYSTEM_TIME LIMIT)
+create or replace table t1 (
+x int,
+row_start timestamp(6) as row start invisible,
+row_end timestamp(6) as row end invisible,
+period for system_time(row_start, row_end)
+) with system versioning
+partition by system_time limit 1 partitions 4;
+insert into t1 values (2), (12), (22);
+update t1 set x= x + 1 where x = 2;
+update t1 set x= x + 1 where x = 12;
+update t1 set x= x + 1 where x = 22;
+Warnings:
+Warning 4114 Versioned table `test`.`t1`: last HISTORY partition (`p2`) is out of LIMIT, need more HISTORY partitions
+select * from t1 partition (p1);
+x
+12
+alter table t1 convert partition pn to table tp1;
+ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exactly one last CURRENT
+alter table t1 convert partition p1 to table tp1;
+show create table tp1;
+Table Create Table
+tp1 CREATE TABLE `tp1` (
+ `x` int(11) DEFAULT NULL,
+ `row_start` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
+ `row_end` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
+) ENGINE=X DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select * from tp1;
+x
+select * from tp1 for system_time all;
+x
+12
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL,
+ `row_start` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
+ `row_end` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
+) ENGINE=X DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY SYSTEM_TIME LIMIT 1
+(PARTITION `p0` HISTORY ENGINE = X,
+ PARTITION `p2` HISTORY ENGINE = X,
+ PARTITION `pn` CURRENT ENGINE = X)
+select * from t1 order by x;
+x
+3
+13
+23
+select * from t1 for system_time all order by x;
+x
+2
+3
+13
+22
+23
+drop tables t1, tp1;
+# System-versioned tables (SYSTEM_TIME INTERVAL)
+set timestamp= unix_timestamp('2000-01-01 00:00:00');
+create or replace table t1 (
+x int,
+row_start timestamp(6) as row start invisible,
+row_end timestamp(6) as row end invisible,
+period for system_time(row_start, row_end)
+) with system versioning
+partition by system_time interval 1 hour partitions 4;
+insert into t1 values (2), (12), (22);
+set timestamp= unix_timestamp('2000-01-01 00:00:01');
+update t1 set x= x + 1 where x = 2;
+set timestamp= unix_timestamp('2000-01-01 01:00:00');
+update t1 set x= x + 1 where x = 12;
+set timestamp= unix_timestamp('2000-01-01 02:00:00');
+update t1 set x= x + 1 where x = 22;
+select * from t1 partition (p0);
+x
+2
+select * from t1 partition (p1);
+x
+12
+select * from t1 partition (p2);
+x
+22
+alter table t1 convert partition p1 to table tp1;
+ERROR HY000: Can only drop oldest partitions when rotating by INTERVAL
+alter table t1 convert partition p0 to table tp0;
+alter table t1 convert partition p1 to table tp1;
+alter table t1 convert partition p2 to table tp2;
+ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exactly one last CURRENT
+show create table tp0;
+Table Create Table
+tp0 CREATE TABLE `tp0` (
+ `x` int(11) DEFAULT NULL,
+ `row_start` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
+ `row_end` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
+) ENGINE=X DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+show create table tp1;
+Table Create Table
+tp1 CREATE TABLE `tp1` (
+ `x` int(11) DEFAULT NULL,
+ `row_start` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
+ `row_end` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
+) ENGINE=X DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+select * from tp0;
+x
+select * from tp1;
+x
+select * from tp0 for system_time all;
+x
+2
+select * from tp1 for system_time all;
+x
+12
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL,
+ `row_start` timestamp(6) GENERATED ALWAYS AS ROW START INVISIBLE,
+ `row_end` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
+ PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
+) ENGINE=X DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR STARTS TIMESTAMP'2000-01-01 02:00:00'
+(PARTITION `p2` HISTORY ENGINE = X,
+ PARTITION `pn` CURRENT ENGINE = X)
+select * from t1;
+x
+3
+13
+23
+select * from t1 for system_time all order by x;
+x
+3
+13
+22
+23
+drop tables t1, tp0, tp1;
+# System-versioned tables (implicit)
+create or replace table t1(x int) with system versioning
+partition by system_time limit 1 partitions 3;
+alter table t1 convert partition p1 to table tp1;
+show create table tp1;
+Table Create Table
+tp1 CREATE TABLE `tp1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=X DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+ PARTITION BY SYSTEM_TIME LIMIT 1
+(PARTITION `p0` HISTORY ENGINE = X,
+ PARTITION `pn` CURRENT ENGINE = X)
+drop tables t1, tp1;
+# Complex table
+create or replace table t1 (
+x int primary key auto_increment,
+t timestamp(6) default '2001-11-11 11:11:11',
+b blob(4096) compressed null,
+c varchar(1033) character set utf8 not null,
+u int,
+unique key (x, u),
+m enum('a', 'b', 'c') not null default 'a' comment 'absolute',
+i1 tinyint, i2 smallint, i3 bigint,
+index three(i1, i2, i3),
+v1 timestamp(6) generated always as (t + interval 1 day),
+v2 timestamp(6) generated always as (t + interval 1 month) stored,
+s timestamp(6) as row start,
+e timestamp(6) as row end,
+period for system_time (s, e),
+ps date, pe date,
+period for app_time (ps, pe),
+constraint check_constr check (u > -1))
+with system versioning default charset=ucs2
+partition by range(x) (
+partition p0 values less than (10),
+partition p1 values less than (20),
+partition pn values less than maxvalue);
+alter table t1 convert partition p1 to table tp1;
+show create table tp1;
+Table Create Table
+tp1 CREATE TABLE `tp1` (
+ `x` int(11) NOT NULL AUTO_INCREMENT,
+ `t` timestamp(6) NOT NULL DEFAULT '2001-11-11 11:11:11.000000',
+ `b` blob /*!100301 COMPRESSED*/ DEFAULT NULL,
+ `c` varchar(1033) CHARACTER SET utf8mb3 NOT NULL,
+ `u` int(11) DEFAULT NULL,
+ `m` enum('a','b','c') NOT NULL DEFAULT 'a' COMMENT 'absolute',
+ `i1` tinyint(4) DEFAULT NULL,
+ `i2` smallint(6) DEFAULT NULL,
+ `i3` bigint(20) DEFAULT NULL,
+ `v1` timestamp(6) GENERATED ALWAYS AS (`t` + interval 1 day) VIRTUAL,
+ `v2` timestamp(6) GENERATED ALWAYS AS (`t` + interval 1 month) STORED,
+ `s` timestamp(6) GENERATED ALWAYS AS ROW START,
+ `e` timestamp(6) GENERATED ALWAYS AS ROW END,
+ `ps` date NOT NULL,
+ `pe` date NOT NULL,
+ PERIOD FOR `app_time` (`ps`, `pe`),
+ PRIMARY KEY (`x`,`e`),
+ UNIQUE KEY `x` (`x`,`u`,`e`),
+ KEY `three` (`i1`,`i2`,`i3`),
+ PERIOD FOR SYSTEM_TIME (`s`, `e`),
+ CONSTRAINT `check_constr` CHECK (`u` > -1)
+) ENGINE=X DEFAULT CHARSET=ucs2 WITH SYSTEM VERSIONING
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL AUTO_INCREMENT,
+ `t` timestamp(6) NOT NULL DEFAULT '2001-11-11 11:11:11.000000',
+ `b` blob /*!100301 COMPRESSED*/ DEFAULT NULL,
+ `c` varchar(1033) CHARACTER SET utf8mb3 NOT NULL,
+ `u` int(11) DEFAULT NULL,
+ `m` enum('a','b','c') NOT NULL DEFAULT 'a' COMMENT 'absolute',
+ `i1` tinyint(4) DEFAULT NULL,
+ `i2` smallint(6) DEFAULT NULL,
+ `i3` bigint(20) DEFAULT NULL,
+ `v1` timestamp(6) GENERATED ALWAYS AS (`t` + interval 1 day) VIRTUAL,
+ `v2` timestamp(6) GENERATED ALWAYS AS (`t` + interval 1 month) STORED,
+ `s` timestamp(6) GENERATED ALWAYS AS ROW START,
+ `e` timestamp(6) GENERATED ALWAYS AS ROW END,
+ `ps` date NOT NULL,
+ `pe` date NOT NULL,
+ PERIOD FOR `app_time` (`ps`, `pe`),
+ PRIMARY KEY (`x`,`e`),
+ UNIQUE KEY `x` (`x`,`u`,`e`),
+ KEY `three` (`i1`,`i2`,`i3`),
+ PERIOD FOR SYSTEM_TIME (`s`, `e`),
+ CONSTRAINT `check_constr` CHECK (`u` > -1)
+) ENGINE=X DEFAULT CHARSET=ucs2 WITH SYSTEM VERSIONING
+ PARTITION BY RANGE (`x`)
+(PARTITION `p0` VALUES LESS THAN (10) ENGINE = X,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
+drop tables t1, tp1;
+#
+# End of 10.7 tests
+#
set global innodb_stats_persistent= @save_persistent;
diff --git a/mysql-test/suite/versioning/t/alter.test b/mysql-test/suite/versioning/t/alter.test
index 0ec2f887950..76185afd523 100644
--- a/mysql-test/suite/versioning/t/alter.test
+++ b/mysql-test/suite/versioning/t/alter.test
@@ -609,7 +609,7 @@ create or replace table t1 (
period for system_time(row_start, row_end)
) with system versioning;
show create table t1;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop column b;
create or replace table t1 (
@@ -619,7 +619,7 @@ a int, b int primary key,
period for system_time(row_start, row_end)
) with system versioning;
show create table t1;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
alter table t1 drop column b;
# cleanup
diff --git a/mysql-test/suite/versioning/t/create.test b/mysql-test/suite/versioning/t/create.test
index 87cafdc7d32..6f5153b4ec1 100644
--- a/mysql-test/suite/versioning/t/create.test
+++ b/mysql-test/suite/versioning/t/create.test
@@ -412,11 +412,11 @@ drop tables t0, t1, t2, t3;
--echo #
--echo # MDEV-23968 CREATE TEMPORARY TABLE .. LIKE (system versioned table) returns error if unique index is defined in the table
--echo #
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
create table t1 (id int primary key, index(row_start)) with system versioning;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
create table t1 (id int primary key, index(row_end)) with system versioning;
---error ER_KEY_COLUMN_DOES_NOT_EXITS
+--error ER_KEY_COLUMN_DOES_NOT_EXIST
create table t1 (id int, primary key(id, row_end, row_end)) with system versioning;
create table t1 (id int primary key) with system versioning;
create temporary table t2 like t1;
diff --git a/mysql-test/suite/versioning/t/data.test b/mysql-test/suite/versioning/t/data.test
new file mode 100644
index 00000000000..4046ec609dd
--- /dev/null
+++ b/mysql-test/suite/versioning/t/data.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source suite/versioning/common.inc
+
+--echo #
+--echo # MDEV-16355 Add option for mysqldump to read data as of specific timestamp from system-versioned tables
+--echo #
+create or replace table t1 (x int) with system versioning;
+set timestamp=unix_timestamp('1990-01-01 00:00');
+insert t1 (x) values (1),(2),(3);
+set timestamp=unix_timestamp('1990-08-03 00:00');
+delete from t1 where x=1;
+set timestamp=unix_timestamp('1991-01-02 00:00');
+delete from t1 where x=2;
+set timestamp=default;
+
+--echo #MYSQL_DUMP --compact test
+--exec $MYSQL_DUMP --compact test
+--echo #MYSQL_DUMP --compact --as-of="1990-01-02 00:00" test
+--exec $MYSQL_DUMP --compact --as-of="1990-01-02 00:00" test
+--echo #MYSQL_DUMP --compact --as-of="1990-08-02 00:00" --databases test
+--exec $MYSQL_DUMP --compact --as-of="1990-08-02 00:00" --databases test
+--echo #MYSQL_DUMP --compact --as-of="1990-08-04 00:00" test t1
+--exec $MYSQL_DUMP --compact --as-of="1990-08-04 00:00" test t1
+## Forged query protection
+--echo #MYSQL_DUMP --compact --as-of="1990-08-04 00:00' where 'abc" test 2>&1
+--replace_result mysqldump.exe mysqldump
+--error 1
+--exec $MYSQL_DUMP --compact --as-of="1990-08-04 00:00' where 'abc" test 2>&1
+
+drop tables t1;
+
+--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test
index 59fe672a98e..de00bdce524 100644
--- a/mysql-test/suite/versioning/t/partition.test
+++ b/mysql-test/suite/versioning/t/partition.test
@@ -232,7 +232,7 @@ partition by system_time limit 2 partitions 3;
--replace_result $default_engine DEFAULT_ENGINE
show create table t1;
---error ER_DROP_PARTITION_NON_EXISTENT
+--error ER_PARTITION_DOES_NOT_EXIST
alter table t1 drop partition non_existent;
insert into t1 values (1), (2), (3), (4), (5), (6);
@@ -1458,6 +1458,7 @@ drop tables t1;
--echo #
--echo # MDEV-22155 ALTER add default history partitions name clash on non-default partitions
--echo #
+set timestamp= default;
create or replace table t1 (x int) with system versioning
partition by system_time limit 1
(partition p2 history, partition p8 history, partition pn current);
@@ -1477,6 +1478,209 @@ drop tables t1;
--echo # End of 10.5 tests
--echo #
+--echo #
+--echo # MDEV-22166 MIGRATE PARTITION: move out partition into a table
+--echo #
+create or replace table t1 (x int)
+with system versioning
+partition by range(x) (
+ partition p1 values less than (10),
+ partition p2 values less than (20),
+ partition p3 values less than (30),
+ partition p4 values less than (40),
+ partition p5 values less than (50),
+ partition pn values less than maxvalue);
+
+insert into t1 values (2), (12), (22), (32), (42), (52);
+update t1 set x= x + 1;
+
+alter table t1 convert partition p2 to table tp2;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table tp2;
+select * from tp2;
+select * from tp2 for system_time all order by x;
+
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 order by x;
+select * from t1 for system_time all order by x;
+
+--echo # SP
+create or replace procedure sp()
+alter table t1 convert partition p3 to table tp3;
+call sp;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table tp3;
+select * from tp3;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 order by x;
+drop table tp3;
+--error ER_PARTITION_DOES_NOT_EXIST
+call sp;
+--error ER_PARTITION_DOES_NOT_EXIST
+call sp;
+drop procedure sp;
+
+--echo # LOCK TABLES, PS, SP
+create or replace procedure sp()
+alter table t1 convert partition p4 to table tp4;
+lock tables t1 write;
+prepare stmt from 'call sp';
+execute stmt;
+
+# TODO: don't unlock here (see above TODO)
+unlock tables;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table tp4;
+select * from tp4;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 order by x;
+drop table tp4;
+lock tables t1 write;
+--error ER_PARTITION_DOES_NOT_EXIST
+execute stmt;
+--error ER_PARTITION_DOES_NOT_EXIST
+call sp;
+drop prepare stmt;
+unlock tables;
+drop procedure sp;
+unlock tables;
+
+drop tables t1, tp2;
+
+--echo # System-versioned tables (SYSTEM_TIME LIMIT)
+
+create or replace table t1 (
+ x int,
+ row_start timestamp(6) as row start invisible,
+ row_end timestamp(6) as row end invisible,
+ period for system_time(row_start, row_end)
+) with system versioning
+partition by system_time limit 1 partitions 4;
+
+insert into t1 values (2), (12), (22);
+update t1 set x= x + 1 where x = 2;
+update t1 set x= x + 1 where x = 12;
+update t1 set x= x + 1 where x = 22;
+
+select * from t1 partition (p1);
+--error ER_VERS_WRONG_PARTS
+alter table t1 convert partition pn to table tp1;
+alter table t1 convert partition p1 to table tp1;
+
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table tp1;
+select * from tp1;
+select * from tp1 for system_time all;
+
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1 order by x;
+select * from t1 for system_time all order by x;
+
+drop tables t1, tp1;
+
+--echo # System-versioned tables (SYSTEM_TIME INTERVAL)
+
+set timestamp= unix_timestamp('2000-01-01 00:00:00');
+create or replace table t1 (
+ x int,
+ row_start timestamp(6) as row start invisible,
+ row_end timestamp(6) as row end invisible,
+ period for system_time(row_start, row_end)
+) with system versioning
+partition by system_time interval 1 hour partitions 4;
+
+insert into t1 values (2), (12), (22);
+set timestamp= unix_timestamp('2000-01-01 00:00:01');
+update t1 set x= x + 1 where x = 2;
+set timestamp= unix_timestamp('2000-01-01 01:00:00');
+update t1 set x= x + 1 where x = 12;
+set timestamp= unix_timestamp('2000-01-01 02:00:00');
+update t1 set x= x + 1 where x = 22;
+
+select * from t1 partition (p0);
+select * from t1 partition (p1);
+select * from t1 partition (p2);
+--error ER_VERS_DROP_PARTITION_INTERVAL
+alter table t1 convert partition p1 to table tp1;
+alter table t1 convert partition p0 to table tp0;
+alter table t1 convert partition p1 to table tp1;
+--error ER_VERS_WRONG_PARTS
+alter table t1 convert partition p2 to table tp2;
+
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table tp0;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table tp1;
+select * from tp0;
+select * from tp1;
+select * from tp0 for system_time all;
+select * from tp1 for system_time all;
+
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+select * from t1;
+select * from t1 for system_time all order by x;
+
+drop tables t1, tp0, tp1;
+
+--echo # System-versioned tables (implicit)
+
+create or replace table t1(x int) with system versioning
+partition by system_time limit 1 partitions 3;
+
+alter table t1 convert partition p1 to table tp1;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table tp1;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+
+drop tables t1, tp1;
+
+if (!$MTR_COMBINATION_HEAP)
+{
+--echo # Complex table
+create or replace table t1 (
+ x int primary key auto_increment,
+ t timestamp(6) default '2001-11-11 11:11:11',
+ b blob(4096) compressed null,
+ c varchar(1033) character set utf8 not null,
+ u int,
+ unique key (x, u),
+ m enum('a', 'b', 'c') not null default 'a' comment 'absolute',
+ i1 tinyint, i2 smallint, i3 bigint,
+ index three(i1, i2, i3),
+ v1 timestamp(6) generated always as (t + interval 1 day),
+ v2 timestamp(6) generated always as (t + interval 1 month) stored,
+ s timestamp(6) as row start,
+ e timestamp(6) as row end,
+ period for system_time (s, e),
+ ps date, pe date,
+ period for app_time (ps, pe),
+ constraint check_constr check (u > -1))
+with system versioning default charset=ucs2
+partition by range(x) (
+ partition p0 values less than (10),
+ partition p1 values less than (20),
+ partition pn values less than maxvalue);
+
+alter table t1 convert partition p1 to table tp1;
+
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table tp1;
+--replace_result $default_engine X ' PAGE_CHECKSUM=1' ''
+show create table t1;
+
+drop tables t1, tp1;
+}
+
+--echo #
+--echo # End of 10.7 tests
+--echo #
+
set global innodb_stats_persistent= @save_persistent;
--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result
index 82c480917f1..8e1af35fd62 100644
--- a/mysql-test/suite/wsrep/r/variables.result
+++ b/mysql-test/suite/wsrep/r/variables.result
@@ -105,8 +105,6 @@ WSREP_FORCED_BINLOG_FORMAT
WSREP_GTID_DOMAIN_ID
WSREP_GTID_MODE
WSREP_GTID_SEQ_NO
-WSREP_MODE
-WSREP_STRICT_DDL
WSREP_IGNORE_APPLY_ERRORS
WSREP_LOAD_DATA_SPLITTING
WSREP_LOG_CONFLICTS
@@ -125,7 +123,6 @@ WSREP_PROVIDER
WSREP_PROVIDER_OPTIONS
WSREP_RECOVER
WSREP_REJECT_QUERIES
-WSREP_REPLICATE_MYISAM
WSREP_RESTART_SLAVE
WSREP_RETRY_AUTOCOMMIT
WSREP_SLAVE_FK_CHECKS
@@ -138,7 +135,6 @@ WSREP_SST_DONOR_REJECTS_QUERIES
WSREP_SST_METHOD
WSREP_SST_RECEIVE_ADDRESS
WSREP_START_POSITION
-WSREP_STRICT_DDL
WSREP_SYNC_WAIT
WSREP_TRX_FRAGMENT_SIZE
WSREP_TRX_FRAGMENT_UNIT
diff --git a/mysql-test/suite/wsrep/r/variables_debug.result b/mysql-test/suite/wsrep/r/variables_debug.result
index fe2bffb3f08..0690f540a37 100644
--- a/mysql-test/suite/wsrep/r/variables_debug.result
+++ b/mysql-test/suite/wsrep/r/variables_debug.result
@@ -105,11 +105,13 @@ WSREP_DRUPAL_282555_WORKAROUND
WSREP_FORCED_BINLOG_FORMAT
WSREP_GTID_DOMAIN_ID
WSREP_GTID_MODE
+WSREP_GTID_SEQ_NO
WSREP_IGNORE_APPLY_ERRORS
WSREP_LOAD_DATA_SPLITTING
WSREP_LOG_CONFLICTS
WSREP_MAX_WS_ROWS
WSREP_MAX_WS_SIZE
+WSREP_MODE
WSREP_MYSQL_REPLICATION_BUNDLE
WSREP_NODE_ADDRESS
WSREP_NODE_INCOMING_ADDRESS
@@ -122,7 +124,6 @@ WSREP_PROVIDER
WSREP_PROVIDER_OPTIONS
WSREP_RECOVER
WSREP_REJECT_QUERIES
-WSREP_REPLICATE_MYISAM
WSREP_RESTART_SLAVE
WSREP_RETRY_AUTOCOMMIT
WSREP_SLAVE_FK_CHECKS
diff --git a/mysys/array.c b/mysys/array.c
index 32606cafb23..c9bf609b6d4 100644
--- a/mysys/array.c
+++ b/mysys/array.c
@@ -41,8 +41,9 @@
*/
my_bool init_dynamic_array2(PSI_memory_key psi_key, DYNAMIC_ARRAY *array,
- uint element_size, void *init_buffer,
- uint init_alloc, uint alloc_increment, myf my_flags)
+ size_t element_size, void *init_buffer,
+ size_t init_alloc, size_t alloc_increment,
+ myf my_flags)
{
DBUG_ENTER("init_dynamic_array2");
if (!alloc_increment)
@@ -198,7 +199,7 @@ void *pop_dynamic(DYNAMIC_ARRAY *array)
FALSE Ok
*/
-my_bool set_dynamic(DYNAMIC_ARRAY *array, const void *element, uint idx)
+my_bool set_dynamic(DYNAMIC_ARRAY *array, const void *element, size_t idx)
{
if (idx >= array->elements)
{
@@ -209,7 +210,7 @@ my_bool set_dynamic(DYNAMIC_ARRAY *array, const void *element, uint idx)
array->elements=idx+1;
}
memcpy(array->buffer+(idx * array->size_of_element),element,
- (size_t) array->size_of_element);
+ array->size_of_element);
return FALSE;
}
@@ -230,13 +231,13 @@ my_bool set_dynamic(DYNAMIC_ARRAY *array, const void *element, uint idx)
TRUE Allocation of new memory failed
*/
-my_bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements)
+my_bool allocate_dynamic(DYNAMIC_ARRAY *array, size_t max_elements)
{
DBUG_ENTER("allocate_dynamic");
if (max_elements >= array->max_element)
{
- uint size;
+ size_t size;
uchar *new_ptr;
size= (max_elements + array->alloc_increment)/array->alloc_increment;
size*= array->alloc_increment;
@@ -277,7 +278,7 @@ my_bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements)
idx Index of element wanted.
*/
-void get_dynamic(DYNAMIC_ARRAY *array, void *element, uint idx)
+void get_dynamic(DYNAMIC_ARRAY *array, void *element, size_t idx)
{
if (idx >= array->elements)
{
@@ -320,7 +321,7 @@ void delete_dynamic(DYNAMIC_ARRAY *array)
idx Index of element to be deleted
*/
-void delete_dynamic_element(DYNAMIC_ARRAY *array, uint idx)
+void delete_dynamic_element(DYNAMIC_ARRAY *array, size_t idx)
{
char *ptr= (char*) array->buffer+array->size_of_element*idx;
array->elements--;
@@ -339,7 +340,7 @@ void delete_dynamic_element(DYNAMIC_ARRAY *array, uint idx)
deleting the array;
*/
void delete_dynamic_with_callback(DYNAMIC_ARRAY *array, FREE_FUNC f) {
- uint i;
+ size_t i;
char *ptr= (char*) array->buffer;
for (i= 0; i < array->elements; i++, ptr+= array->size_of_element) {
f(ptr);
@@ -357,7 +358,7 @@ void delete_dynamic_with_callback(DYNAMIC_ARRAY *array, FREE_FUNC f) {
void freeze_size(DYNAMIC_ARRAY *array)
{
- uint elements;
+ size_t elements;
/*
Do nothing if we are using a static buffer
diff --git a/mysys/hash.c b/mysys/hash.c
index abc11b42500..d9132b28cd7 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -76,8 +76,8 @@ my_hash_value_type my_hash_sort(CHARSET_INFO *cs, const uchar *key,
@retval 1 failure
*/
my_bool
-my_hash_init2(PSI_memory_key psi_key, HASH *hash, uint growth_size,
- CHARSET_INFO *charset, ulong size, size_t key_offset,
+my_hash_init2(PSI_memory_key psi_key, HASH *hash, size_t growth_size,
+ CHARSET_INFO *charset, size_t size, size_t key_offset,
size_t key_length, my_hash_get_key get_key,
my_hash_function hash_function,
void (*free_element)(void*), uint flags)
@@ -282,6 +282,8 @@ uchar* my_hash_first_from_hash_value(const HASH *hash,
uint flag= 1;
uint idx= my_hash_mask(hash_value,
hash->blength, hash->records);
+ if (!length)
+ length= hash->key_length; // length for fixed length keys or 0
do
{
pos= dynamic_element(&hash->array,idx,HASH_LINK*);
@@ -316,6 +318,8 @@ uchar* my_hash_next(const HASH *hash, const uchar *key, size_t length,
if (*current_record != NO_RECORD)
{
HASH_LINK *data=dynamic_element(&hash->array,0,HASH_LINK*);
+ if (!length)
+ length= hash->key_length; // length for fixed length keys or 0
for (idx=data[*current_record].next; idx != NO_RECORD ; idx=pos->next)
{
pos=data+idx;
@@ -356,8 +360,11 @@ static void movelink(HASH_LINK *array,uint find,uint next_link,uint newlink)
length length of key
NOTES:
- If length is 0, comparison is done using the length of the
- record being compared against.
+ length equal 0 can mean 2 things:
+ 1) it is fixed key length hash (HASH::key_length != 0) and
+ default length should be taken in this case
+ 2) it is really 0 length key for variable key length hash
+ (HASH::key_length == 0)
RETURN
= 0 key of record == key
@@ -368,10 +375,11 @@ static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key,
size_t length)
{
size_t rec_keylength;
- uchar *rec_key= (uchar*) my_hash_key(hash, pos->data, &rec_keylength, 1);
- return ((length && length != rec_keylength) ||
+ uchar *rec_key;
+ rec_key= (uchar*) my_hash_key(hash, pos->data, &rec_keylength, 1);
+ return (length != rec_keylength) ||
my_strnncoll(hash->charset, (uchar*) rec_key, rec_keylength,
- (uchar*) key, rec_keylength));
+ (uchar*) key, rec_keylength);
}
diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c
index 3e0b774b0c7..9f230b6bbcb 100644
--- a/mysys/my_alloc.c
+++ b/mysys/my_alloc.c
@@ -20,15 +20,101 @@
#include <my_global.h>
#include <my_sys.h>
#include <m_string.h>
+#include <my_bit.h>
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
#undef EXTRA_DEBUG
#define EXTRA_DEBUG
/* data packed in MEM_ROOT -> min_malloc */
-#define MALLOC_FLAG(A) ((A & 1) ? MY_THREAD_SPECIFIC : 0)
+/* Don't allocate too small blocks */
+#define ROOT_MIN_BLOCK_SIZE 256
+
+/* bits in MEM_ROOT->flags */
+#define ROOT_FLAG_THREAD_SPECIFIC 1
+#define ROOT_FLAG_MPROTECT 2
+
+#define MALLOC_FLAG(R) MYF((R)->flags & ROOT_FLAG_THREAD_SPECIFIC ? THREAD_SPECIFIC : 0)
#define TRASH_MEM(X) TRASH_FREE(((char*)(X) + ((X)->size-(X)->left)), (X)->left)
+
+/*
+ Alloc memory through either my_malloc or mmap()
+*/
+
+static void *root_alloc(MEM_ROOT *root, size_t size, size_t *alloced_size,
+ myf my_flags)
+{
+ *alloced_size= size;
+#if defined(HAVE_MMAP) && defined(HAVE_MPROTECT) && defined(MAP_ANONYMOUS)
+ if (root->flags & ROOT_FLAG_MPROTECT)
+ {
+ void *res;
+ *alloced_size= MY_ALIGN(size, my_system_page_size);
+ res= my_mmap(0, *alloced_size, PROT_READ | PROT_WRITE,
+ MAP_NORESERVE | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ if (res == MAP_FAILED)
+ res= 0;
+ return res;
+ }
+#endif /* HAVE_MMAP */
+
+ return my_malloc(root->psi_key, size,
+ my_flags | MYF(root->flags & ROOT_FLAG_THREAD_SPECIFIC ?
+ MY_THREAD_SPECIFIC : 0));
+}
+
+static void root_free(MEM_ROOT *root, void *ptr, size_t size)
+{
+#if defined(HAVE_MMAP) && defined(HAVE_MPROTECT) && defined(MAP_ANONYMOUS)
+ if (root->flags & ROOT_FLAG_MPROTECT)
+ my_munmap(ptr, size);
+ else
+#endif
+ my_free(ptr);
+}
+
+
+/*
+ Calculate block sizes to use
+
+ Sizes will be updated to next power of 2, minus operating system
+ memory management size.
+
+ The idea is to reduce memory fragmentation as most system memory
+ allocators are using power of 2 block size internally.
+*/
+
+static void calculate_block_sizes(MEM_ROOT *mem_root, size_t block_size,
+ size_t *pre_alloc_size)
+{
+ size_t pre_alloc= *pre_alloc_size;
+
+ if (mem_root->flags&= ROOT_FLAG_MPROTECT)
+ {
+ mem_root->block_size= MY_ALIGN(block_size, my_system_page_size);
+ if (pre_alloc)
+ pre_alloc= MY_ALIGN(pre_alloc, my_system_page_size);
+ }
+ else
+ {
+ DBUG_ASSERT(block_size <= UINT_MAX32);
+ mem_root->block_size= (my_round_up_to_next_power((uint32) block_size -
+ MALLOC_OVERHEAD)-
+ MALLOC_OVERHEAD);
+ if (pre_alloc)
+ pre_alloc= (my_round_up_to_next_power((uint32) pre_alloc -
+ MALLOC_OVERHEAD)-
+ MALLOC_OVERHEAD);
+ }
+ *pre_alloc_size= pre_alloc;
+}
+
+
/*
Initialize memory root
@@ -36,13 +122,18 @@
init_alloc_root()
mem_root - memory root to initialize
name - name of memroot (for debugging)
- block_size - size of chunks (blocks) used for memory allocation
+ block_size - size of chunks (blocks) used for memory allocation.
+ Will be updated to next power of 2, minus
+ internal and system memory management size. This is
+ will reduce memory fragmentation as most system memory
+ allocators are using power of 2 block size internally.
(It is external size of chunk i.e. it should include
memory required for internal structures, thus it
- should be no less than ALLOC_ROOT_MIN_BLOCK_SIZE)
+ should be no less than ROOT_MIN_BLOCK_SIZE).
pre_alloc_size - if non-0, then size of block that should be
pre-allocated during memory root initialization.
my_flags MY_THREAD_SPECIFIC flag for my_malloc
+ MY_RROOT_USE_MPROTECT for read only protected memory
DESCRIPTION
This function prepares memory root for further use, sets initial size of
@@ -50,9 +141,6 @@
Although error can happen during execution of this function if
pre_alloc_size is non-0 it won't be reported. Instead it will be
reported as error in first alloc_root() on this memory root.
-
- We don't want to change the structure size for MEM_ROOT.
- Because of this, we store in MY_THREAD_SPECIFIC as bit 1 in block_size
*/
void init_alloc_root(PSI_memory_key key, MEM_ROOT *mem_root, size_t block_size,
@@ -63,25 +151,31 @@ void init_alloc_root(PSI_memory_key key, MEM_ROOT *mem_root, size_t block_size,
DBUG_PRINT("enter",("root: %p prealloc: %zu", mem_root, pre_alloc_size));
mem_root->free= mem_root->used= mem_root->pre_alloc= 0;
- mem_root->min_malloc= 32;
- mem_root->block_size= (block_size - ALLOC_ROOT_MIN_BLOCK_SIZE) & ~1;
+ mem_root->min_malloc= 32 + REDZONE_SIZE;
+ mem_root->block_size= MY_MAX(block_size, ROOT_MIN_BLOCK_SIZE);
+ mem_root->flags= 0;
if (my_flags & MY_THREAD_SPECIFIC)
- mem_root->block_size|= 1;
+ mem_root->flags|= ROOT_FLAG_THREAD_SPECIFIC;
+ if (my_flags & MY_ROOT_USE_MPROTECT)
+ mem_root->flags|= ROOT_FLAG_MPROTECT;
+
+ calculate_block_sizes(mem_root, block_size, &pre_alloc_size);
mem_root->error_handler= 0;
mem_root->block_num= 4; /* We shift this with >>2 */
mem_root->first_block_usage= 0;
- mem_root->m_psi_key= key;
+ mem_root->psi_key= key;
#if !(defined(HAVE_valgrind) && defined(EXTRA_DEBUG))
if (pre_alloc_size)
{
- size_t size= pre_alloc_size + ALIGN_SIZE(sizeof(USED_MEM));
+ size_t alloced_size;
if ((mem_root->free= mem_root->pre_alloc=
- (USED_MEM*) my_malloc(key, size, MYF(my_flags))))
+ (USED_MEM*) root_alloc(mem_root, pre_alloc_size, &alloced_size,
+ MYF(0))))
{
- mem_root->free->size= size;
- mem_root->free->left= pre_alloc_size;
+ mem_root->free->size= alloced_size;
+ mem_root->free->left= alloced_size - ALIGN_SIZE(sizeof(USED_MEM));
mem_root->free->next= 0;
TRASH_MEM(mem_root->free);
}
@@ -113,13 +207,14 @@ void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
DBUG_ENTER("reset_root_defaults");
DBUG_ASSERT(alloc_root_inited(mem_root));
- mem_root->block_size= (((block_size - ALLOC_ROOT_MIN_BLOCK_SIZE) & ~1) |
- (mem_root->block_size & 1));
+ calculate_block_sizes(mem_root, block_size, &pre_alloc_size);
+
#if !(defined(HAVE_valgrind) && defined(EXTRA_DEBUG))
if (pre_alloc_size)
{
- size_t size= pre_alloc_size + ALIGN_SIZE(sizeof(USED_MEM));
- if (!mem_root->pre_alloc || mem_root->pre_alloc->size != size)
+ size_t size= mem_root->block_size, alloced_size;
+ if (!mem_root->pre_alloc ||
+ mem_root->pre_alloc->size != mem_root->block_size)
{
USED_MEM *mem, **prev= &mem_root->free;
/*
@@ -139,26 +234,23 @@ void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
{
/* remove block from the list and free it */
*prev= mem->next;
- my_free(mem);
+ root_free(mem_root, mem, mem->size);
}
else
prev= &mem->next;
}
/* Allocate new prealloc block and add it to the end of free list */
- if ((mem= (USED_MEM *) my_malloc(mem_root->m_psi_key, size,
- MYF(MALLOC_FLAG(mem_root->
- block_size)))))
+ if ((mem= (USED_MEM *) root_alloc(mem_root, size, &alloced_size,
+ MYF(MY_WME))))
{
- mem->size= size;
- mem->left= pre_alloc_size;
+ mem->size= alloced_size;
+ mem->left= alloced_size - ALIGN_SIZE(sizeof(USED_MEM));
mem->next= *prev;
*prev= mem_root->pre_alloc= mem;
TRASH_MEM(mem);
}
else
- {
mem_root->pre_alloc= 0;
- }
}
}
else
@@ -171,37 +263,6 @@ void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
void *alloc_root(MEM_ROOT *mem_root, size_t length)
{
-#if defined(HAVE_valgrind) && defined(EXTRA_DEBUG)
- reg1 USED_MEM *next;
- DBUG_ENTER("alloc_root");
- DBUG_PRINT("enter",("root: %p", mem_root));
-
- DBUG_ASSERT(alloc_root_inited(mem_root));
-
- DBUG_EXECUTE_IF("simulate_out_of_memory",
- {
- if (mem_root->error_handler)
- (*mem_root->error_handler)();
- DBUG_SET("-d,simulate_out_of_memory");
- DBUG_RETURN((void*) 0); /* purecov: inspected */
- });
-
- length+=ALIGN_SIZE(sizeof(USED_MEM));
- if (!(next = (USED_MEM*) my_malloc(mem_root->m_psi_key, length,
- MYF(MY_WME | ME_FATAL |
- MALLOC_FLAG(mem_root->block_size)))))
- {
- if (mem_root->error_handler)
- (*mem_root->error_handler)();
- DBUG_RETURN((uchar*) 0); /* purecov: inspected */
- }
- next->next= mem_root->used;
- next->left= 0;
- next->size= length;
- mem_root->used= next;
- DBUG_PRINT("exit",("ptr: %p", (((char*)next)+ALIGN_SIZE(sizeof(USED_MEM)))));
- DBUG_RETURN((((uchar*) next)+ALIGN_SIZE(sizeof(USED_MEM))));
-#else
size_t get_size, block_size;
uchar* point;
reg1 USED_MEM *next= 0;
@@ -212,13 +273,36 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length)
DBUG_ASSERT(alloc_root_inited(mem_root));
DBUG_EXECUTE_IF("simulate_out_of_memory",
- {
- /* Avoid reusing an already allocated block */
- if (mem_root->error_handler)
- (*mem_root->error_handler)();
- DBUG_SET("-d,simulate_out_of_memory");
- DBUG_RETURN((void*) 0); /* purecov: inspected */
- });
+ {
+ if (mem_root->error_handler)
+ (*mem_root->error_handler)();
+ DBUG_SET("-d,simulate_out_of_memory");
+ DBUG_RETURN((void*) 0); /* purecov: inspected */
+ });
+
+#if defined(HAVE_valgrind) && defined(EXTRA_DEBUG)
+ if (!(mem_root->flags & ROOT_FLAG_MPROTECT))
+ {
+ length+= ALIGN_SIZE(sizeof(USED_MEM));
+ if (!(next = (USED_MEM*) my_malloc(mem_root->psi_key, length,
+ MYF(MY_WME | ME_FATAL |
+ (mem_root->flags &
+ ROOT_FLAG_THREAD_SPECIFIC ?
+ MY_THREAD_SPECIFIC : 0)))))
+ {
+ if (mem_root->error_handler)
+ (*mem_root->error_handler)();
+ DBUG_RETURN((uchar*) 0); /* purecov: inspected */
+ }
+ next->next= mem_root->used;
+ next->left= 0;
+ next->size= length;
+ mem_root->used= next;
+ DBUG_PRINT("exit",("ptr: %p", (((char*)next)+ALIGN_SIZE(sizeof(USED_MEM)))));
+ DBUG_RETURN((((uchar*) next)+ALIGN_SIZE(sizeof(USED_MEM))));
+ }
+#endif /* defined(HAVE_valgrind) && defined(EXTRA_DEBUG) */
+
length= ALIGN_SIZE(length) + REDZONE_SIZE;
if ((*(prev= &mem_root->free)) != NULL)
{
@@ -237,14 +321,16 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length)
}
if (! next)
{ /* Time to alloc new block */
- block_size= (mem_root->block_size & ~1) * (mem_root->block_num >> 2);
- get_size= length+ALIGN_SIZE(sizeof(USED_MEM));
+ size_t alloced_length;
+
+ /* Increase block size over time if there is a lot of mallocs */
+ block_size= (MY_ALIGN(mem_root->block_size, ROOT_MIN_BLOCK_SIZE) *
+ (mem_root->block_num >> 2)- MALLOC_OVERHEAD);
+ get_size= length + ALIGN_SIZE(sizeof(USED_MEM));
get_size= MY_MAX(get_size, block_size);
- if (!(next = (USED_MEM*) my_malloc(mem_root->m_psi_key, get_size,
- MYF(MY_WME | ME_FATAL |
- MALLOC_FLAG(mem_root->
- block_size)))))
+ if (!(next= (USED_MEM*) root_alloc(mem_root, get_size, &alloced_length,
+ MYF(MY_WME | ME_FATAL))))
{
if (mem_root->error_handler)
(*mem_root->error_handler)();
@@ -252,8 +338,8 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length)
}
mem_root->block_num++;
next->next= *prev;
- next->size= get_size;
- next->left= get_size-ALIGN_SIZE(sizeof(USED_MEM));
+ next->size= alloced_length;
+ next->left= alloced_length - ALIGN_SIZE(sizeof(USED_MEM));
*prev=next;
TRASH_MEM(next);
}
@@ -271,7 +357,6 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length)
TRASH_ALLOC(point, original_length);
DBUG_PRINT("exit",("ptr: %p", point));
DBUG_RETURN((void*) point);
-#endif
}
@@ -407,13 +492,13 @@ void free_root(MEM_ROOT *root, myf MyFlags)
{
old=next; next= next->next ;
if (old != root->pre_alloc)
- my_free(old);
+ root_free(root, old, old->size);
}
for (next=root->free ; next ;)
{
old=next; next= next->next;
if (old != root->pre_alloc)
- my_free(old);
+ root_free(root, old, old->size);
}
root->used=root->free=0;
if (root->pre_alloc)
@@ -428,6 +513,7 @@ void free_root(MEM_ROOT *root, myf MyFlags)
DBUG_VOID_RETURN;
}
+
/*
Find block that contains an object and set the pre_alloc to it
*/
@@ -454,6 +540,38 @@ void set_prealloc_root(MEM_ROOT *root, char *ptr)
}
+/**
+ Change protection for all blocks in the mem root
+*/
+
+#if defined(HAVE_MMAP) && defined(HAVE_MPROTECT) && defined(MAP_ANONYMOUS)
+void protect_root(MEM_ROOT *root, int prot)
+{
+ reg1 USED_MEM *next,*old;
+ DBUG_ENTER("protect_root");
+ DBUG_PRINT("enter",("root: %p prot: %d", root, prot));
+
+ DBUG_ASSERT(root->flags & ROOT_FLAG_MPROTECT);
+
+ for (next= root->used; next ;)
+ {
+ old= next; next= next->next ;
+ mprotect(old, old->size, prot);
+ }
+ for (next= root->free; next ;)
+ {
+ old= next; next= next->next ;
+ mprotect(old, old->size, prot);
+ }
+ DBUG_VOID_RETURN;
+}
+#else
+void protect_root(MEM_ROOT *root, int prot)
+{
+}
+#endif /* defined(HAVE_MMAP) && ... */
+
+
char *strdup_root(MEM_ROOT *root, const char *str)
{
return strmake_root(root, str, strlen(str));
diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c
index bf2bacd213c..9893c7e4a58 100644
--- a/mysys/my_bitmap.c
+++ b/mysys/my_bitmap.c
@@ -123,19 +123,6 @@ static inline my_bitmap_map last_word_mask(uint bit)
}
-static inline void bitmap_lock(MY_BITMAP *map __attribute__((unused)))
-{
- if (map->mutex)
- mysql_mutex_lock(map->mutex);
-}
-
-static inline void bitmap_unlock(MY_BITMAP *map __attribute__((unused)))
-{
- if (map->mutex)
- mysql_mutex_unlock(map->mutex);
-}
-
-
static inline uint get_first_set(my_bitmap_map value, uint word_pos)
{
uchar *byte_ptr= (uchar*)&value;
@@ -159,32 +146,15 @@ static inline uint get_first_set(my_bitmap_map value, uint word_pos)
Initialize a bitmap object. All bits will be set to zero
*/
-my_bool my_bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
- my_bool thread_safe)
+my_bool my_bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits)
{
DBUG_ENTER("my_bitmap_init");
- map->mutex= 0;
if (!buf)
{
uint size_in_bytes= bitmap_buffer_size(n_bits);
- uint extra= 0;
- if (thread_safe)
- {
- size_in_bytes= ALIGN_SIZE(size_in_bytes);
- extra= sizeof(mysql_mutex_t);
- }
if (!(buf= (my_bitmap_map*) my_malloc(key_memory_MY_BITMAP_bitmap,
- size_in_bytes+extra, MYF(MY_WME))))
+ size_in_bytes, MYF(MY_WME))))
DBUG_RETURN(1);
- if (thread_safe)
- {
- map->mutex= (mysql_mutex_t *) ((char*) buf + size_in_bytes);
- mysql_mutex_init(key_BITMAP_mutex, map->mutex, MY_MUTEX_INIT_FAST);
- }
- }
- else
- {
- DBUG_ASSERT(thread_safe == 0);
}
map->bitmap= buf;
@@ -200,8 +170,6 @@ void my_bitmap_free(MY_BITMAP *map)
DBUG_ENTER("my_bitmap_free");
if (map->bitmap)
{
- if (map->mutex)
- mysql_mutex_destroy(map->mutex);
my_free(map->bitmap);
map->bitmap=0;
}
@@ -247,13 +215,9 @@ my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit)
my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit)
{
- my_bool res;
DBUG_ASSERT(map->bitmap);
DBUG_ASSERT(bitmap_bit < map->n_bits);
- bitmap_lock(map);
- res= bitmap_fast_test_and_set(map, bitmap_bit);
- bitmap_unlock(map);
- return res;
+ return bitmap_fast_test_and_set(map, bitmap_bit);
}
/*
@@ -281,13 +245,9 @@ my_bool bitmap_fast_test_and_clear(MY_BITMAP *map, uint bitmap_bit)
my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit)
{
- my_bool res;
DBUG_ASSERT(map->bitmap);
DBUG_ASSERT(bitmap_bit < map->n_bits);
- bitmap_lock(map);
- res= bitmap_fast_test_and_clear(map, bitmap_bit);
- bitmap_unlock(map);
- return res;
+ return bitmap_fast_test_and_clear(map, bitmap_bit);
}
@@ -733,24 +693,3 @@ found:
DBUG_ASSERT(0);
return MY_BIT_NONE; /* Impossible */
}
-
-
-uint bitmap_lock_set_next(MY_BITMAP *map)
-{
- uint bit_found;
- bitmap_lock(map);
- bit_found= bitmap_set_next(map);
- bitmap_unlock(map);
- return bit_found;
-}
-
-
-void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit)
-{
- bitmap_lock(map);
- DBUG_ASSERT(map->bitmap);
- DBUG_ASSERT(bitmap_bit < map->n_bits);
- bitmap_clear_bit(map, bitmap_bit);
- bitmap_unlock(map);
-}
-
diff --git a/mysys/my_default.c b/mysys/my_default.c
index cc4462a240b..ae576f7a058 100644
--- a/mysys/my_default.c
+++ b/mysys/my_default.c
@@ -466,7 +466,7 @@ int my_load_defaults(const char *conf_file, const char **groups, int *argc,
if (*argc)
memcpy(res + args.elements, *argv, *argc * sizeof(char*));
- (*argc)+= args.elements;
+ (*argc)+= (int)args.elements;
*argv= res;
(*argv)[*argc]= 0;
*(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */
@@ -602,7 +602,7 @@ static int search_default_file_with_ext(struct handle_option_ctx *ctx,
MYSQL_FILE *fp;
uint line=0;
enum { NONE, PARSE, SKIP } found_group= NONE;
- uint i;
+ size_t i;
MY_DIR *search_dir;
FILEINFO *search_file;
@@ -690,7 +690,7 @@ static int search_default_file_with_ext(struct handle_option_ctx *ctx,
if (!(search_dir= my_dir(ptr, MYF(MY_WME | MY_WANT_SORT))))
goto err;
- for (i= 0; i < (uint) search_dir->number_of_files; i++)
+ for (i= 0; i < search_dir->number_of_files; i++)
{
search_file= search_dir->dir_entry + i;
ext= fn_ext2(search_file->name);
diff --git a/mysys/my_delete.c b/mysys/my_delete.c
index d322f302ea7..25c0f4657af 100644
--- a/mysys/my_delete.c
+++ b/mysys/my_delete.c
@@ -193,7 +193,7 @@ int my_rmtree(const char *dir, myf MyFlags)
char path[FN_REFLEN];
char sep[] = { FN_LIBCHAR, 0 };
int err = 0;
- uint i;
+ size_t i;
MY_DIR *dir_info = my_dir(dir, MYF(MY_DONT_SORT | MY_WANT_STAT));
if (!dir_info)
diff --git a/mysys/my_init.c b/mysys/my_init.c
index 2b420da03be..d201d45a4ee 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -22,6 +22,9 @@
#include <m_ctype.h>
#include <signal.h>
#include <mysql/psi/mysql_stage.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#ifdef _WIN32
#ifdef _MSC_VER
#include <locale.h>
@@ -35,6 +38,10 @@ static my_bool win32_init_tcp_ip();
#define my_win_init()
#endif
+#if defined(_SC_PAGE_SIZE) && !defined(_SC_PAGESIZE)
+#define _SC_PAGESIZE _SC_PAGE_SIZE
+#endif
+
extern pthread_key(struct st_my_thread_var*, THR_KEY_mysys);
#define SCALE_SEC 100
@@ -42,6 +49,7 @@ extern pthread_key(struct st_my_thread_var*, THR_KEY_mysys);
my_bool my_init_done= 0;
uint mysys_usage_id= 0; /* Incremented for each my_init() */
+size_t my_system_page_size= 8192; /* Default if no sysconf() */
ulonglong my_thread_stack_size= (sizeof(void*) <= 4)? 65536: ((256-16)*1024);
@@ -79,6 +87,9 @@ my_bool my_init(void)
my_umask= 0660; /* Default umask for new files */
my_umask_dir= 0700; /* Default umask for new directories */
my_global_flags= 0;
+#ifdef _SC_PAGESIZE
+ my_system_page_size= sysconf(_SC_PAGESIZE);
+#endif
/* Default creation of new files */
if ((str= getenv("UMASK")) != 0)
diff --git a/mysys/my_lockmem.c b/mysys/my_lockmem.c
index e159502a278..a3ad7a5b76c 100644
--- a/mysys/my_lockmem.c
+++ b/mysys/my_lockmem.c
@@ -13,7 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
-/* Alloc a block of locked memory */
+/* Alloc a block of locked memory (memory protected against swap) */
#include "mysys_priv.h"
#include "mysys_err.h"
@@ -33,7 +33,7 @@ LIST *mem_list;
uchar *my_malloc_lock(uint size,myf MyFlags)
{
int success;
- uint pagesize=sysconf(_SC_PAGESIZE);
+ uint pagesize= my_system_page_size;
uchar *ptr;
struct st_mem_list *element;
DBUG_ENTER("my_malloc_lock");
diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c
index befdcb0e5c3..b2cbb84984d 100644
--- a/mysys/my_malloc.c
+++ b/mysys/my_malloc.c
@@ -84,7 +84,7 @@ void *my_malloc(PSI_memory_key key, size_t size, myf my_flags)
/* We have to align size as we store MY_THREAD_SPECIFIC flag in the LSB */
size= ALIGN_SIZE(size);
- if (DBUG_EVALUATE_IF("simulate_out_of_memory", 1, 0))
+ if (DBUG_IF("simulate_out_of_memory"))
mh= NULL;
else
mh= (my_memory_header*) sf_malloc(size + HEADER_SIZE, my_flags);
diff --git a/mysys/my_uuid.c b/mysys/my_uuid.c
index 72c8fa8507d..7925f80191b 100644
--- a/mysys/my_uuid.c
+++ b/mysys/my_uuid.c
@@ -216,37 +216,6 @@ void my_uuid(uchar *to)
}
-/**
- Convert uuid to string representation
-
- @func my_uuid2str()
- @param guid uuid
- @param s Output buffer.Must be at least MY_UUID_STRING_LENGTH+1 large.
-*/
-void my_uuid2str(const uchar *guid, char *s)
-{
- int i;
- for (i=0; i < MY_UUID_SIZE; i++)
- {
- *s++= _dig_vec_lower[guid[i] >>4];
- *s++= _dig_vec_lower[guid[i] & 15];
- /* Set '-' at intervals 3, 5, 7 and 9 */
- if ((1 << i) & ((1 << 3) | (1 << 5) | (1 << 7) | (1 << 9)))
- *s++= '-';
- }
-}
-
-void my_uuid2str_oracle(const uchar *guid, char *s)
-{
- int i;
- for (i=0; i < MY_UUID_SIZE; i++)
- {
- *s++= _dig_vec_upper[guid[i] >>4];
- *s++= _dig_vec_upper[guid[i] & 15];
- }
-}
-
-
void my_uuid_end()
{
if (my_uuid_inited)
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index dd3a5ce132f..aca1c1f7731 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -332,7 +332,8 @@ int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file,
*/
pthread_mutex_lock(&THR_LOCK_mutex);
- if (!my_hash_search(mutex_root->locked_mutex, (uchar*) &mp->id, 0))
+ if (!my_hash_search(mutex_root->locked_mutex, (uchar*) &mp->id,
+ sizeof(mp->id)))
{
safe_mutex_deadlock_t *deadlock;
safe_mutex_t *mutex;
@@ -352,7 +353,8 @@ int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file,
mutex= mutex_root;
do
{
- if (my_hash_search(mp->locked_mutex, (uchar*) &mutex->id, 0))
+ if (my_hash_search(mp->locked_mutex, (uchar*) &mutex->id,
+ sizeof(mutex->id)))
{
print_deadlock_warning(mp, mutex);
/* Mark wrong usage to avoid future warnings for same error */
@@ -772,7 +774,8 @@ static my_bool remove_from_locked_mutex(safe_mutex_t *mp,
delete_mutex->id, mp->id));
found= (safe_mutex_deadlock_t *) my_hash_search(mp->locked_mutex,
- (uchar*) &delete_mutex->id, 0);
+ (uchar*) &delete_mutex->id,
+ sizeof(delete_mutex->id));
DBUG_ASSERT(found);
if (found)
{
diff --git a/mysys/waiting_threads.c b/mysys/waiting_threads.c
index dd60088d534..a03f8da3009 100644
--- a/mysys/waiting_threads.c
+++ b/mysys/waiting_threads.c
@@ -598,7 +598,7 @@ static int deadlock_search(struct deadlock_arg *arg, WT_THD *blocker,
{
WT_RESOURCE *rc, *volatile *shared_ptr= &blocker->waiting_for;
WT_THD *cursor;
- uint i;
+ size_t i;
int ret= WT_OK;
DBUG_ENTER("deadlock_search");
DBUG_PRINT("wt", ("enter: thd=%s, blocker=%s, depth=%u",
diff --git a/plugin/auth_pam/auth_pam.c b/plugin/auth_pam/auth_pam.c
index d232b3b5c65..ffcfa019294 100644
--- a/plugin/auth_pam/auth_pam.c
+++ b/plugin/auth_pam/auth_pam.c
@@ -15,6 +15,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
+#include <my_global.h>
#include <config_auth_pam.h>
#include <unistd.h>
#include <string.h>
@@ -23,7 +24,6 @@
#include <spawn.h>
#include <mysql/plugin_auth.h>
#include "auth_pam_tool.h"
-#include <my_global.h>
#ifndef DBUG_OFF
static char pam_debug = 0;
diff --git a/plugin/cracklib_password_check/cracklib_password_check.c b/plugin/cracklib_password_check/cracklib_password_check.c
index 20294b070e7..95f8e11fe0e 100644
--- a/plugin/cracklib_password_check/cracklib_password_check.c
+++ b/plugin/cracklib_password_check/cracklib_password_check.c
@@ -22,18 +22,21 @@
static char *dictionary;
static int crackme(const MYSQL_CONST_LEX_STRING *username,
- const MYSQL_CONST_LEX_STRING *password)
+ const MYSQL_CONST_LEX_STRING *password,
+ const MYSQL_CONST_LEX_STRING *hostname)
{
char *user= alloca(username->length + 1);
- char *host;
+ char *full_name= alloca(hostname->length + username->length + 2);
const char *res;
memcpy(user, username->str, username->length);
user[username->length]= 0;
- if ((host= strchr(user, '@')))
- *host++= 0;
+ memcpy(full_name, username->str, username->length);
+ full_name[username->length]= '@';
+ memcpy(full_name + username->length + 1, hostname->str, hostname->length);
+ full_name[hostname->length+ username->length + 1]= 0;
- if ((res= FascistCheckUser(password->str, dictionary, user, host)))
+ if ((res= FascistCheckUser(password->str, dictionary, user, full_name)))
{
my_printf_error(ER_NOT_VALID_PASSWORD, "cracklib: %s",
ME_WARNING, res);
diff --git a/plugin/password_reuse_check/CMakeLists.txt b/plugin/password_reuse_check/CMakeLists.txt
new file mode 100644
index 00000000000..b9175eb9f74
--- /dev/null
+++ b/plugin/password_reuse_check/CMakeLists.txt
@@ -0,0 +1,2 @@
+
+MYSQL_ADD_PLUGIN(password_reuse_check password_reuse_check.c)
diff --git a/plugin/password_reuse_check/password_reuse_check.c b/plugin/password_reuse_check/password_reuse_check.c
new file mode 100644
index 00000000000..ff0364ce007
--- /dev/null
+++ b/plugin/password_reuse_check/password_reuse_check.c
@@ -0,0 +1,241 @@
+/* Copyright (c) 2021, Oleksandr Byelkin and MariaDB
+
+ 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.
+
+ 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.
+
+ 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-1335 USA */
+
+#include <stdio.h> // for snprintf
+#include <string.h> // for memset
+#include <mysql/plugin_password_validation.h>
+#include <mysqld_error.h>
+
+#define HISTORY_DB_NAME "password_reuse_check_history"
+
+#define SQL_BUFF_LEN 2048
+
+#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1))
+
+// 0 - unlimited, otherwise number of days to check
+static unsigned interval= 0;
+
+// helping string for bin_to_hex512
+static char digits[]= "0123456789ABCDEF";
+
+
+/**
+ Convert string of 512 bits (64 bytes) to hex representation
+
+ @param to pointer to the result puffer
+ (should be at least 64*2 bytes)
+ @param str pointer to 512 bits (64 bytes string)
+*/
+
+static void bin_to_hex512(char *to, const unsigned char *str)
+{
+ const unsigned char *str_end= str + (512/8);
+ for (; str != str_end; ++str)
+ {
+ *to++= digits[((unsigned char) *str) >> 4];
+ *to++= digits[((unsigned char) *str) & 0x0F];
+ }
+}
+
+
+/**
+ Send SQL error as ER_UNKNOWN_ERROR for information
+
+ @param mysql Connection handler
+*/
+
+static void report_sql_error(MYSQL *mysql)
+{
+ my_printf_error(ER_UNKNOWN_ERROR, "password_reuse_check:[%d] %s", ME_WARNING,
+ mysql_errno(mysql), mysql_error(mysql));
+}
+
+
+/**
+ Create the history of passwords table for this plugin.
+
+ @param mysql Connection handler
+
+ @retval 1 - Error
+ @retval 0 - OK
+*/
+
+static int create_table(MYSQL *mysql)
+{
+ if (mysql_real_query(mysql,
+ // 512/8 = 64
+ STRING_WITH_LEN("CREATE TABLE mysql." HISTORY_DB_NAME
+ " ( hash binary(64),"
+ " time timestamp default current_timestamp,"
+ " primary key (hash), index tm (time) )"
+ " ENGINE=Aria")))
+ {
+ report_sql_error(mysql);
+ return 1;
+ }
+ return 0;
+}
+
+
+/**
+ Run this query and create table if needed
+
+ @param mysql Connection handler
+ @param query The query to run
+ @param len length of the query text
+
+ @retval 1 - Error
+ @retval 0 - OK
+*/
+
+static int run_query_with_table_creation(MYSQL *mysql, const char *query,
+ size_t len)
+{
+ if (mysql_real_query(mysql, query, (unsigned long) len))
+ {
+ unsigned int rc= mysql_errno(mysql);
+ if (rc != ER_NO_SUCH_TABLE)
+ {
+ if (rc != ER_DUP_ENTRY)
+ {
+ report_sql_error(mysql);
+ }
+ else
+ {
+ // warning used to do not change error code
+ my_printf_error(ER_NOT_VALID_PASSWORD,
+ "password_reuse_check: The password was already used",
+ ME_WARNING);
+ }
+ return 1;
+ }
+ if (create_table(mysql))
+ return 1;
+ if (mysql_real_query(mysql, query, (unsigned long) len))
+ {
+ report_sql_error(mysql);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+
+/**
+ Password validator
+
+ @param username User name (part of whole login name)
+ @param password Password to validate
+ @param hostname Host name (part of whole login name)
+
+ @retval 1 - Password is not OK or an error happened
+ @retval 0 - Password is OK
+*/
+
+static int validate(const MYSQL_CONST_LEX_STRING *username,
+ const MYSQL_CONST_LEX_STRING *password,
+ const MYSQL_CONST_LEX_STRING *hostname)
+{
+ MYSQL *mysql= NULL;
+ size_t key_len= username->length + password->length + hostname->length;
+ size_t buff_len= (key_len > SQL_BUFF_LEN ? key_len : SQL_BUFF_LEN);
+ size_t len;
+ char *buff= malloc(buff_len);
+ unsigned char hash[512/8];
+ char escaped_hash[512/8*2 + 1];
+ if (!buff)
+ return 1;
+
+ mysql= mysql_init(NULL);
+ if (!mysql)
+ {
+ free(buff);
+ return 1;
+ }
+
+ memcpy(buff, hostname->str, hostname->length);
+ memcpy(buff + hostname->length, username->str, username->length);
+ memcpy(buff + hostname->length + username->length, password->str,
+ password->length);
+ buff[key_len]= 0;
+ memset(hash, 0, sizeof(hash));
+ my_sha512(hash, buff, key_len);
+ if (mysql_real_connect_local(mysql) == NULL)
+ goto sql_error;
+
+ if (interval)
+ {
+ // trim the table
+ len= snprintf(buff, buff_len,
+ "DELETE FROM mysql." HISTORY_DB_NAME
+ " WHERE time < DATE_SUB(NOW(), interval %d day)",
+ interval);
+ if (run_query_with_table_creation(mysql, buff, len))
+ goto sql_error;
+ }
+
+ bin_to_hex512(escaped_hash, hash);
+ escaped_hash[512/8*2]= '\0';
+ len= snprintf(buff, buff_len,
+ "INSERT INTO mysql." HISTORY_DB_NAME "(hash) "
+ "values (x'%s')",
+ escaped_hash);
+ if (run_query_with_table_creation(mysql, buff, len))
+ goto sql_error;
+
+ free(buff);
+ mysql_close(mysql);
+ return 0; // OK
+
+sql_error:
+ free(buff);
+ if (mysql)
+ mysql_close(mysql);
+ return 1; // Error
+}
+
+static MYSQL_SYSVAR_UINT(interval, interval, PLUGIN_VAR_RQCMDARG,
+ "Password history retention period in days (0 means unlimited)", NULL, NULL,
+ 0, 0, 365*100, 1);
+
+
+static struct st_mysql_sys_var* sysvars[]= {
+ MYSQL_SYSVAR(interval),
+ NULL
+};
+
+static struct st_mariadb_password_validation info=
+{
+ MariaDB_PASSWORD_VALIDATION_INTERFACE_VERSION,
+ validate
+};
+
+maria_declare_plugin(password_reuse_check)
+{
+ MariaDB_PASSWORD_VALIDATION_PLUGIN,
+ &info,
+ "password_reuse_check",
+ "Oleksandr Byelkin",
+ "Prevent password reuse",
+ PLUGIN_LICENSE_GPL,
+ NULL,
+ NULL,
+ 0x0100,
+ NULL,
+ sysvars,
+ "1.0",
+ MariaDB_PLUGIN_MATURITY_GAMMA
+}
+maria_declare_plugin_end;
diff --git a/plugin/provider_bzip2/CMakeLists.txt b/plugin/provider_bzip2/CMakeLists.txt
new file mode 100644
index 00000000000..e2ac4592b1b
--- /dev/null
+++ b/plugin/provider_bzip2/CMakeLists.txt
@@ -0,0 +1,15 @@
+FIND_PACKAGE(BZip2)
+
+SET(CPACK_RPM_provider-bzip2_PACKAGE_SUMMARY "BZip2 compression support in the server and storage engines" PARENT_SCOPE)
+SET(CPACK_RPM_provider-bzip2_PACKAGE_DESCRIPTION "BZip2 compression support in the server and storage engines" PARENT_SCOPE)
+
+IF (BZIP2_FOUND)
+ GET_PROPERTY(dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+ LIST(REMOVE_ITEM dirs ${CMAKE_SOURCE_DIR}/include/providers)
+ SET_PROPERTY(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "${dirs}")
+
+ INCLUDE_DIRECTORIES(${BZIP2_INCLUDE_DIRS})
+
+ MYSQL_ADD_PLUGIN(provider_bzip2 plugin.c COMPONENT provider-bzip2
+ LINK_LIBRARIES ${BZIP2_LIBRARIES} CONFIG provider_bzip2.cnf)
+ENDIF()
diff --git a/plugin/provider_bzip2/plugin.c b/plugin/provider_bzip2/plugin.c
new file mode 100644
index 00000000000..92978b7e888
--- /dev/null
+++ b/plugin/provider_bzip2/plugin.c
@@ -0,0 +1,61 @@
+/* Copyright (c) 2021, 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 Foundation; version 2 of the License.
+
+ 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.
+
+ 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-1335 USA */
+
+#include <stdbool.h>
+#include <mysql_version.h>
+#include <mysql/plugin.h>
+#include <bzlib.h>
+#include <providers/bzlib.h>
+
+static int init(void* h)
+{
+ provider_service_bzip2->BZ2_bzBuffToBuffCompress_ptr= BZ2_bzBuffToBuffCompress;
+ provider_service_bzip2->BZ2_bzBuffToBuffDecompress_ptr= BZ2_bzBuffToBuffDecompress;
+ provider_service_bzip2->BZ2_bzCompress_ptr= BZ2_bzCompress;
+ provider_service_bzip2->BZ2_bzCompressEnd_ptr= BZ2_bzCompressEnd;
+ provider_service_bzip2->BZ2_bzCompressInit_ptr= BZ2_bzCompressInit;
+ provider_service_bzip2->BZ2_bzDecompress_ptr= BZ2_bzDecompress;
+ provider_service_bzip2->BZ2_bzDecompressEnd_ptr= BZ2_bzDecompressEnd;
+ provider_service_bzip2->BZ2_bzDecompressInit_ptr= BZ2_bzDecompressInit;
+
+ provider_service_bzip2->is_loaded = true;
+
+ return 0;
+}
+
+static int deinit(void *h)
+{
+ return 1; /* don't unload me */
+}
+
+static struct st_mysql_daemon info= { MYSQL_DAEMON_INTERFACE_VERSION };
+
+maria_declare_plugin(provider_bzip2)
+{
+ MYSQL_DAEMON_PLUGIN,
+ &info,
+ "provider_bzip2",
+ "Kartik Soneji",
+ "BZip2 compression provider",
+ PLUGIN_LICENSE_GPL,
+ init,
+ deinit,
+ 0x0100,
+ NULL,
+ NULL,
+ "1.0",
+ MariaDB_PLUGIN_MATURITY_STABLE
+}
+maria_declare_plugin_end;
diff --git a/plugin/provider_bzip2/provider_bzip2.cnf b/plugin/provider_bzip2/provider_bzip2.cnf
new file mode 100644
index 00000000000..9b855e88769
--- /dev/null
+++ b/plugin/provider_bzip2/provider_bzip2.cnf
@@ -0,0 +1,3 @@
+[server]
+plugin_load_add=provider_bzip2
+provider_bzip2=force_plus_permanent
diff --git a/plugin/provider_lz4/CMakeLists.txt b/plugin/provider_lz4/CMakeLists.txt
new file mode 100644
index 00000000000..daad63ac6da
--- /dev/null
+++ b/plugin/provider_lz4/CMakeLists.txt
@@ -0,0 +1,15 @@
+FIND_PACKAGE(LZ4 1.6)
+
+SET(CPACK_RPM_provider-lz4_PACKAGE_SUMMARY "LZ4 compression support in the server and storage engines" PARENT_SCOPE)
+SET(CPACK_RPM_provider-lz4_PACKAGE_DESCRIPTION "LZ4 compression support in the server and storage engines" PARENT_SCOPE)
+
+IF (LZ4_FOUND)
+ GET_PROPERTY(dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+ LIST(REMOVE_ITEM dirs ${CMAKE_SOURCE_DIR}/include/providers)
+ SET_PROPERTY(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "${dirs}")
+
+ INCLUDE_DIRECTORIES(${LZ4_INCLUDE_DIRS})
+
+ MYSQL_ADD_PLUGIN(provider_lz4 plugin.c COMPONENT provider-lz4
+ LINK_LIBRARIES ${LZ4_LIBRARIES} CONFIG provider_lz4.cnf)
+ENDIF()
diff --git a/plugin/provider_lz4/plugin.c b/plugin/provider_lz4/plugin.c
new file mode 100644
index 00000000000..f9eab163d5a
--- /dev/null
+++ b/plugin/provider_lz4/plugin.c
@@ -0,0 +1,56 @@
+/* Copyright (c) 2021, 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 Foundation; version 2 of the License.
+
+ 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.
+
+ 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-1335 USA */
+
+#include <stdbool.h>
+#include <mysql_version.h>
+#include <mysql/plugin.h>
+#include <lz4.h>
+#include <providers/lz4.h>
+
+static int init(void* h)
+{
+ provider_service_lz4->LZ4_compressBound_ptr= LZ4_compressBound;
+ provider_service_lz4->LZ4_compress_default_ptr= LZ4_compress_default;
+ provider_service_lz4->LZ4_decompress_safe_ptr= LZ4_decompress_safe;
+
+ provider_service_lz4->is_loaded = true;
+
+ return 0;
+}
+
+static int deinit(void *h)
+{
+ return 1; /* don't unload me */
+}
+
+static struct st_mysql_daemon info= { MYSQL_DAEMON_INTERFACE_VERSION };
+
+maria_declare_plugin(provider_lz4)
+{
+ MYSQL_DAEMON_PLUGIN,
+ &info,
+ "provider_lz4",
+ "Kartik Soneji",
+ "LZ4 compression provider",
+ PLUGIN_LICENSE_GPL,
+ init,
+ deinit,
+ 0x0100,
+ NULL,
+ NULL,
+ "1.0",
+ MariaDB_PLUGIN_MATURITY_STABLE
+}
+maria_declare_plugin_end;
diff --git a/plugin/provider_lz4/provider_lz4.cnf b/plugin/provider_lz4/provider_lz4.cnf
new file mode 100644
index 00000000000..0b8a3ec5222
--- /dev/null
+++ b/plugin/provider_lz4/provider_lz4.cnf
@@ -0,0 +1,3 @@
+[server]
+plugin_load_add=provider_lz4
+provider_lz4=force_plus_permanent
diff --git a/plugin/provider_lzma/CMakeLists.txt b/plugin/provider_lzma/CMakeLists.txt
new file mode 100644
index 00000000000..8b0781aaa33
--- /dev/null
+++ b/plugin/provider_lzma/CMakeLists.txt
@@ -0,0 +1,15 @@
+FIND_PACKAGE(LibLZMA)
+
+SET(CPACK_RPM_provider-lzma_PACKAGE_SUMMARY "LZMA compression support in the server and storage engines" PARENT_SCOPE)
+SET(CPACK_RPM_provider-lzma_PACKAGE_DESCRIPTION "LZMA compression support in the server and storage engines" PARENT_SCOPE)
+
+IF (LIBLZMA_FOUND)
+ GET_PROPERTY(dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+ LIST(REMOVE_ITEM dirs ${CMAKE_SOURCE_DIR}/include/providers)
+ SET_PROPERTY(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "${dirs}")
+
+ INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS})
+
+ MYSQL_ADD_PLUGIN(provider_lzma plugin.c COMPONENT provider-lzma
+ LINK_LIBRARIES ${LIBLZMA_LIBRARIES} CONFIG provider_lzma.cnf)
+ENDIF()
diff --git a/plugin/provider_lzma/plugin.c b/plugin/provider_lzma/plugin.c
new file mode 100644
index 00000000000..0c18471a068
--- /dev/null
+++ b/plugin/provider_lzma/plugin.c
@@ -0,0 +1,55 @@
+/* Copyright (c) 2021, 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 Foundation; version 2 of the License.
+
+ 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.
+
+ 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-1335 USA */
+
+#include <stdbool.h>
+#include <mysql_version.h>
+#include <mysql/plugin.h>
+#include <lzma.h>
+#include <providers/lzma.h>
+
+static int init(void* h)
+{
+ provider_service_lzma->lzma_stream_buffer_decode_ptr= lzma_stream_buffer_decode;
+ provider_service_lzma->lzma_easy_buffer_encode_ptr= lzma_easy_buffer_encode;
+
+ provider_service_lzma->is_loaded = true;
+
+ return 0;
+}
+
+static int deinit(void *h)
+{
+ return 1; /* don't unload me */
+}
+
+static struct st_mysql_daemon info= { MYSQL_DAEMON_INTERFACE_VERSION };
+
+maria_declare_plugin(provider_lzma)
+{
+ MYSQL_DAEMON_PLUGIN,
+ &info,
+ "provider_lzma",
+ "Kartik Soneji",
+ "LZMA compression provider",
+ PLUGIN_LICENSE_GPL,
+ init,
+ deinit,
+ 0x0100,
+ NULL,
+ NULL,
+ "1.0",
+ MariaDB_PLUGIN_MATURITY_STABLE
+}
+maria_declare_plugin_end;
diff --git a/plugin/provider_lzma/provider_lzma.cnf b/plugin/provider_lzma/provider_lzma.cnf
new file mode 100644
index 00000000000..3a05a356f7f
--- /dev/null
+++ b/plugin/provider_lzma/provider_lzma.cnf
@@ -0,0 +1,3 @@
+[server]
+plugin_load_add=provider_lzma
+provider_lzma=force_plus_permanent
diff --git a/plugin/provider_lzo/CMakeLists.txt b/plugin/provider_lzo/CMakeLists.txt
new file mode 100644
index 00000000000..8a8d31d238a
--- /dev/null
+++ b/plugin/provider_lzo/CMakeLists.txt
@@ -0,0 +1,15 @@
+FIND_PACKAGE(LZO)
+
+SET(CPACK_RPM_provider-lzo_PACKAGE_SUMMARY "LZO compression support in the server and storage engines" PARENT_SCOPE)
+SET(CPACK_RPM_provider-lzo_PACKAGE_DESCRIPTION "LZO compression support in the server and storage engines" PARENT_SCOPE)
+
+IF (LZO_FOUND)
+ GET_PROPERTY(dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+ LIST(REMOVE_ITEM dirs ${CMAKE_SOURCE_DIR}/include/providers)
+ SET_PROPERTY(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "${dirs}")
+
+ INCLUDE_DIRECTORIES(${LZO_INCLUDE_DIRS})
+
+ MYSQL_ADD_PLUGIN(provider_lzo plugin.c COMPONENT provider-lzo
+ LINK_LIBRARIES ${LZO_LIBRARIES} CONFIG provider_lzo.cnf)
+ENDIF()
diff --git a/plugin/provider_lzo/plugin.c b/plugin/provider_lzo/plugin.c
new file mode 100644
index 00000000000..44c6b54111b
--- /dev/null
+++ b/plugin/provider_lzo/plugin.c
@@ -0,0 +1,55 @@
+/* Copyright (c) 2021, 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 Foundation; version 2 of the License.
+
+ 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.
+
+ 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-1335 USA */
+
+#include <stdbool.h>
+#include <mysql_version.h>
+#include <mysql/plugin.h>
+#include <lzo/lzo1x.h>
+#include <providers/lzo/lzo1x.h>
+
+static int init(void* h)
+{
+ provider_service_lzo->lzo1x_1_15_compress_ptr= lzo1x_1_15_compress;
+ provider_service_lzo->lzo1x_decompress_safe_ptr= lzo1x_decompress_safe;
+
+ provider_service_lzo->is_loaded = true;
+
+ return 0;
+}
+
+static int deinit(void *h)
+{
+ return 1; /* don't unload me */
+}
+
+static struct st_mysql_daemon info= { MYSQL_DAEMON_INTERFACE_VERSION };
+
+maria_declare_plugin(provider_lzo)
+{
+ MYSQL_DAEMON_PLUGIN,
+ &info,
+ "provider_lzo",
+ "Kartik Soneji",
+ "LZO compression provider",
+ PLUGIN_LICENSE_GPL,
+ init,
+ deinit,
+ 0x0100,
+ NULL,
+ NULL,
+ "1.0",
+ MariaDB_PLUGIN_MATURITY_STABLE
+}
+maria_declare_plugin_end;
diff --git a/plugin/provider_lzo/provider_lzo.cnf b/plugin/provider_lzo/provider_lzo.cnf
new file mode 100644
index 00000000000..65801983dd6
--- /dev/null
+++ b/plugin/provider_lzo/provider_lzo.cnf
@@ -0,0 +1,3 @@
+[server]
+plugin_load_add=provider_lzo
+provider_lzo=force_plus_permanent
diff --git a/plugin/provider_snappy/CMakeLists.txt b/plugin/provider_snappy/CMakeLists.txt
new file mode 100644
index 00000000000..d963029d75c
--- /dev/null
+++ b/plugin/provider_snappy/CMakeLists.txt
@@ -0,0 +1,15 @@
+FIND_PACKAGE(Snappy)
+
+SET(CPACK_RPM_provider-snappy_PACKAGE_SUMMARY "Snappy compression support in the server and storage engines" PARENT_SCOPE)
+SET(CPACK_RPM_provider-snappy_PACKAGE_DESCRIPTION "Snappy compression support in the server and storage engines" PARENT_SCOPE)
+
+IF (SNAPPY_FOUND)
+ GET_PROPERTY(dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+ LIST(REMOVE_ITEM dirs ${CMAKE_SOURCE_DIR}/include/providers)
+ SET_PROPERTY(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "${dirs}")
+
+ INCLUDE_DIRECTORIES(${SNAPPY_INCLUDE_DIRS})
+
+ MYSQL_ADD_PLUGIN(provider_snappy plugin.c COMPONENT provider-snappy
+ LINK_LIBRARIES ${SNAPPY_LIBRARIES} CONFIG provider_snappy.cnf)
+ENDIF()
diff --git a/plugin/provider_snappy/plugin.c b/plugin/provider_snappy/plugin.c
new file mode 100644
index 00000000000..8af7eb1b0ea
--- /dev/null
+++ b/plugin/provider_snappy/plugin.c
@@ -0,0 +1,58 @@
+/* Copyright (c) 2021, 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 Foundation; version 2 of the License.
+
+ 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.
+
+ 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-1335 USA */
+
+#include <stdbool.h>
+#include <mysql_version.h>
+#include <mysql/plugin.h>
+#include <snappy-c.h>
+#define SNAPPY_C
+#include <providers/snappy-c.h>
+
+static int init(void* h)
+{
+ provider_service_snappy->snappy_max_compressed_length_ptr= snappy_max_compressed_length;
+ provider_service_snappy->snappy_compress_ptr= snappy_compress;
+ provider_service_snappy->snappy_uncompressed_length_ptr= snappy_uncompressed_length;
+ provider_service_snappy->snappy_uncompress_ptr= snappy_uncompress;
+
+ provider_service_snappy->is_loaded = true;
+
+ return 0;
+}
+
+static int deinit(void *h)
+{
+ return 1; /* don't unload me */
+}
+
+static struct st_mysql_daemon info= { MYSQL_DAEMON_INTERFACE_VERSION };
+
+maria_declare_plugin(provider_snappy)
+{
+ MYSQL_DAEMON_PLUGIN,
+ &info,
+ "provider_snappy",
+ "Kartik Soneji",
+ "SNAPPY compression provider",
+ PLUGIN_LICENSE_GPL,
+ init,
+ deinit,
+ 0x0100,
+ NULL,
+ NULL,
+ "1.0",
+ MariaDB_PLUGIN_MATURITY_STABLE
+}
+maria_declare_plugin_end;
diff --git a/plugin/provider_snappy/provider_snappy.cnf b/plugin/provider_snappy/provider_snappy.cnf
new file mode 100644
index 00000000000..da78207c3e6
--- /dev/null
+++ b/plugin/provider_snappy/provider_snappy.cnf
@@ -0,0 +1,3 @@
+[server]
+plugin_load_add=provider_snappy
+provider_snappy=force_plus_permanent
diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c
index 52af6206cb2..3c94df243d0 100644
--- a/plugin/server_audit/server_audit.c
+++ b/plugin/server_audit/server_audit.c
@@ -1153,7 +1153,6 @@ static void setup_connection_simple(struct connection_info *ci)
#define MAX_HOSTNAME (HOSTNAME_LENGTH + 1) /* len+1 in mysql.user */
-#define USERNAME_LENGTH 384
static void setup_connection_connect(MYSQL_THD thd,struct connection_info *cn,
const struct mysql_event_connection *event)
diff --git a/plugin/simple_password_check/simple_password_check.c b/plugin/simple_password_check/simple_password_check.c
index 65d017e24a1..e9d852d54ab 100644
--- a/plugin/simple_password_check/simple_password_check.c
+++ b/plugin/simple_password_check/simple_password_check.c
@@ -23,7 +23,9 @@
static unsigned min_length, min_digits, min_letters, min_others;
static int validate(const MYSQL_CONST_LEX_STRING *username,
- const MYSQL_CONST_LEX_STRING *password)
+ const MYSQL_CONST_LEX_STRING *password,
+ const MYSQL_CONST_LEX_STRING *hostname
+ __attribute__((unused)))
{
unsigned digits=0 , uppers=0 , lowers=0, others=0, length= (unsigned)password->length;
const char *ptr= password->str, *end= ptr + length;
diff --git a/plugin/test_sql_service/CMakeLists.txt b/plugin/test_sql_service/CMakeLists.txt
index aa9ecfe685e..615508bdc4e 100644
--- a/plugin/test_sql_service/CMakeLists.txt
+++ b/plugin/test_sql_service/CMakeLists.txt
@@ -15,4 +15,4 @@
SET(SOURCES test_sql_service.c)
-MYSQL_ADD_PLUGIN(test_sql_service ${SOURCES} MODULE_ONLY RECOMPILE_FOR_EMBEDDED)
+MYSQL_ADD_PLUGIN(test_sql_service ${SOURCES} MODULE_ONLY)
diff --git a/plugin/test_sql_service/test_sql_service.c b/plugin/test_sql_service/test_sql_service.c
index 062f10fce58..c2dbb93bf20 100644
--- a/plugin/test_sql_service/test_sql_service.c
+++ b/plugin/test_sql_service/test_sql_service.c
@@ -14,71 +14,108 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
-#define PLUGIN_VERSION 0x100
-#define PLUGIN_STR_VERSION "1.0.0"
-
-#define _my_thread_var loc_thread_var
-
-#include <my_config.h>
-#include <assert.h>
-#include <my_global.h>
-#include <my_base.h>
-#include <typelib.h>
-//#include <mysql_com.h> /* for enum enum_server_command */
-#include <mysql/plugin.h>
-#include <mysql/plugin_audit.h>
-//#include <string.h>
-
+#define PLUGIN_VERSION 0x200
-LEX_STRING * thd_query_string (MYSQL_THD thd);
-unsigned long long thd_query_id(const MYSQL_THD thd);
-size_t thd_query_safe(MYSQL_THD thd, char *buf, size_t buflen);
-const char *thd_user_name(MYSQL_THD thd);
-const char *thd_client_host(MYSQL_THD thd);
-const char *thd_client_ip(MYSQL_THD thd);
-LEX_CSTRING *thd_current_db(MYSQL_THD thd);
-int thd_current_status(MYSQL_THD thd);
-enum enum_server_command thd_current_command(MYSQL_THD thd);
-
-int maria_compare_hostname(const char *wild_host, long wild_ip, long ip_mask,
- const char *host, const char *ip);
-void maria_update_hostname(const char **wild_host, long *wild_ip, long *ip_mask,
- const char *host);
+#include <mysql/plugin_audit.h>
+#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1))
/* Status variables for SHOW STATUS */
static long test_passed= 0;
+static char *sql_text_local, *sql_text_global;
+static char qwe_res[1024]= "";
+
static struct st_mysql_show_var test_sql_status[]=
{
{"test_sql_service_passed", (char *)&test_passed, SHOW_LONG},
+ {"test_sql_query_result", qwe_res, SHOW_CHAR},
{0,0,0}
};
-static my_bool do_test= TRUE;
-static void run_test(MYSQL_THD thd, struct st_mysql_sys_var *var,
- void *var_ptr, const void *save);
-static MYSQL_SYSVAR_BOOL(run_test, do_test, PLUGIN_VAR_OPCMDARG,
- "Perform the test now.", NULL, run_test, FALSE);
+static my_bool do_test= 1;
+static int run_test(MYSQL_THD thd, struct st_mysql_sys_var *var, void *save,
+ struct st_mysql_value *value);
+static int run_sql_local(MYSQL_THD thd, struct st_mysql_sys_var *var, void *save,
+ struct st_mysql_value *value);
+static int run_sql_global(MYSQL_THD thd, struct st_mysql_sys_var *var, void *save,
+ struct st_mysql_value *value);
+
+static void noop_update(MYSQL_THD thd, struct st_mysql_sys_var *var,
+ void *var_ptr, const void *save);
+
+static MYSQL_SYSVAR_BOOL(run_test, do_test,
+ PLUGIN_VAR_OPCMDARG,
+ "Perform the test now.",
+ run_test, NULL, 0);
+
+static MYSQL_SYSVAR_STR(execute_sql_local, sql_text_local,
+ PLUGIN_VAR_OPCMDARG,
+ "Create the new local connection, execute SQL statement with it.",
+ run_sql_local, noop_update, 0);
+
+static MYSQL_SYSVAR_STR(execute_sql_global, sql_text_global,
+ PLUGIN_VAR_OPCMDARG,
+ "Execute SQL statement using the global connection.",
+ run_sql_global, noop_update, 0);
+
static struct st_mysql_sys_var* test_sql_vars[]=
{
MYSQL_SYSVAR(run_test),
+ MYSQL_SYSVAR(execute_sql_local),
+ MYSQL_SYSVAR(execute_sql_global),
NULL
};
+static MYSQL *global_mysql;
+
+
+static int run_queries(MYSQL *mysql)
+{
+ MYSQL_RES *res;
+
+ if (mysql_real_query(mysql,
+ STRING_WITH_LEN("CREATE TABLE test.ts_table"
+ " ( hash varbinary(512),"
+ " time timestamp default current_time,"
+ " primary key (hash), index tm (time) )")))
+ return 1;
-extern int execute_sql_command(const char *command,
- char *hosts, char *names, char *filters);
+ if (mysql_real_query(mysql,
+ STRING_WITH_LEN("INSERT INTO test.ts_table VALUES('1234567890', NULL)")))
+ return 1;
+ if (mysql_real_query(mysql, STRING_WITH_LEN("select * from test.ts_table")))
+ return 1;
+
+ if (!(res= mysql_store_result(mysql)))
+ return 1;
+
+ mysql_free_result(res);
+
+ if (mysql_real_query(mysql, STRING_WITH_LEN("DROP TABLE test.ts_table")))
+ return 1;
+
+ return 0;
+}
static int do_tests()
{
- char plugins[1024];
- char names[1024];
- char dl[2048];
- int result;
+ MYSQL *mysql;
+ int result= 1;
+
+ mysql= mysql_init(NULL);
+ if (mysql_real_connect_local(mysql) == NULL)
+ return 1;
- result= execute_sql_command("select 'plugin', name, dl from mysql.plugin",
- plugins, names, dl);
+ if (run_queries(mysql))
+ goto exit;
+
+ if (run_queries(global_mysql))
+ goto exit;
+
+ result= 0;
+exit:
+ mysql_close(mysql);
return result;
}
@@ -89,29 +126,117 @@ void auditing(MYSQL_THD thd, unsigned int event_class, const void *ev)
}
-static void run_test(MYSQL_THD thd __attribute__((unused)),
- struct st_mysql_sys_var *var __attribute__((unused)),
- void *var_ptr __attribute__((unused)),
- const void *save __attribute__((unused)))
+static int run_test(MYSQL_THD thd, struct st_mysql_sys_var *var, void *save,
+ struct st_mysql_value *value)
+{
+ return (test_passed= (do_tests() == 0)) == 0;
+}
+
+
+static int run_sql(MYSQL *mysql, void *save, struct st_mysql_value *value)
+{
+ const char *str;
+ int len= 0;
+ MYSQL_RES *res;
+
+ str= value->val_str(value, NULL, &len);
+
+ if (mysql_real_query(mysql, str, len))
+ {
+ if (mysql_error(mysql)[0])
+ {
+ my_snprintf(qwe_res, sizeof(qwe_res), "Error %d returned. %s",
+ mysql_errno(mysql), mysql_error(mysql));
+ return 0;
+ }
+
+ return 1;
+ }
+
+ if ((res= mysql_store_result(mysql)))
+ {
+ my_snprintf(qwe_res, sizeof(qwe_res), "Query returned %lld rows.",
+ mysql_num_rows(res));
+ mysql_free_result(res);
+ }
+ else
+ {
+ if (mysql_error(mysql)[0])
+ {
+ my_snprintf(qwe_res, sizeof(qwe_res), "Error %d returned. %s",
+ mysql_errno(mysql), mysql_error(mysql));
+ }
+ else
+ my_snprintf(qwe_res, sizeof(qwe_res), "Query affected %lld rows.",
+ mysql_affected_rows(mysql));
+ }
+
+ return 0;
+}
+
+
+static void noop_update(MYSQL_THD thd, struct st_mysql_sys_var *var,
+ void *var_ptr, const void *save)
+{
+ sql_text_local= sql_text_global= qwe_res;
+}
+
+static int run_sql_local(MYSQL_THD thd, struct st_mysql_sys_var *var, void *save,
+ struct st_mysql_value *value)
+{
+ MYSQL *mysql;
+ int result= 1;
+
+ mysql= mysql_init(NULL);
+ if (mysql_real_connect_local(mysql) == NULL)
+ return 1;
+
+ if (run_sql(mysql, save, value))
+ goto exit;
+
+ result= 0;
+
+exit:
+ mysql_close(mysql);
+
+ return result;
+}
+
+
+static int run_sql_global(MYSQL_THD thd, struct st_mysql_sys_var *var, void *save,
+ struct st_mysql_value *value)
{
- test_passed= do_tests();
+ return run_sql(global_mysql, save, value);
}
static int init_done= 0;
-static int test_sql_service_plugin_init(void *p __attribute__((unused)))
+static int test_sql_service_plugin_init(void *p)
{
+ (void) p;
+ global_mysql= mysql_init(NULL);
+
+ if (!global_mysql ||
+ mysql_real_connect_local(global_mysql) == NULL)
+ return 1;
+
init_done= 1;
+
+ test_passed= (do_tests() == 0);
+
return 0;
}
-static int test_sql_service_plugin_deinit(void *p __attribute__((unused)))
+static int test_sql_service_plugin_deinit(void *p)
{
+ (void) p;
if (!init_done)
return 0;
+ mysql_close(global_mysql);
+
return 0;
}
@@ -138,8 +263,8 @@ maria_declare_plugin(test_sql_service)
PLUGIN_VERSION,
test_sql_status,
test_sql_vars,
- PLUGIN_STR_VERSION,
- MariaDB_PLUGIN_MATURITY_STABLE
+ NULL,
+ MariaDB_PLUGIN_MATURITY_EXPERIMENTAL
}
maria_declare_plugin_end;
diff --git a/plugin/type_inet/item_inetfunc.cc b/plugin/type_inet/item_inetfunc.cc
index dcccf762295..b23ae04a861 100644
--- a/plugin/type_inet/item_inetfunc.cc
+++ b/plugin/type_inet/item_inetfunc.cc
@@ -158,7 +158,7 @@ String *Item_func_inet6_aton::val_str(String *buffer)
return buffer;
}
- Inet6_null ipv6(*tmp.string());
+ Inet6Bundle::Fbt_null ipv6(*tmp.string());
if (!ipv6.is_null())
{
ipv6.to_binary(buffer);
@@ -197,7 +197,7 @@ String *Item_func_inet6_ntoa::val_str_ascii(String *buffer)
return buffer;
}
- Inet6_null ipv6(static_cast<const Binary_string&>(*tmp.string()));
+ Inet6Bundle::Fbt_null ipv6(static_cast<const Binary_string&>(*tmp.string()));
if (!ipv6.is_null())
{
ipv6.to_string(buffer);
@@ -221,6 +221,22 @@ longlong Item_func_is_ipv4::val_int()
return !tmp.is_null() && !Inet4_null(*tmp.string()).is_null();
}
+class IP6 : public Inet6Bundle::Fbt_null
+{
+public:
+ IP6(Item* arg) : Inet6Bundle::Fbt_null(arg) {}
+ bool is_v4compat() const
+ {
+ static_assert(sizeof(in6_addr) == IN6_ADDR_SIZE, "unexpected in6_addr size");
+ return IN6_IS_ADDR_V4COMPAT((struct in6_addr *) m_buffer);
+ }
+ bool is_v4mapped() const
+ {
+ static_assert(sizeof(in6_addr) == IN6_ADDR_SIZE, "unexpected in6_addr size");
+ return IN6_IS_ADDR_V4MAPPED((struct in6_addr *) m_buffer);
+ }
+};
+
/**
Checks if the passed string represents an IPv6-address.
@@ -230,17 +246,16 @@ longlong Item_func_is_ipv6::val_int()
{
DBUG_ASSERT(fixed());
String_ptr_and_buffer<STRING_BUFFER_USUAL_SIZE> tmp(args[0]);
- return !tmp.is_null() && !Inet6_null(*tmp.string()).is_null();
+ return !tmp.is_null() && !Inet6Bundle::Fbt_null(*tmp.string()).is_null();
}
-
/**
Checks if the passed IPv6-address is an IPv4-compat IPv6-address.
*/
longlong Item_func_is_ipv4_compat::val_int()
{
- Inet6_null ip6(args[0]);
+ IP6 ip6(args[0]);
return !ip6.is_null() && ip6.is_v4compat();
}
@@ -251,6 +266,6 @@ longlong Item_func_is_ipv4_compat::val_int()
longlong Item_func_is_ipv4_mapped::val_int()
{
- Inet6_null ip6(args[0]);
+ IP6 ip6(args[0]);
return !ip6.is_null() && ip6.is_v4mapped();
}
diff --git a/plugin/type_inet/plugin.cc b/plugin/type_inet/plugin.cc
index 77804c82af6..0b57e2bec1f 100644
--- a/plugin/type_inet/plugin.cc
+++ b/plugin/type_inet/plugin.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2019 MariaDB Corporation
+/* Copyright (c) 2019,2021 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
@@ -21,14 +21,10 @@
#include <mysql/plugin_data_type.h>
#include <mysql/plugin_function.h>
-
-Type_handler_inet6 type_handler_inet6;
-
-
static struct st_mariadb_data_type plugin_descriptor_type_inet6=
{
MariaDB_DATA_TYPE_INTERFACE_VERSION,
- &type_handler_inet6
+ Inet6Bundle::type_handler_fbt()
};
diff --git a/plugin/type_inet/sql_type_inet.cc b/plugin/type_inet/sql_type_inet.cc
index 488a569ef7d..b8d2ef706a9 100644
--- a/plugin/type_inet/sql_type_inet.cc
+++ b/plugin/type_inet/sql_type_inet.cc
@@ -1,6 +1,6 @@
/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2014 MariaDB Foundation
- Copyright (c) 2019 MariaDB Corporation
+ Copyright (c) 2019,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
@@ -168,7 +168,7 @@ bool Inet4::ascii_to_ipv4(const char *str, size_t str_length)
IPv4-part differently on different platforms.
*/
-bool Inet6::ascii_to_ipv6(const char *str, size_t str_length)
+bool Inet6::ascii_to_fbt(const char *str, size_t str_length)
{
if (str_length < 2)
{
@@ -507,1203 +507,8 @@ size_t Inet6::to_string(char *dst, size_t dstsize) const
return (size_t) (p - dst);
}
-
-bool Inet6::fix_fields_maybe_null_on_conversion_to_inet6(Item *item)
-{
- if (item->maybe_null())
- return true;
- if (item->type_handler() == &type_handler_inet6)
- return false;
- if (!item->const_item() || item->is_expensive())
- return true;
- return Inet6_null(item, false).is_null();
-}
-
-
-bool Inet6::make_from_item(Item *item, bool warn)
-{
- if (item->type_handler() == &type_handler_inet6)
- {
- Native tmp(m_buffer, sizeof(m_buffer));
- bool rc= item->val_native(current_thd, &tmp);
- if (rc)
- return true;
- DBUG_ASSERT(tmp.length() == sizeof(m_buffer));
- if (tmp.ptr() != m_buffer)
- memcpy(m_buffer, tmp.ptr(), sizeof(m_buffer));
- return false;
- }
- StringBufferInet6 tmp;
- String *str= item->val_str(&tmp);
- return str ? make_from_character_or_binary_string(str, warn) : true;
-}
-
-
-bool Inet6::make_from_character_or_binary_string(const String *str, bool warn)
-{
- static Name name= type_handler_inet6.name();
- if (str->charset() != &my_charset_bin)
- {
- bool rc= character_string_to_ipv6(str->ptr(), str->length(),
- str->charset());
- if (rc && warn)
- current_thd->push_warning_wrong_value(Sql_condition::WARN_LEVEL_WARN,
- name.ptr(),
- ErrConvString(str).ptr());
- return rc;
- }
- if (str->length() != sizeof(m_buffer))
- {
- if (warn)
- current_thd->push_warning_wrong_value(Sql_condition::WARN_LEVEL_WARN,
- name.ptr(),
- ErrConvString(str).ptr());
- return true;
- }
- DBUG_ASSERT(str->ptr() != m_buffer);
- memcpy(m_buffer, str->ptr(), sizeof(m_buffer));
- return false;
-};
-
-
-/********************************************************************/
-
-
-class cmp_item_inet6: public cmp_item_scalar
-{
- Inet6 m_native;
-public:
- cmp_item_inet6()
- :cmp_item_scalar(),
- m_native(Inet6_zero())
- { }
- void store_value(Item *item) override
- {
- m_native= Inet6(item, &m_null_value);
- }
- int cmp_not_null(const Value *val) override
- {
- DBUG_ASSERT(!val->is_null());
- DBUG_ASSERT(val->is_string());
- Inet6_null tmp(val->m_string);
- DBUG_ASSERT(!tmp.is_null());
- return m_native.cmp(tmp);
- }
- int cmp(Item *arg) override
- {
- Inet6_null tmp(arg);
- return m_null_value || tmp.is_null() ? UNKNOWN : m_native.cmp(tmp) != 0;
- }
- int compare(cmp_item *ci) override
- {
- cmp_item_inet6 *tmp= static_cast<cmp_item_inet6*>(ci);
- DBUG_ASSERT(!m_null_value);
- DBUG_ASSERT(!tmp->m_null_value);
- return m_native.cmp(tmp->m_native);
- }
- cmp_item *make_same(THD *thd) override
- {
- return new (thd->mem_root) cmp_item_inet6();
- }
-};
-
-
-class Field_inet6: public Field
-{
- static void set_min_value(char *ptr)
- {
- memset(ptr, 0, Inet6::binary_length());
- }
- static void set_max_value(char *ptr)
- {
- memset(ptr, 0xFF, Inet6::binary_length());
- }
- void store_warning(const ErrConv &str,
- Sql_condition::enum_warning_level level)
- {
- static const Name type_name= type_handler_inet6.name();
- if (get_thd()->count_cuted_fields <= CHECK_FIELD_EXPRESSION)
- return;
- const TABLE_SHARE *s= table->s;
- get_thd()->push_warning_truncated_value_for_field(level, type_name.ptr(),
- str.ptr(),
- s ? s->db.str : nullptr,
- s ? s->table_name.str
- : nullptr,
- field_name.str);
- }
- int set_null_with_warn(const ErrConv &str)
- {
- store_warning(str, Sql_condition::WARN_LEVEL_WARN);
- set_null();
- return 1;
- }
- int set_min_value_with_warn(const ErrConv &str)
- {
- store_warning(str, Sql_condition::WARN_LEVEL_WARN);
- set_min_value((char*) ptr);
- return 1;
- }
- int set_max_value_with_warn(const ErrConv &str)
- {
- store_warning(str, Sql_condition::WARN_LEVEL_WARN);
- set_max_value((char*) ptr);
- return 1;
- }
- int store_inet6_null_with_warn(const Inet6_null &inet6,
- const ErrConvString &err)
- {
- DBUG_ASSERT(marked_for_write_or_computed());
- if (inet6.is_null())
- return maybe_null() ? set_null_with_warn(err) :
- set_min_value_with_warn(err);
- inet6.to_binary((char *) ptr, Inet6::binary_length());
- return 0;
- }
-
-public:
- Field_inet6(const LEX_CSTRING *field_name_arg, const Record_addr &rec)
- :Field(rec.ptr(), Inet6::max_char_length(),
- rec.null_ptr(), rec.null_bit(), Field::NONE, field_name_arg)
- {
- flags|= BINARY_FLAG | UNSIGNED_FLAG;
- }
- const Type_handler *type_handler() const override
- {
- return &type_handler_inet6;
- }
- uint32 max_display_length() const override { return field_length; }
- bool str_needs_quotes() const override { return true; }
- const DTCollation &dtcollation() const override
- {
- static DTCollation_numeric c;
- return c;
- }
- CHARSET_INFO *charset(void) const override { return &my_charset_numeric; }
- const CHARSET_INFO *sort_charset(void) const override { return &my_charset_bin; }
- /**
- This makes client-server protocol convert the value according
- to @@character_set_client.
- */
- bool binary() const override { return false; }
- enum ha_base_keytype key_type() const override { return HA_KEYTYPE_BINARY; }
-
- bool is_equal(const Column_definition &new_field) const override
- {
- return new_field.type_handler() == type_handler();
- }
- bool eq_def(const Field *field) const override
- {
- return Field::eq_def(field);
- }
- double pos_in_interval(Field *min, Field *max) override
- {
- return pos_in_interval_val_str(min, max, 0);
- }
- int cmp(const uchar *a, const uchar *b) const override
- { return memcmp(a, b, pack_length()); }
-
- void sort_string(uchar *to, uint length) override
- {
- DBUG_ASSERT(length == pack_length());
- memcpy(to, ptr, length);
- }
- uint32 pack_length() const override
- {
- return Inet6::binary_length();
- }
- uint pack_length_from_metadata(uint field_metadata) const override
- {
- return Inet6::binary_length();
- }
-
- void sql_type(String &str) const override
- {
- static Name name= type_handler_inet6.name();
- str.set_ascii(name.ptr(), name.length());
- }
-
- void make_send_field(Send_field *to) override
- {
- Field::make_send_field(to);
- to->set_data_type_name(type_handler_inet6.name().lex_cstring());
- }
-
- bool validate_value_in_record(THD *thd, const uchar *record) const override
- {
- return false;
- }
-
- String *val_str(String *val_buffer,
- String *val_ptr __attribute__((unused))) override
- {
- DBUG_ASSERT(marked_for_read());
- Inet6_null tmp((const char *) ptr, pack_length());
- return tmp.to_string(val_buffer) ? NULL : val_buffer;
- }
-
- my_decimal *val_decimal(my_decimal *to) override
- {
- DBUG_ASSERT(marked_for_read());
- my_decimal_set_zero(to);
- return to;
- }
-
- longlong val_int() override
- {
- DBUG_ASSERT(marked_for_read());
- return 0;
- }
-
- double val_real() override
- {
- DBUG_ASSERT(marked_for_read());
- return 0;
- }
-
- bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override
- {
- DBUG_ASSERT(marked_for_read());
- set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
- return false;
- }
-
- bool val_bool(void) override
- {
- DBUG_ASSERT(marked_for_read());
- return !Inet6::only_zero_bytes((const char *) ptr, Inet6::binary_length());
- }
-
- int store_native(const Native &value) override
- {
- DBUG_ASSERT(marked_for_write_or_computed());
- DBUG_ASSERT(value.length() == Inet6::binary_length());
- memcpy(ptr, value.ptr(), value.length());
- return 0;
- }
-
- int store(const char *str, size_t length, CHARSET_INFO *cs) override
- {
- return cs == &my_charset_bin ? store_binary(str, length) :
- store_text(str, length, cs);
- }
-
- int store_text(const char *str, size_t length, CHARSET_INFO *cs) override
- {
- return store_inet6_null_with_warn(Inet6_null(str, length, cs),
- ErrConvString(str, length, cs));
- }
-
- int store_binary(const char *str, size_t length) override
- {
- return store_inet6_null_with_warn(Inet6_null(str, length),
- ErrConvString(str, length,
- &my_charset_bin));
- }
-
- int store_hex_hybrid(const char *str, size_t length) override
- {
- return Field_inet6::store_binary(str, length);
- }
-
- int store_decimal(const my_decimal *num) override
- {
- DBUG_ASSERT(marked_for_write_or_computed());
- return set_min_value_with_warn(ErrConvDecimal(num));
- }
-
- int store(longlong nr, bool unsigned_flag) override
- {
- DBUG_ASSERT(marked_for_write_or_computed());
- return set_min_value_with_warn(
- ErrConvInteger(Longlong_hybrid(nr, unsigned_flag)));
- }
-
- int store(double nr) override
- {
- DBUG_ASSERT(marked_for_write_or_computed());
- return set_min_value_with_warn(ErrConvDouble(nr));
- }
-
- int store_time_dec(const MYSQL_TIME *ltime, uint dec) override
- {
- DBUG_ASSERT(marked_for_write_or_computed());
- return set_min_value_with_warn(ErrConvTime(ltime));
- }
-
- /*** Field conversion routines ***/
- int store_field(Field *from) override
- {
- // INSERT INTO t1 (inet6_field) SELECT different_field_type FROM t2;
- return from->save_in_field(this);
- }
- int save_in_field(Field *to) override
- {
- // INSERT INTO t2 (different_field_type) SELECT inet6_field FROM t1;
- if (to->charset() == &my_charset_bin &&
- dynamic_cast<const Type_handler_general_purpose_string*>
- (to->type_handler()))
- {
- NativeBufferInet6 res;
- val_native(&res);
- return to->store(res.ptr(), res.length(), &my_charset_bin);
- }
- return save_in_field_str(to);
- }
- Copy_func *get_copy_func(const Field *from) const override
- {
- // ALTER to INET6 from another field
- return do_field_string;
- }
-
- Copy_func *get_copy_func_to(const Field *to) const override
- {
- if (type_handler() == to->type_handler())
- {
- // ALTER from INET6 to INET6
- DBUG_ASSERT(pack_length() == to->pack_length());
- DBUG_ASSERT(charset() == to->charset());
- DBUG_ASSERT(sort_charset() == to->sort_charset());
- return Field::do_field_eq;
- }
- // ALTER from INET6 to another data type
- if (to->charset() == &my_charset_bin &&
- dynamic_cast<const Type_handler_general_purpose_string*>
- (to->type_handler()))
- {
- /*
- ALTER from INET6 to a binary string type, e.g.:
- BINARY, TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB
- */
- return do_field_inet6_native_to_binary;
- }
- return do_field_string;
- }
-
- static void do_field_inet6_native_to_binary(Copy_field *copy)
- {
- NativeBufferInet6 res;
- copy->from_field->val_native(&res);
- copy->to_field->store(res.ptr(), res.length(), &my_charset_bin);
- }
-
- bool memcpy_field_possible(const Field *from) const override
- {
- // INSERT INTO t1 (inet6_field) SELECT field2 FROM t2;
- return type_handler() == from->type_handler();
- }
- enum_conv_type rpl_conv_type_from(const Conv_source &source,
- const Relay_log_info *rli,
- const Conv_param &param) const override
- {
- if (type_handler() == source.type_handler() ||
- (source.type_handler() == &type_handler_string &&
- source.type_handler()->max_display_length_for_field(source) ==
- Inet6::binary_length()))
- return rpl_conv_type_from_same_data_type(source.metadata(), rli, param);
- return CONV_TYPE_IMPOSSIBLE;
- }
-
- /*** Optimizer routines ***/
- bool test_if_equality_guarantees_uniqueness(const Item *const_item) const override
- {
- /*
- This condition:
- WHERE inet6_field=const
- should return a single distinct value only,
- as comparison is done according to INET6.
- */
- return true;
- }
- bool can_be_substituted_to_equal_item(const Context &ctx,
- const Item_equal *item_equal)
- override
- {
- switch (ctx.subst_constraint()) {
- case ANY_SUBST:
- return ctx.compare_type_handler() == item_equal->compare_type_handler();
- case IDENTITY_SUBST:
- return true;
- }
- return false;
- }
- Item *get_equal_const_item(THD *thd, const Context &ctx,
- Item *const_item) override;
- bool can_optimize_keypart_ref(const Item_bool_func *cond,
- const Item *item) const override
- {
- /*
- Mixing of two different non-traditional types is currently prevented.
- This may change in the future. For example, INET4 and INET6
- data types can be made comparable.
- But we allow mixing INET6 to a data type directly inherited from
- a traditional type, e.g. INET6=VARCHAR/JSON.
- */
- DBUG_ASSERT(item->type_handler()->type_handler_base_or_self()->
- is_traditional_scalar_type() ||
- item->type_handler() == type_handler());
- return true;
- }
- /**
- Test if Field can use range optimizer for a standard comparison operation:
- <=, <, =, <=>, >, >=
- Note, this method does not cover spatial operations.
- */
- bool can_optimize_range(const Item_bool_func *cond,
- const Item *item,
- bool is_eq_func) const override
- {
- // See the DBUG_ASSERT comment in can_optimize_keypart_ref()
- DBUG_ASSERT(item->type_handler()->type_handler_base_or_self()->
- is_traditional_scalar_type() ||
- item->type_handler() == type_handler());
- return true;
- }
- SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *prm, KEY_PART *key_part,
- const Item_bool_func *cond,
- scalar_comparison_op op, Item *value) override
- {
- DBUG_ENTER("Field_inet6::get_mm_leaf");
- if (!can_optimize_scalar_range(prm, key_part, cond, op, value))
- DBUG_RETURN(0);
- int err= value->save_in_field_no_warnings(this, 1);
- if ((op != SCALAR_CMP_EQUAL && is_real_null()) || err < 0)
- DBUG_RETURN(&null_element);
- if (err > 0)
- {
- if (op == SCALAR_CMP_EQ || op == SCALAR_CMP_EQUAL)
- DBUG_RETURN(new (prm->mem_root) SEL_ARG_IMPOSSIBLE(this));
- DBUG_RETURN(NULL); /* Cannot infer anything */
- }
- DBUG_RETURN(stored_field_make_mm_leaf(prm, key_part, op, value));
- }
- bool can_optimize_hash_join(const Item_bool_func *cond,
- const Item *item) const override
- {
- return can_optimize_keypart_ref(cond, item);
- }
- bool can_optimize_group_min_max(const Item_bool_func *cond,
- const Item *const_item) const override
- {
- return true;
- }
-
- uint row_pack_length() const override { return pack_length(); }
-
- Binlog_type_info binlog_type_info() const override
- {
- DBUG_ASSERT(type() == binlog_type());
- return Binlog_type_info_fixed_string(Field_inet6::binlog_type(),
- Inet6::binary_length(),
- &my_charset_bin);
- }
-
- uchar *pack(uchar *to, const uchar *from, uint max_length) override
- {
- DBUG_PRINT("debug", ("Packing field '%s'", field_name.str));
- return StringPack(&my_charset_bin, Inet6::binary_length()).
- pack(to, from, max_length);
- }
-
- const uchar *unpack(uchar *to, const uchar *from, const uchar *from_end,
- uint param_data) override
- {
- return StringPack(&my_charset_bin, Inet6::binary_length()).
- unpack(to, from, from_end, param_data);
- }
-
- uint max_packed_col_length(uint max_length) override
- {
- return StringPack::max_packed_col_length(max_length);
- }
-
- uint packed_col_length(const uchar *data_ptr, uint length) override
- {
- return StringPack::packed_col_length(data_ptr, length);
- }
-
- /**********/
- uint size_of() const override { return sizeof(*this); }
-};
-
-
-class Item_typecast_inet6: public Item_func
-{
-public:
- Item_typecast_inet6(THD *thd, Item *a) :Item_func(thd, a) {}
-
- const Type_handler *type_handler() const override
- { return &type_handler_inet6; }
-
- enum Functype functype() const override { return CHAR_TYPECAST_FUNC; }
- bool eq(const Item *item, bool binary_cmp) const override
- {
- if (this == item)
- return true;
- if (item->type() != FUNC_ITEM ||
- functype() != ((Item_func*)item)->functype())
- return false;
- if (type_handler() != item->type_handler())
- return false;
- Item_typecast_inet6 *cast= (Item_typecast_inet6*) item;
- return args[0]->eq(cast->args[0], binary_cmp);
- }
- LEX_CSTRING func_name_cstring() const override
- {
- static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_inet6") };
- return name;
- }
- void print(String *str, enum_query_type query_type) override
- {
- str->append(STRING_WITH_LEN("cast("));
- args[0]->print(str, query_type);
- str->append(STRING_WITH_LEN(" as inet6)"));
- }
- bool fix_length_and_dec() override
- {
- Type_std_attributes::operator=(Type_std_attributes_inet6());
- if (Inet6::fix_fields_maybe_null_on_conversion_to_inet6(args[0]))
- set_maybe_null();
- return false;
- }
- String *val_str(String *to) override
- {
- Inet6_null tmp(args[0]);
- return (null_value= tmp.is_null() || tmp.to_string(to)) ? NULL : to;
- }
- longlong val_int() override
- {
- return 0;
- }
- double val_real() override
- {
- return 0;
- }
- my_decimal *val_decimal(my_decimal *to) override
- {
- my_decimal_set_zero(to);
- return to;
- }
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
- {
- set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
- return false;
- }
- bool val_native(THD *thd, Native *to) override
- {
- Inet6_null tmp(args[0]);
- return null_value= tmp.is_null() || tmp.to_native(to);
- }
- Item *get_copy(THD *thd) override
- { return get_item_copy<Item_typecast_inet6>(thd, this); }
-};
-
-
-class Item_cache_inet6: public Item_cache
-{
- NativeBufferInet6 m_value;
-public:
- Item_cache_inet6(THD *thd)
- :Item_cache(thd, &type_handler_inet6)
- { }
- Item *get_copy(THD *thd)
- { return get_item_copy<Item_cache_inet6>(thd, this); }
- bool cache_value()
- {
- if (!example)
- return false;
- value_cached= true;
- /*
- Merge comments: in 10.7 this code migrated to
- Item_cache_fbt in to sql/sql_type_fixedbin.h
- */
- null_value_inside= null_value=
- example->val_native_with_conversion_result(current_thd,
- &m_value,
- type_handler());
- return true;
- }
- String* val_str(String *to)
- {
- if (!has_value())
- return NULL;
- Inet6_null tmp(m_value.ptr(), m_value.length());
- return tmp.is_null() || tmp.to_string(to) ? NULL : to;
- }
- my_decimal *val_decimal(my_decimal *to)
- {
- if (!has_value())
- return NULL;
- my_decimal_set_zero(to);
- return to;
- }
- longlong val_int()
- {
- if (!has_value())
- return 0;
- return 0;
- }
- double val_real()
- {
- if (!has_value())
- return 0;
- return 0;
- }
- longlong val_datetime_packed(THD *thd)
- {
- DBUG_ASSERT(0);
- if (!has_value())
- return 0;
- return 0;
- }
- longlong val_time_packed(THD *thd)
- {
- DBUG_ASSERT(0);
- if (!has_value())
- return 0;
- return 0;
- }
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
- {
- if (!has_value())
- return true;
- set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
- return false;
- }
- bool val_native(THD *thd, Native *to)
- {
- if (!has_value())
- return true;
- return to->copy(m_value.ptr(), m_value.length());
- }
-};
-
-
-class Item_literal_inet6: public Item_literal
-{
- Inet6 m_value;
-public:
- Item_literal_inet6(THD *thd)
- :Item_literal(thd),
- m_value(Inet6_zero())
- { }
- Item_literal_inet6(THD *thd, const Inet6 &value)
- :Item_literal(thd),
- m_value(value)
- { }
- const Type_handler *type_handler() const override
- {
- return &type_handler_inet6;
- }
- longlong val_int() override
- {
- return 0;
- }
- double val_real() override
- {
- return 0;
- }
- String *val_str(String *to) override
- {
- return m_value.to_string(to) ? NULL : to;
- }
- my_decimal *val_decimal(my_decimal *to) override
- {
- my_decimal_set_zero(to);
- return to;
- }
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
- {
- set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
- return false;
- }
- bool val_native(THD *thd, Native *to) override
- {
- return m_value.to_native(to);
- }
- void print(String *str, enum_query_type query_type) override
- {
- StringBufferInet6 tmp;
- m_value.to_string(&tmp);
- str->append(STRING_WITH_LEN("INET6'"));
- str->append(tmp);
- str->append('\'');
- }
- Item *get_copy(THD *thd) override
- { return get_item_copy<Item_literal_inet6>(thd, this); }
-
- // Non-overriding methods
- void set_value(const Inet6 &value)
- {
- m_value= value;
- }
-};
-
-
-class Item_copy_inet6: public Item_copy
-{
- NativeBufferInet6 m_value;
-public:
- Item_copy_inet6(THD *thd, Item *item_arg): Item_copy(thd, item_arg) {}
-
- bool val_native(THD *thd, Native *to) override
- {
- if (null_value)
- return true;
- return to->copy(m_value.ptr(), m_value.length());
- }
- String *val_str(String *to) override
- {
- if (null_value)
- return NULL;
- Inet6_null tmp(m_value.ptr(), m_value.length());
- return tmp.is_null() || tmp.to_string(to) ? NULL : to;
- }
- my_decimal *val_decimal(my_decimal *to) override
- {
- my_decimal_set_zero(to);
- return to;
- }
- double val_real() override
- {
- return 0;
- }
- longlong val_int() override
- {
- return 0;
- }
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
- {
- set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
- return null_value;
- }
- void copy() override
- {
- null_value= item->val_native(current_thd, &m_value);
- DBUG_ASSERT(null_value == item->null_value);
- }
- int save_in_field(Field *field, bool no_conversions) override
- {
- return Item::save_in_field(field, no_conversions);
- }
- Item *get_copy(THD *thd) override
- { return get_item_copy<Item_copy_inet6>(thd, this); }
-};
-
-
-class in_inet6 :public in_vector
-{
- Inet6 m_value;
- static int cmp_inet6(void *cmp_arg, Inet6 *a, Inet6 *b)
- {
- return a->cmp(*b);
- }
-public:
- in_inet6(THD *thd, uint elements)
- :in_vector(thd, elements, sizeof(Inet6), (qsort2_cmp) cmp_inet6, 0),
- m_value(Inet6_zero())
- { }
- const Type_handler *type_handler() const override
- {
- return &type_handler_inet6;
- }
- void set(uint pos, Item *item) override
- {
- Inet6 *buff= &((Inet6 *) base)[pos];
- Inet6_null value(item);
- if (value.is_null())
- *buff= Inet6_zero();
- else
- *buff= value;
- }
- uchar *get_value(Item *item) override
- {
- Inet6_null value(item);
- if (value.is_null())
- return 0;
- m_value= value;
- return (uchar *) &m_value;
- }
- Item* create_item(THD *thd) override
- {
- return new (thd->mem_root) Item_literal_inet6(thd);
- }
- void value_to_item(uint pos, Item *item) override
- {
- const Inet6 &buff= (((Inet6*) base)[pos]);
- static_cast<Item_literal_inet6*>(item)->set_value(buff);
- }
-};
-
-
-class Item_char_typecast_func_handler_inet6_to_binary:
- public Item_handled_func::Handler_str
-{
-public:
- const Type_handler *return_type_handler(const Item_handled_func *item)
- const override
- {
- if (item->max_length > MAX_FIELD_VARCHARLENGTH)
- return Type_handler::blob_type_handler(item->max_length);
- if (item->max_length > 255)
- return &type_handler_varchar;
- return &type_handler_string;
- }
- bool fix_length_and_dec(Item_handled_func *xitem) const override
- {
- return false;
- }
- String *val_str(Item_handled_func *item, String *to) const override
- {
- DBUG_ASSERT(dynamic_cast<const Item_char_typecast*>(item));
- return static_cast<Item_char_typecast*>(item)->
- val_str_binary_from_native(to);
- }
-};
-
-
-static Item_char_typecast_func_handler_inet6_to_binary
- item_char_typecast_func_handler_inet6_to_binary;
-
-
-bool Type_handler_inet6::
- Item_char_typecast_fix_length_and_dec(Item_char_typecast *item) const
-{
- if (item->cast_charset() == &my_charset_bin)
- {
- item->fix_length_and_dec_native_to_binary(Inet6::binary_length());
- item->set_func_handler(&item_char_typecast_func_handler_inet6_to_binary);
- return false;
- }
- item->fix_length_and_dec_str();
- return false;
-}
-
-
-bool
-Type_handler_inet6::character_or_binary_string_to_native(THD *thd,
- const String *str,
- Native *to) const
-{
- if (str->charset() == &my_charset_bin)
- {
- // Convert from a binary string
- if (str->length() != Inet6::binary_length() ||
- to->copy(str->ptr(), str->length()))
- {
- thd->push_warning_wrong_value(Sql_condition::WARN_LEVEL_WARN,
- name().ptr(),
- ErrConvString(str).ptr());
- return true;
- }
- return false;
- }
- // Convert from a character string
- Inet6_null tmp(*str);
- if (tmp.is_null())
- thd->push_warning_wrong_value(Sql_condition::WARN_LEVEL_WARN,
- name().ptr(), ErrConvString(str).ptr());
- return tmp.is_null() || tmp.to_native(to);
-}
-
-
-bool
-Type_handler_inet6::Item_save_in_value(THD *thd, Item *item,
- st_value *value) const
-{
- value->m_type= DYN_COL_STRING;
- String *str= item->val_str(&value->m_string);
- if (str != &value->m_string && !item->null_value)
- {
- // "item" returned a non-NULL value
- if (Inet6_null(*str).is_null())
- {
- /*
- The value was not-null, but conversion to INET6 failed:
- SELECT a, DECODE_ORACLE(inet6col, 'garbage', '<NULL>', '::01', '01')
- FROM t1;
- */
- thd->push_warning_wrong_value(Sql_condition::WARN_LEVEL_WARN,
- name().ptr(), ErrConvString(str).ptr());
- value->m_type= DYN_COL_NULL;
- return true;
- }
- // "item" returned a non-NULL value, and it was a valid INET6
- value->m_string.set(str->ptr(), str->length(), str->charset());
- }
- return check_null(item, value);
-}
-
-
-void Type_handler_inet6::Item_param_setup_conversion(THD *thd,
- Item_param *param) const
-{
- param->setup_conversion_string(thd, thd->variables.character_set_client);
-}
-
-
-void Type_handler_inet6::make_sort_key_part(uchar *to, Item *item,
- const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const
-{
- DBUG_ASSERT(item->type_handler() == this);
- NativeBufferInet6 tmp;
- item->val_native_result(current_thd, &tmp);
- if (item->maybe_null())
- {
- if (item->null_value)
- {
- memset(to, 0, Inet6::binary_length() + 1);
- return;
- }
- *to++= 1;
- }
- DBUG_ASSERT(!item->null_value);
- DBUG_ASSERT(Inet6::binary_length() == tmp.length());
- DBUG_ASSERT(Inet6::binary_length() == sort_field->length);
- memcpy(to, tmp.ptr(), tmp.length());
-}
-
-uint
-Type_handler_inet6::make_packed_sort_key_part(uchar *to, Item *item,
- const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const
-{
- DBUG_ASSERT(item->type_handler() == this);
- NativeBufferInet6 tmp;
- item->val_native_result(current_thd, &tmp);
- if (item->maybe_null())
- {
- if (item->null_value)
- {
- *to++=0;
- return 0;
- }
- *to++= 1;
- }
- DBUG_ASSERT(!item->null_value);
- DBUG_ASSERT(Inet6::binary_length() == tmp.length());
- DBUG_ASSERT(Inet6::binary_length() == sort_field->length);
- memcpy(to, tmp.ptr(), tmp.length());
- return tmp.length();
-}
-
-void Type_handler_inet6::sort_length(THD *thd,
- const Type_std_attributes *item,
- SORT_FIELD_ATTR *attr) const
-{
- attr->original_length= attr->length= Inet6::binary_length();
- attr->suffix_length= 0;
-}
-
-
-cmp_item *Type_handler_inet6::make_cmp_item(THD *thd, CHARSET_INFO *cs) const
-{
- return new (thd->mem_root) cmp_item_inet6;
-}
-
-
-
-in_vector *
-Type_handler_inet6::make_in_vector(THD *thd, const Item_func_in *func,
- uint nargs) const
-{
- return new (thd->mem_root) in_inet6(thd, nargs);
-}
-
-
-Item *Type_handler_inet6::create_typecast_item(THD *thd, Item *item,
- const Type_cast_attributes &attr)
- const
-{
- return new (thd->mem_root) Item_typecast_inet6(thd, item);
-}
-
-
-Item_cache *Type_handler_inet6::Item_get_cache(THD *thd, const Item *item) const
-{
- return new (thd->mem_root) Item_cache_inet6(thd);
-}
-
-
-Item_copy *Type_handler_inet6::create_item_copy(THD *thd, Item *item) const
-{
- return new (thd->mem_root) Item_copy_inet6(thd, item);
-}
-
-
-Item *
-Type_handler_inet6::make_const_item_for_comparison(THD *thd,
- Item *src,
- const Item *cmp) const
-{
- Inet6_null tmp(src);
- if (tmp.is_null())
- return new (thd->mem_root) Item_null(thd, src->name.str);
- return new (thd->mem_root) Item_literal_inet6(thd, tmp);
-}
-
-
-Item *Field_inet6::get_equal_const_item(THD *thd, const Context &ctx,
- Item *const_item)
-{
- Inet6_null tmp(const_item);
- if (tmp.is_null())
- return NULL;
- return new (thd->mem_root) Item_literal_inet6(thd, tmp);
-}
-
-
-Field *
-Type_handler_inet6::make_table_field_from_def(
- TABLE_SHARE *share,
- MEM_ROOT *mem_root,
- const LEX_CSTRING *name,
- const Record_addr &addr,
- const Bit_addr &bit,
- const Column_definition_attributes *attr,
- uint32 flags) const
-{
- return new (mem_root) Field_inet6(name, addr);
-}
-
-
-Field *Type_handler_inet6::make_table_field(MEM_ROOT *root,
- const LEX_CSTRING *name,
- const Record_addr &addr,
- const Type_all_attributes &attr,
- TABLE_SHARE *share) const
-{
- return new (root) Field_inet6(name, addr);
-}
-
-
-Field *Type_handler_inet6::make_conversion_table_field(MEM_ROOT *root,
- TABLE *table,
- uint metadata,
- const Field *target)
- const
-{
- const Record_addr tmp(NULL, Bit_addr(true));
- return new (table->in_use->mem_root) Field_inet6(&empty_clex_str, tmp);
-}
-
-
-bool Type_handler_inet6::partition_field_check(const LEX_CSTRING &field_name,
- Item *item_expr) const
-{
- if (item_expr->cmp_type() != STRING_RESULT)
- {
- my_error(ER_WRONG_TYPE_COLUMN_VALUE_ERROR, MYF(0));
- return true;
- }
- return false;
-}
-
-
-bool
-Type_handler_inet6::partition_field_append_value(
- String *to,
- Item *item_expr,
- CHARSET_INFO *field_cs,
- partition_value_print_mode_t mode)
- const
-{
- StringBufferInet6 inet6str;
- Inet6_null inet6(item_expr);
- if (inet6.is_null())
- {
- my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
- return true;
- }
- return inet6.to_string(&inet6str) ||
- to->append('\'') ||
- to->append(inet6str) ||
- to->append('\'');
-}
-
-
-/***************************************************************/
-
-
-class Type_collection_inet: public Type_collection
-{
- const Type_handler *aggregate_common(const Type_handler *a,
- const Type_handler *b) const
- {
- if (a == b)
- return a;
- return NULL;
- }
- const Type_handler *aggregate_if_string(const Type_handler *a,
- const Type_handler *b) const
- {
- static const Type_aggregator::Pair agg[]=
- {
- {&type_handler_inet6, &type_handler_null, &type_handler_inet6},
- {&type_handler_inet6, &type_handler_varchar, &type_handler_inet6},
- {&type_handler_inet6, &type_handler_string, &type_handler_inet6},
- {&type_handler_inet6, &type_handler_tiny_blob, &type_handler_inet6},
- {&type_handler_inet6, &type_handler_blob, &type_handler_inet6},
- {&type_handler_inet6, &type_handler_medium_blob, &type_handler_inet6},
- {&type_handler_inet6, &type_handler_long_blob, &type_handler_inet6},
- {&type_handler_inet6, &type_handler_hex_hybrid, &type_handler_inet6},
- {NULL,NULL,NULL}
- };
- return Type_aggregator::find_handler_in_array(agg, a, b, true);
- }
-public:
- const Type_handler *aggregate_for_result(const Type_handler *a,
- const Type_handler *b)
- const override
- {
- const Type_handler *h;
- if ((h= aggregate_common(a, b)) ||
- (h= aggregate_if_string(a, b)))
- return h;
- return NULL;
- }
-
- const Type_handler *aggregate_for_min_max(const Type_handler *a,
- const Type_handler *b)
- const override
- {
- return aggregate_for_result(a, b);
- }
-
- const Type_handler *aggregate_for_comparison(const Type_handler *a,
- const Type_handler *b)
- const override
- {
- if (const Type_handler *h= aggregate_common(a, b))
- return h;
- static const Type_aggregator::Pair agg[]=
- {
- {&type_handler_inet6, &type_handler_null, &type_handler_inet6},
- {&type_handler_inet6, &type_handler_long_blob, &type_handler_inet6},
- {NULL,NULL,NULL}
- };
- return Type_aggregator::find_handler_in_array(agg, a, b, true);
- }
-
- const Type_handler *aggregate_for_num_op(const Type_handler *a,
- const Type_handler *b)
- const override
- {
- return NULL;
- }
-
- const Type_handler *handler_by_name(const LEX_CSTRING &name) const override
- {
- if (type_handler_inet6.name().eq(name))
- return &type_handler_inet6;
- return NULL;
- }
-};
-
-
-const Type_collection *Type_handler_inet6::type_collection() const
+const Name &Inet6::default_value()
{
- static Type_collection_inet type_collection_inet;
- return &type_collection_inet;
+ static Name def(STRING_WITH_LEN("::"));
+ return def;
}
diff --git a/plugin/type_inet/sql_type_inet.h b/plugin/type_inet/sql_type_inet.h
index 109718637c6..b0560f1ffe0 100644
--- a/plugin/type_inet/sql_type_inet.h
+++ b/plugin/type_inet/sql_type_inet.h
@@ -1,8 +1,8 @@
#ifndef SQL_TYPE_INET_H
#define SQL_TYPE_INET_H
-/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011,2013, Oracle and/or its affiliates.
Copyright (c) 2014 MariaDB Foundation
- Copyright (c) 2019 MariaDB Corporation
+ Copyright (c) 2019,2021 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
@@ -31,14 +31,20 @@ static const size_t IN6_ADDR_NUM_WORDS= IN6_ADDR_SIZE / 2;
*/
static const uint IN6_ADDR_MAX_CHAR_LENGTH= 8 * 4 + 7;
+#include "sql_type_fixedbin_storage.h"
-class NativeBufferInet6: public NativeBuffer<IN6_ADDR_SIZE+1>
+class Inet6: public FixedBinTypeStorage<IN6_ADDR_SIZE, IN6_ADDR_MAX_CHAR_LENGTH>
{
+public:
+ using FixedBinTypeStorage::FixedBinTypeStorage;
+ bool ascii_to_fbt(const char *str, size_t str_length);
+ size_t to_string(char *dst, size_t dstsize) const;
+ static const Name &default_value();
};
-class StringBufferInet6: public StringBuffer<IN6_ADDR_MAX_CHAR_LENGTH+1>
-{
-};
+
+#include "sql_type_fixedbin.h"
+typedef FixedBinTypeBundle<Inet6> Inet6Bundle;
/***********************************************************************/
@@ -132,898 +138,4 @@ public:
}
};
-
-class Inet6
-{
-protected:
- char m_buffer[IN6_ADDR_SIZE];
- bool make_from_item(Item *item, bool warn);
- bool ascii_to_ipv6(const char *str, size_t str_length);
- bool character_string_to_ipv6(const char *str, size_t str_length,
- CHARSET_INFO *cs)
- {
- if (cs->state & MY_CS_NONASCII)
- {
- char tmp[IN6_ADDR_MAX_CHAR_LENGTH];
- String_copier copier;
- uint length= copier.well_formed_copy(&my_charset_latin1, tmp, sizeof(tmp),
- cs, str, str_length);
- return ascii_to_ipv6(tmp, length);
- }
- return ascii_to_ipv6(str, str_length);
- }
- bool make_from_character_or_binary_string(const String *str, bool warn);
- bool binary_to_ipv6(const char *str, size_t length)
- {
- if (length != sizeof(m_buffer))
- return true;
- memcpy(m_buffer, str, length);
- return false;
- }
-
- Inet6() { }
-
-public:
- static uint binary_length() { return IN6_ADDR_SIZE; }
- /**
- Non-abbreviated syntax is 8 groups, up to 4 digits each,
- plus 7 delimiters between the groups.
- Abbreviated syntax is even shorter.
- */
- static uint max_char_length() { return IN6_ADDR_MAX_CHAR_LENGTH; }
-
- static bool only_zero_bytes(const char *ptr, uint length)
- {
- for (uint i= 0 ; i < length; i++)
- {
- if (ptr[i] != 0)
- return false;
- }
- return true;
- }
-
- /*
- Check at Item's fix_fields() time if "item" can return a nullable value
- on conversion to INET6, or conversion produces a NOT NULL INET6 value.
- */
- static bool fix_fields_maybe_null_on_conversion_to_inet6(Item *item);
-
-public:
-
- Inet6(Item *item, bool *error, bool warn= true)
- {
- *error= make_from_item(item, warn);
- }
- void to_binary(char *str, size_t str_size) const
- {
- DBUG_ASSERT(str_size >= sizeof(m_buffer));
- memcpy(str, m_buffer, sizeof(m_buffer));
- }
- bool to_binary(String *to) const
- {
- return to->copy(m_buffer, sizeof(m_buffer), &my_charset_bin);
- }
- bool to_native(Native *to) const
- {
- return to->copy(m_buffer, sizeof(m_buffer));
- }
- size_t to_string(char *dst, size_t dstsize) const;
- bool to_string(String *to) const
- {
- to->set_charset(&my_charset_latin1);
- if (to->alloc(INET6_ADDRSTRLEN))
- return true;
- to->length((uint32) to_string((char*) to->ptr(), INET6_ADDRSTRLEN));
- return false;
- }
- bool is_v4compat() const
- {
- static_assert(sizeof(in6_addr) == IN6_ADDR_SIZE, "unexpected in6_addr size");
- return IN6_IS_ADDR_V4COMPAT((struct in6_addr *) m_buffer);
- }
- bool is_v4mapped() const
- {
- static_assert(sizeof(in6_addr) == IN6_ADDR_SIZE, "unexpected in6_addr size");
- return IN6_IS_ADDR_V4MAPPED((struct in6_addr *) m_buffer);
- }
- int cmp(const char *str, size_t length) const
- {
- DBUG_ASSERT(length == sizeof(m_buffer));
- return memcmp(m_buffer, str, length);
- }
- int cmp(const Binary_string &other) const
- {
- return cmp(other.ptr(), other.length());
- }
- int cmp(const Inet6 &other) const
- {
- return memcmp(m_buffer, other.m_buffer, sizeof(m_buffer));
- }
-};
-
-
-class Inet6_zero: public Inet6
-{
-public:
- Inet6_zero()
- {
- bzero(&m_buffer, sizeof(m_buffer));
- }
-};
-
-
-class Inet6_null: public Inet6, public Null_flag
-{
-public:
- // Initialize from a text representation
- Inet6_null(const char *str, size_t length, CHARSET_INFO *cs)
- :Null_flag(character_string_to_ipv6(str, length, cs))
- { }
- Inet6_null(const String &str)
- :Inet6_null(str.ptr(), str.length(), str.charset())
- { }
- // Initialize from a binary representation
- Inet6_null(const char *str, size_t length)
- :Null_flag(binary_to_ipv6(str, length))
- { }
- Inet6_null(const Binary_string &str)
- :Inet6_null(str.ptr(), str.length())
- { }
- // Initialize from an Item
- Inet6_null(Item *item, bool warn= true)
- :Null_flag(make_from_item(item, warn))
- { }
-public:
- const Inet6& to_inet6() const
- {
- DBUG_ASSERT(!is_null());
- return *this;
- }
- void to_binary(char *str, size_t str_size) const
- {
- to_inet6().to_binary(str, str_size);
- }
- bool to_binary(String *to) const
- {
- return to_inet6().to_binary(to);
- }
- size_t to_string(char *dst, size_t dstsize) const
- {
- return to_inet6().to_string(dst, dstsize);
- }
- bool to_string(String *to) const
- {
- return to_inet6().to_string(to);
- }
- bool is_v4compat() const
- {
- return to_inet6().is_v4compat();
- }
- bool is_v4mapped() const
- {
- return to_inet6().is_v4mapped();
- }
-};
-
-
-class Type_std_attributes_inet6: public Type_std_attributes
-{
-public:
- Type_std_attributes_inet6()
- :Type_std_attributes(
- Type_numeric_attributes(Inet6::max_char_length(), 0, true),
- DTCollation_numeric())
- { }
-};
-
-
-class Type_handler_inet6: public Type_handler
-{
- bool character_or_binary_string_to_native(THD *thd, const String *str,
- Native *to) const;
-public:
- ~Type_handler_inet6() override {}
-
- const Type_collection *type_collection() const override;
- const Name &default_value() const override
- {
- static Name def(STRING_WITH_LEN("::"));
- return def;
- }
- protocol_send_type_t protocol_send_type() const override
- {
- return PROTOCOL_SEND_STRING;
- }
- bool Item_append_extended_type_info(Send_field_extended_metadata *to,
- const Item *item) const override
- {
- return to->set_data_type_name(name().lex_cstring());
- }
-
- enum_field_types field_type() const override
- {
- return MYSQL_TYPE_STRING;
- }
-
- Item_result result_type() const override
- {
- return STRING_RESULT;
- }
-
- Item_result cmp_type() const override
- {
- return STRING_RESULT;
- }
-
- enum_dynamic_column_type dyncol_type(const Type_all_attributes *attr)
- const override
- {
- return DYN_COL_STRING;
- }
-
- uint32 max_display_length_for_field(const Conv_source &src) const override
- {
- return Inet6::max_char_length();
- }
-
- const Type_handler *type_handler_for_comparison() const override
- {
- return this;
- }
-
- int
- stored_field_cmp_to_item(THD *thd, Field *field, Item *item) const override
- {
- DBUG_ASSERT(field->type_handler() == this);
- Inet6_null ni(item); // Convert Item to INET6
- if (ni.is_null())
- return 0;
- NativeBufferInet6 tmp;
- if (field->val_native(&tmp))
- {
- DBUG_ASSERT(0);
- return 0;
- }
- return -ni.cmp(tmp);
- }
- CHARSET_INFO *charset_for_protocol(const Item *item) const override
- {
- return item->collation.collation;
- }
-
- bool is_scalar_type() const override { return true; }
- bool is_val_native_ready() const override { return true; }
- bool can_return_int() const override { return false; }
- bool can_return_decimal() const override { return false; }
- bool can_return_real() const override { return false; }
- bool can_return_str() const override { return true; }
- bool can_return_text() const override { return true; }
- bool can_return_date() const override { return false; }
- bool can_return_time() const override { return false; }
- bool convert_to_binary_using_val_native() const override { return true; }
-
- decimal_digits_t Item_time_precision(THD *thd, Item *item) const override
- {
- return 0;
- }
- decimal_digits_t Item_datetime_precision(THD *thd, Item *item) const override
- {
- return 0;
- }
- decimal_digits_t Item_decimal_scale(const Item *item) const override
- {
- return 0;
- }
- decimal_digits_t Item_decimal_precision(const Item *item) const override
- {
- /*
- This will be needed if we ever allow cast from INET6 to DECIMAL.
- Decimal precision of INET6 is 39 digits:
- 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' =
- 340282366920938463463374607431768211456 = 39 digits
- */
- return 39;
- }
-
- /*
- Returns how many digits a divisor adds into a division result.
- See Item::divisor_precision_increment() in item.h for more comments.
- */
- decimal_digits_t Item_divisor_precision_increment(const Item *) const override
- {
- return 0;
- }
- /**
- Makes a temporary table Field to handle numeric aggregate functions,
- e.g. SUM(DISTINCT expr), AVG(DISTINCT expr), etc.
- */
- Field *make_num_distinct_aggregator_field(MEM_ROOT *,
- const Item *) const override
- {
- DBUG_ASSERT(0);
- return 0;
- }
- Field *make_conversion_table_field(MEM_ROOT *root,
- TABLE *TABLE,
- uint metadata,
- const Field *target) const override;
- // Fix attributes after the parser
- bool Column_definition_fix_attributes(Column_definition *c) const override
- {
- c->length= Inet6::max_char_length();
- return false;
- }
-
- bool Column_definition_prepare_stage1(THD *thd,
- MEM_ROOT *mem_root,
- Column_definition *def,
- handler *file,
- ulonglong table_flags,
- const Column_derived_attributes
- *derived_attr)
- const override
- {
- def->prepare_stage1_simple(&my_charset_numeric);
- return false;
- }
-
- bool Column_definition_redefine_stage1(Column_definition *def,
- const Column_definition *dup,
- const handler *file)
- const override
- {
- def->redefine_stage1_common(dup, file);
- def->set_compression_method(dup->compression_method());
- def->create_length_to_internal_length_string();
- return false;
- }
-
- bool Column_definition_prepare_stage2(Column_definition *def,
- handler *file,
- ulonglong table_flags) const override
- {
- def->pack_flag= FIELDFLAG_BINARY;
- return false;
- }
-
- bool partition_field_check(const LEX_CSTRING &field_name,
- Item *item_expr) const override;
-
- bool partition_field_append_value(String *to,
- Item *item_expr,
- CHARSET_INFO *field_cs,
- partition_value_print_mode_t mode)
- const override;
-
- Field *make_table_field(MEM_ROOT *root,
- const LEX_CSTRING *name,
- const Record_addr &addr,
- const Type_all_attributes &attr,
- TABLE_SHARE *table) const override;
-
- Field *
- make_table_field_from_def(TABLE_SHARE *share,
- MEM_ROOT *mem_root,
- const LEX_CSTRING *name,
- const Record_addr &addr,
- const Bit_addr &bit,
- const Column_definition_attributes *attr,
- uint32 flags) const override;
- void
- Column_definition_attributes_frm_pack(const Column_definition_attributes *def,
- uchar *buff) const override
- {
- def->frm_pack_basic(buff);
- def->frm_pack_charset(buff);
- }
- bool
- Column_definition_attributes_frm_unpack(Column_definition_attributes *def,
- TABLE_SHARE *share,
- const uchar *buffer,
- LEX_CUSTRING *gis_options)
- const override
- {
- def->frm_unpack_basic(buffer);
- return def->frm_unpack_charset(share, buffer);
- }
- void make_sort_key_part(uchar *to, Item *item,
- const SORT_FIELD_ATTR *sort_field,
- Sort_param *param)
- const override;
- uint make_packed_sort_key_part(uchar *to, Item *item,
- const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const override;
- void sort_length(THD *thd,
- const Type_std_attributes *item,
- SORT_FIELD_ATTR *attr) const override;
- uint32 max_display_length(const Item *item) const override
- {
- return Inet6::max_char_length();
- }
- uint32 calc_pack_length(uint32 length) const override
- {
- return Inet6::binary_length();
- }
- void Item_update_null_value(Item *item) const override
- {
- NativeBufferInet6 tmp;
- item->val_native(current_thd, &tmp);
- }
- bool Item_save_in_value(THD *thd, Item *item, st_value *value) const override;
- void Item_param_setup_conversion(THD *thd, Item_param *param) const override;
- void Item_param_set_param_func(Item_param *param,
- uchar **pos, ulong len) const override
- {
- param->set_param_str(pos, len);
- }
- bool Item_param_set_from_value(THD *thd,
- Item_param *param,
- const Type_all_attributes *attr,
- const st_value *val) const override
- {
- param->unsigned_flag= false;//QQ
- param->setup_conversion_string(thd, attr->collation.collation);
- /*
- Exact value of max_length is not known unless data is converted to
- charset of connection, so we have to set it later.
- */
- return param->set_str(val->m_string.ptr(), val->m_string.length(),
- attr->collation.collation,
- attr->collation.collation);
- }
- bool Item_param_val_native(THD *thd, Item_param *item, Native *to)
- const override
- {
- StringBufferInet6 buffer;
- String *str= item->val_str(&buffer);
- if (!str)
- return true;
- Inet6_null tmp(*str);
- return tmp.is_null() || tmp.to_native(to);
- }
- bool Item_send(Item *item, Protocol *p, st_value *buf) const override
- {
- return Item_send_str(item, p, buf);
- }
- int Item_save_in_field(Item *item, Field *field, bool no_conversions)
- const override
- {
- if (field->type_handler() == this)
- {
- NativeBuffer<MAX_FIELD_WIDTH> tmp;
- bool rc= item->val_native(current_thd, &tmp);
- if (rc || item->null_value)
- return set_field_to_null_with_conversions(field, no_conversions);
- field->set_notnull();
- return field->store_native(tmp);
- }
- return item->save_str_in_field(field, no_conversions);
- }
-
- String *print_item_value(THD *thd, Item *item, String *str) const override
- {
- StringBufferInet6 buf;
- String *result= item->val_str(&buf);
- /*
- TODO: This should eventually use one of these notations:
- 1. CAST('::' AS INET6)
- Problem: CAST is not supported as a NAME_CONST() argument.
- 2. INET6'::
- Problem: This syntax is not supported by the parser yet.
- */
- return !result ||
- str->realloc(result->length() + 2) ||
- str->append(STRING_WITH_LEN("'")) ||
- str->append(result->ptr(), result->length()) ||
- str->append(STRING_WITH_LEN("'")) ?
- NULL :
- str;
- }
-
- /**
- Check if
- WHERE expr=value AND expr=const
- can be rewritten as:
- WHERE const=value AND expr=const
-
- "this" is the comparison handler that is used by "target".
-
- @param target - the predicate expr=value,
- whose "expr" argument will be replaced to "const".
- @param target_expr - the target's "expr" which will be replaced to "const".
- @param target_value - the target's second argument, it will remain unchanged.
- @param source - the equality predicate expr=const (or expr<=>const)
- that can be used to rewrite the "target" part
- (under certain conditions, see the code).
- @param source_expr - the source's "expr". It should be exactly equal to
- the target's "expr" to make condition rewrite possible.
- @param source_const - the source's "const" argument, it will be inserted
- into "target" instead of "expr".
- */
- bool
- can_change_cond_ref_to_const(Item_bool_func2 *target,
- Item *target_expr, Item *target_value,
- Item_bool_func2 *source,
- Item *source_expr, Item *source_const)
- const override
- {
- /*
- WHERE COALESCE(inet6_col)='::1' AND COALESCE(inet6_col)=CONCAT(a); -->
- WHERE COALESCE(inet6_col)='::1' AND '::1'=CONCAT(a);
- */
- return target->compare_type_handler() == source->compare_type_handler();
- }
- bool
- subquery_type_allows_materialization(const Item *inner,
- const Item *outer, bool) const override
- {
- /*
- Example:
- SELECT * FROM t1 WHERE a IN (SELECT inet6col FROM t1 GROUP BY inet6col);
- Allow materialization only if the outer column is also INET6.
- This can be changed for more relaxed rules in the future.
- */
- DBUG_ASSERT(inner->type_handler() == this);
- return outer->type_handler() == this;
- }
- /**
- Make a simple constant replacement item for a constant "src",
- so the new item can futher be used for comparison with "cmp", e.g.:
- src = cmp -> replacement = cmp
-
- "this" is the type handler that is used to compare "src" and "cmp".
-
- @param thd - current thread, for mem_root
- @param src - The item that we want to replace. It's a const item,
- but it can be complex enough to calculate on every row.
- @param cmp - The src's comparand.
- @retval - a pointer to the created replacement Item
- @retval - NULL, if could not create a replacement (e.g. on EOM).
- NULL is also returned for ROWs, because instead of replacing
- a Item_row to a new Item_row, Type_handler_row just replaces
- its elements.
- */
- Item *make_const_item_for_comparison(THD *thd,
- Item *src,
- const Item *cmp) const override;
- Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
-
- Item *create_typecast_item(THD *thd, Item *item,
- const Type_cast_attributes &attr) const override;
-
- Item_copy *create_item_copy(THD *thd, Item *item) const override;
- int cmp_native(const Native &a, const Native &b) const override
- {
- DBUG_ASSERT(a.length() == Inet6::binary_length());
- DBUG_ASSERT(b.length() == Inet6::binary_length());
- return memcmp(a.ptr(), b.ptr(), Inet6::binary_length());
- }
- bool set_comparator_func(THD *thd, Arg_comparator *cmp) const override
- {
- return cmp->set_cmp_func_native(thd);
- }
- bool Item_const_eq(const Item_const *a, const Item_const *b,
- bool binary_cmp) const override
- {
- return false;//QQ
- }
- bool Item_eq_value(THD *thd, const Type_cmp_attributes *attr,
- Item *a, Item *b) const override
- {
- Inet6_null na(a);
- Inet6_null nb(b);
- return !na.is_null() && !nb.is_null() && !na.cmp(nb);
- }
- bool Item_hybrid_func_fix_attributes(THD *thd,
- const LEX_CSTRING &name,
- Type_handler_hybrid_field_type *h,
- Type_all_attributes *attr,
- Item **items,
- uint nitems) const override
- {
- attr->Type_std_attributes::operator=(Type_std_attributes_inet6());
- h->set_handler(this);
- /*
- If some of the arguments cannot be safely converted to "INET6 NOT NULL",
- then mark the entire function nullability as NULL-able.
- Otherwise, keep the generic nullability calculated by earlier stages:
- - either by the most generic way in Item_func::fix_fields()
- - or by Item_func_xxx::fix_length_and_dec() before the call of
- Item_hybrid_func_fix_attributes()
- IFNULL() is special. It does not need to test args[0].
- */
- uint first= dynamic_cast<Item_func_ifnull*>(attr) ? 1 : 0;
- for (uint i= first; i < nitems; i++)
- {
- if (Inet6::fix_fields_maybe_null_on_conversion_to_inet6(items[i]))
- {
- attr->set_type_maybe_null(true);
- break;
- }
- }
- return false;
- }
- bool Item_func_min_max_fix_attributes(THD *thd,
- Item_func_min_max *func,
- Item **items,
- uint nitems) const override
- {
- return Item_hybrid_func_fix_attributes(thd, func->func_name_cstring(),
- func, func, items, nitems);
-
- }
- bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const override
- {
- func->Type_std_attributes::operator=(Type_std_attributes_inet6());
- func->set_handler(this);
- return false;
- }
- bool Item_sum_sum_fix_length_and_dec(Item_sum_sum *func) const override
- {
- return Item_func_or_sum_illegal_param(func);
- }
- bool Item_sum_avg_fix_length_and_dec(Item_sum_avg *func) const override
- {
- return Item_func_or_sum_illegal_param(func);
- }
- bool Item_sum_variance_fix_length_and_dec(Item_sum_variance *func) const override
- {
- return Item_func_or_sum_illegal_param(func);
- }
-
- bool Item_val_native_with_conversion(THD *thd, Item *item,
- Native *to) const override
- {
- if (item->type_handler() == this)
- return item->val_native(thd, to); // No conversion needed
- StringBufferInet6 buffer;
- String *str= item->val_str(&buffer);
- return str ? character_or_binary_string_to_native(thd, str, to) : true;
- }
- bool Item_val_native_with_conversion_result(THD *thd, Item *item,
- Native *to) const override
- {
- if (item->type_handler() == this)
- return item->val_native_result(thd, to); // No conversion needed
- StringBufferInet6 buffer;
- String *str= item->str_result(&buffer);
- return str ? character_or_binary_string_to_native(thd, str, to) : true;
- }
-
- bool Item_val_bool(Item *item) const override
- {
- NativeBufferInet6 tmp;
- if (item->val_native(current_thd, &tmp))
- return false;
- return !Inet6::only_zero_bytes(tmp.ptr(), tmp.length());
- }
- void Item_get_date(THD *thd, Item *item,
- Temporal::Warn *buff, MYSQL_TIME *ltime,
- date_mode_t fuzzydate) const override
- {
- set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
- }
-
- longlong Item_val_int_signed_typecast(Item *item) const override
- {
- DBUG_ASSERT(0);
- return 0;
- }
-
- longlong Item_val_int_unsigned_typecast(Item *item) const override
- {
- DBUG_ASSERT(0);
- return 0;
- }
-
- String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str)
- const override
- {
- NativeBufferInet6 tmp;
- if ((item->null_value= item->arguments()[0]->val_native(current_thd, &tmp)))
- return NULL;
- DBUG_ASSERT(tmp.length() == Inet6::binary_length());
- if (str->set_hex(tmp.ptr(), tmp.length()))
- {
- str->length(0);
- str->set_charset(item->collation.collation);
- }
- return str;
- }
-
- String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *item,
- String *str) const override
- {
- NativeBufferInet6 native;
- if (item->val_native(current_thd, &native))
- {
- DBUG_ASSERT(item->null_value);
- return NULL;
- }
- DBUG_ASSERT(native.length() == Inet6::binary_length());
- Inet6_null tmp(native.ptr(), native.length());
- return tmp.is_null() || tmp.to_string(str) ? NULL : str;
- }
- double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *)
- const override
- {
- return 0;
- }
- longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *)
- const override
- {
- return 0;
- }
- my_decimal *
- Item_func_hybrid_field_type_val_decimal(Item_func_hybrid_field_type *,
- my_decimal *to) const override
- {
- my_decimal_set_zero(to);
- return to;
- }
- void Item_func_hybrid_field_type_get_date(THD *,
- Item_func_hybrid_field_type *,
- Temporal::Warn *,
- MYSQL_TIME *to,
- date_mode_t fuzzydate)
- const override
- {
- set_zero_time(to, MYSQL_TIMESTAMP_TIME);
- }
- // WHERE is Item_func_min_max_val_native???
- String *Item_func_min_max_val_str(Item_func_min_max *func, String *str)
- const override
- {
- Inet6_null tmp(func);
- return tmp.is_null() || tmp.to_string(str) ? NULL : str;
- }
- double Item_func_min_max_val_real(Item_func_min_max *) const override
- {
- return 0;
- }
- longlong Item_func_min_max_val_int(Item_func_min_max *) const override
- {
- return 0;
- }
- my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *,
- my_decimal *to) const override
- {
- my_decimal_set_zero(to);
- return to;
- }
- bool Item_func_min_max_get_date(THD *thd, Item_func_min_max*,
- MYSQL_TIME *to, date_mode_t fuzzydate)
- const override
- {
- set_zero_time(to, MYSQL_TIMESTAMP_TIME);
- return false;
- }
-
- bool
- Item_func_between_fix_length_and_dec(Item_func_between *func) const override
- {
- return false;
- }
- longlong Item_func_between_val_int(Item_func_between *func) const override
- {
- return func->val_int_cmp_native();
- }
-
- cmp_item *make_cmp_item(THD *thd, CHARSET_INFO *cs) const override;
-
- in_vector *make_in_vector(THD *thd, const Item_func_in *func,
- uint nargs) const override;
-
- bool Item_func_in_fix_comparator_compatible_types(THD *thd,
- Item_func_in *func)
- const override
- {
- if (func->compatible_types_scalar_bisection_possible())
- {
- return func->value_list_convert_const_to_int(thd) ||
- func->fix_for_scalar_comparison_using_bisection(thd);
- }
- return
- func->fix_for_scalar_comparison_using_cmp_items(thd,
- 1U << (uint) STRING_RESULT);
- }
- bool
- Item_func_round_fix_length_and_dec(Item_func_round *func) const override
- {
- return Item_func_or_sum_illegal_param(func);
- }
- bool
- Item_func_int_val_fix_length_and_dec(Item_func_int_val *func) const override
- {
- return Item_func_or_sum_illegal_param(func);
- }
-
- bool Item_func_abs_fix_length_and_dec(Item_func_abs *func) const override
- {
- return Item_func_or_sum_illegal_param(func);
- }
-
- bool Item_func_neg_fix_length_and_dec(Item_func_neg *func) const override
- {
- return Item_func_or_sum_illegal_param(func);
- }
-
- bool
- Item_func_signed_fix_length_and_dec(Item_func_signed *item) const override
- {
- return Item_func_or_sum_illegal_param(item);
- }
- bool
- Item_func_unsigned_fix_length_and_dec(Item_func_unsigned *item) const override
- {
- return Item_func_or_sum_illegal_param(item);
- }
- bool
- Item_double_typecast_fix_length_and_dec(Item_double_typecast *item)
- const override
- {
- return Item_func_or_sum_illegal_param(item);
- }
- bool
- Item_float_typecast_fix_length_and_dec(Item_float_typecast *item)
- const override
- {
- return Item_func_or_sum_illegal_param(item);
- }
- bool
- Item_decimal_typecast_fix_length_and_dec(Item_decimal_typecast *item)
- const override
- {
- return Item_func_or_sum_illegal_param(item);
- }
- bool
- Item_char_typecast_fix_length_and_dec(Item_char_typecast *item)
- const override;
- bool
- Item_time_typecast_fix_length_and_dec(Item_time_typecast *item) const override
- {
- return Item_func_or_sum_illegal_param(item);
- }
- bool
- Item_date_typecast_fix_length_and_dec(Item_date_typecast *item) const override
- {
- return Item_func_or_sum_illegal_param(item);
- }
- bool
- Item_datetime_typecast_fix_length_and_dec(Item_datetime_typecast *item)
- const override
- {
- return Item_func_or_sum_illegal_param(item);
- }
- bool
- Item_func_plus_fix_length_and_dec(Item_func_plus *item) const override
- {
- return Item_func_or_sum_illegal_param(item);
- }
- bool
- Item_func_minus_fix_length_and_dec(Item_func_minus *item) const override
- {
- return Item_func_or_sum_illegal_param(item);
- }
- bool
- Item_func_mul_fix_length_and_dec(Item_func_mul *item) const override
- {
- return Item_func_or_sum_illegal_param(item);
- }
- bool
- Item_func_div_fix_length_and_dec(Item_func_div *item) const override
- {
- return Item_func_or_sum_illegal_param(item);
- }
- bool
- Item_func_mod_fix_length_and_dec(Item_func_mod *item) const override
- {
- return Item_func_or_sum_illegal_param(item);
- }
-};
-
-
-extern MYSQL_PLUGIN_IMPORT Type_handler_inet6 type_handler_inet6;
-
-
#endif /* SQL_TYPE_INET_H */
diff --git a/plugin/type_mysql_json/type.cc b/plugin/type_mysql_json/type.cc
index 7cab4780ee5..7e6576e5df4 100644
--- a/plugin/type_mysql_json/type.cc
+++ b/plugin/type_mysql_json/type.cc
@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
-#include <mysql/plugin_data_type.h>
#include <my_global.h>
+#include <mysql/plugin_data_type.h>
#include <sql_type.h>
#include <field.h>
#include <mysqld_error.h>
diff --git a/plugin/type_uuid/CMakeLists.txt b/plugin/type_uuid/CMakeLists.txt
new file mode 100644
index 00000000000..9a379abef04
--- /dev/null
+++ b/plugin/type_uuid/CMakeLists.txt
@@ -0,0 +1,18 @@
+# Copyright (c) 2019,2021, 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 Foundation; version 2 of the License.
+#
+# 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.
+#
+# 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
+
+MYSQL_ADD_PLUGIN(type_uuid
+ plugin.cc sql_type_uuid.cc item_uuidfunc.cc
+ MANDATORY RECOMPILE_FOR_EMBEDDED)
diff --git a/plugin/type_uuid/item_uuidfunc.cc b/plugin/type_uuid/item_uuidfunc.cc
new file mode 100644
index 00000000000..725b696f905
--- /dev/null
+++ b/plugin/type_uuid/item_uuidfunc.cc
@@ -0,0 +1,46 @@
+/* Copyright (c) 2019,2021, 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 Foundation; version 2 of the License.
+
+ 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.
+
+ 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-1335 USA */
+
+#define MYSQL_SERVER
+#include "mariadb.h"
+#include "item_uuidfunc.h"
+#include "sql_type_uuid.h"
+
+String *Item_func_sys_guid::val_str(String *str)
+{
+ DBUG_ASSERT(fixed());
+ str->alloc(uuid_len()+1);
+ str->length(uuid_len());
+ str->set_charset(collation.collation);
+
+ uchar buf[MY_UUID_SIZE];
+ my_uuid(buf);
+ my_uuid2str(buf, const_cast<char*>(str->ptr()), with_dashes);
+ return str;
+}
+
+const Type_handler *Item_func_uuid::type_handler() const
+{
+ return UUIDBundle::type_handler_fbt();
+}
+
+bool Item_func_uuid::val_native(THD *, Native *to)
+{
+ DBUG_ASSERT(fixed());
+ to->alloc(MY_UUID_SIZE);
+ to->length(MY_UUID_SIZE);
+ my_uuid((uchar*)to->ptr());
+ return 0;
+}
diff --git a/plugin/type_uuid/item_uuidfunc.h b/plugin/type_uuid/item_uuidfunc.h
new file mode 100644
index 00000000000..296b6592f10
--- /dev/null
+++ b/plugin/type_uuid/item_uuidfunc.h
@@ -0,0 +1,67 @@
+#ifndef ITEM_UUIDFUNC_INCLUDED
+#define ITEM_UUIDFUNC_INCLUDED
+
+/* Copyright (c) 2019,2021, 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 Foundation; version 2 of the License.
+
+ 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.
+
+ 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-1335 USA */
+
+
+#include "item.h"
+
+class Item_func_sys_guid: public Item_str_func
+{
+protected:
+ bool with_dashes;
+ size_t uuid_len() const
+ { return MY_UUID_BARE_STRING_LENGTH + with_dashes*MY_UUID_SEPARATORS; }
+public:
+ Item_func_sys_guid(THD *thd): Item_str_func(thd), with_dashes(false) {}
+ bool fix_length_and_dec() override
+ {
+ collation.set(DTCollation_numeric());
+ fix_char_length(uuid_len());
+ return FALSE;
+ }
+ bool const_item() const override { return false; }
+ table_map used_tables() const override { return RAND_TABLE_BIT; }
+ LEX_CSTRING func_name_cstring() const override
+ {
+ static LEX_CSTRING name= {STRING_WITH_LEN("sys_guid") };
+ return name;
+ }
+ String *val_str(String *) override;
+ bool check_vcol_func_processor(void *arg) override
+ {
+ return mark_unsupported_function(func_name(), "()", arg, VCOL_NON_DETERMINISTIC);
+ }
+ Item *get_copy(THD *thd) override
+ { return get_item_copy<Item_func_sys_guid>(thd, this); }
+};
+
+class Item_func_uuid: public Item_func_sys_guid
+{
+public:
+ Item_func_uuid(THD *thd): Item_func_sys_guid(thd) { with_dashes= true; }
+ const Type_handler *type_handler() const override;
+ LEX_CSTRING func_name_cstring() const override
+ {
+ static LEX_CSTRING name= {STRING_WITH_LEN("uuid") };
+ return name;
+ }
+ bool val_native(THD *thd, Native *to) override;
+ Item *get_copy(THD *thd) override
+ { return get_item_copy<Item_func_uuid>(thd, this); }
+};
+
+#endif // ITEM_UUIDFUNC_INCLUDED
diff --git a/plugin/type_uuid/mysql-test/type_uuid/binlog_stm_type_uuid.result b/plugin/type_uuid/mysql-test/type_uuid/binlog_stm_type_uuid.result
new file mode 100644
index 00000000000..a0e5a3af11c
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/binlog_stm_type_uuid.result
@@ -0,0 +1,37 @@
+#
+# MDEV-4958 Adding datatype UUID
+#
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000000');
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff');
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (?)';
+EXECUTE stmt USING CAST('00000000-0000-0000-0000-000000000001' AS UUID);
+EXECUTE stmt USING CAST(CONCAT(REPEAT(0x00,15), 0x02) AS UUID);
+DEALLOCATE PREPARE stmt;
+BEGIN NOT ATOMIC
+DECLARE a UUID DEFAULT '00000000-0000-0000-0000-000000000003';
+INSERT INTO t1 VALUES (a);
+END;
+$$
+DROP TABLE t1;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a UUID)
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000000')
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff')
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001')
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000002')
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES ( NAME_CONST('a','00000000-0000-0000-0000-000000000003'))
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
diff --git a/plugin/type_uuid/mysql-test/type_uuid/binlog_stm_type_uuid.test b/plugin/type_uuid/mysql-test/type_uuid/binlog_stm_type_uuid.test
new file mode 100644
index 00000000000..2c2dd95858d
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/binlog_stm_type_uuid.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source include/have_binlog_format_statement.inc
+
+--disable_query_log
+reset master; # get rid of previous tests binlog
+--enable_query_log
+
+--echo #
+--echo # MDEV-4958 Adding datatype UUID
+--echo #
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000000');
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff');
+
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (?)';
+EXECUTE stmt USING CAST('00000000-0000-0000-0000-000000000001' AS UUID);
+EXECUTE stmt USING CAST(CONCAT(REPEAT(0x00,15), 0x02) AS UUID);
+DEALLOCATE PREPARE stmt;
+
+DELIMITER $$;
+BEGIN NOT ATOMIC
+ DECLARE a UUID DEFAULT '00000000-0000-0000-0000-000000000003';
+ INSERT INTO t1 VALUES (a);
+END;
+$$
+DELIMITER ;$$
+
+DROP TABLE t1;
+
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
diff --git a/plugin/type_uuid/mysql-test/type_uuid/binlog_table_map_optional_metadata_type_uuid.result b/plugin/type_uuid/mysql-test/type_uuid/binlog_table_map_optional_metadata_type_uuid.result
new file mode 100644
index 00000000000..3932470cf64
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/binlog_table_map_optional_metadata_type_uuid.result
@@ -0,0 +1,60 @@
+#
+# Start of 10.5 tests
+#
+#
+# MDEV-4958 Adding datatype UUID
+#
+# Using DEFAULT_CHARSET format
+RESET MASTER;
+SET GLOBAL binlog_row_metadata = NO_LOG;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES('123e4567-e89b-12d3-a456-426655440000');
+# Columns(BINARY(16))
+DROP TABLE t1;
+RESET MASTER;
+RESET MASTER;
+SET GLOBAL binlog_row_metadata = MINIMAL;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES('12334567-8888-9999-aaaa-000000000000');
+# Columns(BINARY(16))
+DROP TABLE t1;
+RESET MASTER;
+RESET MASTER;
+SET GLOBAL binlog_row_metadata = FULL;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES('12334567-8888-9999-aaaa-000000000000');
+# Columns(`a` BINARY(16))
+DROP TABLE t1;
+RESET MASTER;
+# Using COLUMN_CHARSET format
+RESET MASTER;
+SET GLOBAL binlog_row_metadata = NO_LOG;
+CREATE TABLE t1 (a UUID, b CHAR(16) CHARACTER SET latin1, c CHAR(16) CHARACTER SET utf8);
+INSERT INTO t1 VALUES('12334567-8888-9999-aaaa-000000000000','','');
+# Columns(BINARY(16),
+# BINARY(16),
+# BINARY(48))
+DROP TABLE t1;
+RESET MASTER;
+RESET MASTER;
+SET GLOBAL binlog_row_metadata = MINIMAL;
+CREATE TABLE t1 (a UUID, b CHAR(16) CHARACTER SET latin1, c CHAR(16) CHARACTER SET utf8);
+INSERT INTO t1 VALUES('12334567-8888-9999-aaaa-000000000000','','');
+# Columns(BINARY(16),
+# CHAR(16) CHARSET latin1 COLLATE latin1_swedish_ci,
+# CHAR(16) CHARSET utf8mb3 COLLATE utf8mb3_general_ci)
+DROP TABLE t1;
+RESET MASTER;
+RESET MASTER;
+SET GLOBAL binlog_row_metadata = FULL;
+CREATE TABLE t1 (a UUID, b CHAR(16) CHARACTER SET latin1, c CHAR(16) CHARACTER SET utf8);
+INSERT INTO t1 VALUES('12334567-8888-9999-aaaa-000000000000','','');
+# Columns(`a` BINARY(16),
+# `b` CHAR(16) CHARSET latin1 COLLATE latin1_swedish_ci,
+# `c` CHAR(16) CHARSET utf8mb3 COLLATE utf8mb3_general_ci)
+DROP TABLE t1;
+RESET MASTER;
+SET GLOBAL binlog_row_metadata = DEFAULT;
+#
+# End of 10.5 tests
+#
diff --git a/plugin/type_uuid/mysql-test/type_uuid/binlog_table_map_optional_metadata_type_uuid.test b/plugin/type_uuid/mysql-test/type_uuid/binlog_table_map_optional_metadata_type_uuid.test
new file mode 100644
index 00000000000..aa525123855
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/binlog_table_map_optional_metadata_type_uuid.test
@@ -0,0 +1,72 @@
+--source include/have_debug.inc
+--source include/have_binlog_format_row.inc
+
+--let $MYSQLD_DATADIR= `select @@datadir`
+--let $binlog_file= $MYSQLD_DATADIR/master-bin.000001
+
+
+--echo #
+--echo # Start of 10.5 tests
+--echo #
+
+--echo #
+--echo # MDEV-4958 Adding datatype UUID
+--echo #
+
+--echo # Using DEFAULT_CHARSET format
+
+RESET MASTER;
+SET GLOBAL binlog_row_metadata = NO_LOG;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES('123e4567-e89b-12d3-a456-426655440000');
+--source suite/binlog/include/print_optional_metadata.inc
+DROP TABLE t1;
+RESET MASTER;
+
+RESET MASTER;
+SET GLOBAL binlog_row_metadata = MINIMAL;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES('12334567-8888-9999-aaaa-000000000000');
+--source suite/binlog/include/print_optional_metadata.inc
+DROP TABLE t1;
+RESET MASTER;
+
+RESET MASTER;
+SET GLOBAL binlog_row_metadata = FULL;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES('12334567-8888-9999-aaaa-000000000000');
+--source suite/binlog/include/print_optional_metadata.inc
+DROP TABLE t1;
+RESET MASTER;
+
+--echo # Using COLUMN_CHARSET format
+
+RESET MASTER;
+SET GLOBAL binlog_row_metadata = NO_LOG;
+CREATE TABLE t1 (a UUID, b CHAR(16) CHARACTER SET latin1, c CHAR(16) CHARACTER SET utf8);
+INSERT INTO t1 VALUES('12334567-8888-9999-aaaa-000000000000','','');
+--source suite/binlog/include/print_optional_metadata.inc
+DROP TABLE t1;
+RESET MASTER;
+
+RESET MASTER;
+SET GLOBAL binlog_row_metadata = MINIMAL;
+CREATE TABLE t1 (a UUID, b CHAR(16) CHARACTER SET latin1, c CHAR(16) CHARACTER SET utf8);
+INSERT INTO t1 VALUES('12334567-8888-9999-aaaa-000000000000','','');
+--source suite/binlog/include/print_optional_metadata.inc
+DROP TABLE t1;
+RESET MASTER;
+
+RESET MASTER;
+SET GLOBAL binlog_row_metadata = FULL;
+CREATE TABLE t1 (a UUID, b CHAR(16) CHARACTER SET latin1, c CHAR(16) CHARACTER SET utf8);
+INSERT INTO t1 VALUES('12334567-8888-9999-aaaa-000000000000','','');
+--source suite/binlog/include/print_optional_metadata.inc
+DROP TABLE t1;
+RESET MASTER;
+
+SET GLOBAL binlog_row_metadata = DEFAULT;
+
+--echo #
+--echo # End of 10.5 tests
+--echo #
diff --git a/plugin/type_uuid/mysql-test/type_uuid/func_uuid_plugin.result b/plugin/type_uuid/mysql-test/type_uuid/func_uuid_plugin.result
new file mode 100644
index 00000000000..716f33134ca
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/func_uuid_plugin.result
@@ -0,0 +1,35 @@
+#
+# Start of 10.5 tests
+#
+#
+# MDEV-4958 Adding datatype UUID
+#
+SELECT
+'----' AS `----`,
+PLUGIN_NAME,
+PLUGIN_VERSION,
+PLUGIN_STATUS,
+PLUGIN_TYPE,
+PLUGIN_AUTHOR,
+PLUGIN_DESCRIPTION,
+PLUGIN_LICENSE,
+PLUGIN_MATURITY,
+PLUGIN_AUTH_VERSION
+FROM INFORMATION_SCHEMA.PLUGINS
+WHERE PLUGIN_TYPE='FUNCTION'
+ AND PLUGIN_NAME IN
+('uuid')
+ORDER BY PLUGIN_NAME;
+---- ----
+PLUGIN_NAME uuid
+PLUGIN_VERSION 1.0
+PLUGIN_STATUS ACTIVE
+PLUGIN_TYPE FUNCTION
+PLUGIN_AUTHOR MariaDB Corporation
+PLUGIN_DESCRIPTION Function UUID()
+PLUGIN_LICENSE GPL
+PLUGIN_MATURITY Stable
+PLUGIN_AUTH_VERSION 1.0
+#
+# End of 10.5 tests
+#
diff --git a/plugin/type_uuid/mysql-test/type_uuid/func_uuid_plugin.test b/plugin/type_uuid/mysql-test/type_uuid/func_uuid_plugin.test
new file mode 100644
index 00000000000..ce8aba68979
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/func_uuid_plugin.test
@@ -0,0 +1,30 @@
+--echo #
+--echo # Start of 10.5 tests
+--echo #
+
+--echo #
+--echo # MDEV-4958 Adding datatype UUID
+--echo #
+
+--vertical_results
+SELECT
+ '----' AS `----`,
+ PLUGIN_NAME,
+ PLUGIN_VERSION,
+ PLUGIN_STATUS,
+ PLUGIN_TYPE,
+ PLUGIN_AUTHOR,
+ PLUGIN_DESCRIPTION,
+ PLUGIN_LICENSE,
+ PLUGIN_MATURITY,
+ PLUGIN_AUTH_VERSION
+FROM INFORMATION_SCHEMA.PLUGINS
+WHERE PLUGIN_TYPE='FUNCTION'
+ AND PLUGIN_NAME IN
+ ('uuid')
+ORDER BY PLUGIN_NAME;
+--horizontal_results
+
+--echo #
+--echo # End of 10.5 tests
+--echo #
diff --git a/plugin/type_uuid/mysql-test/type_uuid/rpl_row_binary_to_uuid.result b/plugin/type_uuid/mysql-test/type_uuid/rpl_row_binary_to_uuid.result
new file mode 100644
index 00000000000..553c8c6eacd
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/rpl_row_binary_to_uuid.result
@@ -0,0 +1,35 @@
+include/master-slave.inc
+[connection master]
+#
+# Start of 10.5 tests
+#
+#
+# MDEV-4958 Adding datatype UUID
+#
+CREATE TABLE t1 (a BINARY(16));
+connection slave;
+ALTER TABLE t1 MODIFY a UUID;
+connection master;
+INSERT INTO t1 VALUES (X'00000000000000000000000000000000');
+INSERT INTO t1 VALUES (X'00000000000000000000000000000001');
+INSERT INTO t1 VALUES (X'fffffffffffffffffffffffffffffffe');
+INSERT INTO t1 VALUES (X'ffffffffffffffffffffffffffffffff');
+SELECT HEX(a) FROM t1 ORDER BY a;
+HEX(a)
+00000000000000000000000000000000
+00000000000000000000000000000001
+FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE
+FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+connection slave;
+SELECT * FROM t1 ORDER BY a;
+a
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+ffffffff-ffff-ffff-ffff-fffffffffffe
+ffffffff-ffff-ffff-ffff-ffffffffffff
+connection master;
+DROP TABLE t1;
+#
+# End of 10.5 tests
+#
+include/rpl_end.inc
diff --git a/plugin/type_uuid/mysql-test/type_uuid/rpl_row_binary_to_uuid.test b/plugin/type_uuid/mysql-test/type_uuid/rpl_row_binary_to_uuid.test
new file mode 100644
index 00000000000..6f3f5caebc4
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/rpl_row_binary_to_uuid.test
@@ -0,0 +1,33 @@
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+--echo #
+--echo # Start of 10.5 tests
+--echo #
+
+--echo #
+--echo # MDEV-4958 Adding datatype UUID
+--echo #
+
+CREATE TABLE t1 (a BINARY(16));
+
+--sync_slave_with_master
+ALTER TABLE t1 MODIFY a UUID;
+
+--connection master
+INSERT INTO t1 VALUES (X'00000000000000000000000000000000');
+INSERT INTO t1 VALUES (X'00000000000000000000000000000001');
+INSERT INTO t1 VALUES (X'fffffffffffffffffffffffffffffffe');
+INSERT INTO t1 VALUES (X'ffffffffffffffffffffffffffffffff');
+SELECT HEX(a) FROM t1 ORDER BY a;
+--sync_slave_with_master
+SELECT * FROM t1 ORDER BY a;
+
+--connection master
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.5 tests
+--echo #
+
+--source include/rpl_end.inc
diff --git a/plugin/type_uuid/mysql-test/type_uuid/rpl_row_uuid_to_binary.result b/plugin/type_uuid/mysql-test/type_uuid/rpl_row_uuid_to_binary.result
new file mode 100644
index 00000000000..a917a6830b0
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/rpl_row_uuid_to_binary.result
@@ -0,0 +1,35 @@
+include/master-slave.inc
+[connection master]
+#
+# Start of 10.5 tests
+#
+#
+# MDEV-4958 Adding datatype UUID
+#
+CREATE TABLE t1 (a UUID);
+connection slave;
+ALTER TABLE t1 MODIFY a BINARY(16);
+connection master;
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000000');
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-fffffffffffe');
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff');
+SELECT a FROM t1 ORDER BY a;
+a
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+ffffffff-ffff-ffff-ffff-fffffffffffe
+ffffffff-ffff-ffff-ffff-ffffffffffff
+connection slave;
+SELECT HEX(a) FROM t1 ORDER BY a;
+HEX(a)
+00000000000000000000000000000000
+00000000000000000000000000000001
+FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE
+FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+connection master;
+DROP TABLE t1;
+#
+# End of 10.5 tests
+#
+include/rpl_end.inc
diff --git a/plugin/type_uuid/mysql-test/type_uuid/rpl_row_uuid_to_binary.test b/plugin/type_uuid/mysql-test/type_uuid/rpl_row_uuid_to_binary.test
new file mode 100644
index 00000000000..df927fafa02
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/rpl_row_uuid_to_binary.test
@@ -0,0 +1,33 @@
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+--echo #
+--echo # Start of 10.5 tests
+--echo #
+
+--echo #
+--echo # MDEV-4958 Adding datatype UUID
+--echo #
+
+CREATE TABLE t1 (a UUID);
+
+--sync_slave_with_master
+ALTER TABLE t1 MODIFY a BINARY(16);
+
+--connection master
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000000');
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-fffffffffffe');
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff');
+SELECT a FROM t1 ORDER BY a;
+--sync_slave_with_master
+SELECT HEX(a) FROM t1 ORDER BY a;
+
+--connection master
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.5 tests
+--echo #
+
+--source include/rpl_end.inc
diff --git a/plugin/type_uuid/mysql-test/type_uuid/rpl_type_uuid.result b/plugin/type_uuid/mysql-test/type_uuid/rpl_type_uuid.result
new file mode 100644
index 00000000000..c3825570a5c
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/rpl_type_uuid.result
@@ -0,0 +1,19 @@
+include/master-slave.inc
+[connection master]
+#
+# MDEV-4958 Adding datatype UUID
+#
+connection master;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000000'),
+('ffffffff-ffff-ffff-ffff-ffffffffffff');
+connection slave;
+SELECT HEX(a), a FROM t1;
+HEX(a) a
+00000000000000000000000000000000 00000000-0000-0000-0000-000000000000
+FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ffffffff-ffff-ffff-ffff-ffffffffffff
+connection master;
+DROP TABLE t1;
+connection slave;
+include/rpl_end.inc
diff --git a/plugin/type_uuid/mysql-test/type_uuid/rpl_type_uuid.test b/plugin/type_uuid/mysql-test/type_uuid/rpl_type_uuid.test
new file mode 100644
index 00000000000..7651a0d5e02
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/rpl_type_uuid.test
@@ -0,0 +1,18 @@
+--source include/master-slave.inc
+
+--echo #
+--echo # MDEV-4958 Adding datatype UUID
+--echo #
+
+connection master;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000000'),
+('ffffffff-ffff-ffff-ffff-ffffffffffff');
+sync_slave_with_master;
+SELECT HEX(a), a FROM t1;
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/plugin/type_uuid/mysql-test/type_uuid/std_data/t1nopackkey.frm b/plugin/type_uuid/mysql-test/type_uuid/std_data/t1nopackkey.frm
new file mode 100644
index 00000000000..ca934198cf7
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/std_data/t1nopackkey.frm
Binary files differ
diff --git a/plugin/type_uuid/mysql-test/type_uuid/std_data/t1packkey.frm b/plugin/type_uuid/mysql-test/type_uuid/std_data/t1packkey.frm
new file mode 100644
index 00000000000..b3d8e433e9d
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/std_data/t1packkey.frm
Binary files differ
diff --git a/plugin/type_uuid/mysql-test/type_uuid/suite.pm b/plugin/type_uuid/mysql-test/type_uuid/suite.pm
new file mode 100644
index 00000000000..ad21c8688de
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/suite.pm
@@ -0,0 +1,7 @@
+package My::Suite::Type_uuid;
+
+@ISA = qw(My::Suite);
+
+sub is_default { 1 }
+
+bless { };
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid-debug.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid-debug.result
new file mode 100644
index 00000000000..0416c39c6f9
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid-debug.result
@@ -0,0 +1,18 @@
+#
+# MDEV-4958 Adding datatype UUID
+#
+SET @old_debug_dbug=@@debug_dbug;
+SET debug_dbug="+d,frm_data_type_info";
+CREATE TABLE t1 (c01 UUID, c02 UUID);
+Warnings:
+Note 1105 build_frm_image: Field data type info length: 12
+Note 1105 DBUG: [0] name='c01' type_info='uuid'
+Note 1105 DBUG: [1] name='c02' type_info='uuid'
+SET debug_dbug=@old_debug_dbug;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c01` uuid DEFAULT NULL,
+ `c02` uuid DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid-debug.test b/plugin/type_uuid/mysql-test/type_uuid/type_uuid-debug.test
new file mode 100644
index 00000000000..59300d167c9
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid-debug.test
@@ -0,0 +1,14 @@
+--source include/have_debug.inc
+
+--echo #
+--echo # MDEV-4958 Adding datatype UUID
+--echo #
+
+SET @old_debug_dbug=@@debug_dbug;
+
+SET debug_dbug="+d,frm_data_type_info";
+CREATE TABLE t1 (c01 UUID, c02 UUID);
+SET debug_dbug=@old_debug_dbug;
+
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid.result
new file mode 100644
index 00000000000..7ce3b878a1a
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid.result
@@ -0,0 +1,3173 @@
+#
+# MDEV-4958 Adding datatype UUID
+#
+#
+# Basic CREATE functionality, defaults, metadata
+#
+CREATE TABLE t1 (a UUID AUTO_INCREMENT);
+ERROR 42000: Incorrect column specifier for column 'a'
+CREATE TABLE t1 (a UUID);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` uuid DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DESCRIBE t1;
+Field Type Null Key Default Extra
+a uuid YES NULL
+SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='test' AND table_name='t1';
+TABLE_CATALOG def
+TABLE_SCHEMA test
+TABLE_NAME t1
+COLUMN_NAME a
+ORDINAL_POSITION 1
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE uuid
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE uuid
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+IS_GENERATED NEVER
+GENERATION_EXPRESSION NULL
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT * FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a a 254 (type=uuid) 36 36 Y 160 0 8
+a
+00000000-0000-0000-0000-000000000001
+SELECT CAST('00000000-0000-0000-0000-000000000001' AS UUID) AS a;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def a 254 (type=uuid) 36 36 N 33 0 8
+a
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 UUID DEFAULT 0x00000000000000000000000000000000,
+c2 UUID DEFAULT 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,
+c3 UUID DEFAULT '00000000-0000-0000-0000-000000000000',
+c4 UUID DEFAULT 'ffffffff-ffff-ffff-ffff-ffffffffffff',
+c5 UUID DEFAULT CAST(X'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF' AS UUID)
+);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` uuid DEFAULT '00000000-0000-0000-0000-000000000000',
+ `c2` uuid DEFAULT 'ffffffff-ffff-ffff-ffff-ffffffffffff',
+ `c3` uuid DEFAULT '00000000-0000-0000-0000-000000000000',
+ `c4` uuid DEFAULT 'ffffffff-ffff-ffff-ffff-ffffffffffff',
+ `c5` uuid DEFAULT cast(X'ffffffffffffffffffffffffffffffff' as uuid)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DESCRIBE t1;
+Field Type Null Key Default Extra
+c1 uuid YES 00000000-0000-0000-0000-000000000000
+c2 uuid YES ffffffff-ffff-ffff-ffff-ffffffffffff
+c3 uuid YES 00000000-0000-0000-0000-000000000000
+c4 uuid YES ffffffff-ffff-ffff-ffff-ffffffffffff
+c5 uuid YES cast(X'ffffffffffffffffffffffffffffffff' as uuid)
+SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='test' AND table_name='t1';
+TABLE_CATALOG def
+TABLE_SCHEMA test
+TABLE_NAME t1
+COLUMN_NAME c1
+ORDINAL_POSITION 1
+COLUMN_DEFAULT '00000000-0000-0000-0000-000000000000'
+IS_NULLABLE YES
+DATA_TYPE uuid
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE uuid
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+IS_GENERATED NEVER
+GENERATION_EXPRESSION NULL
+TABLE_CATALOG def
+TABLE_SCHEMA test
+TABLE_NAME t1
+COLUMN_NAME c2
+ORDINAL_POSITION 2
+COLUMN_DEFAULT 'ffffffff-ffff-ffff-ffff-ffffffffffff'
+IS_NULLABLE YES
+DATA_TYPE uuid
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE uuid
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+IS_GENERATED NEVER
+GENERATION_EXPRESSION NULL
+TABLE_CATALOG def
+TABLE_SCHEMA test
+TABLE_NAME t1
+COLUMN_NAME c3
+ORDINAL_POSITION 3
+COLUMN_DEFAULT '00000000-0000-0000-0000-000000000000'
+IS_NULLABLE YES
+DATA_TYPE uuid
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE uuid
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+IS_GENERATED NEVER
+GENERATION_EXPRESSION NULL
+TABLE_CATALOG def
+TABLE_SCHEMA test
+TABLE_NAME t1
+COLUMN_NAME c4
+ORDINAL_POSITION 4
+COLUMN_DEFAULT 'ffffffff-ffff-ffff-ffff-ffffffffffff'
+IS_NULLABLE YES
+DATA_TYPE uuid
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE uuid
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+IS_GENERATED NEVER
+GENERATION_EXPRESSION NULL
+TABLE_CATALOG def
+TABLE_SCHEMA test
+TABLE_NAME t1
+COLUMN_NAME c5
+ORDINAL_POSITION 5
+COLUMN_DEFAULT cast(X'ffffffffffffffffffffffffffffffff' as uuid)
+IS_NULLABLE YES
+DATA_TYPE uuid
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+DATETIME_PRECISION NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE uuid
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+IS_GENERATED NEVER
+GENERATION_EXPRESSION NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 UUID DEFAULT 0x00);
+ERROR 42000: Invalid default value for 'c1'
+CREATE TABLE t1 (c1 UUID DEFAULT '');
+ERROR 42000: Invalid default value for 'c1'
+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 22007: Incorrect uuid value: '1' for column `test`.`t1`.`a` at row 1
+INSERT INTO t1 VALUES (TIME'10:20:30');
+ERROR 22007: Incorrect uuid value: '10:20:30' for column `test`.`t1`.`a` at row 1
+INSERT INTO t1 VALUES (0x00);
+ERROR 22007: Incorrect uuid value: '\x00' for column `test`.`t1`.`a` at row 1
+DROP TABLE t1;
+#
+# CAST
+#
+SELECT CAST('garbage' AS UUID);
+CAST('garbage' AS UUID)
+NULL
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+SELECT CAST(0x01 AS UUID);
+CAST(0x01 AS UUID)
+NULL
+Warnings:
+Warning 1292 Incorrect uuid value: '\x01'
+SELECT CAST(REPEAT(0x00,16) AS UUID);
+CAST(REPEAT(0x00,16) AS UUID)
+00000000-0000-0000-0000-000000000000
+SELECT CAST(REPEAT(0x11,16) AS UUID);
+CAST(REPEAT(0x11,16) AS UUID)
+11111111-1111-1111-1111-111111111111
+CREATE TABLE t1 AS SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `CAST('00000000-0000-0000-0000-000000000000' AS UUID)` uuid NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+#
+# Text and binary formats, comparison operators
+#
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES (0x00000000000000000000000000000000);
+INSERT INTO t1 VALUES (0x00000000000000000000000000000001);
+INSERT INTO t1 VALUES (0xFFFF0000000000000000000000000001);
+INSERT INTO t1 VALUES (0xFFFF0000000000000000000000000002);
+SELECT * FROM t1 ORDER BY a;
+a
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+ffff0000-0000-0000-0000-000000000001
+ffff0000-0000-0000-0000-000000000002
+SELECT * FROM t1 ORDER BY a DESC;
+a
+ffff0000-0000-0000-0000-000000000002
+ffff0000-0000-0000-0000-000000000001
+00000000-0000-0000-0000-000000000001
+00000000-0000-0000-0000-000000000000
+SELECT HEX(a),a FROM t1 ORDER BY a;
+HEX(a) a
+00000000000000000000000000000000 00000000-0000-0000-0000-000000000000
+00000000000000000000000000000001 00000000-0000-0000-0000-000000000001
+FFFF0000000000000000000000000001 ffff0000-0000-0000-0000-000000000001
+FFFF0000000000000000000000000002 ffff0000-0000-0000-0000-000000000002
+SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-000000000000';
+a
+00000000-0000-0000-0000-000000000000
+SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-000000000001';
+a
+00000000-0000-0000-0000-000000000001
+SELECT * FROM t1 WHERE a='ffff0000-0000-0000-0000-000000000001';
+a
+ffff0000-0000-0000-0000-000000000001
+SELECT * FROM t1 WHERE a='ffff0000-0000-0000-0000-000000000002';
+a
+ffff0000-0000-0000-0000-000000000002
+SELECT * FROM t1 WHERE a=0x00000000000000000000000000000000;
+a
+00000000-0000-0000-0000-000000000000
+SELECT * FROM t1 WHERE a=0x00000000000000000000000000000001;
+a
+00000000-0000-0000-0000-000000000001
+SELECT * FROM t1 WHERE a=0xffff0000000000000000000000000001;
+a
+ffff0000-0000-0000-0000-000000000001
+SELECT * FROM t1 WHERE a=0xffff0000000000000000000000000002;
+a
+ffff0000-0000-0000-0000-000000000002
+SELECT * FROM t1 WHERE a< '00000000-0000-0000-0000-000000000000';
+a
+SELECT * FROM t1 WHERE a<='00000000-0000-0000-0000-000000000000';
+a
+00000000-0000-0000-0000-000000000000
+SELECT * FROM t1 WHERE a>='ffff0000-0000-0000-0000-000000000002';
+a
+ffff0000-0000-0000-0000-000000000002
+SELECT * FROM t1 WHERE a> 'ffff0000-0000-0000-0000-000000000002';
+a
+SELECT * FROM t1 WHERE a IN
+(
+'00000000-0000-0000-0000-000000000000',
+'ffff0000-0000-0000-0000-000000000001'
+) ORDER BY a;
+a
+00000000-0000-0000-0000-000000000000
+ffff0000-0000-0000-0000-000000000001
+SELECT * FROM t1 WHERE a IN
+(
+'00000000-0000-0000-0000-000000000000',
+0xffff0000000000000000000000000002
+) ORDER BY a;
+a
+00000000-0000-0000-0000-000000000000
+ffff0000-0000-0000-0000-000000000002
+SELECT * FROM t1 WHERE a<'garbage';
+a
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+SELECT * FROM t1 WHERE a<='garbage';
+a
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+SELECT * FROM t1 WHERE a='garbage';
+a
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+SELECT * FROM t1 WHERE a>='garbage';
+a
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+SELECT * FROM t1 WHERE a>'garbage';
+a
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+SELECT * FROM t1 WHERE a<0x01;
+a
+Warnings:
+Warning 1292 Incorrect uuid value: '\x01'
+SELECT * FROM t1 WHERE a<=0x01;
+a
+Warnings:
+Warning 1292 Incorrect uuid value: '\x01'
+SELECT * FROM t1 WHERE a=0x01;
+a
+Warnings:
+Warning 1292 Incorrect uuid value: '\x01'
+Warning 1292 Incorrect uuid value: '\x01'
+SELECT * FROM t1 WHERE a>=0x01;
+a
+Warnings:
+Warning 1292 Incorrect uuid value: '\x01'
+SELECT * FROM t1 WHERE a>0x01;
+a
+Warnings:
+Warning 1292 Incorrect uuid value: '\x01'
+SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-000000000000';
+a
+00000000-0000-0000-0000-000000000000
+SELECT * FROM t1 WHERE a='00-000000-0000-0000-0000-000000000000';
+a
+00000000-0000-0000-0000-000000000000
+SELECT * FROM t1 WHERE a='00-00-0000-0000-0000-0000-000000000000';
+a
+00000000-0000-0000-0000-000000000000
+SELECT * FROM t1 WHERE a='00-00-00-00-0000-0000-0000-000000000000';
+a
+00000000-0000-0000-0000-000000000000
+SELECT * FROM t1 WHERE a=0;
+ERROR HY000: Illegal parameter data types uuid and int for operation '='
+SELECT * FROM t1 WHERE a=0.0;
+ERROR HY000: Illegal parameter data types uuid and decimal for operation '='
+SELECT * FROM t1 WHERE a=0e0;
+ERROR HY000: Illegal parameter data types uuid and double for operation '='
+SELECT * FROM t1 WHERE a=TIME'10:20:30';
+ERROR HY000: Illegal parameter data types uuid and time for operation '='
+SELECT * FROM t1 WHERE a IN ('::', 10);
+ERROR HY000: Illegal parameter data types uuid and int for operation 'in'
+DROP TABLE t1;
+#
+# ORDER BY
+#
+CREATE TABLE t1 (a UUID);
+FOR i IN 0..15
+DO
+INSERT INTO t1 VALUES (REPLACE('XX000000-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00XX0000-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('0000XX00-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('000000XX-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-XX00-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-00XX-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-XX00-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-00XX-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-XX00-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-00XX-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-XX0000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-00XX00000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-0000XX000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-000000XX0000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-00000000XX00','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-0000000000XX','XX',LPAD(HEX(i),2,'0')));
+END FOR;
+$$
+#
+# Logical ORDER BY
+#
+SELECT * FROM t1 ORDER BY a;
+a
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000001-0000-0000-0000-000000000000
+00000002-0000-0000-0000-000000000000
+00000003-0000-0000-0000-000000000000
+00000004-0000-0000-0000-000000000000
+00000005-0000-0000-0000-000000000000
+00000006-0000-0000-0000-000000000000
+00000007-0000-0000-0000-000000000000
+00000008-0000-0000-0000-000000000000
+00000009-0000-0000-0000-000000000000
+0000000a-0000-0000-0000-000000000000
+0000000b-0000-0000-0000-000000000000
+0000000c-0000-0000-0000-000000000000
+0000000d-0000-0000-0000-000000000000
+0000000e-0000-0000-0000-000000000000
+0000000f-0000-0000-0000-000000000000
+00000100-0000-0000-0000-000000000000
+00000200-0000-0000-0000-000000000000
+00000300-0000-0000-0000-000000000000
+00000400-0000-0000-0000-000000000000
+00000500-0000-0000-0000-000000000000
+00000600-0000-0000-0000-000000000000
+00000700-0000-0000-0000-000000000000
+00000800-0000-0000-0000-000000000000
+00000900-0000-0000-0000-000000000000
+00000a00-0000-0000-0000-000000000000
+00000b00-0000-0000-0000-000000000000
+00000c00-0000-0000-0000-000000000000
+00000d00-0000-0000-0000-000000000000
+00000e00-0000-0000-0000-000000000000
+00000f00-0000-0000-0000-000000000000
+00010000-0000-0000-0000-000000000000
+00020000-0000-0000-0000-000000000000
+00030000-0000-0000-0000-000000000000
+00040000-0000-0000-0000-000000000000
+00050000-0000-0000-0000-000000000000
+00060000-0000-0000-0000-000000000000
+00070000-0000-0000-0000-000000000000
+00080000-0000-0000-0000-000000000000
+00090000-0000-0000-0000-000000000000
+000a0000-0000-0000-0000-000000000000
+000b0000-0000-0000-0000-000000000000
+000c0000-0000-0000-0000-000000000000
+000d0000-0000-0000-0000-000000000000
+000e0000-0000-0000-0000-000000000000
+000f0000-0000-0000-0000-000000000000
+01000000-0000-0000-0000-000000000000
+02000000-0000-0000-0000-000000000000
+03000000-0000-0000-0000-000000000000
+04000000-0000-0000-0000-000000000000
+05000000-0000-0000-0000-000000000000
+06000000-0000-0000-0000-000000000000
+07000000-0000-0000-0000-000000000000
+08000000-0000-0000-0000-000000000000
+09000000-0000-0000-0000-000000000000
+0a000000-0000-0000-0000-000000000000
+0b000000-0000-0000-0000-000000000000
+0c000000-0000-0000-0000-000000000000
+0d000000-0000-0000-0000-000000000000
+0e000000-0000-0000-0000-000000000000
+0f000000-0000-0000-0000-000000000000
+00000000-0001-0000-0000-000000000000
+00000000-0002-0000-0000-000000000000
+00000000-0003-0000-0000-000000000000
+00000000-0004-0000-0000-000000000000
+00000000-0005-0000-0000-000000000000
+00000000-0006-0000-0000-000000000000
+00000000-0007-0000-0000-000000000000
+00000000-0008-0000-0000-000000000000
+00000000-0009-0000-0000-000000000000
+00000000-000a-0000-0000-000000000000
+00000000-000b-0000-0000-000000000000
+00000000-000c-0000-0000-000000000000
+00000000-000d-0000-0000-000000000000
+00000000-000e-0000-0000-000000000000
+00000000-000f-0000-0000-000000000000
+00000000-0100-0000-0000-000000000000
+00000000-0200-0000-0000-000000000000
+00000000-0300-0000-0000-000000000000
+00000000-0400-0000-0000-000000000000
+00000000-0500-0000-0000-000000000000
+00000000-0600-0000-0000-000000000000
+00000000-0700-0000-0000-000000000000
+00000000-0800-0000-0000-000000000000
+00000000-0900-0000-0000-000000000000
+00000000-0a00-0000-0000-000000000000
+00000000-0b00-0000-0000-000000000000
+00000000-0c00-0000-0000-000000000000
+00000000-0d00-0000-0000-000000000000
+00000000-0e00-0000-0000-000000000000
+00000000-0f00-0000-0000-000000000000
+00000000-0000-0001-0000-000000000000
+00000000-0000-0002-0000-000000000000
+00000000-0000-0003-0000-000000000000
+00000000-0000-0004-0000-000000000000
+00000000-0000-0005-0000-000000000000
+00000000-0000-0006-0000-000000000000
+00000000-0000-0007-0000-000000000000
+00000000-0000-0008-0000-000000000000
+00000000-0000-0009-0000-000000000000
+00000000-0000-000a-0000-000000000000
+00000000-0000-000b-0000-000000000000
+00000000-0000-000c-0000-000000000000
+00000000-0000-000d-0000-000000000000
+00000000-0000-000e-0000-000000000000
+00000000-0000-000f-0000-000000000000
+00000000-0000-0100-0000-000000000000
+00000000-0000-0200-0000-000000000000
+00000000-0000-0300-0000-000000000000
+00000000-0000-0400-0000-000000000000
+00000000-0000-0500-0000-000000000000
+00000000-0000-0600-0000-000000000000
+00000000-0000-0700-0000-000000000000
+00000000-0000-0800-0000-000000000000
+00000000-0000-0900-0000-000000000000
+00000000-0000-0a00-0000-000000000000
+00000000-0000-0b00-0000-000000000000
+00000000-0000-0c00-0000-000000000000
+00000000-0000-0d00-0000-000000000000
+00000000-0000-0e00-0000-000000000000
+00000000-0000-0f00-0000-000000000000
+00000000-0000-0000-0001-000000000000
+00000000-0000-0000-0002-000000000000
+00000000-0000-0000-0003-000000000000
+00000000-0000-0000-0004-000000000000
+00000000-0000-0000-0005-000000000000
+00000000-0000-0000-0006-000000000000
+00000000-0000-0000-0007-000000000000
+00000000-0000-0000-0008-000000000000
+00000000-0000-0000-0009-000000000000
+00000000-0000-0000-000a-000000000000
+00000000-0000-0000-000b-000000000000
+00000000-0000-0000-000c-000000000000
+00000000-0000-0000-000d-000000000000
+00000000-0000-0000-000e-000000000000
+00000000-0000-0000-000f-000000000000
+00000000-0000-0000-0100-000000000000
+00000000-0000-0000-0200-000000000000
+00000000-0000-0000-0300-000000000000
+00000000-0000-0000-0400-000000000000
+00000000-0000-0000-0500-000000000000
+00000000-0000-0000-0600-000000000000
+00000000-0000-0000-0700-000000000000
+00000000-0000-0000-0800-000000000000
+00000000-0000-0000-0900-000000000000
+00000000-0000-0000-0a00-000000000000
+00000000-0000-0000-0b00-000000000000
+00000000-0000-0000-0c00-000000000000
+00000000-0000-0000-0d00-000000000000
+00000000-0000-0000-0e00-000000000000
+00000000-0000-0000-0f00-000000000000
+00000000-0000-0000-0000-000000000001
+00000000-0000-0000-0000-000000000002
+00000000-0000-0000-0000-000000000003
+00000000-0000-0000-0000-000000000004
+00000000-0000-0000-0000-000000000005
+00000000-0000-0000-0000-000000000006
+00000000-0000-0000-0000-000000000007
+00000000-0000-0000-0000-000000000008
+00000000-0000-0000-0000-000000000009
+00000000-0000-0000-0000-00000000000a
+00000000-0000-0000-0000-00000000000b
+00000000-0000-0000-0000-00000000000c
+00000000-0000-0000-0000-00000000000d
+00000000-0000-0000-0000-00000000000e
+00000000-0000-0000-0000-00000000000f
+00000000-0000-0000-0000-000000000100
+00000000-0000-0000-0000-000000000200
+00000000-0000-0000-0000-000000000300
+00000000-0000-0000-0000-000000000400
+00000000-0000-0000-0000-000000000500
+00000000-0000-0000-0000-000000000600
+00000000-0000-0000-0000-000000000700
+00000000-0000-0000-0000-000000000800
+00000000-0000-0000-0000-000000000900
+00000000-0000-0000-0000-000000000a00
+00000000-0000-0000-0000-000000000b00
+00000000-0000-0000-0000-000000000c00
+00000000-0000-0000-0000-000000000d00
+00000000-0000-0000-0000-000000000e00
+00000000-0000-0000-0000-000000000f00
+00000000-0000-0000-0000-000000010000
+00000000-0000-0000-0000-000000020000
+00000000-0000-0000-0000-000000030000
+00000000-0000-0000-0000-000000040000
+00000000-0000-0000-0000-000000050000
+00000000-0000-0000-0000-000000060000
+00000000-0000-0000-0000-000000070000
+00000000-0000-0000-0000-000000080000
+00000000-0000-0000-0000-000000090000
+00000000-0000-0000-0000-0000000a0000
+00000000-0000-0000-0000-0000000b0000
+00000000-0000-0000-0000-0000000c0000
+00000000-0000-0000-0000-0000000d0000
+00000000-0000-0000-0000-0000000e0000
+00000000-0000-0000-0000-0000000f0000
+00000000-0000-0000-0000-000001000000
+00000000-0000-0000-0000-000002000000
+00000000-0000-0000-0000-000003000000
+00000000-0000-0000-0000-000004000000
+00000000-0000-0000-0000-000005000000
+00000000-0000-0000-0000-000006000000
+00000000-0000-0000-0000-000007000000
+00000000-0000-0000-0000-000008000000
+00000000-0000-0000-0000-000009000000
+00000000-0000-0000-0000-00000a000000
+00000000-0000-0000-0000-00000b000000
+00000000-0000-0000-0000-00000c000000
+00000000-0000-0000-0000-00000d000000
+00000000-0000-0000-0000-00000e000000
+00000000-0000-0000-0000-00000f000000
+00000000-0000-0000-0000-000100000000
+00000000-0000-0000-0000-000200000000
+00000000-0000-0000-0000-000300000000
+00000000-0000-0000-0000-000400000000
+00000000-0000-0000-0000-000500000000
+00000000-0000-0000-0000-000600000000
+00000000-0000-0000-0000-000700000000
+00000000-0000-0000-0000-000800000000
+00000000-0000-0000-0000-000900000000
+00000000-0000-0000-0000-000a00000000
+00000000-0000-0000-0000-000b00000000
+00000000-0000-0000-0000-000c00000000
+00000000-0000-0000-0000-000d00000000
+00000000-0000-0000-0000-000e00000000
+00000000-0000-0000-0000-000f00000000
+00000000-0000-0000-0000-010000000000
+00000000-0000-0000-0000-020000000000
+00000000-0000-0000-0000-030000000000
+00000000-0000-0000-0000-040000000000
+00000000-0000-0000-0000-050000000000
+00000000-0000-0000-0000-060000000000
+00000000-0000-0000-0000-070000000000
+00000000-0000-0000-0000-080000000000
+00000000-0000-0000-0000-090000000000
+00000000-0000-0000-0000-0a0000000000
+00000000-0000-0000-0000-0b0000000000
+00000000-0000-0000-0000-0c0000000000
+00000000-0000-0000-0000-0d0000000000
+00000000-0000-0000-0000-0e0000000000
+00000000-0000-0000-0000-0f0000000000
+SELECT COALESCE(NULL, a) FROM t1 ORDER BY a;
+COALESCE(NULL, a)
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000001-0000-0000-0000-000000000000
+00000002-0000-0000-0000-000000000000
+00000003-0000-0000-0000-000000000000
+00000004-0000-0000-0000-000000000000
+00000005-0000-0000-0000-000000000000
+00000006-0000-0000-0000-000000000000
+00000007-0000-0000-0000-000000000000
+00000008-0000-0000-0000-000000000000
+00000009-0000-0000-0000-000000000000
+0000000a-0000-0000-0000-000000000000
+0000000b-0000-0000-0000-000000000000
+0000000c-0000-0000-0000-000000000000
+0000000d-0000-0000-0000-000000000000
+0000000e-0000-0000-0000-000000000000
+0000000f-0000-0000-0000-000000000000
+00000100-0000-0000-0000-000000000000
+00000200-0000-0000-0000-000000000000
+00000300-0000-0000-0000-000000000000
+00000400-0000-0000-0000-000000000000
+00000500-0000-0000-0000-000000000000
+00000600-0000-0000-0000-000000000000
+00000700-0000-0000-0000-000000000000
+00000800-0000-0000-0000-000000000000
+00000900-0000-0000-0000-000000000000
+00000a00-0000-0000-0000-000000000000
+00000b00-0000-0000-0000-000000000000
+00000c00-0000-0000-0000-000000000000
+00000d00-0000-0000-0000-000000000000
+00000e00-0000-0000-0000-000000000000
+00000f00-0000-0000-0000-000000000000
+00010000-0000-0000-0000-000000000000
+00020000-0000-0000-0000-000000000000
+00030000-0000-0000-0000-000000000000
+00040000-0000-0000-0000-000000000000
+00050000-0000-0000-0000-000000000000
+00060000-0000-0000-0000-000000000000
+00070000-0000-0000-0000-000000000000
+00080000-0000-0000-0000-000000000000
+00090000-0000-0000-0000-000000000000
+000a0000-0000-0000-0000-000000000000
+000b0000-0000-0000-0000-000000000000
+000c0000-0000-0000-0000-000000000000
+000d0000-0000-0000-0000-000000000000
+000e0000-0000-0000-0000-000000000000
+000f0000-0000-0000-0000-000000000000
+01000000-0000-0000-0000-000000000000
+02000000-0000-0000-0000-000000000000
+03000000-0000-0000-0000-000000000000
+04000000-0000-0000-0000-000000000000
+05000000-0000-0000-0000-000000000000
+06000000-0000-0000-0000-000000000000
+07000000-0000-0000-0000-000000000000
+08000000-0000-0000-0000-000000000000
+09000000-0000-0000-0000-000000000000
+0a000000-0000-0000-0000-000000000000
+0b000000-0000-0000-0000-000000000000
+0c000000-0000-0000-0000-000000000000
+0d000000-0000-0000-0000-000000000000
+0e000000-0000-0000-0000-000000000000
+0f000000-0000-0000-0000-000000000000
+00000000-0001-0000-0000-000000000000
+00000000-0002-0000-0000-000000000000
+00000000-0003-0000-0000-000000000000
+00000000-0004-0000-0000-000000000000
+00000000-0005-0000-0000-000000000000
+00000000-0006-0000-0000-000000000000
+00000000-0007-0000-0000-000000000000
+00000000-0008-0000-0000-000000000000
+00000000-0009-0000-0000-000000000000
+00000000-000a-0000-0000-000000000000
+00000000-000b-0000-0000-000000000000
+00000000-000c-0000-0000-000000000000
+00000000-000d-0000-0000-000000000000
+00000000-000e-0000-0000-000000000000
+00000000-000f-0000-0000-000000000000
+00000000-0100-0000-0000-000000000000
+00000000-0200-0000-0000-000000000000
+00000000-0300-0000-0000-000000000000
+00000000-0400-0000-0000-000000000000
+00000000-0500-0000-0000-000000000000
+00000000-0600-0000-0000-000000000000
+00000000-0700-0000-0000-000000000000
+00000000-0800-0000-0000-000000000000
+00000000-0900-0000-0000-000000000000
+00000000-0a00-0000-0000-000000000000
+00000000-0b00-0000-0000-000000000000
+00000000-0c00-0000-0000-000000000000
+00000000-0d00-0000-0000-000000000000
+00000000-0e00-0000-0000-000000000000
+00000000-0f00-0000-0000-000000000000
+00000000-0000-0001-0000-000000000000
+00000000-0000-0002-0000-000000000000
+00000000-0000-0003-0000-000000000000
+00000000-0000-0004-0000-000000000000
+00000000-0000-0005-0000-000000000000
+00000000-0000-0006-0000-000000000000
+00000000-0000-0007-0000-000000000000
+00000000-0000-0008-0000-000000000000
+00000000-0000-0009-0000-000000000000
+00000000-0000-000a-0000-000000000000
+00000000-0000-000b-0000-000000000000
+00000000-0000-000c-0000-000000000000
+00000000-0000-000d-0000-000000000000
+00000000-0000-000e-0000-000000000000
+00000000-0000-000f-0000-000000000000
+00000000-0000-0100-0000-000000000000
+00000000-0000-0200-0000-000000000000
+00000000-0000-0300-0000-000000000000
+00000000-0000-0400-0000-000000000000
+00000000-0000-0500-0000-000000000000
+00000000-0000-0600-0000-000000000000
+00000000-0000-0700-0000-000000000000
+00000000-0000-0800-0000-000000000000
+00000000-0000-0900-0000-000000000000
+00000000-0000-0a00-0000-000000000000
+00000000-0000-0b00-0000-000000000000
+00000000-0000-0c00-0000-000000000000
+00000000-0000-0d00-0000-000000000000
+00000000-0000-0e00-0000-000000000000
+00000000-0000-0f00-0000-000000000000
+00000000-0000-0000-0001-000000000000
+00000000-0000-0000-0002-000000000000
+00000000-0000-0000-0003-000000000000
+00000000-0000-0000-0004-000000000000
+00000000-0000-0000-0005-000000000000
+00000000-0000-0000-0006-000000000000
+00000000-0000-0000-0007-000000000000
+00000000-0000-0000-0008-000000000000
+00000000-0000-0000-0009-000000000000
+00000000-0000-0000-000a-000000000000
+00000000-0000-0000-000b-000000000000
+00000000-0000-0000-000c-000000000000
+00000000-0000-0000-000d-000000000000
+00000000-0000-0000-000e-000000000000
+00000000-0000-0000-000f-000000000000
+00000000-0000-0000-0100-000000000000
+00000000-0000-0000-0200-000000000000
+00000000-0000-0000-0300-000000000000
+00000000-0000-0000-0400-000000000000
+00000000-0000-0000-0500-000000000000
+00000000-0000-0000-0600-000000000000
+00000000-0000-0000-0700-000000000000
+00000000-0000-0000-0800-000000000000
+00000000-0000-0000-0900-000000000000
+00000000-0000-0000-0a00-000000000000
+00000000-0000-0000-0b00-000000000000
+00000000-0000-0000-0c00-000000000000
+00000000-0000-0000-0d00-000000000000
+00000000-0000-0000-0e00-000000000000
+00000000-0000-0000-0f00-000000000000
+00000000-0000-0000-0000-000000000001
+00000000-0000-0000-0000-000000000002
+00000000-0000-0000-0000-000000000003
+00000000-0000-0000-0000-000000000004
+00000000-0000-0000-0000-000000000005
+00000000-0000-0000-0000-000000000006
+00000000-0000-0000-0000-000000000007
+00000000-0000-0000-0000-000000000008
+00000000-0000-0000-0000-000000000009
+00000000-0000-0000-0000-00000000000a
+00000000-0000-0000-0000-00000000000b
+00000000-0000-0000-0000-00000000000c
+00000000-0000-0000-0000-00000000000d
+00000000-0000-0000-0000-00000000000e
+00000000-0000-0000-0000-00000000000f
+00000000-0000-0000-0000-000000000100
+00000000-0000-0000-0000-000000000200
+00000000-0000-0000-0000-000000000300
+00000000-0000-0000-0000-000000000400
+00000000-0000-0000-0000-000000000500
+00000000-0000-0000-0000-000000000600
+00000000-0000-0000-0000-000000000700
+00000000-0000-0000-0000-000000000800
+00000000-0000-0000-0000-000000000900
+00000000-0000-0000-0000-000000000a00
+00000000-0000-0000-0000-000000000b00
+00000000-0000-0000-0000-000000000c00
+00000000-0000-0000-0000-000000000d00
+00000000-0000-0000-0000-000000000e00
+00000000-0000-0000-0000-000000000f00
+00000000-0000-0000-0000-000000010000
+00000000-0000-0000-0000-000000020000
+00000000-0000-0000-0000-000000030000
+00000000-0000-0000-0000-000000040000
+00000000-0000-0000-0000-000000050000
+00000000-0000-0000-0000-000000060000
+00000000-0000-0000-0000-000000070000
+00000000-0000-0000-0000-000000080000
+00000000-0000-0000-0000-000000090000
+00000000-0000-0000-0000-0000000a0000
+00000000-0000-0000-0000-0000000b0000
+00000000-0000-0000-0000-0000000c0000
+00000000-0000-0000-0000-0000000d0000
+00000000-0000-0000-0000-0000000e0000
+00000000-0000-0000-0000-0000000f0000
+00000000-0000-0000-0000-000001000000
+00000000-0000-0000-0000-000002000000
+00000000-0000-0000-0000-000003000000
+00000000-0000-0000-0000-000004000000
+00000000-0000-0000-0000-000005000000
+00000000-0000-0000-0000-000006000000
+00000000-0000-0000-0000-000007000000
+00000000-0000-0000-0000-000008000000
+00000000-0000-0000-0000-000009000000
+00000000-0000-0000-0000-00000a000000
+00000000-0000-0000-0000-00000b000000
+00000000-0000-0000-0000-00000c000000
+00000000-0000-0000-0000-00000d000000
+00000000-0000-0000-0000-00000e000000
+00000000-0000-0000-0000-00000f000000
+00000000-0000-0000-0000-000100000000
+00000000-0000-0000-0000-000200000000
+00000000-0000-0000-0000-000300000000
+00000000-0000-0000-0000-000400000000
+00000000-0000-0000-0000-000500000000
+00000000-0000-0000-0000-000600000000
+00000000-0000-0000-0000-000700000000
+00000000-0000-0000-0000-000800000000
+00000000-0000-0000-0000-000900000000
+00000000-0000-0000-0000-000a00000000
+00000000-0000-0000-0000-000b00000000
+00000000-0000-0000-0000-000c00000000
+00000000-0000-0000-0000-000d00000000
+00000000-0000-0000-0000-000e00000000
+00000000-0000-0000-0000-000f00000000
+00000000-0000-0000-0000-010000000000
+00000000-0000-0000-0000-020000000000
+00000000-0000-0000-0000-030000000000
+00000000-0000-0000-0000-040000000000
+00000000-0000-0000-0000-050000000000
+00000000-0000-0000-0000-060000000000
+00000000-0000-0000-0000-070000000000
+00000000-0000-0000-0000-080000000000
+00000000-0000-0000-0000-090000000000
+00000000-0000-0000-0000-0a0000000000
+00000000-0000-0000-0000-0b0000000000
+00000000-0000-0000-0000-0c0000000000
+00000000-0000-0000-0000-0d0000000000
+00000000-0000-0000-0000-0e0000000000
+00000000-0000-0000-0000-0f0000000000
+#
+# Lexicographical ORDER BY
+#
+SELECT * FROM t1 ORDER BY CAST(a AS BINARY(16));
+a
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+00000000-0000-0000-0000-000000000002
+00000000-0000-0000-0000-000000000003
+00000000-0000-0000-0000-000000000004
+00000000-0000-0000-0000-000000000005
+00000000-0000-0000-0000-000000000006
+00000000-0000-0000-0000-000000000007
+00000000-0000-0000-0000-000000000008
+00000000-0000-0000-0000-000000000009
+00000000-0000-0000-0000-00000000000a
+00000000-0000-0000-0000-00000000000b
+00000000-0000-0000-0000-00000000000c
+00000000-0000-0000-0000-00000000000d
+00000000-0000-0000-0000-00000000000e
+00000000-0000-0000-0000-00000000000f
+00000000-0000-0000-0000-000000000100
+00000000-0000-0000-0000-000000000200
+00000000-0000-0000-0000-000000000300
+00000000-0000-0000-0000-000000000400
+00000000-0000-0000-0000-000000000500
+00000000-0000-0000-0000-000000000600
+00000000-0000-0000-0000-000000000700
+00000000-0000-0000-0000-000000000800
+00000000-0000-0000-0000-000000000900
+00000000-0000-0000-0000-000000000a00
+00000000-0000-0000-0000-000000000b00
+00000000-0000-0000-0000-000000000c00
+00000000-0000-0000-0000-000000000d00
+00000000-0000-0000-0000-000000000e00
+00000000-0000-0000-0000-000000000f00
+00000000-0000-0000-0000-000000010000
+00000000-0000-0000-0000-000000020000
+00000000-0000-0000-0000-000000030000
+00000000-0000-0000-0000-000000040000
+00000000-0000-0000-0000-000000050000
+00000000-0000-0000-0000-000000060000
+00000000-0000-0000-0000-000000070000
+00000000-0000-0000-0000-000000080000
+00000000-0000-0000-0000-000000090000
+00000000-0000-0000-0000-0000000a0000
+00000000-0000-0000-0000-0000000b0000
+00000000-0000-0000-0000-0000000c0000
+00000000-0000-0000-0000-0000000d0000
+00000000-0000-0000-0000-0000000e0000
+00000000-0000-0000-0000-0000000f0000
+00000000-0000-0000-0000-000001000000
+00000000-0000-0000-0000-000002000000
+00000000-0000-0000-0000-000003000000
+00000000-0000-0000-0000-000004000000
+00000000-0000-0000-0000-000005000000
+00000000-0000-0000-0000-000006000000
+00000000-0000-0000-0000-000007000000
+00000000-0000-0000-0000-000008000000
+00000000-0000-0000-0000-000009000000
+00000000-0000-0000-0000-00000a000000
+00000000-0000-0000-0000-00000b000000
+00000000-0000-0000-0000-00000c000000
+00000000-0000-0000-0000-00000d000000
+00000000-0000-0000-0000-00000e000000
+00000000-0000-0000-0000-00000f000000
+00000000-0000-0000-0000-000100000000
+00000000-0000-0000-0000-000200000000
+00000000-0000-0000-0000-000300000000
+00000000-0000-0000-0000-000400000000
+00000000-0000-0000-0000-000500000000
+00000000-0000-0000-0000-000600000000
+00000000-0000-0000-0000-000700000000
+00000000-0000-0000-0000-000800000000
+00000000-0000-0000-0000-000900000000
+00000000-0000-0000-0000-000a00000000
+00000000-0000-0000-0000-000b00000000
+00000000-0000-0000-0000-000c00000000
+00000000-0000-0000-0000-000d00000000
+00000000-0000-0000-0000-000e00000000
+00000000-0000-0000-0000-000f00000000
+00000000-0000-0000-0000-010000000000
+00000000-0000-0000-0000-020000000000
+00000000-0000-0000-0000-030000000000
+00000000-0000-0000-0000-040000000000
+00000000-0000-0000-0000-050000000000
+00000000-0000-0000-0000-060000000000
+00000000-0000-0000-0000-070000000000
+00000000-0000-0000-0000-080000000000
+00000000-0000-0000-0000-090000000000
+00000000-0000-0000-0000-0a0000000000
+00000000-0000-0000-0000-0b0000000000
+00000000-0000-0000-0000-0c0000000000
+00000000-0000-0000-0000-0d0000000000
+00000000-0000-0000-0000-0e0000000000
+00000000-0000-0000-0000-0f0000000000
+00000000-0000-0000-0001-000000000000
+00000000-0000-0000-0002-000000000000
+00000000-0000-0000-0003-000000000000
+00000000-0000-0000-0004-000000000000
+00000000-0000-0000-0005-000000000000
+00000000-0000-0000-0006-000000000000
+00000000-0000-0000-0007-000000000000
+00000000-0000-0000-0008-000000000000
+00000000-0000-0000-0009-000000000000
+00000000-0000-0000-000a-000000000000
+00000000-0000-0000-000b-000000000000
+00000000-0000-0000-000c-000000000000
+00000000-0000-0000-000d-000000000000
+00000000-0000-0000-000e-000000000000
+00000000-0000-0000-000f-000000000000
+00000000-0000-0000-0100-000000000000
+00000000-0000-0000-0200-000000000000
+00000000-0000-0000-0300-000000000000
+00000000-0000-0000-0400-000000000000
+00000000-0000-0000-0500-000000000000
+00000000-0000-0000-0600-000000000000
+00000000-0000-0000-0700-000000000000
+00000000-0000-0000-0800-000000000000
+00000000-0000-0000-0900-000000000000
+00000000-0000-0000-0a00-000000000000
+00000000-0000-0000-0b00-000000000000
+00000000-0000-0000-0c00-000000000000
+00000000-0000-0000-0d00-000000000000
+00000000-0000-0000-0e00-000000000000
+00000000-0000-0000-0f00-000000000000
+00000000-0000-0001-0000-000000000000
+00000000-0000-0002-0000-000000000000
+00000000-0000-0003-0000-000000000000
+00000000-0000-0004-0000-000000000000
+00000000-0000-0005-0000-000000000000
+00000000-0000-0006-0000-000000000000
+00000000-0000-0007-0000-000000000000
+00000000-0000-0008-0000-000000000000
+00000000-0000-0009-0000-000000000000
+00000000-0000-000a-0000-000000000000
+00000000-0000-000b-0000-000000000000
+00000000-0000-000c-0000-000000000000
+00000000-0000-000d-0000-000000000000
+00000000-0000-000e-0000-000000000000
+00000000-0000-000f-0000-000000000000
+00000000-0000-0100-0000-000000000000
+00000000-0000-0200-0000-000000000000
+00000000-0000-0300-0000-000000000000
+00000000-0000-0400-0000-000000000000
+00000000-0000-0500-0000-000000000000
+00000000-0000-0600-0000-000000000000
+00000000-0000-0700-0000-000000000000
+00000000-0000-0800-0000-000000000000
+00000000-0000-0900-0000-000000000000
+00000000-0000-0a00-0000-000000000000
+00000000-0000-0b00-0000-000000000000
+00000000-0000-0c00-0000-000000000000
+00000000-0000-0d00-0000-000000000000
+00000000-0000-0e00-0000-000000000000
+00000000-0000-0f00-0000-000000000000
+00000000-0001-0000-0000-000000000000
+00000000-0002-0000-0000-000000000000
+00000000-0003-0000-0000-000000000000
+00000000-0004-0000-0000-000000000000
+00000000-0005-0000-0000-000000000000
+00000000-0006-0000-0000-000000000000
+00000000-0007-0000-0000-000000000000
+00000000-0008-0000-0000-000000000000
+00000000-0009-0000-0000-000000000000
+00000000-000a-0000-0000-000000000000
+00000000-000b-0000-0000-000000000000
+00000000-000c-0000-0000-000000000000
+00000000-000d-0000-0000-000000000000
+00000000-000e-0000-0000-000000000000
+00000000-000f-0000-0000-000000000000
+00000000-0100-0000-0000-000000000000
+00000000-0200-0000-0000-000000000000
+00000000-0300-0000-0000-000000000000
+00000000-0400-0000-0000-000000000000
+00000000-0500-0000-0000-000000000000
+00000000-0600-0000-0000-000000000000
+00000000-0700-0000-0000-000000000000
+00000000-0800-0000-0000-000000000000
+00000000-0900-0000-0000-000000000000
+00000000-0a00-0000-0000-000000000000
+00000000-0b00-0000-0000-000000000000
+00000000-0c00-0000-0000-000000000000
+00000000-0d00-0000-0000-000000000000
+00000000-0e00-0000-0000-000000000000
+00000000-0f00-0000-0000-000000000000
+00000001-0000-0000-0000-000000000000
+00000002-0000-0000-0000-000000000000
+00000003-0000-0000-0000-000000000000
+00000004-0000-0000-0000-000000000000
+00000005-0000-0000-0000-000000000000
+00000006-0000-0000-0000-000000000000
+00000007-0000-0000-0000-000000000000
+00000008-0000-0000-0000-000000000000
+00000009-0000-0000-0000-000000000000
+0000000a-0000-0000-0000-000000000000
+0000000b-0000-0000-0000-000000000000
+0000000c-0000-0000-0000-000000000000
+0000000d-0000-0000-0000-000000000000
+0000000e-0000-0000-0000-000000000000
+0000000f-0000-0000-0000-000000000000
+00000100-0000-0000-0000-000000000000
+00000200-0000-0000-0000-000000000000
+00000300-0000-0000-0000-000000000000
+00000400-0000-0000-0000-000000000000
+00000500-0000-0000-0000-000000000000
+00000600-0000-0000-0000-000000000000
+00000700-0000-0000-0000-000000000000
+00000800-0000-0000-0000-000000000000
+00000900-0000-0000-0000-000000000000
+00000a00-0000-0000-0000-000000000000
+00000b00-0000-0000-0000-000000000000
+00000c00-0000-0000-0000-000000000000
+00000d00-0000-0000-0000-000000000000
+00000e00-0000-0000-0000-000000000000
+00000f00-0000-0000-0000-000000000000
+00010000-0000-0000-0000-000000000000
+00020000-0000-0000-0000-000000000000
+00030000-0000-0000-0000-000000000000
+00040000-0000-0000-0000-000000000000
+00050000-0000-0000-0000-000000000000
+00060000-0000-0000-0000-000000000000
+00070000-0000-0000-0000-000000000000
+00080000-0000-0000-0000-000000000000
+00090000-0000-0000-0000-000000000000
+000a0000-0000-0000-0000-000000000000
+000b0000-0000-0000-0000-000000000000
+000c0000-0000-0000-0000-000000000000
+000d0000-0000-0000-0000-000000000000
+000e0000-0000-0000-0000-000000000000
+000f0000-0000-0000-0000-000000000000
+01000000-0000-0000-0000-000000000000
+02000000-0000-0000-0000-000000000000
+03000000-0000-0000-0000-000000000000
+04000000-0000-0000-0000-000000000000
+05000000-0000-0000-0000-000000000000
+06000000-0000-0000-0000-000000000000
+07000000-0000-0000-0000-000000000000
+08000000-0000-0000-0000-000000000000
+09000000-0000-0000-0000-000000000000
+0a000000-0000-0000-0000-000000000000
+0b000000-0000-0000-0000-000000000000
+0c000000-0000-0000-0000-000000000000
+0d000000-0000-0000-0000-000000000000
+0e000000-0000-0000-0000-000000000000
+0f000000-0000-0000-0000-000000000000
+SELECT * FROM t1 ORDER BY CAST(COALESCE(NULL,a) AS BINARY(16));
+a
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+00000000-0000-0000-0000-000000000002
+00000000-0000-0000-0000-000000000003
+00000000-0000-0000-0000-000000000004
+00000000-0000-0000-0000-000000000005
+00000000-0000-0000-0000-000000000006
+00000000-0000-0000-0000-000000000007
+00000000-0000-0000-0000-000000000008
+00000000-0000-0000-0000-000000000009
+00000000-0000-0000-0000-00000000000a
+00000000-0000-0000-0000-00000000000b
+00000000-0000-0000-0000-00000000000c
+00000000-0000-0000-0000-00000000000d
+00000000-0000-0000-0000-00000000000e
+00000000-0000-0000-0000-00000000000f
+00000000-0000-0000-0000-000000000100
+00000000-0000-0000-0000-000000000200
+00000000-0000-0000-0000-000000000300
+00000000-0000-0000-0000-000000000400
+00000000-0000-0000-0000-000000000500
+00000000-0000-0000-0000-000000000600
+00000000-0000-0000-0000-000000000700
+00000000-0000-0000-0000-000000000800
+00000000-0000-0000-0000-000000000900
+00000000-0000-0000-0000-000000000a00
+00000000-0000-0000-0000-000000000b00
+00000000-0000-0000-0000-000000000c00
+00000000-0000-0000-0000-000000000d00
+00000000-0000-0000-0000-000000000e00
+00000000-0000-0000-0000-000000000f00
+00000000-0000-0000-0000-000000010000
+00000000-0000-0000-0000-000000020000
+00000000-0000-0000-0000-000000030000
+00000000-0000-0000-0000-000000040000
+00000000-0000-0000-0000-000000050000
+00000000-0000-0000-0000-000000060000
+00000000-0000-0000-0000-000000070000
+00000000-0000-0000-0000-000000080000
+00000000-0000-0000-0000-000000090000
+00000000-0000-0000-0000-0000000a0000
+00000000-0000-0000-0000-0000000b0000
+00000000-0000-0000-0000-0000000c0000
+00000000-0000-0000-0000-0000000d0000
+00000000-0000-0000-0000-0000000e0000
+00000000-0000-0000-0000-0000000f0000
+00000000-0000-0000-0000-000001000000
+00000000-0000-0000-0000-000002000000
+00000000-0000-0000-0000-000003000000
+00000000-0000-0000-0000-000004000000
+00000000-0000-0000-0000-000005000000
+00000000-0000-0000-0000-000006000000
+00000000-0000-0000-0000-000007000000
+00000000-0000-0000-0000-000008000000
+00000000-0000-0000-0000-000009000000
+00000000-0000-0000-0000-00000a000000
+00000000-0000-0000-0000-00000b000000
+00000000-0000-0000-0000-00000c000000
+00000000-0000-0000-0000-00000d000000
+00000000-0000-0000-0000-00000e000000
+00000000-0000-0000-0000-00000f000000
+00000000-0000-0000-0000-000100000000
+00000000-0000-0000-0000-000200000000
+00000000-0000-0000-0000-000300000000
+00000000-0000-0000-0000-000400000000
+00000000-0000-0000-0000-000500000000
+00000000-0000-0000-0000-000600000000
+00000000-0000-0000-0000-000700000000
+00000000-0000-0000-0000-000800000000
+00000000-0000-0000-0000-000900000000
+00000000-0000-0000-0000-000a00000000
+00000000-0000-0000-0000-000b00000000
+00000000-0000-0000-0000-000c00000000
+00000000-0000-0000-0000-000d00000000
+00000000-0000-0000-0000-000e00000000
+00000000-0000-0000-0000-000f00000000
+00000000-0000-0000-0000-010000000000
+00000000-0000-0000-0000-020000000000
+00000000-0000-0000-0000-030000000000
+00000000-0000-0000-0000-040000000000
+00000000-0000-0000-0000-050000000000
+00000000-0000-0000-0000-060000000000
+00000000-0000-0000-0000-070000000000
+00000000-0000-0000-0000-080000000000
+00000000-0000-0000-0000-090000000000
+00000000-0000-0000-0000-0a0000000000
+00000000-0000-0000-0000-0b0000000000
+00000000-0000-0000-0000-0c0000000000
+00000000-0000-0000-0000-0d0000000000
+00000000-0000-0000-0000-0e0000000000
+00000000-0000-0000-0000-0f0000000000
+00000000-0000-0000-0001-000000000000
+00000000-0000-0000-0002-000000000000
+00000000-0000-0000-0003-000000000000
+00000000-0000-0000-0004-000000000000
+00000000-0000-0000-0005-000000000000
+00000000-0000-0000-0006-000000000000
+00000000-0000-0000-0007-000000000000
+00000000-0000-0000-0008-000000000000
+00000000-0000-0000-0009-000000000000
+00000000-0000-0000-000a-000000000000
+00000000-0000-0000-000b-000000000000
+00000000-0000-0000-000c-000000000000
+00000000-0000-0000-000d-000000000000
+00000000-0000-0000-000e-000000000000
+00000000-0000-0000-000f-000000000000
+00000000-0000-0000-0100-000000000000
+00000000-0000-0000-0200-000000000000
+00000000-0000-0000-0300-000000000000
+00000000-0000-0000-0400-000000000000
+00000000-0000-0000-0500-000000000000
+00000000-0000-0000-0600-000000000000
+00000000-0000-0000-0700-000000000000
+00000000-0000-0000-0800-000000000000
+00000000-0000-0000-0900-000000000000
+00000000-0000-0000-0a00-000000000000
+00000000-0000-0000-0b00-000000000000
+00000000-0000-0000-0c00-000000000000
+00000000-0000-0000-0d00-000000000000
+00000000-0000-0000-0e00-000000000000
+00000000-0000-0000-0f00-000000000000
+00000000-0000-0001-0000-000000000000
+00000000-0000-0002-0000-000000000000
+00000000-0000-0003-0000-000000000000
+00000000-0000-0004-0000-000000000000
+00000000-0000-0005-0000-000000000000
+00000000-0000-0006-0000-000000000000
+00000000-0000-0007-0000-000000000000
+00000000-0000-0008-0000-000000000000
+00000000-0000-0009-0000-000000000000
+00000000-0000-000a-0000-000000000000
+00000000-0000-000b-0000-000000000000
+00000000-0000-000c-0000-000000000000
+00000000-0000-000d-0000-000000000000
+00000000-0000-000e-0000-000000000000
+00000000-0000-000f-0000-000000000000
+00000000-0000-0100-0000-000000000000
+00000000-0000-0200-0000-000000000000
+00000000-0000-0300-0000-000000000000
+00000000-0000-0400-0000-000000000000
+00000000-0000-0500-0000-000000000000
+00000000-0000-0600-0000-000000000000
+00000000-0000-0700-0000-000000000000
+00000000-0000-0800-0000-000000000000
+00000000-0000-0900-0000-000000000000
+00000000-0000-0a00-0000-000000000000
+00000000-0000-0b00-0000-000000000000
+00000000-0000-0c00-0000-000000000000
+00000000-0000-0d00-0000-000000000000
+00000000-0000-0e00-0000-000000000000
+00000000-0000-0f00-0000-000000000000
+00000000-0001-0000-0000-000000000000
+00000000-0002-0000-0000-000000000000
+00000000-0003-0000-0000-000000000000
+00000000-0004-0000-0000-000000000000
+00000000-0005-0000-0000-000000000000
+00000000-0006-0000-0000-000000000000
+00000000-0007-0000-0000-000000000000
+00000000-0008-0000-0000-000000000000
+00000000-0009-0000-0000-000000000000
+00000000-000a-0000-0000-000000000000
+00000000-000b-0000-0000-000000000000
+00000000-000c-0000-0000-000000000000
+00000000-000d-0000-0000-000000000000
+00000000-000e-0000-0000-000000000000
+00000000-000f-0000-0000-000000000000
+00000000-0100-0000-0000-000000000000
+00000000-0200-0000-0000-000000000000
+00000000-0300-0000-0000-000000000000
+00000000-0400-0000-0000-000000000000
+00000000-0500-0000-0000-000000000000
+00000000-0600-0000-0000-000000000000
+00000000-0700-0000-0000-000000000000
+00000000-0800-0000-0000-000000000000
+00000000-0900-0000-0000-000000000000
+00000000-0a00-0000-0000-000000000000
+00000000-0b00-0000-0000-000000000000
+00000000-0c00-0000-0000-000000000000
+00000000-0d00-0000-0000-000000000000
+00000000-0e00-0000-0000-000000000000
+00000000-0f00-0000-0000-000000000000
+00000001-0000-0000-0000-000000000000
+00000002-0000-0000-0000-000000000000
+00000003-0000-0000-0000-000000000000
+00000004-0000-0000-0000-000000000000
+00000005-0000-0000-0000-000000000000
+00000006-0000-0000-0000-000000000000
+00000007-0000-0000-0000-000000000000
+00000008-0000-0000-0000-000000000000
+00000009-0000-0000-0000-000000000000
+0000000a-0000-0000-0000-000000000000
+0000000b-0000-0000-0000-000000000000
+0000000c-0000-0000-0000-000000000000
+0000000d-0000-0000-0000-000000000000
+0000000e-0000-0000-0000-000000000000
+0000000f-0000-0000-0000-000000000000
+00000100-0000-0000-0000-000000000000
+00000200-0000-0000-0000-000000000000
+00000300-0000-0000-0000-000000000000
+00000400-0000-0000-0000-000000000000
+00000500-0000-0000-0000-000000000000
+00000600-0000-0000-0000-000000000000
+00000700-0000-0000-0000-000000000000
+00000800-0000-0000-0000-000000000000
+00000900-0000-0000-0000-000000000000
+00000a00-0000-0000-0000-000000000000
+00000b00-0000-0000-0000-000000000000
+00000c00-0000-0000-0000-000000000000
+00000d00-0000-0000-0000-000000000000
+00000e00-0000-0000-0000-000000000000
+00000f00-0000-0000-0000-000000000000
+00010000-0000-0000-0000-000000000000
+00020000-0000-0000-0000-000000000000
+00030000-0000-0000-0000-000000000000
+00040000-0000-0000-0000-000000000000
+00050000-0000-0000-0000-000000000000
+00060000-0000-0000-0000-000000000000
+00070000-0000-0000-0000-000000000000
+00080000-0000-0000-0000-000000000000
+00090000-0000-0000-0000-000000000000
+000a0000-0000-0000-0000-000000000000
+000b0000-0000-0000-0000-000000000000
+000c0000-0000-0000-0000-000000000000
+000d0000-0000-0000-0000-000000000000
+000e0000-0000-0000-0000-000000000000
+000f0000-0000-0000-0000-000000000000
+01000000-0000-0000-0000-000000000000
+02000000-0000-0000-0000-000000000000
+03000000-0000-0000-0000-000000000000
+04000000-0000-0000-0000-000000000000
+05000000-0000-0000-0000-000000000000
+06000000-0000-0000-0000-000000000000
+07000000-0000-0000-0000-000000000000
+08000000-0000-0000-0000-000000000000
+09000000-0000-0000-0000-000000000000
+0a000000-0000-0000-0000-000000000000
+0b000000-0000-0000-0000-000000000000
+0c000000-0000-0000-0000-000000000000
+0d000000-0000-0000-0000-000000000000
+0e000000-0000-0000-0000-000000000000
+0f000000-0000-0000-0000-000000000000
+DROP TABLE t1;
+#
+# cmp_item_uuid: IN for non-constants
+#
+CREATE TABLE t1 (a UUID, b UUID);
+INSERT INTO t1 VALUES
+(
+'00000000-0000-0000-0000-000000000001',
+'00000000-0000-0000-0000-000000000002'
+);
+SELECT * FROM t1 WHERE '00000000-0000-0000-0000-000000000000' IN (a, b);
+a b
+SELECT * FROM t1 WHERE '00000000-0000-0000-0000-000000000001' IN (a, b);
+a b
+00000000-0000-0000-0000-000000000001 00000000-0000-0000-0000-000000000002
+SELECT * FROM t1 WHERE '00-000000-0000-0000-0000-000000000001' IN (a, b);
+a b
+00000000-0000-0000-0000-000000000001 00000000-0000-0000-0000-000000000002
+SELECT * FROM t1 WHERE '00-00-0000-0000-0000-0000-000000000001' IN (a, b);
+a b
+00000000-0000-0000-0000-000000000001 00000000-0000-0000-0000-000000000002
+DROP TABLE t1;
+#
+# cmp_item_uuid: DECODE_ORACLE
+#
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+(NULL),
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-000000000002');
+SELECT a, DECODE_ORACLE(a, '00000000-0000-0000-0000-000000000002', '01') AS d FROM t1;
+a d
+NULL NULL
+00000000-0000-0000-0000-000000000001 NULL
+00000000-0000-0000-0000-000000000002 01
+SELECT
+a,
+DECODE_ORACLE(a, '00000000-0000-0000-0000-000000000001', '01') AS d0,
+DECODE_ORACLE(a, NULL, '<NULL>', '00000000-0000-0000-0000-000000000001', '01') AS d1,
+DECODE_ORACLE(a, 'garbage', '<NULL>', '00000000-0000-0000-0000-000000000001', '01') AS d2
+FROM t1;
+a d0 d1 d2
+NULL NULL <NULL> <NULL>
+00000000-0000-0000-0000-000000000001 01 01 01
+00000000-0000-0000-0000-000000000002 NULL NULL NULL
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+DROP TABLE t1;
+#
+# CASE abbreviations
+#
+CREATE TABLE t1 (
+c UUID,
+c_char CHAR(32),
+c_varchar VARCHAR(32),
+c_tinytext TINYTEXT,
+c_text TEXT,
+c_mediumtext TEXT,
+c_longtext LONGTEXT
+);
+CREATE TABLE t2 AS SELECT
+COALESCE(c, c_char),
+COALESCE(c, c_varchar),
+COALESCE(c, c_tinytext),
+COALESCE(c, c_text),
+COALESCE(c, c_mediumtext),
+COALESCE(c, c_longtext)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `COALESCE(c, c_char)` uuid DEFAULT NULL,
+ `COALESCE(c, c_varchar)` uuid DEFAULT NULL,
+ `COALESCE(c, c_tinytext)` uuid DEFAULT NULL,
+ `COALESCE(c, c_text)` uuid DEFAULT NULL,
+ `COALESCE(c, c_mediumtext)` uuid DEFAULT NULL,
+ `COALESCE(c, c_longtext)` uuid DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+LEAST(c, c_char),
+LEAST(c, c_varchar),
+LEAST(c, c_tinytext),
+LEAST(c, c_text),
+LEAST(c, c_mediumtext),
+LEAST(c, c_longtext)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `LEAST(c, c_char)` uuid DEFAULT NULL,
+ `LEAST(c, c_varchar)` uuid DEFAULT NULL,
+ `LEAST(c, c_tinytext)` uuid DEFAULT NULL,
+ `LEAST(c, c_text)` uuid DEFAULT NULL,
+ `LEAST(c, c_mediumtext)` uuid DEFAULT NULL,
+ `LEAST(c, c_longtext)` uuid DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+(NULL),
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-000000000002');
+SELECT COALESCE(a, '00000000-0000-0000-0000-000000000000') FROM t1 ORDER BY a;
+COALESCE(a, '00000000-0000-0000-0000-000000000000')
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+00000000-0000-0000-0000-000000000002
+SELECT
+a,
+LEAST(a,'00000000-0000-0000-0000-000000000000'),
+LEAST(a,'00000000-0000-0000-0000-00000000000f')
+FROM t1 ORDER BY a;
+a LEAST(a,'00000000-0000-0000-0000-000000000000') LEAST(a,'00000000-0000-0000-0000-00000000000f')
+NULL NULL NULL
+00000000-0000-0000-0000-000000000001 00000000-0000-0000-0000-000000000000 00000000-0000-0000-0000-000000000001
+00000000-0000-0000-0000-000000000002 00000000-0000-0000-0000-000000000000 00000000-0000-0000-0000-000000000002
+SELECT
+a,
+GREATEST(a,'00000000-0000-0000-0000-000000000000'),
+GREATEST(a,'00000000-0000-0000-0000-00000000000f')
+FROM t1 ORDER BY a;
+a GREATEST(a,'00000000-0000-0000-0000-000000000000') GREATEST(a,'00000000-0000-0000-0000-00000000000f')
+NULL NULL NULL
+00000000-0000-0000-0000-000000000001 00000000-0000-0000-0000-000000000001 00000000-0000-0000-0000-00000000000f
+00000000-0000-0000-0000-000000000002 00000000-0000-0000-0000-000000000002 00000000-0000-0000-0000-00000000000f
+CREATE TABLE t2 AS SELECT
+COALESCE(a, '00000000-0000-0000-0000-000000000000'),
+LEAST(a,'00000000-0000-0000-0000-000000000000'),
+GREATEST(a,'00000000-0000-0000-0000-000000000000')
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `COALESCE(a, '00000000-0000-0000-0000-000000000000')` uuid DEFAULT NULL,
+ `LEAST(a,'00000000-0000-0000-0000-000000000000')` uuid DEFAULT NULL,
+ `GREATEST(a,'00000000-0000-0000-0000-000000000000')` uuid DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+SELECT COALESCE(a, 0x00000000000000000000000000000000) FROM t1 ORDER BY a;
+COALESCE(a, 0x00000000000000000000000000000000)
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+00000000-0000-0000-0000-000000000002
+SELECT
+a,
+LEAST(a, 0x00000000000000000000000000000000),
+LEAST(a, 0x0000000000000000000000000000000f)
+FROM t1 ORDER BY a;
+a LEAST(a, 0x00000000000000000000000000000000) LEAST(a, 0x0000000000000000000000000000000f)
+NULL NULL NULL
+00000000-0000-0000-0000-000000000001 00000000-0000-0000-0000-000000000000 00000000-0000-0000-0000-000000000001
+00000000-0000-0000-0000-000000000002 00000000-0000-0000-0000-000000000000 00000000-0000-0000-0000-000000000002
+SELECT
+a,
+GREATEST(a, 0x00000000000000000000000000000000),
+GREATEST(a, 0x0000000000000000000000000000000f)
+FROM t1 ORDER BY a;
+a GREATEST(a, 0x00000000000000000000000000000000) GREATEST(a, 0x0000000000000000000000000000000f)
+NULL NULL NULL
+00000000-0000-0000-0000-000000000001 00000000-0000-0000-0000-000000000001 00000000-0000-0000-0000-00000000000f
+00000000-0000-0000-0000-000000000002 00000000-0000-0000-0000-000000000002 00000000-0000-0000-0000-00000000000f
+CREATE TABLE t2 AS SELECT
+COALESCE(a, 0x00000000000000000000000000000000),
+LEAST(a,0x00000000000000000000000000000000),
+GREATEST(a,0x00000000000000000000000000000000)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `COALESCE(a, 0x00000000000000000000000000000000)` uuid DEFAULT NULL,
+ `LEAST(a,0x00000000000000000000000000000000)` uuid DEFAULT NULL,
+ `GREATEST(a,0x00000000000000000000000000000000)` uuid DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+SELECT COALESCE(a, 10) FROM t1;
+ERROR HY000: Illegal parameter data types uuid and int for operation 'coalesce'
+SELECT LEAST(a, 10) FROM t1;
+ERROR HY000: Illegal parameter data types uuid and int for operation 'least'
+SELECT GREATEST(a, 10) FROM t1;
+ERROR HY000: Illegal parameter data types uuid and int for operation 'greatest'
+DROP TABLE t1;
+SELECT COALESCE('garbage', CAST('::1' AS UUID));
+COALESCE('garbage', CAST('::1' AS UUID))
+NULL
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: '::1'
+SELECT COALESCE(0x01, CAST('::1' AS UUID));
+COALESCE(0x01, CAST('::1' AS UUID))
+NULL
+Warnings:
+Warning 1292 Incorrect uuid value: '\x01'
+Warning 1292 Incorrect uuid value: '::1'
+#
+# Uniqueness
+#
+CREATE TABLE t1 (a UUID NOT NULL PRIMARY KEY);
+INSERT INTO t1 VALUES
+('41000000-0000-0000-0000-000000000001'),
+('61000000-0000-0000-0000-000000000001');
+INSERT INTO t1 VALUES ('41000000-0000-0000-0000-000000000001');
+ERROR 23000: Duplicate entry '41000000-0000-0000-0000-000000000001' for key 'PRIMARY'
+SELECT * FROM t1;
+a
+41000000-0000-0000-0000-000000000001
+61000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+#
+# Indexes
+#
+CREATE TABLE t1 (a UUID, KEY(a(1)));
+ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys
+#
+# Explicit CAST on INSERT
+#
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES (CAST('10000000-0000-0000-0000-000000000001' AS UUID));
+INSERT INTO t1 VALUES (CAST('10000000-0000-0000-0000-000000000002' AS UUID));
+INSERT INTO t1 VALUES (CAST('10000000-0000-0000-0000-000000000003' AS UUID));
+INSERT INTO t1 VALUES (CAST(CONCAT('2','0000000-0000-0000-0000-000000000001') AS UUID));
+INSERT INTO t1 VALUES (CAST(CONCAT('2','0000000-0000-0000-0000-000000000002') AS UUID));
+INSERT INTO t1 VALUES (CAST(CONCAT('2','0000000-0000-0000-0000-000000000003') AS UUID));
+SELECT * FROM t1 ORDER BY a;
+a
+10000000-0000-0000-0000-000000000001
+20000000-0000-0000-0000-000000000001
+10000000-0000-0000-0000-000000000002
+20000000-0000-0000-0000-000000000002
+10000000-0000-0000-0000-000000000003
+20000000-0000-0000-0000-000000000003
+DROP TABLE t1;
+#
+# Explicit CAST and implicit CAST on ALTER
+#
+CREATE TABLE t1 (a VARCHAR(64));
+INSERT INTO t1 VALUES
+('garbage'),
+('00000000-0000-0000-0000-000000000000'),
+('00000000-0000-0000-0000-000000000001'),
+('ffff0000-0000-0000-0000-000000000001'),
+('ffff0000-0000-0000-0000-000000000002');
+SELECT a, CAST(a AS UUID) FROM t1 ORDER BY a;
+a CAST(a AS UUID)
+00000000-0000-0000-0000-000000000000 00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001 00000000-0000-0000-0000-000000000001
+ffff0000-0000-0000-0000-000000000001 ffff0000-0000-0000-0000-000000000001
+ffff0000-0000-0000-0000-000000000002 ffff0000-0000-0000-0000-000000000002
+garbage NULL
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+SELECT a, CAST(a AS UUID) FROM t1 ORDER BY CAST(a AS UUID);
+a CAST(a AS UUID)
+garbage NULL
+00000000-0000-0000-0000-000000000000 00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001 00000000-0000-0000-0000-000000000001
+ffff0000-0000-0000-0000-000000000001 ffff0000-0000-0000-0000-000000000001
+ffff0000-0000-0000-0000-000000000002 ffff0000-0000-0000-0000-000000000002
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+ALTER TABLE t1 MODIFY a UUID;
+ERROR 22007: Incorrect uuid value: 'garbage' for column `test`.`t1`.`a` at row 1
+SET sql_mode='';
+ALTER TABLE t1 MODIFY a UUID;
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage' for column `test`.`t1`.`a` at row 1
+SET sql_mode=DEFAULT;
+SELECT * FROM t1 ORDER BY a;
+a
+NULL
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+ffff0000-0000-0000-0000-000000000001
+ffff0000-0000-0000-0000-000000000002
+DROP TABLE t1;
+CREATE TABLE t1 (a BINARY(16));
+INSERT INTO t1 VALUES (0x00000000000000000000000000000000);
+INSERT INTO t1 VALUES (0x00000000000000000000000000000001);
+INSERT INTO t1 VALUES (0xffff0000000000000000000000000001);
+INSERT INTO t1 VALUES (0xffff0000000000000000000000000002);
+SELECT HEX(a), CAST(a AS UUID) FROM t1 ORDER BY a;
+HEX(a) CAST(a AS UUID)
+00000000000000000000000000000000 00000000-0000-0000-0000-000000000000
+00000000000000000000000000000001 00000000-0000-0000-0000-000000000001
+FFFF0000000000000000000000000001 ffff0000-0000-0000-0000-000000000001
+FFFF0000000000000000000000000002 ffff0000-0000-0000-0000-000000000002
+ALTER TABLE t1 MODIFY a UUID;
+SELECT * FROM t1 ORDER BY a;
+a
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+ffff0000-0000-0000-0000-000000000001
+ffff0000-0000-0000-0000-000000000002
+DROP TABLE t1;
+#
+# INSERT..SELECT, same data types
+#
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000000'),
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-000000000002');
+CREATE TABLE t2 (a UUID);
+INSERT INTO t2 SELECT a FROM t1;
+SELECT * FROM t2;
+a
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+00000000-0000-0000-0000-000000000002
+DROP TABLE t1,t2;
+#
+# Implicit CAST on INSERT..SELECT, text format
+#
+CREATE TABLE t1 (a VARCHAR(64));
+INSERT INTO t1 VALUES
+('garbage'),
+('00000000-0000-0000-0000-000000000000'),
+('00000000-0000-0000-0000-000000000001'),
+('ffff0000-0000-0000-0000-000000000001'),
+('ffff0000-0000-0000-0000-000000000002');
+CREATE TABLE t2 (a UUID);
+INSERT INTO t2 SELECT a FROM t1;
+ERROR 22007: Incorrect uuid value: 'garbage' for column `test`.`t2`.`a` at row 1
+SET sql_mode='';
+INSERT INTO t2 SELECT a FROM t1;
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage' for column `test`.`t2`.`a` at row 1
+SELECT * FROM t2 ORDER BY a;
+a
+NULL
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+ffff0000-0000-0000-0000-000000000001
+ffff0000-0000-0000-0000-000000000002
+SET sql_mode=DEFAULT;
+DROP TABLE t2;
+CREATE TABLE t2 (a UUID NOT NULL);
+INSERT INTO t2 SELECT a FROM t1;
+ERROR 22007: Incorrect uuid value: 'garbage' for column `test`.`t2`.`a` at row 1
+SET sql_mode='';
+INSERT INTO t2 SELECT a FROM t1;
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage' for column `test`.`t2`.`a` at row 1
+SELECT * FROM t2 ORDER BY a;
+a
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+ffff0000-0000-0000-0000-000000000001
+ffff0000-0000-0000-0000-000000000002
+SET sql_mode=DEFAULT;
+DROP TABLE t2;
+DROP TABLE t1;
+#
+# Implicit CAST on INSERT..SELECT, binary format
+#
+CREATE TABLE t1 (a BINARY(16));
+INSERT INTO t1 VALUES (0x00000000000000000000000000000000);
+INSERT INTO t1 VALUES (0x00000000000000000000000000000001);
+INSERT INTO t1 VALUES (0xffff0000000000000000000000000001);
+INSERT INTO t1 VALUES (0xffff0000000000000000000000000002);
+CREATE TABLE t2 (a UUID);
+INSERT INTO t2 SELECT a FROM t1;
+SELECT a FROM t2 ORDER BY a;
+a
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+ffff0000-0000-0000-0000-000000000001
+ffff0000-0000-0000-0000-000000000002
+DROP TABLE t1,t2;
+#
+# CAST to other data types
+#
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS DOUBLE);
+ERROR HY000: Illegal parameter data type uuid for operation 'double_typecast'
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS FLOAT);
+ERROR HY000: Illegal parameter data type uuid for operation 'float_typecast'
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS DECIMAL);
+ERROR HY000: Illegal parameter data type uuid for operation 'decimal_typecast'
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS SIGNED);
+ERROR HY000: Illegal parameter data type uuid for operation 'cast_as_signed'
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS UNSIGNED);
+ERROR HY000: Illegal parameter data type uuid for operation 'cast_as_unsigned'
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS TIME);
+ERROR HY000: Illegal parameter data type uuid for operation 'cast_as_time'
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS DATE);
+ERROR HY000: Illegal parameter data type uuid for operation 'cast_as_date'
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS DATETIME);
+ERROR HY000: Illegal parameter data type uuid for operation 'cast_as_datetime'
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS CHAR);
+CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS CHAR)
+00000000-0000-0000-0000-000000000000
+CREATE TABLE t1 AS SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS CHAR) AS a;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(36) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff');
+CREATE TABLE t2 AS SELECT
+CAST(a AS CHAR),
+CAST(a AS CHAR(36)),
+CAST(a AS CHAR(530)),
+CAST(a AS CHAR(65535)),
+CAST(a AS CHAR(66000)),
+CAST(a AS CHAR(16777215)),
+CAST(a AS CHAR(16777216))
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `CAST(a AS CHAR)` varchar(36) DEFAULT NULL,
+ `CAST(a AS CHAR(36))` varchar(36) DEFAULT NULL,
+ `CAST(a AS CHAR(530))` text DEFAULT NULL,
+ `CAST(a AS CHAR(65535))` text DEFAULT NULL,
+ `CAST(a AS CHAR(66000))` mediumtext DEFAULT NULL,
+ `CAST(a AS CHAR(16777215))` mediumtext DEFAULT NULL,
+ `CAST(a AS CHAR(16777216))` longtext DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+CAST(a AS CHAR) ffffffff-ffff-ffff-ffff-ffffffffffff
+CAST(a AS CHAR(36)) ffffffff-ffff-ffff-ffff-ffffffffffff
+CAST(a AS CHAR(530)) ffffffff-ffff-ffff-ffff-ffffffffffff
+CAST(a AS CHAR(65535)) ffffffff-ffff-ffff-ffff-ffffffffffff
+CAST(a AS CHAR(66000)) ffffffff-ffff-ffff-ffff-ffffffffffff
+CAST(a AS CHAR(16777215)) ffffffff-ffff-ffff-ffff-ffffffffffff
+CAST(a AS CHAR(16777216)) ffffffff-ffff-ffff-ffff-ffffffffffff
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff');
+CREATE TABLE t2 AS SELECT
+CAST(a AS BINARY(4)) AS cb4,
+CAST(a AS BINARY) AS cb,
+CAST(a AS BINARY(16)) AS cb16,
+CAST(a AS BINARY(32)) AS cb32,
+CAST(a AS BINARY(530)) AS cb530,
+CAST(a AS BINARY(65535)) AS cb65535,
+CAST(a AS BINARY(66000)) AS cb66000,
+CAST(a AS BINARY(16777215)) AS cb16777215,
+CAST(a AS BINARY(16777216)) AS cb16777216
+FROM t1 LIMIT 0;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `cb4` binary(4) DEFAULT NULL,
+ `cb` binary(16) DEFAULT NULL,
+ `cb16` binary(16) DEFAULT NULL,
+ `cb32` binary(32) DEFAULT NULL,
+ `cb530` varbinary(530) DEFAULT NULL,
+ `cb65535` blob DEFAULT NULL,
+ `cb66000` mediumblob DEFAULT NULL,
+ `cb16777215` mediumblob DEFAULT NULL,
+ `cb16777216` longblob DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+CAST(a AS BINARY(4)) AS cb4,
+CAST(a AS BINARY) AS cb,
+CAST(a AS BINARY(16)) AS cb16,
+CAST(a AS BINARY(32)) AS cb32,
+CAST(a AS BINARY(530)) AS cb530,
+CAST(a AS BINARY(65535)) AS cb65535
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `cb4` binary(4) DEFAULT NULL,
+ `cb` binary(16) DEFAULT NULL,
+ `cb16` binary(16) DEFAULT NULL,
+ `cb32` binary(32) DEFAULT NULL,
+ `cb530` varbinary(530) DEFAULT NULL,
+ `cb65535` blob DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT
+HEX(cb4),
+HEX(cb),
+HEX(cb16),
+HEX(cb32),
+LENGTH(cb530),
+LENGTH(cb65535)
+FROM t2;
+HEX(cb4) FFFFFFFF
+HEX(cb) FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+HEX(cb16) FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+HEX(cb32) FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000
+LENGTH(cb530) 530
+LENGTH(cb65535) 65535
+DROP TABLE t2;
+DROP TABLE t1;
+#
+# Implicit conversion to other types in INSERT
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL(32,0));
+INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+ERROR 01000: Data truncated for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(64));
+INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT);
+INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+DROP TABLE t1;
+#
+# Boolean context
+#
+SELECT
+CAST('00000000-0000-0000-0000-000000000000' AS UUID) IS TRUE,
+CAST('00000000-0000-0000-0000-000000000000' AS UUID) IS FALSE,
+CAST('00000000-0000-0000-0000-000000000001' AS UUID) IS TRUE,
+CAST('00000000-0000-0000-0000-000000000001' AS UUID) IS FALSE;
+CAST('00000000-0000-0000-0000-000000000000' AS UUID) IS TRUE CAST('00000000-0000-0000-0000-000000000000' AS UUID) IS FALSE CAST('00000000-0000-0000-0000-000000000001' AS UUID) IS TRUE CAST('00000000-0000-0000-0000-000000000001' AS UUID) IS FALSE
+0 1 1 0
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000000'),
+('00000000-0000-0000-0000-000000000001');
+SELECT a, a IS TRUE, a IS FALSE FROM t1 ORDER BY a;
+a a IS TRUE a IS FALSE
+00000000-0000-0000-0000-000000000000 0 1
+00000000-0000-0000-0000-000000000001 1 0
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000000'),
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-000000000002');
+SELECT * FROM t1 WHERE a;
+ERROR HY000: Illegal parameter data types uuid and bigint for operation '<>'
+DROP TABLE t1;
+#
+# GROUP BY
+#
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000000'),
+('00000000-0000-0000-0000-0000-00000000');
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-0000-00000001'),
+('00000000-0000-0000-0000-0000-0000-0001');
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000002'),
+('00000000-0000-0000-0000-000000000002'),
+('00000000-0000-0000-0000-0000-00000002'),
+('00000000-0000-0000-0000-0000-0000-0002');
+SELECT a, COUNT(*) FROM t1 GROUP BY a;
+a COUNT(*)
+00000000-0000-0000-0000-000000000000 2
+00000000-0000-0000-0000-000000000001 3
+00000000-0000-0000-0000-000000000002 4
+DROP TABLE t1;
+#
+# Aggregate functions
+#
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000000'),
+('00000000-0000-0000-0000-000000000000');
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-0000-00000001'),
+('00000000-0000-0000-0000-0000-0000-0001');
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000002'),
+('00000000-0000-0000-0000-000000000002'),
+('00000000-0000-0000-0000-000000000002'),
+('00000000-0000-0000-0000-000000000002');
+SELECT MIN(a),MAX(a) FROM t1;
+MIN(a) MAX(a)
+00000000-0000-0000-0000-000000000000 00000000-0000-0000-0000-000000000002
+CREATE TABLE t2 AS SELECT MIN(a), MAX(a) FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `MIN(a)` uuid DEFAULT NULL,
+ `MAX(a)` uuid DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t2;
+MIN(a) MAX(a)
+00000000-0000-0000-0000-000000000000 00000000-0000-0000-0000-000000000002
+DROP TABLE t2;
+SELECT AVG(a) FROM t1;
+ERROR HY000: Illegal parameter data type uuid for operation 'avg('
+SELECT AVG(DISTINCT a) FROM t1;
+ERROR HY000: Illegal parameter data type uuid for operation 'avg(distinct '
+SELECT SUM(a) FROM t1;
+ERROR HY000: Illegal parameter data type uuid for operation 'sum('
+SELECT SUM(DISTINCT a) FROM t1;
+ERROR HY000: Illegal parameter data type uuid for operation 'sum(distinct '
+SELECT STDDEV(a) FROM t1;
+ERROR HY000: Illegal parameter data type uuid for operation 'std('
+SELECT GROUP_CONCAT(a ORDER BY a) FROM t1;
+GROUP_CONCAT(a ORDER BY a)
+00000000-0000-0000-0000-000000000000,00000000-0000-0000-0000-000000000000,00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002,00000000-0000-0000-0000-000000000002,00000000-0000-0000-0000-000000000002,00000000-0000-0000-0000-000000000002
+SELECT a, GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a;
+a GROUP_CONCAT(a ORDER BY a)
+00000000-0000-0000-0000-000000000000 00000000-0000-0000-0000-000000000000,00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001 00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000001
+00000000-0000-0000-0000-000000000002 00000000-0000-0000-0000-000000000002,00000000-0000-0000-0000-000000000002,00000000-0000-0000-0000-000000000002,00000000-0000-0000-0000-000000000002
+DROP TABLE t1;
+#
+# Window functions
+#
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-000000000002'),
+('00000000-0000-0000-0000-000000000003'),
+('00000000-0000-0000-0000-000000000004');
+SELECT
+a,
+LAG(a) OVER (ORDER BY a),
+LEAD(a) OVER (ORDER BY a)
+FROM t1 ORDER BY a;
+a LAG(a) OVER (ORDER BY a) LEAD(a) OVER (ORDER BY a)
+00000000-0000-0000-0000-000000000001 NULL 00000000-0000-0000-0000-000000000002
+00000000-0000-0000-0000-000000000002 00000000-0000-0000-0000-000000000001 00000000-0000-0000-0000-000000000003
+00000000-0000-0000-0000-000000000003 00000000-0000-0000-0000-000000000002 00000000-0000-0000-0000-000000000004
+00000000-0000-0000-0000-000000000004 00000000-0000-0000-0000-000000000003 NULL
+SELECT
+a,
+FIRST_VALUE(a) OVER (ORDER BY a ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING),
+LAST_VALUE(a) OVER (ORDER BY a ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING)
+FROM t1 ORDER BY a;
+a FIRST_VALUE(a) OVER (ORDER BY a ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) LAST_VALUE(a) OVER (ORDER BY a ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING)
+00000000-0000-0000-0000-000000000001 00000000-0000-0000-0000-000000000001 00000000-0000-0000-0000-000000000002
+00000000-0000-0000-0000-000000000002 00000000-0000-0000-0000-000000000001 00000000-0000-0000-0000-000000000003
+00000000-0000-0000-0000-000000000003 00000000-0000-0000-0000-000000000002 00000000-0000-0000-0000-000000000004
+00000000-0000-0000-0000-000000000004 00000000-0000-0000-0000-000000000003 00000000-0000-0000-0000-000000000004
+DROP TABLE t1;
+#
+# Prepared statements
+#
+EXECUTE IMMEDIATE 'CREATE TABLE t1 AS SELECT ? AS a'
+ USING CAST('00000000-0000-0000-0000-000000000000' AS UUID);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` uuid NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES (?)'
+ USING '00000000-0000-0000-0000-000000000001';
+EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES (?)'
+ USING CAST('00000000-0000-0000-0000-000000000002' AS UUID);
+EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES (?)'
+ USING 0x00000000000000000000000000000003;
+SELECT a FROM t1 ORDER BY a;
+a
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+00000000-0000-0000-0000-000000000002
+00000000-0000-0000-0000-000000000003
+EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE a=?'
+ USING '00000000-0000-0000-0000-000000000001';
+a
+00000000-0000-0000-0000-000000000001
+EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE a=?'
+ USING CAST('00000000-0000-0000-0000-000000000002' AS UUID);
+a
+00000000-0000-0000-0000-000000000002
+EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE a=?'
+ USING 0x00000000000000000000000000000003;
+a
+00000000-0000-0000-0000-000000000003
+DROP TABLE t1;
+#
+# Character set and collation aggregation
+#
+CREATE TABLE t1 (a UUID);
+CREATE TABLE t2 AS SELECT
+CONCAT(a) AS c1,
+CONCAT(CAST('00000000-0000-0000-0000-000000000000' AS UUID)) AS c2
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varchar(36) DEFAULT NULL,
+ `c2` varchar(36) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+CONCAT(_utf8'1', LEFT(a,35)) AS c1,
+CONCAT(_utf8'1', LEFT(CAST('00000000-0000-0000-0000-000000000000' AS UUID),35)) AS c2,
+CONCAT(_utf8'1', LEFT(COALESCE(a),35)) AS c3
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varchar(36) CHARACTER SET utf8mb3 DEFAULT NULL,
+ `c2` varchar(36) CHARACTER SET utf8mb3 DEFAULT NULL,
+ `c3` varchar(36) CHARACTER SET utf8mb3 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+CONCAT(_latin1'1', LEFT(a,35)) AS c1,
+CONCAT(_latin1'1', LEFT(CAST('00000000-0000-0000-0000-000000000000' AS UUID),35)) AS c2,
+CONCAT(_latin1'1', LEFT(COALESCE(a),35)) AS c3
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varchar(36) DEFAULT NULL,
+ `c2` varchar(36) DEFAULT NULL,
+ `c3` varchar(36) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+#
+# UNION
+#
+CREATE TABLE t1 AS
+SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS c
+UNION
+SELECT CAST('00000000-0000-0000-0000-000000000001' AS UUID);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c;
+c
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+CREATE TABLE t1 AS
+SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS c
+UNION
+SELECT '00000000-0000-0000-0000-000000000001';
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c;
+c
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+CREATE TABLE t1 AS
+SELECT '00000000-0000-0000-0000-000000000000' AS c
+UNION
+SELECT CAST('00000000-0000-0000-0000-000000000001' AS UUID);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c;
+c
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+CREATE TABLE t1 AS
+SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS c
+UNION
+SELECT 0x00000000000000000000000000000001;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t1 ORDER BY c;
+c
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+CREATE TABLE t1 AS
+SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS c
+UNION
+SELECT 1;
+ERROR HY000: Illegal parameter data types uuid and int for operation 'UNION'
+#
+# Unary operators
+#
+SELECT -CAST('00000000-0000-0000-0000-000000000000' AS UUID);
+ERROR HY000: Illegal parameter data type uuid for operation '-'
+SELECT ABS(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+ERROR HY000: Illegal parameter data type uuid for operation 'abs'
+SELECT ROUND(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+ERROR HY000: Illegal parameter data type uuid for operation 'round'
+SELECT CEILING(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+ERROR HY000: Illegal parameter data type uuid for operation 'ceiling'
+SELECT FLOOR(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+ERROR HY000: Illegal parameter data type uuid for operation 'floor'
+#
+# Arithmetic operators
+#
+SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) + 1;
+ERROR HY000: Illegal parameter data types uuid and int for operation '+'
+SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) - 1;
+ERROR HY000: Illegal parameter data types uuid and int for operation '-'
+SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) * 1;
+ERROR HY000: Illegal parameter data types uuid and int for operation '*'
+SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) / 1;
+ERROR HY000: Illegal parameter data types uuid and int for operation '/'
+SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) MOD 1;
+ERROR HY000: Illegal parameter data types uuid and int for operation 'MOD'
+#
+# Misc
+#
+SELECT RAND(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+ERROR HY000: Illegal parameter data type uuid for operation 'rand'
+SELECT FROM_UNIXTIME(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+ERROR HY000: Illegal parameter data type uuid for operation 'from_unixtime'
+SELECT HOUR(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+ERROR HY000: Illegal parameter data type uuid for operation 'hour'
+SELECT YEAR(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+ERROR HY000: Illegal parameter data type uuid for operation 'year'
+SELECT RELEASE_LOCK(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+ERROR HY000: Illegal parameter data type uuid for operation 'release_lock'
+SELECT JSON_LENGTH(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+JSON_LENGTH(CAST('00000000-0000-0000-0000-000000000000' AS UUID))
+1
+#
+# Virtual columns
+#
+CREATE TABLE t1 (
+a INT,
+b UUID GENERATED ALWAYS AS (CAST(CONCAT(RAND(),a) AS UUID)), INDEX(b)
+);
+ERROR HY000: Function or expression 'rand()' cannot be used in the GENERATED ALWAYS AS clause of `b`
+CREATE TABLE t1 (
+a INT,
+b UUID GENERATED ALWAYS AS (CAST(CONCAT('00000000-0000-0000-0000-00000000001',HEX(a)) AS UUID)), INDEX(b)
+);
+INSERT INTO t1 (a) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15);
+SELECT * FROM t1;
+a b
+0 00000000-0000-0000-0000-000000000010
+1 00000000-0000-0000-0000-000000000011
+2 00000000-0000-0000-0000-000000000012
+3 00000000-0000-0000-0000-000000000013
+4 00000000-0000-0000-0000-000000000014
+5 00000000-0000-0000-0000-000000000015
+6 00000000-0000-0000-0000-000000000016
+7 00000000-0000-0000-0000-000000000017
+8 00000000-0000-0000-0000-000000000018
+9 00000000-0000-0000-0000-000000000019
+10 00000000-0000-0000-0000-00000000001a
+11 00000000-0000-0000-0000-00000000001b
+12 00000000-0000-0000-0000-00000000001c
+13 00000000-0000-0000-0000-00000000001d
+14 00000000-0000-0000-0000-00000000001e
+15 00000000-0000-0000-0000-00000000001f
+DROP TABLE t1;
+#
+# VIEW
+#
+CREATE TABLE t1 (a INT DEFAULT 0);
+INSERT INTO t1 (a) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15);
+SELECT * FROM t1 ORDER BY a;
+a
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+CREATE VIEW v1 AS SELECT (CAST(CONCAT('00000000-0000-0000-0000-00000000001',HEX(a)) AS UUID)) AS c FROM t1;
+SELECT * FROM v1 ORDER BY c;
+c
+00000000-0000-0000-0000-000000000010
+00000000-0000-0000-0000-000000000011
+00000000-0000-0000-0000-000000000012
+00000000-0000-0000-0000-000000000013
+00000000-0000-0000-0000-000000000014
+00000000-0000-0000-0000-000000000015
+00000000-0000-0000-0000-000000000016
+00000000-0000-0000-0000-000000000017
+00000000-0000-0000-0000-000000000018
+00000000-0000-0000-0000-000000000019
+00000000-0000-0000-0000-00000000001a
+00000000-0000-0000-0000-00000000001b
+00000000-0000-0000-0000-00000000001c
+00000000-0000-0000-0000-00000000001d
+00000000-0000-0000-0000-00000000001e
+00000000-0000-0000-0000-00000000001f
+DROP VIEW v1;
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID DEFAULT '00000000-0000-0000-0000-000000000000');
+CREATE VIEW v1 AS SELECT * FROM t1;
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci
+DESCRIBE v1;
+Field Type Null Key Default Extra
+a uuid YES 00000000-0000-0000-0000-000000000000
+INSERT INTO v1 VALUES
+(DEFAULT),
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-000000000002');
+SELECT * FROM t1;
+a
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+00000000-0000-0000-0000-000000000002
+DROP VIEW v1;
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID DEFAULT CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+CREATE VIEW v1 AS SELECT * FROM t1;
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci
+DESCRIBE v1;
+Field Type Null Key Default Extra
+a uuid YES cast('00000000-0000-0000-0000-000000000000' as uuid)
+INSERT INTO v1 VALUES
+(DEFAULT),
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-000000000002');
+SELECT * FROM t1;
+a
+00000000-0000-0000-0000-000000000000
+00000000-0000-0000-0000-000000000001
+00000000-0000-0000-0000-000000000002
+DROP VIEW v1;
+DROP TABLE t1;
+#
+# Subqueries
+#
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000000'),
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-000000000002');
+SELECT * FROM t1 WHERE a=(SELECT MIN(a) FROM t1) ORDER BY a;
+a
+00000000-0000-0000-0000-000000000000
+SELECT * FROM t1 WHERE a=(SELECT MAX(a) FROM t1) ORDER BY a;
+a
+00000000-0000-0000-0000-000000000002
+SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE a>'00000000-0000-0000-0000-000000000000') ORDER BY a;
+a
+00000000-0000-0000-0000-000000000001
+00000000-0000-0000-0000-000000000002
+DROP TABLE t1;
+#
+# Stored routines
+#
+CREATE PROCEDURE p1(a UUID)
+BEGIN
+DECLARE b UUID DEFAULT CONCAT('1',SUBSTRING(a,2,36));
+SELECT a, b;
+END;
+$$
+CALL p1('00000000-0000-0000-0000-000000000001');
+a b
+00000000-0000-0000-0000-000000000001 10000000-0000-0000-0000-000000000001
+CALL p1(CAST('00000000-0000-0000-0000-000000000002' AS UUID));
+a b
+00000000-0000-0000-0000-000000000002 10000000-0000-0000-0000-000000000002
+DROP PROCEDURE p1;
+CREATE FUNCTION f1(a UUID) RETURNS UUID
+BEGIN
+RETURN CONCAT('1',SUBSTRING(a,2,36));
+END;
+$$
+SELECT f1('00000000-0000-0000-0000-000000000001');
+f1('00000000-0000-0000-0000-000000000001')
+10000000-0000-0000-0000-000000000001
+SELECT f1(CAST('00000000-0000-0000-0000-000000000002' AS UUID));
+f1(CAST('00000000-0000-0000-0000-000000000002' AS UUID))
+10000000-0000-0000-0000-000000000002
+DROP FUNCTION f1;
+#
+# Anchored data types in SP variables
+#
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE va TYPE OF t1.a;
+SELECT MAX(a) INTO va FROM t1;
+SELECT va;
+END;
+$$
+CALL p1;
+va
+00000000-0000-0000-0000-000000000001
+DROP PROCEDURE p1;
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID, b UUID);
+INSERT INTO t1 VALUES
+(
+'00000000-0000-0000-0000-00000000000a',
+'00000000-0000-0000-0000-00000000000b'
+);
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE va ROW TYPE OF t1;
+SELECT MAX(a), MAX(b) INTO va FROM t1;
+SELECT va.a, va.b;
+END;
+$$
+CALL p1;
+va.a va.b
+00000000-0000-0000-0000-00000000000a 00000000-0000-0000-0000-00000000000b
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# Optimizer: make_const_item_for_comparison
+#
+CREATE TABLE t1 (id INT, a UUID);
+INSERT INTO t1 VALUES
+(1,'00000000-0000-0000-0000-000000000001'),
+(2,'00000000-0000-0000-0000-000000000002');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=COALESCE(CAST('00000000-0000-0000-0000-000000000001' AS UUID)) AND id>0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = UUID'00000000-0000-0000-0000-000000000001' and `test`.`t1`.`id` > 0
+DROP TABLE t1;
+#
+# Optimizer: equal field propagation
+#
+CREATE TABLE t1 (id INT, a UUID);
+INSERT INTO t1 VALUES
+(1,'00000000-0000-0000-0000-000000000001'),
+(2,'00000000-0000-0000-0000-000000000002');
+EXPLAIN EXTENDED SELECT * FROM t1
+WHERE a=COALESCE(CAST('00000000-0000-0000-0000-000000000001' AS UUID))
+AND LENGTH(CONCAT(a,RAND()))>1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = UUID'00000000-0000-0000-0000-000000000001' and octet_length(concat(UUID'00000000-0000-0000-0000-000000000001',rand())) > 1
+EXPLAIN EXTENDED SELECT * FROM t1
+WHERE a=COALESCE(CAST('00000000-0000-0000-0000-000000000001' AS UUID))
+AND LENGTH(a)>1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = UUID'00000000-0000-0000-0000-000000000001'
+DROP TABLE t1;
+#
+# Optimizer: equal expression propagation
+#
+CREATE TABLE t1 (id INT, a UUID);
+INSERT INTO t1 VALUES
+(1,'00000000-0000-0000-0000-000000000001'),
+(2,'00000000-0000-0000-0000-000000000002');
+EXPLAIN EXTENDED SELECT * FROM t1
+WHERE COALESCE(a)='00000000-0000-0000-0000-000000000001' AND COALESCE(a)=CONCAT(a);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(`test`.`t1`.`a`) = '00000000-0000-0000-0000-000000000001' and concat(`test`.`t1`.`a`) = '00000000-0000-0000-0000-000000000001'
+DROP TABLE t1;
+#
+# Subquery materialization
+#
+CREATE TABLE t1 (a UUID, b VARCHAR(36), KEY (a), KEY(b)) ;
+INSERT INTO t1 VALUES
+(
+'00000000-0000-0000-0000-00000000000a',
+'00000000-0000-0000-0000-00000000000a'
+),
+(
+'00000000-0000-0000-0000-00000000000a',
+'00000000-0000-0000-0000-00000000000b'
+);
+SET @@optimizer_switch='semijoin=off,materialization=on,in_to_exists=off,subquery_cache=off';
+EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS a_inner FROM t1 GROUP BY a_inner);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
+2 MATERIALIZED t1 index NULL a 17 NULL 2 Using index
+EXPLAIN SELECT * FROM t1 WHERE b IN (SELECT a AS a_inner FROM t1 GROUP BY a_inner);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t1 index_subquery a a 17 func 2 Using index; Using where
+SET @@optimizer_switch=DEFAULT;
+DROP TABLE t1;
+#
+# ALTER from UUID to UUID
+#
+CREATE TABLE t1 (a UUID, b INT);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001', 1);
+ALTER TABLE t1 MODIFY b DECIMAL(10,2);
+SELECT * FROM t1;
+a b
+00000000-0000-0000-0000-000000000001 1.00
+DROP TABLE t1;
+#
+# ALTER to character string data types
+#
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT CAST(a AS CHAR(36)) FROM t1;
+CAST(a AS CHAR(36))
+00000000-0000-0000-0000-000000000001
+ALTER TABLE t1 MODIFY a CHAR(39);
+SELECT * FROM t1;
+a
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a VARCHAR(36);
+SELECT * FROM t1;
+a
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a TINYTEXT;
+SELECT * FROM t1;
+a
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a TEXT;
+SELECT * FROM t1;
+a
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a MEDIUMTEXT;
+SELECT * FROM t1;
+a
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a LONGTEXT;
+SELECT * FROM t1;
+a
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+#
+# ALTER from character string data types
+#
+CREATE OR REPLACE TABLE t1 (a CHAR(64));
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT CAST(a AS UUID) FROM t1;
+CAST(a AS UUID)
+00000000-0000-0000-0000-000000000001
+ALTER TABLE t1 MODIFY a UUID;
+SELECT * FROM t1;
+a
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+CREATE OR REPLACE TABLE t1 (a VARCHAR(64));
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT CAST(a AS UUID) FROM t1;
+CAST(a AS UUID)
+00000000-0000-0000-0000-000000000001
+ALTER TABLE t1 MODIFY a UUID;
+SELECT * FROM t1;
+a
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+CREATE OR REPLACE TABLE t1 (a TINYTEXT);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT CAST(a AS UUID) FROM t1;
+CAST(a AS UUID)
+00000000-0000-0000-0000-000000000001
+ALTER TABLE t1 MODIFY a UUID;
+SELECT * FROM t1;
+a
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+CREATE OR REPLACE TABLE t1 (a TEXT);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT CAST(a AS UUID) FROM t1;
+CAST(a AS UUID)
+00000000-0000-0000-0000-000000000001
+ALTER TABLE t1 MODIFY a UUID;
+SELECT * FROM t1;
+a
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+CREATE OR REPLACE TABLE t1 (a MEDIUMTEXT);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT CAST(a AS UUID) FROM t1;
+CAST(a AS UUID)
+00000000-0000-0000-0000-000000000001
+ALTER TABLE t1 MODIFY a UUID;
+SELECT * FROM t1;
+a
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+CREATE OR REPLACE TABLE t1 (a LONGTEXT);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT CAST(a AS UUID) FROM t1;
+CAST(a AS UUID)
+00000000-0000-0000-0000-000000000001
+ALTER TABLE t1 MODIFY a UUID;
+SELECT * FROM t1;
+a
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+#
+# ALTER to binary string data types
+#
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a BINARY(16);
+SELECT HEX(a) FROM t1;
+HEX(a)
+00000000000000000000000000000001
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a BINARY(17);
+SELECT HEX(a) FROM t1;
+HEX(a)
+0000000000000000000000000000000100
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a BINARY(15);
+ERROR 22001: Data too long for column 'a' at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a TINYBLOB;
+SELECT HEX(a) FROM t1;
+HEX(a)
+00000000000000000000000000000001
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a BLOB;
+SELECT HEX(a) FROM t1;
+HEX(a)
+00000000000000000000000000000001
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a MEDIUMBLOB;
+SELECT HEX(a) FROM t1;
+HEX(a)
+00000000000000000000000000000001
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a LONGBLOB;
+SELECT HEX(a) FROM t1;
+HEX(a)
+00000000000000000000000000000001
+DROP TABLE t1;
+#
+# ALTER from binary string data types
+#
+CREATE TABLE t1 (a BINARY(16));
+INSERT INTO t1 VALUES (X'20010DB8000000000000FF0000428329');
+ALTER TABLE t1 MODIFY a UUID;
+SELECT a FROM t1;
+a
+20010db8-0000-0000-0000-ff0000428329
+DROP TABLE t1;
+CREATE TABLE t1 (a BINARY(17));
+INSERT INTO t1 VALUES (X'20010DB8000000000000FF000042832900');
+ALTER TABLE t1 MODIFY a UUID;
+ERROR 22007: Incorrect uuid value: ' \x01\x0D\xB8\x00\x00\x00\x00\x00\x00\xFF\x00\x00B\x83)\x00' for column `test`.`t1`.`a` at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a BINARY(15));
+INSERT INTO t1 VALUES (X'20010DB8000000000000FF00004283');
+ALTER TABLE t1 MODIFY a UUID;
+ERROR 22007: Incorrect uuid value: ' \x01\x0D\xB8\x00\x00\x00\x00\x00\x00\xFF\x00\x00B\x83' for column `test`.`t1`.`a` at row 1
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYBLOB);
+INSERT INTO t1 VALUES (X'20010DB8000000000000FF0000428329');
+ALTER TABLE t1 MODIFY a UUID;
+SELECT a FROM t1;
+a
+20010db8-0000-0000-0000-ff0000428329
+DROP TABLE t1;
+CREATE TABLE t1 (a BLOB);
+INSERT INTO t1 VALUES (X'20010DB8000000000000FF0000428329');
+ALTER TABLE t1 MODIFY a UUID;
+SELECT a FROM t1;
+a
+20010db8-0000-0000-0000-ff0000428329
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMBLOB);
+INSERT INTO t1 VALUES (X'20010DB8000000000000FF0000428329');
+ALTER TABLE t1 MODIFY a UUID;
+SELECT a FROM t1;
+a
+20010db8-0000-0000-0000-ff0000428329
+DROP TABLE t1;
+CREATE TABLE t1 (a BLOB);
+INSERT INTO t1 VALUES (X'20010DB8000000000000FF0000428329');
+ALTER TABLE t1 MODIFY a UUID;
+SELECT a FROM t1;
+a
+20010db8-0000-0000-0000-ff0000428329
+DROP TABLE t1;
+#
+# SET from UUID to UUID
+#
+CREATE TABLE t1 (a UUID, b UUID);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+b
+ffffffff-ffff-ffff-ffff-ffffffffffff
+DROP TABLE t1;
+#
+# SET from UUID to numeric
+#
+CREATE TABLE t1 (a UUID, b INT);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+ERROR 22007: Incorrect integer value: 'ffffffff-ffff-ffff-ffff-ffffffffffff' for column `test`.`t1`.`b` at row 1
+SELECT b FROM t1;
+b
+NULL
+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 22007: Incorrect double value: 'ffffffff-ffff-ffff-ffff-ffffffffffff' for column `test`.`t1`.`b` at row 1
+SELECT b FROM t1;
+b
+NULL
+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 22007: Incorrect decimal value: 'ffffffff-ffff-ffff-ffff-ffffffffffff' for column `test`.`t1`.`b` at row 1
+SELECT b FROM t1;
+b
+NULL
+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 22007: Incorrect integer value: 'ffffffff-ffff-ffff-ffff-ffffffffffff' for column `test`.`t1`.`b` at row 1
+SELECT b FROM t1;
+b
+NULL
+DROP TABLE t1;
+#
+# SET from numeric to UUID
+#
+CREATE TABLE t1 (a INT, b UUID);
+INSERT INTO t1 VALUES (1, NULL);
+UPDATE t1 SET b=a;
+ERROR 22007: Incorrect uuid value: '1' for column `test`.`t1`.`b` at row 1
+SELECT b FROM t1;
+b
+NULL
+DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE, b UUID);
+INSERT INTO t1 VALUES (1, NULL);
+UPDATE t1 SET b=a;
+ERROR 22007: Incorrect uuid value: '1' for column `test`.`t1`.`b` at row 1
+SELECT b FROM t1;
+b
+NULL
+DROP TABLE t1;
+CREATE TABLE t1 (a DECIMAL(32,0), b UUID);
+INSERT INTO t1 VALUES (1, NULL);
+UPDATE t1 SET b=a;
+ERROR 22007: Incorrect uuid value: '1' for column `test`.`t1`.`b` at row 1
+SELECT b FROM t1;
+b
+NULL
+DROP TABLE t1;
+CREATE TABLE t1 (a YEAR, b UUID);
+INSERT INTO t1 VALUES (1, NULL);
+UPDATE t1 SET b=a;
+ERROR 22007: Incorrect uuid value: '2001' for column `test`.`t1`.`b` at row 1
+SELECT b FROM t1;
+b
+NULL
+DROP TABLE t1;
+#
+# SET from UUID to temporal
+#
+CREATE TABLE t1 (a UUID, b TIME);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+ERROR 22007: Incorrect time value: 'ffffffff-ffff-ffff-ffff-ffffffffffff' for column `test`.`t1`.`b` at row 1
+SELECT b FROM t1;
+b
+NULL
+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 22007: Incorrect date value: 'ffffffff-ffff-ffff-ffff-ffffffffffff' for column `test`.`t1`.`b` at row 1
+SELECT b FROM t1;
+b
+NULL
+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 22007: Incorrect datetime value: 'ffffffff-ffff-ffff-ffff-ffffffffffff' for column `test`.`t1`.`b` at row 1
+SELECT b FROM t1;
+b
+NULL
+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 22007: Incorrect datetime value: 'ffffffff-ffff-ffff-ffff-ffffffffffff' for column `test`.`t1`.`b` at row 1
+SELECT b FROM t1;
+b
+NULL
+DROP TABLE t1;
+#
+# SET from temporal to UUID
+#
+CREATE TABLE t1 (a TIME, b UUID);
+INSERT INTO t1 VALUES ('00:00:00', NULL);
+UPDATE t1 SET b=a;
+ERROR 22007: Incorrect uuid value: '00:00:00' for column `test`.`t1`.`b` at row 1
+SELECT b FROM t1;
+b
+NULL
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE, b UUID);
+INSERT INTO t1 VALUES ('2001-01:01', NULL);
+UPDATE t1 SET b=a;
+ERROR 22007: Incorrect uuid value: '2001-01-01' for column `test`.`t1`.`b` at row 1
+SELECT b FROM t1;
+b
+NULL
+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 22007: Incorrect uuid value: '2001-01-01 10:20:30' for column `test`.`t1`.`b` at row 1
+SELECT b FROM t1;
+b
+NULL
+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 22007: Incorrect uuid value: '2001-01-01 10:20:30' for column `test`.`t1`.`b` at row 1
+SELECT b FROM t1;
+b
+NULL
+DROP TABLE t1;
+#
+# SET from UUID to character string
+#
+CREATE TABLE t1 (a UUID, b CHAR(39));
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+b
+ffffffff-ffff-ffff-ffff-ffffffffffff
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID, b VARCHAR(39));
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+b
+ffffffff-ffff-ffff-ffff-ffffffffffff
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID, b TEXT);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+b
+ffffffff-ffff-ffff-ffff-ffffffffffff
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID, b ENUM('ffffffff-ffff-ffff-ffff-ffffffffffff'));
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+b
+ffffffff-ffff-ffff-ffff-ffffffffffff
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID, b SET('ffffffff-ffff-ffff-ffff-ffffffffffff'));
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+b
+ffffffff-ffff-ffff-ffff-ffffffffffff
+DROP TABLE t1;
+#
+# SET from character string to UUID
+#
+CREATE TABLE t1 (a CHAR(36), b UUID);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+b
+ffffffff-ffff-ffff-ffff-ffffffffffff
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(36), b UUID);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+b
+ffffffff-ffff-ffff-ffff-ffffffffffff
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT, b UUID);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+b
+ffffffff-ffff-ffff-ffff-ffffffffffff
+DROP TABLE t1;
+CREATE TABLE t1 (a ENUM('ffffffff-ffff-ffff-ffff-ffffffffffff'), b UUID);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+b
+ffffffff-ffff-ffff-ffff-ffffffffffff
+DROP TABLE t1;
+CREATE TABLE t1 (a SET('ffffffff-ffff-ffff-ffff-ffffffffffff'), b UUID);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+b
+ffffffff-ffff-ffff-ffff-ffffffffffff
+DROP TABLE t1;
+#
+# SET from UUID to binary
+#
+CREATE TABLE t1 (a UUID, b BINARY(16));
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT HEX(b) FROM t1;
+HEX(b)
+FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID, b VARBINARY(39));
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT HEX(b) FROM t1;
+HEX(b)
+FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID, b BLOB);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT HEX(b) FROM t1;
+HEX(b)
+FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+DROP TABLE t1;
+#
+# SET from binary to UUID
+#
+CREATE TABLE t1 (a BINARY(16), b UUID);
+INSERT INTO t1 VALUES (CONCAT(0xFFFF,REPEAT(0x0000,6),0xFFFF), NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+b
+ffff0000-0000-0000-0000-00000000ffff
+DROP TABLE t1;
+CREATE TABLE t1 (a VARBINARY(16), b UUID);
+INSERT INTO t1 VALUES (CONCAT(0xFFFF,REPEAT(0x0000,6),0xFFFF), NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+b
+ffff0000-0000-0000-0000-00000000ffff
+DROP TABLE t1;
+CREATE TABLE t1 (a BLOB, b UUID);
+INSERT INTO t1 VALUES (CONCAT(0xFFFF,REPEAT(0x0000,6),0xFFFF), NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+b
+ffff0000-0000-0000-0000-00000000ffff
+DROP TABLE t1;
+#
+# Limit clause parameter
+# TODO: this should fail.
+# The test for a valid data type should be moved
+# from parse time to fix_fields() time, and performed
+# for both Item_splocal and Item_param.
+#
+EXECUTE IMMEDIATE 'SELECT 1 FROM DUAL LIMIT ?' USING CAST('00000000-0000-0000-0000-000000000000' AS UUID);
+1
+#
+# ALTER from UUID to CHAR
+#
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT CAST(a AS CHAR(36)) FROM t1;
+CAST(a AS CHAR(36))
+00000000-0000-0000-0000-000000000001
+ALTER TABLE t1 MODIFY a CHAR(36);
+SELECT * FROM t1;
+a
+00000000-0000-0000-0000-000000000001
+DROP TABLE t1;
+#
+# ALTER from UUID to BINARY(16)
+#
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a BINARY(16);
+SELECT HEX(a) FROM t1;
+HEX(a)
+00000000000000000000000000000001
+DROP TABLE t1;
+#
+# CAST(uuid AS BINARY)
+#
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT HEX(CAST(a AS BINARY)) FROM t1;
+HEX(CAST(a AS BINARY))
+00000000000000000000000000000001
+SELECT HEX(CAST(a AS BINARY(16))) FROM t1;
+HEX(CAST(a AS BINARY(16)))
+00000000000000000000000000000001
+DROP TABLE t1;
+#
+# CAST from UUID to FLOAT
+#
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000000');
+SELECT CAST(a AS FLOAT) FROM t1;
+ERROR HY000: Illegal parameter data type uuid for operation 'float_typecast'
+DROP TABLE t1;
+#
+# CAST(UUID AS BINARY) - metadata
+#
+CREATE TABLE t1 (a UUID);
+SELECT
+CAST(a AS BINARY(0)),
+CAST(a AS BINARY(1)),
+CAST(a AS BINARY(16)),
+CAST(a AS BINARY(255)),
+CAST(a AS BINARY(256)),
+CAST(a AS BINARY(512)),
+CAST(a AS BINARY(513)),
+CAST(a AS BINARY(65532)),
+CAST(a AS BINARY(65533)),
+CAST(a AS BINARY(65534)),
+CAST(a AS BINARY(65535)),
+CAST(a AS BINARY(65536)),
+CAST(a AS BINARY(16777215)),
+CAST(a AS BINARY(16777216))
+FROM t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def CAST(a AS BINARY(0)) 254 0 0 Y 128 0 63
+def CAST(a AS BINARY(1)) 254 1 0 Y 128 0 63
+def CAST(a AS BINARY(16)) 254 16 0 Y 128 0 63
+def CAST(a AS BINARY(255)) 254 255 0 Y 128 0 63
+def CAST(a AS BINARY(256)) 253 256 0 Y 128 0 63
+def CAST(a AS BINARY(512)) 253 512 0 Y 128 0 63
+def CAST(a AS BINARY(513)) 253 513 0 Y 128 0 63
+def CAST(a AS BINARY(65532)) 253 65532 0 Y 128 0 63
+def CAST(a AS BINARY(65533)) 252 65533 0 Y 128 0 63
+def CAST(a AS BINARY(65534)) 252 65534 0 Y 128 0 63
+def CAST(a AS BINARY(65535)) 252 65535 0 Y 128 0 63
+def CAST(a AS BINARY(65536)) 250 65536 0 Y 128 0 63
+def CAST(a AS BINARY(16777215)) 250 16777215 0 Y 128 0 63
+def CAST(a AS BINARY(16777216)) 251 16777216 0 Y 128 0 63
+CAST(a AS BINARY(0)) CAST(a AS BINARY(1)) CAST(a AS BINARY(16)) CAST(a AS BINARY(255)) CAST(a AS BINARY(256)) CAST(a AS BINARY(512)) CAST(a AS BINARY(513)) CAST(a AS BINARY(65532)) CAST(a AS BINARY(65533)) CAST(a AS BINARY(65534)) CAST(a AS BINARY(65535)) CAST(a AS BINARY(65536)) CAST(a AS BINARY(16777215)) CAST(a AS BINARY(16777216))
+DROP TABLE t1;
+#
+# MIN(uuid) with GROUP BY
+#
+CREATE TABLE t1 (id INT, a UUID) ENGINE=MyISAM;
+INSERT INTO t1 VALUES
+(1, '00000000-0000-0000-0000-000000000fff'),
+(1, '00000000-0000-0000-0000-000000008888');
+SELECT MIN(a), MAX(a) FROM t1 GROUP BY id;
+MIN(a) MAX(a)
+00000000-0000-0000-0000-000000000fff 00000000-0000-0000-0000-000000008888
+DROP TABLE t1;
+#
+# MDEV-26785 Hyphens inside the value of uuid datatype
+#
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('0000000000000000000000000000000'/*31 digits*/);
+ERROR 22007: Incorrect uuid value: '0000000000000000000000000000000' for column `test`.`t1`.`a` at row 1
+INSERT INTO t1 VALUES ('000000000000000000000000000000000'/*33 digits*/);
+ERROR 22007: Incorrect uuid value: '000000000000000000000000000000000' for column `test`.`t1`.`a` at row 1
+INSERT INTO t1 VALUES ('-00000000000000000000000000000000'/*leading hyphen*/);
+ERROR 22007: Incorrect uuid value: '-00000000000000000000000000000000' for column `test`.`t1`.`a` at row 1
+INSERT INTO t1 VALUES ('-00000000000000000000000000000000-'/*trailing hyphen*/);
+ERROR 22007: Incorrect uuid value: '-00000000000000000000000000000000-' for column `test`.`t1`.`a` at row 1
+INSERT INTO t1 VALUES ('00000000000000000000000000000000');
+INSERT INTO t1 VALUES ('0-0000000000000000000000000000011');
+INSERT INTO t1 VALUES ('0--0000000000000000000000000000012');
+INSERT INTO t1 VALUES ('0---0000000000000000000000000000013');
+INSERT INTO t1 VALUES ('0----0000000000000000000000000000014');
+INSERT INTO t1 VALUES ('00-000000000000000000000000000021');
+INSERT INTO t1 VALUES ('00--000000000000000000000000000022');
+INSERT INTO t1 VALUES ('00---000000000000000000000000000023');
+INSERT INTO t1 VALUES ('00----000000000000000000000000000024');
+INSERT INTO t1 VALUES ('5796dac11a1c11--------------ecab4ef859-713e4be4');
+INSERT INTO t1 VALUES ('5796dac11a1c11---------------ecab4ef859-713e4be4');
+DROP TABLE t1;
+#
+# MDEV-26732 Assertion `0' failed in Item::val_native
+#
+SELECT uuid() AS f, var_pop('x') FROM dual HAVING f > '';
+f var_pop('x')
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'x'
+Warning 1292 Incorrect uuid value: ''
+#
+# MDEV-28491 Uuid. "UPDATE/DELETE" not working "WHERE id IN (SELECT id FROM ..)"
+#
+CREATE TABLE companies (id uuid, name varchar(10));
+INSERT INTO companies (id) values ('7bc95b06-cc6c-11ec-96c5-0242ac130002');
+CREATE TABLE divisions (company_id uuid);
+INSERT INTO divisions (company_id) values ('7bc95b06-cc6c-11ec-96c5-0242ac130002');
+SELECT * FROM companies WHERE id IN (SELECT company_id FROM divisions);
+id name
+7bc95b06-cc6c-11ec-96c5-0242ac130002 NULL
+UPDATE companies SET name = 'value' WHERE id IN (SELECT company_id FROM divisions);
+SELECT * FROM companies;
+id name
+7bc95b06-cc6c-11ec-96c5-0242ac130002 value
+DELETE FROM companies WHERE id IN (SELECT company_id FROM divisions);
+SELECT * FROM companies;
+id name
+DROP TABLE divisions;
+DROP TABLE companies;
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid.test b/plugin/type_uuid/mysql-test/type_uuid/type_uuid.test
new file mode 100644
index 00000000000..4a3525a783c
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid.test
@@ -0,0 +1,1672 @@
+--echo #
+--echo # MDEV-4958 Adding datatype UUID
+--echo #
+
+--echo #
+--echo # Basic CREATE functionality, defaults, metadata
+--echo #
+
+--error ER_WRONG_FIELD_SPEC
+CREATE TABLE t1 (a UUID AUTO_INCREMENT);
+
+CREATE TABLE t1 (a UUID);
+SHOW CREATE TABLE t1;
+DESCRIBE t1;
+--vertical_results
+--replace_column 19 #
+SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='test' AND table_name='t1';
+--horizontal_results
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+--enable_metadata
+SELECT * FROM t1;
+SELECT CAST('00000000-0000-0000-0000-000000000001' AS UUID) AS a;
+--disable_metadata
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (
+ c1 UUID DEFAULT 0x00000000000000000000000000000000,
+ c2 UUID DEFAULT 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,
+ c3 UUID DEFAULT '00000000-0000-0000-0000-000000000000',
+ c4 UUID DEFAULT 'ffffffff-ffff-ffff-ffff-ffffffffffff',
+ c5 UUID DEFAULT CAST(X'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF' AS UUID)
+);
+SHOW CREATE TABLE t1;
+DESCRIBE t1;
+--vertical_results
+--replace_column 19 #
+SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='test' AND table_name='t1';
+--horizontal_results
+DROP TABLE t1;
+
+--error ER_INVALID_DEFAULT
+CREATE TABLE t1 (c1 UUID DEFAULT 0x00);
+--error ER_INVALID_DEFAULT
+CREATE TABLE t1 (c1 UUID DEFAULT '');
+
+
+CREATE TABLE t1 (a UUID);
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO t1 VALUES ('x');
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO t1 VALUES (1);
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO t1 VALUES (TIME'10:20:30');
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO t1 VALUES (0x00);
+DROP TABLE t1;
+
+--echo #
+--echo # CAST
+--echo #
+
+SELECT CAST('garbage' AS UUID);
+SELECT CAST(0x01 AS UUID);
+SELECT CAST(REPEAT(0x00,16) AS UUID);
+SELECT CAST(REPEAT(0x11,16) AS UUID);
+
+CREATE TABLE t1 AS SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Text and binary formats, comparison operators
+--echo #
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES (0x00000000000000000000000000000000);
+INSERT INTO t1 VALUES (0x00000000000000000000000000000001);
+INSERT INTO t1 VALUES (0xFFFF0000000000000000000000000001);
+INSERT INTO t1 VALUES (0xFFFF0000000000000000000000000002);
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t1 ORDER BY a DESC;
+SELECT HEX(a),a FROM t1 ORDER BY a;
+SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-000000000000';
+SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-000000000001';
+SELECT * FROM t1 WHERE a='ffff0000-0000-0000-0000-000000000001';
+SELECT * FROM t1 WHERE a='ffff0000-0000-0000-0000-000000000002';
+SELECT * FROM t1 WHERE a=0x00000000000000000000000000000000;
+SELECT * FROM t1 WHERE a=0x00000000000000000000000000000001;
+SELECT * FROM t1 WHERE a=0xffff0000000000000000000000000001;
+SELECT * FROM t1 WHERE a=0xffff0000000000000000000000000002;
+SELECT * FROM t1 WHERE a< '00000000-0000-0000-0000-000000000000';
+SELECT * FROM t1 WHERE a<='00000000-0000-0000-0000-000000000000';
+SELECT * FROM t1 WHERE a>='ffff0000-0000-0000-0000-000000000002';
+SELECT * FROM t1 WHERE a> 'ffff0000-0000-0000-0000-000000000002';
+SELECT * FROM t1 WHERE a IN
+(
+ '00000000-0000-0000-0000-000000000000',
+ 'ffff0000-0000-0000-0000-000000000001'
+) ORDER BY a;
+SELECT * FROM t1 WHERE a IN
+(
+ '00000000-0000-0000-0000-000000000000',
+ 0xffff0000000000000000000000000002
+) ORDER BY a;
+
+SELECT * FROM t1 WHERE a<'garbage';
+SELECT * FROM t1 WHERE a<='garbage';
+SELECT * FROM t1 WHERE a='garbage';
+SELECT * FROM t1 WHERE a>='garbage';
+SELECT * FROM t1 WHERE a>'garbage';
+
+SELECT * FROM t1 WHERE a<0x01;
+SELECT * FROM t1 WHERE a<=0x01;
+SELECT * FROM t1 WHERE a=0x01;
+SELECT * FROM t1 WHERE a>=0x01;
+SELECT * FROM t1 WHERE a>0x01;
+
+SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-000000000000';
+SELECT * FROM t1 WHERE a='00-000000-0000-0000-0000-000000000000';
+SELECT * FROM t1 WHERE a='00-00-0000-0000-0000-0000-000000000000';
+SELECT * FROM t1 WHERE a='00-00-00-00-0000-0000-0000-000000000000';
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT * FROM t1 WHERE a=0;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT * FROM t1 WHERE a=0.0;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT * FROM t1 WHERE a=0e0;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT * FROM t1 WHERE a=TIME'10:20:30';
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT * FROM t1 WHERE a IN ('::', 10);
+
+DROP TABLE t1;
+
+--echo #
+--echo # ORDER BY
+--echo #
+
+CREATE TABLE t1 (a UUID);
+DELIMITER $$;
+FOR i IN 0..15
+DO
+ INSERT INTO t1 VALUES (REPLACE('XX000000-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00XX0000-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('0000XX00-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('000000XX-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-XX00-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-00XX-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-XX00-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-00XX-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-XX00-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-00XX-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-XX0000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-00XX00000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-0000XX000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-000000XX0000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-00000000XX00','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-0000000000XX','XX',LPAD(HEX(i),2,'0')));
+END FOR;
+$$
+DELIMITER ;$$
+
+--echo #
+--echo # Logical ORDER BY
+--echo #
+SELECT * FROM t1 ORDER BY a;
+SELECT COALESCE(NULL, a) FROM t1 ORDER BY a;
+
+--echo #
+--echo # Lexicographical ORDER BY
+--echo #
+
+SELECT * FROM t1 ORDER BY CAST(a AS BINARY(16));
+SELECT * FROM t1 ORDER BY CAST(COALESCE(NULL,a) AS BINARY(16));
+
+DROP TABLE t1;
+
+
+--echo #
+--echo # cmp_item_uuid: IN for non-constants
+--echo #
+
+CREATE TABLE t1 (a UUID, b UUID);
+INSERT INTO t1 VALUES
+(
+ '00000000-0000-0000-0000-000000000001',
+ '00000000-0000-0000-0000-000000000002'
+);
+SELECT * FROM t1 WHERE '00000000-0000-0000-0000-000000000000' IN (a, b);
+SELECT * FROM t1 WHERE '00000000-0000-0000-0000-000000000001' IN (a, b);
+SELECT * FROM t1 WHERE '00-000000-0000-0000-0000-000000000001' IN (a, b);
+SELECT * FROM t1 WHERE '00-00-0000-0000-0000-0000-000000000001' IN (a, b);
+DROP TABLE t1;
+
+
+--echo #
+--echo # cmp_item_uuid: DECODE_ORACLE
+--echo #
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+(NULL),
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-000000000002');
+SELECT a, DECODE_ORACLE(a, '00000000-0000-0000-0000-000000000002', '01') AS d FROM t1;
+SELECT
+ a,
+ DECODE_ORACLE(a, '00000000-0000-0000-0000-000000000001', '01') AS d0,
+ DECODE_ORACLE(a, NULL, '<NULL>', '00000000-0000-0000-0000-000000000001', '01') AS d1,
+ DECODE_ORACLE(a, 'garbage', '<NULL>', '00000000-0000-0000-0000-000000000001', '01') AS d2
+FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # CASE abbreviations
+--echo #
+
+CREATE TABLE t1 (
+ c UUID,
+ c_char CHAR(32),
+ c_varchar VARCHAR(32),
+ c_tinytext TINYTEXT,
+ c_text TEXT,
+ c_mediumtext TEXT,
+ c_longtext LONGTEXT
+);
+CREATE TABLE t2 AS SELECT
+ COALESCE(c, c_char),
+ COALESCE(c, c_varchar),
+ COALESCE(c, c_tinytext),
+ COALESCE(c, c_text),
+ COALESCE(c, c_mediumtext),
+ COALESCE(c, c_longtext)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT
+ LEAST(c, c_char),
+ LEAST(c, c_varchar),
+ LEAST(c, c_tinytext),
+ LEAST(c, c_text),
+ LEAST(c, c_mediumtext),
+ LEAST(c, c_longtext)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+(NULL),
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-000000000002');
+
+SELECT COALESCE(a, '00000000-0000-0000-0000-000000000000') FROM t1 ORDER BY a;
+
+SELECT
+ a,
+ LEAST(a,'00000000-0000-0000-0000-000000000000'),
+ LEAST(a,'00000000-0000-0000-0000-00000000000f')
+FROM t1 ORDER BY a;
+
+SELECT
+ a,
+ GREATEST(a,'00000000-0000-0000-0000-000000000000'),
+ GREATEST(a,'00000000-0000-0000-0000-00000000000f')
+FROM t1 ORDER BY a;
+
+CREATE TABLE t2 AS SELECT
+ COALESCE(a, '00000000-0000-0000-0000-000000000000'),
+ LEAST(a,'00000000-0000-0000-0000-000000000000'),
+ GREATEST(a,'00000000-0000-0000-0000-000000000000')
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+SELECT COALESCE(a, 0x00000000000000000000000000000000) FROM t1 ORDER BY a;
+SELECT
+ a,
+ LEAST(a, 0x00000000000000000000000000000000),
+ LEAST(a, 0x0000000000000000000000000000000f)
+FROM t1 ORDER BY a;
+
+SELECT
+ a,
+ GREATEST(a, 0x00000000000000000000000000000000),
+ GREATEST(a, 0x0000000000000000000000000000000f)
+FROM t1 ORDER BY a;
+
+CREATE TABLE t2 AS SELECT
+ COALESCE(a, 0x00000000000000000000000000000000),
+ LEAST(a,0x00000000000000000000000000000000),
+ GREATEST(a,0x00000000000000000000000000000000)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT COALESCE(a, 10) FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT LEAST(a, 10) FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT GREATEST(a, 10) FROM t1;
+
+DROP TABLE t1;
+
+SELECT COALESCE('garbage', CAST('::1' AS UUID));
+SELECT COALESCE(0x01, CAST('::1' AS UUID));
+
+
+--echo #
+--echo # Uniqueness
+--echo #
+
+CREATE TABLE t1 (a UUID NOT NULL PRIMARY KEY);
+INSERT INTO t1 VALUES
+('41000000-0000-0000-0000-000000000001'),
+('61000000-0000-0000-0000-000000000001');
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES ('41000000-0000-0000-0000-000000000001');
+SELECT * FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Indexes
+--echo #
+
+--error ER_WRONG_SUB_KEY
+CREATE TABLE t1 (a UUID, KEY(a(1)));
+
+
+--echo #
+--echo # Explicit CAST on INSERT
+--echo #
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES (CAST('10000000-0000-0000-0000-000000000001' AS UUID));
+INSERT INTO t1 VALUES (CAST('10000000-0000-0000-0000-000000000002' AS UUID));
+INSERT INTO t1 VALUES (CAST('10000000-0000-0000-0000-000000000003' AS UUID));
+INSERT INTO t1 VALUES (CAST(CONCAT('2','0000000-0000-0000-0000-000000000001') AS UUID));
+INSERT INTO t1 VALUES (CAST(CONCAT('2','0000000-0000-0000-0000-000000000002') AS UUID));
+INSERT INTO t1 VALUES (CAST(CONCAT('2','0000000-0000-0000-0000-000000000003') AS UUID));
+SELECT * FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Explicit CAST and implicit CAST on ALTER
+--echo #
+
+CREATE TABLE t1 (a VARCHAR(64));
+INSERT INTO t1 VALUES
+('garbage'),
+('00000000-0000-0000-0000-000000000000'),
+('00000000-0000-0000-0000-000000000001'),
+('ffff0000-0000-0000-0000-000000000001'),
+('ffff0000-0000-0000-0000-000000000002');
+SELECT a, CAST(a AS UUID) FROM t1 ORDER BY a;
+SELECT a, CAST(a AS UUID) FROM t1 ORDER BY CAST(a AS UUID);
+--error ER_TRUNCATED_WRONG_VALUE
+ALTER TABLE t1 MODIFY a UUID;
+SET sql_mode='';
+ALTER TABLE t1 MODIFY a UUID;
+SET sql_mode=DEFAULT;
+SELECT * FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a BINARY(16));
+INSERT INTO t1 VALUES (0x00000000000000000000000000000000);
+INSERT INTO t1 VALUES (0x00000000000000000000000000000001);
+INSERT INTO t1 VALUES (0xffff0000000000000000000000000001);
+INSERT INTO t1 VALUES (0xffff0000000000000000000000000002);
+SELECT HEX(a), CAST(a AS UUID) FROM t1 ORDER BY a;
+ALTER TABLE t1 MODIFY a UUID;
+SELECT * FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+
+--echo #
+--echo # INSERT..SELECT, same data types
+--echo #
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000000'),
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-000000000002');
+CREATE TABLE t2 (a UUID);
+INSERT INTO t2 SELECT a FROM t1;
+SELECT * FROM t2;
+DROP TABLE t1,t2;
+
+
+--echo #
+--echo # Implicit CAST on INSERT..SELECT, text format
+--echo #
+
+CREATE TABLE t1 (a VARCHAR(64));
+INSERT INTO t1 VALUES
+('garbage'),
+('00000000-0000-0000-0000-000000000000'),
+('00000000-0000-0000-0000-000000000001'),
+('ffff0000-0000-0000-0000-000000000001'),
+('ffff0000-0000-0000-0000-000000000002');
+
+CREATE TABLE t2 (a UUID);
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO t2 SELECT a FROM t1;
+SET sql_mode='';
+INSERT INTO t2 SELECT a FROM t1;
+SELECT * FROM t2 ORDER BY a;
+SET sql_mode=DEFAULT;
+DROP TABLE t2;
+
+CREATE TABLE t2 (a UUID NOT NULL);
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO t2 SELECT a FROM t1;
+SET sql_mode='';
+INSERT INTO t2 SELECT a FROM t1;
+SELECT * FROM t2 ORDER BY a;
+SET sql_mode=DEFAULT;
+DROP TABLE t2;
+
+DROP TABLE t1;
+
+
+--echo #
+--echo # Implicit CAST on INSERT..SELECT, binary format
+--echo #
+
+CREATE TABLE t1 (a BINARY(16));
+INSERT INTO t1 VALUES (0x00000000000000000000000000000000);
+INSERT INTO t1 VALUES (0x00000000000000000000000000000001);
+INSERT INTO t1 VALUES (0xffff0000000000000000000000000001);
+INSERT INTO t1 VALUES (0xffff0000000000000000000000000002);
+CREATE TABLE t2 (a UUID);
+INSERT INTO t2 SELECT a FROM t1;
+SELECT a FROM t2 ORDER BY a;
+DROP TABLE t1,t2;
+
+
+--echo #
+--echo # CAST to other data types
+--echo #
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS DOUBLE);
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS FLOAT);
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS DECIMAL);
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS SIGNED);
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS UNSIGNED);
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS TIME);
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS DATE);
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS DATETIME);
+
+SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS CHAR);
+CREATE TABLE t1 AS SELECT CAST(CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS CHAR) AS a;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff');
+CREATE TABLE t2 AS SELECT
+ CAST(a AS CHAR),
+ CAST(a AS CHAR(36)),
+ CAST(a AS CHAR(530)),
+ CAST(a AS CHAR(65535)),
+ CAST(a AS CHAR(66000)),
+ CAST(a AS CHAR(16777215)),
+ CAST(a AS CHAR(16777216))
+FROM t1;
+SHOW CREATE TABLE t2;
+--vertical_results
+SELECT * FROM t2;
+--horizontal_results
+DROP TABLE t2;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff');
+CREATE TABLE t2 AS SELECT
+ CAST(a AS BINARY(4)) AS cb4,
+ CAST(a AS BINARY) AS cb,
+ CAST(a AS BINARY(16)) AS cb16,
+ CAST(a AS BINARY(32)) AS cb32,
+ CAST(a AS BINARY(530)) AS cb530,
+ CAST(a AS BINARY(65535)) AS cb65535,
+ CAST(a AS BINARY(66000)) AS cb66000,
+ CAST(a AS BINARY(16777215)) AS cb16777215,
+ CAST(a AS BINARY(16777216)) AS cb16777216
+FROM t1 LIMIT 0;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ CAST(a AS BINARY(4)) AS cb4,
+ CAST(a AS BINARY) AS cb,
+ CAST(a AS BINARY(16)) AS cb16,
+ CAST(a AS BINARY(32)) AS cb32,
+ CAST(a AS BINARY(530)) AS cb530,
+ CAST(a AS BINARY(65535)) AS cb65535
+FROM t1;
+SHOW CREATE TABLE t2;
+--vertical_results
+SELECT
+ HEX(cb4),
+ HEX(cb),
+ HEX(cb16),
+ HEX(cb32),
+ LENGTH(cb530),
+ LENGTH(cb65535)
+FROM t2;
+--horizontal_results
+DROP TABLE t2;
+DROP TABLE t1;
+
+--echo #
+--echo # Implicit conversion to other types in INSERT
+--echo #
+
+CREATE TABLE t1 (a INT);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DOUBLE);
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DECIMAL(32,0));
+--error WARN_DATA_TRUNCATED
+INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARCHAR(64));
+INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TEXT);
+INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+DROP TABLE t1;
+
+
+
+--echo #
+--echo # Boolean context
+--echo #
+
+SELECT
+ CAST('00000000-0000-0000-0000-000000000000' AS UUID) IS TRUE,
+ CAST('00000000-0000-0000-0000-000000000000' AS UUID) IS FALSE,
+ CAST('00000000-0000-0000-0000-000000000001' AS UUID) IS TRUE,
+ CAST('00000000-0000-0000-0000-000000000001' AS UUID) IS FALSE;
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000000'),
+('00000000-0000-0000-0000-000000000001');
+SELECT a, a IS TRUE, a IS FALSE FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+#
+# TODO: Error looks like a bug. This should return rows where a<>'00000000-0000-0000-0000-000000000000'.
+# The same problem is repeatable with GEOMETRY.
+#
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000000'),
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-000000000002');
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT * FROM t1 WHERE a;
+DROP TABLE t1;
+
+
+--echo #
+--echo # GROUP BY
+--echo #
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000000'),
+('00000000-0000-0000-0000-0000-00000000');
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-0000-00000001'),
+('00000000-0000-0000-0000-0000-0000-0001');
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000002'),
+('00000000-0000-0000-0000-000000000002'),
+('00000000-0000-0000-0000-0000-00000002'),
+('00000000-0000-0000-0000-0000-0000-0002');
+SELECT a, COUNT(*) FROM t1 GROUP BY a;
+DROP TABLE t1;
+
+--echo #
+--echo # Aggregate functions
+--echo #
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000000'),
+('00000000-0000-0000-0000-000000000000');
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-0000-00000001'),
+('00000000-0000-0000-0000-0000-0000-0001');
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000002'),
+('00000000-0000-0000-0000-000000000002'),
+('00000000-0000-0000-0000-000000000002'),
+('00000000-0000-0000-0000-000000000002');
+SELECT MIN(a),MAX(a) FROM t1;
+
+CREATE TABLE t2 AS SELECT MIN(a), MAX(a) FROM t1;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t2;
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT AVG(a) FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT AVG(DISTINCT a) FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT SUM(a) FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT SUM(DISTINCT a) FROM t1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT STDDEV(a) FROM t1;
+SELECT GROUP_CONCAT(a ORDER BY a) FROM t1;
+SELECT a, GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a;
+DROP TABLE t1;
+
+--echo #
+--echo # Window functions
+--echo #
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-000000000002'),
+('00000000-0000-0000-0000-000000000003'),
+('00000000-0000-0000-0000-000000000004');
+SELECT
+ a,
+ LAG(a) OVER (ORDER BY a),
+ LEAD(a) OVER (ORDER BY a)
+FROM t1 ORDER BY a;
+
+SELECT
+ a,
+ FIRST_VALUE(a) OVER (ORDER BY a ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING),
+ LAST_VALUE(a) OVER (ORDER BY a ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING)
+FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Prepared statements
+--echo #
+
+EXECUTE IMMEDIATE 'CREATE TABLE t1 AS SELECT ? AS a'
+ USING CAST('00000000-0000-0000-0000-000000000000' AS UUID);
+SHOW CREATE TABLE t1;
+
+EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES (?)'
+ USING '00000000-0000-0000-0000-000000000001';
+
+EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES (?)'
+ USING CAST('00000000-0000-0000-0000-000000000002' AS UUID);
+
+EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES (?)'
+ USING 0x00000000000000000000000000000003;
+
+SELECT a FROM t1 ORDER BY a;
+EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE a=?'
+ USING '00000000-0000-0000-0000-000000000001';
+
+EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE a=?'
+ USING CAST('00000000-0000-0000-0000-000000000002' AS UUID);
+
+EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE a=?'
+ USING 0x00000000000000000000000000000003;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Character set and collation aggregation
+--echo #
+
+CREATE TABLE t1 (a UUID);
+
+CREATE TABLE t2 AS SELECT
+ CONCAT(a) AS c1,
+ CONCAT(CAST('00000000-0000-0000-0000-000000000000' AS UUID)) AS c2
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ CONCAT(_utf8'1', LEFT(a,35)) AS c1,
+ CONCAT(_utf8'1', LEFT(CAST('00000000-0000-0000-0000-000000000000' AS UUID),35)) AS c2,
+ CONCAT(_utf8'1', LEFT(COALESCE(a),35)) AS c3
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE TABLE t2 AS SELECT
+ CONCAT(_latin1'1', LEFT(a,35)) AS c1,
+ CONCAT(_latin1'1', LEFT(CAST('00000000-0000-0000-0000-000000000000' AS UUID),35)) AS c2,
+ CONCAT(_latin1'1', LEFT(COALESCE(a),35)) AS c3
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+DROP TABLE t1;
+
+
+--echo #
+--echo # UNION
+--echo #
+
+CREATE TABLE t1 AS
+ SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS c
+ UNION
+ SELECT CAST('00000000-0000-0000-0000-000000000001' AS UUID);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1 ORDER BY c;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS
+ SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS c
+ UNION
+ SELECT '00000000-0000-0000-0000-000000000001';
+SHOW CREATE TABLE t1;
+SELECT * FROM t1 ORDER BY c;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS
+ SELECT '00000000-0000-0000-0000-000000000000' AS c
+ UNION
+ SELECT CAST('00000000-0000-0000-0000-000000000001' AS UUID);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1 ORDER BY c;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS
+ SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS c
+ UNION
+ SELECT 0x00000000000000000000000000000001;
+SHOW CREATE TABLE t1;
+SELECT * FROM t1 ORDER BY c;
+DROP TABLE t1;
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+CREATE TABLE t1 AS
+ SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) AS c
+ UNION
+ SELECT 1;
+
+
+--echo #
+--echo # Unary operators
+--echo #
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT -CAST('00000000-0000-0000-0000-000000000000' AS UUID);
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT ABS(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT ROUND(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT CEILING(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT FLOOR(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+
+
+--echo #
+--echo # Arithmetic operators
+--echo #
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) + 1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) - 1;
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) * 1;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) / 1;
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) MOD 1;
+
+
+--echo #
+--echo # Misc
+--echo #
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT RAND(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT FROM_UNIXTIME(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT HOUR(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT YEAR(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT RELEASE_LOCK(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+
+SELECT JSON_LENGTH(CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+
+--echo #
+--echo # Virtual columns
+--echo #
+
+--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+CREATE TABLE t1 (
+ a INT,
+ b UUID GENERATED ALWAYS AS (CAST(CONCAT(RAND(),a) AS UUID)), INDEX(b)
+);
+
+CREATE TABLE t1 (
+ a INT,
+ b UUID GENERATED ALWAYS AS (CAST(CONCAT('00000000-0000-0000-0000-00000000001',HEX(a)) AS UUID)), INDEX(b)
+);
+INSERT INTO t1 (a) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # VIEW
+--echo #
+
+CREATE TABLE t1 (a INT DEFAULT 0);
+INSERT INTO t1 (a) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15);
+SELECT * FROM t1 ORDER BY a;
+CREATE VIEW v1 AS SELECT (CAST(CONCAT('00000000-0000-0000-0000-00000000001',HEX(a)) AS UUID)) AS c FROM t1;
+SELECT * FROM v1 ORDER BY c;
+DROP VIEW v1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID DEFAULT '00000000-0000-0000-0000-000000000000');
+CREATE VIEW v1 AS SELECT * FROM t1;
+SHOW CREATE VIEW v1;
+DESCRIBE v1;
+INSERT INTO v1 VALUES
+(DEFAULT),
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-000000000002');
+SELECT * FROM t1;
+DROP VIEW v1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID DEFAULT CAST('00000000-0000-0000-0000-000000000000' AS UUID));
+CREATE VIEW v1 AS SELECT * FROM t1;
+SHOW CREATE VIEW v1;
+DESCRIBE v1;
+INSERT INTO v1 VALUES
+(DEFAULT),
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-000000000002');
+SELECT * FROM t1;
+DROP VIEW v1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Subqueries
+--echo #
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('00000000-0000-0000-0000-000000000000'),
+('00000000-0000-0000-0000-000000000001'),
+('00000000-0000-0000-0000-000000000002');
+SELECT * FROM t1 WHERE a=(SELECT MIN(a) FROM t1) ORDER BY a;
+SELECT * FROM t1 WHERE a=(SELECT MAX(a) FROM t1) ORDER BY a;
+SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE a>'00000000-0000-0000-0000-000000000000') ORDER BY a;
+DROP TABLE t1;
+
+--echo #
+--echo # Stored routines
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1(a UUID)
+BEGIN
+ DECLARE b UUID DEFAULT CONCAT('1',SUBSTRING(a,2,36));
+ SELECT a, b;
+END;
+$$
+DELIMITER ;$$
+CALL p1('00000000-0000-0000-0000-000000000001');
+CALL p1(CAST('00000000-0000-0000-0000-000000000002' AS UUID));
+DROP PROCEDURE p1;
+
+DELIMITER $$;
+CREATE FUNCTION f1(a UUID) RETURNS UUID
+BEGIN
+ RETURN CONCAT('1',SUBSTRING(a,2,36));
+END;
+$$
+DELIMITER ;$$
+SELECT f1('00000000-0000-0000-0000-000000000001');
+SELECT f1(CAST('00000000-0000-0000-0000-000000000002' AS UUID));
+DROP FUNCTION f1;
+
+--echo #
+--echo # Anchored data types in SP variables
+--echo #
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+DELIMITER $$;
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE va TYPE OF t1.a;
+ SELECT MAX(a) INTO va FROM t1;
+ SELECT va;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a UUID, b UUID);
+INSERT INTO t1 VALUES
+(
+ '00000000-0000-0000-0000-00000000000a',
+ '00000000-0000-0000-0000-00000000000b'
+);
+DELIMITER $$;
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE va ROW TYPE OF t1;
+ SELECT MAX(a), MAX(b) INTO va FROM t1;
+ SELECT va.a, va.b;
+END;
+$$
+DELIMITER ;$$
+CALL p1;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Optimizer: make_const_item_for_comparison
+--echo #
+
+CREATE TABLE t1 (id INT, a UUID);
+INSERT INTO t1 VALUES
+(1,'00000000-0000-0000-0000-000000000001'),
+(2,'00000000-0000-0000-0000-000000000002');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=COALESCE(CAST('00000000-0000-0000-0000-000000000001' AS UUID)) AND id>0;
+DROP TABLE t1;
+
+--echo #
+--echo # Optimizer: equal field propagation
+--echo #
+
+CREATE TABLE t1 (id INT, a UUID);
+INSERT INTO t1 VALUES
+(1,'00000000-0000-0000-0000-000000000001'),
+(2,'00000000-0000-0000-0000-000000000002');
+EXPLAIN EXTENDED SELECT * FROM t1
+WHERE a=COALESCE(CAST('00000000-0000-0000-0000-000000000001' AS UUID))
+ AND LENGTH(CONCAT(a,RAND()))>1;
+EXPLAIN EXTENDED SELECT * FROM t1
+WHERE a=COALESCE(CAST('00000000-0000-0000-0000-000000000001' AS UUID))
+ AND LENGTH(a)>1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Optimizer: equal expression propagation
+--echo #
+
+
+CREATE TABLE t1 (id INT, a UUID);
+INSERT INTO t1 VALUES
+(1,'00000000-0000-0000-0000-000000000001'),
+(2,'00000000-0000-0000-0000-000000000002');
+EXPLAIN EXTENDED SELECT * FROM t1
+WHERE COALESCE(a)='00000000-0000-0000-0000-000000000001' AND COALESCE(a)=CONCAT(a);
+DROP TABLE t1;
+
+--echo #
+--echo # Subquery materialization
+--echo #
+
+CREATE TABLE t1 (a UUID, b VARCHAR(36), KEY (a), KEY(b)) ;
+INSERT INTO t1 VALUES
+(
+ '00000000-0000-0000-0000-00000000000a',
+ '00000000-0000-0000-0000-00000000000a'
+),
+(
+ '00000000-0000-0000-0000-00000000000a',
+ '00000000-0000-0000-0000-00000000000b'
+);
+SET @@optimizer_switch='semijoin=off,materialization=on,in_to_exists=off,subquery_cache=off';
+EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS a_inner FROM t1 GROUP BY a_inner);
+EXPLAIN SELECT * FROM t1 WHERE b IN (SELECT a AS a_inner FROM t1 GROUP BY a_inner);
+SET @@optimizer_switch=DEFAULT;
+DROP TABLE t1;
+
+
+--echo #
+--echo # ALTER from UUID to UUID
+--echo #
+
+CREATE TABLE t1 (a UUID, b INT);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001', 1);
+ALTER TABLE t1 MODIFY b DECIMAL(10,2);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # ALTER to character string data types
+--echo #
+
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT CAST(a AS CHAR(36)) FROM t1;
+ALTER TABLE t1 MODIFY a CHAR(39);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a VARCHAR(36);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a TINYTEXT;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a TEXT;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a MEDIUMTEXT;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a LONGTEXT;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # ALTER from character string data types
+--echo #
+
+CREATE OR REPLACE TABLE t1 (a CHAR(64));
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT CAST(a AS UUID) FROM t1;
+ALTER TABLE t1 MODIFY a UUID;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE OR REPLACE TABLE t1 (a VARCHAR(64));
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT CAST(a AS UUID) FROM t1;
+ALTER TABLE t1 MODIFY a UUID;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE OR REPLACE TABLE t1 (a TINYTEXT);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT CAST(a AS UUID) FROM t1;
+ALTER TABLE t1 MODIFY a UUID;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE OR REPLACE TABLE t1 (a TEXT);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT CAST(a AS UUID) FROM t1;
+ALTER TABLE t1 MODIFY a UUID;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE OR REPLACE TABLE t1 (a MEDIUMTEXT);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT CAST(a AS UUID) FROM t1;
+ALTER TABLE t1 MODIFY a UUID;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE OR REPLACE TABLE t1 (a LONGTEXT);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT CAST(a AS UUID) FROM t1;
+ALTER TABLE t1 MODIFY a UUID;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # ALTER to binary string data types
+--echo #
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a BINARY(16);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a BINARY(17);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+--error ER_DATA_TOO_LONG
+ALTER TABLE t1 MODIFY a BINARY(15);
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a TINYBLOB;
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a BLOB;
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a MEDIUMBLOB;
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a LONGBLOB;
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # ALTER from binary string data types
+--echo #
+
+CREATE TABLE t1 (a BINARY(16));
+INSERT INTO t1 VALUES (X'20010DB8000000000000FF0000428329');
+ALTER TABLE t1 MODIFY a UUID;
+SELECT a FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a BINARY(17));
+INSERT INTO t1 VALUES (X'20010DB8000000000000FF000042832900');
+--error ER_TRUNCATED_WRONG_VALUE
+ALTER TABLE t1 MODIFY a UUID;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a BINARY(15));
+INSERT INTO t1 VALUES (X'20010DB8000000000000FF00004283');
+--error ER_TRUNCATED_WRONG_VALUE
+ALTER TABLE t1 MODIFY a UUID;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TINYBLOB);
+INSERT INTO t1 VALUES (X'20010DB8000000000000FF0000428329');
+ALTER TABLE t1 MODIFY a UUID;
+SELECT a FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a BLOB);
+INSERT INTO t1 VALUES (X'20010DB8000000000000FF0000428329');
+ALTER TABLE t1 MODIFY a UUID;
+SELECT a FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a MEDIUMBLOB);
+INSERT INTO t1 VALUES (X'20010DB8000000000000FF0000428329');
+ALTER TABLE t1 MODIFY a UUID;
+SELECT a FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a BLOB);
+INSERT INTO t1 VALUES (X'20010DB8000000000000FF0000428329');
+ALTER TABLE t1 MODIFY a UUID;
+SELECT a FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # SET from UUID to UUID
+--echo #
+
+CREATE TABLE t1 (a UUID, b UUID);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # SET from UUID to numeric
+--echo #
+
+CREATE TABLE t1 (a UUID, b INT);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID, b DOUBLE);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID, b DECIMAL(32,0));
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID, b YEAR);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # SET from numeric to UUID
+--echo #
+
+CREATE TABLE t1 (a INT, b UUID);
+INSERT INTO t1 VALUES (1, NULL);
+--error ER_TRUNCATED_WRONG_VALUE
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DOUBLE, b UUID);
+INSERT INTO t1 VALUES (1, NULL);
+--error ER_TRUNCATED_WRONG_VALUE
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DECIMAL(32,0), b UUID);
+INSERT INTO t1 VALUES (1, NULL);
+--error ER_TRUNCATED_WRONG_VALUE
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a YEAR, b UUID);
+INSERT INTO t1 VALUES (1, NULL);
+--error ER_TRUNCATED_WRONG_VALUE
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # SET from UUID to temporal
+--echo #
+
+CREATE TABLE t1 (a UUID, b TIME);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+--error ER_TRUNCATED_WRONG_VALUE
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID, b DATE);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+--error ER_TRUNCATED_WRONG_VALUE
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID, b DATETIME);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+--error ER_TRUNCATED_WRONG_VALUE
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID, b TIMESTAMP NULL DEFAULT NULL);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+--error ER_TRUNCATED_WRONG_VALUE
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # SET from temporal to UUID
+--echo #
+
+CREATE TABLE t1 (a TIME, b UUID);
+INSERT INTO t1 VALUES ('00:00:00', NULL);
+--error ER_TRUNCATED_WRONG_VALUE
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DATE, b UUID);
+INSERT INTO t1 VALUES ('2001-01:01', NULL);
+--error ER_TRUNCATED_WRONG_VALUE
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a DATETIME, b UUID);
+INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
+--error ER_TRUNCATED_WRONG_VALUE
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TIMESTAMP, b UUID);
+INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
+--error ER_TRUNCATED_WRONG_VALUE
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # SET from UUID to character string
+--echo #
+
+CREATE TABLE t1 (a UUID, b CHAR(39));
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID, b VARCHAR(39));
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID, b TEXT);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID, b ENUM('ffffffff-ffff-ffff-ffff-ffffffffffff'));
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID, b SET('ffffffff-ffff-ffff-ffff-ffffffffffff'));
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # SET from character string to UUID
+--echo #
+
+CREATE TABLE t1 (a CHAR(36), b UUID);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARCHAR(36), b UUID);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TEXT, b UUID);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a ENUM('ffffffff-ffff-ffff-ffff-ffffffffffff'), b UUID);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a SET('ffffffff-ffff-ffff-ffff-ffffffffffff'), b UUID);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # SET from UUID to binary
+--echo #
+
+CREATE TABLE t1 (a UUID, b BINARY(16));
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT HEX(b) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID, b VARBINARY(39));
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT HEX(b) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID, b BLOB);
+INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
+UPDATE t1 SET b=a;
+SELECT HEX(b) FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # SET from binary to UUID
+--echo #
+
+CREATE TABLE t1 (a BINARY(16), b UUID);
+INSERT INTO t1 VALUES (CONCAT(0xFFFF,REPEAT(0x0000,6),0xFFFF), NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARBINARY(16), b UUID);
+INSERT INTO t1 VALUES (CONCAT(0xFFFF,REPEAT(0x0000,6),0xFFFF), NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a BLOB, b UUID);
+INSERT INTO t1 VALUES (CONCAT(0xFFFF,REPEAT(0x0000,6),0xFFFF), NULL);
+UPDATE t1 SET b=a;
+SELECT b FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Limit clause parameter
+--echo # TODO: this should fail.
+--echo # The test for a valid data type should be moved
+--echo # from parse time to fix_fields() time, and performed
+--echo # for both Item_splocal and Item_param.
+--echo #
+
+EXECUTE IMMEDIATE 'SELECT 1 FROM DUAL LIMIT ?' USING CAST('00000000-0000-0000-0000-000000000000' AS UUID);
+
+
+# TODO:
+# - Add hooks to run mysql_client_test with pluggable data types
+#
+# - This should fail with the "illegal data type" error:
+#SELECT CAST('00000000-0000-0000-0000-000000000000' AS UUID) DIV 1;
+#
+# - This should fail with the "illegal data type" error:
+# EXTRACT(MINUTE...)
+#
+
+
+--echo #
+--echo # ALTER from UUID to CHAR
+--echo #
+
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT CAST(a AS CHAR(36)) FROM t1;
+ALTER TABLE t1 MODIFY a CHAR(36);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # ALTER from UUID to BINARY(16)
+--echo #
+
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+ALTER TABLE t1 MODIFY a BINARY(16);
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # CAST(uuid AS BINARY)
+--echo #
+
+CREATE OR REPLACE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
+SELECT HEX(CAST(a AS BINARY)) FROM t1;
+SELECT HEX(CAST(a AS BINARY(16))) FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # CAST from UUID to FLOAT
+--echo #
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000000');
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+SELECT CAST(a AS FLOAT) FROM t1;
+DROP TABLE t1;
+
+# TODO: below does not work well
+#--echo #
+#--echo # Conversion from UUID to other types
+#--echo #
+#
+#CREATE TABLE t1 (a UUID, b INT);
+#INSERT INTO t1 (a) VALUES ('00000000-0000-0000-0000-000000000000');
+#--error WARN_DATA_TRUNCATED
+#UPDATE t1 SET b=a;
+#SELECT * FROM t1;
+#DROP TABLE t1;
+#
+#SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
+#CREATE TABLE t1 (a UUID, b TIMESTAMP);
+#INSERT INTO t1 (a) VALUES ('00000000-0000-0000-0000-000000000000');
+#--error WARN_DATA_TRUNCATED
+#UPDATE t1 SET b=a;
+#SELECT * FROM t1;
+#DROP TABLE t1;
+#SET timestamp=DEFAULT;
+#
+#CREATE OR REPLACE TABLE t1 (a UUID);
+#INSERT INTO t1 (a) VALUES ('00000000-0000-0000-0000-000000000000');
+#--error WARN_DATA_TRUNCATED
+#ALTER TABLE t1 MODIFY a DATE;
+#DROP TABLE t1;
+
+--echo #
+--echo # CAST(UUID AS BINARY) - metadata
+--echo #
+
+CREATE TABLE t1 (a UUID);
+--enable_metadata
+SELECT
+ CAST(a AS BINARY(0)),
+ CAST(a AS BINARY(1)),
+ CAST(a AS BINARY(16)),
+ CAST(a AS BINARY(255)),
+ CAST(a AS BINARY(256)),
+ CAST(a AS BINARY(512)),
+ CAST(a AS BINARY(513)),
+ CAST(a AS BINARY(65532)),
+ CAST(a AS BINARY(65533)),
+ CAST(a AS BINARY(65534)),
+ CAST(a AS BINARY(65535)),
+ CAST(a AS BINARY(65536)),
+ CAST(a AS BINARY(16777215)),
+ CAST(a AS BINARY(16777216))
+FROM t1;
+--disable_metadata
+DROP TABLE t1;
+
+--echo #
+--echo # MIN(uuid) with GROUP BY
+--echo #
+
+CREATE TABLE t1 (id INT, a UUID) ENGINE=MyISAM;
+INSERT INTO t1 VALUES
+(1, '00000000-0000-0000-0000-000000000fff'),
+(1, '00000000-0000-0000-0000-000000008888');
+SELECT MIN(a), MAX(a) FROM t1 GROUP BY id;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-26785 Hyphens inside the value of uuid datatype
+--echo #
+
+CREATE TABLE t1 (a UUID);
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO t1 VALUES ('0000000000000000000000000000000'/*31 digits*/);
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO t1 VALUES ('000000000000000000000000000000000'/*33 digits*/);
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO t1 VALUES ('-00000000000000000000000000000000'/*leading hyphen*/);
+--error ER_TRUNCATED_WRONG_VALUE
+INSERT INTO t1 VALUES ('-00000000000000000000000000000000-'/*trailing hyphen*/);
+
+INSERT INTO t1 VALUES ('00000000000000000000000000000000');
+INSERT INTO t1 VALUES ('0-0000000000000000000000000000011');
+INSERT INTO t1 VALUES ('0--0000000000000000000000000000012');
+INSERT INTO t1 VALUES ('0---0000000000000000000000000000013');
+INSERT INTO t1 VALUES ('0----0000000000000000000000000000014');
+INSERT INTO t1 VALUES ('00-000000000000000000000000000021');
+INSERT INTO t1 VALUES ('00--000000000000000000000000000022');
+INSERT INTO t1 VALUES ('00---000000000000000000000000000023');
+INSERT INTO t1 VALUES ('00----000000000000000000000000000024');
+
+INSERT INTO t1 VALUES ('5796dac11a1c11--------------ecab4ef859-713e4be4');
+INSERT INTO t1 VALUES ('5796dac11a1c11---------------ecab4ef859-713e4be4');
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-26732 Assertion `0' failed in Item::val_native
+--echo #
+
+SELECT uuid() AS f, var_pop('x') FROM dual HAVING f > '';
+
+
+--echo #
+--echo # MDEV-28491 Uuid. "UPDATE/DELETE" not working "WHERE id IN (SELECT id FROM ..)"
+--echo #
+
+CREATE TABLE companies (id uuid, name varchar(10));
+INSERT INTO companies (id) values ('7bc95b06-cc6c-11ec-96c5-0242ac130002');
+
+CREATE TABLE divisions (company_id uuid);
+INSERT INTO divisions (company_id) values ('7bc95b06-cc6c-11ec-96c5-0242ac130002');
+SELECT * FROM companies WHERE id IN (SELECT company_id FROM divisions);
+UPDATE companies SET name = 'value' WHERE id IN (SELECT company_id FROM divisions);
+SELECT * FROM companies;
+DELETE FROM companies WHERE id IN (SELECT company_id FROM divisions);
+SELECT * FROM companies;
+DROP TABLE divisions;
+DROP TABLE companies;
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_csv.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_csv.result
new file mode 100644
index 00000000000..1ad371ec561
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_csv.result
@@ -0,0 +1,92 @@
+#
+# Start of 10.5 tests
+#
+#
+# MDEV-4958 Adding datatype UUID
+#
+SET default_storage_engine=CSV;
+CREATE TABLE t1 (a UUID NOT NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` uuid NOT NULL
+) ENGINE=CSV DEFAULT CHARSET=latin1
+FOR i IN 0..255
+DO
+INSERT INTO t1 VALUES (CONCAT(REPEAT(0x00,15), UNHEX(HEX(i))));
+END FOR
+$$
+SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-0000000000ff';
+a
+00000000-0000-0000-0000-0000000000ff
+SELECT * FROM t1 WHERE a>='00000000-0000-0000-0000-0000000000fe' ORDER BY a;
+a
+00000000-0000-0000-0000-0000000000fe
+00000000-0000-0000-0000-0000000000ff
+SELECT * FROM t1 WHERE a IN
+(
+'00000000-0000-0000-0000-000000000080',
+'00000000-0000-0000-0000-0000000000a0',
+'00000000-0000-0000-0000-0000000000ff'
+)
+ORDER BY a;
+a
+00000000-0000-0000-0000-000000000080
+00000000-0000-0000-0000-0000000000a0
+00000000-0000-0000-0000-0000000000ff
+SELECT * FROM t1
+WHERE a BETWEEN
+'00000000-0000-0000-0000-000000000080'
+ AND
+'00000000-0000-0000-0000-000000000081'
+ORDER BY a;
+a
+00000000-0000-0000-0000-000000000080
+00000000-0000-0000-0000-000000000081
+SELECT CONCAT('ffff',SUBSTRING(a, 5,256)) FROM t1 WHERE a LIKE '%a_';
+CONCAT('ffff',SUBSTRING(a, 5,256))
+ffff0000-0000-0000-0000-0000000000a0
+ffff0000-0000-0000-0000-0000000000a1
+ffff0000-0000-0000-0000-0000000000a2
+ffff0000-0000-0000-0000-0000000000a3
+ffff0000-0000-0000-0000-0000000000a4
+ffff0000-0000-0000-0000-0000000000a5
+ffff0000-0000-0000-0000-0000000000a6
+ffff0000-0000-0000-0000-0000000000a7
+ffff0000-0000-0000-0000-0000000000a8
+ffff0000-0000-0000-0000-0000000000a9
+ffff0000-0000-0000-0000-0000000000aa
+ffff0000-0000-0000-0000-0000000000ab
+ffff0000-0000-0000-0000-0000000000ac
+ffff0000-0000-0000-0000-0000000000ad
+ffff0000-0000-0000-0000-0000000000ae
+ffff0000-0000-0000-0000-0000000000af
+UPDATE t1 SET a=CONCAT('ffff',SUBSTRING(a, 5,256)) WHERE a LIKE '%a_';
+SELECT * FROM t1 WHERE a LIKE 'ffff%' ORDER BY a;
+a
+ffff0000-0000-0000-0000-0000000000a0
+ffff0000-0000-0000-0000-0000000000a1
+ffff0000-0000-0000-0000-0000000000a2
+ffff0000-0000-0000-0000-0000000000a3
+ffff0000-0000-0000-0000-0000000000a4
+ffff0000-0000-0000-0000-0000000000a5
+ffff0000-0000-0000-0000-0000000000a6
+ffff0000-0000-0000-0000-0000000000a7
+ffff0000-0000-0000-0000-0000000000a8
+ffff0000-0000-0000-0000-0000000000a9
+ffff0000-0000-0000-0000-0000000000aa
+ffff0000-0000-0000-0000-0000000000ab
+ffff0000-0000-0000-0000-0000000000ac
+ffff0000-0000-0000-0000-0000000000ad
+ffff0000-0000-0000-0000-0000000000ae
+ffff0000-0000-0000-0000-0000000000af
+DROP TABLE t1;
+CREATE TABLE t1 (a UUID NOT NULL) ENGINE=CSV;
+INSERT INTO t1 VALUES ('123e4567-e89b-12d3-a456-426655440000');
+SELECT * FROM t1;
+a
+123e4567-e89b-12d3-a456-426655440000
+DROP TABLE t1;
+#
+# End of 10.5 tests
+#
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_csv.test b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_csv.test
new file mode 100644
index 00000000000..482fb6a0e43
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_csv.test
@@ -0,0 +1,58 @@
+--source include/have_csv.inc
+
+--echo #
+--echo # Start of 10.5 tests
+--echo #
+
+--echo #
+--echo # MDEV-4958 Adding datatype UUID
+--echo #
+
+SET default_storage_engine=CSV;
+
+CREATE TABLE t1 (a UUID NOT NULL);
+SHOW CREATE TABLE t1;
+
+DELIMITER $$;
+FOR i IN 0..255
+DO
+ INSERT INTO t1 VALUES (CONCAT(REPEAT(0x00,15), UNHEX(HEX(i))));
+END FOR
+$$
+DELIMITER ;$$
+
+SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-0000000000ff';
+
+SELECT * FROM t1 WHERE a>='00000000-0000-0000-0000-0000000000fe' ORDER BY a;
+
+SELECT * FROM t1 WHERE a IN
+(
+ '00000000-0000-0000-0000-000000000080',
+ '00000000-0000-0000-0000-0000000000a0',
+ '00000000-0000-0000-0000-0000000000ff'
+)
+ORDER BY a;
+
+SELECT * FROM t1
+WHERE a BETWEEN
+ '00000000-0000-0000-0000-000000000080'
+ AND
+ '00000000-0000-0000-0000-000000000081'
+ORDER BY a;
+
+SELECT CONCAT('ffff',SUBSTRING(a, 5,256)) FROM t1 WHERE a LIKE '%a_';
+UPDATE t1 SET a=CONCAT('ffff',SUBSTRING(a, 5,256)) WHERE a LIKE '%a_';
+
+SELECT * FROM t1 WHERE a LIKE 'ffff%' ORDER BY a;
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (a UUID NOT NULL) ENGINE=CSV;
+INSERT INTO t1 VALUES ('123e4567-e89b-12d3-a456-426655440000');
+SELECT * FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 10.5 tests
+--echo #
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_engines.inc b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_engines.inc
new file mode 100644
index 00000000000..41494c86ff6
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_engines.inc
@@ -0,0 +1,108 @@
+--echo #
+--echo # Range optimizer
+--echo #
+
+CREATE TABLE t1 (a UUID, INDEX(a));
+SHOW CREATE TABLE t1;
+
+DELIMITER $$;
+FOR i IN 0..255
+DO
+ INSERT INTO t1 VALUES (CONCAT(REPEAT(0x00, 15),CHAR(i USING BINARY)));
+END FOR
+$$
+DELIMITER ;$$
+
+SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-0000000000ff';
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-0000000000ff';
+SELECT * FROM t1 WHERE a='garbage';
+EXPLAIN SELECT * FROM t1 WHERE a='garbage';
+
+SELECT * FROM t1 WHERE a>='00000000-0000-0000-0000-0000000000fe';
+EXPLAIN SELECT * FROM t1 WHERE a>='00000000-0000-0000-0000-0000000000fe';
+SELECT * FROM t1 WHERE a>='garbage';
+EXPLAIN SELECT * FROM t1 WHERE a>='garbage';
+
+SELECT * FROM t1 WHERE a IN
+(
+ '00000000-0000-0000-0000-000000000080',
+ '00000000-0000-0000-0000-0000000000a0',
+ '00000000-0000-0000-0000-0000000000f0'
+);
+EXPLAIN SELECT * FROM t1 WHERE a IN
+(
+ '00000000-0000-0000-0000-000000000080',
+ '00000000-0000-0000-0000-0000000000a0',
+ '00000000-0000-0000-0000-0000000000f0'
+);
+SELECT * FROM t1 WHERE a IN
+(
+ '00000000-0000-0000-0000-000000000080',
+ '00000000-0000-0000-0000-0000000000a0',
+ 'garbage'
+);
+EXPLAIN SELECT * FROM t1 WHERE a IN
+(
+ '00000000-0000-0000-0000-000000000080',
+ '00000000-0000-0000-0000-0000000000a0',
+ 'garbage'
+);
+
+SELECT * FROM t1 WHERE a BETWEEN
+ '00000000-0000-0000-0000-000000000080' AND
+ '00000000-0000-0000-0000-000000000081';
+EXPLAIN SELECT * FROM t1 WHERE a BETWEEN
+ '00000000-0000-0000-0000-000000000080' AND
+ '00000000-0000-0000-0000-000000000081';
+
+SELECT * FROM t1 WHERE a BETWEEN
+ '00000000-0000-0000-0000-000000000080' AND
+ 'garbage';
+EXPLAIN SELECT * FROM t1 WHERE a BETWEEN
+ '00000000-0000-0000-0000-000000000080' AND
+ 'garbage';
+
+SELECT * FROM t1 WHERE a=CAST('00000000-0000-0000-0000-0000000000ff' AS UUID);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=CAST('00000000-0000-0000-0000-0000000000ff' AS UUID);
+
+DROP TABLE t1;
+
+
+CREATE OR REPLACE TABLE t1 (a UUID,KEY(a));
+SHOW CREATE TABLE t1;
+BEGIN;
+DELIMITER $$;
+FOR i IN 0..255
+DO
+ INSERT INTO t1 VALUES (REPLACE('XX000000-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00XX0000-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('0000XX00-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('000000XX-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-XX00-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-00XX-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-XX00-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-00XX-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-XX00-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-00XX-000000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-XX0000000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-00XX00000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-0000XX000000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-000000XX0000','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-00000000XX00','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-0000000000XX','XX',LPAD(HEX(i),2,'0')));
+END FOR;
+$$
+DELIMITER ;$$
+COMMIT;
+EXPLAIN SELECT * FROM t1 WHERE a='ff000000-0000-0000-0000-000000000000';
+EXPLAIN SELECT * FROM t1 WHERE a='00ff0000-0000-0000-0000-000000000000';
+EXPLAIN SELECT * FROM t1 WHERE a='0000ff00-0000-0000-0000-000000000000';
+EXPLAIN SELECT * FROM t1 WHERE a='000000ff-0000-0000-0000-000000000000';
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-ff00-0000-0000-000000000000';
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-00ff-0000-0000-000000000000';
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-ff00-0000-000000000000';
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-00ff-0000-000000000000';
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-ff00-000000000000';
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-00ff-000000000000';
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-ff0000000000';
+DROP TABLE t1;
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_innodb.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_innodb.result
new file mode 100644
index 00000000000..f777723eefc
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_innodb.result
@@ -0,0 +1,203 @@
+#
+# Start of 10.7 tests
+#
+#
+# MDEV-4958 Adding datatype UUID
+#
+SET default_storage_engine=InnoDB;
+#
+# Range optimizer
+#
+CREATE TABLE t1 (a UUID, INDEX(a));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` uuid DEFAULT NULL,
+ KEY `a` (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+FOR i IN 0..255
+DO
+INSERT INTO t1 VALUES (CONCAT(REPEAT(0x00, 15),CHAR(i USING BINARY)));
+END FOR
+$$
+SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-0000000000ff';
+a
+00000000-0000-0000-0000-0000000000ff
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-0000000000ff';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+SELECT * FROM t1 WHERE a='garbage';
+a
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+EXPLAIN SELECT * FROM t1 WHERE a='garbage';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+SELECT * FROM t1 WHERE a>='00000000-0000-0000-0000-0000000000fe';
+a
+00000000-0000-0000-0000-0000000000fe
+00000000-0000-0000-0000-0000000000ff
+EXPLAIN SELECT * FROM t1 WHERE a>='00000000-0000-0000-0000-0000000000fe';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 17 NULL 2 Using where; Using index
+SELECT * FROM t1 WHERE a>='garbage';
+a
+EXPLAIN SELECT * FROM t1 WHERE a>='garbage';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT * FROM t1 WHERE a IN
+(
+'00000000-0000-0000-0000-000000000080',
+'00000000-0000-0000-0000-0000000000a0',
+'00000000-0000-0000-0000-0000000000f0'
+);
+a
+00000000-0000-0000-0000-000000000080
+00000000-0000-0000-0000-0000000000a0
+00000000-0000-0000-0000-0000000000f0
+EXPLAIN SELECT * FROM t1 WHERE a IN
+(
+'00000000-0000-0000-0000-000000000080',
+'00000000-0000-0000-0000-0000000000a0',
+'00000000-0000-0000-0000-0000000000f0'
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 17 NULL 3 Using where; Using index
+SELECT * FROM t1 WHERE a IN
+(
+'00000000-0000-0000-0000-000000000080',
+'00000000-0000-0000-0000-0000000000a0',
+'garbage'
+);
+a
+00000000-0000-0000-0000-000000000080
+00000000-0000-0000-0000-0000000000a0
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+EXPLAIN SELECT * FROM t1 WHERE a IN
+(
+'00000000-0000-0000-0000-000000000080',
+'00000000-0000-0000-0000-0000000000a0',
+'garbage'
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 17 NULL 2 Using where; Using index
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+SELECT * FROM t1 WHERE a BETWEEN
+'00000000-0000-0000-0000-000000000080' AND
+'00000000-0000-0000-0000-000000000081';
+a
+00000000-0000-0000-0000-000000000080
+00000000-0000-0000-0000-000000000081
+EXPLAIN SELECT * FROM t1 WHERE a BETWEEN
+'00000000-0000-0000-0000-000000000080' AND
+'00000000-0000-0000-0000-000000000081';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 17 NULL 2 Using where; Using index
+SELECT * FROM t1 WHERE a BETWEEN
+'00000000-0000-0000-0000-000000000080' AND
+'garbage';
+a
+EXPLAIN SELECT * FROM t1 WHERE a BETWEEN
+'00000000-0000-0000-0000-000000000080' AND
+'garbage';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT * FROM t1 WHERE a=CAST('00000000-0000-0000-0000-0000000000ff' AS UUID);
+a
+00000000-0000-0000-0000-0000000000ff
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=CAST('00000000-0000-0000-0000-0000000000ff' AS UUID);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ref a a 17 const 1 100.00 Using where; Using index
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = UUID'00000000-0000-0000-0000-0000000000ff'
+DROP TABLE t1;
+CREATE OR REPLACE TABLE t1 (a UUID,KEY(a));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` uuid DEFAULT NULL,
+ KEY `a` (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+BEGIN;
+FOR i IN 0..255
+DO
+INSERT INTO t1 VALUES (REPLACE('XX000000-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00XX0000-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('0000XX00-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('000000XX-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-XX00-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-00XX-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-XX00-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-00XX-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-XX00-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-00XX-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-XX0000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-00XX00000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-0000XX000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-000000XX0000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-00000000XX00','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-0000000000XX','XX',LPAD(HEX(i),2,'0')));
+END FOR;
+$$
+COMMIT;
+EXPLAIN SELECT * FROM t1 WHERE a='ff000000-0000-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='00ff0000-0000-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='0000ff00-0000-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='000000ff-0000-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-ff00-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-00ff-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-ff00-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-00ff-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-ff00-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-00ff-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-ff0000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+DROP TABLE t1;
+#
+# MDEV-26742 Assertion `field->type_handler() == this' failed in FixedBinTypeBundle<NATIVE_LEN, MAX_CHAR_LEN>::Type_handler_fbt::stored_field_cmp_to_item
+#
+CREATE TABLE t1 ( pk uuid, c text) engine=myisam;
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000000',1);
+CREATE TABLE t2 ( d text, KEY (d)) engine=innodb ;
+Warnings:
+Note 1071 Specified key was too long; max key length is 3072 bytes
+INSERT INTO t2 VALUES (2);
+SELECT * FROM t2 JOIN t1 ON ( t1.pk > t2.d);
+d pk c
+Warnings:
+Warning 1292 Incorrect uuid value: '2'
+EXPLAIN SELECT * FROM t2 JOIN t1 ON ( t1.pk > t2.d);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1
+1 SIMPLE t2 ALL d NULL NULL NULL 1 Using where
+UPDATE t2 JOIN t1 ON ( t1.pk > t2.d) SET t1.c = 1;
+ERROR 22007: Incorrect uuid value: '2'
+DROP TABLE t1, t2;
+#
+# End of 10.7 tests
+#
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_innodb.test b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_innodb.test
new file mode 100644
index 00000000000..941a7a73d9a
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_innodb.test
@@ -0,0 +1,31 @@
+--source include/have_innodb.inc
+
+--echo #
+--echo # Start of 10.7 tests
+--echo #
+
+--echo #
+--echo # MDEV-4958 Adding datatype UUID
+--echo #
+
+SET default_storage_engine=InnoDB;
+--source type_uuid_engines.inc
+
+--echo #
+--echo # MDEV-26742 Assertion `field->type_handler() == this' failed in FixedBinTypeBundle<NATIVE_LEN, MAX_CHAR_LEN>::Type_handler_fbt::stored_field_cmp_to_item
+--echo #
+
+CREATE TABLE t1 ( pk uuid, c text) engine=myisam;
+INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000000',1);
+CREATE TABLE t2 ( d text, KEY (d)) engine=innodb ;
+INSERT INTO t2 VALUES (2);
+SELECT * FROM t2 JOIN t1 ON ( t1.pk > t2.d);
+EXPLAIN SELECT * FROM t2 JOIN t1 ON ( t1.pk > t2.d);
+--error ER_TRUNCATED_WRONG_VALUE
+UPDATE t2 JOIN t1 ON ( t1.pk > t2.d) SET t1.c = 1;
+DROP TABLE t1, t2;
+
+
+--echo #
+--echo # End of 10.7 tests
+--echo #
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_memory.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_memory.result
new file mode 100644
index 00000000000..9d2c27a9e25
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_memory.result
@@ -0,0 +1,250 @@
+#
+# Start of 10.5 tests
+#
+#
+# MDEV-4958 Adding datatype UUID
+#
+SET default_storage_engine=MEMORY;
+#
+# Range optimizer
+#
+CREATE TABLE t1 (a UUID, INDEX(a));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` uuid DEFAULT NULL,
+ KEY `a` (`a`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+FOR i IN 0..255
+DO
+INSERT INTO t1 VALUES (CONCAT(REPEAT(0x00, 15),CHAR(i USING BINARY)));
+END FOR
+$$
+SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-0000000000ff';
+a
+00000000-0000-0000-0000-0000000000ff
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-0000000000ff';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 4 Using where
+SELECT * FROM t1 WHERE a='garbage';
+a
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+EXPLAIN SELECT * FROM t1 WHERE a='garbage';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+SELECT * FROM t1 WHERE a>='00000000-0000-0000-0000-0000000000fe';
+a
+00000000-0000-0000-0000-0000000000fe
+00000000-0000-0000-0000-0000000000ff
+EXPLAIN SELECT * FROM t1 WHERE a>='00000000-0000-0000-0000-0000000000fe';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL a NULL NULL NULL 256 Using where
+SELECT * FROM t1 WHERE a>='garbage';
+a
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+EXPLAIN SELECT * FROM t1 WHERE a>='garbage';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL a NULL NULL NULL 256 Using where
+SELECT * FROM t1 WHERE a IN
+(
+'00000000-0000-0000-0000-000000000080',
+'00000000-0000-0000-0000-0000000000a0',
+'00000000-0000-0000-0000-0000000000f0'
+);
+a
+00000000-0000-0000-0000-000000000080
+00000000-0000-0000-0000-0000000000a0
+00000000-0000-0000-0000-0000000000f0
+EXPLAIN SELECT * FROM t1 WHERE a IN
+(
+'00000000-0000-0000-0000-000000000080',
+'00000000-0000-0000-0000-0000000000a0',
+'00000000-0000-0000-0000-0000000000f0'
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 17 NULL 12 Using where
+SELECT * FROM t1 WHERE a IN
+(
+'00000000-0000-0000-0000-000000000080',
+'00000000-0000-0000-0000-0000000000a0',
+'garbage'
+);
+a
+00000000-0000-0000-0000-000000000080
+00000000-0000-0000-0000-0000000000a0
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+EXPLAIN SELECT * FROM t1 WHERE a IN
+(
+'00000000-0000-0000-0000-000000000080',
+'00000000-0000-0000-0000-0000000000a0',
+'garbage'
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 17 NULL 8 Using where
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+SELECT * FROM t1 WHERE a BETWEEN
+'00000000-0000-0000-0000-000000000080' AND
+'00000000-0000-0000-0000-000000000081';
+a
+00000000-0000-0000-0000-000000000080
+00000000-0000-0000-0000-000000000081
+EXPLAIN SELECT * FROM t1 WHERE a BETWEEN
+'00000000-0000-0000-0000-000000000080' AND
+'00000000-0000-0000-0000-000000000081';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL a NULL NULL NULL 256 Using where
+SELECT * FROM t1 WHERE a BETWEEN
+'00000000-0000-0000-0000-000000000080' AND
+'garbage';
+a
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+Warning 1292 Incorrect uuid value: 'garbage'
+EXPLAIN SELECT * FROM t1 WHERE a BETWEEN
+'00000000-0000-0000-0000-000000000080' AND
+'garbage';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL a NULL NULL NULL 256 Using where
+SELECT * FROM t1 WHERE a=CAST('00000000-0000-0000-0000-0000000000ff' AS UUID);
+a
+00000000-0000-0000-0000-0000000000ff
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=CAST('00000000-0000-0000-0000-0000000000ff' AS UUID);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ref a a 17 const 4 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = UUID'00000000-0000-0000-0000-0000000000ff'
+DROP TABLE t1;
+CREATE OR REPLACE TABLE t1 (a UUID,KEY(a));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` uuid DEFAULT NULL,
+ KEY `a` (`a`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+BEGIN;
+FOR i IN 0..255
+DO
+INSERT INTO t1 VALUES (REPLACE('XX000000-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00XX0000-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('0000XX00-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('000000XX-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-XX00-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-00XX-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-XX00-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-00XX-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-XX00-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-00XX-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-XX0000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-00XX00000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-0000XX000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-000000XX0000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-00000000XX00','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-0000000000XX','XX',LPAD(HEX(i),2,'0')));
+END FOR;
+$$
+COMMIT;
+EXPLAIN SELECT * FROM t1 WHERE a='ff000000-0000-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 2 Using where
+EXPLAIN SELECT * FROM t1 WHERE a='00ff0000-0000-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 2 Using where
+EXPLAIN SELECT * FROM t1 WHERE a='0000ff00-0000-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 2 Using where
+EXPLAIN SELECT * FROM t1 WHERE a='000000ff-0000-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 2 Using where
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-ff00-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 2 Using where
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-00ff-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 2 Using where
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-ff00-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 2 Using where
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-00ff-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 2 Using where
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-ff00-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 2 Using where
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-00ff-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 2 Using where
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-ff0000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 2 Using where
+DROP TABLE t1;
+#
+# End of 10.5 tests
+#
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_memory.test b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_memory.test
new file mode 100644
index 00000000000..cdae2bc39c2
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_memory.test
@@ -0,0 +1,15 @@
+--echo #
+--echo # Start of 10.5 tests
+--echo #
+
+--echo #
+--echo # MDEV-4958 Adding datatype UUID
+--echo #
+
+SET default_storage_engine=MEMORY;
+--source type_uuid_engines.inc
+
+
+--echo #
+--echo # End of 10.5 tests
+--echo #
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_myisam.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_myisam.result
new file mode 100644
index 00000000000..35cc25abfd6
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_myisam.result
@@ -0,0 +1,237 @@
+#
+# Start of 10.7 tests
+#
+#
+# MDEV-4958 Adding datatype UUID
+#
+SET default_storage_engine=MyISAM;
+#
+# Range optimizer
+#
+CREATE TABLE t1 (a UUID, INDEX(a));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` uuid DEFAULT NULL,
+ KEY `a` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+FOR i IN 0..255
+DO
+INSERT INTO t1 VALUES (CONCAT(REPEAT(0x00, 15),CHAR(i USING BINARY)));
+END FOR
+$$
+SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-0000000000ff';
+a
+00000000-0000-0000-0000-0000000000ff
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-0000000000ff';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+SELECT * FROM t1 WHERE a='garbage';
+a
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+EXPLAIN SELECT * FROM t1 WHERE a='garbage';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+SELECT * FROM t1 WHERE a>='00000000-0000-0000-0000-0000000000fe';
+a
+00000000-0000-0000-0000-0000000000fe
+00000000-0000-0000-0000-0000000000ff
+EXPLAIN SELECT * FROM t1 WHERE a>='00000000-0000-0000-0000-0000000000fe';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 17 NULL 3 Using where; Using index
+SELECT * FROM t1 WHERE a>='garbage';
+a
+EXPLAIN SELECT * FROM t1 WHERE a>='garbage';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT * FROM t1 WHERE a IN
+(
+'00000000-0000-0000-0000-000000000080',
+'00000000-0000-0000-0000-0000000000a0',
+'00000000-0000-0000-0000-0000000000f0'
+);
+a
+00000000-0000-0000-0000-000000000080
+00000000-0000-0000-0000-0000000000a0
+00000000-0000-0000-0000-0000000000f0
+EXPLAIN SELECT * FROM t1 WHERE a IN
+(
+'00000000-0000-0000-0000-000000000080',
+'00000000-0000-0000-0000-0000000000a0',
+'00000000-0000-0000-0000-0000000000f0'
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 17 NULL 4 Using where; Using index
+SELECT * FROM t1 WHERE a IN
+(
+'00000000-0000-0000-0000-000000000080',
+'00000000-0000-0000-0000-0000000000a0',
+'garbage'
+);
+a
+00000000-0000-0000-0000-000000000080
+00000000-0000-0000-0000-0000000000a0
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+EXPLAIN SELECT * FROM t1 WHERE a IN
+(
+'00000000-0000-0000-0000-000000000080',
+'00000000-0000-0000-0000-0000000000a0',
+'garbage'
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 17 NULL 2 Using where; Using index
+Warnings:
+Warning 1292 Incorrect uuid value: 'garbage'
+SELECT * FROM t1 WHERE a BETWEEN
+'00000000-0000-0000-0000-000000000080' AND
+'00000000-0000-0000-0000-000000000081';
+a
+00000000-0000-0000-0000-000000000080
+00000000-0000-0000-0000-000000000081
+EXPLAIN SELECT * FROM t1 WHERE a BETWEEN
+'00000000-0000-0000-0000-000000000080' AND
+'00000000-0000-0000-0000-000000000081';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 17 NULL 2 Using where; Using index
+SELECT * FROM t1 WHERE a BETWEEN
+'00000000-0000-0000-0000-000000000080' AND
+'garbage';
+a
+EXPLAIN SELECT * FROM t1 WHERE a BETWEEN
+'00000000-0000-0000-0000-000000000080' AND
+'garbage';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT * FROM t1 WHERE a=CAST('00000000-0000-0000-0000-0000000000ff' AS UUID);
+a
+00000000-0000-0000-0000-0000000000ff
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=CAST('00000000-0000-0000-0000-0000000000ff' AS UUID);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ref a a 17 const 1 100.00 Using where; Using index
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = UUID'00000000-0000-0000-0000-0000000000ff'
+DROP TABLE t1;
+CREATE OR REPLACE TABLE t1 (a UUID,KEY(a));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` uuid DEFAULT NULL,
+ KEY `a` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+BEGIN;
+FOR i IN 0..255
+DO
+INSERT INTO t1 VALUES (REPLACE('XX000000-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00XX0000-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('0000XX00-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('000000XX-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-XX00-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-00XX-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-XX00-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-00XX-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-XX00-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-00XX-000000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-XX0000000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-00XX00000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-0000XX000000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-000000XX0000','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-00000000XX00','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-0000000000XX','XX',LPAD(HEX(i),2,'0')));
+END FOR;
+$$
+COMMIT;
+EXPLAIN SELECT * FROM t1 WHERE a='ff000000-0000-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='00ff0000-0000-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='0000ff00-0000-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='000000ff-0000-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-ff00-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-00ff-0000-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-ff00-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-00ff-0000-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-ff00-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-00ff-000000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-ff0000000000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 17 const 1 Using where; Using index
+DROP TABLE t1;
+#
+# Testing index prefix compression
+#
+CREATE PROCEDURE test_pack_key()
+BEGIN
+SHOW CREATE TABLE t1;
+FOR i IN 0..0x1FFF
+DO
+INSERT INTO t1 VALUES (UUID());
+END FOR;
+SELECT
+CASE
+WHEN INDEX_LENGTH/DATA_LENGTH < 0.7 THEN 'PACKED'
+ WHEN INDEX_LENGTH/DATA_LENGTH > 1.2 THEN 'NOT PACKED'
+ ELSE CONCAT('UNKNOWN ', INDEX_LENGTH/DATA_LENGTH)
+END AS PackKey
+FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
+END;
+$$
+"------------------ CREATE TABLE"
+CREATE TABLE t1 (a UUID, KEY(a));
+CALL test_pack_key();
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` uuid DEFAULT NULL,
+ KEY `a` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+PackKey
+PACKED
+DROP TABLE t1;
+"------------------ t1packkey.frm"
+TRUNCATE TABLE t1;
+CALL test_pack_key();
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` uuid DEFAULT NULL,
+ KEY `a` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+PackKey
+PACKED
+DROP TABLE t1;
+"------------------ t1nopackkey.frm"
+TRUNCATE TABLE t1;
+CALL test_pack_key();
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` uuid DEFAULT NULL,
+ KEY `a` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+PackKey
+NOT PACKED
+DROP TABLE t1;
+DROP PROCEDURE test_pack_key;
+#
+# End of 10.7 tests
+#
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_myisam.test b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_myisam.test
new file mode 100644
index 00000000000..7526d344fc3
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_myisam.test
@@ -0,0 +1,61 @@
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+--echo #
+--echo # Start of 10.7 tests
+--echo #
+
+--echo #
+--echo # MDEV-4958 Adding datatype UUID
+--echo #
+
+
+SET default_storage_engine=MyISAM;
+--source type_uuid_engines.inc
+
+--echo #
+--echo # Testing index prefix compression
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE test_pack_key()
+BEGIN
+ SHOW CREATE TABLE t1;
+ FOR i IN 0..0x1FFF
+ DO
+ INSERT INTO t1 VALUES (UUID());
+ END FOR;
+ SELECT
+ CASE
+ WHEN INDEX_LENGTH/DATA_LENGTH < 0.7 THEN 'PACKED'
+ WHEN INDEX_LENGTH/DATA_LENGTH > 1.2 THEN 'NOT PACKED'
+ ELSE CONCAT('UNKNOWN ', INDEX_LENGTH/DATA_LENGTH)
+ END AS PackKey
+ FROM INFORMATION_SCHEMA.TABLES
+ WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
+END;
+$$
+DELIMITER ;$$
+
+--echo "------------------ CREATE TABLE"
+CREATE TABLE t1 (a UUID, KEY(a));
+CALL test_pack_key();
+DROP TABLE t1;
+
+--echo "------------------ t1packkey.frm"
+--copy_file $MTR_SUITE_DIR/std_data/t1packkey.frm $MYSQLD_DATADIR/test/t1.frm
+TRUNCATE TABLE t1;
+CALL test_pack_key();
+DROP TABLE t1;
+
+--echo "------------------ t1nopackkey.frm"
+--copy_file $MTR_SUITE_DIR/std_data/t1nopackkey.frm $MYSQLD_DATADIR/test/t1.frm
+TRUNCATE TABLE t1;
+CALL test_pack_key();
+DROP TABLE t1;
+
+
+DROP PROCEDURE test_pack_key;
+
+--echo #
+--echo # End of 10.7 tests
+--echo #
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mysql.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mysql.result
new file mode 100644
index 00000000000..51531e5c0d7
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mysql.result
@@ -0,0 +1,16 @@
+CREATE TABLE t1 (a UUID);
+Field 1: `a`
+Org_field: `a`
+Catalog: `def`
+Database: `test`
+Table: `t1`
+Org_table: `t1`
+Type: STRING (type=uuid)
+Collation: latin1_swedish_ci (8)
+Length: 36
+Max_length: 0
+Decimals: 0
+Flags: UNSIGNED BINARY
+
+
+DROP TABLE t1;
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mysql.test b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mysql.test
new file mode 100644
index 00000000000..c9bfadca01b
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mysql.test
@@ -0,0 +1,6 @@
+-- source include/have_working_dns.inc
+-- source include/not_embedded.inc
+
+CREATE TABLE t1 (a UUID);
+--exec $MYSQL -t test --column-type-info -e "SELECT * FROM t1" 2>&1
+DROP TABLE t1;
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_partition.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_partition.result
new file mode 100644
index 00000000000..82b96002d2e
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_partition.result
@@ -0,0 +1,1797 @@
+#
+# MDEV-4958 Adding datatype UUID
+#
+SET NAMES utf8;
+CREATE TABLE t1 (a UUID)
+PARTITION BY LIST COLUMNS(a)
+(PARTITION p00 VALUES IN (10));
+ERROR HY000: Partition column values of incorrect type
+CREATE TABLE t1 (a UUID)
+PARTITION BY LIST COLUMNS(a)
+(PARTITION p00 VALUES IN (TIME'10:20:30'));
+ERROR HY000: Partition column values of incorrect type
+CREATE TABLE t1 (a UUID)
+PARTITION BY LIST COLUMNS(a)
+(PARTITION p00 VALUES IN ('€'));
+ERROR 22007: Incorrect uuid value: '€'
+CREATE TABLE t1 (a UUID)
+PARTITION BY LIST COLUMNS(a)
+(PARTITION p00 VALUES IN ('123e4567-e89b-12d3-a456-426655440000'),
+PARTITION pFF VALUES IN (0xffff000000000000000000000000ffff));
+INSERT INTO t1 VALUES ('123e4567-e89b-12d3-a456-426655440000');
+INSERT INTO t1 VALUES ('ffff0000-0000-0000-0000-00000000ffff');
+SELECT * FROM t1 PARTITION (p00);
+a
+123e4567-e89b-12d3-a456-426655440000
+SELECT * FROM t1 PARTITION (pFF);
+a
+ffff0000-0000-0000-0000-00000000ffff
+DROP TABLE t1;
+CREATE TABLE t0 (a UUID);
+FOR i IN 0..255
+DO
+INSERT INTO t0 VALUES (REPLACE('XXfd306d-307f-11ec-8d10-d20bbc909b57','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t0 VALUES (REPLACE('9cfd306d-XX7f-12ec-8d10-d20bbc909b57','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t0 VALUES (REPLACE('9cfd306d-307f-13XX-8d10-d20bbc909b57','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t0 VALUES (REPLACE('9cfd306d-307f-14ec-8dXX-d20bbc909b57','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t0 VALUES (REPLACE('9cfd306d-307f-15ec-8d10-XX0bbc909b57','XX',LPAD(HEX(i),2,'0')));
+INSERT INTO t0 VALUES (REPLACE('9cfd306d-307f-16ec-8d10-d20bbc909bXX','XX',LPAD(HEX(i),2,'0')));
+END FOR;
+$$
+# Test that UUID and BINARY(16) implement the same distribution by key
+CREATE PROCEDURE test_partition_by_key_uuid_vs_binary(parts INT)
+BEGIN
+EXECUTE IMMEDIATE REPLACE('CREATE TABLE t1 (a UUID) PARTITION BY KEY (a) PARTITIONS 7','7',parts);
+EXECUTE IMMEDIATE REPLACE('CREATE TABLE t2 (a BINARY(16)) PARTITION BY KEY (a) PARTITIONS 7','7',parts);
+INSERT INTO t1 SELECT * FROM t0;
+INSERT INTO t2 SELECT * FROM t0;
+FOR i IN 0..(parts-1)
+DO
+BEGIN
+DECLARE query_template TEXT DEFAULT 'SELECT a_p0, COUNT(*) FROM ('
+ 'SELECT a AS a_p0 FROM t1 PARTITION(p0) '
+ 'UNION ALL '
+ 'SELECT CAST(a AS UUID) AS a_p0 FROM t2 PARTITION(p0)) td '
+ 'GROUP BY a_p0';
+DECLARE query TEXT DEFAULT REPLACE(query_template,'p0',CONCAT('p',i));
+SELECT query;
+EXECUTE IMMEDIATE query;
+END;
+END FOR;
+DROP TABLE t1,t2;
+END;
+$$
+# Display statistics how records are distributed between partitions
+CREATE PROCEDURE test_partition_by_key_pstat(parts INT)
+BEGIN
+EXECUTE IMMEDIATE REPLACE('CREATE TABLE t1 (a UUID) PARTITION BY KEY (a) PARTITIONS 7','7',parts);
+CREATE TABLE t1_pstat (pname VARCHAR(32), pcount int);
+INSERT INTO t1 SELECT * FROM t0;
+FOR i IN 0..(parts-1)
+DO
+BEGIN
+DECLARE query_template TEXT DEFAULT 'INSERT INTO t1_pstat VALUES (''p0'',(SELECT COUNT(*) FROM t1 PARTITION (p0)))';
+EXECUTE IMMEDIATE REPLACE(query_template,'p0',CONCAT('p',i));
+END;
+END FOR;
+SELECT * FROM t1_pstat ORDER BY CAST(SUBSTR(pname,2,100) AS UNSIGNED);
+DROP TABLE t1,t1_pstat;
+END;
+$$
+CALL test_partition_by_key_uuid_vs_binary(7);
+query
+SELECT a_p0, COUNT(*) FROM (SELECT a AS a_p0 FROM t1 PARTITION(p0) UNION ALL SELECT CAST(a AS UUID) AS a_p0 FROM t2 PARTITION(p0)) td GROUP BY a_p0
+a_p0 COUNT(*)
+9cfd306d-307f-15ec-8d10-010bbc909b57 2
+9cfd306d-307f-15ec-8d10-080bbc909b57 2
+9cfd306d-307f-15ec-8d10-0d0bbc909b57 2
+9cfd306d-307f-15ec-8d10-250bbc909b57 2
+9cfd306d-307f-15ec-8d10-2b0bbc909b57 2
+9cfd306d-307f-15ec-8d10-300bbc909b57 2
+9cfd306d-307f-15ec-8d10-3c0bbc909b57 2
+9cfd306d-307f-15ec-8d10-480bbc909b57 2
+9cfd306d-307f-15ec-8d10-500bbc909b57 2
+9cfd306d-307f-15ec-8d10-530bbc909b57 2
+9cfd306d-307f-15ec-8d10-560bbc909b57 2
+9cfd306d-307f-15ec-8d10-570bbc909b57 2
+9cfd306d-307f-15ec-8d10-580bbc909b57 2
+9cfd306d-307f-15ec-8d10-630bbc909b57 2
+9cfd306d-307f-15ec-8d10-680bbc909b57 2
+9cfd306d-307f-15ec-8d10-6a0bbc909b57 2
+9cfd306d-307f-15ec-8d10-700bbc909b57 2
+9cfd306d-307f-15ec-8d10-7e0bbc909b57 2
+9cfd306d-307f-15ec-8d10-820bbc909b57 2
+9cfd306d-307f-15ec-8d10-8e0bbc909b57 2
+9cfd306d-307f-15ec-8d10-930bbc909b57 2
+9cfd306d-307f-15ec-8d10-970bbc909b57 2
+9cfd306d-307f-15ec-8d10-980bbc909b57 2
+9cfd306d-307f-15ec-8d10-9b0bbc909b57 2
+9cfd306d-307f-15ec-8d10-9f0bbc909b57 2
+9cfd306d-307f-15ec-8d10-a00bbc909b57 2
+9cfd306d-307f-15ec-8d10-a70bbc909b57 2
+9cfd306d-307f-15ec-8d10-a80bbc909b57 2
+9cfd306d-307f-15ec-8d10-b80bbc909b57 2
+9cfd306d-307f-15ec-8d10-c10bbc909b57 2
+9cfd306d-307f-15ec-8d10-c30bbc909b57 2
+9cfd306d-307f-15ec-8d10-c60bbc909b57 2
+9cfd306d-307f-15ec-8d10-cb0bbc909b57 2
+9cfd306d-307f-15ec-8d10-cf0bbc909b57 2
+9cfd306d-307f-15ec-8d10-d00bbc909b57 2
+9cfd306d-307f-15ec-8d10-d10bbc909b57 2
+9cfd306d-307f-16ec-8d10-d20bbc909b04 2
+9cfd306d-307f-16ec-8d10-d20bbc909b13 2
+9cfd306d-307f-16ec-8d10-d20bbc909b29 2
+9cfd306d-307f-16ec-8d10-d20bbc909b31 2
+9cfd306d-307f-16ec-8d10-d20bbc909b37 2
+9cfd306d-307f-16ec-8d10-d20bbc909b3c 2
+9cfd306d-307f-16ec-8d10-d20bbc909b45 2
+9cfd306d-307f-16ec-8d10-d20bbc909b51 2
+9cfd306d-307f-16ec-8d10-d20bbc909b56 2
+9cfd306d-307f-14ec-8d05-d20bbc909b57 2
+9cfd306d-307f-14ec-8d07-d20bbc909b57 2
+0bfd306d-307f-11ec-8d10-d20bbc909b57 2
+0dfd306d-307f-11ec-8d10-d20bbc909b57 2
+16fd306d-307f-11ec-8d10-d20bbc909b57 2
+17fd306d-307f-11ec-8d10-d20bbc909b57 2
+19fd306d-307f-11ec-8d10-d20bbc909b57 2
+34fd306d-307f-11ec-8d10-d20bbc909b57 2
+36fd306d-307f-11ec-8d10-d20bbc909b57 2
+48fd306d-307f-11ec-8d10-d20bbc909b57 2
+58fd306d-307f-11ec-8d10-d20bbc909b57 2
+61fd306d-307f-11ec-8d10-d20bbc909b57 2
+76fd306d-307f-11ec-8d10-d20bbc909b57 2
+78fd306d-307f-11ec-8d10-d20bbc909b57 2
+7efd306d-307f-11ec-8d10-d20bbc909b57 2
+7ffd306d-307f-11ec-8d10-d20bbc909b57 2
+85fd306d-307f-11ec-8d10-d20bbc909b57 2
+8ffd306d-307f-11ec-8d10-d20bbc909b57 2
+91fd306d-307f-11ec-8d10-d20bbc909b57 2
+9bfd306d-307f-11ec-8d10-d20bbc909b57 2
+affd306d-307f-11ec-8d10-d20bbc909b57 2
+b2fd306d-307f-11ec-8d10-d20bbc909b57 2
+b3fd306d-307f-11ec-8d10-d20bbc909b57 2
+b4fd306d-307f-11ec-8d10-d20bbc909b57 2
+c3fd306d-307f-11ec-8d10-d20bbc909b57 2
+cdfd306d-307f-11ec-8d10-d20bbc909b57 2
+d0fd306d-307f-11ec-8d10-d20bbc909b57 2
+d3fd306d-307f-11ec-8d10-d20bbc909b57 2
+d4fd306d-307f-11ec-8d10-d20bbc909b57 2
+e4fd306d-307f-11ec-8d10-d20bbc909b57 2
+f3fd306d-307f-11ec-8d10-d20bbc909b57 2
+f6fd306d-307f-11ec-8d10-d20bbc909b57 2
+f7fd306d-307f-11ec-8d10-d20bbc909b57 2
+9cfd306d-0e7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-177f-12ec-8d10-d20bbc909b57 2
+9cfd306d-2a7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-2b7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-347f-12ec-8d10-d20bbc909b57 2
+9cfd306d-377f-12ec-8d10-d20bbc909b57 2
+9cfd306d-3a7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-447f-12ec-8d10-d20bbc909b57 2
+9cfd306d-4b7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-527f-12ec-8d10-d20bbc909b57 2
+9cfd306d-537f-12ec-8d10-d20bbc909b57 2
+9cfd306d-547f-12ec-8d10-d20bbc909b57 2
+9cfd306d-5b7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-6d7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-727f-12ec-8d10-d20bbc909b57 2
+9cfd306d-787f-12ec-8d10-d20bbc909b57 2
+9cfd306d-7d7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-7e7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-807f-12ec-8d10-d20bbc909b57 2
+9cfd306d-8c7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-8d7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-977f-12ec-8d10-d20bbc909b57 2
+9cfd306d-987f-12ec-8d10-d20bbc909b57 2
+9cfd306d-ac7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-b07f-12ec-8d10-d20bbc909b57 2
+9cfd306d-bb7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-c07f-12ec-8d10-d20bbc909b57 2
+9cfd306d-c77f-12ec-8d10-d20bbc909b57 2
+9cfd306d-f07f-12ec-8d10-d20bbc909b57 2
+9cfd306d-f77f-12ec-8d10-d20bbc909b57 2
+9cfd306d-fd7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-307f-1300-8d10-d20bbc909b57 2
+9cfd306d-307f-1309-8d10-d20bbc909b57 2
+9cfd306d-307f-130b-8d10-d20bbc909b57 2
+9cfd306d-307f-130e-8d10-d20bbc909b57 2
+9cfd306d-307f-1313-8d10-d20bbc909b57 2
+9cfd306d-307f-1329-8d10-d20bbc909b57 2
+9cfd306d-307f-132a-8d10-d20bbc909b57 2
+9cfd306d-307f-1332-8d10-d20bbc909b57 2
+9cfd306d-307f-1336-8d10-d20bbc909b57 2
+9cfd306d-307f-1337-8d10-d20bbc909b57 2
+9cfd306d-307f-133d-8d10-d20bbc909b57 2
+9cfd306d-307f-1340-8d10-d20bbc909b57 2
+9cfd306d-307f-134d-8d10-d20bbc909b57 2
+9cfd306d-307f-1351-8d10-d20bbc909b57 2
+9cfd306d-307f-1363-8d10-d20bbc909b57 2
+9cfd306d-307f-1375-8d10-d20bbc909b57 2
+9cfd306d-307f-137d-8d10-d20bbc909b57 2
+9cfd306d-307f-137e-8d10-d20bbc909b57 2
+9cfd306d-307f-138e-8d10-d20bbc909b57 2
+9cfd306d-307f-139f-8d10-d20bbc909b57 2
+9cfd306d-307f-13a1-8d10-d20bbc909b57 2
+9cfd306d-307f-13a2-8d10-d20bbc909b57 2
+9cfd306d-307f-13b1-8d10-d20bbc909b57 2
+9cfd306d-307f-13b3-8d10-d20bbc909b57 2
+9cfd306d-307f-13b5-8d10-d20bbc909b57 2
+9cfd306d-307f-13bf-8d10-d20bbc909b57 2
+9cfd306d-307f-13d0-8d10-d20bbc909b57 2
+9cfd306d-307f-13db-8d10-d20bbc909b57 2
+9cfd306d-307f-13fe-8d10-d20bbc909b57 2
+9cfd306d-307f-16ec-8d10-d20bbc909b57 2
+9cfd306d-307f-14ec-8d27-d20bbc909b57 2
+9cfd306d-307f-14ec-8d2a-d20bbc909b57 2
+9cfd306d-307f-14ec-8d2d-d20bbc909b57 2
+9cfd306d-307f-14ec-8d30-d20bbc909b57 2
+9cfd306d-307f-14ec-8d33-d20bbc909b57 2
+9cfd306d-307f-14ec-8d36-d20bbc909b57 2
+9cfd306d-307f-14ec-8d38-d20bbc909b57 2
+9cfd306d-307f-14ec-8d40-d20bbc909b57 2
+9cfd306d-307f-14ec-8d42-d20bbc909b57 2
+9cfd306d-307f-14ec-8d4c-d20bbc909b57 2
+9cfd306d-307f-14ec-8d50-d20bbc909b57 2
+9cfd306d-307f-14ec-8d51-d20bbc909b57 2
+9cfd306d-307f-14ec-8d59-d20bbc909b57 2
+9cfd306d-307f-14ec-8d5a-d20bbc909b57 2
+9cfd306d-307f-14ec-8d63-d20bbc909b57 2
+9cfd306d-307f-14ec-8d67-d20bbc909b57 2
+9cfd306d-307f-14ec-8d68-d20bbc909b57 2
+9cfd306d-307f-14ec-8d6c-d20bbc909b57 2
+9cfd306d-307f-14ec-8d6d-d20bbc909b57 2
+9cfd306d-307f-14ec-8d75-d20bbc909b57 2
+9cfd306d-307f-14ec-8d7e-d20bbc909b57 2
+9cfd306d-307f-14ec-8d81-d20bbc909b57 2
+9cfd306d-307f-14ec-8d82-d20bbc909b57 2
+9cfd306d-307f-14ec-8d86-d20bbc909b57 2
+9cfd306d-307f-14ec-8d87-d20bbc909b57 2
+9cfd306d-307f-14ec-8d94-d20bbc909b57 2
+9cfd306d-307f-14ec-8d95-d20bbc909b57 2
+9cfd306d-307f-14ec-8d9c-d20bbc909b57 2
+9cfd306d-307f-14ec-8d9e-d20bbc909b57 2
+9cfd306d-307f-14ec-8d9f-d20bbc909b57 2
+9cfd306d-307f-14ec-8db4-d20bbc909b57 2
+9cfd306d-307f-14ec-8db9-d20bbc909b57 2
+9cfd306d-307f-14ec-8dc6-d20bbc909b57 2
+9cfd306d-307f-14ec-8dd3-d20bbc909b57 2
+9cfd306d-307f-14ec-8de1-d20bbc909b57 2
+9cfd306d-307f-14ec-8de6-d20bbc909b57 2
+9cfd306d-307f-14ec-8dee-d20bbc909b57 2
+9cfd306d-307f-14ec-8df1-d20bbc909b57 2
+9cfd306d-307f-14ec-8df6-d20bbc909b57 2
+9cfd306d-307f-14ec-8df7-d20bbc909b57 2
+9cfd306d-307f-16ec-8d10-d20bbc909b5a 2
+9cfd306d-307f-16ec-8d10-d20bbc909b69 2
+9cfd306d-307f-16ec-8d10-d20bbc909b6f 2
+9cfd306d-307f-16ec-8d10-d20bbc909b72 2
+9cfd306d-307f-16ec-8d10-d20bbc909b78 2
+9cfd306d-307f-16ec-8d10-d20bbc909b7b 2
+9cfd306d-307f-16ec-8d10-d20bbc909b82 2
+9cfd306d-307f-16ec-8d10-d20bbc909b83 2
+9cfd306d-307f-16ec-8d10-d20bbc909b8d 2
+9cfd306d-307f-16ec-8d10-d20bbc909b9b 2
+9cfd306d-307f-16ec-8d10-d20bbc909b9c 2
+9cfd306d-307f-16ec-8d10-d20bbc909ba2 2
+9cfd306d-307f-16ec-8d10-d20bbc909ba3 2
+9cfd306d-307f-16ec-8d10-d20bbc909bab 2
+9cfd306d-307f-16ec-8d10-d20bbc909bac 2
+9cfd306d-307f-16ec-8d10-d20bbc909bad 2
+9cfd306d-307f-16ec-8d10-d20bbc909bb6 2
+9cfd306d-307f-16ec-8d10-d20bbc909bd4 2
+9cfd306d-307f-16ec-8d10-d20bbc909bd8 2
+9cfd306d-307f-16ec-8d10-d20bbc909bdf 2
+9cfd306d-307f-16ec-8d10-d20bbc909be8 2
+9cfd306d-307f-16ec-8d10-d20bbc909bee 2
+9cfd306d-307f-16ec-8d10-d20bbc909bf0 2
+9cfd306d-307f-16ec-8d10-d20bbc909bf1 2
+9cfd306d-307f-16ec-8d10-d20bbc909bf2 2
+9cfd306d-307f-16ec-8d10-d20bbc909bfb 2
+9cfd306d-307f-16ec-8d10-d20bbc909bff 2
+9cfd306d-307f-15ec-8d10-d40bbc909b57 2
+9cfd306d-307f-15ec-8d10-df0bbc909b57 2
+9cfd306d-307f-15ec-8d10-e40bbc909b57 2
+9cfd306d-307f-15ec-8d10-eb0bbc909b57 2
+9cfd306d-307f-15ec-8d10-ef0bbc909b57 2
+9cfd306d-307f-15ec-8d10-f10bbc909b57 2
+9cfd306d-307f-15ec-8d10-f90bbc909b57 2
+query
+SELECT a_p1, COUNT(*) FROM (SELECT a AS a_p1 FROM t1 PARTITION(p1) UNION ALL SELECT CAST(a AS UUID) AS a_p1 FROM t2 PARTITION(p1)) td GROUP BY a_p1
+a_p1 COUNT(*)
+9cfd306d-307f-15ec-8d10-060bbc909b57 2
+9cfd306d-307f-15ec-8d10-0c0bbc909b57 2
+9cfd306d-307f-15ec-8d10-120bbc909b57 2
+9cfd306d-307f-15ec-8d10-150bbc909b57 2
+9cfd306d-307f-15ec-8d10-1a0bbc909b57 2
+9cfd306d-307f-15ec-8d10-1c0bbc909b57 2
+9cfd306d-307f-15ec-8d10-1d0bbc909b57 2
+9cfd306d-307f-15ec-8d10-1f0bbc909b57 2
+9cfd306d-307f-15ec-8d10-230bbc909b57 2
+9cfd306d-307f-15ec-8d10-2d0bbc909b57 2
+9cfd306d-307f-15ec-8d10-310bbc909b57 2
+9cfd306d-307f-15ec-8d10-3a0bbc909b57 2
+9cfd306d-307f-15ec-8d10-3e0bbc909b57 2
+9cfd306d-307f-15ec-8d10-400bbc909b57 2
+9cfd306d-307f-15ec-8d10-4c0bbc909b57 2
+9cfd306d-307f-15ec-8d10-5e0bbc909b57 2
+9cfd306d-307f-15ec-8d10-5f0bbc909b57 2
+9cfd306d-307f-15ec-8d10-7b0bbc909b57 2
+9cfd306d-307f-15ec-8d10-7d0bbc909b57 2
+9cfd306d-307f-15ec-8d10-8c0bbc909b57 2
+9cfd306d-307f-15ec-8d10-910bbc909b57 2
+9cfd306d-307f-15ec-8d10-920bbc909b57 2
+9cfd306d-307f-15ec-8d10-940bbc909b57 2
+9cfd306d-307f-15ec-8d10-950bbc909b57 2
+9cfd306d-307f-15ec-8d10-9d0bbc909b57 2
+9cfd306d-307f-15ec-8d10-a20bbc909b57 2
+9cfd306d-307f-15ec-8d10-aa0bbc909b57 2
+9cfd306d-307f-15ec-8d10-ac0bbc909b57 2
+9cfd306d-307f-15ec-8d10-af0bbc909b57 2
+9cfd306d-307f-15ec-8d10-ba0bbc909b57 2
+9cfd306d-307f-15ec-8d10-bc0bbc909b57 2
+9cfd306d-307f-15ec-8d10-c50bbc909b57 2
+9cfd306d-307f-15ec-8d10-cc0bbc909b57 2
+9cfd306d-307f-16ec-8d10-d20bbc909b05 2
+9cfd306d-307f-16ec-8d10-d20bbc909b0f 2
+9cfd306d-307f-16ec-8d10-d20bbc909b1b 2
+9cfd306d-307f-16ec-8d10-d20bbc909b2a 2
+9cfd306d-307f-16ec-8d10-d20bbc909b34 2
+9cfd306d-307f-16ec-8d10-d20bbc909b35 2
+9cfd306d-307f-16ec-8d10-d20bbc909b42 2
+00fd306d-307f-11ec-8d10-d20bbc909b57 2
+09fd306d-307f-11ec-8d10-d20bbc909b57 2
+10fd306d-307f-11ec-8d10-d20bbc909b57 2
+13fd306d-307f-11ec-8d10-d20bbc909b57 2
+1cfd306d-307f-11ec-8d10-d20bbc909b57 2
+3ffd306d-307f-11ec-8d10-d20bbc909b57 2
+45fd306d-307f-11ec-8d10-d20bbc909b57 2
+4efd306d-307f-11ec-8d10-d20bbc909b57 2
+4ffd306d-307f-11ec-8d10-d20bbc909b57 2
+50fd306d-307f-11ec-8d10-d20bbc909b57 2
+54fd306d-307f-11ec-8d10-d20bbc909b57 2
+55fd306d-307f-11ec-8d10-d20bbc909b57 2
+5bfd306d-307f-11ec-8d10-d20bbc909b57 2
+5ffd306d-307f-11ec-8d10-d20bbc909b57 2
+6ffd306d-307f-11ec-8d10-d20bbc909b57 2
+73fd306d-307f-11ec-8d10-d20bbc909b57 2
+89fd306d-307f-11ec-8d10-d20bbc909b57 2
+8cfd306d-307f-11ec-8d10-d20bbc909b57 2
+8dfd306d-307f-11ec-8d10-d20bbc909b57 2
+93fd306d-307f-11ec-8d10-d20bbc909b57 2
+94fd306d-307f-11ec-8d10-d20bbc909b57 2
+9efd306d-307f-11ec-8d10-d20bbc909b57 2
+aefd306d-307f-11ec-8d10-d20bbc909b57 2
+b0fd306d-307f-11ec-8d10-d20bbc909b57 2
+c2fd306d-307f-11ec-8d10-d20bbc909b57 2
+cbfd306d-307f-11ec-8d10-d20bbc909b57 2
+ddfd306d-307f-11ec-8d10-d20bbc909b57 2
+defd306d-307f-11ec-8d10-d20bbc909b57 2
+e5fd306d-307f-11ec-8d10-d20bbc909b57 2
+e6fd306d-307f-11ec-8d10-d20bbc909b57 2
+edfd306d-307f-11ec-8d10-d20bbc909b57 2
+f9fd306d-307f-11ec-8d10-d20bbc909b57 2
+fafd306d-307f-11ec-8d10-d20bbc909b57 2
+9cfd306d-007f-12ec-8d10-d20bbc909b57 2
+9cfd306d-037f-12ec-8d10-d20bbc909b57 2
+9cfd306d-047f-12ec-8d10-d20bbc909b57 2
+9cfd306d-057f-12ec-8d10-d20bbc909b57 2
+9cfd306d-0a7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-0b7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-117f-12ec-8d10-d20bbc909b57 2
+9cfd306d-127f-12ec-8d10-d20bbc909b57 2
+9cfd306d-1a7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-207f-12ec-8d10-d20bbc909b57 2
+9cfd306d-227f-12ec-8d10-d20bbc909b57 2
+9cfd306d-247f-12ec-8d10-d20bbc909b57 2
+9cfd306d-277f-12ec-8d10-d20bbc909b57 2
+9cfd306d-2c7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-307f-12ec-8d10-d20bbc909b57 2
+9cfd306d-317f-12ec-8d10-d20bbc909b57 2
+9cfd306d-357f-12ec-8d10-d20bbc909b57 2
+9cfd306d-3e7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-407f-12ec-8d10-d20bbc909b57 2
+9cfd306d-437f-12ec-8d10-d20bbc909b57 2
+9cfd306d-4f7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-5a7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-5d7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-657f-12ec-8d10-d20bbc909b57 2
+9cfd306d-747f-12ec-8d10-d20bbc909b57 2
+9cfd306d-817f-12ec-8d10-d20bbc909b57 2
+9cfd306d-927f-12ec-8d10-d20bbc909b57 2
+9cfd306d-967f-12ec-8d10-d20bbc909b57 2
+9cfd306d-9e7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-b97f-12ec-8d10-d20bbc909b57 2
+9cfd306d-bd7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-c67f-12ec-8d10-d20bbc909b57 2
+9cfd306d-c87f-12ec-8d10-d20bbc909b57 2
+9cfd306d-c97f-12ec-8d10-d20bbc909b57 2
+9cfd306d-d67f-12ec-8d10-d20bbc909b57 2
+9cfd306d-dd7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-e17f-12ec-8d10-d20bbc909b57 2
+9cfd306d-ea7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-f57f-12ec-8d10-d20bbc909b57 2
+9cfd306d-f87f-12ec-8d10-d20bbc909b57 2
+9cfd306d-307f-1314-8d10-d20bbc909b57 2
+9cfd306d-307f-1319-8d10-d20bbc909b57 2
+9cfd306d-307f-131e-8d10-d20bbc909b57 2
+9cfd306d-307f-1325-8d10-d20bbc909b57 2
+9cfd306d-307f-132d-8d10-d20bbc909b57 2
+9cfd306d-307f-132e-8d10-d20bbc909b57 2
+9cfd306d-307f-1330-8d10-d20bbc909b57 2
+9cfd306d-307f-1335-8d10-d20bbc909b57 2
+9cfd306d-307f-1339-8d10-d20bbc909b57 2
+9cfd306d-307f-1341-8d10-d20bbc909b57 2
+9cfd306d-307f-1345-8d10-d20bbc909b57 2
+9cfd306d-307f-1355-8d10-d20bbc909b57 2
+9cfd306d-307f-135a-8d10-d20bbc909b57 2
+9cfd306d-307f-135b-8d10-d20bbc909b57 2
+9cfd306d-307f-135c-8d10-d20bbc909b57 2
+9cfd306d-307f-1379-8d10-d20bbc909b57 2
+9cfd306d-307f-137f-8d10-d20bbc909b57 2
+9cfd306d-307f-1383-8d10-d20bbc909b57 2
+9cfd306d-307f-1388-8d10-d20bbc909b57 2
+9cfd306d-307f-1389-8d10-d20bbc909b57 2
+9cfd306d-307f-138c-8d10-d20bbc909b57 2
+9cfd306d-307f-138d-8d10-d20bbc909b57 2
+9cfd306d-307f-138f-8d10-d20bbc909b57 2
+9cfd306d-307f-1390-8d10-d20bbc909b57 2
+9cfd306d-307f-1391-8d10-d20bbc909b57 2
+9cfd306d-307f-139c-8d10-d20bbc909b57 2
+9cfd306d-307f-13a3-8d10-d20bbc909b57 2
+9cfd306d-307f-13aa-8d10-d20bbc909b57 2
+9cfd306d-307f-13ab-8d10-d20bbc909b57 2
+9cfd306d-307f-13af-8d10-d20bbc909b57 2
+9cfd306d-307f-13b4-8d10-d20bbc909b57 2
+9cfd306d-307f-13bc-8d10-d20bbc909b57 2
+9cfd306d-307f-13be-8d10-d20bbc909b57 2
+9cfd306d-307f-13c2-8d10-d20bbc909b57 2
+9cfd306d-307f-13c8-8d10-d20bbc909b57 2
+9cfd306d-307f-13cf-8d10-d20bbc909b57 2
+9cfd306d-307f-13e0-8d10-d20bbc909b57 2
+9cfd306d-307f-13e7-8d10-d20bbc909b57 2
+9cfd306d-307f-13fa-8d10-d20bbc909b57 2
+9cfd306d-307f-15ec-8d10-d20bbc909b57 2
+9cfd306d-307f-14ec-8d11-d20bbc909b57 2
+9cfd306d-307f-14ec-8d17-d20bbc909b57 2
+9cfd306d-307f-14ec-8d2c-d20bbc909b57 2
+9cfd306d-307f-14ec-8d37-d20bbc909b57 2
+9cfd306d-307f-14ec-8d3c-d20bbc909b57 2
+9cfd306d-307f-14ec-8d3e-d20bbc909b57 2
+9cfd306d-307f-14ec-8d3f-d20bbc909b57 2
+9cfd306d-307f-14ec-8d45-d20bbc909b57 2
+9cfd306d-307f-14ec-8d47-d20bbc909b57 2
+9cfd306d-307f-14ec-8d49-d20bbc909b57 2
+9cfd306d-307f-14ec-8d4e-d20bbc909b57 2
+9cfd306d-307f-14ec-8d4f-d20bbc909b57 2
+9cfd306d-307f-14ec-8d57-d20bbc909b57 2
+9cfd306d-307f-14ec-8d5e-d20bbc909b57 2
+9cfd306d-307f-14ec-8d6a-d20bbc909b57 2
+9cfd306d-307f-14ec-8d78-d20bbc909b57 2
+9cfd306d-307f-14ec-8d7b-d20bbc909b57 2
+9cfd306d-307f-14ec-8d88-d20bbc909b57 2
+9cfd306d-307f-14ec-8d89-d20bbc909b57 2
+9cfd306d-307f-14ec-8d8f-d20bbc909b57 2
+9cfd306d-307f-14ec-8d92-d20bbc909b57 2
+9cfd306d-307f-14ec-8d97-d20bbc909b57 2
+9cfd306d-307f-14ec-8da0-d20bbc909b57 2
+9cfd306d-307f-14ec-8da3-d20bbc909b57 2
+9cfd306d-307f-14ec-8da5-d20bbc909b57 2
+9cfd306d-307f-14ec-8daa-d20bbc909b57 2
+9cfd306d-307f-14ec-8db5-d20bbc909b57 2
+9cfd306d-307f-14ec-8dcc-d20bbc909b57 2
+9cfd306d-307f-14ec-8dd1-d20bbc909b57 2
+9cfd306d-307f-14ec-8dd6-d20bbc909b57 2
+9cfd306d-307f-14ec-8dda-d20bbc909b57 2
+9cfd306d-307f-14ec-8ddd-d20bbc909b57 2
+9cfd306d-307f-14ec-8df9-d20bbc909b57 2
+9cfd306d-307f-16ec-8d10-d20bbc909b65 2
+9cfd306d-307f-16ec-8d10-d20bbc909b6a 2
+9cfd306d-307f-16ec-8d10-d20bbc909b73 2
+9cfd306d-307f-16ec-8d10-d20bbc909b80 2
+9cfd306d-307f-16ec-8d10-d20bbc909b86 2
+9cfd306d-307f-16ec-8d10-d20bbc909b87 2
+9cfd306d-307f-16ec-8d10-d20bbc909b89 2
+9cfd306d-307f-16ec-8d10-d20bbc909b8e 2
+9cfd306d-307f-16ec-8d10-d20bbc909ba9 2
+9cfd306d-307f-16ec-8d10-d20bbc909bae 2
+9cfd306d-307f-16ec-8d10-d20bbc909bb0 2
+9cfd306d-307f-16ec-8d10-d20bbc909bb1 2
+9cfd306d-307f-16ec-8d10-d20bbc909bb7 2
+9cfd306d-307f-16ec-8d10-d20bbc909bbb 2
+9cfd306d-307f-16ec-8d10-d20bbc909bc6 2
+9cfd306d-307f-16ec-8d10-d20bbc909bc9 2
+9cfd306d-307f-16ec-8d10-d20bbc909bca 2
+9cfd306d-307f-16ec-8d10-d20bbc909bcf 2
+9cfd306d-307f-16ec-8d10-d20bbc909bf3 2
+9cfd306d-307f-16ec-8d10-d20bbc909bfc 2
+9cfd306d-307f-15ec-8d10-d30bbc909b57 2
+9cfd306d-307f-15ec-8d10-dc0bbc909b57 2
+9cfd306d-307f-15ec-8d10-e30bbc909b57 2
+9cfd306d-307f-15ec-8d10-e80bbc909b57 2
+9cfd306d-307f-15ec-8d10-ed0bbc909b57 2
+9cfd306d-307f-15ec-8d10-ee0bbc909b57 2
+query
+SELECT a_p2, COUNT(*) FROM (SELECT a AS a_p2 FROM t1 PARTITION(p2) UNION ALL SELECT CAST(a AS UUID) AS a_p2 FROM t2 PARTITION(p2)) td GROUP BY a_p2
+a_p2 COUNT(*)
+9cfd306d-307f-15ec-8d10-040bbc909b57 2
+9cfd306d-307f-15ec-8d10-0f0bbc909b57 2
+9cfd306d-307f-15ec-8d10-100bbc909b57 2
+9cfd306d-307f-15ec-8d10-110bbc909b57 2
+9cfd306d-307f-15ec-8d10-130bbc909b57 2
+9cfd306d-307f-15ec-8d10-180bbc909b57 2
+9cfd306d-307f-15ec-8d10-1e0bbc909b57 2
+9cfd306d-307f-15ec-8d10-320bbc909b57 2
+9cfd306d-307f-15ec-8d10-330bbc909b57 2
+9cfd306d-307f-15ec-8d10-430bbc909b57 2
+9cfd306d-307f-15ec-8d10-460bbc909b57 2
+9cfd306d-307f-15ec-8d10-520bbc909b57 2
+9cfd306d-307f-15ec-8d10-650bbc909b57 2
+9cfd306d-307f-15ec-8d10-660bbc909b57 2
+9cfd306d-307f-15ec-8d10-6e0bbc909b57 2
+9cfd306d-307f-15ec-8d10-750bbc909b57 2
+9cfd306d-307f-15ec-8d10-780bbc909b57 2
+9cfd306d-307f-15ec-8d10-790bbc909b57 2
+9cfd306d-307f-15ec-8d10-830bbc909b57 2
+9cfd306d-307f-15ec-8d10-8f0bbc909b57 2
+9cfd306d-307f-15ec-8d10-900bbc909b57 2
+9cfd306d-307f-15ec-8d10-9a0bbc909b57 2
+9cfd306d-307f-15ec-8d10-9c0bbc909b57 2
+9cfd306d-307f-15ec-8d10-a40bbc909b57 2
+9cfd306d-307f-15ec-8d10-c00bbc909b57 2
+9cfd306d-307f-15ec-8d10-c20bbc909b57 2
+9cfd306d-307f-15ec-8d10-c40bbc909b57 2
+9cfd306d-307f-15ec-8d10-cd0bbc909b57 2
+9cfd306d-307f-16ec-8d10-d20bbc909b02 2
+9cfd306d-307f-16ec-8d10-d20bbc909b0b 2
+9cfd306d-307f-16ec-8d10-d20bbc909b0d 2
+9cfd306d-307f-16ec-8d10-d20bbc909b16 2
+9cfd306d-307f-16ec-8d10-d20bbc909b1c 2
+9cfd306d-307f-16ec-8d10-d20bbc909b1f 2
+9cfd306d-307f-16ec-8d10-d20bbc909b26 2
+9cfd306d-307f-16ec-8d10-d20bbc909b27 2
+9cfd306d-307f-16ec-8d10-d20bbc909b38 2
+9cfd306d-307f-16ec-8d10-d20bbc909b3a 2
+9cfd306d-307f-16ec-8d10-d20bbc909b3f 2
+9cfd306d-307f-16ec-8d10-d20bbc909b43 2
+9cfd306d-307f-16ec-8d10-d20bbc909b46 2
+9cfd306d-307f-16ec-8d10-d20bbc909b47 2
+9cfd306d-307f-16ec-8d10-d20bbc909b49 2
+9cfd306d-307f-16ec-8d10-d20bbc909b4f 2
+9cfd306d-307f-14ec-8d01-d20bbc909b57 2
+9cfd306d-307f-14ec-8d06-d20bbc909b57 2
+9cfd306d-307f-14ec-8d0a-d20bbc909b57 2
+02fd306d-307f-11ec-8d10-d20bbc909b57 2
+07fd306d-307f-11ec-8d10-d20bbc909b57 2
+08fd306d-307f-11ec-8d10-d20bbc909b57 2
+0efd306d-307f-11ec-8d10-d20bbc909b57 2
+1afd306d-307f-11ec-8d10-d20bbc909b57 2
+20fd306d-307f-11ec-8d10-d20bbc909b57 2
+25fd306d-307f-11ec-8d10-d20bbc909b57 2
+26fd306d-307f-11ec-8d10-d20bbc909b57 2
+2afd306d-307f-11ec-8d10-d20bbc909b57 2
+2dfd306d-307f-11ec-8d10-d20bbc909b57 2
+32fd306d-307f-11ec-8d10-d20bbc909b57 2
+33fd306d-307f-11ec-8d10-d20bbc909b57 2
+3dfd306d-307f-11ec-8d10-d20bbc909b57 2
+42fd306d-307f-11ec-8d10-d20bbc909b57 2
+46fd306d-307f-11ec-8d10-d20bbc909b57 2
+4bfd306d-307f-11ec-8d10-d20bbc909b57 2
+53fd306d-307f-11ec-8d10-d20bbc909b57 2
+5afd306d-307f-11ec-8d10-d20bbc909b57 2
+65fd306d-307f-11ec-8d10-d20bbc909b57 2
+69fd306d-307f-11ec-8d10-d20bbc909b57 2
+6bfd306d-307f-11ec-8d10-d20bbc909b57 2
+7cfd306d-307f-11ec-8d10-d20bbc909b57 2
+82fd306d-307f-11ec-8d10-d20bbc909b57 2
+86fd306d-307f-11ec-8d10-d20bbc909b57 2
+99fd306d-307f-11ec-8d10-d20bbc909b57 2
+9afd306d-307f-11ec-8d10-d20bbc909b57 2
+a3fd306d-307f-11ec-8d10-d20bbc909b57 2
+aafd306d-307f-11ec-8d10-d20bbc909b57 2
+ccfd306d-307f-11ec-8d10-d20bbc909b57 2
+d5fd306d-307f-11ec-8d10-d20bbc909b57 2
+dcfd306d-307f-11ec-8d10-d20bbc909b57 2
+e0fd306d-307f-11ec-8d10-d20bbc909b57 2
+f0fd306d-307f-11ec-8d10-d20bbc909b57 2
+f1fd306d-307f-11ec-8d10-d20bbc909b57 2
+f4fd306d-307f-11ec-8d10-d20bbc909b57 2
+f8fd306d-307f-11ec-8d10-d20bbc909b57 2
+9cfd306d-097f-12ec-8d10-d20bbc909b57 2
+9cfd306d-137f-12ec-8d10-d20bbc909b57 2
+9cfd306d-267f-12ec-8d10-d20bbc909b57 2
+9cfd306d-297f-12ec-8d10-d20bbc909b57 2
+9cfd306d-4d7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-5e7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-6f7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-757f-12ec-8d10-d20bbc909b57 2
+9cfd306d-7f7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-867f-12ec-8d10-d20bbc909b57 2
+9cfd306d-897f-12ec-8d10-d20bbc909b57 2
+9cfd306d-907f-12ec-8d10-d20bbc909b57 2
+9cfd306d-937f-12ec-8d10-d20bbc909b57 2
+9cfd306d-9d7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-a77f-12ec-8d10-d20bbc909b57 2
+9cfd306d-a87f-12ec-8d10-d20bbc909b57 2
+9cfd306d-a97f-12ec-8d10-d20bbc909b57 2
+9cfd306d-ab7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-b67f-12ec-8d10-d20bbc909b57 2
+9cfd306d-b87f-12ec-8d10-d20bbc909b57 2
+9cfd306d-c47f-12ec-8d10-d20bbc909b57 2
+9cfd306d-d47f-12ec-8d10-d20bbc909b57 2
+9cfd306d-d77f-12ec-8d10-d20bbc909b57 2
+9cfd306d-d87f-12ec-8d10-d20bbc909b57 2
+9cfd306d-da7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-e37f-12ec-8d10-d20bbc909b57 2
+9cfd306d-eb7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-ec7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-ff7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-307f-131c-8d10-d20bbc909b57 2
+9cfd306d-307f-1320-8d10-d20bbc909b57 2
+9cfd306d-307f-1321-8d10-d20bbc909b57 2
+9cfd306d-307f-1327-8d10-d20bbc909b57 2
+9cfd306d-307f-1331-8d10-d20bbc909b57 2
+9cfd306d-307f-1338-8d10-d20bbc909b57 2
+9cfd306d-307f-133a-8d10-d20bbc909b57 2
+9cfd306d-307f-133b-8d10-d20bbc909b57 2
+9cfd306d-307f-133e-8d10-d20bbc909b57 2
+9cfd306d-307f-1356-8d10-d20bbc909b57 2
+9cfd306d-307f-135e-8d10-d20bbc909b57 2
+9cfd306d-307f-1361-8d10-d20bbc909b57 2
+9cfd306d-307f-1368-8d10-d20bbc909b57 2
+9cfd306d-307f-136a-8d10-d20bbc909b57 2
+9cfd306d-307f-136c-8d10-d20bbc909b57 2
+9cfd306d-307f-136e-8d10-d20bbc909b57 2
+9cfd306d-307f-136f-8d10-d20bbc909b57 2
+9cfd306d-307f-1372-8d10-d20bbc909b57 2
+9cfd306d-307f-1376-8d10-d20bbc909b57 2
+9cfd306d-307f-1381-8d10-d20bbc909b57 2
+9cfd306d-307f-1382-8d10-d20bbc909b57 2
+9cfd306d-307f-1385-8d10-d20bbc909b57 2
+9cfd306d-307f-1386-8d10-d20bbc909b57 2
+9cfd306d-307f-1387-8d10-d20bbc909b57 2
+9cfd306d-307f-138a-8d10-d20bbc909b57 2
+9cfd306d-307f-1394-8d10-d20bbc909b57 2
+9cfd306d-307f-1398-8d10-d20bbc909b57 2
+9cfd306d-307f-13a6-8d10-d20bbc909b57 2
+9cfd306d-307f-13a7-8d10-d20bbc909b57 2
+9cfd306d-307f-13b0-8d10-d20bbc909b57 2
+9cfd306d-307f-13b8-8d10-d20bbc909b57 2
+9cfd306d-307f-13ba-8d10-d20bbc909b57 2
+9cfd306d-307f-13bb-8d10-d20bbc909b57 2
+9cfd306d-307f-13c0-8d10-d20bbc909b57 2
+9cfd306d-307f-13ca-8d10-d20bbc909b57 2
+9cfd306d-307f-13ce-8d10-d20bbc909b57 2
+9cfd306d-307f-13d1-8d10-d20bbc909b57 2
+9cfd306d-307f-13d3-8d10-d20bbc909b57 2
+9cfd306d-307f-13d6-8d10-d20bbc909b57 2
+9cfd306d-307f-13d8-8d10-d20bbc909b57 2
+9cfd306d-307f-13df-8d10-d20bbc909b57 2
+9cfd306d-307f-13e9-8d10-d20bbc909b57 2
+9cfd306d-307f-13eb-8d10-d20bbc909b57 2
+9cfd306d-307f-13f5-8d10-d20bbc909b57 2
+9cfd306d-307f-13f7-8d10-d20bbc909b57 2
+9cfd306d-307f-13f9-8d10-d20bbc909b57 2
+9cfd306d-307f-13fb-8d10-d20bbc909b57 2
+9cfd306d-307f-14ec-8d2b-d20bbc909b57 2
+9cfd306d-307f-14ec-8d31-d20bbc909b57 2
+9cfd306d-307f-14ec-8d3d-d20bbc909b57 2
+9cfd306d-307f-14ec-8d44-d20bbc909b57 2
+9cfd306d-307f-14ec-8d4a-d20bbc909b57 2
+9cfd306d-307f-14ec-8d4d-d20bbc909b57 2
+9cfd306d-307f-14ec-8d61-d20bbc909b57 2
+9cfd306d-307f-14ec-8d76-d20bbc909b57 2
+9cfd306d-307f-14ec-8d7d-d20bbc909b57 2
+9cfd306d-307f-14ec-8d8d-d20bbc909b57 2
+9cfd306d-307f-14ec-8d8e-d20bbc909b57 2
+9cfd306d-307f-14ec-8d96-d20bbc909b57 2
+9cfd306d-307f-14ec-8d9b-d20bbc909b57 2
+9cfd306d-307f-14ec-8da6-d20bbc909b57 2
+9cfd306d-307f-14ec-8dab-d20bbc909b57 2
+9cfd306d-307f-14ec-8dad-d20bbc909b57 2
+9cfd306d-307f-14ec-8dba-d20bbc909b57 2
+9cfd306d-307f-14ec-8dbd-d20bbc909b57 2
+9cfd306d-307f-14ec-8dc5-d20bbc909b57 2
+9cfd306d-307f-14ec-8dc7-d20bbc909b57 2
+9cfd306d-307f-14ec-8dd4-d20bbc909b57 2
+9cfd306d-307f-14ec-8de5-d20bbc909b57 2
+9cfd306d-307f-14ec-8de8-d20bbc909b57 2
+9cfd306d-307f-14ec-8de9-d20bbc909b57 2
+9cfd306d-307f-14ec-8def-d20bbc909b57 2
+9cfd306d-307f-14ec-8df8-d20bbc909b57 2
+9cfd306d-307f-16ec-8d10-d20bbc909b58 2
+9cfd306d-307f-16ec-8d10-d20bbc909b62 2
+9cfd306d-307f-16ec-8d10-d20bbc909b63 2
+9cfd306d-307f-16ec-8d10-d20bbc909b70 2
+9cfd306d-307f-16ec-8d10-d20bbc909b7c 2
+9cfd306d-307f-16ec-8d10-d20bbc909b81 2
+9cfd306d-307f-16ec-8d10-d20bbc909b8a 2
+9cfd306d-307f-16ec-8d10-d20bbc909b8b 2
+9cfd306d-307f-16ec-8d10-d20bbc909b8c 2
+9cfd306d-307f-16ec-8d10-d20bbc909b94 2
+9cfd306d-307f-16ec-8d10-d20bbc909b95 2
+9cfd306d-307f-16ec-8d10-d20bbc909b96 2
+9cfd306d-307f-16ec-8d10-d20bbc909b9f 2
+9cfd306d-307f-16ec-8d10-d20bbc909ba7 2
+9cfd306d-307f-16ec-8d10-d20bbc909bb4 2
+9cfd306d-307f-16ec-8d10-d20bbc909bb5 2
+9cfd306d-307f-16ec-8d10-d20bbc909bbc 2
+9cfd306d-307f-16ec-8d10-d20bbc909bbf 2
+9cfd306d-307f-16ec-8d10-d20bbc909bc7 2
+9cfd306d-307f-16ec-8d10-d20bbc909bd2 2
+9cfd306d-307f-16ec-8d10-d20bbc909bdd 2
+9cfd306d-307f-16ec-8d10-d20bbc909be0 2
+9cfd306d-307f-16ec-8d10-d20bbc909be1 2
+9cfd306d-307f-16ec-8d10-d20bbc909be6 2
+9cfd306d-307f-16ec-8d10-d20bbc909bec 2
+9cfd306d-307f-16ec-8d10-d20bbc909bf9 2
+9cfd306d-307f-16ec-8d10-d20bbc909bfa 2
+9cfd306d-307f-15ec-8d10-e20bbc909b57 2
+9cfd306d-307f-15ec-8d10-ec0bbc909b57 2
+9cfd306d-307f-15ec-8d10-f70bbc909b57 2
+9cfd306d-307f-15ec-8d10-fb0bbc909b57 2
+query
+SELECT a_p3, COUNT(*) FROM (SELECT a AS a_p3 FROM t1 PARTITION(p3) UNION ALL SELECT CAST(a AS UUID) AS a_p3 FROM t2 PARTITION(p3)) td GROUP BY a_p3
+a_p3 COUNT(*)
+9cfd306d-307f-15ec-8d10-090bbc909b57 2
+9cfd306d-307f-15ec-8d10-190bbc909b57 2
+9cfd306d-307f-15ec-8d10-240bbc909b57 2
+9cfd306d-307f-15ec-8d10-260bbc909b57 2
+9cfd306d-307f-15ec-8d10-270bbc909b57 2
+9cfd306d-307f-15ec-8d10-470bbc909b57 2
+9cfd306d-307f-15ec-8d10-490bbc909b57 2
+9cfd306d-307f-15ec-8d10-510bbc909b57 2
+9cfd306d-307f-15ec-8d10-5a0bbc909b57 2
+9cfd306d-307f-15ec-8d10-5d0bbc909b57 2
+9cfd306d-307f-15ec-8d10-640bbc909b57 2
+9cfd306d-307f-15ec-8d10-740bbc909b57 2
+9cfd306d-307f-15ec-8d10-770bbc909b57 2
+9cfd306d-307f-15ec-8d10-840bbc909b57 2
+9cfd306d-307f-15ec-8d10-860bbc909b57 2
+9cfd306d-307f-15ec-8d10-880bbc909b57 2
+9cfd306d-307f-15ec-8d10-8b0bbc909b57 2
+9cfd306d-307f-15ec-8d10-990bbc909b57 2
+9cfd306d-307f-15ec-8d10-ad0bbc909b57 2
+9cfd306d-307f-15ec-8d10-b00bbc909b57 2
+9cfd306d-307f-15ec-8d10-b60bbc909b57 2
+9cfd306d-307f-15ec-8d10-b70bbc909b57 2
+9cfd306d-307f-15ec-8d10-c70bbc909b57 2
+9cfd306d-307f-15ec-8d10-ca0bbc909b57 2
+9cfd306d-307f-16ec-8d10-d20bbc909b03 2
+9cfd306d-307f-16ec-8d10-d20bbc909b0e 2
+9cfd306d-307f-16ec-8d10-d20bbc909b10 2
+9cfd306d-307f-16ec-8d10-d20bbc909b11 2
+9cfd306d-307f-16ec-8d10-d20bbc909b17 2
+9cfd306d-307f-16ec-8d10-d20bbc909b19 2
+9cfd306d-307f-16ec-8d10-d20bbc909b22 2
+9cfd306d-307f-16ec-8d10-d20bbc909b24 2
+9cfd306d-307f-16ec-8d10-d20bbc909b2d 2
+9cfd306d-307f-16ec-8d10-d20bbc909b40 2
+9cfd306d-307f-16ec-8d10-d20bbc909b4a 2
+9cfd306d-307f-16ec-8d10-d20bbc909b4d 2
+9cfd306d-307f-16ec-8d10-d20bbc909b54 2
+9cfd306d-307f-16ec-8d10-d20bbc909b55 2
+9cfd306d-307f-14ec-8d02-d20bbc909b57 2
+03fd306d-307f-11ec-8d10-d20bbc909b57 2
+04fd306d-307f-11ec-8d10-d20bbc909b57 2
+11fd306d-307f-11ec-8d10-d20bbc909b57 2
+14fd306d-307f-11ec-8d10-d20bbc909b57 2
+1bfd306d-307f-11ec-8d10-d20bbc909b57 2
+21fd306d-307f-11ec-8d10-d20bbc909b57 2
+29fd306d-307f-11ec-8d10-d20bbc909b57 2
+2bfd306d-307f-11ec-8d10-d20bbc909b57 2
+38fd306d-307f-11ec-8d10-d20bbc909b57 2
+3bfd306d-307f-11ec-8d10-d20bbc909b57 2
+3efd306d-307f-11ec-8d10-d20bbc909b57 2
+51fd306d-307f-11ec-8d10-d20bbc909b57 2
+52fd306d-307f-11ec-8d10-d20bbc909b57 2
+5cfd306d-307f-11ec-8d10-d20bbc909b57 2
+60fd306d-307f-11ec-8d10-d20bbc909b57 2
+62fd306d-307f-11ec-8d10-d20bbc909b57 2
+66fd306d-307f-11ec-8d10-d20bbc909b57 2
+6efd306d-307f-11ec-8d10-d20bbc909b57 2
+75fd306d-307f-11ec-8d10-d20bbc909b57 2
+83fd306d-307f-11ec-8d10-d20bbc909b57 2
+97fd306d-307f-11ec-8d10-d20bbc909b57 2
+a1fd306d-307f-11ec-8d10-d20bbc909b57 2
+adfd306d-307f-11ec-8d10-d20bbc909b57 2
+b7fd306d-307f-11ec-8d10-d20bbc909b57 2
+b8fd306d-307f-11ec-8d10-d20bbc909b57 2
+b9fd306d-307f-11ec-8d10-d20bbc909b57 2
+bcfd306d-307f-11ec-8d10-d20bbc909b57 2
+c7fd306d-307f-11ec-8d10-d20bbc909b57 2
+d8fd306d-307f-11ec-8d10-d20bbc909b57 2
+dbfd306d-307f-11ec-8d10-d20bbc909b57 2
+ebfd306d-307f-11ec-8d10-d20bbc909b57 2
+eefd306d-307f-11ec-8d10-d20bbc909b57 2
+fdfd306d-307f-11ec-8d10-d20bbc909b57 2
+9cfd306d-077f-12ec-8d10-d20bbc909b57 2
+9cfd306d-087f-12ec-8d10-d20bbc909b57 2
+9cfd306d-0d7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-147f-12ec-8d10-d20bbc909b57 2
+9cfd306d-187f-12ec-8d10-d20bbc909b57 2
+9cfd306d-197f-12ec-8d10-d20bbc909b57 2
+9cfd306d-1b7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-367f-12ec-8d10-d20bbc909b57 2
+9cfd306d-387f-12ec-8d10-d20bbc909b57 2
+9cfd306d-3f7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-467f-12ec-8d10-d20bbc909b57 2
+9cfd306d-517f-12ec-8d10-d20bbc909b57 2
+9cfd306d-587f-12ec-8d10-d20bbc909b57 2
+9cfd306d-617f-12ec-8d10-d20bbc909b57 2
+9cfd306d-667f-12ec-8d10-d20bbc909b57 2
+9cfd306d-6b7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-777f-12ec-8d10-d20bbc909b57 2
+9cfd306d-797f-12ec-8d10-d20bbc909b57 2
+9cfd306d-7a7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-7b7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-837f-12ec-8d10-d20bbc909b57 2
+9cfd306d-917f-12ec-8d10-d20bbc909b57 2
+9cfd306d-9a7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-a17f-12ec-8d10-d20bbc909b57 2
+9cfd306d-a47f-12ec-8d10-d20bbc909b57 2
+9cfd306d-a67f-12ec-8d10-d20bbc909b57 2
+9cfd306d-aa7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-ad7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-b17f-12ec-8d10-d20bbc909b57 2
+9cfd306d-b27f-12ec-8d10-d20bbc909b57 2
+9cfd306d-b57f-12ec-8d10-d20bbc909b57 2
+9cfd306d-bc7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-cb7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-cf7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-d17f-12ec-8d10-d20bbc909b57 2
+9cfd306d-df7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-e57f-12ec-8d10-d20bbc909b57 2
+9cfd306d-fb7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-fc7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-307f-1304-8d10-d20bbc909b57 2
+9cfd306d-307f-1310-8d10-d20bbc909b57 2
+9cfd306d-307f-1316-8d10-d20bbc909b57 2
+9cfd306d-307f-1317-8d10-d20bbc909b57 2
+9cfd306d-307f-131a-8d10-d20bbc909b57 2
+9cfd306d-307f-131b-8d10-d20bbc909b57 2
+9cfd306d-307f-131f-8d10-d20bbc909b57 2
+9cfd306d-307f-132c-8d10-d20bbc909b57 2
+9cfd306d-307f-134a-8d10-d20bbc909b57 2
+9cfd306d-307f-134c-8d10-d20bbc909b57 2
+9cfd306d-307f-134f-8d10-d20bbc909b57 2
+9cfd306d-307f-1358-8d10-d20bbc909b57 2
+9cfd306d-307f-1360-8d10-d20bbc909b57 2
+9cfd306d-307f-1365-8d10-d20bbc909b57 2
+9cfd306d-307f-1371-8d10-d20bbc909b57 2
+9cfd306d-307f-137a-8d10-d20bbc909b57 2
+9cfd306d-307f-1380-8d10-d20bbc909b57 2
+9cfd306d-307f-1384-8d10-d20bbc909b57 2
+9cfd306d-307f-1393-8d10-d20bbc909b57 2
+9cfd306d-307f-1395-8d10-d20bbc909b57 2
+9cfd306d-307f-139e-8d10-d20bbc909b57 2
+9cfd306d-307f-13a0-8d10-d20bbc909b57 2
+9cfd306d-307f-13a5-8d10-d20bbc909b57 2
+9cfd306d-307f-13a9-8d10-d20bbc909b57 2
+9cfd306d-307f-13ac-8d10-d20bbc909b57 2
+9cfd306d-307f-13ad-8d10-d20bbc909b57 2
+9cfd306d-307f-13c3-8d10-d20bbc909b57 2
+9cfd306d-307f-13cb-8d10-d20bbc909b57 2
+9cfd306d-307f-13d9-8d10-d20bbc909b57 2
+9cfd306d-307f-13dc-8d10-d20bbc909b57 2
+9cfd306d-307f-13e2-8d10-d20bbc909b57 2
+9cfd306d-307f-13e5-8d10-d20bbc909b57 2
+9cfd306d-307f-13ef-8d10-d20bbc909b57 2
+9cfd306d-307f-13f1-8d10-d20bbc909b57 2
+9cfd306d-307f-13f6-8d10-d20bbc909b57 2
+9cfd306d-307f-13fc-8d10-d20bbc909b57 2
+9cfd306d-307f-13fd-8d10-d20bbc909b57 2
+9cfd306d-307f-14ec-8d14-d20bbc909b57 2
+9cfd306d-307f-14ec-8d19-d20bbc909b57 2
+9cfd306d-307f-14ec-8d1f-d20bbc909b57 2
+9cfd306d-307f-14ec-8d23-d20bbc909b57 2
+9cfd306d-307f-14ec-8d26-d20bbc909b57 2
+9cfd306d-307f-14ec-8d28-d20bbc909b57 2
+9cfd306d-307f-14ec-8d35-d20bbc909b57 2
+9cfd306d-307f-14ec-8d39-d20bbc909b57 2
+9cfd306d-307f-14ec-8d3b-d20bbc909b57 2
+9cfd306d-307f-14ec-8d4b-d20bbc909b57 2
+9cfd306d-307f-14ec-8d56-d20bbc909b57 2
+9cfd306d-307f-14ec-8d5f-d20bbc909b57 2
+9cfd306d-307f-14ec-8d66-d20bbc909b57 2
+9cfd306d-307f-14ec-8d6b-d20bbc909b57 2
+9cfd306d-307f-14ec-8d6e-d20bbc909b57 2
+9cfd306d-307f-14ec-8d6f-d20bbc909b57 2
+9cfd306d-307f-14ec-8d8c-d20bbc909b57 2
+9cfd306d-307f-14ec-8d93-d20bbc909b57 2
+9cfd306d-307f-14ec-8dac-d20bbc909b57 2
+9cfd306d-307f-14ec-8daf-d20bbc909b57 2
+9cfd306d-307f-14ec-8db7-d20bbc909b57 2
+9cfd306d-307f-14ec-8dbb-d20bbc909b57 2
+9cfd306d-307f-14ec-8dbe-d20bbc909b57 2
+9cfd306d-307f-14ec-8dc2-d20bbc909b57 2
+9cfd306d-307f-14ec-8dd7-d20bbc909b57 2
+9cfd306d-307f-14ec-8dd9-d20bbc909b57 2
+9cfd306d-307f-14ec-8de7-d20bbc909b57 2
+9cfd306d-307f-14ec-8dea-d20bbc909b57 2
+9cfd306d-307f-14ec-8deb-d20bbc909b57 2
+9cfd306d-307f-14ec-8df5-d20bbc909b57 2
+9cfd306d-307f-14ec-8dfc-d20bbc909b57 2
+9cfd306d-307f-14ec-8dff-d20bbc909b57 2
+9cfd306d-307f-16ec-8d10-d20bbc909b5f 2
+9cfd306d-307f-16ec-8d10-d20bbc909b68 2
+9cfd306d-307f-16ec-8d10-d20bbc909b6d 2
+9cfd306d-307f-16ec-8d10-d20bbc909b6e 2
+9cfd306d-307f-16ec-8d10-d20bbc909b71 2
+9cfd306d-307f-16ec-8d10-d20bbc909b79 2
+9cfd306d-307f-16ec-8d10-d20bbc909b7a 2
+9cfd306d-307f-16ec-8d10-d20bbc909b92 2
+9cfd306d-307f-16ec-8d10-d20bbc909b97 2
+9cfd306d-307f-16ec-8d10-d20bbc909b99 2
+9cfd306d-307f-16ec-8d10-d20bbc909b9a 2
+9cfd306d-307f-16ec-8d10-d20bbc909ba6 2
+9cfd306d-307f-16ec-8d10-d20bbc909baa 2
+9cfd306d-307f-16ec-8d10-d20bbc909bb8 2
+9cfd306d-307f-16ec-8d10-d20bbc909bb9 2
+9cfd306d-307f-16ec-8d10-d20bbc909bba 2
+9cfd306d-307f-16ec-8d10-d20bbc909bc2 2
+9cfd306d-307f-16ec-8d10-d20bbc909bc3 2
+9cfd306d-307f-16ec-8d10-d20bbc909bc4 2
+9cfd306d-307f-16ec-8d10-d20bbc909bcd 2
+9cfd306d-307f-16ec-8d10-d20bbc909bd3 2
+9cfd306d-307f-16ec-8d10-d20bbc909bd6 2
+9cfd306d-307f-16ec-8d10-d20bbc909bde 2
+9cfd306d-307f-16ec-8d10-d20bbc909beb 2
+9cfd306d-307f-16ec-8d10-d20bbc909bf6 2
+9cfd306d-307f-16ec-8d10-d20bbc909bfe 2
+9cfd306d-307f-15ec-8d10-d70bbc909b57 2
+9cfd306d-307f-15ec-8d10-d80bbc909b57 2
+9cfd306d-307f-15ec-8d10-dd0bbc909b57 2
+9cfd306d-307f-15ec-8d10-de0bbc909b57 2
+9cfd306d-307f-15ec-8d10-e00bbc909b57 2
+9cfd306d-307f-15ec-8d10-ea0bbc909b57 2
+9cfd306d-307f-15ec-8d10-f60bbc909b57 2
+9cfd306d-307f-15ec-8d10-fa0bbc909b57 2
+9cfd306d-307f-15ec-8d10-fd0bbc909b57 2
+9cfd306d-307f-15ec-8d10-ff0bbc909b57 2
+query
+SELECT a_p4, COUNT(*) FROM (SELECT a AS a_p4 FROM t1 PARTITION(p4) UNION ALL SELECT CAST(a AS UUID) AS a_p4 FROM t2 PARTITION(p4)) td GROUP BY a_p4
+a_p4 COUNT(*)
+9cfd306d-307f-15ec-8d10-000bbc909b57 2
+9cfd306d-307f-15ec-8d10-020bbc909b57 2
+9cfd306d-307f-15ec-8d10-030bbc909b57 2
+9cfd306d-307f-15ec-8d10-050bbc909b57 2
+9cfd306d-307f-15ec-8d10-220bbc909b57 2
+9cfd306d-307f-15ec-8d10-2c0bbc909b57 2
+9cfd306d-307f-15ec-8d10-340bbc909b57 2
+9cfd306d-307f-15ec-8d10-370bbc909b57 2
+9cfd306d-307f-15ec-8d10-380bbc909b57 2
+9cfd306d-307f-15ec-8d10-3d0bbc909b57 2
+9cfd306d-307f-15ec-8d10-440bbc909b57 2
+9cfd306d-307f-15ec-8d10-4a0bbc909b57 2
+9cfd306d-307f-15ec-8d10-4d0bbc909b57 2
+9cfd306d-307f-15ec-8d10-4f0bbc909b57 2
+9cfd306d-307f-15ec-8d10-5c0bbc909b57 2
+9cfd306d-307f-15ec-8d10-610bbc909b57 2
+9cfd306d-307f-15ec-8d10-6c0bbc909b57 2
+9cfd306d-307f-15ec-8d10-6d0bbc909b57 2
+9cfd306d-307f-15ec-8d10-6f0bbc909b57 2
+9cfd306d-307f-15ec-8d10-710bbc909b57 2
+9cfd306d-307f-15ec-8d10-7c0bbc909b57 2
+9cfd306d-307f-15ec-8d10-800bbc909b57 2
+9cfd306d-307f-15ec-8d10-850bbc909b57 2
+9cfd306d-307f-15ec-8d10-890bbc909b57 2
+9cfd306d-307f-15ec-8d10-a50bbc909b57 2
+9cfd306d-307f-15ec-8d10-a90bbc909b57 2
+9cfd306d-307f-15ec-8d10-c90bbc909b57 2
+9cfd306d-307f-16ec-8d10-d20bbc909b00 2
+9cfd306d-307f-16ec-8d10-d20bbc909b06 2
+9cfd306d-307f-16ec-8d10-d20bbc909b07 2
+9cfd306d-307f-16ec-8d10-d20bbc909b09 2
+9cfd306d-307f-16ec-8d10-d20bbc909b14 2
+9cfd306d-307f-16ec-8d10-d20bbc909b1a 2
+9cfd306d-307f-16ec-8d10-d20bbc909b25 2
+9cfd306d-307f-16ec-8d10-d20bbc909b28 2
+9cfd306d-307f-16ec-8d10-d20bbc909b2e 2
+9cfd306d-307f-16ec-8d10-d20bbc909b2f 2
+9cfd306d-307f-16ec-8d10-d20bbc909b32 2
+9cfd306d-307f-16ec-8d10-d20bbc909b41 2
+9cfd306d-307f-16ec-8d10-d20bbc909b50 2
+9cfd306d-307f-16ec-8d10-d20bbc909b52 2
+9cfd306d-307f-14ec-8d0f-d20bbc909b57 2
+0ffd306d-307f-11ec-8d10-d20bbc909b57 2
+15fd306d-307f-11ec-8d10-d20bbc909b57 2
+1dfd306d-307f-11ec-8d10-d20bbc909b57 2
+23fd306d-307f-11ec-8d10-d20bbc909b57 2
+24fd306d-307f-11ec-8d10-d20bbc909b57 2
+28fd306d-307f-11ec-8d10-d20bbc909b57 2
+2cfd306d-307f-11ec-8d10-d20bbc909b57 2
+2ffd306d-307f-11ec-8d10-d20bbc909b57 2
+35fd306d-307f-11ec-8d10-d20bbc909b57 2
+37fd306d-307f-11ec-8d10-d20bbc909b57 2
+43fd306d-307f-11ec-8d10-d20bbc909b57 2
+44fd306d-307f-11ec-8d10-d20bbc909b57 2
+49fd306d-307f-11ec-8d10-d20bbc909b57 2
+4dfd306d-307f-11ec-8d10-d20bbc909b57 2
+59fd306d-307f-11ec-8d10-d20bbc909b57 2
+63fd306d-307f-11ec-8d10-d20bbc909b57 2
+64fd306d-307f-11ec-8d10-d20bbc909b57 2
+67fd306d-307f-11ec-8d10-d20bbc909b57 2
+6afd306d-307f-11ec-8d10-d20bbc909b57 2
+70fd306d-307f-11ec-8d10-d20bbc909b57 2
+72fd306d-307f-11ec-8d10-d20bbc909b57 2
+79fd306d-307f-11ec-8d10-d20bbc909b57 2
+7afd306d-307f-11ec-8d10-d20bbc909b57 2
+81fd306d-307f-11ec-8d10-d20bbc909b57 2
+8afd306d-307f-11ec-8d10-d20bbc909b57 2
+8bfd306d-307f-11ec-8d10-d20bbc909b57 2
+96fd306d-307f-11ec-8d10-d20bbc909b57 2
+98fd306d-307f-11ec-8d10-d20bbc909b57 2
+a6fd306d-307f-11ec-8d10-d20bbc909b57 2
+abfd306d-307f-11ec-8d10-d20bbc909b57 2
+acfd306d-307f-11ec-8d10-d20bbc909b57 2
+b1fd306d-307f-11ec-8d10-d20bbc909b57 2
+b5fd306d-307f-11ec-8d10-d20bbc909b57 2
+bbfd306d-307f-11ec-8d10-d20bbc909b57 2
+bdfd306d-307f-11ec-8d10-d20bbc909b57 2
+bffd306d-307f-11ec-8d10-d20bbc909b57 2
+c0fd306d-307f-11ec-8d10-d20bbc909b57 2
+c4fd306d-307f-11ec-8d10-d20bbc909b57 2
+c6fd306d-307f-11ec-8d10-d20bbc909b57 2
+c9fd306d-307f-11ec-8d10-d20bbc909b57 2
+d1fd306d-307f-11ec-8d10-d20bbc909b57 2
+d6fd306d-307f-11ec-8d10-d20bbc909b57 2
+d9fd306d-307f-11ec-8d10-d20bbc909b57 2
+dafd306d-307f-11ec-8d10-d20bbc909b57 2
+e8fd306d-307f-11ec-8d10-d20bbc909b57 2
+eafd306d-307f-11ec-8d10-d20bbc909b57 2
+effd306d-307f-11ec-8d10-d20bbc909b57 2
+f5fd306d-307f-11ec-8d10-d20bbc909b57 2
+fbfd306d-307f-11ec-8d10-d20bbc909b57 2
+fcfd306d-307f-11ec-8d10-d20bbc909b57 2
+fefd306d-307f-11ec-8d10-d20bbc909b57 2
+9cfd306d-017f-12ec-8d10-d20bbc909b57 2
+9cfd306d-067f-12ec-8d10-d20bbc909b57 2
+9cfd306d-0f7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-107f-12ec-8d10-d20bbc909b57 2
+9cfd306d-167f-12ec-8d10-d20bbc909b57 2
+9cfd306d-1c7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-217f-12ec-8d10-d20bbc909b57 2
+9cfd306d-237f-12ec-8d10-d20bbc909b57 2
+9cfd306d-2e7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-327f-12ec-8d10-d20bbc909b57 2
+9cfd306d-3c7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-3d7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-417f-12ec-8d10-d20bbc909b57 2
+9cfd306d-4a7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-4c7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-4e7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-507f-12ec-8d10-d20bbc909b57 2
+9cfd306d-597f-12ec-8d10-d20bbc909b57 2
+9cfd306d-607f-12ec-8d10-d20bbc909b57 2
+9cfd306d-627f-12ec-8d10-d20bbc909b57 2
+9cfd306d-637f-12ec-8d10-d20bbc909b57 2
+9cfd306d-677f-12ec-8d10-d20bbc909b57 2
+9cfd306d-697f-12ec-8d10-d20bbc909b57 2
+9cfd306d-6c7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-737f-12ec-8d10-d20bbc909b57 2
+9cfd306d-767f-12ec-8d10-d20bbc909b57 2
+9cfd306d-7c7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-827f-12ec-8d10-d20bbc909b57 2
+9cfd306d-847f-12ec-8d10-d20bbc909b57 2
+9cfd306d-8b7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-8e7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-997f-12ec-8d10-d20bbc909b57 2
+9cfd306d-9f7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-a27f-12ec-8d10-d20bbc909b57 2
+9cfd306d-af7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-ba7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-be7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-c37f-12ec-8d10-d20bbc909b57 2
+9cfd306d-ce7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-d97f-12ec-8d10-d20bbc909b57 2
+9cfd306d-db7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-e47f-12ec-8d10-d20bbc909b57 2
+9cfd306d-ee7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-fa7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-fe7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-307f-1302-8d10-d20bbc909b57 2
+9cfd306d-307f-1303-8d10-d20bbc909b57 2
+9cfd306d-307f-1308-8d10-d20bbc909b57 2
+9cfd306d-307f-130d-8d10-d20bbc909b57 2
+9cfd306d-307f-130f-8d10-d20bbc909b57 2
+9cfd306d-307f-1311-8d10-d20bbc909b57 2
+9cfd306d-307f-1315-8d10-d20bbc909b57 2
+9cfd306d-307f-1318-8d10-d20bbc909b57 2
+9cfd306d-307f-1326-8d10-d20bbc909b57 2
+9cfd306d-307f-132f-8d10-d20bbc909b57 2
+9cfd306d-307f-1333-8d10-d20bbc909b57 2
+9cfd306d-307f-1342-8d10-d20bbc909b57 2
+9cfd306d-307f-1344-8d10-d20bbc909b57 2
+9cfd306d-307f-134b-8d10-d20bbc909b57 2
+9cfd306d-307f-134e-8d10-d20bbc909b57 2
+9cfd306d-307f-1350-8d10-d20bbc909b57 2
+9cfd306d-307f-1354-8d10-d20bbc909b57 2
+9cfd306d-307f-1357-8d10-d20bbc909b57 2
+9cfd306d-307f-1369-8d10-d20bbc909b57 2
+9cfd306d-307f-1370-8d10-d20bbc909b57 2
+9cfd306d-307f-1373-8d10-d20bbc909b57 2
+9cfd306d-307f-1378-8d10-d20bbc909b57 2
+9cfd306d-307f-1392-8d10-d20bbc909b57 2
+9cfd306d-307f-1397-8d10-d20bbc909b57 2
+9cfd306d-307f-139a-8d10-d20bbc909b57 2
+9cfd306d-307f-139d-8d10-d20bbc909b57 2
+9cfd306d-307f-13b2-8d10-d20bbc909b57 2
+9cfd306d-307f-13b7-8d10-d20bbc909b57 2
+9cfd306d-307f-13b9-8d10-d20bbc909b57 2
+9cfd306d-307f-13c1-8d10-d20bbc909b57 2
+9cfd306d-307f-13d2-8d10-d20bbc909b57 2
+9cfd306d-307f-13e3-8d10-d20bbc909b57 2
+9cfd306d-307f-13e8-8d10-d20bbc909b57 2
+9cfd306d-307f-13f0-8d10-d20bbc909b57 2
+9cfd306d-307f-13f2-8d10-d20bbc909b57 2
+9cfd306d-307f-13ff-8d10-d20bbc909b57 2
+9cfd306d-307f-14ec-8d13-d20bbc909b57 2
+9cfd306d-307f-14ec-8d1e-d20bbc909b57 2
+9cfd306d-307f-14ec-8d24-d20bbc909b57 2
+9cfd306d-307f-14ec-8d29-d20bbc909b57 2
+9cfd306d-307f-14ec-8d2e-d20bbc909b57 2
+9cfd306d-307f-14ec-8d2f-d20bbc909b57 2
+9cfd306d-307f-14ec-8d34-d20bbc909b57 2
+9cfd306d-307f-14ec-8d3a-d20bbc909b57 2
+9cfd306d-307f-14ec-8d41-d20bbc909b57 2
+9cfd306d-307f-14ec-8d46-d20bbc909b57 2
+9cfd306d-307f-14ec-8d55-d20bbc909b57 2
+9cfd306d-307f-14ec-8d5b-d20bbc909b57 2
+9cfd306d-307f-14ec-8d60-d20bbc909b57 2
+9cfd306d-307f-14ec-8d69-d20bbc909b57 2
+9cfd306d-307f-14ec-8d70-d20bbc909b57 2
+9cfd306d-307f-14ec-8d73-d20bbc909b57 2
+9cfd306d-307f-14ec-8d77-d20bbc909b57 2
+9cfd306d-307f-14ec-8d7a-d20bbc909b57 2
+9cfd306d-307f-14ec-8d80-d20bbc909b57 2
+9cfd306d-307f-14ec-8d85-d20bbc909b57 2
+9cfd306d-307f-14ec-8d8b-d20bbc909b57 2
+9cfd306d-307f-14ec-8d90-d20bbc909b57 2
+9cfd306d-307f-14ec-8d91-d20bbc909b57 2
+9cfd306d-307f-14ec-8d98-d20bbc909b57 2
+9cfd306d-307f-14ec-8d99-d20bbc909b57 2
+9cfd306d-307f-14ec-8d9d-d20bbc909b57 2
+9cfd306d-307f-14ec-8da2-d20bbc909b57 2
+9cfd306d-307f-14ec-8da4-d20bbc909b57 2
+9cfd306d-307f-14ec-8da8-d20bbc909b57 2
+9cfd306d-307f-14ec-8da9-d20bbc909b57 2
+9cfd306d-307f-14ec-8db1-d20bbc909b57 2
+9cfd306d-307f-14ec-8db6-d20bbc909b57 2
+9cfd306d-307f-14ec-8dc0-d20bbc909b57 2
+9cfd306d-307f-14ec-8dca-d20bbc909b57 2
+9cfd306d-307f-14ec-8dcb-d20bbc909b57 2
+9cfd306d-307f-14ec-8ddf-d20bbc909b57 2
+9cfd306d-307f-14ec-8de0-d20bbc909b57 2
+9cfd306d-307f-14ec-8de4-d20bbc909b57 2
+9cfd306d-307f-14ec-8ded-d20bbc909b57 2
+9cfd306d-307f-14ec-8df3-d20bbc909b57 2
+9cfd306d-307f-16ec-8d10-d20bbc909b5b 2
+9cfd306d-307f-16ec-8d10-d20bbc909b76 2
+9cfd306d-307f-16ec-8d10-d20bbc909b84 2
+9cfd306d-307f-16ec-8d10-d20bbc909b85 2
+9cfd306d-307f-16ec-8d10-d20bbc909b88 2
+9cfd306d-307f-16ec-8d10-d20bbc909b9d 2
+9cfd306d-307f-16ec-8d10-d20bbc909b9e 2
+9cfd306d-307f-16ec-8d10-d20bbc909ba0 2
+9cfd306d-307f-16ec-8d10-d20bbc909ba8 2
+9cfd306d-307f-16ec-8d10-d20bbc909bc0 2
+9cfd306d-307f-16ec-8d10-d20bbc909bc5 2
+9cfd306d-307f-16ec-8d10-d20bbc909bc8 2
+9cfd306d-307f-16ec-8d10-d20bbc909bce 2
+9cfd306d-307f-16ec-8d10-d20bbc909bd0 2
+9cfd306d-307f-16ec-8d10-d20bbc909bd1 2
+9cfd306d-307f-16ec-8d10-d20bbc909bd7 2
+9cfd306d-307f-16ec-8d10-d20bbc909bd9 2
+9cfd306d-307f-16ec-8d10-d20bbc909bda 2
+9cfd306d-307f-16ec-8d10-d20bbc909bdb 2
+9cfd306d-307f-16ec-8d10-d20bbc909be4 2
+9cfd306d-307f-16ec-8d10-d20bbc909bf7 2
+9cfd306d-307f-15ec-8d10-d60bbc909b57 2
+9cfd306d-307f-15ec-8d10-d90bbc909b57 2
+9cfd306d-307f-15ec-8d10-e10bbc909b57 2
+9cfd306d-307f-15ec-8d10-e90bbc909b57 2
+9cfd306d-307f-15ec-8d10-f80bbc909b57 2
+query
+SELECT a_p5, COUNT(*) FROM (SELECT a AS a_p5 FROM t1 PARTITION(p5) UNION ALL SELECT CAST(a AS UUID) AS a_p5 FROM t2 PARTITION(p5)) td GROUP BY a_p5
+a_p5 COUNT(*)
+9cfd306d-307f-15ec-8d10-070bbc909b57 2
+9cfd306d-307f-15ec-8d10-0a0bbc909b57 2
+9cfd306d-307f-15ec-8d10-0b0bbc909b57 2
+9cfd306d-307f-15ec-8d10-140bbc909b57 2
+9cfd306d-307f-15ec-8d10-1b0bbc909b57 2
+9cfd306d-307f-15ec-8d10-200bbc909b57 2
+9cfd306d-307f-15ec-8d10-210bbc909b57 2
+9cfd306d-307f-15ec-8d10-280bbc909b57 2
+9cfd306d-307f-15ec-8d10-2a0bbc909b57 2
+9cfd306d-307f-15ec-8d10-2f0bbc909b57 2
+9cfd306d-307f-15ec-8d10-360bbc909b57 2
+9cfd306d-307f-15ec-8d10-390bbc909b57 2
+9cfd306d-307f-15ec-8d10-3b0bbc909b57 2
+9cfd306d-307f-15ec-8d10-3f0bbc909b57 2
+9cfd306d-307f-15ec-8d10-410bbc909b57 2
+9cfd306d-307f-15ec-8d10-420bbc909b57 2
+9cfd306d-307f-15ec-8d10-4b0bbc909b57 2
+9cfd306d-307f-15ec-8d10-4e0bbc909b57 2
+9cfd306d-307f-15ec-8d10-590bbc909b57 2
+9cfd306d-307f-15ec-8d10-720bbc909b57 2
+9cfd306d-307f-15ec-8d10-760bbc909b57 2
+9cfd306d-307f-15ec-8d10-7f0bbc909b57 2
+9cfd306d-307f-15ec-8d10-810bbc909b57 2
+9cfd306d-307f-15ec-8d10-8d0bbc909b57 2
+9cfd306d-307f-15ec-8d10-960bbc909b57 2
+9cfd306d-307f-15ec-8d10-a10bbc909b57 2
+9cfd306d-307f-15ec-8d10-a30bbc909b57 2
+9cfd306d-307f-15ec-8d10-ab0bbc909b57 2
+9cfd306d-307f-15ec-8d10-ae0bbc909b57 2
+9cfd306d-307f-15ec-8d10-b10bbc909b57 2
+9cfd306d-307f-15ec-8d10-b20bbc909b57 2
+9cfd306d-307f-15ec-8d10-b30bbc909b57 2
+9cfd306d-307f-15ec-8d10-bb0bbc909b57 2
+9cfd306d-307f-15ec-8d10-be0bbc909b57 2
+9cfd306d-307f-16ec-8d10-d20bbc909b01 2
+9cfd306d-307f-16ec-8d10-d20bbc909b0a 2
+9cfd306d-307f-16ec-8d10-d20bbc909b0c 2
+9cfd306d-307f-16ec-8d10-d20bbc909b15 2
+9cfd306d-307f-16ec-8d10-d20bbc909b1d 2
+9cfd306d-307f-16ec-8d10-d20bbc909b1e 2
+9cfd306d-307f-16ec-8d10-d20bbc909b20 2
+9cfd306d-307f-16ec-8d10-d20bbc909b2b 2
+9cfd306d-307f-16ec-8d10-d20bbc909b33 2
+9cfd306d-307f-16ec-8d10-d20bbc909b36 2
+9cfd306d-307f-16ec-8d10-d20bbc909b3d 2
+9cfd306d-307f-16ec-8d10-d20bbc909b3e 2
+9cfd306d-307f-16ec-8d10-d20bbc909b48 2
+9cfd306d-307f-16ec-8d10-d20bbc909b4e 2
+9cfd306d-307f-16ec-8d10-d20bbc909b53 2
+9cfd306d-307f-14ec-8d00-d20bbc909b57 2
+9cfd306d-307f-14ec-8d04-d20bbc909b57 2
+9cfd306d-307f-14ec-8d08-d20bbc909b57 2
+9cfd306d-307f-14ec-8d0b-d20bbc909b57 2
+06fd306d-307f-11ec-8d10-d20bbc909b57 2
+0afd306d-307f-11ec-8d10-d20bbc909b57 2
+12fd306d-307f-11ec-8d10-d20bbc909b57 2
+18fd306d-307f-11ec-8d10-d20bbc909b57 2
+22fd306d-307f-11ec-8d10-d20bbc909b57 2
+27fd306d-307f-11ec-8d10-d20bbc909b57 2
+39fd306d-307f-11ec-8d10-d20bbc909b57 2
+41fd306d-307f-11ec-8d10-d20bbc909b57 2
+47fd306d-307f-11ec-8d10-d20bbc909b57 2
+4cfd306d-307f-11ec-8d10-d20bbc909b57 2
+56fd306d-307f-11ec-8d10-d20bbc909b57 2
+5dfd306d-307f-11ec-8d10-d20bbc909b57 2
+68fd306d-307f-11ec-8d10-d20bbc909b57 2
+6dfd306d-307f-11ec-8d10-d20bbc909b57 2
+77fd306d-307f-11ec-8d10-d20bbc909b57 2
+7dfd306d-307f-11ec-8d10-d20bbc909b57 2
+80fd306d-307f-11ec-8d10-d20bbc909b57 2
+84fd306d-307f-11ec-8d10-d20bbc909b57 2
+87fd306d-307f-11ec-8d10-d20bbc909b57 2
+90fd306d-307f-11ec-8d10-d20bbc909b57 2
+92fd306d-307f-11ec-8d10-d20bbc909b57 2
+95fd306d-307f-11ec-8d10-d20bbc909b57 2
+9cfd306d-307f-11ec-8d10-d20bbc909b57 2
+9dfd306d-307f-11ec-8d10-d20bbc909b57 2
+a4fd306d-307f-11ec-8d10-d20bbc909b57 2
+a5fd306d-307f-11ec-8d10-d20bbc909b57 2
+a7fd306d-307f-11ec-8d10-d20bbc909b57 2
+a8fd306d-307f-11ec-8d10-d20bbc909b57 2
+a9fd306d-307f-11ec-8d10-d20bbc909b57 2
+b6fd306d-307f-11ec-8d10-d20bbc909b57 2
+cafd306d-307f-11ec-8d10-d20bbc909b57 2
+cefd306d-307f-11ec-8d10-d20bbc909b57 2
+d2fd306d-307f-11ec-8d10-d20bbc909b57 2
+e1fd306d-307f-11ec-8d10-d20bbc909b57 2
+e2fd306d-307f-11ec-8d10-d20bbc909b57 2
+ecfd306d-307f-11ec-8d10-d20bbc909b57 2
+9cfd306d-1d7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-1e7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-257f-12ec-8d10-d20bbc909b57 2
+9cfd306d-337f-12ec-8d10-d20bbc909b57 2
+9cfd306d-457f-12ec-8d10-d20bbc909b57 2
+9cfd306d-477f-12ec-8d10-d20bbc909b57 2
+9cfd306d-487f-12ec-8d10-d20bbc909b57 2
+9cfd306d-497f-12ec-8d10-d20bbc909b57 2
+9cfd306d-557f-12ec-8d10-d20bbc909b57 2
+9cfd306d-577f-12ec-8d10-d20bbc909b57 2
+9cfd306d-647f-12ec-8d10-d20bbc909b57 2
+9cfd306d-687f-12ec-8d10-d20bbc909b57 2
+9cfd306d-6a7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-6e7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-707f-12ec-8d10-d20bbc909b57 2
+9cfd306d-717f-12ec-8d10-d20bbc909b57 2
+9cfd306d-857f-12ec-8d10-d20bbc909b57 2
+9cfd306d-8a7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-ae7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-b37f-12ec-8d10-d20bbc909b57 2
+9cfd306d-c17f-12ec-8d10-d20bbc909b57 2
+9cfd306d-cd7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-d27f-12ec-8d10-d20bbc909b57 2
+9cfd306d-dc7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-de7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-e87f-12ec-8d10-d20bbc909b57 2
+9cfd306d-ef7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-f17f-12ec-8d10-d20bbc909b57 2
+9cfd306d-307f-130a-8d10-d20bbc909b57 2
+9cfd306d-307f-1322-8d10-d20bbc909b57 2
+9cfd306d-307f-1323-8d10-d20bbc909b57 2
+9cfd306d-307f-1324-8d10-d20bbc909b57 2
+9cfd306d-307f-1328-8d10-d20bbc909b57 2
+9cfd306d-307f-132b-8d10-d20bbc909b57 2
+9cfd306d-307f-1346-8d10-d20bbc909b57 2
+9cfd306d-307f-1348-8d10-d20bbc909b57 2
+9cfd306d-307f-1352-8d10-d20bbc909b57 2
+9cfd306d-307f-1353-8d10-d20bbc909b57 2
+9cfd306d-307f-1359-8d10-d20bbc909b57 2
+9cfd306d-307f-135f-8d10-d20bbc909b57 2
+9cfd306d-307f-1366-8d10-d20bbc909b57 2
+9cfd306d-307f-1367-8d10-d20bbc909b57 2
+9cfd306d-307f-136b-8d10-d20bbc909b57 2
+9cfd306d-307f-1374-8d10-d20bbc909b57 2
+9cfd306d-307f-139b-8d10-d20bbc909b57 2
+9cfd306d-307f-13a4-8d10-d20bbc909b57 2
+9cfd306d-307f-13a8-8d10-d20bbc909b57 2
+9cfd306d-307f-13b6-8d10-d20bbc909b57 2
+9cfd306d-307f-13c5-8d10-d20bbc909b57 2
+9cfd306d-307f-13c6-8d10-d20bbc909b57 2
+9cfd306d-307f-13c7-8d10-d20bbc909b57 2
+9cfd306d-307f-13d4-8d10-d20bbc909b57 2
+9cfd306d-307f-13d5-8d10-d20bbc909b57 2
+9cfd306d-307f-13de-8d10-d20bbc909b57 2
+9cfd306d-307f-13e4-8d10-d20bbc909b57 2
+9cfd306d-307f-13ea-8d10-d20bbc909b57 2
+9cfd306d-307f-13f3-8d10-d20bbc909b57 2
+9cfd306d-307f-13f4-8d10-d20bbc909b57 2
+9cfd306d-307f-14ec-8d12-d20bbc909b57 2
+9cfd306d-307f-14ec-8d15-d20bbc909b57 2
+9cfd306d-307f-14ec-8d16-d20bbc909b57 2
+9cfd306d-307f-14ec-8d18-d20bbc909b57 2
+9cfd306d-307f-14ec-8d1a-d20bbc909b57 2
+9cfd306d-307f-14ec-8d1c-d20bbc909b57 2
+9cfd306d-307f-14ec-8d20-d20bbc909b57 2
+9cfd306d-307f-14ec-8d43-d20bbc909b57 2
+9cfd306d-307f-14ec-8d52-d20bbc909b57 2
+9cfd306d-307f-14ec-8d53-d20bbc909b57 2
+9cfd306d-307f-14ec-8d54-d20bbc909b57 2
+9cfd306d-307f-14ec-8d58-d20bbc909b57 2
+9cfd306d-307f-14ec-8d5c-d20bbc909b57 2
+9cfd306d-307f-14ec-8d65-d20bbc909b57 2
+9cfd306d-307f-14ec-8d72-d20bbc909b57 2
+9cfd306d-307f-14ec-8d74-d20bbc909b57 2
+9cfd306d-307f-14ec-8d79-d20bbc909b57 2
+9cfd306d-307f-14ec-8d7c-d20bbc909b57 2
+9cfd306d-307f-14ec-8d7f-d20bbc909b57 2
+9cfd306d-307f-14ec-8d83-d20bbc909b57 2
+9cfd306d-307f-14ec-8db3-d20bbc909b57 2
+9cfd306d-307f-14ec-8dbc-d20bbc909b57 2
+9cfd306d-307f-14ec-8dbf-d20bbc909b57 2
+9cfd306d-307f-14ec-8dc4-d20bbc909b57 2
+9cfd306d-307f-14ec-8dc9-d20bbc909b57 2
+9cfd306d-307f-14ec-8dcd-d20bbc909b57 2
+9cfd306d-307f-14ec-8dd2-d20bbc909b57 2
+9cfd306d-307f-14ec-8dd5-d20bbc909b57 2
+9cfd306d-307f-14ec-8dde-d20bbc909b57 2
+9cfd306d-307f-14ec-8dec-d20bbc909b57 2
+9cfd306d-307f-14ec-8df0-d20bbc909b57 2
+9cfd306d-307f-14ec-8df2-d20bbc909b57 2
+9cfd306d-307f-14ec-8df4-d20bbc909b57 2
+9cfd306d-307f-14ec-8dfa-d20bbc909b57 2
+9cfd306d-307f-14ec-8dfe-d20bbc909b57 2
+9cfd306d-307f-16ec-8d10-d20bbc909b5c 2
+9cfd306d-307f-16ec-8d10-d20bbc909b5d 2
+9cfd306d-307f-16ec-8d10-d20bbc909b5e 2
+9cfd306d-307f-16ec-8d10-d20bbc909b60 2
+9cfd306d-307f-16ec-8d10-d20bbc909b66 2
+9cfd306d-307f-16ec-8d10-d20bbc909b67 2
+9cfd306d-307f-16ec-8d10-d20bbc909b77 2
+9cfd306d-307f-16ec-8d10-d20bbc909b8f 2
+9cfd306d-307f-16ec-8d10-d20bbc909b93 2
+9cfd306d-307f-16ec-8d10-d20bbc909b98 2
+9cfd306d-307f-16ec-8d10-d20bbc909ba1 2
+9cfd306d-307f-16ec-8d10-d20bbc909ba4 2
+9cfd306d-307f-16ec-8d10-d20bbc909baf 2
+9cfd306d-307f-16ec-8d10-d20bbc909bb2 2
+9cfd306d-307f-16ec-8d10-d20bbc909bb3 2
+9cfd306d-307f-16ec-8d10-d20bbc909bbe 2
+9cfd306d-307f-16ec-8d10-d20bbc909bcb 2
+9cfd306d-307f-16ec-8d10-d20bbc909bcc 2
+9cfd306d-307f-16ec-8d10-d20bbc909bdc 2
+9cfd306d-307f-16ec-8d10-d20bbc909be5 2
+9cfd306d-307f-16ec-8d10-d20bbc909be7 2
+9cfd306d-307f-16ec-8d10-d20bbc909be9 2
+9cfd306d-307f-16ec-8d10-d20bbc909bef 2
+9cfd306d-307f-16ec-8d10-d20bbc909bf4 2
+9cfd306d-307f-16ec-8d10-d20bbc909bf8 2
+9cfd306d-307f-16ec-8d10-d20bbc909bfd 2
+9cfd306d-307f-15ec-8d10-e50bbc909b57 2
+9cfd306d-307f-15ec-8d10-f20bbc909b57 2
+9cfd306d-307f-15ec-8d10-f40bbc909b57 2
+9cfd306d-307f-15ec-8d10-f50bbc909b57 2
+9cfd306d-307f-15ec-8d10-fc0bbc909b57 2
+query
+SELECT a_p6, COUNT(*) FROM (SELECT a AS a_p6 FROM t1 PARTITION(p6) UNION ALL SELECT CAST(a AS UUID) AS a_p6 FROM t2 PARTITION(p6)) td GROUP BY a_p6
+a_p6 COUNT(*)
+9cfd306d-307f-15ec-8d10-0e0bbc909b57 2
+9cfd306d-307f-15ec-8d10-160bbc909b57 2
+9cfd306d-307f-15ec-8d10-170bbc909b57 2
+9cfd306d-307f-15ec-8d10-290bbc909b57 2
+9cfd306d-307f-15ec-8d10-2e0bbc909b57 2
+9cfd306d-307f-15ec-8d10-350bbc909b57 2
+9cfd306d-307f-15ec-8d10-450bbc909b57 2
+9cfd306d-307f-15ec-8d10-540bbc909b57 2
+9cfd306d-307f-15ec-8d10-550bbc909b57 2
+9cfd306d-307f-15ec-8d10-5b0bbc909b57 2
+9cfd306d-307f-15ec-8d10-600bbc909b57 2
+9cfd306d-307f-15ec-8d10-620bbc909b57 2
+9cfd306d-307f-15ec-8d10-670bbc909b57 2
+9cfd306d-307f-15ec-8d10-690bbc909b57 2
+9cfd306d-307f-15ec-8d10-6b0bbc909b57 2
+9cfd306d-307f-15ec-8d10-730bbc909b57 2
+9cfd306d-307f-15ec-8d10-7a0bbc909b57 2
+9cfd306d-307f-15ec-8d10-870bbc909b57 2
+9cfd306d-307f-15ec-8d10-8a0bbc909b57 2
+9cfd306d-307f-15ec-8d10-9e0bbc909b57 2
+9cfd306d-307f-15ec-8d10-a60bbc909b57 2
+9cfd306d-307f-15ec-8d10-b40bbc909b57 2
+9cfd306d-307f-15ec-8d10-b50bbc909b57 2
+9cfd306d-307f-15ec-8d10-b90bbc909b57 2
+9cfd306d-307f-15ec-8d10-bd0bbc909b57 2
+9cfd306d-307f-15ec-8d10-bf0bbc909b57 2
+9cfd306d-307f-15ec-8d10-c80bbc909b57 2
+9cfd306d-307f-15ec-8d10-ce0bbc909b57 2
+9cfd306d-307f-16ec-8d10-d20bbc909b08 2
+9cfd306d-307f-16ec-8d10-d20bbc909b12 2
+9cfd306d-307f-16ec-8d10-d20bbc909b18 2
+9cfd306d-307f-16ec-8d10-d20bbc909b21 2
+9cfd306d-307f-16ec-8d10-d20bbc909b23 2
+9cfd306d-307f-16ec-8d10-d20bbc909b2c 2
+9cfd306d-307f-16ec-8d10-d20bbc909b30 2
+9cfd306d-307f-16ec-8d10-d20bbc909b39 2
+9cfd306d-307f-16ec-8d10-d20bbc909b3b 2
+9cfd306d-307f-16ec-8d10-d20bbc909b44 2
+9cfd306d-307f-16ec-8d10-d20bbc909b4b 2
+9cfd306d-307f-16ec-8d10-d20bbc909b4c 2
+9cfd306d-307f-14ec-8d03-d20bbc909b57 2
+9cfd306d-307f-14ec-8d09-d20bbc909b57 2
+9cfd306d-307f-14ec-8d0c-d20bbc909b57 2
+9cfd306d-307f-14ec-8d0d-d20bbc909b57 2
+9cfd306d-307f-14ec-8d0e-d20bbc909b57 2
+01fd306d-307f-11ec-8d10-d20bbc909b57 2
+05fd306d-307f-11ec-8d10-d20bbc909b57 2
+0cfd306d-307f-11ec-8d10-d20bbc909b57 2
+1efd306d-307f-11ec-8d10-d20bbc909b57 2
+1ffd306d-307f-11ec-8d10-d20bbc909b57 2
+2efd306d-307f-11ec-8d10-d20bbc909b57 2
+30fd306d-307f-11ec-8d10-d20bbc909b57 2
+31fd306d-307f-11ec-8d10-d20bbc909b57 2
+3afd306d-307f-11ec-8d10-d20bbc909b57 2
+3cfd306d-307f-11ec-8d10-d20bbc909b57 2
+40fd306d-307f-11ec-8d10-d20bbc909b57 2
+4afd306d-307f-11ec-8d10-d20bbc909b57 2
+57fd306d-307f-11ec-8d10-d20bbc909b57 2
+5efd306d-307f-11ec-8d10-d20bbc909b57 2
+6cfd306d-307f-11ec-8d10-d20bbc909b57 2
+71fd306d-307f-11ec-8d10-d20bbc909b57 2
+74fd306d-307f-11ec-8d10-d20bbc909b57 2
+7bfd306d-307f-11ec-8d10-d20bbc909b57 2
+88fd306d-307f-11ec-8d10-d20bbc909b57 2
+8efd306d-307f-11ec-8d10-d20bbc909b57 2
+9ffd306d-307f-11ec-8d10-d20bbc909b57 2
+a0fd306d-307f-11ec-8d10-d20bbc909b57 2
+a2fd306d-307f-11ec-8d10-d20bbc909b57 2
+bafd306d-307f-11ec-8d10-d20bbc909b57 2
+befd306d-307f-11ec-8d10-d20bbc909b57 2
+c1fd306d-307f-11ec-8d10-d20bbc909b57 2
+c5fd306d-307f-11ec-8d10-d20bbc909b57 2
+c8fd306d-307f-11ec-8d10-d20bbc909b57 2
+cffd306d-307f-11ec-8d10-d20bbc909b57 2
+d7fd306d-307f-11ec-8d10-d20bbc909b57 2
+dffd306d-307f-11ec-8d10-d20bbc909b57 2
+e3fd306d-307f-11ec-8d10-d20bbc909b57 2
+e7fd306d-307f-11ec-8d10-d20bbc909b57 2
+e9fd306d-307f-11ec-8d10-d20bbc909b57 2
+f2fd306d-307f-11ec-8d10-d20bbc909b57 2
+fffd306d-307f-11ec-8d10-d20bbc909b57 2
+9cfd306d-027f-12ec-8d10-d20bbc909b57 2
+9cfd306d-0c7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-157f-12ec-8d10-d20bbc909b57 2
+9cfd306d-1f7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-287f-12ec-8d10-d20bbc909b57 2
+9cfd306d-2d7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-2f7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-397f-12ec-8d10-d20bbc909b57 2
+9cfd306d-3b7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-427f-12ec-8d10-d20bbc909b57 2
+9cfd306d-567f-12ec-8d10-d20bbc909b57 2
+9cfd306d-5c7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-5f7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-877f-12ec-8d10-d20bbc909b57 2
+9cfd306d-887f-12ec-8d10-d20bbc909b57 2
+9cfd306d-8f7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-947f-12ec-8d10-d20bbc909b57 2
+9cfd306d-957f-12ec-8d10-d20bbc909b57 2
+9cfd306d-9b7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-9c7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-a07f-12ec-8d10-d20bbc909b57 2
+9cfd306d-a37f-12ec-8d10-d20bbc909b57 2
+9cfd306d-a57f-12ec-8d10-d20bbc909b57 2
+9cfd306d-b47f-12ec-8d10-d20bbc909b57 2
+9cfd306d-b77f-12ec-8d10-d20bbc909b57 2
+9cfd306d-bf7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-c27f-12ec-8d10-d20bbc909b57 2
+9cfd306d-c57f-12ec-8d10-d20bbc909b57 2
+9cfd306d-ca7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-cc7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-d07f-12ec-8d10-d20bbc909b57 2
+9cfd306d-d37f-12ec-8d10-d20bbc909b57 2
+9cfd306d-d57f-12ec-8d10-d20bbc909b57 2
+9cfd306d-e07f-12ec-8d10-d20bbc909b57 2
+9cfd306d-e27f-12ec-8d10-d20bbc909b57 2
+9cfd306d-e67f-12ec-8d10-d20bbc909b57 2
+9cfd306d-e77f-12ec-8d10-d20bbc909b57 2
+9cfd306d-e97f-12ec-8d10-d20bbc909b57 2
+9cfd306d-ed7f-12ec-8d10-d20bbc909b57 2
+9cfd306d-f27f-12ec-8d10-d20bbc909b57 2
+9cfd306d-f37f-12ec-8d10-d20bbc909b57 2
+9cfd306d-f47f-12ec-8d10-d20bbc909b57 2
+9cfd306d-f67f-12ec-8d10-d20bbc909b57 2
+9cfd306d-f97f-12ec-8d10-d20bbc909b57 2
+9cfd306d-307f-1301-8d10-d20bbc909b57 2
+9cfd306d-307f-1305-8d10-d20bbc909b57 2
+9cfd306d-307f-1306-8d10-d20bbc909b57 2
+9cfd306d-307f-1307-8d10-d20bbc909b57 2
+9cfd306d-307f-130c-8d10-d20bbc909b57 2
+9cfd306d-307f-1312-8d10-d20bbc909b57 2
+9cfd306d-307f-131d-8d10-d20bbc909b57 2
+9cfd306d-307f-1334-8d10-d20bbc909b57 2
+9cfd306d-307f-133c-8d10-d20bbc909b57 2
+9cfd306d-307f-133f-8d10-d20bbc909b57 2
+9cfd306d-307f-1343-8d10-d20bbc909b57 2
+9cfd306d-307f-1347-8d10-d20bbc909b57 2
+9cfd306d-307f-1349-8d10-d20bbc909b57 2
+9cfd306d-307f-135d-8d10-d20bbc909b57 2
+9cfd306d-307f-1362-8d10-d20bbc909b57 2
+9cfd306d-307f-1364-8d10-d20bbc909b57 2
+9cfd306d-307f-136d-8d10-d20bbc909b57 2
+9cfd306d-307f-1377-8d10-d20bbc909b57 2
+9cfd306d-307f-137b-8d10-d20bbc909b57 2
+9cfd306d-307f-137c-8d10-d20bbc909b57 2
+9cfd306d-307f-138b-8d10-d20bbc909b57 2
+9cfd306d-307f-1396-8d10-d20bbc909b57 2
+9cfd306d-307f-1399-8d10-d20bbc909b57 2
+9cfd306d-307f-13ae-8d10-d20bbc909b57 2
+9cfd306d-307f-13bd-8d10-d20bbc909b57 2
+9cfd306d-307f-13c4-8d10-d20bbc909b57 2
+9cfd306d-307f-13c9-8d10-d20bbc909b57 2
+9cfd306d-307f-13cc-8d10-d20bbc909b57 2
+9cfd306d-307f-13cd-8d10-d20bbc909b57 2
+9cfd306d-307f-13d7-8d10-d20bbc909b57 2
+9cfd306d-307f-13da-8d10-d20bbc909b57 2
+9cfd306d-307f-13dd-8d10-d20bbc909b57 2
+9cfd306d-307f-13e1-8d10-d20bbc909b57 2
+9cfd306d-307f-13e6-8d10-d20bbc909b57 2
+9cfd306d-307f-13ec-8d10-d20bbc909b57 2
+9cfd306d-307f-13ed-8d10-d20bbc909b57 2
+9cfd306d-307f-13ee-8d10-d20bbc909b57 2
+9cfd306d-307f-13f8-8d10-d20bbc909b57 2
+9cfd306d-307f-14ec-8d10-d20bbc909b57 2
+9cfd306d-307f-14ec-8d1b-d20bbc909b57 2
+9cfd306d-307f-14ec-8d1d-d20bbc909b57 2
+9cfd306d-307f-14ec-8d21-d20bbc909b57 2
+9cfd306d-307f-14ec-8d22-d20bbc909b57 2
+9cfd306d-307f-14ec-8d25-d20bbc909b57 2
+9cfd306d-307f-14ec-8d32-d20bbc909b57 2
+9cfd306d-307f-14ec-8d48-d20bbc909b57 2
+9cfd306d-307f-14ec-8d5d-d20bbc909b57 2
+9cfd306d-307f-14ec-8d62-d20bbc909b57 2
+9cfd306d-307f-14ec-8d64-d20bbc909b57 2
+9cfd306d-307f-14ec-8d71-d20bbc909b57 2
+9cfd306d-307f-14ec-8d84-d20bbc909b57 2
+9cfd306d-307f-14ec-8d8a-d20bbc909b57 2
+9cfd306d-307f-14ec-8d9a-d20bbc909b57 2
+9cfd306d-307f-14ec-8da1-d20bbc909b57 2
+9cfd306d-307f-14ec-8da7-d20bbc909b57 2
+9cfd306d-307f-14ec-8dae-d20bbc909b57 2
+9cfd306d-307f-14ec-8db0-d20bbc909b57 2
+9cfd306d-307f-14ec-8db2-d20bbc909b57 2
+9cfd306d-307f-14ec-8db8-d20bbc909b57 2
+9cfd306d-307f-14ec-8dc1-d20bbc909b57 2
+9cfd306d-307f-14ec-8dc3-d20bbc909b57 2
+9cfd306d-307f-14ec-8dc8-d20bbc909b57 2
+9cfd306d-307f-14ec-8dce-d20bbc909b57 2
+9cfd306d-307f-14ec-8dcf-d20bbc909b57 2
+9cfd306d-307f-14ec-8dd0-d20bbc909b57 2
+9cfd306d-307f-14ec-8dd8-d20bbc909b57 2
+9cfd306d-307f-14ec-8ddb-d20bbc909b57 2
+9cfd306d-307f-14ec-8ddc-d20bbc909b57 2
+9cfd306d-307f-14ec-8de2-d20bbc909b57 2
+9cfd306d-307f-14ec-8de3-d20bbc909b57 2
+9cfd306d-307f-14ec-8dfb-d20bbc909b57 2
+9cfd306d-307f-14ec-8dfd-d20bbc909b57 2
+9cfd306d-307f-16ec-8d10-d20bbc909b59 2
+9cfd306d-307f-16ec-8d10-d20bbc909b61 2
+9cfd306d-307f-16ec-8d10-d20bbc909b64 2
+9cfd306d-307f-16ec-8d10-d20bbc909b6b 2
+9cfd306d-307f-16ec-8d10-d20bbc909b6c 2
+9cfd306d-307f-16ec-8d10-d20bbc909b74 2
+9cfd306d-307f-16ec-8d10-d20bbc909b75 2
+9cfd306d-307f-16ec-8d10-d20bbc909b7d 2
+9cfd306d-307f-16ec-8d10-d20bbc909b7e 2
+9cfd306d-307f-16ec-8d10-d20bbc909b7f 2
+9cfd306d-307f-16ec-8d10-d20bbc909b90 2
+9cfd306d-307f-16ec-8d10-d20bbc909b91 2
+9cfd306d-307f-16ec-8d10-d20bbc909ba5 2
+9cfd306d-307f-16ec-8d10-d20bbc909bbd 2
+9cfd306d-307f-16ec-8d10-d20bbc909bc1 2
+9cfd306d-307f-16ec-8d10-d20bbc909bd5 2
+9cfd306d-307f-16ec-8d10-d20bbc909be2 2
+9cfd306d-307f-16ec-8d10-d20bbc909be3 2
+9cfd306d-307f-16ec-8d10-d20bbc909bea 2
+9cfd306d-307f-16ec-8d10-d20bbc909bed 2
+9cfd306d-307f-16ec-8d10-d20bbc909bf5 2
+9cfd306d-307f-15ec-8d10-d50bbc909b57 2
+9cfd306d-307f-15ec-8d10-da0bbc909b57 2
+9cfd306d-307f-15ec-8d10-db0bbc909b57 2
+9cfd306d-307f-15ec-8d10-e60bbc909b57 2
+9cfd306d-307f-15ec-8d10-e70bbc909b57 2
+9cfd306d-307f-15ec-8d10-f00bbc909b57 2
+9cfd306d-307f-15ec-8d10-f30bbc909b57 2
+9cfd306d-307f-15ec-8d10-fe0bbc909b57 2
+CALL test_partition_by_key_pstat(7);
+pname pcount
+p0 213
+p1 212
+p2 216
+p3 216
+p4 240
+p5 213
+p6 226
+CALL test_partition_by_key_pstat(4);
+pname pcount
+p0 64
+p1 64
+p2 64
+p3 1344
+CALL test_partition_by_key_pstat(5);
+pname pcount
+p0 343
+p1 305
+p2 288
+p3 307
+p4 293
+CALL test_partition_by_key_pstat(6);
+pname pcount
+p0 47
+p1 469
+p2 38
+p3 451
+p4 43
+p5 488
+CALL test_partition_by_key_pstat(8);
+pname pcount
+p0 32
+p1 32
+p2 32
+p3 32
+p4 32
+p5 32
+p6 32
+p7 1312
+CALL test_partition_by_key_pstat(9);
+pname pcount
+p0 174
+p1 171
+p2 175
+p3 155
+p4 157
+p5 180
+p6 169
+p7 184
+p8 171
+CALL test_partition_by_key_pstat(10);
+pname pcount
+p0 23
+p1 283
+p2 31
+p3 282
+p4 27
+p5 320
+p6 22
+p7 257
+p8 25
+p9 266
+CALL test_partition_by_key_pstat(11);
+pname pcount
+p0 119
+p1 149
+p2 166
+p3 147
+p4 150
+p5 138
+p6 150
+p7 142
+p8 131
+p9 126
+p10 118
+CALL test_partition_by_key_pstat(12);
+pname pcount
+p0 23
+p1 21
+p2 19
+p3 435
+p4 22
+p5 27
+p6 24
+p7 448
+p8 19
+p9 16
+p10 21
+p11 461
+CALL test_partition_by_key_pstat(13);
+pname pcount
+p0 123
+p1 108
+p2 115
+p3 104
+p4 124
+p5 118
+p6 134
+p7 107
+p8 119
+p9 126
+p10 114
+p11 117
+p12 127
+CALL test_partition_by_key_pstat(14);
+pname pcount
+p0 17
+p1 200
+p2 22
+p3 194
+p4 21
+p5 193
+p6 14
+p7 196
+p8 12
+p9 194
+p10 22
+p11 219
+p12 20
+p13 212
+CALL test_partition_by_key_pstat(15);
+pname pcount
+p0 121
+p1 110
+p2 99
+p3 90
+p4 82
+p5 112
+p6 105
+p7 110
+p8 117
+p9 103
+p10 110
+p11 90
+p12 79
+p13 100
+p14 108
+CALL test_partition_by_key_pstat(16);
+pname pcount
+p0 16
+p1 16
+p2 16
+p3 16
+p4 16
+p5 16
+p6 16
+p7 1296
+p8 16
+p9 16
+p10 16
+p11 16
+p12 16
+p13 16
+p14 16
+p15 16
+DROP PROCEDURE test_partition_by_key_uuid_vs_binary;
+DROP PROCEDURE test_partition_by_key_pstat;
+DROP TABLE t0;
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_partition.test b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_partition.test
new file mode 100644
index 00000000000..5bd198c4e8b
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_partition.test
@@ -0,0 +1,104 @@
+--source include/have_partition.inc
+
+--echo #
+--echo # MDEV-4958 Adding datatype UUID
+--echo #
+
+SET NAMES utf8;
+
+--error ER_WRONG_TYPE_COLUMN_VALUE_ERROR
+CREATE TABLE t1 (a UUID)
+ PARTITION BY LIST COLUMNS(a)
+ (PARTITION p00 VALUES IN (10));
+
+--error ER_WRONG_TYPE_COLUMN_VALUE_ERROR
+CREATE TABLE t1 (a UUID)
+ PARTITION BY LIST COLUMNS(a)
+ (PARTITION p00 VALUES IN (TIME'10:20:30'));
+
+--error ER_TRUNCATED_WRONG_VALUE
+CREATE TABLE t1 (a UUID)
+ PARTITION BY LIST COLUMNS(a)
+ (PARTITION p00 VALUES IN ('€'));
+
+CREATE TABLE t1 (a UUID)
+ PARTITION BY LIST COLUMNS(a)
+ (PARTITION p00 VALUES IN ('123e4567-e89b-12d3-a456-426655440000'),
+ PARTITION pFF VALUES IN (0xffff000000000000000000000000ffff));
+INSERT INTO t1 VALUES ('123e4567-e89b-12d3-a456-426655440000');
+INSERT INTO t1 VALUES ('ffff0000-0000-0000-0000-00000000ffff');
+SELECT * FROM t1 PARTITION (p00);
+SELECT * FROM t1 PARTITION (pFF);
+DROP TABLE t1;
+
+
+CREATE TABLE t0 (a UUID);
+DELIMITER $$;
+FOR i IN 0..255
+DO
+ INSERT INTO t0 VALUES (REPLACE('XXfd306d-307f-11ec-8d10-d20bbc909b57','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t0 VALUES (REPLACE('9cfd306d-XX7f-12ec-8d10-d20bbc909b57','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t0 VALUES (REPLACE('9cfd306d-307f-13XX-8d10-d20bbc909b57','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t0 VALUES (REPLACE('9cfd306d-307f-14ec-8dXX-d20bbc909b57','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t0 VALUES (REPLACE('9cfd306d-307f-15ec-8d10-XX0bbc909b57','XX',LPAD(HEX(i),2,'0')));
+ INSERT INTO t0 VALUES (REPLACE('9cfd306d-307f-16ec-8d10-d20bbc909bXX','XX',LPAD(HEX(i),2,'0')));
+END FOR;
+$$
+--echo # Test that UUID and BINARY(16) implement the same distribution by key
+CREATE PROCEDURE test_partition_by_key_uuid_vs_binary(parts INT)
+BEGIN
+ EXECUTE IMMEDIATE REPLACE('CREATE TABLE t1 (a UUID) PARTITION BY KEY (a) PARTITIONS 7','7',parts);
+ EXECUTE IMMEDIATE REPLACE('CREATE TABLE t2 (a BINARY(16)) PARTITION BY KEY (a) PARTITIONS 7','7',parts);
+ INSERT INTO t1 SELECT * FROM t0;
+ INSERT INTO t2 SELECT * FROM t0;
+ FOR i IN 0..(parts-1)
+ DO
+ BEGIN
+ DECLARE query_template TEXT DEFAULT 'SELECT a_p0, COUNT(*) FROM ('
+ 'SELECT a AS a_p0 FROM t1 PARTITION(p0) '
+ 'UNION ALL '
+ 'SELECT CAST(a AS UUID) AS a_p0 FROM t2 PARTITION(p0)) td '
+ 'GROUP BY a_p0';
+ DECLARE query TEXT DEFAULT REPLACE(query_template,'p0',CONCAT('p',i));
+ SELECT query;
+ EXECUTE IMMEDIATE query;
+ END;
+ END FOR;
+ DROP TABLE t1,t2;
+END;
+$$
+--echo # Display statistics how records are distributed between partitions
+CREATE PROCEDURE test_partition_by_key_pstat(parts INT)
+BEGIN
+ EXECUTE IMMEDIATE REPLACE('CREATE TABLE t1 (a UUID) PARTITION BY KEY (a) PARTITIONS 7','7',parts);
+ CREATE TABLE t1_pstat (pname VARCHAR(32), pcount int);
+ INSERT INTO t1 SELECT * FROM t0;
+ FOR i IN 0..(parts-1)
+ DO
+ BEGIN
+ DECLARE query_template TEXT DEFAULT 'INSERT INTO t1_pstat VALUES (''p0'',(SELECT COUNT(*) FROM t1 PARTITION (p0)))';
+ EXECUTE IMMEDIATE REPLACE(query_template,'p0',CONCAT('p',i));
+ END;
+ END FOR;
+ SELECT * FROM t1_pstat ORDER BY CAST(SUBSTR(pname,2,100) AS UNSIGNED);
+ DROP TABLE t1,t1_pstat;
+END;
+$$
+DELIMITER ;$$
+CALL test_partition_by_key_uuid_vs_binary(7);
+CALL test_partition_by_key_pstat(7);
+CALL test_partition_by_key_pstat(4);
+CALL test_partition_by_key_pstat(5);
+CALL test_partition_by_key_pstat(6);
+CALL test_partition_by_key_pstat(8);
+CALL test_partition_by_key_pstat(9);
+CALL test_partition_by_key_pstat(10);
+CALL test_partition_by_key_pstat(11);
+CALL test_partition_by_key_pstat(12);
+CALL test_partition_by_key_pstat(13);
+CALL test_partition_by_key_pstat(14);
+CALL test_partition_by_key_pstat(15);
+CALL test_partition_by_key_pstat(16);
+DROP PROCEDURE test_partition_by_key_uuid_vs_binary;
+DROP PROCEDURE test_partition_by_key_pstat;
+DROP TABLE t0;
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_plugin.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_plugin.result
new file mode 100644
index 00000000000..a8fc3ca22a6
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_plugin.result
@@ -0,0 +1,31 @@
+#
+# Start of 10.5 tests
+#
+#
+# MDEV-4958 Adding datatype UUID
+#
+SELECT
+PLUGIN_NAME,
+PLUGIN_VERSION,
+PLUGIN_STATUS,
+PLUGIN_TYPE,
+PLUGIN_AUTHOR,
+PLUGIN_DESCRIPTION,
+PLUGIN_LICENSE,
+PLUGIN_MATURITY,
+PLUGIN_AUTH_VERSION
+FROM INFORMATION_SCHEMA.PLUGINS
+WHERE PLUGIN_TYPE='DATA TYPE'
+ AND PLUGIN_NAME='uuid';
+PLUGIN_NAME uuid
+PLUGIN_VERSION 1.0
+PLUGIN_STATUS ACTIVE
+PLUGIN_TYPE DATA TYPE
+PLUGIN_AUTHOR MariaDB Corporation
+PLUGIN_DESCRIPTION Data type UUID
+PLUGIN_LICENSE GPL
+PLUGIN_MATURITY Stable
+PLUGIN_AUTH_VERSION 1.0
+#
+# End of 10.5 tests
+#
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_plugin.test b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_plugin.test
new file mode 100644
index 00000000000..112105a176b
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_plugin.test
@@ -0,0 +1,27 @@
+--echo #
+--echo # Start of 10.5 tests
+--echo #
+
+--echo #
+--echo # MDEV-4958 Adding datatype UUID
+--echo #
+
+--vertical_results
+SELECT
+ PLUGIN_NAME,
+ PLUGIN_VERSION,
+ PLUGIN_STATUS,
+ PLUGIN_TYPE,
+ PLUGIN_AUTHOR,
+ PLUGIN_DESCRIPTION,
+ PLUGIN_LICENSE,
+ PLUGIN_MATURITY,
+ PLUGIN_AUTH_VERSION
+FROM INFORMATION_SCHEMA.PLUGINS
+ WHERE PLUGIN_TYPE='DATA TYPE'
+ AND PLUGIN_NAME='uuid';
+--horizontal_results
+
+--echo #
+--echo # End of 10.5 tests
+--echo #
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_stat_tables.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_stat_tables.result
new file mode 100644
index 00000000000..09784df61ff
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_stat_tables.result
@@ -0,0 +1,24 @@
+#
+# Start of 10.5 tests
+#
+#
+# MDEV-4958 Adding datatype UUID
+#
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+('123e4567-e89b-12d3-a456-426655440000'),
+('123e4567-e89b-12d3-a456-426655440001');
+ANALYZE TABLE t1 PERSISTENT FOR ALL;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+INSERT INTO t1 VALUES ('123e4567-e89b-12d3-a456-426655440002');
+SELECT * FROM t1 ORDER BY a;
+a
+123e4567-e89b-12d3-a456-426655440000
+123e4567-e89b-12d3-a456-426655440001
+123e4567-e89b-12d3-a456-426655440002
+DROP TABLE t1;
+#
+# End of 10.5 tests
+#
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_stat_tables.test b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_stat_tables.test
new file mode 100644
index 00000000000..1a39f813cba
--- /dev/null
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_stat_tables.test
@@ -0,0 +1,22 @@
+--source include/have_stat_tables.inc
+
+--echo #
+--echo # Start of 10.5 tests
+--echo #
+
+--echo #
+--echo # MDEV-4958 Adding datatype UUID
+--echo #
+
+CREATE TABLE t1 (a UUID);
+INSERT INTO t1 VALUES
+ ('123e4567-e89b-12d3-a456-426655440000'),
+ ('123e4567-e89b-12d3-a456-426655440001');
+ANALYZE TABLE t1 PERSISTENT FOR ALL;
+INSERT INTO t1 VALUES ('123e4567-e89b-12d3-a456-426655440002');
+SELECT * FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.5 tests
+--echo #
diff --git a/plugin/type_uuid/plugin.cc b/plugin/type_uuid/plugin.cc
new file mode 100644
index 00000000000..bd320a9a897
--- /dev/null
+++ b/plugin/type_uuid/plugin.cc
@@ -0,0 +1,122 @@
+/* Copyright (c) 2019,2021, 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 Foundation; version 2 of the License.
+
+ 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.
+
+ 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-1335 USA */
+
+#define MYSQL_SERVER
+#include "mariadb.h"
+#include "sql_class.h"
+#include "sql_type_uuid.h"
+#include "item_uuidfunc.h"
+#include <mysql/plugin_data_type.h>
+#include <mysql/plugin_function.h>
+
+static struct st_mariadb_data_type plugin_descriptor_type_uuid=
+{
+ MariaDB_DATA_TYPE_INTERFACE_VERSION,
+ UUIDBundle::type_handler_fbt()
+};
+
+/*************************************************************************/
+
+class Create_func_uuid : public Create_func_arg0
+{
+public:
+ Item *create_builder(THD *thd) override
+ {
+ DBUG_ENTER("Create_func_uuid::create");
+ thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION);
+ thd->lex->safe_to_cache_query= 0;
+ DBUG_RETURN(new (thd->mem_root) Item_func_uuid(thd));
+ }
+ static Create_func_uuid s_singleton;
+
+protected:
+ Create_func_uuid() {}
+ virtual ~Create_func_uuid() {}
+};
+
+
+class Create_func_sys_guid : public Create_func_arg0
+{
+public:
+ Item *create_builder(THD *thd) override
+ {
+ DBUG_ENTER("Create_func_sys_guid::create");
+ thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION);
+ thd->lex->safe_to_cache_query= 0;
+ DBUG_RETURN(new (thd->mem_root) Item_func_sys_guid(thd));
+ }
+ static Create_func_sys_guid s_singleton;
+
+protected:
+ Create_func_sys_guid() {}
+ virtual ~Create_func_sys_guid() {}
+};
+
+Create_func_uuid Create_func_uuid::s_singleton;
+Create_func_sys_guid Create_func_sys_guid::s_singleton;
+
+static Plugin_function
+ plugin_descriptor_function_uuid(&Create_func_uuid::s_singleton),
+ plugin_descriptor_function_sys_guid(&Create_func_sys_guid::s_singleton);
+
+/*************************************************************************/
+
+maria_declare_plugin(type_uuid)
+{
+ MariaDB_DATA_TYPE_PLUGIN, // the plugin type (see include/mysql/plugin.h)
+ &plugin_descriptor_type_uuid, // pointer to type-specific plugin descriptor
+ "uuid", // plugin name
+ "MariaDB Corporation", // plugin author
+ "Data type UUID", // the plugin description
+ PLUGIN_LICENSE_GPL, // the plugin license (see include/mysql/plugin.h)
+ 0, // Pointer to plugin initialization function
+ 0, // Pointer to plugin deinitialization function
+ 0x0100, // Numeric version 0xAABB means AA.BB version
+ NULL, // Status variables
+ NULL, // System variables
+ "1.0", // String version representation
+ MariaDB_PLUGIN_MATURITY_STABLE// Maturity(see include/mysql/plugin.h)*/
+},
+{
+ MariaDB_FUNCTION_PLUGIN, // the plugin type (see include/mysql/plugin.h)
+ &plugin_descriptor_function_uuid,// pointer to type-specific plugin descriptor
+ "uuid", // plugin name
+ "MariaDB Corporation", // plugin author
+ "Function UUID()", // the plugin description
+ PLUGIN_LICENSE_GPL, // the plugin license (see include/mysql/plugin.h)
+ 0, // Pointer to plugin initialization function
+ 0, // Pointer to plugin deinitialization function
+ 0x0100, // Numeric version 0xAABB means AA.BB version
+ NULL, // Status variables
+ NULL, // System variables
+ "1.0", // String version representation
+ MariaDB_PLUGIN_MATURITY_STABLE// Maturity(see include/mysql/plugin.h)*/
+},
+{
+ MariaDB_FUNCTION_PLUGIN, // the plugin type (see include/mysql/plugin.h)
+ &plugin_descriptor_function_sys_guid,// pointer to type-specific plugin descriptor
+ "sys_guid", // plugin name
+ "MariaDB Corporation", // plugin author
+ "Function SYS_GUID()", // the plugin description
+ PLUGIN_LICENSE_GPL, // the plugin license (see include/mysql/plugin.h)
+ 0, // Pointer to plugin initialization function
+ 0, // Pointer to plugin deinitialization function
+ 0x0100, // Numeric version 0xAABB means AA.BB version
+ NULL, // Status variables
+ NULL, // System variables
+ "1.0", // String version representation
+ MariaDB_PLUGIN_MATURITY_STABLE// Maturity(see include/mysql/plugin.h)*/
+}
+maria_declare_plugin_end;
diff --git a/plugin/type_uuid/sql_type_uuid.cc b/plugin/type_uuid/sql_type_uuid.cc
new file mode 100644
index 00000000000..9b4a731dbb2
--- /dev/null
+++ b/plugin/type_uuid/sql_type_uuid.cc
@@ -0,0 +1,117 @@
+/* Copyright (c) 2019,2021 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 Foundation; version 2 of the License.
+
+ 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.
+
+ 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-1335 USA */
+
+#define MYSQL_SERVER
+#include "mariadb.h"
+#include "my_net.h"
+#include "sql_class.h" // THD, SORT_FIELD_ATTR
+#include "opt_range.h" // SEL_ARG
+#include "sql_type_uuid.h"
+
+
+static bool get_digit(char ch, uint *val)
+{
+ if (ch >= '0' && ch <= '9')
+ {
+ *val= (uint) ch - '0';
+ return false;
+ }
+ if (ch >= 'a' && ch <= 'f')
+ {
+ *val= (uint) ch - 'a' + 0x0a;
+ return false;
+ }
+ if (ch >= 'A' && ch <= 'F')
+ {
+ *val= (uint) ch - 'A' + 0x0a;
+ return false;
+ }
+ return true;
+}
+
+
+static bool get_digit(uint *val, const char *str, const char *end)
+{
+ if (str >= end)
+ return true;
+ return get_digit(*str, val);
+}
+
+
+static size_t skip_hyphens(const char *str, const char *end)
+{
+ const char *str0= str;
+ for ( ; str < end; str++)
+ {
+ if (str[0] != '-')
+ break;
+ }
+ return str - str0;
+}
+
+
+static const char *get_two_digits(char *val, const char *str, const char *end)
+{
+ uint hi, lo;
+ if (get_digit(&hi, str++, end))
+ return NULL;
+ str+= skip_hyphens(str, end);
+ if (get_digit(&lo, str++, end))
+ return NULL;
+ *val= (char) ((hi << 4) + lo);
+ return str;
+}
+
+
+bool UUID::ascii_to_fbt(const char *str, size_t str_length)
+{
+ const char *end= str + str_length;
+ /*
+ The format understood:
+ - Hyphen is not allowed on the first and the last position.
+ - Otherwise, hyphens are allowed on any (odd and even) position,
+ with any amount.
+ */
+ if (str_length < 32)
+ goto err;
+
+ for (uint oidx= 0; oidx < binary_length(); oidx++)
+ {
+ if (!(str= get_two_digits(&m_buffer[oidx], str, end)))
+ goto err;
+ // Allow hypheps after two digits, but not after the last digit
+ if (oidx + 1 < binary_length())
+ str+= skip_hyphens(str, end);
+ }
+ if (str < end)
+ goto err; // Some input left
+ return false;
+err:
+ bzero(m_buffer, sizeof(m_buffer));
+ return true;
+}
+
+size_t UUID::to_string(char *dst, size_t dstsize) const
+{
+ my_uuid2str((const uchar *) m_buffer, dst, 1);
+ return MY_UUID_STRING_LENGTH;
+}
+
+
+const Name &UUID::default_value()
+{
+ static Name def(STRING_WITH_LEN("00000000-0000-0000-0000-000000000000"));
+ return def;
+}
diff --git a/plugin/type_uuid/sql_type_uuid.h b/plugin/type_uuid/sql_type_uuid.h
new file mode 100644
index 00000000000..be9fea8ebc9
--- /dev/null
+++ b/plugin/type_uuid/sql_type_uuid.h
@@ -0,0 +1,186 @@
+#ifndef SQL_TYPE_UUID_INCLUDED
+#define SQL_TYPE_UUID_INCLUDED
+
+/* Copyright (c) 2019,2021 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 Foundation; version 2 of the License.
+
+ 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.
+
+ 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-1335 USA */
+
+#include "sql_type_fixedbin_storage.h"
+class UUID: public FixedBinTypeStorage<MY_UUID_SIZE, MY_UUID_STRING_LENGTH>
+{
+public:
+ using FixedBinTypeStorage::FixedBinTypeStorage;
+ bool ascii_to_fbt(const char *str, size_t str_length);
+ size_t to_string(char *dst, size_t dstsize) const;
+ static const Name &default_value();
+
+ /*
+ Binary (in-memory) UUIDv1 representation:
+
+ llllllll-mmmm-Vhhh-vsss-nnnnnnnnnnnn
+
+ Binary sortable (in-record) representation:
+
+ nnnnnnnnnnnn-vsss-Vhhh-mmmm-llllllll
+
+ Sign Section Bits Bytes Pos PosBinSortable
+ ------------- ------- ---- ----- --- --------------
+ llllllll time low 32 4 0 12
+ mmmm time mid 16 2 4 10
+ Vhhh version and time hi 16 2 6 8
+ vsss variant and clock seq 16 2 8 6
+ nnnnnnnnnnnn node ID 48 6 10 0
+ */
+
+ class Segment
+ {
+ size_t m_memory_pos;
+ size_t m_record_pos;
+ size_t m_length;
+ public:
+ constexpr Segment(size_t memory_pos, size_t record_pos, size_t length)
+ :m_memory_pos(memory_pos), m_record_pos(record_pos), m_length(length)
+ { }
+ void memory_to_record(char *to, const char *from) const
+ {
+ memcpy(to + m_record_pos, from + m_memory_pos, m_length);
+ }
+ void record_to_memory(char *to, const char * from) const
+ {
+ memcpy(to + m_memory_pos, from + m_record_pos, m_length);
+ }
+ int cmp_memory(const char *a, const char *b) const
+ {
+ return memcmp(a + m_memory_pos, b + m_memory_pos, m_length);
+ }
+ void hash_record(const uchar *ptr, ulong *nr, ulong *nr2) const
+ {
+ my_charset_bin.hash_sort(ptr + m_record_pos, m_length, nr, nr2);
+ }
+ };
+
+ static const Segment & segment(uint i)
+ {
+ static Segment segments[]=
+ {
+ {0, 12, 4}, // llllllll
+ {4, 10, 2}, // mmmm
+ {6, 8, 2}, // Vhhh
+ {8, 6, 2}, // vsss
+ {10, 0, 6} // nnnnnnnnnnnn
+ };
+ return segments[i];
+ }
+
+ // Convert the in-memory representation to the in-record representation
+ static void memory_to_record(char *to, const char *from)
+ {
+ segment(0).memory_to_record(to, from);
+ segment(1).memory_to_record(to, from);
+ segment(2).memory_to_record(to, from);
+ segment(3).memory_to_record(to, from);
+ segment(4).memory_to_record(to, from);
+ }
+
+ // Convert the in-record representation to the in-memory representation
+ static void record_to_memory(char *to, const char *from)
+ {
+ segment(0).record_to_memory(to, from);
+ segment(1).record_to_memory(to, from);
+ segment(2).record_to_memory(to, from);
+ segment(3).record_to_memory(to, from);
+ segment(4).record_to_memory(to, from);
+ }
+
+ /*
+ Calculate a hash of the in-record representation.
+ Used in Field_uuid::hash(), e.g. for KEY partitioning. This
+ makes partition distribution for UUID and BINARY(16) equal,
+ so for example:
+
+ CREATE OR REPLACE TABLE t1 (c1 UUID) PARTITION BY KEY(c1) PARTITIONS 5;
+ INSERT INTO t1 (c1) VALUES (UUID());
+
+ and
+
+ CREATE OR REPLACE TABLE t1 (c1 BINARY(16)) PARTITION BY KEY(c1) PARTITIONS 5;
+ INSERT INTO t1 (c1) VALUES (UUID());
+
+ put values into the same partition.
+ */
+ static void hash_record(const uchar *ptr, ulong *nr, ulong *nr2)
+ {
+ segment(0).hash_record(ptr, nr, nr2);
+ segment(1).hash_record(ptr, nr, nr2);
+ segment(2).hash_record(ptr, nr, nr2);
+ segment(3).hash_record(ptr, nr, nr2);
+ segment(4).hash_record(ptr, nr, nr2);
+ }
+
+ // Compare two in-memory values
+ static int cmp(const LEX_CSTRING &a, const LEX_CSTRING &b)
+ {
+ DBUG_ASSERT(a.length == binary_length());
+ DBUG_ASSERT(b.length == binary_length());
+ int res;
+ if ((res= segment(4).cmp_memory(a.str, b.str)) ||
+ (res= segment(3).cmp_memory(a.str, b.str)) ||
+ (res= segment(2).cmp_memory(a.str, b.str)) ||
+ (res= segment(1).cmp_memory(a.str, b.str)) ||
+ (res= segment(0).cmp_memory(a.str, b.str)))
+ return res;
+ return 0;
+ }
+
+ static ulong KEY_pack_flags(uint column_nr)
+ {
+ return HA_PACK_KEY;
+ }
+
+ /*
+ Convert in-record representation to binlog representation.
+ We tranfer UUID values in binlog by compressing in-memory representation.
+ This makes replication between UUID and BINARY(16) simpler:
+
+ Transferring by compressing the in-record representation would require
+ extending the binary log format to put the extact data type name into
+ the column metadata.
+ */
+ static uchar *pack(uchar *to, const uchar *from, uint max_length)
+ {
+ uchar buf[binary_length()];
+ record_to_memory((char *) buf, (const char *) from);
+ return StringPack(&my_charset_bin, binary_length()).
+ pack(to, buf, max_length);
+ }
+
+ // Convert binlog representation to in-record representation
+ static const uchar *unpack(uchar *to,
+ const uchar *from, const uchar *from_end,
+ uint param_data)
+ {
+ uchar buf[binary_length()];
+ const uchar *rc= StringPack(&my_charset_bin, binary_length()).
+ unpack(buf, from, from_end, param_data);
+ memory_to_record((char *) to, (const char *) buf);
+ return rc;
+ }
+
+};
+
+
+#include "sql_type_fixedbin.h"
+typedef FixedBinTypeBundle<UUID> UUIDBundle;
+
+#endif // SQL_TYPE_UUID_INCLUDED
diff --git a/plugin/user_variables/mysql-test/user_variables/basic.result b/plugin/user_variables/mysql-test/user_variables/basic.result
index d0841d212ef..a47c9301c21 100644
--- a/plugin/user_variables/mysql-test/user_variables/basic.result
+++ b/plugin/user_variables/mysql-test/user_variables/basic.result
@@ -29,13 +29,13 @@ SET @dec_var=CAST(1 AS DECIMAL(20, 10));
SET @time_var=CAST('2016-02-25' AS DATE);
SET @' @#^%'='Value of variable with odd name';
SET @''='Value of variable with empty name';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '='Value of variable with empty name'' at line 1
SET @null_var=NULL;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.USER_VARIABLES;
COUNT(*)
-10
+9
SELECT * FROM INFORMATION_SCHEMA.USER_VARIABLES ORDER BY VARIABLE_NAME;
VARIABLE_NAME VARIABLE_VALUE VARIABLE_TYPE CHARACTER_SET_NAME
- Value of variable with empty name VARCHAR latin1
@#^% Value of variable with odd name VARCHAR latin1
dec_var 1.0000000000 DECIMAL latin1
double_var 1 DOUBLE latin1
@@ -47,7 +47,6 @@ uint_var 2 INT UNSIGNED latin1
utf8str_var UTF8 string value VARCHAR utf8mb3
SHOW USER_VARIABLES;
Variable_name Value
- Value of variable with empty name
@#^% Value of variable with odd name
dec_var 1.0000000000
double_var 1
diff --git a/plugin/user_variables/mysql-test/user_variables/basic.test b/plugin/user_variables/mysql-test/user_variables/basic.test
index 7e67e4fa5af..7432f6537a9 100644
--- a/plugin/user_variables/mysql-test/user_variables/basic.test
+++ b/plugin/user_variables/mysql-test/user_variables/basic.test
@@ -12,6 +12,7 @@ SET @double_var=CAST(1 AS DOUBLE);
SET @dec_var=CAST(1 AS DECIMAL(20, 10));
SET @time_var=CAST('2016-02-25' AS DATE);
SET @' @#^%'='Value of variable with odd name';
+--error ER_PARSE_ERROR
SET @''='Value of variable with empty name';
SET @null_var=NULL;
diff --git a/plugin/win_auth_client/handshake_client.cc b/plugin/win_auth_client/handshake_client.cc
index 28a228cc210..feeaae88d19 100644
--- a/plugin/win_auth_client/handshake_client.cc
+++ b/plugin/win_auth_client/handshake_client.cc
@@ -252,7 +252,7 @@ Blob Handshake_client::process_data(const Blob &data)
static byte test_buf[2048];
if (m_round == 1
- && DBUG_EVALUATE_IF("winauth_first_packet_test", true, false))
+ && DBUG_IF("winauth_first_packet_test"))
{
const char *env= getenv("TEST_PACKET_LENGTH");
size_t len= env ? atoi(env) : 0;
diff --git a/scripts/sys_schema/procedures/ps_setup_save.sql b/scripts/sys_schema/procedures/ps_setup_save.sql
index a5a2197e935..b7843ecd1f2 100644
--- a/scripts/sys_schema/procedures/ps_setup_save.sql
+++ b/scripts/sys_schema/procedures/ps_setup_save.sql
@@ -80,14 +80,11 @@ BEGIN
DROP TEMPORARY TABLE IF EXISTS tmp_setup_instruments;
DROP TEMPORARY TABLE IF EXISTS tmp_threads;
- CREATE TEMPORARY TABLE tmp_setup_actors LIKE performance_schema.setup_actors;
- CREATE TEMPORARY TABLE tmp_setup_consumers LIKE performance_schema.setup_consumers;
- CREATE TEMPORARY TABLE tmp_setup_instruments LIKE performance_schema.setup_instruments;
+ CREATE TEMPORARY TABLE tmp_setup_actors AS SELECT * FROM performance_schema.setup_actors;
+ CREATE TEMPORARY TABLE tmp_setup_consumers AS SELECT * FROM performance_schema.setup_consumers;
+ CREATE TEMPORARY TABLE tmp_setup_instruments AS SELECT * FROM performance_schema.setup_instruments;
CREATE TEMPORARY TABLE tmp_threads (THREAD_ID bigint unsigned NOT NULL PRIMARY KEY, INSTRUMENTED enum('YES','NO') NOT NULL);
- INSERT INTO tmp_setup_actors SELECT * FROM performance_schema.setup_actors;
- INSERT INTO tmp_setup_consumers SELECT * FROM performance_schema.setup_consumers;
- INSERT INTO tmp_setup_instruments SELECT * FROM performance_schema.setup_instruments;
INSERT INTO tmp_threads SELECT THREAD_ID, INSTRUMENTED FROM performance_schema.threads;
ELSE
SIGNAL SQLSTATE VALUE '90000'
diff --git a/sql-common/client.c b/sql-common/client.c
index e65367baddb..d2c6778e167 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1712,14 +1712,14 @@ static MYSQL_METHODS client_methods=
cli_use_result, /* use_result */
cli_fetch_lengths, /* fetch_lengths */
cli_flush_use_result, /* flush_use_result */
- cli_read_change_user_result /* read_change_user_result */
+ cli_read_change_user_result, /* read_change_user_result */
+ NULL /* on_close_free */
#ifndef MYSQL_SERVER
,cli_list_fields, /* list_fields */
cli_read_prepare_result, /* read_prepare_result */
cli_stmt_execute, /* stmt_execute */
cli_read_binary_rows, /* read_binary_rows */
cli_unbuffered_fetch, /* unbuffered_fetch */
- NULL, /* free_embedded_thd */
cli_read_statistics, /* read_statistics */
cli_read_query_result, /* next_result */
cli_read_binary_rows /* read_rows_from_cursor */
@@ -3321,10 +3321,8 @@ static void mysql_close_free(MYSQL *mysql)
my_free(mysql->user);
my_free(mysql->passwd);
my_free(mysql->db);
-#if defined(EMBEDDED_LIBRARY) || MYSQL_VERSION_ID >= 50100
- my_free(mysql->info_buffer);
- mysql->info_buffer= 0;
-#endif
+ if (mysql->methods && mysql->methods->on_close_free)
+ (*mysql->methods->on_close_free)(mysql);
/* Clear pointers for better safety */
mysql->host_info= mysql->user= mysql->passwd= mysql->db= 0;
}
@@ -3443,13 +3441,6 @@ void STDCALL mysql_close(MYSQL *mysql)
mysql_close_free_options(mysql);
mysql_close_free(mysql);
mysql_detach_stmt_list(&mysql->stmts, "mysql_close");
-#ifndef MYSQL_SERVER
- if (mysql->thd)
- {
- (*mysql->methods->free_embedded_thd)(mysql);
- mysql->thd= 0;
- }
-#endif
if (mysql->free_me)
my_free(mysql);
}
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 23a5062e0d4..241b482ab16 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -52,6 +52,7 @@ ENDIF()
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql
+${LIBFMT_INCLUDE_DIR}
${PCRE_INCLUDES}
${ZLIB_INCLUDE_DIR}
${SSL_INCLUDE_DIRS}
@@ -97,9 +98,9 @@ SET (SQL_SOURCE
filesort.cc gstream.cc
signal_handler.cc
handler.cc
- hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc
- item_create.cc item_func.cc item_geofunc.cc item_row.cc
- item_strfunc.cc item_subselect.cc item_sum.cc item_timefunc.cc
+ hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc
+ item_create.cc item_func.cc item_geofunc.cc item_row.cc
+ item_strfunc.cc item_subselect.cc item_sum.cc item_timefunc.cc
key.cc log.cc lock.cc
log_event.cc log_event_server.cc
rpl_record.cc rpl_reporting.cc
@@ -108,33 +109,33 @@ SET (SQL_SOURCE
mysqld.cc net_serv.cc keycaches.cc
../sql-common/client_plugin.c
opt_range.cc opt_sum.cc
- ../sql-common/pack.c parse_file.cc password.c procedure.cc
+ ../sql-common/pack.c parse_file.cc password.c procedure.cc
protocol.cc records.cc repl_failsafe.cc rpl_filter.cc
session_tracker.cc
- set_var.cc
- slave.cc sp.cc sp_cache.cc sp_head.cc sp_pcontext.cc
- sp_rcontext.cc spatial.cc sql_acl.cc sql_analyse.cc sql_base.cc
+ set_var.cc
+ slave.cc sp.cc sp_cache.cc sp_head.cc sp_pcontext.cc
+ sp_rcontext.cc spatial.cc sql_acl.cc sql_analyse.cc sql_base.cc
sql_cache.cc sql_class.cc sql_client.cc sql_crypt.cc
sql_cursor.cc sql_db.cc sql_delete.cc sql_derived.cc
- sql_digest.cc sql_do.cc
+ sql_digest.cc sql_do.cc
sql_error.cc sql_handler.cc sql_get_diagnostics.cc
- sql_help.cc sql_insert.cc sql_lex.cc
+ sql_help.cc sql_insert.cc sql_lex.cc
sql_list.cc sql_load.cc sql_manager.cc
sql_parse.cc sql_bootstrap.cc
- sql_partition.cc sql_plugin.cc sql_prepare.cc sql_rename.cc
+ sql_partition.cc sql_plugin.cc sql_prepare.cc sql_rename.cc
debug_sync.cc debug.cc
sql_repl.cc sql_select.cc sql_show.cc sql_state.c
group_by_handler.cc derived_handler.cc select_handler.cc
sql_statistics.cc sql_string.cc lex_string.h
sql_table.cc sql_test.cc sql_trigger.cc sql_udf.cc sql_union.cc
ddl_log.cc ddl_log.h
- sql_update.cc sql_view.cc strfunc.cc table.cc thr_malloc.cc
- sql_time.cc tztime.cc unireg.cc item_xmlfunc.cc
+ sql_update.cc sql_view.cc strfunc.cc table.cc thr_malloc.cc
+ sql_time.cc tztime.cc unireg.cc item_xmlfunc.cc
uniques.cc
rpl_tblmap.cc sql_binlog.cc event_scheduler.cc
event_data_objects.cc
- event_queue.cc event_db_repository.cc
- sql_tablespace.cc events.cc ../sql-common/my_user.c
+ event_queue.cc event_db_repository.cc
+ events.cc ../sql-common/my_user.c
partition_info.cc rpl_utility.cc rpl_utility_server.cc
rpl_injector.cc sql_locale.cc
rpl_rli.cc rpl_mi.cc sql_servers.cc sql_audit.cc
@@ -178,7 +179,7 @@ SET (SQL_SOURCE
${GEN_SOURCES}
${MYSYS_LIBWRAP_SOURCE}
)
-
+
IF ((CMAKE_SYSTEM_NAME MATCHES "Linux" OR
CMAKE_SYSTEM_NAME MATCHES "SunOS" OR
WIN32 OR
@@ -312,24 +313,24 @@ ENDIF()
# On Solaris, some extra effort is required in order to get dtrace probes
# from static libraries
-DTRACE_INSTRUMENT_STATIC_LIBS(mariadbd
+DTRACE_INSTRUMENT_STATIC_LIBS(mariadbd
"sql;mysys;mysys_ssl;${MYSQLD_STATIC_PLUGIN_LIBS}")
-
+
SET(WITH_MYSQLD_LDFLAGS "" CACHE STRING "Additional linker flags for mysqld")
MARK_AS_ADVANCED(WITH_MYSQLD_LDFLAGS)
IF(WITH_MYSQLD_LDFLAGS)
GET_TARGET_PROPERTY(MYSQLD_LINK_FLAGS mariadbd LINK_FLAGS)
IF(NOT MYSQLD_LINK_FLAGS)
- SET(MYSQLD_LINK_FLAGS)
- ENDIF()
- SET_TARGET_PROPERTIES(mariadbd PROPERTIES LINK_FLAGS
+ SET(MYSQLD_LINK_FLAGS)
+ ENDIF()
+ SET_TARGET_PROPERTIES(mariadbd PROPERTIES LINK_FLAGS
"${MYSQLD_LINK_FLAGS} ${WITH_MYSQLD_LDFLAGS}")
ENDIF()
-# Handle out-of-source build from source package with possibly broken
-# bison. Copy bison output to from source to build directory, if not already
+# Handle out-of-source build from source package with possibly broken
+# bison. Copy bison output to from source to build directory, if not already
# there
IF (NOT BISON_FOUND)
IF (NOT ${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
@@ -391,6 +392,10 @@ ADD_CUSTOM_TARGET(
)
ADD_DEPENDENCIES(sql GenServerSource)
+IF(TARGET libfmt)
+ ADD_DEPENDENCIES(sql libfmt)
+ENDIF()
+
IF(WIN32 OR HAVE_DLOPEN AND NOT DISABLE_SHARED)
ADD_LIBRARY(udf_example MODULE udf_example.c udf_example.def)
SET_TARGET_PROPERTIES(udf_example PROPERTIES PREFIX "")
@@ -440,9 +445,9 @@ IF(TARGET mariadbd AND (NOT CMAKE_CROSSCOMPILING OR DEFINED CMAKE_CROSSCOMPILING
ELSE()
SET(ALL_ON_WINDOWS)
ENDIF()
- ADD_CUSTOM_TARGET(initial_database
+ ADD_CUSTOM_TARGET(initial_database
${ALL_ON_WINDOWS}
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep
)
ENDIF()
@@ -451,7 +456,7 @@ IF(WIN32)
FILE(TO_NATIVE_PATH ${my_bootstrap_sql} native_outfile)
# Create bootstrapper SQL script
- ADD_CUSTOM_COMMAND(OUTPUT
+ ADD_CUSTOM_COMMAND(OUTPUT
${my_bootstrap_sql}
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/scripts
cmd /c copy mysql_system_tables.sql+mysql_system_tables_data.sql+fill_help_tables.sql+mysql_performance_tables.sql+mysql_test_db.sql+mysql_sys_schema.sql ${native_outfile}
@@ -474,7 +479,7 @@ IF(WIN32)
DEPENDS comp_sql ${my_bootstrap_sql}
)
- MYSQL_ADD_EXECUTABLE(mariadb-install-db
+ MYSQL_ADD_EXECUTABLE(mariadb-install-db
mysql_install_db.cc
${CMAKE_CURRENT_BINARY_DIR}/mysql_bootstrap_sql.c
COMPONENT Server
diff --git a/sql/backup.cc b/sql/backup.cc
index 64fa91bdded..0e50d12550f 100644
--- a/sql/backup.cc
+++ b/sql/backup.cc
@@ -400,6 +400,9 @@ bool backup_end(THD *thd)
if (WSREP_NNULL(thd) && thd->wsrep_desynced_backup_stage)
{
Wsrep_server_state &server_state= Wsrep_server_state::instance();
+ THD_STAGE_INFO(thd, stage_waiting_flow);
+ WSREP_DEBUG("backup_end: waiting for flow control for %s",
+ wsrep_thd_query(thd));
server_state.resume_and_resync();
thd->wsrep_desynced_backup_stage= false;
}
@@ -551,7 +554,7 @@ static char *add_id_to_buffer(char *ptr, const LEX_CUSTRING *from)
tmp.str= buff;
tmp.length= MY_UUID_STRING_LENGTH;
- my_uuid2str(from->str, buff);
+ my_uuid2str(from->str, buff, 1);
return add_str_to_buffer(ptr, &tmp);
}
diff --git a/sql/ddl_log.cc b/sql/ddl_log.cc
index 8722d88ba95..2ac4e256112 100644
--- a/sql/ddl_log.cc
+++ b/sql/ddl_log.cc
@@ -77,6 +77,8 @@
#define DDL_LOG_MAGIC_LENGTH 4
/* How many times to try to execute a ddl log entry that causes crashes */
#define DDL_LOG_MAX_RETRY 3
+#define DDL_LOG_RETRY_MASK 0xFF
+#define DDL_LOG_RETRY_BITS 8
uchar ddl_log_file_magic[]=
{ (uchar) 254, (uchar) 254, (uchar) 11, (uchar) 2 };
@@ -155,7 +157,7 @@ mysql_mutex_t LOCK_gdl;
#define DDL_LOG_XID_POS 10
/* Used to store unique uuid from the .frm file */
#define DDL_LOG_UUID_POS 18
-/* ID_POS can be used to store something unique, like file size (4 bytes) */
+/* ID_POS can be used to store something unique, like file size (8 bytes) */
#define DDL_LOG_ID_POS DDL_LOG_UUID_POS + MY_UUID_SIZE
#define DDL_LOG_END_POS DDL_LOG_ID_POS + 8
@@ -335,7 +337,7 @@ static bool write_ddl_log_file_entry(uint entry_pos)
static bool update_phase(uint entry_pos, uchar phase)
{
DBUG_ENTER("update_phase");
- DBUG_PRINT("enter", ("phase: %d", (int) phase));
+ DBUG_PRINT("ddl_log", ("pos: %u phase: %u", entry_pos, (uint) phase));
DBUG_RETURN(mysql_file_pwrite(global_ddl_log.file_id, &phase, 1,
global_ddl_log.io_size * entry_pos +
@@ -369,6 +371,8 @@ static bool update_next_entry_pos(uint entry_pos, uint next_entry)
uchar buff[4];
DBUG_ENTER("update_next_entry_pos");
+ DBUG_PRINT("ddl_log", ("pos: %u->%u", entry_pos, next_entry));
+
int4store(buff, next_entry);
DBUG_RETURN(mysql_file_pwrite(global_ddl_log.file_id, buff, sizeof(buff),
global_ddl_log.io_size * entry_pos +
@@ -420,6 +424,7 @@ static bool disable_execute_entry(uint entry_pos)
{
uchar buff[1];
DBUG_ENTER("disable_execute_entry");
+ DBUG_PRINT("ddl_log", ("pos: {%u}", entry_pos));
buff[0]= DDL_LOG_IGNORE_ENTRY_CODE;
DBUG_RETURN(mysql_file_pwrite(global_ddl_log.file_id, buff, sizeof(buff),
@@ -1296,13 +1301,15 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root,
mysql_mutex_assert_owner(&LOCK_gdl);
DBUG_PRINT("ddl_log",
- ("entry type: %u action type: %u (%s) phase: %u next: %u "
+ ("pos: %u=>%u->%u type: %u action: %u (%s) phase: %u "
"handler: '%s' name: '%s' from_name: '%s' tmp_name: '%s'",
+ recovery_state.execute_entry_pos,
+ ddl_log_entry->entry_pos,
+ ddl_log_entry->next_entry,
(uint) ddl_log_entry->entry_type,
(uint) ddl_log_entry->action_type,
ddl_log_action_name[ddl_log_entry->action_type],
(uint) ddl_log_entry->phase,
- ddl_log_entry->next_entry,
ddl_log_entry->handler_name.str,
ddl_log_entry->name.str,
ddl_log_entry->from_name.str,
@@ -2470,13 +2477,13 @@ bool ddl_log_write_entry(DDL_LOG_ENTRY *ddl_log_entry,
error= FALSE;
DBUG_PRINT("ddl_log",
- ("entry type: %u action type: %u (%s) phase: %u next: %u "
+ ("pos: %u->%u action: %u (%s) phase: %u "
"handler: '%s' name: '%s' from_name: '%s' tmp_name: '%s'",
- (uint) ddl_log_entry->entry_type,
+ (*active_entry)->entry_pos,
+ (uint) ddl_log_entry->next_entry,
(uint) ddl_log_entry->action_type,
ddl_log_action_name[ddl_log_entry->action_type],
(uint) ddl_log_entry->phase,
- ddl_log_entry->next_entry,
ddl_log_entry->handler_name.str,
ddl_log_entry->name.str,
ddl_log_entry->from_name.str,
@@ -2510,6 +2517,7 @@ bool ddl_log_write_entry(DDL_LOG_ENTRY *ddl_log_entry,
@param first_entry First entry in linked list of entries
to execute.
+ @param cond_entry Check and don't execute if cond_entry is active
@param[in,out] active_entry Entry to execute, 0 = NULL if the entry
is written first time and needs to be
returned. In this case the entry written
@@ -2520,6 +2528,7 @@ bool ddl_log_write_entry(DDL_LOG_ENTRY *ddl_log_entry,
*/
bool ddl_log_write_execute_entry(uint first_entry,
+ uint cond_entry,
DDL_LOG_MEMORY_ENTRY **active_entry)
{
uchar *file_entry_buf= global_ddl_log.file_entry_buf;
@@ -2536,13 +2545,17 @@ bool ddl_log_write_execute_entry(uint first_entry,
file_entry_buf[DDL_LOG_ENTRY_TYPE_POS]= (uchar)DDL_LOG_EXECUTE_CODE;
int4store(file_entry_buf + DDL_LOG_NEXT_ENTRY_POS, first_entry);
+ int8store(file_entry_buf + DDL_LOG_ID_POS, ((ulonglong)cond_entry << DDL_LOG_RETRY_BITS));
if (!(*active_entry))
{
if (ddl_log_get_free_entry(active_entry))
DBUG_RETURN(TRUE);
got_free_entry= TRUE;
- }
+ }
+ DBUG_PRINT("ddl_log",
+ ("pos: %u=>%u",
+ (*active_entry)->entry_pos, first_entry));
if (write_ddl_log_file_entry((*active_entry)->entry_pos))
{
sql_print_error("DDL_LOG: Error writing execute entry %u",
@@ -2575,6 +2588,7 @@ bool ddl_log_increment_phase(uint entry_pos)
{
bool error;
DBUG_ENTER("ddl_log_increment_phase");
+ DBUG_PRINT("ddl_log", ("pos: %u", entry_pos));
mysql_mutex_lock(&LOCK_gdl);
error= ddl_log_increment_phase_no_lock(entry_pos);
@@ -2754,13 +2768,13 @@ int ddl_log_execute_recovery()
recovery_state.xid= ddl_log_entry.xid;
/* purecov: begin tested */
- if (ddl_log_entry.unique_id > DDL_LOG_MAX_RETRY)
+ if ((ddl_log_entry.unique_id & DDL_LOG_RETRY_MASK) > DDL_LOG_MAX_RETRY)
{
error= -1;
continue;
}
update_unique_id(i, ++ddl_log_entry.unique_id);
- if (ddl_log_entry.unique_id > DDL_LOG_MAX_RETRY)
+ if ((ddl_log_entry.unique_id & DDL_LOG_RETRY_MASK) > DDL_LOG_MAX_RETRY)
{
sql_print_error("DDL_LOG: Aborting executing entry %u after %llu "
"retries", i, ddl_log_entry.unique_id);
@@ -2769,6 +2783,15 @@ int ddl_log_execute_recovery()
}
/* purecov: end tested */
+ uint cond_entry= (uint)(ddl_log_entry.unique_id >> DDL_LOG_RETRY_BITS);
+
+ if (cond_entry && is_execute_entry_active(cond_entry))
+ {
+ if (disable_execute_entry(i))
+ error= -1;
+ continue;
+ }
+
if (ddl_log_execute_entry_no_lock(thd, ddl_log_entry.next_entry))
{
/* Real unpleasant scenario but we have to continue anyway */
@@ -2848,8 +2871,7 @@ void ddl_log_release()
Methods for DDL_LOG_STATE
*/
-static void add_log_entry(DDL_LOG_STATE *state,
- DDL_LOG_MEMORY_ENTRY *log_entry)
+void ddl_log_add_entry(DDL_LOG_STATE *state, DDL_LOG_MEMORY_ENTRY *log_entry)
{
log_entry->next_active_log_entry= state->list;
state->main_entry= state->list= log_entry;
@@ -3028,7 +3050,7 @@ static bool ddl_log_write(DDL_LOG_STATE *ddl_state,
ddl_log_release_memory_entry(log_entry);
DBUG_RETURN(1);
}
- add_log_entry(ddl_state, log_entry);
+ ddl_log_add_entry(ddl_state, log_entry);
ddl_state->flags|= ddl_log_entry->flags; // Update cache
DBUG_RETURN(0);
}
@@ -3178,7 +3200,7 @@ static bool ddl_log_drop(THD *thd, DDL_LOG_STATE *ddl_state,
}
mysql_mutex_unlock(&LOCK_gdl);
- add_log_entry(ddl_state, log_entry);
+ ddl_log_add_entry(ddl_state, log_entry);
DBUG_RETURN(0);
error:
@@ -3478,7 +3500,7 @@ bool ddl_log_store_query(THD *thd, DDL_LOG_STATE *ddl_state,
goto err;
parent_entry_pos= ddl_state->list->entry_pos;
entry_pos= first_entry->entry_pos;
- add_log_entry(ddl_state, first_entry);
+ ddl_log_add_entry(ddl_state, first_entry);
while (length)
{
@@ -3494,7 +3516,7 @@ bool ddl_log_store_query(THD *thd, DDL_LOG_STATE *ddl_state,
if (ddl_log_get_free_entry(&next_entry))
goto err;
ddl_log_entry.next_entry= next_entry_pos= next_entry->entry_pos;
- add_log_entry(ddl_state, next_entry);
+ ddl_log_add_entry(ddl_state, next_entry);
}
else
{
@@ -3526,3 +3548,32 @@ err:
mysql_mutex_unlock(&LOCK_gdl);
DBUG_RETURN(1);
}
+
+
+/*
+ Log an delete frm file
+*/
+
+/*
+ TODO: Partitioning atomic DDL refactoring: this should be replaced with
+ ddl_log_create_table().
+*/
+bool ddl_log_delete_frm(DDL_LOG_STATE *ddl_state, const char *to_path)
+{
+ DDL_LOG_ENTRY ddl_log_entry;
+ DDL_LOG_MEMORY_ENTRY *log_entry;
+ DBUG_ENTER("ddl_log_delete_frm");
+ bzero(&ddl_log_entry, sizeof(ddl_log_entry));
+ ddl_log_entry.action_type= DDL_LOG_DELETE_ACTION;
+ ddl_log_entry.next_entry= ddl_state->list ? ddl_state->list->entry_pos : 0;
+
+ lex_string_set(&ddl_log_entry.handler_name, reg_ext);
+ lex_string_set(&ddl_log_entry.name, to_path);
+
+ mysql_mutex_assert_owner(&LOCK_gdl);
+ if (ddl_log_write_entry(&ddl_log_entry, &log_entry))
+ DBUG_RETURN(1);
+
+ ddl_log_add_entry(ddl_state, log_entry);
+ DBUG_RETURN(0);
+}
diff --git a/sql/ddl_log.h b/sql/ddl_log.h
index a2a6af76a77..9960855a813 100644
--- a/sql/ddl_log.h
+++ b/sql/ddl_log.h
@@ -262,8 +262,14 @@ int ddl_log_execute_recovery();
bool ddl_log_write_entry(DDL_LOG_ENTRY *ddl_log_entry,
DDL_LOG_MEMORY_ENTRY **active_entry);
+bool ddl_log_write_execute_entry(uint first_entry, uint cond_entry,
+ DDL_LOG_MEMORY_ENTRY** active_entry);
+inline
bool ddl_log_write_execute_entry(uint first_entry,
- DDL_LOG_MEMORY_ENTRY **active_entry);
+ DDL_LOG_MEMORY_ENTRY **active_entry)
+{
+ return ddl_log_write_execute_entry(first_entry, 0, active_entry);
+}
bool ddl_log_disable_execute_entry(DDL_LOG_MEMORY_ENTRY **active_entry);
void ddl_log_complete(DDL_LOG_STATE *ddl_log_state);
@@ -279,6 +285,7 @@ void ddl_log_release_memory_entry(DDL_LOG_MEMORY_ENTRY *log_entry);
bool ddl_log_sync();
bool ddl_log_execute_entry(THD *thd, uint first_entry);
+void ddl_log_add_entry(DDL_LOG_STATE *state, DDL_LOG_MEMORY_ENTRY *log_entry);
void ddl_log_release_entries(DDL_LOG_STATE *ddl_log_state);
bool ddl_log_rename_table(THD *thd, DDL_LOG_STATE *ddl_state,
handlerton *hton,
@@ -348,5 +355,6 @@ bool ddl_log_alter_table(THD *thd, DDL_LOG_STATE *ddl_state,
bool is_renamed);
bool ddl_log_store_query(THD *thd, DDL_LOG_STATE *ddl_log_state,
const char *query, size_t length);
+bool ddl_log_delete_frm(DDL_LOG_STATE *ddl_state, const char *to_path);
extern mysql_mutex_t LOCK_gdl;
#endif /* DDL_LOG_INCLUDED */
diff --git a/sql/discover.cc b/sql/discover.cc
index 22d7008630a..201169357a2 100644
--- a/sql/discover.cc
+++ b/sql/discover.cc
@@ -233,7 +233,7 @@ int extension_based_table_discovery(MY_DIR *dirp, const char *ext_meta,
cur++;
}
advance(from, to, cur, skip);
- dirp->number_of_files= (uint)(to - dirp->dir_entry);
+ dirp->number_of_files= to - dirp->dir_entry;
return 0;
}
diff --git a/sql/encryption.cc b/sql/encryption.cc
index 13239b91910..3c7ba2e997b 100644
--- a/sql/encryption.cc
+++ b/sql/encryption.cc
@@ -109,6 +109,7 @@ int initialize_encryption_plugin(st_plugin_int *plugin)
int finalize_encryption_plugin(st_plugin_int *plugin)
{
+ int deinit_status= 0;
bool used= plugin_ref_to_int(encryption_manager) == plugin;
if (used)
@@ -118,18 +119,15 @@ int finalize_encryption_plugin(st_plugin_int *plugin)
encryption_handler.encryption_ctx_size_func= zero_size;
}
- if (plugin && plugin->plugin->deinit && plugin->plugin->deinit(NULL))
- {
- DBUG_PRINT("warning", ("Plugin '%s' deinit function returned error.",
- plugin->name.str));
- }
+ if (plugin && plugin->plugin->deinit)
+ deinit_status= plugin->plugin->deinit(NULL);
if (used)
{
plugin_unlock(NULL, encryption_manager);
encryption_manager= 0;
}
- return 0;
+ return deinit_status;
}
/******************************************************************
diff --git a/sql/field.cc b/sql/field.cc
index 0cb3a90849a..348947329f7 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -11118,6 +11118,14 @@ Field::set_warning(Sql_condition::enum_warning_level level, uint code,
will have table == NULL.
*/
THD *thd= get_thd();
+
+ /*
+ In INPLACE ALTER, server can't know which row has generated
+ the warning, so the value of current row is supplied by the engine.
+ */
+ if (current_row)
+ thd->get_stmt_da()->reset_current_row_for_warning(current_row);
+
if (thd->count_cuted_fields > CHECK_FIELD_EXPRESSION)
{
thd->cuted_fields+= cut_increment;
diff --git a/sql/gcalc_slicescan.cc b/sql/gcalc_slicescan.cc
index 93561f5fe97..e35f9155967 100644
--- a/sql/gcalc_slicescan.cc
+++ b/sql/gcalc_slicescan.cc
@@ -168,7 +168,7 @@ static void GCALC_DBUG_PRINT_SLICE(const char *header,
Gcalc_dyn_list::Gcalc_dyn_list(size_t blk_size, size_t sizeof_item):
- m_blk_size(blk_size - ALLOC_ROOT_MIN_BLOCK_SIZE),
+ m_blk_size(blk_size),
m_sizeof_item(ALIGN_SIZE(sizeof_item)),
m_points_per_blk((uint)((m_blk_size - PH_DATA_OFFSET) / m_sizeof_item)),
m_blk_hook(&m_first_blk),
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 19fb2a9357d..9cefd695c56 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -3628,31 +3628,31 @@ bool ha_partition::init_partition_bitmaps()
DBUG_ENTER("ha_partition::init_partition_bitmaps");
/* Initialize the bitmap we use to minimize ha_start_bulk_insert calls */
- if (my_bitmap_init(&m_bulk_insert_started, NULL, m_tot_parts + 1, FALSE))
+ if (my_bitmap_init(&m_bulk_insert_started, NULL, m_tot_parts + 1))
DBUG_RETURN(true);
/* Initialize the bitmap we use to keep track of locked partitions */
- if (my_bitmap_init(&m_locked_partitions, NULL, m_tot_parts, FALSE))
+ if (my_bitmap_init(&m_locked_partitions, NULL, m_tot_parts))
DBUG_RETURN(true);
/*
Initialize the bitmap we use to keep track of partitions which may have
something to reset in ha_reset().
*/
- if (my_bitmap_init(&m_partitions_to_reset, NULL, m_tot_parts, FALSE))
+ if (my_bitmap_init(&m_partitions_to_reset, NULL, m_tot_parts))
DBUG_RETURN(true);
/*
Initialize the bitmap we use to keep track of partitions which returned
HA_ERR_KEY_NOT_FOUND from index_read_map.
*/
- if (my_bitmap_init(&m_key_not_found_partitions, NULL, m_tot_parts, FALSE))
+ if (my_bitmap_init(&m_key_not_found_partitions, NULL, m_tot_parts))
DBUG_RETURN(true);
- if (bitmap_init(&m_mrr_used_partitions, NULL, m_tot_parts, TRUE))
+ if (my_bitmap_init(&m_mrr_used_partitions, NULL, m_tot_parts))
DBUG_RETURN(true);
- if (my_bitmap_init(&m_opened_partitions, NULL, m_tot_parts, FALSE))
+ if (my_bitmap_init(&m_opened_partitions, NULL, m_tot_parts))
DBUG_RETURN(true);
m_file_sample= NULL;
diff --git a/sql/handler.cc b/sql/handler.cc
index 81b4e9adc15..80dc2419b9d 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -581,6 +581,7 @@ static int hton_drop_table(handlerton *hton, const char *path)
int ha_finalize_handlerton(st_plugin_int *plugin)
{
+ int deinit_status= 0;
handlerton *hton= (handlerton *)plugin->data;
DBUG_ENTER("ha_finalize_handlerton");
@@ -595,18 +596,7 @@ int ha_finalize_handlerton(st_plugin_int *plugin)
hton->panic(hton, HA_PANIC_CLOSE);
if (plugin->plugin->deinit)
- {
- /*
- Today we have no defined/special behavior for uninstalling
- engine plugins.
- */
- DBUG_PRINT("info", ("Deinitializing plugin: '%s'", plugin->name.str));
- if (plugin->plugin->deinit(NULL))
- {
- DBUG_PRINT("warning", ("Plugin '%s' deinit function returned error.",
- plugin->name.str));
- }
- }
+ deinit_status= plugin->plugin->deinit(NULL);
free_sysvar_table_options(hton);
update_discovery_counters(hton, -1);
@@ -627,7 +617,7 @@ int ha_finalize_handlerton(st_plugin_int *plugin)
my_free(hton);
end:
- DBUG_RETURN(0);
+ DBUG_RETURN(deinit_status);
}
@@ -1762,6 +1752,13 @@ int ha_commit_trans(THD *thd, bool all)
if (ha_info->ht()->prepare_commit_versioned)
{
trx_end_id= ha_info->ht()->prepare_commit_versioned(thd, &trx_start_id);
+
+ if (trx_end_id == ULONGLONG_MAX)
+ {
+ my_error(ER_ERROR_DURING_COMMIT, MYF(0), 1);
+ goto err;
+ }
+
if (trx_end_id)
break; // FIXME: use a common ID for cross-engine transactions
}
@@ -8077,7 +8074,7 @@ static Create_field *vers_init_sys_field(THD *thd, const char *field_name, int f
f->set_handler(&type_handler_timestamp2);
f->length= MAX_DATETIME_PRECISION;
}
- f->invisible= DBUG_EVALUATE_IF("sysvers_show", VISIBLE, INVISIBLE_SYSTEM);
+ f->invisible= DBUG_IF("sysvers_show") ? VISIBLE : INVISIBLE_SYSTEM;
if (f->check(thd))
return NULL;
@@ -8225,7 +8222,7 @@ bool Vers_parse_info::fix_alter_info(THD *thd, Alter_info *alter_info,
if (!need_check(alter_info) && !share->versioned)
return false;
- if (DBUG_EVALUATE_IF("sysvers_force", 0, share->tmp_table))
+ if (!DBUG_IF("sysvers_force") && share->tmp_table)
{
my_error(ER_VERS_NOT_SUPPORTED, MYF(0), "CREATE TEMPORARY TABLE");
return true;
diff --git a/sql/handler.h b/sql/handler.h
index c50e1ced377..ed24f160385 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -838,7 +838,9 @@ typedef bool Log_func(THD*, TABLE*, bool, const uchar*, const uchar*);
// Set by Sql_cmd_alter_table_truncate_partition::execute()
#define ALTER_PARTITION_TRUNCATE (1ULL << 11)
// Set for REORGANIZE PARTITION
-#define ALTER_PARTITION_TABLE_REORG (1ULL << 12)
+#define ALTER_PARTITION_TABLE_REORG (1ULL << 12)
+#define ALTER_PARTITION_CONVERT_IN (1ULL << 13)
+#define ALTER_PARTITION_CONVERT_OUT (1ULL << 14)
/*
This is master database for most of system tables. However there
@@ -1000,39 +1002,6 @@ struct xid_recovery_member
#define MIN_XID_LIST_SIZE 128
#define MAX_XID_LIST_SIZE (1024*128)
-/*
- These structures are used to pass information from a set of SQL commands
- on add/drop/change tablespace definitions to the proper hton.
-*/
-#define UNDEF_NODEGROUP 65535
-enum ts_command_type
-{
- TS_CMD_NOT_DEFINED = -1,
- CREATE_TABLESPACE = 0,
- ALTER_TABLESPACE = 1,
- CREATE_LOGFILE_GROUP = 2,
- ALTER_LOGFILE_GROUP = 3,
- DROP_TABLESPACE = 4,
- DROP_LOGFILE_GROUP = 5,
- CHANGE_FILE_TABLESPACE = 6,
- ALTER_ACCESS_MODE_TABLESPACE = 7
-};
-
-enum ts_alter_tablespace_type
-{
- TS_ALTER_TABLESPACE_TYPE_NOT_DEFINED = -1,
- ALTER_TABLESPACE_ADD_FILE = 1,
- ALTER_TABLESPACE_DROP_FILE = 2
-};
-
-enum tablespace_access_mode
-{
- TS_NOT_DEFINED= -1,
- TS_READ_ONLY = 0,
- TS_READ_WRITE = 1,
- TS_NOT_ACCESSIBLE = 2
-};
-
/* Statistics about batch operations like bulk_insert */
struct ha_copy_info
{
@@ -1043,50 +1012,6 @@ struct ha_copy_info
ha_rows updated;
};
-struct handlerton;
-class st_alter_tablespace : public Sql_alloc
-{
- public:
- const char *tablespace_name;
- const char *logfile_group_name;
- enum ts_command_type ts_cmd_type;
- enum ts_alter_tablespace_type ts_alter_tablespace_type;
- const char *data_file_name;
- const char *undo_file_name;
- const char *redo_file_name;
- ulonglong extent_size;
- ulonglong undo_buffer_size;
- ulonglong redo_buffer_size;
- ulonglong initial_size;
- ulonglong autoextend_size;
- ulonglong max_size;
- uint nodegroup_id;
- handlerton *storage_engine;
- bool wait_until_completed;
- const char *ts_comment;
- enum tablespace_access_mode ts_access_mode;
- st_alter_tablespace()
- {
- tablespace_name= NULL;
- logfile_group_name= "DEFAULT_LG"; //Default log file group
- ts_cmd_type= TS_CMD_NOT_DEFINED;
- data_file_name= NULL;
- undo_file_name= NULL;
- redo_file_name= NULL;
- extent_size= 1024*1024; //Default 1 MByte
- undo_buffer_size= 8*1024*1024; //Default 8 MByte
- redo_buffer_size= 8*1024*1024; //Default 8 MByte
- initial_size= 128*1024*1024; //Default 128 MByte
- autoextend_size= 0; //No autoextension as default
- max_size= 0; //Max size == initial size => no extension
- storage_engine= NULL;
- nodegroup_id= UNDEF_NODEGROUP;
- wait_until_completed= TRUE;
- ts_comment= NULL;
- ts_access_mode= TS_NOT_DEFINED;
- }
-};
-
/* The handler for a table type. Will be included in the TABLE structure */
struct TABLE;
@@ -1150,6 +1075,7 @@ typedef bool (stat_print_fn)(THD *thd, const char *type, size_t type_len,
enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX };
extern MYSQL_PLUGIN_IMPORT st_plugin_int *hton2plugin[MAX_HA];
+struct handlerton;
#define view_pseudo_hton ((handlerton *)1)
/*
@@ -1515,8 +1441,7 @@ struct handlerton
bool (*show_status)(handlerton *hton, THD *thd, stat_print_fn *print, enum ha_stat_type stat);
uint (*partition_flags)();
alter_table_operations (*alter_table_flags)(alter_table_operations flags);
- int (*alter_tablespace)(handlerton *hton, THD *thd, st_alter_tablespace *ts_info);
- int (*fill_is_table)(handlerton *hton, THD *thd, TABLE_LIST *tables,
+ int (*fill_is_table)(handlerton *hton, THD *thd, TABLE_LIST *tables,
class Item *cond,
enum enum_schema_tables);
uint32 flags; /* global handler flags */
diff --git a/sql/hostname.cc b/sql/hostname.cc
index 7b07ab620a6..35948db3d23 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -191,7 +191,7 @@ Host_entry *hostname_cache_first()
static inline Host_entry *hostname_cache_search(const char *ip_key)
{
- return hostname_cache->search((uchar *) ip_key, 0);
+ return hostname_cache->search((uchar *) ip_key, HOST_ENTRY_KEY_SIZE);
}
static void add_hostname_impl(const char *ip_key, const char *hostname,
diff --git a/sql/item.cc b/sql/item.cc
index 58824546cbe..1f6d585efd7 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -55,8 +55,8 @@ const char *item_empty_name="";
const char *item_used_name= "\0";
static int save_field_in_field(Field *, bool *, Field *, bool);
-const Item_bool_static Item_false("FALSE", 0);
-const Item_bool_static Item_true("TRUE", 1);
+Item_bool_static *Item_false;
+Item_bool_static *Item_true;
/**
Compare two Items for List<Item>::add_unique()
@@ -445,7 +445,7 @@ Item::Item(THD *thd):
Item::Item():
name(null_clex_str), orig_name(0), is_expensive_cache(-1)
{
- DBUG_ASSERT(my_progname == NULL); // before main()
+ DBUG_ASSERT(!mysqld_server_started); // Created early
base_flags= item_base_t::FIXED;
with_flags= item_with_t::NONE;
null_value= 0;
diff --git a/sql/item.h b/sql/item.h
index e38860dfbbb..c3251259b43 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -769,8 +769,8 @@ enum class item_base_t : item_flags_t
FIXED= (1<<2), // Was fixed with fix_fields().
IS_EXPLICIT_NAME= (1<<3), // The name of this Item was set by the user
// (or was auto generated otherwise)
- IS_IN_WITH_CYCLE= (1<<4) // This item is in CYCLE clause
- // of WITH.
+ IS_IN_WITH_CYCLE= (1<<4), // This item is in CYCLE clause of WITH.
+ AT_TOP_LEVEL= (1<<5) // At top (AND) level of item tree
};
@@ -1319,6 +1319,25 @@ public:
{
set_maybe_null(maybe_null_arg);
}
+ /*
+ Mark the item that it is a top level item, or part of a top level AND item,
+ for WHERE and ON clauses:
+ Example: ... WHERE a=5 AND b=6; Both a=5 and b=6 are top level items
+
+ This is used to indicate that there is no distinction between if the
+ value of the item is FALSE or NULL..
+ This enables Item_cond_and and subquery related items to do special
+ "top level" optimizations.
+ */
+ virtual void top_level_item()
+ {
+ base_flags|= item_base_t::AT_TOP_LEVEL;
+ }
+ /*
+ Return TRUE if this item of top WHERE level (AND/OR)
+ */
+ bool is_top_level_item() const
+ { return (bool) (base_flags & item_base_t::AT_TOP_LEVEL); }
void set_typelib(const TYPELIB *typelib) override
{
@@ -2035,25 +2054,6 @@ public:
{
return type_handler()->Item_update_null_value(this);
}
-
- /*
- Inform the item that there will be no distinction between its result
- being FALSE or NULL.
-
- NOTE
- This function will be called for eg. Items that are top-level AND-parts
- of the WHERE clause. Items implementing this function (currently
- Item_cond_and and subquery-related item) enable special optimizations
- when they are "top level".
- */
- virtual void top_level_item() {}
- /*
- Return TRUE if it is item of top WHERE level (AND/OR) and it is
- important, return FALSE if it not important (we can not use to simplify
- calculations) or not top level
- */
- virtual bool is_top_level_item() const
- { return FALSE; /* not important */}
/*
return IN/ALL/ANY subquery or NULL
*/
@@ -2652,7 +2652,7 @@ public:
bool depends_only_on(table_map view_map)
{ return marker & MARKER_FULL_EXTRACTION; }
- int get_extraction_flag()
+ int get_extraction_flag() const
{ return marker & MARKER_EXTRACTION_MASK; }
void set_extraction_flag(int16 flags)
{
@@ -4437,11 +4437,16 @@ public:
Item_bool_static(const char *str_arg, longlong i):
Item_bool(str_arg, i) {};
+ /* Don't mark static items as top level item */
+ virtual void top_level_item() override {}
void set_join_tab_idx(uint8 join_tab_idx_arg) override
{ DBUG_ASSERT(0); }
+
+ void cleanup() override {}
};
-extern const Item_bool_static Item_false, Item_true;
+/* The following variablese are stored in a read only segment */
+extern Item_bool_static *Item_false, *Item_true;
class Item_uint :public Item_int
{
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 879b314e624..9123bd96d5e 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1065,14 +1065,14 @@ int Arg_comparator::compare_row()
// NULL was compared
switch (((Item_func*)owner)->functype()) {
case Item_func::NE_FUNC:
- break; // NE never aborts on NULL even if abort_on_null is set
+ break; // NE never aborts on NULL
case Item_func::LT_FUNC:
case Item_func::LE_FUNC:
case Item_func::GT_FUNC:
case Item_func::GE_FUNC:
return -1; // <, <=, > and >= always fail on NULL
case Item_func::EQ_FUNC:
- if (((Item_func_eq*)owner)->abort_on_null)
+ if (owner->is_top_level_item())
return -1; // We do not need correct NULL returning
break;
default:
@@ -1189,12 +1189,6 @@ longlong Item_func_truth::val_int()
}
-bool Item_in_optimizer::is_top_level_item() const
-{
- return args[1]->is_top_level_item();
-}
-
-
void Item_in_optimizer::fix_after_pullout(st_select_lex *new_parent,
Item **ref, bool merge)
{
@@ -1379,7 +1373,8 @@ bool Item_in_optimizer::fix_fields(THD *thd, Item **ref)
}
base_flags|= (item_base_t::FIXED |
- (args[1]->base_flags & item_base_t::MAYBE_NULL));
+ (args[1]->base_flags & (item_base_t::MAYBE_NULL |
+ item_base_t::AT_TOP_LEVEL)));
with_flags|= (item_with_t::SUBQUERY |
args[1]->with_flags |
(args[0]->with_flags &
@@ -2065,7 +2060,7 @@ bool Item_func_between::eval_not_null_tables(void *opt_arg)
return 1;
/* not_null_tables_cache == union(T1(e),T1(e1),T1(e2)) */
- if (pred_level && !negated)
+ if (is_top_level_item() && !negated)
return 0;
/* not_null_tables_cache == union(T1(e), intersection(T1(e1),T1(e2))) */
@@ -2467,6 +2462,10 @@ bool
Item_func_if::fix_fields(THD *thd, Item **ref)
{
DBUG_ASSERT(fixed() == 0);
+ /*
+ Mark that we don't care if args[0] is NULL or FALSE, we regard both cases as
+ false.
+ */
args[0]->top_level_item();
if (Item_func::fix_fields(thd, ref))
@@ -4342,7 +4341,7 @@ Item_func_in::eval_not_null_tables(void *opt_arg)
return 1;
/* not_null_tables_cache == union(T1(e),union(T1(ei))) */
- if (pred_level && negated)
+ if (is_top_level_item() && negated)
return 0;
/* not_null_tables_cache = union(T1(e),intersection(T1(ei))) */
@@ -4797,9 +4796,10 @@ bool Item_func_bit_and::fix_length_and_dec()
Item_cond::Item_cond(THD *thd, Item_cond *item)
:Item_bool_func(thd, item),
- abort_on_null(item->abort_on_null),
and_tables_cache(item->and_tables_cache)
{
+ base_flags|= (item->base_flags & item_base_t::AT_TOP_LEVEL);
+
/*
item->list will be copied by copy_andor_arguments() call
*/
@@ -4807,7 +4807,7 @@ Item_cond::Item_cond(THD *thd, Item_cond *item)
Item_cond::Item_cond(THD *thd, Item *i1, Item *i2):
- Item_bool_func(thd), abort_on_null(0)
+ Item_bool_func(thd)
{
list.push_back(i1, thd->mem_root);
list.push_back(i2, thd->mem_root);
@@ -4875,7 +4875,7 @@ Item_cond::fix_fields(THD *thd, Item **ref)
((Item_cond*) item)->list.empty();
item= *li.ref(); // new current item
}
- if (abort_on_null)
+ if (is_top_level_item())
item->top_level_item();
/*
@@ -4902,7 +4902,7 @@ Item_cond::fix_fields(THD *thd, Item **ref)
if (item->can_eval_in_optimize() && !item->with_sp_var() &&
!cond_has_datetime_is_null(item))
{
- if (item->eval_const_cond() == is_and_cond && top_level())
+ if (item->eval_const_cond() == is_and_cond && is_top_level_item())
{
/*
a. This is "... AND true_cond AND ..."
@@ -4959,7 +4959,7 @@ Item_cond::eval_not_null_tables(void *opt_arg)
if (item->can_eval_in_optimize() && !item->with_sp_var() &&
!cond_has_datetime_is_null(item))
{
- if (item->eval_const_cond() == is_and_cond && top_level())
+ if (item->eval_const_cond() == is_and_cond && is_top_level_item())
{
/*
a. This is "... AND true_cond AND ..."
@@ -5394,17 +5394,18 @@ void Item_cond_and::mark_as_condition_AND_part(TABLE_LIST *embedding)
Evaluation of AND(expr, expr, expr ...).
@note
- abort_if_null is set for AND expressions for which we don't care if the
- result is NULL or 0. This is set for:
+ There are AND expressions for which we don't care if the
+ result is NULL or 0. This is the case for:
- WHERE clause
- HAVING clause
- IF(expression)
+ For these we mark them as "top_level_items"
@retval
1 If all expressions are true
@retval
- 0 If all expressions are false or if we find a NULL expression and
- 'abort_on_null' is set.
+ 0 If any of the expressions are false or if we find a NULL expression and
+ this is a top_level_item.
@retval
NULL if all expression are either 1 or NULL
*/
@@ -5420,8 +5421,8 @@ longlong Item_cond_and::val_int()
{
if (!item->val_bool())
{
- if (abort_on_null || !(null_value= item->null_value))
- return 0; // return FALSE
+ if (is_top_level_item() || !(null_value= item->null_value))
+ return 0;
}
}
return null_value ? 0 : 1;
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 5bc0c839c90..fe55f524f89 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -411,7 +411,6 @@ public:
void set_join_tab_idx(uint8 join_tab_idx_arg) override
{ args[1]->set_join_tab_idx(join_tab_idx_arg); }
void get_cache_parameters(List<Item> &parameters) override;
- bool is_top_level_item() const override;
bool eval_not_null_tables(void *opt_arg) override;
bool find_not_null_fields(table_map allowed) override;
void fix_after_pullout(st_select_lex *new_parent, Item **ref,
@@ -631,12 +630,8 @@ public:
class Item_func_not :public Item_bool_func
{
- bool abort_on_null;
public:
- Item_func_not(THD *thd, Item *a):
- Item_bool_func(thd, a), abort_on_null(FALSE) {}
- void top_level_item() override { abort_on_null= 1; }
- bool is_top_level_item() const override { return abort_on_null; }
+ Item_func_not(THD *thd, Item *a): Item_bool_func(thd, a) {}
longlong val_int() override;
enum Functype functype() const override { return NOT_FUNC; }
LEX_CSTRING func_name_cstring() const override
@@ -755,11 +750,10 @@ public:
class Item_func_eq :public Item_bool_rowready_func2
{
- bool abort_on_null;
public:
Item_func_eq(THD *thd, Item *a, Item *b):
Item_bool_rowready_func2(thd, a, b),
- abort_on_null(false), in_equality_no(UINT_MAX)
+ in_equality_no(UINT_MAX)
{}
longlong val_int() override;
enum Functype functype() const override { return EQ_FUNC; }
@@ -770,7 +764,6 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("=") };
return name;
}
- void top_level_item() override { abort_on_null= true; }
Item *negated_item(THD *thd) override;
COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
bool link_item_fields,
@@ -956,15 +949,12 @@ protected:
DTCollation cmp_collation;
public:
bool negated; /* <=> the item represents NOT <func> */
- bool pred_level; /* <=> [NOT] <func> is used on a predicate level */
public:
Item_func_opt_neg(THD *thd, Item *a, Item *b, Item *c):
- Item_bool_func(thd, a, b, c), negated(0), pred_level(0) {}
+ Item_bool_func(thd, a, b, c), negated(0) {}
Item_func_opt_neg(THD *thd, List<Item> &list):
- Item_bool_func(thd, list), negated(0), pred_level(0) {}
+ Item_bool_func(thd, list), negated(0) {}
public:
- void top_level_item() override { pred_level= 1; }
- bool is_top_level_item() const override { return pred_level; }
Item *neg_transformer(THD *thd) override
{
negated= !negated;
@@ -2802,11 +2792,9 @@ public:
class Item_func_isnotnull :public Item_func_null_predicate
{
- bool abort_on_null;
public:
Item_func_isnotnull(THD *thd, Item *a):
- Item_func_null_predicate(thd, a), abort_on_null(0)
- { }
+ Item_func_null_predicate(thd, a) {}
longlong val_int() override;
enum Functype functype() const override { return ISNOTNULL_FUNC; }
LEX_CSTRING func_name_cstring() const override
@@ -2816,10 +2804,9 @@ public:
}
enum precedence precedence() const override { return CMP_PRECEDENCE; }
table_map not_null_tables() const override
- { return abort_on_null ? not_null_tables_cache : 0; }
+ { return is_top_level_item() ? not_null_tables_cache : 0; }
Item *neg_transformer(THD *thd) override;
void print(String *str, enum_query_type query_type) override;
- void top_level_item() override { abort_on_null=1; }
Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_isnotnull>(thd, this); }
};
@@ -3130,17 +3117,19 @@ class Item_cond :public Item_bool_func
{
protected:
List<Item> list;
- bool abort_on_null;
table_map and_tables_cache;
public:
- /* Item_cond() is only used to create top level items */
- Item_cond(THD *thd): Item_bool_func(thd), abort_on_null(1)
- { const_item_cache=0; }
+ Item_cond(THD *thd): Item_bool_func(thd)
+ {
+ /* Item_cond() is only used to create top level items */
+ top_level_item();
+ const_item_cache=0;
+ }
Item_cond(THD *thd, Item *i1, Item *i2);
Item_cond(THD *thd, Item_cond *item);
Item_cond(THD *thd, List<Item> &nlist):
- Item_bool_func(thd), list(nlist), abort_on_null(0) {}
+ Item_bool_func(thd), list(nlist) {}
bool add(Item *item, MEM_ROOT *root)
{
DBUG_ASSERT(item);
@@ -3187,8 +3176,6 @@ public:
List<Item> &fields, uint flags) override;
friend int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
COND **conds);
- void top_level_item() override { abort_on_null=1; }
- bool top_level() { return abort_on_null; }
void copy_andor_arguments(THD *thd, Item_cond *item);
bool walk(Item_processor processor, bool walk_subquery, void *arg) override;
Item *transform(THD *thd, Item_transformer transformer, uchar *arg) override;
@@ -3544,7 +3531,7 @@ public:
}
enum precedence precedence() const override { return AND_PRECEDENCE; }
table_map not_null_tables() const override
- { return abort_on_null ? not_null_tables_cache: and_tables_cache; }
+ { return is_top_level_item() ? not_null_tables_cache: and_tables_cache; }
Item *copy_andor_structure(THD *thd) override;
Item *neg_transformer(THD *thd) override;
void mark_as_condition_AND_part(TABLE_LIST *embedding) override;
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 18a0a20c4fb..a2fe1542cb9 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -918,6 +918,32 @@ protected:
};
+class Create_func_json_normalize : public Create_func_arg1
+{
+public:
+ virtual Item *create_1_arg(THD *thd, Item *arg1);
+
+ static Create_func_json_normalize s_singleton;
+
+protected:
+ Create_func_json_normalize() {}
+ virtual ~Create_func_json_normalize() {}
+};
+
+
+class Create_func_json_equals : public Create_func_arg2
+{
+public:
+ virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
+
+ static Create_func_json_equals s_singleton;
+
+protected:
+ Create_func_json_equals() {}
+ virtual ~Create_func_json_equals() {}
+};
+
+
class Create_func_json_exists : public Create_func_arg2
{
public:
@@ -1639,6 +1665,15 @@ protected:
virtual ~Create_func_name_const() {}
};
+class Create_func_natural_sort_key : public Create_func_arg1
+{
+public:
+ virtual Item *create_1_arg(THD *thd, Item *arg1) override;
+ static Create_func_natural_sort_key s_singleton;
+protected:
+ Create_func_natural_sort_key() {}
+ virtual ~Create_func_natural_sort_key() {}
+};
class Create_func_nullif : public Create_func_arg2
{
@@ -1944,6 +1979,16 @@ protected:
virtual ~Create_func_sec_to_time() {}
};
+class Create_func_sformat : public Create_native_func
+{
+public:
+ Item *create_native(THD *thd, const LEX_CSTRING *name, List<Item> *item_list)
+ override;
+ static Create_func_sformat s_singleton;
+protected:
+ Create_func_sformat() {}
+ virtual ~Create_func_sformat() {}
+};
class Create_func_sha : public Create_func_arg1
{
@@ -2285,30 +2330,6 @@ protected:
};
-class Create_func_uuid : public Create_func_arg0
-{
-public:
- virtual Item *create_builder(THD *thd);
-
- static Create_func_uuid s_singleton;
-
-protected:
- Create_func_uuid() {}
- virtual ~Create_func_uuid() {}
-};
-
-class Create_func_sys_guid : public Create_func_arg0
-{
-public:
- virtual Item *create_builder(THD *thd);
-
- static Create_func_sys_guid s_singleton;
-
-protected:
- Create_func_sys_guid() {}
- virtual ~Create_func_sys_guid() {}
-};
-
class Create_func_uuid_short : public Create_func_arg0
{
public:
@@ -3657,6 +3678,25 @@ Create_func_isnull::create_1_arg(THD *thd, Item *arg1)
return new (thd->mem_root) Item_func_isnull(thd, arg1);
}
+Create_func_json_normalize Create_func_json_normalize::s_singleton;
+
+Item*
+Create_func_json_normalize::create_1_arg(THD *thd, Item *arg1)
+{
+ status_var_increment(thd->status_var.feature_json);
+ return new (thd->mem_root) Item_func_json_normalize(thd, arg1);
+}
+
+
+Create_func_json_equals Create_func_json_equals::s_singleton;
+
+Item*
+Create_func_json_equals::create_2_arg(THD *thd, Item *arg1, Item *arg2)
+{
+ status_var_increment(thd->status_var.feature_json);
+ return new (thd->mem_root) Item_func_json_equals(thd, arg1, arg2);
+}
+
Create_func_json_exists Create_func_json_exists::s_singleton;
@@ -4658,6 +4698,12 @@ Create_func_md5::create_1_arg(THD *thd, Item *arg1)
return new (thd->mem_root) Item_func_md5(thd, arg1);
}
+Create_func_natural_sort_key Create_func_natural_sort_key::s_singleton;
+
+Item *Create_func_natural_sort_key::create_1_arg(THD *thd, Item* arg1)
+{
+ return new (thd->mem_root) Item_func_natural_sort_key(thd, arg1);
+}
Create_func_monthname Create_func_monthname::s_singleton;
@@ -5026,6 +5072,26 @@ Create_func_sec_to_time::create_1_arg(THD *thd, Item *arg1)
return new (thd->mem_root) Item_func_sec_to_time(thd, arg1);
}
+Create_func_sformat Create_func_sformat::s_singleton;
+
+Item*
+Create_func_sformat::create_native(THD *thd, const LEX_CSTRING *name,
+ List<Item> *item_list)
+{
+ int arg_count= 0;
+
+ if (item_list != NULL)
+ arg_count= item_list->elements;
+
+ if (unlikely(arg_count < 1))
+ {
+ my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name->str);
+ return NULL;
+ }
+
+ return new (thd->mem_root) Item_func_sformat(thd, *item_list);
+}
+
Create_func_sha Create_func_sha::s_singleton;
@@ -5344,29 +5410,6 @@ Create_func_unix_timestamp::create_native(THD *thd, const LEX_CSTRING *name,
}
-Create_func_uuid Create_func_uuid::s_singleton;
-
-Item*
-Create_func_uuid::create_builder(THD *thd)
-{
- DBUG_ENTER("Create_func_uuid::create");
- thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION);
- thd->lex->safe_to_cache_query= 0;
- DBUG_RETURN(new (thd->mem_root) Item_func_uuid(thd, 0));
-}
-
-Create_func_sys_guid Create_func_sys_guid::s_singleton;
-
-Item*
-Create_func_sys_guid::create_builder(THD *thd)
-{
- DBUG_ENTER("Create_func_sys_guid::create");
- thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION);
- thd->lex->safe_to_cache_query= 0;
- DBUG_RETURN(new (thd->mem_root) Item_func_uuid(thd, 1));
-}
-
-
Create_func_uuid_short Create_func_uuid_short::s_singleton;
Item*
@@ -5613,6 +5656,7 @@ Native_func_registry func_array[] =
{ { STRING_WITH_LEN("JSON_CONTAINS_PATH") }, BUILDER(Create_func_json_contains_path)},
{ { STRING_WITH_LEN("JSON_DEPTH") }, BUILDER(Create_func_json_depth)},
{ { STRING_WITH_LEN("JSON_DETAILED") }, BUILDER(Create_func_json_detailed)},
+ { { STRING_WITH_LEN("JSON_EQUALS") }, BUILDER(Create_func_json_equals)},
{ { STRING_WITH_LEN("JSON_EXISTS") }, BUILDER(Create_func_json_exists)},
{ { STRING_WITH_LEN("JSON_EXTRACT") }, BUILDER(Create_func_json_extract)},
{ { STRING_WITH_LEN("JSON_INSERT") }, BUILDER(Create_func_json_insert)},
@@ -5622,6 +5666,7 @@ Native_func_registry func_array[] =
{ { STRING_WITH_LEN("JSON_MERGE") }, BUILDER(Create_func_json_merge)},
{ { STRING_WITH_LEN("JSON_MERGE_PATCH") }, BUILDER(Create_func_json_merge_patch)},
{ { STRING_WITH_LEN("JSON_MERGE_PRESERVE") }, BUILDER(Create_func_json_merge)},
+ { { STRING_WITH_LEN("JSON_NORMALIZE") }, BUILDER(Create_func_json_normalize)},
{ { STRING_WITH_LEN("JSON_QUERY") }, BUILDER(Create_func_json_query)},
{ { STRING_WITH_LEN("JSON_QUOTE") }, BUILDER(Create_func_json_quote)},
{ { STRING_WITH_LEN("JSON_OBJECT") }, BUILDER(Create_func_json_object)},
@@ -5662,6 +5707,7 @@ Native_func_registry func_array[] =
{ { STRING_WITH_LEN("MD5") }, BUILDER(Create_func_md5)},
{ { STRING_WITH_LEN("MONTHNAME") }, BUILDER(Create_func_monthname)},
{ { STRING_WITH_LEN("NAME_CONST") }, BUILDER(Create_func_name_const)},
+ { {STRING_WITH_LEN("NATURAL_SORT_KEY")}, BUILDER(Create_func_natural_sort_key)},
{ { STRING_WITH_LEN("NVL") }, BUILDER(Create_func_ifnull)},
{ { STRING_WITH_LEN("NVL2") }, BUILDER(Create_func_nvl2)},
{ { STRING_WITH_LEN("NULLIF") }, BUILDER(Create_func_nullif)},
@@ -5691,6 +5737,7 @@ Native_func_registry func_array[] =
{ { STRING_WITH_LEN("RTRIM") }, BUILDER(Create_func_rtrim)},
{ { STRING_WITH_LEN("RTRIM_ORACLE") }, BUILDER(Create_func_rtrim_oracle)},
{ { STRING_WITH_LEN("SEC_TO_TIME") }, BUILDER(Create_func_sec_to_time)},
+ { { STRING_WITH_LEN("SFORMAT") }, BUILDER(Create_func_sformat)},
{ { STRING_WITH_LEN("SHA") }, BUILDER(Create_func_sha)},
{ { STRING_WITH_LEN("SHA1") }, BUILDER(Create_func_sha)},
{ { STRING_WITH_LEN("SHA2") }, BUILDER(Create_func_sha2)},
@@ -5706,7 +5753,6 @@ Native_func_registry func_array[] =
BUILDER(Create_func_substr_oracle)},
{ { STRING_WITH_LEN("SUBSTRING_INDEX") }, BUILDER(Create_func_substr_index)},
{ { STRING_WITH_LEN("SUBTIME") }, BUILDER(Create_func_subtime)},
- { { STRING_WITH_LEN("SYS_GUID") }, BUILDER(Create_func_sys_guid)},
{ { STRING_WITH_LEN("TAN") }, BUILDER(Create_func_tan)},
{ { STRING_WITH_LEN("TIMEDIFF") }, BUILDER(Create_func_timediff)},
{ { STRING_WITH_LEN("TIME_FORMAT") }, BUILDER(Create_func_time_format)},
@@ -5722,7 +5768,6 @@ Native_func_registry func_array[] =
{ { STRING_WITH_LEN("UNIX_TIMESTAMP") }, BUILDER(Create_func_unix_timestamp)},
{ { STRING_WITH_LEN("UPDATEXML") }, BUILDER(Create_func_xml_update)},
{ { STRING_WITH_LEN("UPPER") }, BUILDER(Create_func_ucase)},
- { { STRING_WITH_LEN("UUID") }, BUILDER(Create_func_uuid)},
{ { STRING_WITH_LEN("UUID_SHORT") }, BUILDER(Create_func_uuid_short)},
{ { STRING_WITH_LEN("VERSION") }, BUILDER(Create_func_version)},
{ { STRING_WITH_LEN("WEEKDAY") }, BUILDER(Create_func_weekday)},
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 6aa9cce11dd..dae2be5aa4e 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1004,7 +1004,8 @@ err:
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WARN_DATA_OUT_OF_RANGE,
ER_THD(thd, ER_WARN_DATA_OUT_OF_RANGE),
- name.str, 1L);
+ name.str,
+ thd->get_stmt_da()->current_row_for_warning());
return dec;
}
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc
index f62b683e6ee..89ac59098ac 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -394,6 +394,66 @@ longlong Item_func_json_valid::val_int()
}
+bool Item_func_json_equals::fix_length_and_dec()
+{
+ if (Item_bool_func::fix_length_and_dec())
+ return TRUE;
+ set_maybe_null();
+ return FALSE;
+}
+
+
+longlong Item_func_json_equals::val_int()
+{
+ longlong result= 0;
+
+ String a_tmp, b_tmp;
+
+ String *a= args[0]->val_json(&a_tmp);
+ String *b= args[1]->val_json(&b_tmp);
+
+ DYNAMIC_STRING a_res;
+ if (init_dynamic_string(&a_res, NULL, 0, 0))
+ {
+ null_value= 1;
+ return 1;
+ }
+
+ DYNAMIC_STRING b_res;
+ if (init_dynamic_string(&b_res, NULL, 0, 0))
+ {
+ dynstr_free(&a_res);
+ null_value= 1;
+ return 1;
+ }
+
+ if ((null_value= args[0]->null_value || args[1]->null_value))
+ {
+ null_value= 1;
+ goto end;
+ }
+
+ if (json_normalize(&a_res, a->ptr(), a->length(), a->charset()))
+ {
+ null_value= 1;
+ goto end;
+ }
+
+ if (json_normalize(&b_res, b->ptr(), b->length(), b->charset()))
+ {
+ null_value= 1;
+ goto end;
+ }
+
+ result= strcmp(a_res.str, b_res.str) ? 0 : 1;
+
+end:
+ dynstr_free(&b_res);
+ dynstr_free(&a_res);
+ return result;
+}
+
+
bool Item_func_json_exists::fix_length_and_dec()
{
if (Item_bool_func::fix_length_and_dec())
@@ -985,7 +1045,7 @@ my_decimal *Item_func_json_extract::val_decimal(my_decimal *to)
case JSON_VALUE_ARRAY:
case JSON_VALUE_FALSE:
case JSON_VALUE_NULL:
- case JSON_VALUE_UNINITALIZED:
+ case JSON_VALUE_UNINITIALIZED:
break;
};
}
@@ -3926,3 +3986,48 @@ String* Item_func_json_objectagg::val_str(String* str)
}
+String *Item_func_json_normalize::val_str(String *buf)
+{
+ String tmp;
+ String *raw_json= args[0]->val_str(&tmp);
+
+ DYNAMIC_STRING normalized_json;
+ if (init_dynamic_string(&normalized_json, NULL, 0, 0))
+ {
+ null_value= 1;
+ return NULL;
+ }
+
+ null_value= args[0]->null_value;
+ if (null_value)
+ goto end;
+
+ if (json_normalize(&normalized_json,
+ raw_json->ptr(), raw_json->length(),
+ raw_json->charset()))
+ {
+ null_value= 1;
+ goto end;
+ }
+
+ buf->length(0);
+ if (buf->append(normalized_json.str, normalized_json.length))
+ {
+ null_value= 1;
+ goto end;
+ }
+
+end:
+ dynstr_free(&normalized_json);
+ return null_value ? NULL : buf;
+}
+
+
+bool Item_func_json_normalize::fix_length_and_dec()
+{
+ collation.set(&my_charset_utf8mb4_bin);
+ /* 0 becomes 0.0E0, thus one character becomes 5 chars */
+ fix_char_length_ulonglong((ulonglong) args[0]->max_char_length() * 5);
+ set_maybe_null();
+ return FALSE;
+}
diff --git a/sql/item_jsonfunc.h b/sql/item_jsonfunc.h
index 6cdd8851663..70993228241 100644
--- a/sql/item_jsonfunc.h
+++ b/sql/item_jsonfunc.h
@@ -107,6 +107,23 @@ public:
};
+class Item_func_json_equals: public Item_bool_func
+{
+public:
+ Item_func_json_equals(THD *thd, Item *a, Item *b):
+ Item_bool_func(thd, a, b) {}
+ LEX_CSTRING func_name_cstring() const override
+ {
+ static LEX_CSTRING name= {STRING_WITH_LEN("json_equals") };
+ return name;
+ }
+ bool fix_length_and_dec() override;
+ Item *get_copy(THD *thd) override
+ { return get_item_copy<Item_func_json_equals>(thd, this); }
+ longlong val_int() override;
+};
+
+
class Item_func_json_exists: public Item_bool_func
{
protected:
@@ -440,6 +457,24 @@ public:
{ return get_item_copy<Item_func_json_merge_patch>(thd, this); }
};
+
+class Item_func_json_normalize: public Item_json_func
+{
+public:
+ Item_func_json_normalize(THD *thd, Item *a):
+ Item_json_func(thd, a) {}
+ String *val_str(String *) override;
+ LEX_CSTRING func_name_cstring() const override
+ {
+ static LEX_CSTRING name= {STRING_WITH_LEN("json_normalize") };
+ return name;
+ }
+ bool fix_length_and_dec() override;
+ Item *get_copy(THD *thd) override
+ { return get_item_copy<Item_func_json_normalize>(thd, this); }
+};
+
+
class Item_func_json_length: public Item_long_func
{
bool check_arguments() const override
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 00ddee4ac4b..9f36cbe1ed9 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -55,6 +55,11 @@ C_MODE_END
#include <sql_repl.h>
#include "sql_statistics.h"
+/* fmtlib include (https://fmt.dev/). */
+#define FMT_STATIC_THOUSANDS_SEPARATOR ','
+#define FMT_HEADER_ONLY 1
+#include "fmt/format-inl.h"
+
size_t username_char_length= USERNAME_CHAR_LENGTH;
/*
@@ -1303,6 +1308,138 @@ bool Item_func_replace::fix_length_and_dec()
return FALSE;
}
+/*
+ this is done in the constructor to be in the same memroot as
+ the item itself
+*/
+Item_func_sformat::Item_func_sformat(THD *thd, List<Item> &list)
+ : Item_str_func(thd, list)
+{
+ val_arg= new (thd->mem_root) String[arg_count];
+}
+
+
+bool Item_func_sformat::fix_length_and_dec()
+{
+ if (!val_arg)
+ return TRUE;
+
+ ulonglong char_length= 0;
+
+ uint flags= MY_COLL_ALLOW_SUPERSET_CONV |
+ MY_COLL_ALLOW_COERCIBLE_CONV |
+ MY_COLL_ALLOW_NUMERIC_CONV;
+
+ if (Type_std_attributes::agg_item_collations(collation, func_name_cstring(),
+ args, arg_count, flags, 1))
+ return TRUE;
+
+ DTCollation c= collation;
+ if (c.collation->mbminlen > 1)
+ c.collation= &my_charset_utf8mb4_bin;
+
+ for (uint i=0 ; i < arg_count ; i++)
+ {
+ char_length+= args[i]->max_char_length();
+ if (args[i]->result_type() == STRING_RESULT &&
+ Type_std_attributes::agg_item_set_converter(c, func_name_cstring(),
+ args+i, 1, flags, 1))
+ return TRUE;
+ }
+
+ fix_char_length_ulonglong(char_length);
+ return FALSE;
+}
+
+/*
+ allow fmt to take String arguments directly.
+ Inherit from string_view, so all string formatting works.
+ but {:p} doesn't, because it's not char*, not a pointer.
+*/
+namespace fmt {
+ template <> struct formatter<String>: formatter<string_view> {
+ template <typename FormatContext>
+ auto format(String c, FormatContext& ctx) -> decltype(ctx.out()) {
+ string_view name = { c.ptr(), c.length() };
+ return formatter<string_view>::format(name, ctx);
+ };
+ };
+};
+
+/*
+ SFORMAT(format_string, ...)
+ This function receives a formatting specification string and N parameters
+ (N >= 0), and it returns string formatted using the rules the user passed
+ in the specification. It uses fmtlib (https://fmt.dev/).
+*/
+String *Item_func_sformat::val_str(String *res)
+{
+ DBUG_ASSERT(fixed());
+ using ctx= fmt::format_context;
+ String *fmt_arg= NULL;
+ String *parg= NULL;
+ fmt::format_args::format_arg *vargs= NULL;
+
+ null_value= true;
+ if (!(fmt_arg= args[0]->val_str(res)))
+ return NULL;
+
+ if (!(vargs= new fmt::format_args::format_arg[arg_count - 1]))
+ return NULL;
+
+ /* Creates the array of arguments for vformat */
+ for (uint carg= 1; carg < arg_count; carg++)
+ {
+ switch (args[carg]->result_type())
+ {
+ case INT_RESULT:
+ vargs[carg-1]= fmt::detail::make_arg<ctx>(args[carg]->val_int());
+ break;
+ case DECIMAL_RESULT: // TODO
+ case REAL_RESULT:
+ if (args[carg]->field_type() == MYSQL_TYPE_FLOAT)
+ vargs[carg-1]= fmt::detail::make_arg<ctx>((float)args[carg]->val_real());
+ else
+ vargs[carg-1]= fmt::detail::make_arg<ctx>(args[carg]->val_real());
+ break;
+ case STRING_RESULT:
+ if (!(parg= args[carg]->val_str(&val_arg[carg-1])))
+ {
+ delete [] vargs;
+ return NULL;
+ }
+ vargs[carg-1]= fmt::detail::make_arg<ctx>(*parg);
+ break;
+ case TIME_RESULT: // TODO
+ case ROW_RESULT: // TODO
+ default:
+ DBUG_ASSERT(0);
+ delete [] vargs;
+ return NULL;
+ }
+ }
+
+ null_value= false;
+ /* Create the string output */
+ try
+ {
+ auto text = fmt::vformat(fmt_arg->c_ptr_safe(),
+ fmt::format_args(vargs, arg_count-1));
+ res->length(0);
+ res->set_charset(collation.collation);
+ res->append(text.c_str(), text.size(), fmt_arg->charset());
+ }
+ catch (const fmt::format_error &ex)
+ {
+ THD *thd= current_thd;
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
+ WARN_SFORMAT_ERROR,
+ ER_THD(thd, WARN_SFORMAT_ERROR), ex.what());
+ null_value= true;
+ }
+ delete [] vargs;
+ return null_value ? NULL : res;
+}
/*********************************************************************/
bool Item_func_regexp_replace::fix_length_and_dec()
@@ -4381,26 +4518,6 @@ err:
#endif
-String *Item_func_uuid::val_str(String *str)
-{
- DBUG_ASSERT(fixed());
- uchar guid[MY_UUID_SIZE];
- size_t length= (without_separators ?
- MY_UUID_ORACLE_STRING_LENGTH :
- MY_UUID_STRING_LENGTH);
-
- str->alloc(length+1);
- str->length(length);
- str->set_charset(system_charset_info);
- my_uuid(guid);
- if (without_separators)
- my_uuid2str_oracle(guid, (char *)str->ptr());
- else
- my_uuid2str(guid, (char *)str->ptr());
- return str;
-}
-
-
Item_func_dyncol_create::Item_func_dyncol_create(THD *thd, List<Item> &args,
DYNCALL_CREATE_DEF *dfs):
Item_str_func(thd, args), defs(dfs), vals(0), keys_num(NULL), keys_str(NULL),
@@ -5306,6 +5423,282 @@ String *Item_temptable_rowid::val_str(String *str)
return &str_value;
}
+/**
+ Helper routine to encode length prefix
+ in natsort_encode_numeric_string().
+
+ The idea is so that bigger input numbers correspond
+ lexicographically bigger output strings.
+
+ Note, that in real use the number would typically
+ small, as it only computes variable *length prefixes*.
+
+ @param[in] n - the number
+ @param[in] s - output string
+
+ @return - length of encoding
+
+ Here is how encoding works
+
+ - n is from 0 to 8
+ Output string calculated as '0'+n (range '0' - '8')
+
+ - n is from 9 to 17
+ Output calculated as concat('9', '0' + n -9)'
+ Output range: '90'-'98'
+
+ -n is from 18 to 26
+ Output calculated as concat('99', '0' + n -18)'
+ Output range '990'-'998'
+
+ - n is from 27 to SIZE_T_MAX
+ Output starts with '999',
+ then log10(n) is encoded as 2-digit decimal number
+ then the number itself is added.
+ Example : for 28 key is concat('999', '01' , '28')
+ i.e '9990128'
+
+ Key length is 5 + ceil(log10(n))
+
+ Output range is
+ (64bit)'9990128' - '9991918446744073709551615'
+ (32bit)'9990128' - '999094294967295'
+*/
+
+/* Largest length of encoded string.*/
+static size_t natsort_encode_length_max(size_t n)
+{
+ return (n < 27) ? n/9+1 : 26;
+}
+
+static void natsort_encode_length(size_t n, String* out)
+{
+ if (n < 27)
+ {
+ if (n >= 9)
+ out->fill(out->length() + n/9,'9');
+ out->append(char(n % 9 + '0'));
+ return;
+ }
+
+ size_t log10n= 0;
+ for (size_t tmp= n / 10; tmp; tmp/= 10)
+ log10n++;
+ out->fill(out->length() + 3, '9');
+ out->append('0' + (char) (log10n / 10));
+ out->append('0' + (char) (log10n % 10));
+ out->append_ulonglong(n);
+}
+
+enum class NATSORT_ERR
+{
+ SUCCESS= 0,
+ KEY_TOO_LARGE= 1,
+ ALLOC_ERROR= 2
+};
+
+/*
+ Encode numeric string for natural sorting.
+
+ @param[in] in - start of the numeric string
+ skipping leading zeros
+
+ @param[in] n_digits - length of the string,
+ in characters, not counting leading zeros.
+
+ @param[out] out - String to write to. The string should
+ have enough preallocated space to fit the encoded key.
+
+ @return
+ NATSORT_ERR::SUCCESS - success
+ NATSORT_ERR::KEY_TOO_LARGE - out string does not have enough
+ space left to accomodate the key.
+
+
+ The resulting encoding of the numeric string is then
+
+ CONCAT(natsort_encode_length(n_digits), in)
+*/
+static NATSORT_ERR natsort_encode_numeric_string(const char *in,
+ size_t n_digits,
+ String *out)
+{
+ DBUG_ASSERT(in);
+ DBUG_ASSERT(n_digits);
+
+ if (out->length() + natsort_encode_length_max(n_digits - 1) + n_digits >
+ out->alloced_length())
+ return NATSORT_ERR::KEY_TOO_LARGE;
+
+ natsort_encode_length(n_digits - 1, out);
+ out->append(in, n_digits);
+ return NATSORT_ERR::SUCCESS;
+}
+
+/*
+ Calculate max size of the natsort key.
+
+ A digit in string expands to 2 chars length_prefix , and the digit
+
+ With even length L=2N, the largest key corresponds to input string
+ in form REPEAT(<digit><letter>,N) and the length of a key is
+ 2N + N = 3N
+
+ With odd input length L=2N+1, largest key is built by appending
+ a digit at the end, with key length 3N+2
+
+*/
+static size_t natsort_max_key_size(size_t input_size)
+{
+ return input_size + (input_size + 1)/2 ;
+}
+
+/**
+ Convert a string to natural sort key.
+ @param[in] in - input string
+ @param[out] out - output string
+ @param[in] max_key_size - the maximum size of the output
+ key, in bytes.
+ @return NATSORT_ERR::SUCCESS - successful completion
+ NATSORT_ERR::ALLOC_ERROR - memory allocation error
+ NATSORT_ERR::KEY_TOO_LARGE - resulting key would exceed max_key_size
+*/
+static NATSORT_ERR to_natsort_key(const String *in, String *out,
+ size_t max_key_size)
+{
+ size_t n_digits= 0;
+ size_t n_lead_zeros= 0;
+ size_t num_start;
+ size_t reserve_length= std::min(
+ natsort_max_key_size(in->length()) + MAX_BIGINT_WIDTH + 2, max_key_size);
+
+ out->length(0);
+ out->set_charset(in->charset());
+
+ if (out->alloc((uint32) reserve_length))
+ return NATSORT_ERR::ALLOC_ERROR;
+
+ for (size_t pos= 0;; pos++)
+ {
+ char c= pos < in->length() ? (*in)[pos] : 0;
+ bool is_digit= (c >= '0' && c <= '9');
+ if (!is_digit && (n_digits || n_lead_zeros))
+ {
+ /* Handle end of digits run.*/
+ if (!n_digits)
+ {
+ /*We only have zeros.*/
+ n_lead_zeros--;
+ num_start= pos - 1;
+ n_digits= 1;
+ }
+ NATSORT_ERR err= natsort_encode_numeric_string(
+ in->ptr() + num_start, n_digits, out);
+ if (err != NATSORT_ERR::SUCCESS)
+ return err;
+
+ /* Reset state.*/
+ n_digits= 0;
+ num_start= size_t(-1);
+ n_lead_zeros= 0;
+ }
+
+ if (pos == in->length())
+ break;
+
+ if (!is_digit)
+ {
+ if (out->length() == max_key_size)
+ return NATSORT_ERR::KEY_TOO_LARGE;
+ out->append(c);
+ }
+ else if (c == '0' && !n_digits)
+ n_lead_zeros++;
+ else if (!n_digits++)
+ num_start= pos;
+ }
+ return NATSORT_ERR::SUCCESS;
+}
+
+String *Item_func_natural_sort_key::val_str(String *out)
+{
+ String *in= args[0]->val_str();
+ if (args[0]->null_value || !in)
+ {
+ null_value= true;
+ return nullptr;
+ }
+ NATSORT_ERR err= NATSORT_ERR::SUCCESS;
+ CHARSET_INFO *cs= in->charset();
+ ulong max_allowed_packet= current_thd->variables.max_allowed_packet;
+ uint errs;
+ String tmp;
+ /*
+ to_natsort_key() only support charsets where digits are represented by
+ a single byte in range 0x30-0x39. Almost everything is OK, just utf16/32
+ won't do. Full ASCII compatibility is not required, so that SJIS and SWE7
+ are fine.
+ */
+ if (cs->mbminlen != 1)
+ {
+ if (tmp.copy(in, &my_charset_utf8mb4_bin, &errs))
+ goto error_exit;
+ in= &tmp;
+ }
+
+ err= to_natsort_key(in, out, max_allowed_packet / cs->mbminlen);
+
+ if (err != NATSORT_ERR::SUCCESS)
+ {
+ if (err == NATSORT_ERR::KEY_TOO_LARGE)
+ {
+ push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_WARN_ALLOWED_PACKET_OVERFLOWED,
+ ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED), func_name(),
+ max_allowed_packet);
+ }
+ goto error_exit;
+ }
+
+ if (cs->mbminlen != 1)
+ {
+ /* output string is now utf8, convert to input charset.*/
+ if (tmp.copy(out, cs, &errs) || out->copy(tmp))
+ goto error_exit;
+ }
+ null_value= false;
+ return out;
+
+error_exit:
+ null_value= true;
+ return nullptr;
+}
+
+bool Item_func_natural_sort_key::fix_length_and_dec(void)
+{
+ if (agg_arg_charsets_for_string_result(collation, args, 1))
+ return true;
+ DBUG_ASSERT(collation.collation != NULL);
+ uint32 max_char_len=
+ (uint32) natsort_max_key_size(args[0]->max_char_length());
+ fix_char_length(max_char_len);
+
+ set_maybe_null(args[0]->maybe_null() ||
+ max_char_len * collation.collation->mbmaxlen >
+ current_thd->variables.max_allowed_packet);
+ return false;
+}
+
+/**
+ Disable use in stored virtual functions. Temporarily(?), until
+ the encoding is stable.
+*/
+bool Item_func_natural_sort_key::check_vcol_func_processor(void *arg)
+{
+ return mark_unsupported_function(func_name(), "()", arg,
+ VCOL_NON_DETERMINISTIC);
+}
+
#ifdef WITH_WSREP
#include "wsrep_mysqld.h"
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index d0bdbeabaa5..c183f1c1ac2 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -271,6 +271,25 @@ public:
{ return get_item_copy<Item_func_aes_decrypt>(thd, this); }
};
+class Item_func_natural_sort_key : public Item_str_func
+{
+public:
+ Item_func_natural_sort_key(THD *thd, Item *a)
+ : Item_str_func(thd, a){};
+ String *val_str(String *) override;
+ LEX_CSTRING func_name_cstring() const override
+ {
+ static LEX_CSTRING name= {STRING_WITH_LEN("natural_sort_key")};
+ return name;
+ }
+ bool fix_length_and_dec(void) override;
+ Item *get_copy(THD *thd) override
+ {
+ return get_item_copy<Item_func_natural_sort_key>(thd, this);
+ }
+
+ bool check_vcol_func_processor(void *arg) override;
+};
class Item_func_concat :public Item_str_func
{
@@ -586,6 +605,23 @@ public:
{ return get_item_copy<Item_func_substr>(thd, this); }
};
+class Item_func_sformat :public Item_str_func
+{
+ String *val_arg;
+public:
+ Item_func_sformat(THD *thd, List<Item> &list);
+ ~Item_func_sformat() { delete [] val_arg; }
+ String *val_str(String*) override;
+ bool fix_length_and_dec() override;
+ LEX_CSTRING func_name_cstring() const override
+ {
+ static LEX_CSTRING name= {STRING_WITH_LEN("sformat") };
+ return name;
+ }
+ Item *get_copy(THD *thd) override
+ { return get_item_copy<Item_func_sformat>(thd, this); }
+};
+
class Item_func_substr_oracle :public Item_func_substr
{
protected:
@@ -1995,40 +2031,6 @@ public:
};
-class Item_func_uuid: public Item_str_func
-{
- /* Set if uuid should be returned without separators (Oracle sys_guid) */
- bool without_separators;
-public:
-Item_func_uuid(THD *thd, bool without_separators_arg): Item_str_func(thd),
- without_separators(without_separators_arg)
- {}
- bool fix_length_and_dec() override
- {
- collation.set(DTCollation_numeric());
- fix_char_length(without_separators ? MY_UUID_ORACLE_STRING_LENGTH :
- MY_UUID_STRING_LENGTH);
- return FALSE;
- }
- bool const_item() const override { return false; }
- table_map used_tables() const override { return RAND_TABLE_BIT; }
- LEX_CSTRING func_name_cstring() const override
- {
- static LEX_CSTRING mariadb_name= {STRING_WITH_LEN("uuid") };
- static LEX_CSTRING oracle_name= {STRING_WITH_LEN("sys_guid") };
- return without_separators ? oracle_name : mariadb_name;
- }
- String *val_str(String *) override;
- bool check_vcol_func_processor(void *arg) override
- {
- return mark_unsupported_function(func_name(), "()", arg,
- VCOL_NON_DETERMINISTIC);
- }
- Item *get_copy(THD *thd) override
- { return get_item_copy<Item_func_uuid>(thd, this); }
-};
-
-
class Item_func_dyncol_create: public Item_str_func
{
protected:
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index fb811bcea6b..b1f913b64ef 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -1620,7 +1620,7 @@ bool Item_singlerow_subselect::get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t
Item_exists_subselect::Item_exists_subselect(THD *thd,
st_select_lex *select_lex):
- Item_subselect(thd), upper_not(NULL), abort_on_null(0),
+ Item_subselect(thd), upper_not(NULL),
emb_on_expr_nest(NULL), optimizer(0), exists_transformed(0)
{
DBUG_ENTER("Item_exists_subselect::Item_exists_subselect");
@@ -1705,7 +1705,6 @@ Item_allany_subselect::Item_allany_subselect(THD *thd, Item * left_exp,
func= func_creator(all_arg);
init(select_lex, new (thd->mem_root) select_exists_subselect(thd, this));
max_columns= 1;
- abort_on_null= 0;
reset();
//if test_limit will fail then error will be reported to client
test_limit(select_lex->master_unit());
@@ -2280,8 +2279,11 @@ bool Item_allany_subselect::is_maxmin_applicable(JOIN *join)
Check if max/min optimization applicable: It is top item of
WHERE condition.
*/
- return (abort_on_null || (upper_item && upper_item->is_top_level_item())) &&
- !(join->select_lex->master_unit()->uncacheable & ~UNCACHEABLE_EXPLAIN) && !func->eqne_op();
+ return ((is_top_level_item() ||
+ (upper_item && upper_item->is_top_level_item())) &&
+ !(join->select_lex->master_unit()->uncacheable &
+ ~UNCACHEABLE_EXPLAIN) &&
+ !func->eqne_op());
}
@@ -2351,7 +2353,7 @@ Item_in_subselect::create_single_in_to_exists_cond(JOIN *join,
ref_pointer_array[0],
{STRING_WITH_LEN("<ref>")},
field_name));
- if (!abort_on_null && left_expr->maybe_null())
+ if (!is_top_level_item() && left_expr->maybe_null())
{
/*
We can encounter "NULL IN (SELECT ...)". Wrap the added condition
@@ -2384,7 +2386,7 @@ Item_in_subselect::create_single_in_to_exists_cond(JOIN *join,
Item *orig_item= item;
item= func->create(thd, expr, item);
- if (!abort_on_null && orig_item->maybe_null())
+ if (!is_top_level_item() && orig_item->maybe_null())
{
having= new (thd->mem_root) Item_is_not_null_test(thd, this, having);
if (left_expr->maybe_null())
@@ -2406,7 +2408,7 @@ Item_in_subselect::create_single_in_to_exists_cond(JOIN *join,
If we may encounter NULL IN (SELECT ...) and care whether subquery
result is NULL or FALSE, wrap condition in a trig_cond.
*/
- if (!abort_on_null && left_expr->maybe_null())
+ if (!is_top_level_item() && left_expr->maybe_null())
{
disable_cond_guard_for_const_null_left_expr(0);
if (!(item= new (thd->mem_root) Item_func_trig_cond(thd, item,
@@ -2436,7 +2438,7 @@ Item_in_subselect::create_single_in_to_exists_cond(JOIN *join,
&select_lex->ref_pointer_array[0],
no_matter_name,
field_name));
- if (!abort_on_null && left_expr->maybe_null())
+ if (!is_top_level_item() && left_expr->maybe_null())
{
disable_cond_guard_for_const_null_left_expr(0);
if (!(new_having= new (thd->mem_root)
@@ -2635,7 +2637,7 @@ Item_in_subselect::create_row_in_to_exists_cond(JOIN * join,
list_ref));
Item *col_item= new (thd->mem_root)
Item_cond_or(thd, item_eq, item_isnull);
- if (!abort_on_null && left_expr->element_index(i)->maybe_null() &&
+ if (!is_top_level_item() && left_expr->element_index(i)->maybe_null() &&
get_cond_guard(i))
{
disable_cond_guard_for_const_null_left_expr(i);
@@ -2654,7 +2656,7 @@ Item_in_subselect::create_row_in_to_exists_cond(JOIN * join,
ref_pointer_array[i],
no_matter_name,
list_ref));
- if (!abort_on_null && left_expr->element_index(i)->maybe_null() &&
+ if (!is_top_level_item() && left_expr->element_index(i)->maybe_null() &&
get_cond_guard(i) )
{
disable_cond_guard_for_const_null_left_expr(i);
@@ -2695,7 +2697,7 @@ Item_in_subselect::create_row_in_to_exists_cond(JOIN * join,
ref_pointer_array[i],
no_matter_name,
list_ref));
- if (!abort_on_null && select_lex->ref_pointer_array[i]->maybe_null())
+ if (!is_top_level_item() && select_lex->ref_pointer_array[i]->maybe_null())
{
Item *having_col_item=
new (thd->mem_root)
@@ -2727,7 +2729,7 @@ Item_in_subselect::create_row_in_to_exists_cond(JOIN * join,
}
*having_item= and_items(thd, *having_item, having_col_item);
}
- if (!abort_on_null && left_expr->element_index(i)->maybe_null() &&
+ if (!is_top_level_item() && left_expr->element_index(i)->maybe_null() &&
get_cond_guard(i))
{
if (!(item= new (thd->mem_root)
@@ -3698,7 +3700,7 @@ bool Item_in_subselect::init_cond_guards()
{
DBUG_ASSERT(thd);
uint cols_num= left_expr->cols();
- if (!abort_on_null && !pushed_cond_guards &&
+ if (!is_top_level_item() && !pushed_cond_guards &&
(left_expr->maybe_null() || cols_num > 1))
{
if (!(pushed_cond_guards= (bool*)thd->alloc(sizeof(bool) * cols_num)))
@@ -4284,9 +4286,9 @@ bool subselect_uniquesubquery_engine::copy_ref_key(bool skip_constants)
- NULL if select produces empty row set
- FALSE otherwise.
- In some cases (IN subselect is a top level item, i.e. abort_on_null==TRUE)
- the caller doesn't distinguish between NULL and FALSE result and we just
- return FALSE.
+ In some cases (IN subselect is a top level item, i.e.
+ is_top_level_item() == TRUE, the caller doesn't distinguish between NULL and
+ FALSE result and we just return FALSE.
Otherwise we make a full table scan to see if there is at least one
matching row.
@@ -5141,7 +5143,7 @@ my_bitmap_init_memroot(MY_BITMAP *map, uint n_bits, MEM_ROOT *mem_root)
if (!(bitmap_buf= (my_bitmap_map*) alloc_root(mem_root,
bitmap_buffer_size(n_bits))) ||
- my_bitmap_init(map, bitmap_buf, n_bits, FALSE))
+ my_bitmap_init(map, bitmap_buf, n_bits))
return TRUE;
bitmap_clear_all(map);
return FALSE;
@@ -6033,7 +6035,7 @@ bool Ordered_key::alloc_keys_buffers()
lookup offset.
*/
/* Notice that max_null_row is max array index, we need count, so +1. */
- if (my_bitmap_init(&null_key, NULL, (uint)(max_null_row + 1), FALSE))
+ if (my_bitmap_init(&null_key, NULL, (uint)(max_null_row + 1)))
return TRUE;
cur_key_idx= HA_POS_ERROR;
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 426b76f8067..54e4f8f0ced 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -373,7 +373,6 @@ class Item_exists_subselect :public Item_subselect
protected:
Item_func_not *upper_not;
bool value; /* value of this item (boolean: exists/not-exists) */
- bool abort_on_null;
void init_length_and_dec();
bool select_prepare_to_be_in();
@@ -397,7 +396,7 @@ public:
Item_exists_subselect(THD *thd_arg, st_select_lex *select_lex);
Item_exists_subselect(THD *thd_arg):
- Item_subselect(thd_arg), upper_not(NULL), abort_on_null(0),
+ Item_subselect(thd_arg), upper_not(NULL),
emb_on_expr_nest(NULL), optimizer(0), exists_transformed(0)
{}
@@ -424,8 +423,6 @@ public:
bool fix_length_and_dec() override;
void print(String *str, enum_query_type query_type) override;
bool select_transformer(JOIN *join) override;
- void top_level_item() override { abort_on_null=1; }
- bool is_top_level_item() const override { return abort_on_null; }
bool exists2in_processor(void *opt_arg) override;
Item* expr_cache_insert_transformer(THD *thd, uchar *unused) override;
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index 2f4d34afc6d..a130be4f973 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -1232,13 +1232,13 @@ my_xpath_keyword(MY_XPATH *x,
static Item *create_func_true(MY_XPATH *xpath, Item **args, uint nargs)
{
- return (Item*) &Item_true;
+ return (Item*) Item_true;
}
static Item *create_func_false(MY_XPATH *xpath, Item **args, uint nargs)
{
- return (Item*) &Item_false;
+ return (Item*) Item_false;
}
diff --git a/sql/json_table.cc b/sql/json_table.cc
index 5fa8434fd67..164c05eff41 100644
--- a/sql/json_table.cc
+++ b/sql/json_table.cc
@@ -860,8 +860,7 @@ TABLE *create_table_for_function(THD *thd, TABLE_LIST *sql_table)
my_bitmap_map* bitmaps=
(my_bitmap_map*) thd->alloc(bitmap_buffer_size(field_count));
- my_bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count,
- FALSE);
+ my_bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count);
table->read_set= &table->def_read_set;
bitmap_clear_all(table->read_set);
table->alias_name_used= true;
diff --git a/sql/lex.h b/sql/lex.h
index cbf9d9d51b2..4ce88ccc2ee 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -110,6 +110,7 @@ SYMBOL symbols[] = {
{ "CHAIN", SYM(CHAIN_SYM)},
{ "CHANGE", SYM(CHANGE)},
{ "CHANGED", SYM(CHANGED)},
+ { "CHANNEL", SYM(CHANNEL_SYM)},
{ "CHAR", SYM(CHAR_SYM)},
{ "CHARACTER", SYM(CHAR_SYM)},
{ "CHARSET", SYM(CHARSET)},
@@ -567,6 +568,8 @@ SYMBOL symbols[] = {
{ "ROWTYPE", SYM(ROWTYPE_MARIADB_SYM)},
{ "ROW_COUNT", SYM(ROW_COUNT_SYM)},
{ "ROW_FORMAT", SYM(ROW_FORMAT_SYM)},
+ /** sql_function and condition_property_name for GET DIAGNOSTICS */
+ { "ROW_NUMBER", SYM(ROW_NUMBER_SYM)},
{ "RTREE", SYM(RTREE_SYM)},
{ "SAVEPOINT", SYM(SAVEPOINT_SYM)},
{ "SCHEDULE", SYM(SCHEDULE_SYM)},
@@ -781,7 +784,6 @@ SYMBOL sql_functions[] = {
{ "PERCENTILE_CONT", SYM(PERCENTILE_CONT_SYM)},
{ "PERCENTILE_DISC", SYM(PERCENTILE_DISC_SYM)},
{ "RANK", SYM(RANK_SYM)},
- { "ROW_NUMBER", SYM(ROW_NUMBER_SYM)},
{ "SESSION_USER", SYM(USER_SYM)},
{ "STD", SYM(STD_SYM)},
{ "STDDEV", SYM(STD_SYM)},
diff --git a/sql/lock.cc b/sql/lock.cc
index 9f53ffb3a69..ef8e93cdfcc 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2020, MariaDB
+ Copyright (c) 2020, 2021, MariaDB
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
@@ -1138,6 +1138,9 @@ void Global_read_lock::unlock_global_read_lock(THD *thd)
else if (WSREP_NNULL(thd) &&
server_state.state() == Wsrep_server_state::s_synced)
{
+ THD_STAGE_INFO(thd, stage_waiting_flow);
+ WSREP_DEBUG("unlock_global_read_lock: waiting for flow control for %s",
+ wsrep_thd_query(thd));
server_state.resume_and_resync();
wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED;
}
diff --git a/sql/log.cc b/sql/log.cc
index 81fe4b1e97d..468f171ae2c 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -2623,12 +2623,11 @@ static void setup_windows_event_source()
static int find_uniq_filename(char *name, ulong min_log_number_to_use,
ulong *last_used_log_number)
{
- uint i;
char buff[FN_REFLEN], ext_buf[FN_REFLEN];
struct st_my_dir *dir_info;
struct fileinfo *file_info;
ulong max_found= 0, next= 0, number= 0;
- size_t buf_length, length;
+ size_t i, buf_length, length;
char *start, *end;
int error= 0;
DBUG_ENTER("find_uniq_filename");
@@ -2959,7 +2958,7 @@ int MYSQL_BIN_LOG::generate_new_name(char *new_name, const char *log_name,
fn_format(new_name, log_name, mysql_data_home, "", 4);
if (!fn_ext(log_name)[0])
{
- if (DBUG_EVALUATE_IF("binlog_inject_new_name_error", TRUE, FALSE) ||
+ if (DBUG_IF("binlog_inject_new_name_error") ||
unlikely(find_uniq_filename(new_name, next_log_number,
&last_used_log_number)))
{
@@ -3529,7 +3528,7 @@ bool MYSQL_BIN_LOG::open_index_file(const char *index_file_name_arg,
mysql_file_seek(index_file_nr, 0L, MY_SEEK_END, MYF(0)),
0, MYF(MY_WME | MY_WAIT_IF_FULL),
m_key_file_log_index_cache) ||
- DBUG_EVALUATE_IF("fault_injection_openning_index", 1, 0))
+ DBUG_IF("fault_injection_openning_index"))
{
/*
TODO: all operations creating/deleting the index file or a log, should
@@ -3555,7 +3554,7 @@ bool MYSQL_BIN_LOG::open_index_file(const char *index_file_name_arg,
open_purge_index_file(FALSE) ||
purge_index_entry(NULL, NULL, need_mutex) ||
close_purge_index_file() ||
- DBUG_EVALUATE_IF("fault_injection_recovering_index", 1, 0))
+ DBUG_IF("fault_injection_recovering_index"))
{
sql_print_error("MYSQL_BIN_LOG::open_index_file failed to sync the index "
"file.");
@@ -3623,7 +3622,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
if (open_purge_index_file(TRUE) ||
register_create_index_entry(log_file_name) ||
sync_purge_index_file() ||
- DBUG_EVALUATE_IF("fault_injection_registering_index", 1, 0))
+ DBUG_IF("fault_injection_registering_index"))
{
/**
TODO:
@@ -3905,7 +3904,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
As this is a new log file, we write the file name to the index
file. As every time we write to the index file, we sync it.
*/
- if (DBUG_EVALUATE_IF("fault_injection_updating_index", 1, 0) ||
+ if (DBUG_IF("fault_injection_updating_index") ||
my_b_write(&index_file, (uchar*) log_file_name,
strlen(log_file_name)) ||
my_b_write(&index_file, (uchar*) "\n", 1) ||
@@ -5318,8 +5317,8 @@ int MYSQL_BIN_LOG::new_file_impl()
r.checksum_alg= relay_log_checksum_alg;
DBUG_ASSERT(!is_relay_log ||
relay_log_checksum_alg != BINLOG_CHECKSUM_ALG_UNDEF);
- if (DBUG_EVALUATE_IF("fault_injection_new_file_rotate_event",
- (error= close_on_error= TRUE), FALSE) ||
+ if ((DBUG_IF("fault_injection_new_file_rotate_event") &&
+ (error= close_on_error= TRUE)) ||
(error= write_event(&r)))
{
DBUG_EXECUTE_IF("fault_injection_new_file_rotate_event", errno= 2;);
@@ -6714,7 +6713,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate)
Write the event.
*/
if (write_event(event_info, cache_data, file) ||
- DBUG_EVALUATE_IF("injecting_fault_writing", 1, 0))
+ DBUG_IF("injecting_fault_writing"))
goto err;
error= 0;
@@ -8471,7 +8470,7 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
DEBUG_SYNC(leader->thd, "commit_loop_entry_commit_ordered");
++num_commits;
if (current->cache_mngr->using_xa && likely(!current->error) &&
- DBUG_EVALUATE_IF("skip_commit_ordered", 0, 1))
+ !DBUG_IF("skip_commit_ordered"))
run_commit_ordered(current->thd, current->all);
current->thd->wakeup_subsequent_commits(current->error);
diff --git a/sql/log_event.cc b/sql/log_event.cc
index b0d47ff496b..afca79b008a 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -3321,8 +3321,7 @@ Rows_log_event::Rows_log_event(const uchar *buf, uint event_len,
/* if my_bitmap_init fails, caught in is_valid() */
if (likely(!my_bitmap_init(&m_cols,
m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL,
- m_width,
- false)))
+ m_width)))
{
DBUG_PRINT("debug", ("Reading from %p", ptr_after_width));
memcpy(m_cols.bitmap, ptr_after_width, (m_width + 7) / 8);
@@ -3346,8 +3345,7 @@ Rows_log_event::Rows_log_event(const uchar *buf, uint event_len,
/* if my_bitmap_init fails, caught in is_valid() */
if (likely(!my_bitmap_init(&m_cols_ai,
m_width <= sizeof(m_bitbuf_ai)*8 ? m_bitbuf_ai : NULL,
- m_width,
- false)))
+ m_width)))
{
DBUG_PRINT("debug", ("Reading from %p", ptr_after_width));
memcpy(m_cols_ai.bitmap, ptr_after_width, (m_width + 7) / 8);
diff --git a/sql/log_event_client.cc b/sql/log_event_client.cc
index 067bfb7c54b..7e0bf7d8e4c 100644
--- a/sql/log_event_client.cc
+++ b/sql/log_event_client.cc
@@ -1184,7 +1184,7 @@ void Rows_log_event::change_to_flashback_event(PRINT_EVENT_INFO *print_event_inf
}
/* Copying rows from the end to the begining into event */
- for (uint i= rows_arr.elements; i > 0; --i)
+ for (size_t i= rows_arr.elements; i > 0; --i)
{
LEX_STRING *one_row= dynamic_element(&rows_arr, i - 1, LEX_STRING*);
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 4e6b9e3f1c8..1990103598e 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -1156,8 +1156,7 @@ Old_rows_log_event::Old_rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid,
/* if my_bitmap_init fails, caught in is_valid() */
if (likely(!my_bitmap_init(&m_cols,
m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL,
- m_width,
- false)))
+ m_width)))
{
/* Cols can be zero if this is a dummy binrows event */
if (likely(cols != NULL))
@@ -1232,8 +1231,7 @@ Old_rows_log_event::Old_rows_log_event(const uchar *buf, uint event_len,
/* if my_bitmap_init fails, caught in is_valid() */
if (likely(!my_bitmap_init(&m_cols,
m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL,
- m_width,
- false)))
+ m_width)))
{
DBUG_PRINT("debug", ("Reading from %p", ptr_after_width));
memcpy(m_cols.bitmap, ptr_after_width, (m_width + 7) / 8);
diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc
index 882dbcfc6a5..af5e90d119b 100644
--- a/sql/log_event_server.cc
+++ b/sql/log_event_server.cc
@@ -471,7 +471,7 @@ static void cleanup_load_tmpdir(LEX_CSTRING *connection_name)
{
MY_DIR *dirp;
FILEINFO *file;
- uint i;
+ size_t i;
char dir[FN_REFLEN], fname[FN_REFLEN];
char prefbuf[31 + MAX_CONNECTION_NAME* MAX_FILENAME_MBWIDTH + 1];
DBUG_ENTER("cleanup_load_tmpdir");
@@ -492,7 +492,7 @@ static void cleanup_load_tmpdir(LEX_CSTRING *connection_name)
load_data_tmp_prefix(prefbuf, connection_name);
DBUG_PRINT("enter", ("dir: '%s' prefix: '%s'", dir, prefbuf));
- for (i=0 ; i < (uint)dirp->number_of_files; i++)
+ for (i=0 ; i < dirp->number_of_files; i++)
{
file=dirp->dir_entry+i;
if (is_prefix(file->name, prefbuf))
@@ -5228,8 +5228,7 @@ Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid,
/* if my_bitmap_init fails, caught in is_valid() */
if (likely(!my_bitmap_init(&m_cols,
m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL,
- m_width,
- false)))
+ m_width)))
{
/* Cols can be zero if this is a dummy binrows event */
if (likely(cols != NULL))
@@ -6459,7 +6458,7 @@ int Table_map_log_event::do_apply_event(rpl_group_info *rgi)
LEX_CSTRING tmp_tbl_name= {tname_mem, tname_mem_length };
table_list->init_one_table(&tmp_db_name, &tmp_tbl_name, 0, TL_WRITE);
- table_list->table_id= DBUG_EVALUATE_IF("inject_tblmap_same_id_maps_diff_table", 0, m_table_id);
+ table_list->table_id= DBUG_IF("inject_tblmap_same_id_maps_diff_table") ? 0 : m_table_id;
table_list->updating= 1;
table_list->required_type= TABLE_TYPE_NORMAL;
@@ -6699,7 +6698,7 @@ void Table_map_log_event::init_metadata_fields()
if (binlog_row_metadata == BINLOG_ROW_METADATA_FULL)
{
- if (DBUG_EVALUATE_IF("dont_log_column_name", 0, init_column_name_field()) ||
+ if ((!DBUG_IF("dont_log_column_name") && init_column_name_field()) ||
init_charset_field(&is_enum_or_set_field, ENUM_AND_SET_DEFAULT_CHARSET,
ENUM_AND_SET_COLUMN_CHARSET) ||
init_set_str_value_field() ||
@@ -8281,8 +8280,7 @@ void Update_rows_log_event::init(MY_BITMAP const *cols)
/* if my_bitmap_init fails, caught in is_valid() */
if (likely(!my_bitmap_init(&m_cols_ai,
m_width <= sizeof(m_bitbuf_ai)*8 ? m_bitbuf_ai : NULL,
- m_width,
- false)))
+ m_width)))
{
/* Cols can be zero if this is a dummy binrows event */
if (likely(cols != NULL))
diff --git a/sql/mdl.cc b/sql/mdl.cc
index bd5d6aa7db3..c2475bb3b91 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2007, 2012, Oracle and/or its affiliates.
- Copyright (c) 2020, MariaDB
+ Copyright (c) 2020, 2021, MariaDB
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
@@ -2304,6 +2304,20 @@ MDL_context::acquire_lock(MDL_request *mdl_request, double lock_wait_timeout)
DBUG_RETURN(TRUE);
}
+#ifdef WITH_WSREP
+ if (WSREP(get_thd()))
+ {
+ THD* requester= get_thd();
+ bool requester_toi= wsrep_thd_is_toi(requester) || wsrep_thd_is_applying(requester);
+ WSREP_DEBUG("::acquire_lock is TOI %d for %s", requester_toi,
+ wsrep_thd_query(requester));
+ if (requester_toi)
+ THD_STAGE_INFO(requester, stage_waiting_ddl);
+ else
+ THD_STAGE_INFO(requester, stage_waiting_isolation);
+ }
+#endif /* WITH_WSREP */
+
lock->m_waiting.add_ticket(ticket);
/*
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 854fcd61b82..ea1bfa1aaf3 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -369,6 +369,7 @@ uint volatile global_disable_checkpoint;
ulong slow_start_timeout;
#endif
static MEM_ROOT startup_root;
+MEM_ROOT read_only_root;
/**
@brief 'grant_option' is used to indicate if privileges needs
@@ -641,7 +642,23 @@ struct system_variables max_system_variables;
struct system_status_var global_status_var;
MY_TMPDIR mysql_tmpdir_list;
-MY_BITMAP temp_pool;
+static MY_BITMAP temp_pool;
+static mysql_mutex_t LOCK_temp_pool;
+
+void temp_pool_clear_bit(uint bit)
+{
+ mysql_mutex_lock(&LOCK_temp_pool);
+ bitmap_clear_bit(&temp_pool, bit);
+ mysql_mutex_unlock(&LOCK_temp_pool);
+}
+
+uint temp_pool_set_next()
+{
+ mysql_mutex_lock(&LOCK_temp_pool);
+ uint res= bitmap_set_next(&temp_pool);
+ mysql_mutex_unlock(&LOCK_temp_pool);
+ return res;
+}
CHARSET_INFO *system_charset_info, *files_charset_info ;
CHARSET_INFO *national_charset_info, *table_alias_charset;
@@ -888,7 +905,7 @@ PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_xid_list,
key_LOCK_manager, key_LOCK_backup_log,
key_LOCK_prepared_stmt_count,
key_LOCK_rpl_status, key_LOCK_server_started,
- key_LOCK_status,
+ key_LOCK_status, key_LOCK_temp_pool,
key_LOCK_system_variables_hash, key_LOCK_thd_data, key_LOCK_thd_kill,
key_LOCK_user_conn, key_LOCK_uuid_short_generator, key_LOG_LOCK_log,
key_master_info_data_lock, key_master_info_run_lock,
@@ -946,6 +963,7 @@ static PSI_mutex_info all_server_mutexes[]=
{ &key_hash_filo_lock, "hash_filo::lock", 0},
{ &key_LOCK_active_mi, "LOCK_active_mi", PSI_FLAG_GLOBAL},
{ &key_LOCK_backup_log, "LOCK_backup_log", PSI_FLAG_GLOBAL},
+ { &key_LOCK_temp_pool, "LOCK_temp_pool", PSI_FLAG_GLOBAL},
{ &key_LOCK_thread_id, "LOCK_thread_id", PSI_FLAG_GLOBAL},
{ &key_LOCK_crypt, "LOCK_crypt", PSI_FLAG_GLOBAL},
{ &key_LOCK_delayed_create, "LOCK_delayed_create", PSI_FLAG_GLOBAL},
@@ -1510,6 +1528,16 @@ static void end_ssl();
#ifndef EMBEDDED_LIBRARY
+extern Atomic_counter<uint32_t> local_connection_thread_count;
+
+uint THD_count::connection_thd_count()
+{
+ return value() -
+ binlog_dump_thread_count -
+ local_connection_thread_count;
+}
+
+
/****************************************************************************
** Code to end mysqld
****************************************************************************/
@@ -1537,7 +1565,7 @@ static my_bool kill_thread_phase_1(THD *thd, int *n_threads_awaiting_ack)
++(*n_threads_awaiting_ack)))
return 0;
- if (DBUG_EVALUATE_IF("only_kill_system_threads", !thd->system_thread, 0))
+ if (DBUG_IF("only_kill_system_threads") ? !thd->system_thread : 0)
return 0;
thd->awake(KILL_SERVER_HARD);
return 0;
@@ -1767,10 +1795,8 @@ static void close_connections(void)
*/
DBUG_PRINT("info", ("THD_count: %u", THD_count::value()));
- for (int i= 0; (THD_count::value() - binlog_dump_thread_count -
- n_threads_awaiting_ack) &&
- i < 1000;
- i++)
+ for (int i= 0; THD_count::connection_thd_count() - n_threads_awaiting_ack
+ && i < 1000; i++)
my_sleep(20000);
if (global_system_variables.log_warnings)
@@ -1785,16 +1811,14 @@ static void close_connections(void)
#endif
/* All threads has now been aborted */
DBUG_PRINT("quit", ("Waiting for threads to die (count=%u)",
- THD_count::value() - binlog_dump_thread_count -
- n_threads_awaiting_ack));
+ THD_count::connection_thd_count() - n_threads_awaiting_ack));
- while (THD_count::value() - binlog_dump_thread_count -
- n_threads_awaiting_ack)
+ while (THD_count::connection_thd_count() - n_threads_awaiting_ack)
my_sleep(1000);
/* Kill phase 2 */
server_threads.iterate(kill_thread_phase_2);
- for (uint64 i= 0; THD_count::value(); i++)
+ for (uint64 i= 0; THD_count::value() > local_connection_thread_count; i++)
{
/*
This time the warnings are emitted within the loop to provide a
@@ -2006,6 +2030,8 @@ static void clean_up(bool print_message)
mysql_library_end();
finish_client_errs();
free_root(&startup_root, MYF(0));
+ protect_root(&read_only_root, PROT_READ | PROT_WRITE);
+ free_root(&read_only_root, MYF(0));
cleanup_errmsgs();
free_error_messages();
/* Tell main we are ready */
@@ -2085,6 +2111,7 @@ static void clean_up_mutexes()
mysql_mutex_destroy(&LOCK_active_mi);
mysql_rwlock_destroy(&LOCK_ssl_refresh);
mysql_mutex_destroy(&LOCK_backup_log);
+ mysql_mutex_destroy(&LOCK_temp_pool);
mysql_rwlock_destroy(&LOCK_sys_init_connect);
mysql_rwlock_destroy(&LOCK_sys_init_slave);
mysql_mutex_destroy(&LOCK_global_system_variables);
@@ -3280,7 +3307,7 @@ void my_message_sql(uint error, const char *str, myf MyFlags)
{
if (unlikely(MyFlags & ME_FATAL))
thd->is_fatal_error= 1;
- (void) thd->raise_condition(error, NULL, level, str);
+ (void) thd->raise_condition(error, "\0\0\0\0\0", level, str);
}
else
mysql_audit_general(0, MYSQL_AUDIT_GENERAL_ERROR, error, str);
@@ -3394,7 +3421,6 @@ SHOW_VAR com_status_vars[]= {
{"alter_server", STMT_STATUS(SQLCOM_ALTER_SERVER)},
{"alter_sequence", STMT_STATUS(SQLCOM_ALTER_SEQUENCE)},
{"alter_table", STMT_STATUS(SQLCOM_ALTER_TABLE)},
- {"alter_tablespace", STMT_STATUS(SQLCOM_ALTER_TABLESPACE)},
{"alter_user", STMT_STATUS(SQLCOM_ALTER_USER)},
{"analyze", STMT_STATUS(SQLCOM_ANALYZE)},
{"assign_to_keycache", STMT_STATUS(SQLCOM_ASSIGN_TO_KEYCACHE)},
@@ -3768,6 +3794,8 @@ static int init_early_variables()
set_malloc_size_cb(my_malloc_size_cb_func);
global_status_var.global_memory_used= 0;
init_alloc_root(PSI_NOT_INSTRUMENTED, &startup_root, 1024, 0, MYF(0));
+ init_alloc_root(PSI_NOT_INSTRUMENTED, &read_only_root, 1024, 0,
+ MYF(MY_ROOT_USE_MPROTECT));
return 0;
}
@@ -4272,7 +4300,7 @@ static int init_common_variables()
#endif /* defined(ENABLED_DEBUG_SYNC) */
#if (ENABLE_TEMP_POOL)
- if (use_temp_pool && my_bitmap_init(&temp_pool,0,1024,1))
+ if (use_temp_pool && my_bitmap_init(&temp_pool,0,1024))
return 1;
#else
use_temp_pool= 0;
@@ -4399,6 +4427,7 @@ static int init_thread_environment()
mysql_mutex_init(key_LOCK_commit_ordered, &LOCK_commit_ordered,
MY_MUTEX_INIT_SLOW);
mysql_mutex_init(key_LOCK_backup_log, &LOCK_backup_log, MY_MUTEX_INIT_FAST);
+ mysql_mutex_init(key_LOCK_temp_pool, &LOCK_temp_pool, MY_MUTEX_INIT_FAST);
#ifdef HAVE_OPENSSL
mysql_mutex_init(key_LOCK_des_key_file,
@@ -5080,6 +5109,7 @@ static int init_server_components()
init_global_table_stats();
init_global_index_stats();
+ init_update_queries();
/* Allow storage engine to give real error messages */
if (unlikely(ha_init_errors()))
@@ -5087,6 +5117,9 @@ static int init_server_components()
tc_log= 0; // ha_initialize_handlerton() needs that
+ if (!opt_abort && ddl_log_initialize())
+ unireg_abort(1);
+
if (plugin_init(&remaining_argc, remaining_argv,
(opt_noacl ? PLUGIN_INIT_SKIP_PLUGIN_TABLE : 0) |
(opt_abort ? PLUGIN_INIT_SKIP_INITIALIZATION : 0)))
@@ -5330,9 +5363,6 @@ static int init_server_components()
}
#endif
- if (ddl_log_initialize())
- unireg_abort(1);
-
tc_log= get_tc_log_implementation();
if (tc_log->open(opt_bin_log ? opt_bin_logname : opt_tc_log_file))
@@ -5416,12 +5446,15 @@ static int init_server_components()
ft_init_stopwords();
init_max_user_conn();
- init_update_queries();
init_global_user_stats();
init_global_client_stats();
if (!opt_bootstrap)
servers_init(0);
init_status_vars();
+ Item_false= new (&read_only_root) Item_bool_static("FALSE", 0);
+ Item_true= new (&read_only_root) Item_bool_static("TRUE", 1);
+ DBUG_ASSERT(Item_false);
+
DBUG_RETURN(0);
}
@@ -5785,6 +5818,9 @@ int mysqld_main(int argc, char **argv)
}
#endif /* WITH_WSREP */
+ /* Protect read_only_root against writes */
+ protect_root(&read_only_root, PROT_READ);
+
if (opt_bootstrap)
{
select_thread_in_use= 0; // Allow 'kill' to work
@@ -9210,6 +9246,14 @@ PSI_stage_info stage_starting= { 0, "starting", 0};
PSI_stage_info stage_waiting_for_flush= { 0, "Waiting for non trans tables to be flushed", 0};
PSI_stage_info stage_waiting_for_ddl= { 0, "Waiting for DDLs", 0};
+#ifdef WITH_WSREP
+// Aditional Galera thread states
+PSI_stage_info stage_waiting_isolation= { 0, "Waiting to execute in isolation", 0};
+PSI_stage_info stage_waiting_certification= {0, "Waiting for certification", 0};
+PSI_stage_info stage_waiting_ddl= {0, "Waiting for TOI DDL", 0};
+PSI_stage_info stage_waiting_flow= {0, "Waiting for flow control", 0};
+#endif /* WITH_WSREP */
+
PSI_memory_key key_memory_DATE_TIME_FORMAT;
PSI_memory_key key_memory_DDL_LOG_MEMORY_ENTRY;
PSI_memory_key key_memory_Event_queue_element_for_exec_names;
@@ -9429,6 +9473,13 @@ PSI_stage_info *all_server_stages[]=
& stage_reading_semi_sync_ack,
& stage_waiting_for_deadlock_kill,
& stage_starting
+#ifdef WITH_WSREP
+ ,
+ & stage_waiting_isolation,
+ & stage_waiting_certification,
+ & stage_waiting_ddl,
+ & stage_waiting_flow
+#endif /* WITH_WSREP */
};
PSI_socket_key key_socket_tcpip, key_socket_unix, key_socket_client_connection;
diff --git a/sql/mysqld.h b/sql/mysqld.h
index 7d41f61c4df..48405a77e87 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2006, 2016, Oracle and/or its affiliates.
- Copyright (c) 2010, 2020, MariaDB Corporation.
+ Copyright (c) 2010, 2021, 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
@@ -100,7 +100,9 @@ extern CHARSET_INFO *error_message_charset_info;
extern CHARSET_INFO *character_set_filesystem;
-extern MY_BITMAP temp_pool;
+void temp_pool_clear_bit(uint bit);
+uint temp_pool_set_next();
+
extern bool opt_large_files;
extern bool opt_update_log, opt_bin_log, opt_error_log, opt_bin_log_compress;
extern uint opt_bin_log_compress_min_len;
@@ -677,6 +679,13 @@ extern PSI_stage_info stage_slave_background_process_request;
extern PSI_stage_info stage_slave_background_wait_request;
extern PSI_stage_info stage_waiting_for_deadlock_kill;
extern PSI_stage_info stage_starting;
+#ifdef WITH_WSREP
+// Aditional Galera thread states
+extern PSI_stage_info stage_waiting_isolation;
+extern PSI_stage_info stage_waiting_certification;
+extern PSI_stage_info stage_waiting_ddl;
+extern PSI_stage_info stage_waiting_flow;
+#endif /* WITH_WSREP */
#ifdef HAVE_PSI_STATEMENT_INTERFACE
/**
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 6366b957377..7909f5b35f9 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1308,7 +1308,7 @@ QUICK_RANGE_SELECT::QUICK_RANGE_SELECT(THD *thd, TABLE *table, uint key_nr,
*create_error= 1;
}
else
- my_bitmap_init(&column_bitmap, bitmap, head->s->fields, FALSE);
+ my_bitmap_init(&column_bitmap, bitmap, head->s->fields);
DBUG_VOID_RETURN;
}
@@ -2577,7 +2577,7 @@ static int fill_used_fields_bitmap(PARAM *param)
param->fields_bitmap_size= table->s->column_bitmap_size;
if (!(tmp= (my_bitmap_map*) alloc_root(param->mem_root,
param->fields_bitmap_size)) ||
- my_bitmap_init(&param->needed_fields, tmp, table->s->fields, FALSE))
+ my_bitmap_init(&param->needed_fields, tmp, table->s->fields))
return 1;
bitmap_copy(&param->needed_fields, table->read_set);
@@ -3368,7 +3368,7 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond)
my_bitmap_map* buf;
if (!(buf= (my_bitmap_map*)thd->alloc(table->s->column_bitmap_size)))
DBUG_RETURN(TRUE);
- my_bitmap_init(&handled_columns, buf, table->s->fields, FALSE);
+ my_bitmap_init(&handled_columns, buf, table->s->fields);
/*
Calculate the selectivity of the range conditions supported by indexes.
@@ -4156,7 +4156,7 @@ static int find_used_partitions_imerge_list(PART_PRUNE_PARAM *ppar,
*/
return find_used_partitions_imerge(ppar, merges.head());
}
- my_bitmap_init(&all_merges, bitmap_buf, n_bits, FALSE);
+ my_bitmap_init(&all_merges, bitmap_buf, n_bits);
bitmap_set_prefix(&all_merges, n_bits);
List_iterator<SEL_IMERGE> it(merges);
@@ -4812,8 +4812,7 @@ static bool create_partition_index_description(PART_PRUNE_PARAM *ppar)
uint32 bufsize= bitmap_buffer_size(ppar->part_info->num_subparts);
if (!(buf= (my_bitmap_map*) alloc_root(alloc, bufsize)))
return TRUE;
- my_bitmap_init(&ppar->subparts_bitmap, buf, ppar->part_info->num_subparts,
- FALSE);
+ my_bitmap_init(&ppar->subparts_bitmap, buf, ppar->part_info->num_subparts);
}
range_par->key_parts= key_part;
Field **field= (ppar->part_fields)? part_info->part_field_array :
@@ -5640,7 +5639,7 @@ bool create_fields_bitmap(PARAM *param, MY_BITMAP *fields_bitmap)
if (!(bitmap_buf= (my_bitmap_map *) alloc_root(param->mem_root,
param->fields_bitmap_size)))
return TRUE;
- if (my_bitmap_init(fields_bitmap, bitmap_buf, param->table->s->fields, FALSE))
+ if (my_bitmap_init(fields_bitmap, bitmap_buf, param->table->s->fields))
return TRUE;
return FALSE;
@@ -6552,7 +6551,7 @@ ROR_SCAN_INFO *make_ror_scan(const PARAM *param, int idx, SEL_ARG *sel_arg)
DBUG_RETURN(NULL);
if (my_bitmap_init(&ror_scan->covered_fields, bitmap_buf,
- param->table->s->fields, FALSE))
+ param->table->s->fields))
DBUG_RETURN(NULL);
bitmap_clear_all(&ror_scan->covered_fields);
@@ -6669,8 +6668,7 @@ ROR_INTERSECT_INFO* ror_intersect_init(const PARAM *param)
if (!(buf= (my_bitmap_map*) alloc_root(param->mem_root,
param->fields_bitmap_size)))
return NULL;
- if (my_bitmap_init(&info->covered_fields, buf, param->table->s->fields,
- FALSE))
+ if (my_bitmap_init(&info->covered_fields, buf, param->table->s->fields))
return NULL;
info->is_covering= FALSE;
info->index_scan_costs= 0.0;
@@ -7315,7 +7313,7 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param,
param->fields_bitmap_size);
if (!covered_fields->bitmap ||
my_bitmap_init(covered_fields, covered_fields->bitmap,
- param->table->s->fields, FALSE))
+ param->table->s->fields))
DBUG_RETURN(0);
bitmap_clear_all(covered_fields);
@@ -12650,10 +12648,10 @@ int QUICK_RANGE_SELECT::reset()
if (!mrr_buf_desc)
empty_buf.buffer= empty_buf.buffer_end= empty_buf.end_of_used_area= NULL;
-
- error= file->multi_range_read_init(&seq_funcs, (void*)this, ranges.elements,
- mrr_flags, mrr_buf_desc? mrr_buf_desc:
- &empty_buf);
+
+ error= file->multi_range_read_init(&seq_funcs, (void*)this,
+ (uint)ranges.elements, mrr_flags,
+ mrr_buf_desc? mrr_buf_desc: &empty_buf);
err:
/* Restore bitmaps set on entry */
if (in_ror_merged_scan)
@@ -12765,7 +12763,7 @@ int QUICK_RANGE_SELECT::get_next_prefix(uint prefix_length,
}
}
- uint count= ranges.elements - (uint)(cur_range - (QUICK_RANGE**) ranges.buffer);
+ size_t count= ranges.elements - (size_t)(cur_range - (QUICK_RANGE**) ranges.buffer);
if (count == 0)
{
/* Ranges have already been used up before. None is left for read. */
@@ -12810,7 +12808,7 @@ int QUICK_RANGE_SELECT_GEOM::get_next()
DBUG_RETURN(result);
}
- uint count= ranges.elements - (uint)(cur_range - (QUICK_RANGE**) ranges.buffer);
+ size_t count= ranges.elements - (size_t)(cur_range - (QUICK_RANGE**) ranges.buffer);
if (count == 0)
{
/* Ranges have already been used up before. None is left for read. */
@@ -12851,9 +12849,9 @@ int QUICK_RANGE_SELECT_GEOM::get_next()
bool QUICK_RANGE_SELECT::row_in_ranges()
{
QUICK_RANGE *res;
- uint min= 0;
- uint max= ranges.elements - 1;
- uint mid= (max + min)/2;
+ size_t min= 0;
+ size_t max= ranges.elements - 1;
+ size_t mid= (max + min)/2;
while (min != max)
{
@@ -15839,7 +15837,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max_in_range()
DBUG_ASSERT(min_max_ranges.elements > 0);
- for (uint range_idx= min_max_ranges.elements; range_idx > 0; range_idx--)
+ for (size_t range_idx= min_max_ranges.elements; range_idx > 0; range_idx--)
{ /* Search from the right-most range to the left. */
get_dynamic(&min_max_ranges, (uchar*)&cur_range, range_idx - 1);
@@ -16385,7 +16383,7 @@ void QUICK_GROUP_MIN_MAX_SELECT::dbug_dump(int indent, bool verbose)
}
if (min_max_ranges.elements > 0)
{
- fprintf(DBUG_FILE, "%*susing %d quick_ranges for MIN/MAX:\n",
+ fprintf(DBUG_FILE, "%*susing %zu quick_ranges for MIN/MAX:\n",
indent, "", min_max_ranges.elements);
}
}
diff --git a/sql/opt_split.cc b/sql/opt_split.cc
index 18710e85624..85e2df2dbb3 100644
--- a/sql/opt_split.cc
+++ b/sql/opt_split.cc
@@ -707,7 +707,7 @@ double spl_postjoin_oper_cost(THD *thd, double join_record_count, uint rec_len)
void JOIN::add_keyuses_for_splitting()
{
uint i;
- uint idx;
+ size_t idx;
KEYUSE_EXT *keyuse_ext;
KEYUSE_EXT keyuse_ext_end;
double oper_cost;
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index 88b1428f2b1..a74ec6ae5fe 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -4496,7 +4496,7 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd)
STEP 1: Get temporary table name
*/
if (use_temp_pool && !(test_flags & TEST_KEEP_TMP_TABLES))
- temp_pool_slot = bitmap_lock_set_next(&temp_pool);
+ temp_pool_slot = temp_pool_set_next();
if (temp_pool_slot != MY_BIT_NONE) // we got a slot
sprintf(path, "%s-subquery-%lx-%i", tmp_file_prefix,
@@ -4533,7 +4533,7 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd)
NullS))
{
if (temp_pool_slot != MY_BIT_NONE)
- bitmap_lock_clear_bit(&temp_pool, temp_pool_slot);
+ temp_pool_clear_bit(temp_pool_slot);
DBUG_RETURN(TRUE);
}
strmov(tmpname,path);
@@ -4743,7 +4743,7 @@ err:
thd->mem_root= mem_root_save;
free_tmp_table(thd,table); /* purecov: inspected */
if (temp_pool_slot != MY_BIT_NONE)
- bitmap_lock_clear_bit(&temp_pool, temp_pool_slot);
+ temp_pool_clear_bit(temp_pool_slot);
DBUG_RETURN(TRUE); /* purecov: inspected */
}
diff --git a/sql/opt_table_elimination.cc b/sql/opt_table_elimination.cc
index a6f0ac24719..8c4720bdec4 100644
--- a/sql/opt_table_elimination.cc
+++ b/sql/opt_table_elimination.cc
@@ -1070,7 +1070,7 @@ bool Dep_analysis_context::setup_equality_modules_deps(List<Dep_module>
void *buf;
if (!(buf= thd->alloc(bitmap_buffer_size(offset))) ||
- my_bitmap_init(&expr_deps, (my_bitmap_map*)buf, offset, FALSE))
+ my_bitmap_init(&expr_deps, (my_bitmap_map*)buf, offset))
{
DBUG_RETURN(TRUE); /* purecov: inspected */
}
diff --git a/sql/partition_element.h b/sql/partition_element.h
index e0a519065cc..c551baa3092 100644
--- a/sql/partition_element.h
+++ b/sql/partition_element.h
@@ -111,7 +111,6 @@ public:
ha_rows part_min_rows;
longlong range_value;
const char *partition_name;
- const char *tablespace_name;
struct st_ddl_log_memory_entry *log_entry;
const char* part_comment;
const char* data_file_name;
@@ -129,7 +128,7 @@ public:
partition_element()
: part_max_rows(0), part_min_rows(0), range_value(0),
- partition_name(NULL), tablespace_name(NULL),
+ partition_name(NULL),
log_entry(NULL), part_comment(NULL),
data_file_name(NULL), index_file_name(NULL),
engine_type(NULL), connect_string(null_clex_str), part_state(PART_NORMAL),
@@ -143,7 +142,6 @@ public:
: part_max_rows(part_elem->part_max_rows),
part_min_rows(part_elem->part_min_rows),
range_value(0), partition_name(NULL),
- tablespace_name(part_elem->tablespace_name),
log_entry(NULL),
part_comment(part_elem->part_comment),
data_file_name(part_elem->data_file_name),
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index d45c8592bfe..3d0669e249a 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -2466,7 +2466,7 @@ bool partition_info::has_same_partitioning(partition_info *new_part_info)
partition_element *new_part_elem= new_part_it++;
/*
The following must match:
- partition_name, tablespace_name, data_file_name, index_file_name,
+ partition_name, data_file_name, index_file_name,
engine_type, part_max_rows, part_min_rows, nodegroup_id.
(max_value, signed_flag, has_null_value only on partition level,
RANGE/LIST)
@@ -2552,9 +2552,7 @@ bool partition_info::has_same_partitioning(partition_info *new_part_info)
if (strcmp_null(sub_part_elem->data_file_name,
new_sub_part_elem->data_file_name) ||
strcmp_null(sub_part_elem->index_file_name,
- new_sub_part_elem->index_file_name) ||
- strcmp_null(sub_part_elem->tablespace_name,
- new_sub_part_elem->tablespace_name))
+ new_sub_part_elem->index_file_name))
DBUG_RETURN(false);
} while (++j < num_subparts);
@@ -2570,9 +2568,7 @@ bool partition_info::has_same_partitioning(partition_info *new_part_info)
if (strcmp_null(part_elem->data_file_name,
new_part_elem->data_file_name) ||
strcmp_null(part_elem->index_file_name,
- new_part_elem->index_file_name) ||
- strcmp_null(part_elem->tablespace_name,
- new_part_elem->tablespace_name))
+ new_part_elem->index_file_name))
DBUG_RETURN(false);
}
} while (++i < num_parts);
diff --git a/sql/partition_info.h b/sql/partition_info.h
index 55ea20cf681..46e17044b85 100644
--- a/sql/partition_info.h
+++ b/sql/partition_info.h
@@ -79,7 +79,7 @@ struct Vers_part_info : public Sql_alloc
partition_element *hist_part;
};
-class partition_info : public Sql_alloc
+class partition_info : public DDL_LOG_STATE, public Sql_alloc
{
public:
/*
@@ -154,10 +154,6 @@ public:
Item *item_free_list;
- struct st_ddl_log_memory_entry *first_log_entry;
- struct st_ddl_log_memory_entry *exec_log_entry;
- struct st_ddl_log_memory_entry *frm_log_entry;
-
/*
Bitmaps of partitions used by the current query.
* read_partitions - partitions to be used for reading.
@@ -297,7 +293,6 @@ public:
part_field_buffers(NULL), subpart_field_buffers(NULL),
restore_part_field_ptrs(NULL), restore_subpart_field_ptrs(NULL),
part_expr(NULL), subpart_expr(NULL), item_free_list(NULL),
- first_log_entry(NULL), exec_log_entry(NULL), frm_log_entry(NULL),
bitmaps_are_initialized(FALSE),
list_array(NULL), vers_info(NULL), err_value(0),
part_info_string(NULL),
@@ -319,6 +314,7 @@ public:
is_auto_partitioned(FALSE),
has_null_value(FALSE), column_list(FALSE)
{
+ bzero((DDL_LOG_STATE *) this, sizeof(DDL_LOG_STATE));
all_fields_in_PF.clear_all();
all_fields_in_PPF.clear_all();
all_fields_in_SPF.clear_all();
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc
index eecc6040051..306ae878060 100644
--- a/sql/rpl_gtid.cc
+++ b/sql/rpl_gtid.cc
@@ -249,8 +249,9 @@ rpl_slave_state::rpl_slave_state()
{
mysql_mutex_init(key_LOCK_slave_state, &LOCK_slave_state,
MY_MUTEX_INIT_SLOW);
- my_hash_init(PSI_INSTRUMENT_ME, &hash, &my_charset_bin, 32, offsetof(element, domain_id),
- sizeof(uint32), NULL, rpl_slave_state_free_element, HASH_UNIQUE);
+ my_hash_init(PSI_INSTRUMENT_ME, &hash, &my_charset_bin, 32,
+ offsetof(element, domain_id), sizeof(element::domain_id),
+ NULL, rpl_slave_state_free_element, HASH_UNIQUE);
my_init_dynamic_array(PSI_INSTRUMENT_ME, &gtid_sort_array, sizeof(rpl_gtid),
8, 8, MYF(0));
}
@@ -366,7 +367,8 @@ rpl_slave_state::get_element(uint32 domain_id)
{
struct element *elem;
- elem= (element *)my_hash_search(&hash, (const uchar *)&domain_id, 0);
+ elem= (element *)my_hash_search(&hash, (const uchar *)&domain_id,
+ sizeof(domain_id));
if (elem)
return elem;
@@ -402,7 +404,8 @@ rpl_slave_state::put_back_list(list_element *list)
list_element *next= list->next;
if ((!e || e->domain_id != list->domain_id) &&
- !(e= (element *)my_hash_search(&hash, (const uchar *)&list->domain_id, 0)))
+ !(e= (element *)my_hash_search(&hash, (const uchar *)&list->domain_id,
+ sizeof(list->domain_id))))
{
err= 1;
goto end;
@@ -1107,8 +1110,8 @@ rpl_slave_state::iterate(int (*cb)(rpl_gtid *, void *), void *data,
bool locked= false;
my_hash_init(PSI_INSTRUMENT_ME, &gtid_hash, &my_charset_bin, 32,
- offsetof(rpl_gtid, domain_id), sizeof(uint32), NULL, NULL,
- HASH_UNIQUE);
+ offsetof(rpl_gtid, domain_id), sizeof(rpl_gtid::domain_id),
+ NULL, NULL, HASH_UNIQUE);
for (i= 0; i < num_extra; ++i)
if (extra_gtids[i].server_id == global_system_variables.server_id &&
my_hash_insert(&gtid_hash, (uchar *)(&extra_gtids[i])))
@@ -1143,7 +1146,8 @@ rpl_slave_state::iterate(int (*cb)(rpl_gtid *, void *), void *data,
}
/* Check if we have something newer in the extra list. */
- rec= my_hash_search(&gtid_hash, (const uchar *)&best_gtid.domain_id, 0);
+ rec= my_hash_search(&gtid_hash, (const uchar *)&best_gtid.domain_id,
+ sizeof(best_gtid.domain_id));
if (rec)
{
gtid= (rpl_gtid *)rec;
@@ -1243,7 +1247,8 @@ rpl_slave_state::domain_to_gtid(uint32 domain_id, rpl_gtid *out_gtid)
uint64 best_sub_id;
mysql_mutex_lock(&LOCK_slave_state);
- elem= (element *)my_hash_search(&hash, (const uchar *)&domain_id, 0);
+ elem= (element *)my_hash_search(&hash, (const uchar *)&domain_id,
+ sizeof(domain_id));
if (!elem || !(list= elem->list))
{
mysql_mutex_unlock(&LOCK_slave_state);
@@ -1477,8 +1482,9 @@ rpl_slave_state::alloc_gtid_pos_table(LEX_CSTRING *table_name, void *hton,
void rpl_binlog_state::init()
{
- my_hash_init(PSI_INSTRUMENT_ME, &hash, &my_charset_bin, 32, offsetof(element, domain_id),
- sizeof(uint32), NULL, my_free, HASH_UNIQUE);
+ my_hash_init(PSI_INSTRUMENT_ME, &hash, &my_charset_bin, 32,
+ offsetof(element, domain_id), sizeof(element::domain_id),
+ NULL, my_free, HASH_UNIQUE);
my_init_dynamic_array(PSI_INSTRUMENT_ME, &gtid_sort_array, sizeof(rpl_gtid), 8, 8, MYF(0));
mysql_mutex_init(key_LOCK_binlog_state, &LOCK_binlog_state,
MY_MUTEX_INIT_SLOW);
@@ -1580,7 +1586,8 @@ rpl_binlog_state::update_nolock(const struct rpl_gtid *gtid, bool strict)
element *elem;
if ((elem= (element *)my_hash_search(&hash,
- (const uchar *)(&gtid->domain_id), 0)))
+ (const uchar *)(&gtid->domain_id),
+ sizeof(gtid->domain_id))))
{
if (strict && elem->last_gtid && elem->last_gtid->seq_no >= gtid->seq_no)
{
@@ -1628,7 +1635,8 @@ rpl_binlog_state::update_with_next_gtid(uint32 domain_id, uint32 server_id,
gtid->server_id= server_id;
mysql_mutex_lock(&LOCK_binlog_state);
- if ((elem= (element *)my_hash_search(&hash, (const uchar *)(&domain_id), 0)))
+ if ((elem= (element *)my_hash_search(&hash, (const uchar *)(&domain_id),
+ sizeof(domain_id))))
{
gtid->seq_no= ++elem->seq_no_counter;
if (!elem->update_element(gtid))
@@ -1667,7 +1675,8 @@ rpl_binlog_state::element::update_element(const rpl_gtid *gtid)
}
lookup_gtid= (rpl_gtid *)
- my_hash_search(&hash, (const uchar *)&gtid->server_id, 0);
+ my_hash_search(&hash, (const uchar *)&gtid->server_id,
+ sizeof(gtid->server_id));
if (lookup_gtid)
{
lookup_gtid->seq_no= gtid->seq_no;
@@ -1705,8 +1714,8 @@ rpl_binlog_state::alloc_element_nolock(const rpl_gtid *gtid)
{
elem->domain_id= gtid->domain_id;
my_hash_init(PSI_INSTRUMENT_ME, &elem->hash, &my_charset_bin, 32,
- offsetof(rpl_gtid, server_id), sizeof(uint32), NULL, my_free,
- HASH_UNIQUE);
+ offsetof(rpl_gtid, server_id), sizeof(rpl_gtid::domain_id),
+ NULL, my_free, HASH_UNIQUE);
elem->last_gtid= lookup_gtid;
elem->seq_no_counter= gtid->seq_no;
memcpy(lookup_gtid, gtid, sizeof(*lookup_gtid));
@@ -1741,7 +1750,8 @@ rpl_binlog_state::check_strict_sequence(uint32 domain_id, uint32 server_id,
mysql_mutex_lock(&LOCK_binlog_state);
if ((elem= (element *)my_hash_search(&hash,
- (const uchar *)(&domain_id), 0)) &&
+ (const uchar *)(&domain_id),
+ sizeof(domain_id))) &&
elem->last_gtid && elem->last_gtid->seq_no >= seq_no)
{
my_error(ER_GTID_STRICT_OUT_OF_ORDER, MYF(0), domain_id, server_id, seq_no,
@@ -1768,7 +1778,8 @@ rpl_binlog_state::bump_seq_no_if_needed(uint32 domain_id, uint64 seq_no)
int res;
mysql_mutex_lock(&LOCK_binlog_state);
- if ((elem= (element *)my_hash_search(&hash, (const uchar *)(&domain_id), 0)))
+ if ((elem= (element *)my_hash_search(&hash, (const uchar *)(&domain_id),
+ sizeof(domain_id))))
{
if (elem->seq_no_counter < seq_no)
elem->seq_no_counter= seq_no;
@@ -1786,8 +1797,8 @@ rpl_binlog_state::bump_seq_no_if_needed(uint32 domain_id, uint64 seq_no)
elem->domain_id= domain_id;
my_hash_init(PSI_INSTRUMENT_ME, &elem->hash, &my_charset_bin, 32,
- offsetof(rpl_gtid, server_id), sizeof(uint32), NULL, my_free,
- HASH_UNIQUE);
+ offsetof(rpl_gtid, server_id), sizeof(rpl_gtid::server_id),
+ NULL, my_free, HASH_UNIQUE);
elem->last_gtid= NULL;
elem->seq_no_counter= seq_no;
if (0 == my_hash_insert(&hash, (const uchar *)elem))
@@ -1891,9 +1902,11 @@ rpl_gtid *
rpl_binlog_state::find_nolock(uint32 domain_id, uint32 server_id)
{
element *elem;
- if (!(elem= (element *)my_hash_search(&hash, (const uchar *)&domain_id, 0)))
+ if (!(elem= (element *)my_hash_search(&hash, (const uchar *)&domain_id,
+ sizeof(domain_id))))
return NULL;
- return (rpl_gtid *)my_hash_search(&elem->hash, (const uchar *)&server_id, 0);
+ return (rpl_gtid *)my_hash_search(&elem->hash, (const uchar *)&server_id,
+ sizeof(server_id));
}
rpl_gtid *
@@ -1913,7 +1926,8 @@ rpl_binlog_state::find_most_recent(uint32 domain_id)
rpl_gtid *gtid= NULL;
mysql_mutex_lock(&LOCK_binlog_state);
- elem= (element *)my_hash_search(&hash, (const uchar *)&domain_id, 0);
+ elem= (element *)my_hash_search(&hash, (const uchar *)&domain_id,
+ sizeof(domain_id));
if (elem && elem->last_gtid)
gtid= elem->last_gtid;
mysql_mutex_unlock(&LOCK_binlog_state);
@@ -2182,7 +2196,8 @@ rpl_binlog_state::drop_domain(DYNAMIC_ARRAY *ids,
ptr_domain_id= (uint32*) dynamic_array_ptr(ids, i);
elem= (rpl_binlog_state::element *)
- my_hash_search(&hash, (const uchar *) ptr_domain_id, 0);
+ my_hash_search(&hash, (const uchar *) ptr_domain_id,
+ sizeof(ptr_domain_id[0]));
if (!elem)
{
push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
@@ -2243,7 +2258,7 @@ slave_connection_state::slave_connection_state()
{
my_hash_init(PSI_INSTRUMENT_ME, &hash, &my_charset_bin, 32,
offsetof(entry, gtid) + offsetof(rpl_gtid, domain_id),
- sizeof(uint32), NULL, my_free, HASH_UNIQUE);
+ sizeof(rpl_gtid::domain_id), NULL, my_free, HASH_UNIQUE);
my_init_dynamic_array(PSI_INSTRUMENT_ME, &gtid_sort_array, sizeof(rpl_gtid), 8, 8, MYF(0));
}
@@ -2298,7 +2313,8 @@ slave_connection_state::load(const char *slave_request, size_t len)
return 1;
}
if ((e= (const entry *)
- my_hash_search(&hash, (const uchar *)(&gtid->domain_id), 0)))
+ my_hash_search(&hash, (const uchar *)(&gtid->domain_id),
+ sizeof(gtid->domain_id))))
{
my_error(ER_DUPLICATE_GTID_DOMAIN, MYF(0), gtid->domain_id,
gtid->server_id, (ulonglong)gtid->seq_no, e->gtid.domain_id,
@@ -2365,7 +2381,8 @@ slave_connection_state::load(rpl_slave_state *state,
slave_connection_state::entry *
slave_connection_state::find_entry(uint32 domain_id)
{
- return (entry *) my_hash_search(&hash, (const uchar *)(&domain_id), 0);
+ return (entry *) my_hash_search(&hash, (const uchar *)(&domain_id),
+ sizeof(domain_id));
}
@@ -2383,7 +2400,8 @@ int
slave_connection_state::update(const rpl_gtid *in_gtid)
{
entry *e;
- uchar *rec= my_hash_search(&hash, (const uchar *)(&in_gtid->domain_id), 0);
+ uchar *rec= my_hash_search(&hash, (const uchar *)(&in_gtid->domain_id),
+ sizeof(in_gtid->domain_id));
if (rec)
{
e= (entry *)rec;
@@ -2408,7 +2426,8 @@ slave_connection_state::update(const rpl_gtid *in_gtid)
void
slave_connection_state::remove(const rpl_gtid *in_gtid)
{
- uchar *rec= my_hash_search(&hash, (const uchar *)(&in_gtid->domain_id), 0);
+ uchar *rec= my_hash_search(&hash, (const uchar *)(&in_gtid->domain_id),
+ sizeof(in_gtid->domain_id));
#ifdef DBUG_ASSERT_EXISTS
bool err;
rpl_gtid *slave_gtid= &((entry *)rec)->gtid;
@@ -2425,7 +2444,8 @@ slave_connection_state::remove(const rpl_gtid *in_gtid)
void
slave_connection_state::remove_if_present(const rpl_gtid *in_gtid)
{
- uchar *rec= my_hash_search(&hash, (const uchar *)(&in_gtid->domain_id), 0);
+ uchar *rec= my_hash_search(&hash, (const uchar *)(&in_gtid->domain_id),
+ sizeof(in_gtid->domain_id));
if (rec)
my_hash_delete(&hash, rec);
}
@@ -2869,7 +2889,8 @@ void
gtid_waiting::init()
{
my_hash_init(PSI_INSTRUMENT_ME, &hash, &my_charset_bin, 32,
- offsetof(hash_element, domain_id), sizeof(uint32), NULL,
+ offsetof(hash_element, domain_id),
+ sizeof(hash_element::domain_id), NULL,
free_hash_element, HASH_UNIQUE);
mysql_mutex_init(key_LOCK_gtid_waiting, &LOCK_gtid_waiting, 0);
}
@@ -2902,7 +2923,8 @@ gtid_waiting::get_entry(uint32 domain_id)
{
hash_element *e;
- if ((e= (hash_element *)my_hash_search(&hash, (const uchar *)&domain_id, 0)))
+ if ((e= (hash_element *)my_hash_search(&hash, (const uchar *)&domain_id,
+ sizeof(domain_id))))
return e;
if (!(e= (hash_element *)my_malloc(PSI_INSTRUMENT_ME, sizeof(*e), MYF(MY_WME))))
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc
index cdd56976549..4fd36891a4b 100644
--- a/sql/rpl_mi.cc
+++ b/sql/rpl_mi.cc
@@ -749,7 +749,7 @@ int flush_master_info(Master_info* mi,
(1 + mi->ignore_server_ids.elements), MYF(MY_WME));
if (!ignore_server_ids_buf)
DBUG_RETURN(1); /* error */
- ulong cur_len= sprintf(ignore_server_ids_buf, "%u",
+ ulong cur_len= sprintf(ignore_server_ids_buf, "%zu",
mi->ignore_server_ids.elements);
for (ulong i= 0; i < mi->ignore_server_ids.elements; i++)
{
@@ -1455,11 +1455,32 @@ bool Master_info_index::add_master_info(Master_info *mi, bool write_to_file)
atomic
*/
-bool Master_info_index::remove_master_info(Master_info *mi)
+bool Master_info_index::remove_master_info(Master_info *mi, bool clear_log_files)
{
+ char tmp_name[FN_REFLEN];
DBUG_ENTER("remove_master_info");
mysql_mutex_assert_owner(&LOCK_active_mi);
+ if (clear_log_files)
+ {
+ /* This code is only executed when change_master() failes to create a new master info */
+
+ // Delete any temporary relay log files that could have been created by change_master()
+ mi->rli.relay_log.reset_logs(current_thd, 0, (rpl_gtid*) 0, 0, 0);
+ /* Delete master-'connection'.info */
+ create_logfile_name_with_suffix(tmp_name,
+ sizeof(tmp_name),
+ master_info_file, 0,
+ &mi->cmp_connection_name);
+ my_delete(tmp_name, MYF(0));
+ /* Delete relay-log-'connection'.info */
+ create_logfile_name_with_suffix(tmp_name,
+ sizeof(tmp_name),
+ relay_log_info_file, 0,
+ &mi->cmp_connection_name);
+ my_delete(tmp_name, MYF(0));
+ }
+
// Delete Master_info and rewrite others to file
if (!my_hash_delete(&master_info_hash, (uchar*) mi))
{
@@ -1916,7 +1937,7 @@ char *Domain_id_filter::as_string(enum_list_type type)
return NULL;
// Store the total number of elements followed by the individual elements.
- size_t cur_len= sprintf(buf, "%u", ids->elements);
+ size_t cur_len= sprintf(buf, "%zu", ids->elements);
sz-= cur_len;
for (uint i= 0; i < ids->elements; i++)
diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h
index ce2d3cc9ad5..a4a06d42a5c 100644
--- a/sql/rpl_mi.h
+++ b/sql/rpl_mi.h
@@ -390,7 +390,7 @@ public:
bool check_duplicate_master_info(LEX_CSTRING *connection_name,
const char *host, uint port);
bool add_master_info(Master_info *mi, bool write_to_file);
- bool remove_master_info(Master_info *mi);
+ bool remove_master_info(Master_info *mi, bool clear_log_files);
Master_info *get_master_info(const LEX_CSTRING *connection_name,
Sql_condition::enum_warning_level warning);
bool start_all_slaves(THD *thd);
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc
index 8be1964b762..49ec08a9cea 100644
--- a/sql/rpl_parallel.cc
+++ b/sql/rpl_parallel.cc
@@ -807,9 +807,7 @@ do_retry:
{
mysql_mutex_lock(&entry->LOCK_parallel_entry);
if (entry->stop_on_error_sub_id == (uint64) ULONGLONG_MAX ||
-#ifndef DBUG_OFF
- (DBUG_EVALUATE_IF("simulate_mdev_12746", 1, 0)) ||
-#endif
+ DBUG_IF("simulate_mdev_12746") ||
rgi->gtid_sub_id < entry->stop_on_error_sub_id)
{
register_wait_for_prior_event_group_commit(rgi, entry);
@@ -2347,7 +2345,8 @@ rpl_parallel::find(uint32 domain_id)
struct rpl_parallel_entry *e;
if (!(e= (rpl_parallel_entry *)my_hash_search(&domain_hash,
- (const uchar *)&domain_id, 0)))
+ (const uchar *)&domain_id,
+ sizeof(domain_id))))
{
/* Allocate a new, empty one. */
ulong count= opt_slave_domain_parallel_threads;
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 064299c6822..42607fbadcf 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -1632,7 +1632,8 @@ scan_one_gtid_slave_pos_table(THD *thd, HASH *hash, DYNAMIC_ARRAY *array,
goto end;
}
- if ((rec= my_hash_search(hash, (const uchar *)&domain_id, 0)))
+ if ((rec= my_hash_search(hash, (const uchar *)&domain_id,
+ sizeof(domain_id))))
{
entry= (struct gtid_pos_element *)rec;
if (entry->sub_id >= sub_id)
diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc
index 9ea8bb3b822..04a2efb3750 100644
--- a/sql/rpl_utility.cc
+++ b/sql/rpl_utility.cc
@@ -338,7 +338,7 @@ bool event_checksum_test(uchar *event_buf, ulong event_len,
DBUG_ASSERT(event_buf[EVENT_TYPE_OFFSET] == FORMAT_DESCRIPTION_EVENT);
event_buf[FLAGS_OFFSET]= (uchar) flags;
}
- res= DBUG_EVALUATE_IF("simulate_checksum_test_failure", TRUE, computed != incoming);
+ res= (DBUG_IF("simulate_checksum_test_failure") || computed != incoming);
}
return res;
}
diff --git a/sql/semisync_master_ack_receiver.cc b/sql/semisync_master_ack_receiver.cc
index b65b7824a0e..b54ad58d153 100644
--- a/sql/semisync_master_ack_receiver.cc
+++ b/sql/semisync_master_ack_receiver.cc
@@ -72,7 +72,7 @@ bool Ack_receiver::start()
m_status= ST_UP;
- if (DBUG_EVALUATE_IF("rpl_semisync_simulate_create_thread_failure", 1, 0) ||
+ if (DBUG_IF("rpl_semisync_simulate_create_thread_failure") ||
pthread_attr_init(&attr) != 0 ||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE) != 0 ||
#ifndef _WIN32
@@ -247,7 +247,7 @@ void Ack_receiver::run()
{
mysql_mutex_unlock(&m_mutex);
- ret= DBUG_EVALUATE_IF("rpl_semisync_simulate_select_error", -1, ret);
+ ret= DBUG_IF("rpl_semisync_simulate_select_error") ? -1 : ret;
if (ret == -1 && errno != EINTR)
sql_print_information("Failed to wait on semi-sync sockets, "
diff --git a/sql/semisync_slave.cc b/sql/semisync_slave.cc
index 3e7578b6a53..788aab78911 100644
--- a/sql/semisync_slave.cc
+++ b/sql/semisync_slave.cc
@@ -63,7 +63,7 @@ int Repl_semi_sync_slave::slave_read_sync_header(const uchar *header,
if (rpl_semi_sync_slave_status)
{
- if (DBUG_EVALUATE_IF("semislave_corrupt_log", 0, 1)
+ if (!DBUG_IF("semislave_corrupt_log")
&& header[0] == k_packet_magic_num)
{
semi_sync_need_reply = (header[1] & k_packet_flag_sync);
@@ -144,7 +144,7 @@ void Repl_semi_sync_slave::kill_connection(MYSQL *mysql)
bool ret= (!mysql_real_connect(kill_mysql, mysql->host,
mysql->user, mysql->passwd,0, mysql->port, mysql->unix_socket, 0));
- if (DBUG_EVALUATE_IF("semisync_slave_failed_kill", 1, 0) || ret)
+ if (DBUG_IF("semisync_slave_failed_kill") || ret)
{
sql_print_information("cannot connect to master to kill slave io_thread's "
"connection");
@@ -198,8 +198,7 @@ int Repl_semi_sync_slave::request_transmit(Master_info *mi)
}
row= mysql_fetch_row(res);
- if (DBUG_EVALUATE_IF("master_not_support_semisync", 1, 0)
- || !row)
+ if (DBUG_IF("master_not_support_semisync") || !row)
{
/* Master does not support semi-sync */
sql_print_warning("Master server does not support semi-sync, "
@@ -260,7 +259,7 @@ int Repl_semi_sync_slave::slave_reply(Master_info *mi)
name_len + REPLY_BINLOG_NAME_OFFSET);
if (!reply_res)
{
- reply_res = DBUG_EVALUATE_IF("semislave_failed_net_flush", 1, net_flush(net));
+ reply_res = (DBUG_IF("semislave_failed_net_flush") || net_flush(net));
if (reply_res)
sql_print_error("Semi-sync slave net_flush() reply failed");
rpl_semi_sync_slave_send_ack++;
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 3dd97527433..aa9ec5ab5ca 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -85,7 +85,7 @@ uint sys_var_elements()
int sys_var_add_options(DYNAMIC_ARRAY *long_options, int parse_flags)
{
- uint saved_elements= long_options->elements;
+ size_t saved_elements= long_options->elements;
DBUG_ENTER("sys_var_add_options");
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 8ca33df033a..95c5241410f 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -1788,7 +1788,7 @@ ER_TOO_LONG_KEY 42000 S1009
spa "Declaración de clave demasiado larga. La máxima longitud de clave es de %d"
swe "För lång nyckel. Högsta tillåtna nyckellängd är %d"
ukr "Зазначений ключ задовгий. Ðайбільша довжина ключа %d байтів"
-ER_KEY_COLUMN_DOES_NOT_EXITS 42000 S1009
+ER_KEY_COLUMN_DOES_NOT_EXIST 42000 S1009
chi "索引列'%-.192s'ä¸åœ¨è¡¨é‡Œ"
cze "KlíÄový sloupec '%-.192s' v tabulce neexistuje"
dan "Nøglefeltet '%-.192s' eksisterer ikke i tabellen"
@@ -6638,12 +6638,12 @@ ER_PARTITION_MGMT_ON_NONPARTITIONED
ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING
eng "Partitioned tables do not support %s"
spa "Las tablas particionadas no soportan %s"
-ER_DROP_PARTITION_NON_EXISTENT
- chi "分区列表错误%-.64s"
- eng "Error in list of partitions to %-.64s"
- ger "Fehler in der Partitionsliste bei %-.64s"
- spa "Error en lista de particiones para %-.64s"
- swe "Fel i listan av partitioner att %-.64s"
+ER_PARTITION_DOES_NOT_EXIST
+ chi "分区å称或分区列表错误"
+ eng "Wrong partition name or partition list"
+ ger "Falscher Name einer Partition oder Fehler in der Partitionsliste"
+ spa "Error en lista de particiones"
+ swe "Fel namn av en partition eller fel i listan av partitioner"
ER_DROP_LAST_PARTITION
chi "无法删除所有分区,请使用删除表"
eng "Cannot remove all partitions, use DROP TABLE instead"
@@ -10060,3 +10060,9 @@ ER_REMOVED_ORPHAN_TRIGGER
ER_STORAGE_ENGINE_DISABLED
eng "Storage engine %s is disabled"
spa "El motor de almacenaje %s está desactivado"
+WARN_SFORMAT_ERROR
+ eng "SFORMAT error: %s"
+ER_PARTITION_CONVERT_SUBPARTITIONED
+ eng "Convert partition is not supported for subpartitioned table."
+ER_PROVIDER_NOT_LOADED
+ eng "MariaDB tried to use the %s, but its provider plugin is not loaded"
diff --git a/sql/slave.cc b/sql/slave.cc
index 7f7f121db7e..f9532752d3f 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -788,7 +788,7 @@ bool init_slave_skip_errors(const char* arg)
if (!arg || !*arg) // No errors defined
goto end;
- if (unlikely(my_bitmap_init(&slave_error_mask,0,MAX_SLAVE_ERROR,0)))
+ if (my_bitmap_init(&slave_error_mask,0,MAX_SLAVE_ERROR))
DBUG_RETURN(1);
use_slave_mask= 1;
@@ -2329,11 +2329,11 @@ past_checksum:
/* Announce MariaDB slave capabilities. */
DBUG_EXECUTE_IF("simulate_slave_capability_none", goto after_set_capability;);
{
- int rc= DBUG_EVALUATE_IF("simulate_slave_capability_old_53",
+ int rc= DBUG_IF("simulate_slave_capability_old_53") ?
mysql_real_query(mysql, STRING_WITH_LEN("SET @mariadb_slave_capability="
- STRINGIFY_ARG(MARIA_SLAVE_CAPABILITY_ANNOTATE))),
+ STRINGIFY_ARG(MARIA_SLAVE_CAPABILITY_ANNOTATE))) :
mysql_real_query(mysql, STRING_WITH_LEN("SET @mariadb_slave_capability="
- STRINGIFY_ARG(MARIA_SLAVE_CAPABILITY_MINE))));
+ STRINGIFY_ARG(MARIA_SLAVE_CAPABILITY_MINE)));
if (unlikely(rc))
{
err_code= mysql_errno(mysql);
@@ -4674,7 +4674,7 @@ pthread_handler_t handle_slave_io(void *arg)
}
thd->variables.wsrep_on= 0;
- if (DBUG_EVALUATE_IF("failed_slave_start", 1, 0)
+ if (DBUG_IF("failed_slave_start")
|| repl_semisync_slave.slave_start(mi))
{
mi->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR, NULL,
@@ -4951,7 +4951,7 @@ Stopping slave I/O thread due to out-of-memory error from master");
(!repl_semisync_slave.get_slave_enabled() ||
(!(mi->semi_ack & SEMI_SYNC_SLAVE_DELAY_SYNC) ||
(mi->semi_ack & (SEMI_SYNC_NEED_ACK)))) &&
- (DBUG_EVALUATE_IF("failed_flush_master_info", 1, 0) ||
+ (DBUG_IF("failed_flush_master_info") ||
flush_master_info(mi, TRUE, TRUE)))
{
sql_print_error("Failed to flush master info file");
diff --git a/sql/sp_head.h b/sql/sp_head.h
index eee5212679f..3c3cb093400 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -561,7 +561,7 @@ public:
{ return m_flags & MODIFIES_DATA; }
inline uint instructions()
- { return m_instr.elements; }
+ { return (uint)m_instr.elements; }
inline sp_instr *
last_instruction()
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc
index c4c19dd39f6..619218f3b68 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.cc
@@ -518,7 +518,8 @@ bool sp_rcontext::handle_sql_condition(THD *thd,
found_condition=
new (callers_arena->mem_root) Sql_condition(callers_arena->mem_root,
da->get_error_condition_identity(),
- da->message());
+ da->message(),
+ da->current_row_for_warning());
}
}
else if (da->current_statement_warn_count())
diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h
index 0e0e8921f86..ea669b2d1d8 100644
--- a/sql/sp_rcontext.h
+++ b/sql/sp_rcontext.h
@@ -111,15 +111,18 @@ public:
/// Text message.
char *message;
+ /** Row number where the condition has happened */
+ ulong m_row_number;
+
/// The constructor.
///
/// @param _sql_condition The SQL condition.
/// @param arena Query arena for SP
- Sql_condition_info(const Sql_condition *_sql_condition,
- Query_arena *arena)
+ Sql_condition_info(const Sql_condition *_sql_condition, Query_arena *arena)
:Sql_condition_identity(*_sql_condition)
{
message= strdup_root(arena->mem_root, _sql_condition->get_message_text());
+ m_row_number= _sql_condition->m_row_number;
}
};
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index bd176b4667f..7d97b1c1b0f 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -2168,24 +2168,26 @@ static bool has_validation_plugins()
MariaDB_PASSWORD_VALIDATION_PLUGIN, NULL);
}
-struct validation_data { const LEX_CSTRING *user, *password; };
+struct validation_data { const LEX_CSTRING *user, *password, *host; };
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);
+ return handler->validate_password(data->user, data->password, data->host);
}
static bool validate_password(THD *thd, const LEX_CSTRING &user,
+ const LEX_CSTRING &host,
const LEX_CSTRING &pwtext, bool has_hash)
{
if (pwtext.length || !has_hash)
{
struct validation_data data= { &user,
- pwtext.str ? &pwtext : &empty_clex_str };
+ pwtext.str ? &pwtext : &empty_clex_str,
+ &host };
if (plugin_foreach(NULL, do_validate,
MariaDB_PASSWORD_VALIDATION_PLUGIN, &data))
{
@@ -2239,6 +2241,7 @@ static int set_user_salt(ACL_USER::AUTH *auth, plugin_ref plugin)
not loaded, if the auth_string is invalid, if the password is not applicable
*/
static int set_user_auth(THD *thd, const LEX_CSTRING &user,
+ const LEX_CSTRING &host,
ACL_USER::AUTH *auth, const LEX_CSTRING &pwtext)
{
const char *plugin_name= auth->plugin.str;
@@ -2270,7 +2273,7 @@ static int set_user_auth(THD *thd, const LEX_CSTRING &user,
}
if (info->hash_password &&
- validate_password(thd, user, pwtext, auth->auth_string.length))
+ validate_password(thd, user, host, pwtext, auth->auth_string.length))
{
res= ER_NOT_VALID_PASSWORD;
goto end;
@@ -3380,7 +3383,9 @@ static int acl_user_update(THD *thd, ACL_USER *acl_user, uint nauth,
auth->auth_str);
if (fix_user_plugin_ptr(work_copy + i))
work_copy[i].plugin= safe_lexcstrdup_root(&acl_memroot, auth->plugin);
- if (set_user_auth(thd, acl_user->user, work_copy + i, auth->pwtext))
+ if (set_user_auth(thd, acl_user->user,
+ {acl_user->host.hostname, acl_user->hostname_length},
+ work_copy + i, auth->pwtext))
return 1;
}
}
@@ -3648,14 +3653,14 @@ static void init_check_host(void)
(my_hash_get_key) check_get_key, 0, 0);
if (!allow_all_hosts)
{
- for (uint i=0 ; i < acl_users.elements ; i++)
+ for (size_t i=0 ; i < acl_users.elements ; i++)
{
ACL_USER *acl_user=dynamic_element(&acl_users,i,ACL_USER*);
if (strchr(acl_user->host.hostname,wild_many) ||
strchr(acl_user->host.hostname,wild_one) ||
acl_user->host.ip_mask)
{ // Has wildcard
- uint j;
+ size_t j;
for (j=0 ; j < acl_wild_hosts.elements ; j++)
{ // Check if host already exists
acl_host_and_ip *acl=dynamic_element(&acl_wild_hosts,j,
@@ -3774,7 +3779,7 @@ static bool add_role_user_mapping(const char *uname, const char *hname,
static void remove_ptr_from_dynarray(DYNAMIC_ARRAY *array, void *ptr)
{
bool found __attribute__((unused))= false;
- for (uint i= 0; i < array->elements; i++)
+ for (size_t i= 0; i < array->elements; i++)
{
if (ptr == *dynamic_element(array, i, void**))
{
@@ -3823,7 +3828,7 @@ static void rebuild_role_grants(void)
/*
Reset every user's and role's role_grants array
*/
- for (uint i=0; i < acl_users.elements; i++) {
+ for (size_t i=0; i < acl_users.elements; i++) {
ACL_USER *user= dynamic_element(&acl_users, i, ACL_USER *);
reset_dynamic(&user->role_grants);
}
@@ -3849,7 +3854,7 @@ bool acl_check_host(const char *host, const char *ip)
mysql_mutex_unlock(&acl_cache->lock);
return 0; // Found host
}
- for (uint i=0 ; i < acl_wild_hosts.elements ; i++)
+ for (size_t i=0 ; i < acl_wild_hosts.elements ; i++)
{
acl_host_and_ip *acl=dynamic_element(&acl_wild_hosts,i,acl_host_and_ip*);
if (compare_hostname(acl, host, ip))
@@ -4006,7 +4011,8 @@ bool change_password(THD *thd, LEX_USER *user)
{
auth= acl_user->auth[i];
auth.auth_string= safe_lexcstrdup_root(&acl_memroot, user->auth->auth_str);
- int r= set_user_auth(thd, user->user, &auth, user->auth->pwtext);
+ int r= set_user_auth(thd, user->user, user->host,
+ &auth, user->auth->pwtext);
if (r == ER_SET_PASSWORD_AUTH_PLUGIN)
password_plugin= auth.plugin.str;
else if (r)
@@ -4289,14 +4295,18 @@ static ACL_USER * find_user_wild(const char *host, const char *user, const char
*/
static ACL_ROLE *find_acl_role(const char *role)
{
+ size_t length= strlen(role);
DBUG_ENTER("find_acl_role");
DBUG_PRINT("enter",("role: '%s'", role));
DBUG_PRINT("info", ("Hash elements: %ld", acl_roles.records));
mysql_mutex_assert_owner(&acl_cache->lock);
+ if (!length)
+ DBUG_RETURN(NULL);
+
ACL_ROLE *r= (ACL_ROLE *)my_hash_search(&acl_roles, (uchar *)role,
- strlen(role));
+ length);
DBUG_RETURN(r);
}
@@ -5048,7 +5058,7 @@ acl_update_proxy_user(ACL_PROXY_USER *new_value, bool is_revoke)
mysql_mutex_assert_owner(&acl_cache->lock);
DBUG_ENTER("acl_update_proxy_user");
- for (uint i= 0; i < acl_proxy_users.elements; i++)
+ for (size_t i= 0; i < acl_proxy_users.elements; i++)
{
ACL_PROXY_USER *acl_user=
dynamic_element(&acl_proxy_users, i, ACL_PROXY_USER *);
@@ -6320,7 +6330,7 @@ static int traverse_role_graph_impl(ACL_USER_BASE *user, void *context,
end:
/* Cleanup */
- for (uint i= 0; i < to_clear.elements(); i++)
+ for (size_t i= 0; i < to_clear.elements(); i++)
{
ACL_USER_BASE *current= to_clear.at(i);
DBUG_ASSERT(current->flags & (ROLE_EXPLORED | ROLE_ON_STACK | ROLE_OPENED));
@@ -6388,7 +6398,7 @@ static bool merge_role_global_privileges(ACL_ROLE *grantee)
DBUG_EXECUTE_IF("role_merge_stats", role_global_merges++;);
- for (uint i= 0; i < grantee->role_grants.elements; i++)
+ for (size_t i= 0; i < grantee->role_grants.elements; i++)
{
ACL_ROLE *r= *dynamic_element(&grantee->role_grants, i, ACL_ROLE**);
grantee->access|= r->access;
@@ -6527,8 +6537,8 @@ static bool merge_role_db_privileges(ACL_ROLE *grantee, const char *dbname,
if (update_flags & 4)
{
// Remove elements marked for deletion.
- uint count= 0;
- for(uint i= 0; i < acl_dbs.elements(); i++)
+ size_t count= 0;
+ for(size_t i= 0; i < acl_dbs.elements(); i++)
{
ACL_DB *acl_db= &acl_dbs.at(i);
if (acl_db->sort)
@@ -6891,7 +6901,7 @@ static int merge_role_privileges(ACL_ROLE *role __attribute__((unused)),
if (data->what != PRIVS_TO_MERGE::GLOBAL)
{
role_hash.insert(grantee);
- for (uint i= 0; i < grantee->role_grants.elements; i++)
+ for (size_t i= 0; i < grantee->role_grants.elements; i++)
role_hash.insert(*dynamic_element(&grantee->role_grants, i, ACL_ROLE**));
}
@@ -9466,7 +9476,7 @@ static bool show_role_grants(THD *thd, const char *hostname,
ACL_USER_BASE *acl_entry,
char *buff, size_t buffsize)
{
- uint counter;
+ size_t counter;
Protocol *protocol= thd->protocol;
LEX_CSTRING host= {const_cast<char*>(hostname), strlen(hostname)};
@@ -9579,7 +9589,7 @@ static bool show_database_privileges(THD *thd, const char *username,
privilege_t want_access(NO_ACL);
Protocol *protocol= thd->protocol;
- for (uint i=0 ; i < acl_dbs.elements() ; i++)
+ for (size_t i=0 ; i < acl_dbs.elements() ; i++)
{
const char *user, *host;
@@ -10271,14 +10281,14 @@ static int handle_grant_struct(enum enum_acl_lists struct_no, bool drop,
propagate_role_grants(acl_role, PRIVS_TO_MERGE::ALL);
// delete the role from cross-reference arrays
- for (uint i=0; i < acl_role->role_grants.elements; i++)
+ for (size_t i=0; i < acl_role->role_grants.elements; i++)
{
ACL_ROLE *grant= *dynamic_element(&acl_role->role_grants,
i, ACL_ROLE**);
remove_ptr_from_dynarray(&grant->parent_grantee, acl_role);
}
- for (uint i=0; i < acl_role->parent_grantee.elements; i++)
+ for (size_t i=0; i < acl_role->parent_grantee.elements; i++)
{
ACL_USER_BASE *grantee= *dynamic_element(&acl_role->parent_grantee,
i, ACL_USER_BASE**);
@@ -10299,7 +10309,7 @@ static int handle_grant_struct(enum enum_acl_lists struct_no, bool drop,
/* Get the number of elements in the in-memory structure. */
switch (struct_no) {
case USER_ACL:
- elements= acl_users.elements;
+ elements= int(acl_users.elements);
break;
case DB_ACL:
elements= int(acl_dbs.elements());
@@ -10325,7 +10335,7 @@ static int handle_grant_struct(enum enum_acl_lists struct_no, bool drop,
elements= grant_name_hash->records;
break;
case PROXY_USERS_ACL:
- elements= acl_proxy_users.elements;
+ elements= int(acl_proxy_users.elements);
break;
case ROLES_MAPPINGS_HASH:
roles_mappings_hash= &acl_roles_mappings;
@@ -12188,11 +12198,11 @@ SHOW_VAR acl_statistics[] = {
{"procedure_grants", (char*)&proc_priv_hash.records, SHOW_ULONG},
{"package_spec_grants", (char*)&package_spec_priv_hash.records, SHOW_ULONG},
{"package_body_grants", (char*)&package_body_priv_hash.records, SHOW_ULONG},
- {"proxy_users", (char*)&acl_proxy_users.elements, SHOW_UINT},
+ {"proxy_users", (char*)&acl_proxy_users.elements, SHOW_SIZE_T},
{"role_grants", (char*)&acl_roles_mappings.records, SHOW_ULONG},
{"roles", (char*)&acl_roles.records, SHOW_ULONG},
{"table_grants", (char*)&column_priv_hash.records, SHOW_ULONG},
- {"users", (char*)&acl_users.elements, SHOW_UINT},
+ {"users", (char*)&acl_users.elements, SHOW_SIZE_T},
#endif
{NullS, NullS, SHOW_LONG},
};
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index 39a5b7ff0db..e0b324e6342 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -657,8 +657,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
protocol->store(operator_name, system_charset_info);
protocol->store(&error_clex_str, system_charset_info);
length= my_snprintf(buff, sizeof(buff),
- ER_THD(thd, ER_DROP_PARTITION_NON_EXISTENT),
- table_name.str);
+ ER_THD(thd, ER_PARTITION_DOES_NOT_EXIST));
protocol->store(buff, length, system_charset_info);
if(protocol->write())
goto err;
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc
index be305267076..e28308b4ff6 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -427,6 +427,8 @@ bool Sql_cmd_alter_table::execute(THD *thd)
as for RENAME TO, as being done by SQLCOM_RENAME_TABLE
*/
if ((alter_info.partition_flags & ALTER_PARTITION_DROP) ||
+ (alter_info.partition_flags & ALTER_PARTITION_CONVERT_IN) ||
+ (alter_info.partition_flags & ALTER_PARTITION_CONVERT_OUT) ||
(alter_info.flags & ALTER_RENAME))
priv_needed|= DROP_ACL;
diff --git a/sql/sql_alter.h b/sql/sql_alter.h
index d91984d4b26..bf1edd4c964 100644
--- a/sql/sql_alter.h
+++ b/sql/sql_alter.h
@@ -250,13 +250,15 @@ public:
const LEX_CSTRING *new_db_arg, const LEX_CSTRING *new_name_arg);
/**
- @return true if the table is moved to another database, false otherwise.
+ @return true if the table is moved to another database or a new table
+ created by ALTER_PARTITION_CONVERT_OUT, false otherwise.
*/
bool is_database_changed() const
{ return (new_db.str != db.str); };
/**
- @return true if the table is renamed, false otherwise.
+ @return true if the table is renamed or a new table created by
+ ALTER_PARTITION_CONVERT_OUT, false otherwise.
*/
bool is_table_renamed() const
{ return (is_database_changed() || new_name.str != table_name.str); };
diff --git a/sql/sql_array.h b/sql/sql_array.h
index 8610e971016..85a53ae1a6f 100644
--- a/sql/sql_array.h
+++ b/sql/sql_array.h
@@ -114,19 +114,19 @@ template <class Elem> class Dynamic_array
{
DYNAMIC_ARRAY array;
public:
- Dynamic_array(PSI_memory_key psi_key, uint prealloc=16, uint increment=16)
+ Dynamic_array(PSI_memory_key psi_key, size_t prealloc=16, size_t increment=16)
{
init(psi_key, prealloc, increment);
}
- Dynamic_array(MEM_ROOT *root, uint prealloc=16, uint increment=16)
+ Dynamic_array(MEM_ROOT *root, size_t prealloc=16, size_t increment=16)
{
void *init_buffer= alloc_root(root, sizeof(Elem) * prealloc);
- init_dynamic_array2(root->m_psi_key, &array, sizeof(Elem), init_buffer,
- prealloc, increment, MYF(0));
+ init_dynamic_array2(root->psi_key, &array, sizeof(Elem), init_buffer,
+ prealloc, increment, MYF(0));
}
- void init(PSI_memory_key psi_key, uint prealloc=16, uint increment=16)
+ void init(PSI_memory_key psi_key, size_t prealloc=16, size_t increment=16)
{
init_dynamic_array2(psi_key, &array, sizeof(Elem), 0, prealloc, increment, MYF(0));
}
@@ -217,7 +217,7 @@ public:
void del(size_t idx)
{
DBUG_ASSERT(idx <= array.max_element);
- delete_dynamic_element(&array, (uint)idx);
+ delete_dynamic_element(&array, idx);
}
size_t elements() const
@@ -228,7 +228,7 @@ public:
void elements(size_t num_elements)
{
DBUG_ASSERT(num_elements <= array.max_element);
- array.elements= (uint)num_elements;
+ array.elements= num_elements;
}
void clear()
@@ -236,7 +236,7 @@ public:
elements(0);
}
- void set(uint idx, const Elem &el)
+ void set(size_t idx, const Elem &el)
{
set_dynamic(&array, &el, idx);
}
@@ -248,7 +248,7 @@ public:
bool reserve(size_t new_size)
{
- return allocate_dynamic(&array, (uint)new_size);
+ return allocate_dynamic(&array, new_size);
}
@@ -260,7 +260,7 @@ public:
if (new_size > old_size)
{
- set_dynamic(&array, (uchar*)&default_val, (uint)(new_size - 1));
+ set_dynamic(&array, (uchar*)&default_val, new_size - 1);
/*for (size_t i= old_size; i != new_size; i++)
{
at(i)= default_val;
diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc
index 3e9379ebe33..cbf3f971088 100644
--- a/sql/sql_audit.cc
+++ b/sql/sql_audit.cc
@@ -350,14 +350,11 @@ static my_bool calc_class_mask(THD *thd, plugin_ref plugin, void *arg)
*/
int finalize_audit_plugin(st_plugin_int *plugin)
{
+ int deinit_status= 0;
unsigned long event_class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE];
- if (plugin->plugin->deinit && plugin->plugin->deinit(NULL))
- {
- DBUG_PRINT("warning", ("Plugin '%s' deinit function returned error.",
- plugin->name.str));
- DBUG_EXECUTE("finalize_audit_plugin", return 1; );
- }
+ if (plugin->plugin->deinit)
+ deinit_status= plugin->plugin->deinit(NULL);
plugin->data= NULL;
bzero(&event_class_mask, sizeof(event_class_mask));
@@ -376,7 +373,7 @@ int finalize_audit_plugin(st_plugin_int *plugin)
bmove(mysql_global_audit_mask, event_class_mask, sizeof(event_class_mask));
mysql_mutex_unlock(&LOCK_audit_mask);
- return 0;
+ return deinit_status;
}
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index ed21f5ab3e2..4f041c061c3 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -6016,7 +6016,7 @@ find_field_in_table(THD *thd, TABLE *table, const char *name, size_t length,
if (field)
{
if (field->invisible == INVISIBLE_FULL &&
- DBUG_EVALUATE_IF("test_completely_invisible", 0, 1))
+ !DBUG_IF("test_completely_invisible"))
DBUG_RETURN((Field*)0);
if (field->invisible == INVISIBLE_SYSTEM &&
@@ -7412,7 +7412,7 @@ store_top_level_join_columns(THD *thd, TABLE_LIST *table_ref,
/* Add a TRUE condition to outer joins that have no common columns. */
if (table_ref_2->outer_join &&
!table_ref_1->on_expr && !table_ref_2->on_expr)
- table_ref_2->on_expr= (Item*) &Item_true;
+ table_ref_2->on_expr= (Item*) Item_true;
/* Change this table reference to become a leaf for name resolution. */
if (left_neighbor)
@@ -8911,7 +8911,7 @@ fill_record_n_invoke_before_triggers(THD *thd, TABLE *table, Field **ptr,
my_bool mysql_rm_tmp_tables(void)
{
- uint i, idx;
+ size_t i, idx;
char path[FN_REFLEN], *tmpdir, path_copy[FN_REFLEN];
MY_DIR *dirp;
FILEINFO *file;
@@ -8933,7 +8933,7 @@ my_bool mysql_rm_tmp_tables(void)
/* Remove all SQLxxx tables from directory */
- for (idx=0 ; idx < (uint) dirp->number_of_files ; idx++)
+ for (idx=0 ; idx < dirp->number_of_files ; idx++)
{
file=dirp->dir_entry+idx;
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 658909c5961..40afe0182b7 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -293,7 +293,7 @@ bool Foreign_key::validate(List<Create_field> &table_fields)
&sql_field->field_name)) {}
if (!sql_field)
{
- my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), column->field_name.str);
+ my_error(ER_KEY_COLUMN_DOES_NOT_EXIST, MYF(0), column->field_name.str);
DBUG_RETURN(TRUE);
}
if (type == Key::FOREIGN_KEY && sql_field->vcol_info)
@@ -750,8 +750,7 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
will be re-initialized in init_for_queries().
*/
init_sql_alloc(key_memory_thd_main_mem_root,
- &main_mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0,
- MYF(MY_THREAD_SPECIFIC));
+ &main_mem_root, 64, 0, MYF(MY_THREAD_SPECIFIC));
/*
Allocation of user variables for binary logging is always done with main
@@ -963,10 +962,8 @@ Internal_error_handler *THD::pop_internal_handler()
void THD::raise_error(uint sql_errno)
{
const char* msg= ER_THD(this, sql_errno);
- (void) raise_condition(sql_errno,
- NULL,
- Sql_condition::WARN_LEVEL_ERROR,
- msg);
+ (void) raise_condition(sql_errno, "\0\0\0\0\0",
+ Sql_condition::WARN_LEVEL_ERROR, msg);
}
void THD::raise_error_printf(uint sql_errno, ...)
@@ -979,20 +976,16 @@ void THD::raise_error_printf(uint sql_errno, ...)
va_start(args, sql_errno);
my_vsnprintf(ebuff, sizeof(ebuff), format, args);
va_end(args);
- (void) raise_condition(sql_errno,
- NULL,
- Sql_condition::WARN_LEVEL_ERROR,
- ebuff);
+ (void) raise_condition(sql_errno, "\0\0\0\0\0",
+ Sql_condition::WARN_LEVEL_ERROR, ebuff);
DBUG_VOID_RETURN;
}
void THD::raise_warning(uint sql_errno)
{
const char* msg= ER_THD(this, sql_errno);
- (void) raise_condition(sql_errno,
- NULL,
- Sql_condition::WARN_LEVEL_WARN,
- msg);
+ (void) raise_condition(sql_errno, "\0\0\0\0\0",
+ Sql_condition::WARN_LEVEL_WARN, msg);
}
void THD::raise_warning_printf(uint sql_errno, ...)
@@ -1005,10 +998,8 @@ void THD::raise_warning_printf(uint sql_errno, ...)
va_start(args, sql_errno);
my_vsnprintf(ebuff, sizeof(ebuff), format, args);
va_end(args);
- (void) raise_condition(sql_errno,
- NULL,
- Sql_condition::WARN_LEVEL_WARN,
- ebuff);
+ (void) raise_condition(sql_errno, "\0\0\0\0\0",
+ Sql_condition::WARN_LEVEL_WARN, ebuff);
DBUG_VOID_RETURN;
}
@@ -1019,10 +1010,8 @@ void THD::raise_note(uint sql_errno)
if (!(variables.option_bits & OPTION_SQL_NOTES))
DBUG_VOID_RETURN;
const char* msg= ER_THD(this, sql_errno);
- (void) raise_condition(sql_errno,
- NULL,
- Sql_condition::WARN_LEVEL_NOTE,
- msg);
+ (void) raise_condition(sql_errno, "\0\0\0\0\0",
+ Sql_condition::WARN_LEVEL_NOTE, msg);
DBUG_VOID_RETURN;
}
@@ -1038,21 +1027,20 @@ void THD::raise_note_printf(uint sql_errno, ...)
va_start(args, sql_errno);
my_vsnprintf(ebuff, sizeof(ebuff), format, args);
va_end(args);
- (void) raise_condition(sql_errno,
- NULL,
- Sql_condition::WARN_LEVEL_NOTE,
- ebuff);
+ (void) raise_condition(sql_errno, "\0\0\0\0\0",
+ Sql_condition::WARN_LEVEL_NOTE, ebuff);
DBUG_VOID_RETURN;
}
-Sql_condition* THD::raise_condition(uint sql_errno,
- const char* sqlstate,
- Sql_condition::enum_warning_level level,
- const Sql_user_condition_identity &ucid,
- const char* msg)
+Sql_condition* THD::raise_condition(const Sql_condition *cond)
{
+ uint sql_errno= cond->get_sql_errno();
+ const char *sqlstate= cond->get_sqlstate();
+ Sql_condition::enum_warning_level level= cond->get_level();
+ const char *msg= cond->get_message_text();
+
Diagnostics_area *da= get_stmt_da();
- Sql_condition *cond= NULL;
+ Sql_condition *raised= NULL;
DBUG_ENTER("THD::raise_condition");
DBUG_ASSERT(level < Sql_condition::WARN_LEVEL_END);
@@ -1080,22 +1068,18 @@ Sql_condition* THD::raise_condition(uint sql_errno,
sql_errno= ER_UNKNOWN_ERROR;
if (msg == NULL)
msg= ER_THD(this, sql_errno);
- if (sqlstate == NULL)
+ if (!*sqlstate)
sqlstate= mysql_errno_to_sqlstate(sql_errno);
- if ((level == Sql_condition::WARN_LEVEL_WARN) &&
- really_abort_on_warning())
+ if ((level == Sql_condition::WARN_LEVEL_WARN) && really_abort_on_warning())
{
- /*
- FIXME:
- push_warning and strict SQL_MODE case.
- */
+ /* FIXME: push_warning and strict SQL_MODE case. */
level= Sql_condition::WARN_LEVEL_ERROR;
}
if (!is_fatal_error &&
- handle_condition(sql_errno, sqlstate, &level, msg, &cond))
- DBUG_RETURN(cond);
+ handle_condition(sql_errno, sqlstate, &level, msg, &raised))
+ goto ret;
switch (level) {
case Sql_condition::WARN_LEVEL_NOTE:
@@ -1120,8 +1104,7 @@ Sql_condition* THD::raise_condition(uint sql_errno,
With wsrep we allow converting BF abort error to warning if
errors are ignored.
*/
- if (!is_fatal_error &&
- no_errors &&
+ if (!is_fatal_error && no_errors &&
(wsrep_trx().bf_aborted() || wsrep_retry_counter))
{
WSREP_DEBUG("BF abort error converted to warning");
@@ -1132,7 +1115,7 @@ Sql_condition* THD::raise_condition(uint sql_errno,
if (!da->is_error())
{
set_row_count_func(-1);
- da->set_error_status(sql_errno, msg, sqlstate, ucid, cond);
+ da->set_error_status(sql_errno, msg, sqlstate, *cond, raised);
}
}
}
@@ -1147,9 +1130,13 @@ Sql_condition* THD::raise_condition(uint sql_errno,
if (likely(!(is_fatal_error && (sql_errno == EE_OUTOFMEMORY ||
sql_errno == ER_OUTOFMEMORY))))
{
- cond= da->push_warning(this, sql_errno, sqlstate, level, ucid, msg);
+ raised= da->push_warning(this, sql_errno, sqlstate, level, *cond, msg,
+ cond->m_row_number);
}
- DBUG_RETURN(cond);
+ret:
+ if (raised)
+ raised->copy_opt_attributes(cond);
+ DBUG_RETURN(raised);
}
extern "C"
diff --git a/sql/sql_class.h b/sql/sql_class.h
index d9e56ed5e5b..a6f51d4b28f 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -560,7 +560,8 @@ typedef enum enum_diag_condition_item_name
DIAG_CURSOR_NAME= 9,
DIAG_MESSAGE_TEXT= 10,
DIAG_MYSQL_ERRNO= 11,
- LAST_DIAG_SET_PROPERTY= DIAG_MYSQL_ERRNO
+ DIAG_ROW_NUMBER= 12,
+ LAST_DIAG_SET_PROPERTY= DIAG_ROW_NUMBER
} Diag_condition_item_name;
/**
@@ -1131,6 +1132,7 @@ struct THD_count
{
static Atomic_counter<uint32_t> count;
static uint value() { return static_cast<uint>(count); }
+ static uint connection_thd_count();
THD_count() { count++; }
~THD_count() { count--; }
};
@@ -3083,8 +3085,8 @@ public:
{
bzero((char*)this, sizeof(*this));
implicit_xid.null();
- init_sql_alloc(key_memory_thd_transactions, &mem_root,
- ALLOC_ROOT_MIN_BLOCK_SIZE, 0, MYF(MY_THREAD_SPECIFIC));
+ init_sql_alloc(key_memory_thd_transactions, &mem_root, 256,
+ 0, MYF(MY_THREAD_SPECIFIC));
}
} default_transaction, *transaction;
Global_read_lock global_read_lock;
@@ -3948,6 +3950,11 @@ public:
user_time= t;
set_time();
}
+ inline void force_set_time(my_time_t t, ulong sec_part)
+ {
+ start_time= system_time.sec= t;
+ start_time_sec_part= system_time.sec_part= sec_part;
+ }
/*
this is only used by replication and BINLOG command.
usecs > TIME_MAX_SECOND_PART means "was not in binlog"
@@ -3959,15 +3966,9 @@ public:
else
{
if (sec_part <= TIME_MAX_SECOND_PART)
- {
- start_time= system_time.sec= t;
- start_time_sec_part= system_time.sec_part= sec_part;
- }
+ force_set_time(t, sec_part);
else if (t != system_time.sec)
- {
- start_time= system_time.sec= t;
- start_time_sec_part= system_time.sec_part= 0;
- }
+ force_set_time(t, 0);
else
{
start_time= t;
@@ -4833,45 +4834,17 @@ private:
@param msg the condition message text
@return The condition raised, or NULL
*/
- Sql_condition*
- raise_condition(uint sql_errno,
- const char* sqlstate,
- Sql_condition::enum_warning_level level,
- const char* msg)
+ Sql_condition* raise_condition(uint sql_errno, const char* sqlstate,
+ Sql_condition::enum_warning_level level, const char* msg)
{
- return raise_condition(sql_errno, sqlstate, level,
- Sql_user_condition_identity(), msg);
+ Sql_condition cond(NULL, // don't strdup the msg
+ Sql_condition_identity(sql_errno, sqlstate, level,
+ Sql_user_condition_identity()),
+ msg, get_stmt_da()->current_row_for_warning());
+ return raise_condition(&cond);
}
- /**
- Raise a generic or a user defined SQL condition.
- @param ucid - the user condition identity
- (or an empty identity if not a user condition)
- @param sql_errno - the condition error number
- @param sqlstate - the condition SQLSTATE
- @param level - the condition level
- @param msg - the condition message text
- @return The condition raised, or NULL
- */
- Sql_condition*
- raise_condition(uint sql_errno,
- const char* sqlstate,
- Sql_condition::enum_warning_level level,
- const Sql_user_condition_identity &ucid,
- const char* msg);
-
- Sql_condition*
- raise_condition(const Sql_condition *cond)
- {
- Sql_condition *raised= raise_condition(cond->get_sql_errno(),
- cond->get_sqlstate(),
- cond->get_level(),
- *cond/*Sql_user_condition_identity*/,
- cond->get_message_text());
- if (raised)
- raised->copy_opt_attributes(cond);
- return raised;
- }
+ Sql_condition* raise_condition(const Sql_condition *cond);
private:
void push_warning_truncated_priv(Sql_condition::enum_warning_level level,
diff --git a/sql/sql_cmd.h b/sql/sql_cmd.h
index ce34852117f..430afadb491 100644
--- a/sql/sql_cmd.h
+++ b/sql/sql_cmd.h
@@ -75,7 +75,6 @@ enum enum_sql_command {
SQLCOM_XA_START, SQLCOM_XA_END, SQLCOM_XA_PREPARE,
SQLCOM_XA_COMMIT, SQLCOM_XA_ROLLBACK, SQLCOM_XA_RECOVER,
SQLCOM_SHOW_PROC_CODE, SQLCOM_SHOW_FUNC_CODE,
- SQLCOM_ALTER_TABLESPACE,
SQLCOM_INSTALL_PLUGIN, SQLCOM_UNINSTALL_PLUGIN,
SQLCOM_SHOW_AUTHORS, SQLCOM_BINLOG_BASE64_EVENT,
SQLCOM_SHOW_PLUGINS, SQLCOM_SHOW_CONTRIBUTORS,
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 37e136927f2..c5defc1959c 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -1363,9 +1363,7 @@ static bool find_db_tables_and_rm_known_files(THD *thd, MY_DIR *dirp,
*tables= tot_list;
/* and at last delete all non-table files */
- for (uint idx=0 ;
- idx < (uint) dirp->number_of_files && !thd->killed ;
- idx++)
+ for (size_t idx=0; idx < dirp->number_of_files && !thd->killed; idx++)
{
FILEINFO *file=dirp->dir_entry+idx;
char *extension;
@@ -1488,9 +1486,7 @@ long mysql_rm_arc_files(THD *thd, MY_DIR *dirp, const char *org_path)
DBUG_ENTER("mysql_rm_arc_files");
DBUG_PRINT("enter", ("path: %s", org_path));
- for (uint idx=0 ;
- idx < (uint) dirp->number_of_files && !thd->killed ;
- idx++)
+ for (size_t idx=0; idx < dirp->number_of_files && !thd->killed; idx++)
{
FILEINFO *file=dirp->dir_entry+idx;
char *extension, *revision;
@@ -1970,8 +1966,8 @@ bool mysql_upgrade_db(THD *thd, const LEX_CSTRING *old_db)
/* Step2: Move tables to the new database */
if ((dirp = my_dir(path,MYF(MY_DONT_SORT))))
{
- uint nfiles= (uint) dirp->number_of_files;
- for (uint idx=0 ; idx < nfiles && !thd->killed ; idx++)
+ size_t nfiles= dirp->number_of_files;
+ for (size_t idx=0 ; idx < nfiles && !thd->killed ; idx++)
{
FILEINFO *file= dirp->dir_entry + idx;
char *extension, tname[FN_REFLEN + 1];
@@ -2060,8 +2056,8 @@ bool mysql_upgrade_db(THD *thd, const LEX_CSTRING *old_db)
if ((dirp = my_dir(path,MYF(MY_DONT_SORT))))
{
- uint nfiles= (uint) dirp->number_of_files;
- for (uint idx=0 ; idx < nfiles ; idx++)
+ size_t nfiles= dirp->number_of_files;
+ for (size_t idx=0 ; idx < nfiles ; idx++)
{
FILEINFO *file= dirp->dir_entry + idx;
char oldname[FN_REFLEN + 1], newname[FN_REFLEN + 1];
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index da417495041..95adf17987c 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -729,6 +729,8 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
explain= (Explain_delete*)thd->lex->explain->get_upd_del_plan();
explain->tracker.on_scan_init();
+ thd->get_stmt_da()->reset_current_row_for_warning(1);
+
if (!delete_while_scanning)
{
/*
@@ -794,9 +796,11 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
THD_STAGE_INFO(thd, stage_updating);
fix_rownum_pointers(thd, thd->lex->current_select, &deleted);
+ thd->get_stmt_da()->reset_current_row_for_warning(0);
while (likely(!(error=info.read_record())) && likely(!thd->killed) &&
likely(!thd->is_error()))
{
+ thd->get_stmt_da()->inc_current_row_for_warning();
if (delete_while_scanning)
delete_record= record_should_be_deleted(thd, table, select, explain,
delete_history);
@@ -872,6 +876,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
else
break;
}
+ thd->get_stmt_da()->reset_current_row_for_warning(1);
terminate_delete:
killed_status= thd->killed;
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index cef9e6cec00..85be61c34ef 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -204,6 +204,7 @@ Sql_condition::copy_opt_attributes(const Sql_condition *cond)
copy_string(m_mem_root, & m_table_name, & cond->m_table_name);
copy_string(m_mem_root, & m_column_name, & cond->m_column_name);
copy_string(m_mem_root, & m_cursor_name, & cond->m_cursor_name);
+ m_row_number= cond->m_row_number;
}
@@ -216,7 +217,7 @@ Sql_condition::set_builtin_message_text(const char* str)
*/
const char* copy;
- copy= strdup_root(m_mem_root, str);
+ copy= m_mem_root ? strdup_root(m_mem_root, str) : str;
m_message_text.set(copy, strlen(copy), error_message_charset_info);
DBUG_ASSERT(! m_message_text.is_alloced());
}
@@ -500,7 +501,7 @@ Diagnostics_area::disable_status()
Warning_info::Warning_info(ulonglong warn_id_arg,
bool allow_unlimited_warnings, bool initialize)
:m_current_statement_warn_count(0),
- m_current_row_for_warning(1),
+ m_current_row_for_warning(0),
m_warn_id(warn_id_arg),
m_error_condition(NULL),
m_allow_unlimited_warnings(allow_unlimited_warnings),
@@ -557,7 +558,7 @@ void Warning_info::clear(ulonglong new_id)
free_memory();
memset(m_warn_count, 0, sizeof(m_warn_count));
m_current_statement_warn_count= 0;
- m_current_row_for_warning= 1; /* Start counting from the first row */
+ m_current_row_for_warning= 0;
clear_error_condition();
}
@@ -663,7 +664,8 @@ void Warning_info::reserve_space(THD *thd, uint count)
Sql_condition *Warning_info::push_warning(THD *thd,
const Sql_condition_identity *value,
- const char *msg)
+ const char *msg,
+ ulong current_row_number)
{
Sql_condition *cond= NULL;
@@ -672,7 +674,8 @@ Sql_condition *Warning_info::push_warning(THD *thd,
if (m_allow_unlimited_warnings ||
m_warn_list.elements() < thd->variables.max_error_count)
{
- cond= new (& m_warn_root) Sql_condition(& m_warn_root, *value, msg);
+ cond= new (& m_warn_root) Sql_condition(& m_warn_root, *value, msg,
+ current_row_number);
if (cond)
m_warn_list.push_back(cond);
}
@@ -688,7 +691,8 @@ Sql_condition *Warning_info::push_warning(THD *thd,
const Sql_condition *sql_condition)
{
Sql_condition *new_condition= push_warning(thd, sql_condition,
- sql_condition->get_message_text());
+ sql_condition->get_message_text(),
+ sql_condition->m_row_number);
if (new_condition)
new_condition->copy_opt_attributes(sql_condition);
@@ -723,7 +727,7 @@ void push_warning(THD *thd, Sql_condition::enum_warning_level level,
if (level == Sql_condition::WARN_LEVEL_ERROR)
level= Sql_condition::WARN_LEVEL_WARN;
- (void) thd->raise_condition(code, NULL, level, msg);
+ (void) thd->raise_condition(code, "\0\0\0\0\0", level, msg);
/* Make sure we also count warnings pushed after calling set_ok_status(). */
thd->get_stmt_da()->increment_warning();
diff --git a/sql/sql_error.h b/sql/sql_error.h
index 6b0d4d7749c..d9d7f420baa 100644
--- a/sql/sql_error.h
+++ b/sql/sql_error.h
@@ -306,6 +306,9 @@ protected:
/** SQL CURSOR_NAME condition item. */
String m_cursor_name;
+ /** SQL ROW_NUMBER condition item. */
+ ulong m_row_number;
+
Sql_condition_items()
:m_class_origin((const char*) NULL, 0, & my_charset_utf8mb3_bin),
m_subclass_origin((const char*) NULL, 0, & my_charset_utf8mb3_bin),
@@ -316,7 +319,8 @@ protected:
m_schema_name((const char*) NULL, 0, & my_charset_utf8mb3_bin),
m_table_name((const char*) NULL, 0, & my_charset_utf8mb3_bin),
m_column_name((const char*) NULL, 0, & my_charset_utf8mb3_bin),
- m_cursor_name((const char*) NULL, 0, & my_charset_utf8mb3_bin)
+ m_cursor_name((const char*) NULL, 0, & my_charset_utf8mb3_bin),
+ m_row_number(0)
{ }
void clear()
@@ -331,6 +335,7 @@ protected:
m_table_name.length(0);
m_column_name.length(0);
m_cursor_name.length(0);
+ m_row_number= 0;
}
};
@@ -434,16 +439,14 @@ private:
@param level - the error level for this condition
@param msg - the message text for this condition
*/
- Sql_condition(MEM_ROOT *mem_root,
- const Sql_condition_identity &value,
- const char *msg)
- :Sql_condition_identity(value),
- m_mem_root(mem_root)
+ Sql_condition(MEM_ROOT *mem_root, const Sql_condition_identity &value,
+ const char *msg, ulong current_row_for_warning)
+ : Sql_condition_identity(value), m_mem_root(mem_root)
{
- DBUG_ASSERT(mem_root != NULL);
DBUG_ASSERT(value.get_sql_errno() != 0);
DBUG_ASSERT(msg != NULL);
set_builtin_message_text(msg);
+ m_row_number= current_row_for_warning;
}
/** Destructor. */
@@ -720,7 +723,7 @@ private:
void inc_current_row_for_warning() { m_current_row_for_warning++; }
/** Reset the current row counter. Start counting from the first row. */
- void reset_current_row_for_warning() { m_current_row_for_warning= 1; }
+ void reset_current_row_for_warning(int n) { m_current_row_for_warning= n; }
/** Return the current counter value. */
ulong current_row_for_warning() const { return m_current_row_for_warning; }
@@ -742,9 +745,8 @@ private:
@return a pointer to the added SQL-condition.
*/
- Sql_condition *push_warning(THD *thd,
- const Sql_condition_identity *identity,
- const char* msg);
+ Sql_condition *push_warning(THD *thd, const Sql_condition_identity *identity,
+ const char* msg, ulong current_row_number);
/**
Add a new SQL-condition to the current list and increment the respective
@@ -1143,8 +1145,8 @@ public:
void inc_current_row_for_warning()
{ get_warning_info()->inc_current_row_for_warning(); }
- void reset_current_row_for_warning()
- { get_warning_info()->reset_current_row_for_warning(); }
+ void reset_current_row_for_warning(int n)
+ { get_warning_info()->reset_current_row_for_warning(n); }
bool is_warning_info_read_only() const
{ return get_warning_info()->is_read_only(); }
@@ -1175,10 +1177,12 @@ public:
const char* sqlstate,
Sql_condition::enum_warning_level level,
const Sql_user_condition_identity &ucid,
- const char* msg)
+ const char* msg,
+ ulong current_row_number)
{
Sql_condition_identity tmp(sql_errno_arg, sqlstate, level, ucid);
- return get_warning_info()->push_warning(thd, &tmp, msg);
+ return get_warning_info()->push_warning(thd, &tmp, msg,
+ current_row_number);
}
Sql_condition *push_warning(THD *thd,
@@ -1188,7 +1192,7 @@ public:
const char* msg)
{
return push_warning(thd, sqlerrno, sqlstate, level,
- Sql_user_condition_identity(), msg);
+ Sql_user_condition_identity(), msg, 0);
}
void mark_sql_conditions_for_removal()
{ get_warning_info()->mark_sql_conditions_for_removal(); }
diff --git a/sql/sql_get_diagnostics.cc b/sql/sql_get_diagnostics.cc
index 197bf5e7a00..240975d2974 100644
--- a/sql/sql_get_diagnostics.cc
+++ b/sql/sql_get_diagnostics.cc
@@ -338,6 +338,8 @@ Condition_information_item::get_value(THD *thd, const Sql_condition *cond)
str.set_ascii(cond->get_sqlstate(), strlen(cond->get_sqlstate()));
value= make_utf8_string_item(thd, &str);
break;
+ case ROW_NUMBER:
+ value= new (thd->mem_root) Item_uint(thd, cond->m_row_number);
}
DBUG_RETURN(value);
diff --git a/sql/sql_get_diagnostics.h b/sql/sql_get_diagnostics.h
index f283aa5b2c6..efe526d7c61 100644
--- a/sql/sql_get_diagnostics.h
+++ b/sql/sql_get_diagnostics.h
@@ -254,7 +254,8 @@ public:
CURSOR_NAME,
MESSAGE_TEXT,
MYSQL_ERRNO,
- RETURNED_SQLSTATE
+ RETURNED_SQLSTATE,
+ ROW_NUMBER
};
/**
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 10dab7db4a0..d22a5670495 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -229,6 +229,7 @@ static int check_insert_fields(THD *thd, TABLE_LIST *table_list,
}
if (values.elements != table->s->visible_fields)
{
+ thd->get_stmt_da()->reset_current_row_for_warning(1);
my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), 1L);
DBUG_RETURN(-1);
}
@@ -253,6 +254,7 @@ static int check_insert_fields(THD *thd, TABLE_LIST *table_list,
if (fields.elements != values.elements)
{
+ thd->get_stmt_da()->reset_current_row_for_warning(1);
my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), 1L);
DBUG_RETURN(-1);
}
@@ -699,7 +701,6 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list,
const bool was_insert_delayed= (table_list->lock_type == TL_WRITE_DELAYED);
bool using_bulk_insert= 0;
uint value_count;
- ulong counter = 1;
/* counter of iteration in bulk PS operation*/
ulonglong iteration= 0;
ulonglong id;
@@ -830,10 +831,11 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list,
while ((values= its++))
{
- counter++;
+ thd->get_stmt_da()->inc_current_row_for_warning();
if (values->elements != value_count)
{
- my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), counter);
+ my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0),
+ thd->get_stmt_da()->current_row_for_warning());
goto abort;
}
if (setup_fields(thd, Ref_ptr_array(),
@@ -842,6 +844,7 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list,
switch_to_nullable_trigger_fields(*values, table);
}
its.rewind ();
+ thd->get_stmt_da()->reset_current_row_for_warning(0);
/* Restore the current context. */
ctx_state.restore_state(context, table_list);
@@ -1013,6 +1016,7 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list,
while ((values= its++))
{
+ thd->get_stmt_da()->inc_current_row_for_warning();
if (fields.elements || !value_count)
{
/*
@@ -1129,7 +1133,6 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list,
if (unlikely(error))
break;
info.accepted_rows++;
- thd->get_stmt_da()->inc_current_row_for_warning();
}
its.rewind();
iteration++;
@@ -1162,8 +1165,13 @@ values_loop_end:
table->file->ha_release_auto_increment();
if (using_bulk_insert)
{
- if (unlikely(table->file->ha_end_bulk_insert()) &&
- !error)
+ /*
+ if my_error() wasn't called yet on some specific row, end_bulk_insert()
+ can still do it, but the error shouldn't be for any specific row number
+ */
+ if (!error)
+ thd->get_stmt_da()->reset_current_row_for_warning(0);
+ if (unlikely(table->file->ha_end_bulk_insert()) && !error)
{
table->file->print_error(my_errno,MYF(0));
error=1;
@@ -1418,7 +1426,7 @@ static bool check_view_insertability(THD * thd, TABLE_LIST *view)
DBUG_ASSERT(view->table != 0 && view->field_translation != 0);
- (void) my_bitmap_init(&used_fields, used_fields_buff, table->s->fields, 0);
+ (void) my_bitmap_init(&used_fields, used_fields_buff, table->s->fields);
bitmap_clear_all(&used_fields);
view->contain_auto_increment= 0;
@@ -1688,6 +1696,8 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
ctx_state.restore_state(context, table_list);
}
+ thd->get_stmt_da()->reset_current_row_for_warning(1);
+
if (res)
DBUG_RETURN(res);
@@ -2795,7 +2805,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
my_bitmap_init(&copy->has_value_set,
(my_bitmap_map*) (bitmap +
bitmaps_used*share->column_bitmap_size),
- share->fields, FALSE);
+ share->fields);
}
copy->tmp_set.bitmap= 0; // To catch errors
bzero((char*) bitmap, share->column_bitmap_size * bitmaps_used);
@@ -5083,7 +5093,8 @@ bool select_create::send_eof()
{
WSREP_DEBUG("select_create commit failed, thd: %llu err: %s %s",
thd->thread_id,
- wsrep_thd_transaction_state_str(thd), wsrep_thd_query(thd));
+ wsrep_thd_transaction_state_str(thd),
+ wsrep_thd_query(thd));
mysql_mutex_unlock(&thd->LOCK_thd_data);
abort_result_set();
DBUG_RETURN(true);
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 934e7e7e7e0..2fb98f5aa88 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1349,7 +1349,7 @@ void lex_unlock_plugins(LEX *lex)
/* release used plugins */
if (lex->plugins.elements) /* No function call and no mutex if no plugins. */
{
- plugin_unlock_list(0, (plugin_ref*)lex->plugins.buffer,
+ plugin_unlock_list(0, (plugin_ref*)lex->plugins.buffer,
lex->plugins.elements);
}
reset_dynamic(&lex->plugins);
@@ -6071,8 +6071,10 @@ int st_select_lex_unit::save_union_explain_part2(Explain_query *output)
bool LEX::is_partition_management() const
{
return (sql_command == SQLCOM_ALTER_TABLE &&
- (alter_info.partition_flags == ALTER_PARTITION_ADD ||
- alter_info.partition_flags == ALTER_PARTITION_REORGANIZE));
+ (alter_info.partition_flags & (ALTER_PARTITION_ADD |
+ ALTER_PARTITION_CONVERT_IN |
+ ALTER_PARTITION_CONVERT_OUT |
+ ALTER_PARTITION_REORGANIZE)));
}
@@ -11368,6 +11370,25 @@ bool LEX::stmt_alter_table_exchange_partition(Table_ident *table)
}
+bool LEX::stmt_alter_table(Table_ident *table)
+{
+ DBUG_ASSERT(sql_command == SQLCOM_ALTER_TABLE);
+ first_select_lex()->db= table->db;
+ if (first_select_lex()->db.str == NULL &&
+ copy_db_to(&first_select_lex()->db))
+ return true;
+ if (unlikely(check_table_name(table->table.str, table->table.length,
+ false)) ||
+ (table->db.str && unlikely(check_db_name((LEX_STRING*) &table->db))))
+ {
+ my_error(ER_WRONG_TABLE_NAME, MYF(0), table->table.str);
+ return true;
+ }
+ name= table->table;
+ return false;
+}
+
+
void LEX::stmt_purge_to(const LEX_CSTRING &to)
{
type= 0;
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index a9040f7c3d2..3233234fd39 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -290,7 +290,6 @@ class sp_pcontext;
class sp_variable;
class sp_expr_lex;
class sp_assignment_lex;
-class st_alter_tablespace;
class partition_info;
class Event_parse_data;
class set_var_base;
@@ -3530,12 +3529,6 @@ public:
/*
- Reference to a struct that contains information in various commands
- to add/create/drop/change table spaces.
- */
- st_alter_tablespace *alter_tablespace_info;
-
- /*
The set of those tables whose fields are referenced in all subqueries
of the query.
TODO: possibly this it is incorrect to have used tables in LEX because
@@ -4720,6 +4713,7 @@ public:
void stmt_deallocate_prepare(const Lex_ident_sys_st &ident);
bool stmt_alter_table_exchange_partition(Table_ident *table);
+ bool stmt_alter_table(Table_ident *table);
void stmt_purge_to(const LEX_CSTRING &to);
bool stmt_purge_before(Item *item);
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 2f1ee0b11bd..fe574db528f 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -659,6 +659,7 @@ int mysql_load(THD *thd, const sql_exchange *ex, TABLE_LIST *table_list,
table->copy_blobs=1;
thd->abort_on_warning= !ignore && thd->is_strict_mode();
+ thd->get_stmt_da()->reset_current_row_for_warning(1);
bool create_lookup_handler= handle_duplicates != DUP_ERROR;
if ((table_list->table->file->ha_table_flags() & HA_DUPLICATE_POS))
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 0aae981db27..f8f61c66df0 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -54,7 +54,6 @@
// check_mqh,
// reset_mqh
#include "sql_rename.h" // mysql_rename_tables
-#include "sql_tablespace.h" // mysql_alter_tablespace
#include "hostname.h" // hostname_cache_refresh
#include "sql_test.h" // mysql_print_status
#include "sql_select.h" // handle_select, mysql_select,
@@ -878,7 +877,6 @@ void init_update_queries(void)
sql_command_flags[SQLCOM_ALTER_PROCEDURE]|= CF_DISALLOW_IN_RO_TRANS;
sql_command_flags[SQLCOM_ALTER_FUNCTION]|= CF_DISALLOW_IN_RO_TRANS;
sql_command_flags[SQLCOM_TRUNCATE]|= CF_DISALLOW_IN_RO_TRANS;
- sql_command_flags[SQLCOM_ALTER_TABLESPACE]|= CF_DISALLOW_IN_RO_TRANS;
sql_command_flags[SQLCOM_REPAIR]|= CF_DISALLOW_IN_RO_TRANS;
sql_command_flags[SQLCOM_OPTIMIZE]|= CF_DISALLOW_IN_RO_TRANS;
sql_command_flags[SQLCOM_GRANT]|= CF_DISALLOW_IN_RO_TRANS;
@@ -4136,7 +4134,7 @@ mysql_execute_command(THD *thd, bool is_called_from_prepared_stmt)
If new master was not added, we still need to free mi.
*/
if (master_info_added)
- master_info_index->remove_master_info(mi);
+ master_info_index->remove_master_info(mi, 1);
else
delete mi;
}
@@ -5888,12 +5886,6 @@ mysql_execute_command(THD *thd, bool is_called_from_prepared_stmt)
case SQLCOM_XA_RECOVER:
res= mysql_xa_recover(thd);
break;
- case SQLCOM_ALTER_TABLESPACE:
- if (check_global_access(thd, CREATE_TABLESPACE_ACL))
- break;
- if (!(res= mysql_alter_tablespace(thd, lex->alter_tablespace_info)))
- my_ok(thd);
- break;
case SQLCOM_INSTALL_PLUGIN:
if (! (res= mysql_install_plugin(thd, &thd->lex->comment,
&thd->lex->ident)))
@@ -6125,7 +6117,12 @@ finish:
thd->wsrep_consistency_check= NO_CONSISTENCY_CHECK;
if (wsrep_thd_is_toi(thd) || wsrep_thd_is_in_rsu(thd))
+ {
+ WSREP_DEBUG("mysql_execute_command for %s", wsrep_thd_query(thd));
+ THD_STAGE_INFO(thd, stage_waiting_isolation);
wsrep_to_isolation_end(thd);
+ }
+
/*
Force release of transactional locks if not in active MST and wsrep is on.
*/
@@ -7889,7 +7886,8 @@ static bool wsrep_mysql_parse(THD *thd, char *rawbuf, uint length,
DBUG_ASSERT(!debug_sync_set_action(thd, STRING_WITH_LEN(act)));
});
WSREP_DEBUG("wsrep retrying AC query: %lu %s",
- thd->wsrep_retry_counter, wsrep_thd_query(thd));
+ thd->wsrep_retry_counter,
+ wsrep_thd_query(thd));
wsrep_prepare_for_autocommit_retry(thd, rawbuf, length, parser_state);
if (thd->lex->explain)
delete_explain_query(thd->lex);
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index b0df5ef5adc..39e57baa510 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -67,7 +67,6 @@
#include "opt_range.h" // store_key_image_to_rec
#include "sql_alter.h" // Alter_table_ctx
#include "sql_select.h"
-#include "sql_tablespace.h" // check_tablespace_name
#include "ddl_log.h"
#include "tztime.h" // my_tz_OFFSET0
@@ -78,11 +77,6 @@ using std::min;
#ifdef WITH_PARTITION_STORAGE_ENGINE
#include "ha_partition.h"
-#define ERROR_INJECT_CRASH(code) \
- DBUG_EVALUATE_IF(code, (DBUG_SUICIDE(), 0), 0)
-#define ERROR_INJECT_ERROR(code) \
- DBUG_EVALUATE_IF(code, (my_error(ER_UNKNOWN_ERROR, MYF(0)), TRUE), 0)
-
/*
Partition related functions declarations and some static constants;
*/
@@ -525,7 +519,7 @@ static bool create_full_part_field_array(THD *thd, TABLE *table,
goto end;
}
if (unlikely(my_bitmap_init(&part_info->full_part_field_set, bitmap_buf,
- table->s->fields, FALSE)))
+ table->s->fields)))
{
result= TRUE;
goto end;
@@ -1100,10 +1094,10 @@ static bool set_up_partition_bitmaps(THD *thd, partition_info *part_info)
bitmap_bytes * 2))))
DBUG_RETURN(TRUE);
- my_bitmap_init(&part_info->read_partitions, bitmap_buf, bitmap_bits, FALSE);
+ my_bitmap_init(&part_info->read_partitions, bitmap_buf, bitmap_bits);
/* Use the second half of the allocated buffer for lock_partitions */
my_bitmap_init(&part_info->lock_partitions, bitmap_buf + (bitmap_bytes / 4),
- bitmap_bits, FALSE);
+ bitmap_bits);
part_info->bitmaps_are_initialized= TRUE;
part_info->set_partition_bitmaps(NULL);
DBUG_RETURN(FALSE);
@@ -2215,8 +2209,6 @@ static int add_partition_options(String *str, partition_element *p_elem)
{
int err= 0;
- if (p_elem->tablespace_name)
- err+= add_keyword_string(str,"TABLESPACE", false, p_elem->tablespace_name);
if (p_elem->nodegroup_id != UNDEF_NODEGROUP)
err+= add_keyword_int(str,"NODEGROUP",(longlong)p_elem->nodegroup_id);
if (p_elem->part_max_rows)
@@ -4714,8 +4706,6 @@ bool compare_partition_options(HA_CREATE_INFO *table_create_info,
Note that there are not yet any engine supporting tablespace together
with partitioning. TODO: when there are, add compare.
*/
- if (part_elem->tablespace_name || table_create_info->tablespace)
- option_diffs[errors++]= "TABLESPACE";
if (part_elem->part_max_rows != table_create_info->max_rows)
option_diffs[errors++]= "MAX_ROWS";
if (part_elem->part_min_rows != table_create_info->min_rows)
@@ -4876,10 +4866,12 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
if (alter_info->partition_flags &
(ALTER_PARTITION_ADD |
ALTER_PARTITION_DROP |
+ ALTER_PARTITION_CONVERT_OUT |
ALTER_PARTITION_COALESCE |
ALTER_PARTITION_REORGANIZE |
ALTER_PARTITION_TABLE_REORG |
- ALTER_PARTITION_REBUILD))
+ ALTER_PARTITION_REBUILD |
+ ALTER_PARTITION_CONVERT_IN))
{
/*
You can't add column when we are doing alter related to partition
@@ -5085,6 +5077,13 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
}
if (alter_info->partition_flags & ALTER_PARTITION_ADD)
{
+ if ((alter_info->partition_flags & ALTER_PARTITION_CONVERT_IN) &&
+ !(tab_part_info->part_type == RANGE_PARTITION ||
+ tab_part_info->part_type == LIST_PARTITION))
+ {
+ my_error(ER_ONLY_ON_RANGE_LIST_PARTITION, MYF(0), "CONVERT TABLE TO");
+ goto err;
+ }
if (*fast_alter_table && thd->locked_tables_mode)
{
MEM_ROOT *old_root= thd->mem_root;
@@ -5371,8 +5370,12 @@ that are reorganised.
tab_part_info->is_auto_partitioned= FALSE;
}
}
- else if (alter_info->partition_flags & ALTER_PARTITION_DROP)
+ else if ((alter_info->partition_flags & ALTER_PARTITION_DROP) |
+ (alter_info->partition_flags & ALTER_PARTITION_CONVERT_OUT))
{
+ const char * const cmd=
+ (alter_info->partition_flags & ALTER_PARTITION_CONVERT_OUT) ?
+ "CONVERT" : "DROP";
/*
Drop a partition from a range partition and list partitioning is
always safe and can be made more or less immediate. It is necessary
@@ -5401,7 +5404,7 @@ that are reorganised.
if (!(tab_part_info->part_type == RANGE_PARTITION ||
tab_part_info->part_type == LIST_PARTITION))
{
- my_error(ER_ONLY_ON_RANGE_LIST_PARTITION, MYF(0), "DROP");
+ my_error(ER_ONLY_ON_RANGE_LIST_PARTITION, MYF(0), cmd);
goto err;
}
if (num_parts_dropped >= tab_part_info->num_parts)
@@ -5443,7 +5446,7 @@ that are reorganised.
} while (++part_count < tab_part_info->num_parts);
if (num_parts_found != num_parts_dropped)
{
- my_error(ER_DROP_PARTITION_NON_EXISTENT, MYF(0), "DROP");
+ my_error(ER_PARTITION_DOES_NOT_EXIST, MYF(0));
goto err;
}
if (table->file->is_fk_defined_on_table_or_index(MAX_KEY))
@@ -5451,6 +5454,17 @@ that are reorganised.
my_error(ER_ROW_IS_REFERENCED, MYF(0));
goto err;
}
+ DBUG_ASSERT(!(alter_info->partition_flags & ALTER_PARTITION_CONVERT_OUT) ||
+ num_parts_dropped == 1);
+ /* NOTE: num_parts is used in generate_partition_syntax() */
+ tab_part_info->num_parts-= num_parts_dropped;
+ if ((alter_info->partition_flags & ALTER_PARTITION_CONVERT_OUT) &&
+ tab_part_info->is_sub_partitioned())
+ {
+ // TODO technically this can be converted to a *partitioned* table
+ my_error(ER_PARTITION_CONVERT_SUBPARTITIONED, MYF(0));
+ goto err;
+ }
}
else if (alter_info->partition_flags & ALTER_PARTITION_REBUILD)
{
@@ -5458,7 +5472,7 @@ that are reorganised.
tab_part_info->default_engine_type);
if (set_part_state(alter_info, tab_part_info, PART_CHANGED))
{
- my_error(ER_DROP_PARTITION_NON_EXISTENT, MYF(0), "REBUILD");
+ my_error(ER_PARTITION_DOES_NOT_EXIST, MYF(0));
goto err;
}
if (!(*fast_alter_table))
@@ -5734,7 +5748,7 @@ the generated partition syntax in a correct manner.
} while (++part_count < tab_part_info->num_parts);
if (drop_count != num_parts_reorged)
{
- my_error(ER_DROP_PARTITION_NON_EXISTENT, MYF(0), "REORGANIZE");
+ my_error(ER_PARTITION_DOES_NOT_EXIST, MYF(0));
goto err;
}
tab_part_info->num_parts= check_total_partitions;
@@ -5794,7 +5808,7 @@ the generated partition syntax in a correct manner.
goto err;
}
}
- } // ADD, DROP, COALESCE, REORGANIZE, TABLE_REORG, REBUILD
+ } // ADD, DROP, COALESCE, REORGANIZE, TABLE_REORG, REBUILD, CONVERT
else
{
/*
@@ -6135,19 +6149,64 @@ static bool mysql_drop_partitions(ALTER_PARTITION_PARAM_TYPE *lpt)
/*
- Insert log entry into list
+ Convert partition to a table in an ALTER TABLE of partitions
+
SYNOPSIS
- insert_part_info_log_entry_list()
- log_entry
+ alter_partition_convert_out()
+ lpt Struct containing parameters
+
RETURN VALUES
- NONE
+ TRUE Failure
+ FALSE Success
+
+ DESCRIPTION
+ Rename partition table marked with PART_TO_BE_DROPPED into a separate table
+ under the name lpt->alter_ctx->(new_db, new_name).
+
+ This is ddl-logged by write_log_convert_out_partition().
*/
-static void insert_part_info_log_entry_list(partition_info *part_info,
- DDL_LOG_MEMORY_ENTRY *log_entry)
+static bool alter_partition_convert_out(ALTER_PARTITION_PARAM_TYPE *lpt)
{
- log_entry->next_active_log_entry= part_info->first_log_entry;
- part_info->first_log_entry= log_entry;
+ partition_info *part_info= lpt->table->part_info;
+ THD *thd= lpt->thd;
+ int error;
+ handler *file= get_new_handler(NULL, thd->mem_root, part_info->default_engine_type);
+
+ DBUG_ASSERT(lpt->thd->mdl_context.is_lock_owner(MDL_key::TABLE,
+ lpt->table->s->db.str,
+ lpt->table->s->table_name.str,
+ MDL_EXCLUSIVE));
+
+ char from_name[FN_REFLEN + 1], to_name[FN_REFLEN + 1];
+ const char *path= lpt->table->s->path.str;
+
+ build_table_filename(to_name, sizeof(to_name) - 1, lpt->alter_ctx->new_db.str,
+ lpt->alter_ctx->new_name.str, "", 0);
+
+ for (const partition_element &e: part_info->partitions)
+ {
+ if (e.part_state != PART_TO_BE_DROPPED)
+ continue;
+
+ if (unlikely((error= create_partition_name(from_name, sizeof(from_name),
+ path, e.partition_name,
+ NORMAL_PART_NAME, FALSE))))
+ {
+ DBUG_ASSERT(thd->is_error());
+ return true;
+ }
+ if (DBUG_IF("error_convert_partition_00") ||
+ unlikely(error= file->ha_rename_table(from_name, to_name)))
+ {
+ my_error(ER_ERROR_ON_RENAME, MYF(0), from_name, to_name, my_errno);
+ lpt->table->file->print_error(error, MYF(0));
+ return true;
+ }
+ break;
+ }
+
+ return false;
}
@@ -6175,50 +6234,44 @@ static void release_part_info_log_entries(DDL_LOG_MEMORY_ENTRY *log_entry)
/*
- Log an delete/rename frm file
+ Log an rename frm file
SYNOPSIS
- write_log_replace_delete_frm()
+ write_log_replace_frm()
lpt Struct for parameters
next_entry Next reference to use in log record
from_path Name to rename from
to_path Name to rename to
- replace_flag TRUE if replace, else delete
RETURN VALUES
TRUE Error
FALSE Success
DESCRIPTION
- Support routine that writes a replace or delete of an frm file into the
+ Support routine that writes a replace of an frm file into the
ddl log. It also inserts an entry that keeps track of used space into
the partition info object
*/
-static bool write_log_replace_delete_frm(ALTER_PARTITION_PARAM_TYPE *lpt,
- uint next_entry,
- const char *from_path,
- const char *to_path,
- bool replace_flag)
+bool write_log_replace_frm(ALTER_PARTITION_PARAM_TYPE *lpt,
+ uint next_entry,
+ const char *from_path,
+ const char *to_path)
{
DDL_LOG_ENTRY ddl_log_entry;
DDL_LOG_MEMORY_ENTRY *log_entry;
- DBUG_ENTER("write_log_replace_delete_frm");
+ DBUG_ENTER("write_log_replace_frm");
bzero(&ddl_log_entry, sizeof(ddl_log_entry));
- if (replace_flag)
- ddl_log_entry.action_type= DDL_LOG_REPLACE_ACTION;
- else
- ddl_log_entry.action_type= DDL_LOG_DELETE_ACTION;
+ ddl_log_entry.action_type= DDL_LOG_REPLACE_ACTION;
ddl_log_entry.next_entry= next_entry;
lex_string_set(&ddl_log_entry.handler_name, reg_ext);
lex_string_set(&ddl_log_entry.name, to_path);
+ lex_string_set(&ddl_log_entry.from_name, from_path);
- if (replace_flag)
- lex_string_set(&ddl_log_entry.from_name, from_path);
if (ddl_log_write_entry(&ddl_log_entry, &log_entry))
{
- DBUG_RETURN(TRUE);
+ DBUG_RETURN(true);
}
- insert_part_info_log_entry_list(lpt->part_info, log_entry);
- DBUG_RETURN(FALSE);
+ ddl_log_add_entry(lpt->part_info, log_entry);
+ DBUG_RETURN(false);
}
@@ -6297,7 +6350,7 @@ static bool write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
*next_entry= log_entry->entry_pos;
sub_elem->log_entry= log_entry;
- insert_part_info_log_entry_list(part_info, log_entry);
+ ddl_log_add_entry(part_info, log_entry);
} while (++j < num_subparts);
}
else
@@ -6324,7 +6377,7 @@ static bool write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
}
*next_entry= log_entry->entry_pos;
part_elem->log_entry= log_entry;
- insert_part_info_log_entry_list(part_info, log_entry);
+ ddl_log_add_entry(part_info, log_entry);
}
}
} while (++i < num_elements);
@@ -6333,21 +6386,29 @@ static bool write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
/*
- Log dropped partitions
+ Log dropped or converted partitions
SYNOPSIS
- write_log_dropped_partitions()
+ log_drop_or_convert_action()
lpt Struct containing parameters
RETURN VALUES
TRUE Error
FALSE Success
*/
-static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
- uint *next_entry,
- const char *path,
- bool temp_list)
+enum log_action_enum
+{
+ ACT_DROP = 0,
+ ACT_CONVERT_IN,
+ ACT_CONVERT_OUT
+};
+
+static bool log_drop_or_convert_action(ALTER_PARTITION_PARAM_TYPE *lpt,
+ uint *next_entry, const char *path,
+ const char *from_name, bool temp_list,
+ const log_action_enum convert_action)
{
DDL_LOG_ENTRY ddl_log_entry;
+ DBUG_ASSERT(convert_action == ACT_DROP || (from_name != NULL));
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
char tmp_path[FN_REFLEN + 1];
@@ -6355,10 +6416,13 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
List_iterator<partition_element> temp_it(part_info->temp_partitions);
uint num_temp_partitions= part_info->temp_partitions.elements;
uint num_elements= part_info->partitions.elements;
- DBUG_ENTER("write_log_dropped_partitions");
+ DBUG_ENTER("log_drop_or_convert_action");
bzero(&ddl_log_entry, sizeof(ddl_log_entry));
- ddl_log_entry.action_type= DDL_LOG_DELETE_ACTION;
+
+ ddl_log_entry.action_type= convert_action ?
+ DDL_LOG_RENAME_ACTION :
+ DDL_LOG_DELETE_ACTION;
if (temp_list)
num_elements= num_temp_partitions;
while (num_elements--)
@@ -6379,8 +6443,13 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
name_variant= TEMP_PART_NAME;
else
name_variant= NORMAL_PART_NAME;
+ DBUG_ASSERT(convert_action != ACT_CONVERT_IN ||
+ part_elem->part_state == PART_TO_BE_ADDED);
+ DBUG_ASSERT(convert_action != ACT_CONVERT_OUT ||
+ part_elem->part_state == PART_TO_BE_DROPPED);
if (part_info->is_sub_partitioned())
{
+ DBUG_ASSERT(!convert_action);
List_iterator<partition_element> sub_it(part_elem->subpartitions);
uint num_subparts= part_info->num_subparts;
uint j= 0;
@@ -6402,7 +6471,7 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
}
*next_entry= log_entry->entry_pos;
sub_elem->log_entry= log_entry;
- insert_part_info_log_entry_list(part_info, log_entry);
+ ddl_log_add_entry(part_info, log_entry);
} while (++j < num_subparts);
}
else
@@ -6414,14 +6483,25 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
part_elem->partition_name, name_variant,
TRUE))
DBUG_RETURN(TRUE);
- lex_string_set(&ddl_log_entry.name, tmp_path);
+ switch (convert_action)
+ {
+ case ACT_CONVERT_OUT:
+ ddl_log_entry.from_name= { from_name, strlen(from_name) };
+ /* fall through */
+ case ACT_DROP:
+ ddl_log_entry.name= { tmp_path, strlen(tmp_path) };
+ break;
+ case ACT_CONVERT_IN:
+ ddl_log_entry.name= { from_name, strlen(from_name) };
+ ddl_log_entry.from_name= { tmp_path, strlen(tmp_path) };
+ }
if (ddl_log_write_entry(&ddl_log_entry, &log_entry))
{
DBUG_RETURN(TRUE);
}
*next_entry= log_entry->entry_pos;
part_elem->log_entry= log_entry;
- insert_part_info_log_entry_list(part_info, log_entry);
+ ddl_log_add_entry(part_info, log_entry);
}
}
}
@@ -6429,21 +6509,37 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
}
-/*
- Set execute log entry in ddl log for this partitioned table
- SYNOPSIS
- set_part_info_exec_log_entry()
- part_info Partition info object
- exec_log_entry Log entry
- RETURN VALUES
- NONE
-*/
-
-static void set_part_info_exec_log_entry(partition_info *part_info,
- DDL_LOG_MEMORY_ENTRY *exec_log_entry)
+inline
+static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
+ uint *next_entry, const char *path,
+ bool temp_list)
{
- part_info->exec_log_entry= exec_log_entry;
- exec_log_entry->next_active_log_entry= NULL;
+ return log_drop_or_convert_action(lpt, next_entry, path, NULL, temp_list,
+ ACT_DROP);
+}
+
+inline
+static bool write_log_convert_partition(ALTER_PARTITION_PARAM_TYPE *lpt,
+ uint *next_entry, const char *path)
+{
+ char other_table[FN_REFLEN + 1];
+ const ulong f= lpt->alter_info->partition_flags;
+ DBUG_ASSERT((f & ALTER_PARTITION_CONVERT_IN) || (f & ALTER_PARTITION_CONVERT_OUT));
+ const log_action_enum convert_action= (f & ALTER_PARTITION_CONVERT_IN)
+ ? ACT_CONVERT_IN : ACT_CONVERT_OUT;
+ build_table_filename(other_table, sizeof(other_table) - 1, lpt->alter_ctx->new_db.str,
+ lpt->alter_ctx->new_name.str, "", 0);
+ DDL_LOG_MEMORY_ENTRY *main_entry= lpt->part_info->main_entry;
+ bool res= log_drop_or_convert_action(lpt, next_entry, path, other_table,
+ false, convert_action);
+ /*
+ NOTE: main_entry is "drop shadow frm", we have to keep it like this
+ because partitioning crash-safety disables it at install shadow FRM phase.
+ This is needed to avoid spurious drop action when the shadow frm is replaced
+ by the backup frm and there is nothing to drop.
+ */
+ lpt->part_info->main_entry= main_entry;
+ return res;
}
@@ -6451,10 +6547,9 @@ static void set_part_info_exec_log_entry(partition_info *part_info,
Write the log entry to ensure that the shadow frm file is removed at
crash.
SYNOPSIS
- write_log_drop_shadow_frm()
+ write_log_drop_frm()
lpt Struct containing parameters
- install_frm Should we log action to install shadow frm or should
- the action be to remove the shadow frm file.
+
RETURN VALUES
TRUE Error
FALSE Success
@@ -6463,36 +6558,53 @@ static void set_part_info_exec_log_entry(partition_info *part_info,
file and its corresponding handler file.
*/
-static bool write_log_drop_shadow_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
+static bool write_log_drop_frm(ALTER_PARTITION_PARAM_TYPE *lpt,
+ DDL_LOG_STATE *drop_chain)
{
- partition_info *part_info= lpt->part_info;
- DDL_LOG_MEMORY_ENTRY *log_entry;
- DDL_LOG_MEMORY_ENTRY *exec_log_entry= NULL;
- char shadow_path[FN_REFLEN + 1];
- DBUG_ENTER("write_log_drop_shadow_frm");
+ char path[FN_REFLEN + 1];
+ DBUG_ENTER("write_log_drop_frm");
+ const DDL_LOG_STATE *main_chain= lpt->part_info;
+ const bool drop_backup= (drop_chain != main_chain);
- build_table_shadow_filename(shadow_path, sizeof(shadow_path) - 1, lpt);
+ build_table_shadow_filename(path, sizeof(path) - 1, lpt, drop_backup);
mysql_mutex_lock(&LOCK_gdl);
- if (write_log_replace_delete_frm(lpt, 0UL, NULL,
- (const char*)shadow_path, FALSE))
+ if (ddl_log_delete_frm(drop_chain, (const char*)path))
goto error;
- log_entry= part_info->first_log_entry;
- if (ddl_log_write_execute_entry(log_entry->entry_pos,
- &exec_log_entry))
+
+ if (drop_backup && (lpt->alter_info->partition_flags & ALTER_PARTITION_CONVERT_IN))
+ {
+ TABLE_LIST *table_from= lpt->table_list->next_local;
+ build_table_filename(path, sizeof(path) - 1, table_from->db.str,
+ table_from->table_name.str, "", 0);
+
+ if (ddl_log_delete_frm(drop_chain, (const char*) path))
+ goto error;
+ }
+
+ if (ddl_log_write_execute_entry(drop_chain->list->entry_pos,
+ drop_backup ?
+ main_chain->execute_entry->entry_pos : 0,
+ &drop_chain->execute_entry))
goto error;
mysql_mutex_unlock(&LOCK_gdl);
- set_part_info_exec_log_entry(part_info, exec_log_entry);
DBUG_RETURN(FALSE);
error:
- release_part_info_log_entries(part_info->first_log_entry);
+ release_part_info_log_entries(drop_chain->list);
mysql_mutex_unlock(&LOCK_gdl);
- part_info->first_log_entry= NULL;
+ drop_chain->list= NULL;
my_error(ER_DDL_LOG_ERROR, MYF(0));
DBUG_RETURN(TRUE);
}
+static inline
+bool write_log_drop_shadow_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
+{
+ return write_log_drop_frm(lpt, lpt->part_info);
+}
+
+
/*
Log renaming of shadow frm to real frm name and dropping of old frm
SYNOPSIS
@@ -6510,20 +6622,20 @@ static bool write_log_rename_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
{
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
- DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->exec_log_entry;
+ DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->execute_entry;
char path[FN_REFLEN + 1];
char shadow_path[FN_REFLEN + 1];
- DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->first_log_entry;
+ DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->list;
DBUG_ENTER("write_log_rename_frm");
- part_info->first_log_entry= NULL;
+ part_info->list= NULL;
build_table_filename(path, sizeof(path) - 1, lpt->db.str, lpt->table_name.str, "", 0);
build_table_shadow_filename(shadow_path, sizeof(shadow_path) - 1, lpt);
mysql_mutex_lock(&LOCK_gdl);
- if (write_log_replace_delete_frm(lpt, 0UL, shadow_path, path, TRUE))
+ if (write_log_replace_frm(lpt, 0UL, shadow_path, path))
goto error;
- log_entry= part_info->first_log_entry;
- part_info->frm_log_entry= log_entry;
+ log_entry= part_info->list;
+ part_info->main_entry= log_entry;
if (ddl_log_write_execute_entry(log_entry->entry_pos,
&exec_log_entry))
goto error;
@@ -6532,10 +6644,10 @@ static bool write_log_rename_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
DBUG_RETURN(FALSE);
error:
- release_part_info_log_entries(part_info->first_log_entry);
+ release_part_info_log_entries(part_info->list);
mysql_mutex_unlock(&LOCK_gdl);
- part_info->first_log_entry= old_first_log_entry;
- part_info->frm_log_entry= NULL;
+ part_info->list= old_first_log_entry;
+ part_info->main_entry= NULL;
my_error(ER_DDL_LOG_ERROR, MYF(0));
DBUG_RETURN(TRUE);
}
@@ -6560,25 +6672,25 @@ static bool write_log_drop_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
{
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
- DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->exec_log_entry;
+ DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->execute_entry;
char tmp_path[FN_REFLEN + 1];
char path[FN_REFLEN + 1];
uint next_entry= 0;
- DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->first_log_entry;
+ DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->list;
DBUG_ENTER("write_log_drop_partition");
- part_info->first_log_entry= NULL;
+ part_info->list= NULL;
build_table_filename(path, sizeof(path) - 1, lpt->db.str, lpt->table_name.str, "", 0);
build_table_shadow_filename(tmp_path, sizeof(tmp_path) - 1, lpt);
mysql_mutex_lock(&LOCK_gdl);
if (write_log_dropped_partitions(lpt, &next_entry, (const char*)path,
FALSE))
goto error;
- if (write_log_replace_delete_frm(lpt, next_entry, (const char*)tmp_path,
- (const char*)path, TRUE))
+ if (write_log_replace_frm(lpt, next_entry, (const char*)tmp_path,
+ (const char*)path))
goto error;
- log_entry= part_info->first_log_entry;
- part_info->frm_log_entry= log_entry;
+ log_entry= part_info->list;
+ part_info->main_entry= log_entry;
if (ddl_log_write_execute_entry(log_entry->entry_pos,
&exec_log_entry))
goto error;
@@ -6587,15 +6699,44 @@ static bool write_log_drop_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
DBUG_RETURN(FALSE);
error:
- release_part_info_log_entries(part_info->first_log_entry);
+ release_part_info_log_entries(part_info->list);
mysql_mutex_unlock(&LOCK_gdl);
- part_info->first_log_entry= old_first_log_entry;
- part_info->frm_log_entry= NULL;
+ part_info->list= old_first_log_entry;
+ part_info->main_entry= NULL;
my_error(ER_DDL_LOG_ERROR, MYF(0));
DBUG_RETURN(TRUE);
}
+static bool write_log_convert_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
+{
+ partition_info *part_info= lpt->part_info;
+ char tmp_path[FN_REFLEN + 1];
+ char path[FN_REFLEN + 1];
+ uint next_entry= part_info->list ? part_info->list->entry_pos : 0;
+
+ build_table_filename(path, sizeof(path) - 1, lpt->db.str, lpt->table_name.str, "", 0);
+ build_table_shadow_filename(tmp_path, sizeof(tmp_path) - 1, lpt);
+
+ mysql_mutex_lock(&LOCK_gdl);
+
+ if (write_log_convert_partition(lpt, &next_entry, (const char*)path))
+ goto error;
+ DBUG_ASSERT(next_entry == part_info->list->entry_pos);
+ if (ddl_log_write_execute_entry(part_info->list->entry_pos,
+ &part_info->execute_entry))
+ goto error;
+ mysql_mutex_unlock(&LOCK_gdl);
+ return false;
+
+error:
+ mysql_mutex_unlock(&LOCK_gdl);
+ part_info->main_entry= NULL;
+ my_error(ER_DDL_LOG_ERROR, MYF(0));
+ return true;
+}
+
+
/*
Write the log entries to ensure that the add partition command is not
executed at all if a crash before it has completed
@@ -6617,11 +6758,10 @@ static bool write_log_add_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
{
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
- DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->exec_log_entry;
char tmp_path[FN_REFLEN + 1];
char path[FN_REFLEN + 1];
uint next_entry= 0;
- DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->first_log_entry;
+ DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->list;
/* write_log_drop_shadow_frm(lpt) must have been run first */
DBUG_ASSERT(old_first_log_entry);
DBUG_ENTER("write_log_add_change_partition");
@@ -6636,20 +6776,18 @@ static bool write_log_add_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
if (write_log_dropped_partitions(lpt, &next_entry, (const char*)path,
FALSE))
goto error;
- log_entry= part_info->first_log_entry;
+ log_entry= part_info->list;
if (ddl_log_write_execute_entry(log_entry->entry_pos,
- /* Reuse the old execute ddl_log_entry */
- &exec_log_entry))
+ &part_info->execute_entry))
goto error;
mysql_mutex_unlock(&LOCK_gdl);
- set_part_info_exec_log_entry(part_info, exec_log_entry);
DBUG_RETURN(FALSE);
error:
- release_part_info_log_entries(part_info->first_log_entry);
+ release_part_info_log_entries(part_info->list);
mysql_mutex_unlock(&LOCK_gdl);
- part_info->first_log_entry= old_first_log_entry;
+ part_info->list= old_first_log_entry;
my_error(ER_DDL_LOG_ERROR, MYF(0));
DBUG_RETURN(TRUE);
}
@@ -6681,10 +6819,10 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
{
partition_info *part_info= lpt->part_info;
DDL_LOG_MEMORY_ENTRY *log_entry;
- DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->exec_log_entry;
+ DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->execute_entry;
char path[FN_REFLEN + 1];
char shadow_path[FN_REFLEN + 1];
- DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->first_log_entry;
+ DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->list;
uint next_entry= 0;
DBUG_ENTER("write_log_final_change_partition");
@@ -6692,7 +6830,7 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
Do not link any previous log entry.
Replace the revert operations with forced retry operations.
*/
- part_info->first_log_entry= NULL;
+ part_info->list= NULL;
build_table_filename(path, sizeof(path) - 1, lpt->db.str, lpt->table_name.str, "", 0);
build_table_shadow_filename(shadow_path, sizeof(shadow_path) - 1, lpt);
mysql_mutex_lock(&LOCK_gdl);
@@ -6702,10 +6840,10 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
lpt->alter_info->partition_flags &
ALTER_PARTITION_REORGANIZE))
goto error;
- if (write_log_replace_delete_frm(lpt, next_entry, shadow_path, path, TRUE))
+ if (write_log_replace_frm(lpt, next_entry, shadow_path, path))
goto error;
- log_entry= part_info->first_log_entry;
- part_info->frm_log_entry= log_entry;
+ log_entry= part_info->list;
+ part_info->main_entry= log_entry;
/* Overwrite the revert execute log entry with this retry execute entry */
if (ddl_log_write_execute_entry(log_entry->entry_pos,
&exec_log_entry))
@@ -6715,10 +6853,10 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
DBUG_RETURN(FALSE);
error:
- release_part_info_log_entries(part_info->first_log_entry);
+ release_part_info_log_entries(part_info->list);
mysql_mutex_unlock(&LOCK_gdl);
- part_info->first_log_entry= old_first_log_entry;
- part_info->frm_log_entry= NULL;
+ part_info->list= old_first_log_entry;
+ part_info->main_entry= NULL;
my_error(ER_DDL_LOG_ERROR, MYF(0));
DBUG_RETURN(TRUE);
}
@@ -6735,11 +6873,15 @@ error:
FALSE Success
*/
+/*
+ TODO: Partitioning atomic DDL refactoring: this should be replaced with
+ ddl_log_complete().
+*/
static void write_log_completed(ALTER_PARTITION_PARAM_TYPE *lpt,
bool dont_crash)
{
partition_info *part_info= lpt->part_info;
- DDL_LOG_MEMORY_ENTRY *log_entry= part_info->exec_log_entry;
+ DDL_LOG_MEMORY_ENTRY *log_entry= part_info->execute_entry;
DBUG_ENTER("write_log_completed");
DBUG_ASSERT(log_entry);
@@ -6755,11 +6897,11 @@ static void write_log_completed(ALTER_PARTITION_PARAM_TYPE *lpt,
*/
;
}
- release_part_info_log_entries(part_info->first_log_entry);
- release_part_info_log_entries(part_info->exec_log_entry);
+ release_part_info_log_entries(part_info->list);
+ release_part_info_log_entries(part_info->execute_entry);
mysql_mutex_unlock(&LOCK_gdl);
- part_info->exec_log_entry= NULL;
- part_info->first_log_entry= NULL;
+ part_info->execute_entry= NULL;
+ part_info->list= NULL;
DBUG_VOID_RETURN;
}
@@ -6773,14 +6915,18 @@ static void write_log_completed(ALTER_PARTITION_PARAM_TYPE *lpt,
NONE
*/
+/*
+ TODO: Partitioning atomic DDL refactoring: this should be replaced with
+ ddl_log_release_entries().
+*/
static void release_log_entries(partition_info *part_info)
{
mysql_mutex_lock(&LOCK_gdl);
- release_part_info_log_entries(part_info->first_log_entry);
- release_part_info_log_entries(part_info->exec_log_entry);
+ release_part_info_log_entries(part_info->list);
+ release_part_info_log_entries(part_info->execute_entry);
mysql_mutex_unlock(&LOCK_gdl);
- part_info->first_log_entry= NULL;
- part_info->exec_log_entry= NULL;
+ part_info->list= NULL;
+ part_info->execute_entry= NULL;
}
@@ -6846,10 +6992,15 @@ static int alter_close_table(ALTER_PARTITION_PARAM_TYPE *lpt)
@param close_table Table is still open, close it before reverting
*/
+/*
+ TODO: Partitioning atomic DDL refactoring: this should be replaced with
+ correct combination of ddl_log_revert() / ddl_log_complete()
+*/
static void handle_alter_part_error(ALTER_PARTITION_PARAM_TYPE *lpt,
bool action_completed,
bool drop_partition,
- bool frm_install)
+ bool frm_install,
+ bool reopen)
{
THD *thd= lpt->thd;
partition_info *part_info= lpt->part_info->get_clone(thd);
@@ -6893,8 +7044,11 @@ static void handle_alter_part_error(ALTER_PARTITION_PARAM_TYPE *lpt,
close_all_tables_for_name(thd, table->s, HA_EXTRA_NOT_USED, NULL);
}
- if (part_info->first_log_entry &&
- ddl_log_execute_entry(thd, part_info->first_log_entry->entry_pos))
+ if (!reopen)
+ DBUG_VOID_RETURN;
+
+ if (part_info->list &&
+ ddl_log_execute_entry(thd, part_info->list->entry_pos))
{
/*
We couldn't recover from error, most likely manual interaction
@@ -7056,6 +7210,64 @@ bool log_partition_alter_to_ddl_log(ALTER_PARTITION_PARAM_TYPE *lpt)
}
+extern bool alter_partition_convert_in(ALTER_PARTITION_PARAM_TYPE *lpt);
+
+/**
+ Check that definition of source table fits definition of partition being
+ added and every row stored in the table conforms partition's expression.
+
+ @param lpt Structure containing parameters required for checking
+ @param[in,out] part_file_name_buf Buffer for storing a partition name
+ @param part_file_name_buf_sz Size of buffer for storing a partition name
+ @param part_file_name_len Length of partition prefix stored in the buffer
+ on invocation of function
+
+ @return false on success, true on error
+*/
+
+static bool check_table_data(ALTER_PARTITION_PARAM_TYPE *lpt)
+{
+ /*
+ TODO: if destination is partitioned by range(X) and source is indexed by X
+ then just get min(X) and max(X) from index.
+ */
+ THD *thd= lpt->thd;
+ TABLE *table_to= lpt->table_list->table;
+ TABLE *table_from= lpt->table_list->next_local->table;
+
+ DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE,
+ table_to->s->db.str,
+ table_to->s->table_name.str,
+ MDL_EXCLUSIVE));
+
+ DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE,
+ table_from->s->db.str,
+ table_from->s->table_name.str,
+ MDL_EXCLUSIVE));
+
+ uint32 new_part_id;
+ partition_element *part_elem;
+ const char* partition_name= thd->lex->part_info->curr_part_elem->partition_name;
+ part_elem= table_to->part_info->get_part_elem(partition_name,
+ nullptr, 0, &new_part_id);
+ if (unlikely(!part_elem))
+ return true;
+
+ if (unlikely(new_part_id == NOT_A_PARTITION_ID))
+ {
+ DBUG_ASSERT(table_to->part_info->is_sub_partitioned());
+ my_error(ER_PARTITION_INSTEAD_OF_SUBPARTITION, MYF(0));
+ return true;
+ }
+
+ if (verify_data_with_partition(table_from, table_to, new_part_id))
+ {
+ return true;
+ }
+
+ return false;
+}
+
/**
Actually perform the change requested by ALTER TABLE of partitions
@@ -7080,11 +7292,23 @@ bool log_partition_alter_to_ddl_log(ALTER_PARTITION_PARAM_TYPE *lpt)
uint fast_alter_partition_table(THD *thd, TABLE *table,
Alter_info *alter_info,
+ Alter_table_ctx *alter_ctx,
HA_CREATE_INFO *create_info,
- TABLE_LIST *table_list,
- const LEX_CSTRING *db,
- const LEX_CSTRING *table_name)
+ TABLE_LIST *table_list)
{
+ /*
+ TODO: Partitioning atomic DDL refactoring.
+
+ DDL log chain state is stored in partition_info:
+
+ struct st_ddl_log_memory_entry *first_log_entry;
+ struct st_ddl_log_memory_entry *exec_log_entry;
+ struct st_ddl_log_memory_entry *frm_log_entry;
+
+ Make it stored and used in DDL_LOG_STATE like it was done in MDEV-17567.
+ This requires mysql_write_frm() refactoring (see comment there).
+ */
+
/* Set-up struct used to write frm files */
partition_info *part_info;
ALTER_PARTITION_PARAM_TYPE lpt_obj;
@@ -7102,13 +7326,14 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
lpt->table_list= table_list;
lpt->part_info= part_info;
lpt->alter_info= alter_info;
+ lpt->alter_ctx= alter_ctx;
lpt->create_info= create_info;
lpt->db_options= create_info->table_options_with_row_type();
lpt->table= table;
lpt->key_info_buffer= 0;
lpt->key_count= 0;
- lpt->db= *db;
- lpt->table_name= *table_name;
+ lpt->db= alter_ctx->db;
+ lpt->table_name= alter_ctx->table_name;
lpt->org_tabledef_version= table->s->tabledef_version;
lpt->copied= 0;
lpt->deleted= 0;
@@ -7228,49 +7453,138 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
to test if recovery is properly done.
*/
if (write_log_drop_shadow_frm(lpt) ||
- ERROR_INJECT_CRASH("crash_drop_partition_1") ||
- ERROR_INJECT_ERROR("fail_drop_partition_1") ||
+ ERROR_INJECT("drop_partition_1") ||
mysql_write_frm(lpt, WFRM_WRITE_SHADOW) ||
- ERROR_INJECT_CRASH("crash_drop_partition_2") ||
- ERROR_INJECT_ERROR("fail_drop_partition_2") ||
+ ERROR_INJECT("drop_partition_2") ||
wait_while_table_is_used(thd, table, HA_EXTRA_NOT_USED) ||
- ERROR_INJECT_CRASH("crash_drop_partition_3") ||
- ERROR_INJECT_ERROR("fail_drop_partition_3") ||
+ ERROR_INJECT("drop_partition_3") ||
write_log_drop_partition(lpt) ||
(action_completed= TRUE, FALSE) ||
- ERROR_INJECT_CRASH("crash_drop_partition_4") ||
- ERROR_INJECT_ERROR("fail_drop_partition_4") ||
+ ERROR_INJECT("drop_partition_4") ||
alter_close_table(lpt) ||
- ERROR_INJECT_CRASH("crash_drop_partition_5") ||
- ERROR_INJECT_ERROR("fail_drop_partition_5") ||
- ERROR_INJECT_CRASH("crash_drop_partition_6") ||
- ERROR_INJECT_ERROR("fail_drop_partition_6") ||
+ ERROR_INJECT("drop_partition_5") ||
+ ERROR_INJECT("drop_partition_6") ||
(frm_install= TRUE, FALSE) ||
mysql_write_frm(lpt, WFRM_INSTALL_SHADOW) ||
log_partition_alter_to_ddl_log(lpt) ||
(frm_install= FALSE, FALSE) ||
- ERROR_INJECT_CRASH("crash_drop_partition_7") ||
- ERROR_INJECT_ERROR("fail_drop_partition_7") ||
+ ERROR_INJECT("drop_partition_7") ||
mysql_drop_partitions(lpt) ||
- ERROR_INJECT_CRASH("crash_drop_partition_8") ||
- ERROR_INJECT_ERROR("fail_drop_partition_8") ||
+ ERROR_INJECT("drop_partition_8") ||
(write_log_completed(lpt, FALSE), FALSE) ||
((!thd->lex->no_write_to_binlog) &&
(write_bin_log(thd, FALSE,
thd->query(), thd->query_length()), FALSE)) ||
- ERROR_INJECT_CRASH("crash_drop_partition_9") ||
- ERROR_INJECT_ERROR("fail_drop_partition_9"))
+ ERROR_INJECT("drop_partition_9"))
{
- handle_alter_part_error(lpt, action_completed, TRUE, frm_install);
+ handle_alter_part_error(lpt, action_completed, TRUE, frm_install, true);
goto err;
}
if (alter_partition_lock_handling(lpt))
goto err;
}
+ else if (alter_info->partition_flags & ALTER_PARTITION_CONVERT_OUT)
+ {
+ DDL_LOG_STATE chain_drop_backup;
+ bzero(&chain_drop_backup, sizeof(chain_drop_backup));
+
+ if (mysql_write_frm(lpt, WFRM_WRITE_CONVERTED_TO) ||
+ ERROR_INJECT("convert_partition_1") ||
+ write_log_drop_shadow_frm(lpt) ||
+ ERROR_INJECT("convert_partition_2") ||
+ mysql_write_frm(lpt, WFRM_WRITE_SHADOW) ||
+ ERROR_INJECT("convert_partition_3") ||
+ wait_while_table_is_used(thd, table, HA_EXTRA_NOT_USED) ||
+ ERROR_INJECT("convert_partition_4") ||
+ write_log_convert_partition(lpt) ||
+ ERROR_INJECT("convert_partition_5") ||
+ alter_close_table(lpt) ||
+ ERROR_INJECT("convert_partition_6") ||
+ alter_partition_convert_out(lpt) ||
+ ERROR_INJECT("convert_partition_7") ||
+ write_log_drop_frm(lpt, &chain_drop_backup) ||
+ mysql_write_frm(lpt, WFRM_INSTALL_SHADOW|WFRM_BACKUP_ORIGINAL) ||
+ log_partition_alter_to_ddl_log(lpt) ||
+ ERROR_INJECT("convert_partition_8") ||
+ ((!thd->lex->no_write_to_binlog) &&
+ ((thd->binlog_xid= thd->query_id),
+ ddl_log_update_xid(lpt->part_info, thd->binlog_xid),
+ write_bin_log(thd, false, thd->query(), thd->query_length()),
+ (thd->binlog_xid= 0))) ||
+ ERROR_INJECT("convert_partition_9"))
+ {
+ DDL_LOG_STATE main_state= *lpt->part_info;
+ handle_alter_part_error(lpt, true, true, false, false);
+ ddl_log_complete(&chain_drop_backup);
+ (void) ddl_log_revert(thd, &main_state);
+ if (thd->locked_tables_mode)
+ thd->locked_tables_list.reopen_tables(thd, false);
+ goto err;
+ }
+ ddl_log_complete(lpt->part_info);
+ ERROR_INJECT("convert_partition_10");
+ (void) ddl_log_revert(thd, &chain_drop_backup);
+ if (alter_partition_lock_handling(lpt) ||
+ ERROR_INJECT("convert_partition_11"))
+ goto err;
+ }
+ else if ((alter_info->partition_flags & ALTER_PARTITION_CONVERT_IN))
+ {
+ DDL_LOG_STATE chain_drop_backup;
+ bzero(&chain_drop_backup, sizeof(chain_drop_backup));
+ TABLE *table_from= table_list->next_local->table;
+
+ if (wait_while_table_is_used(thd, table, HA_EXTRA_NOT_USED) ||
+ wait_while_table_is_used(thd, table_from, HA_EXTRA_PREPARE_FOR_RENAME) ||
+ ERROR_INJECT("convert_partition_1") ||
+ compare_table_with_partition(thd, table_from, table, NULL, 0) ||
+ ERROR_INJECT("convert_partition_2") ||
+ check_table_data(lpt))
+ goto err;
+
+ if (write_log_drop_shadow_frm(lpt) ||
+ ERROR_INJECT("convert_partition_3") ||
+ mysql_write_frm(lpt, WFRM_WRITE_SHADOW) ||
+ ERROR_INJECT("convert_partition_4") ||
+ alter_close_table(lpt) ||
+ ERROR_INJECT("convert_partition_5") ||
+ write_log_convert_partition(lpt) ||
+ ERROR_INJECT("convert_partition_6") ||
+ alter_partition_convert_in(lpt) ||
+ ERROR_INJECT("convert_partition_7") ||
+ (frm_install= true, false) ||
+ write_log_drop_frm(lpt, &chain_drop_backup) ||
+ mysql_write_frm(lpt, WFRM_INSTALL_SHADOW|WFRM_BACKUP_ORIGINAL) ||
+ log_partition_alter_to_ddl_log(lpt) ||
+ (frm_install= false, false) ||
+ ERROR_INJECT("convert_partition_8") ||
+ ((!thd->lex->no_write_to_binlog) &&
+ ((thd->binlog_xid= thd->query_id),
+ ddl_log_update_xid(lpt->part_info, thd->binlog_xid),
+ write_bin_log(thd, false, thd->query(), thd->query_length()),
+ (thd->binlog_xid= 0))) ||
+ ERROR_INJECT("convert_partition_9"))
+ {
+ DDL_LOG_STATE main_state= *lpt->part_info;
+ handle_alter_part_error(lpt, true, true, false, false);
+ ddl_log_complete(&chain_drop_backup);
+ (void) ddl_log_revert(thd, &main_state);
+ if (thd->locked_tables_mode)
+ thd->locked_tables_list.reopen_tables(thd, false);
+ goto err;
+ }
+ ddl_log_complete(lpt->part_info);
+ ERROR_INJECT("convert_partition_10");
+ (void) ddl_log_revert(thd, &chain_drop_backup);
+ if (alter_partition_lock_handling(lpt) ||
+ ERROR_INJECT("convert_partition_11"))
+ goto err;
+ }
else if ((alter_info->partition_flags & ALTER_PARTITION_ADD) &&
(part_info->part_type == RANGE_PARTITION ||
part_info->part_type == LIST_PARTITION))
{
+ DBUG_ASSERT(!(alter_info->partition_flags & ALTER_PARTITION_CONVERT_IN));
/*
ADD RANGE/LIST PARTITIONS
In this case there are no tuples removed and no tuples are added.
@@ -7302,43 +7616,33 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
12)Complete query
*/
if (write_log_drop_shadow_frm(lpt) ||
- ERROR_INJECT_CRASH("crash_add_partition_1") ||
- ERROR_INJECT_ERROR("fail_add_partition_1") ||
+ ERROR_INJECT("add_partition_1") ||
mysql_write_frm(lpt, WFRM_WRITE_SHADOW) ||
- ERROR_INJECT_CRASH("crash_add_partition_2") ||
- ERROR_INJECT_ERROR("fail_add_partition_2") ||
+ ERROR_INJECT("add_partition_2") ||
wait_while_table_is_used(thd, table, HA_EXTRA_NOT_USED) ||
- ERROR_INJECT_CRASH("crash_add_partition_3") ||
- ERROR_INJECT_ERROR("fail_add_partition_3") ||
+ ERROR_INJECT("add_partition_3") ||
write_log_add_change_partition(lpt) ||
- ERROR_INJECT_CRASH("crash_add_partition_4") ||
- ERROR_INJECT_ERROR("fail_add_partition_4") ||
+ ERROR_INJECT("add_partition_4") ||
mysql_change_partitions(lpt) ||
- ERROR_INJECT_CRASH("crash_add_partition_5") ||
- ERROR_INJECT_ERROR("fail_add_partition_5") ||
+ ERROR_INJECT("add_partition_5") ||
alter_close_table(lpt) ||
- ERROR_INJECT_CRASH("crash_add_partition_6") ||
- ERROR_INJECT_ERROR("fail_add_partition_6") ||
- ERROR_INJECT_CRASH("crash_add_partition_7") ||
- ERROR_INJECT_ERROR("fail_add_partition_7") ||
+ ERROR_INJECT("add_partition_6") ||
+ ERROR_INJECT("add_partition_7") ||
write_log_rename_frm(lpt) ||
(action_completed= TRUE, FALSE) ||
- ERROR_INJECT_CRASH("crash_add_partition_8") ||
- ERROR_INJECT_ERROR("fail_add_partition_8") ||
+ ERROR_INJECT("add_partition_8") ||
(frm_install= TRUE, FALSE) ||
mysql_write_frm(lpt, WFRM_INSTALL_SHADOW) ||
log_partition_alter_to_ddl_log(lpt) ||
(frm_install= FALSE, FALSE) ||
- ERROR_INJECT_CRASH("crash_add_partition_9") ||
- ERROR_INJECT_ERROR("fail_add_partition_9") ||
+ ERROR_INJECT("add_partition_9") ||
(write_log_completed(lpt, FALSE), FALSE) ||
((!thd->lex->no_write_to_binlog) &&
(write_bin_log(thd, FALSE,
thd->query(), thd->query_length()), FALSE)) ||
- ERROR_INJECT_CRASH("crash_add_partition_10") ||
- ERROR_INJECT_ERROR("fail_add_partition_10"))
+ ERROR_INJECT("add_partition_10"))
{
- handle_alter_part_error(lpt, action_completed, FALSE, frm_install);
+ handle_alter_part_error(lpt, action_completed, FALSE, frm_install, true);
goto err;
}
if (alter_partition_lock_handling(lpt))
@@ -7401,49 +7705,37 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
13) Complete query.
*/
if (write_log_drop_shadow_frm(lpt) ||
- ERROR_INJECT_CRASH("crash_change_partition_1") ||
- ERROR_INJECT_ERROR("fail_change_partition_1") ||
+ ERROR_INJECT("change_partition_1") ||
mysql_write_frm(lpt, WFRM_WRITE_SHADOW) ||
- ERROR_INJECT_CRASH("crash_change_partition_2") ||
- ERROR_INJECT_ERROR("fail_change_partition_2") ||
+ ERROR_INJECT("change_partition_2") ||
write_log_add_change_partition(lpt) ||
- ERROR_INJECT_CRASH("crash_change_partition_3") ||
- ERROR_INJECT_ERROR("fail_change_partition_3") ||
+ ERROR_INJECT("change_partition_3") ||
mysql_change_partitions(lpt) ||
- ERROR_INJECT_CRASH("crash_change_partition_4") ||
- ERROR_INJECT_ERROR("fail_change_partition_4") ||
+ ERROR_INJECT("change_partition_4") ||
wait_while_table_is_used(thd, table, HA_EXTRA_NOT_USED) ||
- ERROR_INJECT_CRASH("crash_change_partition_5") ||
- ERROR_INJECT_ERROR("fail_change_partition_5") ||
+ ERROR_INJECT("change_partition_5") ||
alter_close_table(lpt) ||
- ERROR_INJECT_CRASH("crash_change_partition_6") ||
- ERROR_INJECT_ERROR("fail_change_partition_6") ||
+ ERROR_INJECT("change_partition_6") ||
write_log_final_change_partition(lpt) ||
(action_completed= TRUE, FALSE) ||
- ERROR_INJECT_CRASH("crash_change_partition_7") ||
- ERROR_INJECT_ERROR("fail_change_partition_7") ||
- ERROR_INJECT_CRASH("crash_change_partition_8") ||
- ERROR_INJECT_ERROR("fail_change_partition_8") ||
+ ERROR_INJECT("change_partition_7") ||
+ ERROR_INJECT("change_partition_8") ||
((frm_install= TRUE), FALSE) ||
mysql_write_frm(lpt, WFRM_INSTALL_SHADOW) ||
log_partition_alter_to_ddl_log(lpt) ||
(frm_install= FALSE, FALSE) ||
- ERROR_INJECT_CRASH("crash_change_partition_9") ||
- ERROR_INJECT_ERROR("fail_change_partition_9") ||
+ ERROR_INJECT("change_partition_9") ||
mysql_drop_partitions(lpt) ||
- ERROR_INJECT_CRASH("crash_change_partition_10") ||
- ERROR_INJECT_ERROR("fail_change_partition_10") ||
+ ERROR_INJECT("change_partition_10") ||
mysql_rename_partitions(lpt) ||
- ERROR_INJECT_CRASH("crash_change_partition_11") ||
- ERROR_INJECT_ERROR("fail_change_partition_11") ||
+ ERROR_INJECT("change_partition_11") ||
(write_log_completed(lpt, FALSE), FALSE) ||
((!thd->lex->no_write_to_binlog) &&
(write_bin_log(thd, FALSE,
thd->query(), thd->query_length()), FALSE)) ||
- ERROR_INJECT_CRASH("crash_change_partition_12") ||
- ERROR_INJECT_ERROR("fail_change_partition_12"))
+ ERROR_INJECT("change_partition_12"))
{
- handle_alter_part_error(lpt, action_completed, FALSE, frm_install);
+ handle_alter_part_error(lpt, action_completed, FALSE, frm_install, true);
goto err;
}
if (alter_partition_lock_handling(lpt))
diff --git a/sql/sql_partition.h b/sql/sql_partition.h
index 57e6d0600ed..a90eaae0bae 100644
--- a/sql/sql_partition.h
+++ b/sql/sql_partition.h
@@ -55,6 +55,7 @@ typedef struct st_lock_param_type
THD *thd;
HA_CREATE_INFO *create_info;
Alter_info *alter_info;
+ Alter_table_ctx *alter_ctx;
TABLE *table;
KEY *key_info_buffer;
LEX_CSTRING db;
@@ -64,6 +65,7 @@ typedef struct st_lock_param_type
uint key_count;
uint db_options;
size_t pack_frm_len;
+ // TODO: remove duplicate data: part_info can be accessed via table->part_info
partition_info *part_info;
} ALTER_PARTITION_PARAM_TYPE;
@@ -255,10 +257,9 @@ typedef int (*get_partitions_in_range_iter)(partition_info *part_info,
#ifdef WITH_PARTITION_STORAGE_ENGINE
uint fast_alter_partition_table(THD *thd, TABLE *table,
Alter_info *alter_info,
+ Alter_table_ctx *alter_ctx,
HA_CREATE_INFO *create_info,
- TABLE_LIST *table_list,
- const LEX_CSTRING *db,
- const LEX_CSTRING *table_name);
+ TABLE_LIST *table_list);
bool set_part_state(Alter_info *alter_info, partition_info *tab_part_info,
enum partition_state part_state);
uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
@@ -278,7 +279,16 @@ bool verify_data_with_partition(TABLE *table, TABLE *part_table,
uint32 part_id);
bool compare_partition_options(HA_CREATE_INFO *table_create_info,
partition_element *part_elem);
+bool compare_table_with_partition(THD *thd, TABLE *table,
+ TABLE *part_table,
+ partition_element *part_elem,
+ uint part_id);
bool partition_key_modified(TABLE *table, const MY_BITMAP *fields);
+bool write_log_replace_frm(ALTER_PARTITION_PARAM_TYPE *lpt,
+ uint next_entry,
+ const char *from_path,
+ const char *to_path);
+
#else
#define partition_key_modified(X,Y) 0
#endif
diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc
index fc7b6460b2b..a2d2a833285 100644
--- a/sql/sql_partition_admin.cc
+++ b/sql/sql_partition_admin.cc
@@ -192,10 +192,8 @@ static bool check_exchange_partition(TABLE *table, TABLE *part_table)
@param part_table Partitioned table.
@param part_elem Partition element to use for partition specific compare.
*/
-static bool compare_table_with_partition(THD *thd, TABLE *table,
- TABLE *part_table,
- partition_element *part_elem,
- uint part_id)
+bool compare_table_with_partition(THD *thd, TABLE *table, TABLE *part_table,
+ partition_element *part_elem, uint part_id)
{
HA_CREATE_INFO table_create_info, part_create_info;
Alter_info part_alter_info;
@@ -297,7 +295,7 @@ static bool compare_table_with_partition(THD *thd, TABLE *table,
The workaround is to use REORGANIZE PARTITION to rewrite
the frm file and then use EXCHANGE PARTITION when they are the same.
*/
- if (compare_partition_options(&table_create_info, part_elem))
+ if (part_elem && compare_partition_options(&table_create_info, part_elem))
DBUG_RETURN(TRUE);
DBUG_RETURN(FALSE);
@@ -1001,4 +999,53 @@ bool Sql_cmd_alter_table_truncate_partition::execute(THD *thd)
DBUG_RETURN(error);
}
+
+/**
+ Move a table specified in the CONVERT TABLE <table_name> TO PARTITION ...
+ to the new partition.
+
+ @param lpt A structure containing parameters regarding to the statement
+ ALTER TABLE ... TO PARTITION ...
+ @param part_file_name a file name of the partition being added
+
+ @return false on success, true on error
+*/
+
+bool alter_partition_convert_in(ALTER_PARTITION_PARAM_TYPE *lpt)
+{
+ char part_file_name[2*FN_REFLEN+1];
+ THD *thd= lpt->thd;
+ const char *path= lpt->table_list->table->s->path.str;
+ TABLE_LIST *table_from= lpt->table_list->next_local;
+
+ const char *partition_name=
+ thd->lex->part_info->curr_part_elem->partition_name;
+
+ if (create_partition_name(part_file_name, sizeof(part_file_name), path,
+ partition_name, NORMAL_PART_NAME, false))
+ return true;
+
+ char from_file_name[FN_REFLEN+1];
+
+ build_table_filename(from_file_name, sizeof(from_file_name),
+ table_from->db.str, table_from->table_name.str, "", 0);
+
+ handler *file= get_new_handler(nullptr, thd->mem_root,
+ table_from->table->file->ht);
+ if (unlikely(!file))
+ return true;
+
+ close_all_tables_for_name(thd, table_from->table->s,
+ HA_EXTRA_PREPARE_FOR_RENAME, nullptr);
+
+ bool res= file->ha_rename_table(from_file_name, part_file_name);
+
+ if (res)
+ my_error(ER_ERROR_ON_RENAME, MYF(0), from_file_name,
+ part_file_name, my_errno);
+
+ delete file;
+ return res;
+}
+
#endif /* WITH_PARTITION_STORAGE_ENGINE */
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 6170a4dcc0c..66781caac3e 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -458,7 +458,7 @@ static int item_val_real(struct st_mysql_value *value, double *buf)
static struct st_plugin_dl *plugin_dl_find(const LEX_CSTRING *dl)
{
- uint i;
+ size_t i;
struct st_plugin_dl *tmp;
DBUG_ENTER("plugin_dl_find");
for (i= 0; i < plugin_dl_array.elements; i++)
@@ -475,7 +475,7 @@ static struct st_plugin_dl *plugin_dl_find(const LEX_CSTRING *dl)
static st_plugin_dl *plugin_dl_insert_or_reuse(struct st_plugin_dl *plugin_dl)
{
- uint i;
+ size_t i;
struct st_plugin_dl *tmp;
DBUG_ENTER("plugin_dl_insert_or_reuse");
for (i= 0; i < plugin_dl_array.elements; i++)
@@ -1070,6 +1070,8 @@ plugin_ref plugin_lock_by_name(THD *thd, const LEX_CSTRING *name, int type)
plugin_ref rc= NULL;
st_plugin_int *plugin;
DBUG_ENTER("plugin_lock_by_name");
+ if (!name->length)
+ DBUG_RETURN(NULL);
mysql_mutex_lock(&LOCK_plugin);
if ((plugin= plugin_find_internal(name, type)))
rc= intern_plugin_lock(lex, plugin_int_to_ref(plugin));
@@ -1080,7 +1082,7 @@ plugin_ref plugin_lock_by_name(THD *thd, const LEX_CSTRING *name, int type)
static st_plugin_int *plugin_insert_or_reuse(struct st_plugin_int *plugin)
{
- uint i;
+ size_t i;
struct st_plugin_int *tmp;
DBUG_ENTER("plugin_insert_or_reuse");
for (i= 0; i < plugin_array.elements; i++)
@@ -1263,24 +1265,18 @@ static void plugin_deinitialize(struct st_plugin_int *plugin, bool ref_check)
remove_status_vars(show_vars);
}
- if (plugin_type_deinitialize[plugin->plugin->type])
- {
- if ((*plugin_type_deinitialize[plugin->plugin->type])(plugin))
- {
- sql_print_error("Plugin '%s' of type %s failed deinitialization",
- plugin->name.str, plugin_type_names[plugin->plugin->type].str);
- }
- }
- else if (plugin->plugin->deinit)
+ plugin_type_init deinit= plugin_type_deinitialize[plugin->plugin->type];
+ if (!deinit)
+ deinit= (plugin_type_init)(plugin->plugin->deinit);
+
+ if (deinit && deinit(plugin))
{
- DBUG_PRINT("info", ("Deinitializing plugin: '%s'", plugin->name.str));
- if (plugin->plugin->deinit(plugin))
- {
- DBUG_PRINT("warning", ("Plugin '%s' deinit function returned error.",
- plugin->name.str));
- }
+ if (THD *thd= current_thd)
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
+ WARN_PLUGIN_BUSY, ER_THD(thd, WARN_PLUGIN_BUSY));
}
- plugin->state= PLUGIN_IS_UNINITIALIZED;
+ else
+ plugin->state= PLUGIN_IS_UNINITIALIZED; // free to unload
if (ref_check && plugin->ref_count)
sql_print_error("Plugin '%s' has ref_count=%d after deinitialization.",
@@ -1288,10 +1284,13 @@ static void plugin_deinitialize(struct st_plugin_int *plugin, bool ref_check)
plugin_variables_deinit(plugin);
}
-static void plugin_del(struct st_plugin_int *plugin)
+static void plugin_del(struct st_plugin_int *plugin, uint del_mask)
{
DBUG_ENTER("plugin_del");
mysql_mutex_assert_owner(&LOCK_plugin);
+ del_mask|= PLUGIN_IS_UNINITIALIZED | PLUGIN_IS_DISABLED; // always use these
+ if (!(plugin->state & del_mask))
+ DBUG_VOID_RETURN;
/* Free allocated strings before deleting the plugin. */
plugin_vars_free_values(plugin->system_vars);
restore_ptr_backup(plugin->nbackups, plugin->ptr_backup);
@@ -1309,7 +1308,7 @@ static void plugin_del(struct st_plugin_int *plugin)
static void reap_plugins(void)
{
- uint count;
+ size_t count;
struct st_plugin_int *plugin, **reap, **list;
mysql_mutex_assert_owner(&LOCK_plugin);
@@ -1341,19 +1340,19 @@ static void reap_plugins(void)
list= reap;
while ((plugin= *(--list)))
- plugin_deinitialize(plugin, true);
+ plugin_deinitialize(plugin, true);
mysql_mutex_lock(&LOCK_plugin);
while ((plugin= *(--reap)))
- plugin_del(plugin);
+ plugin_del(plugin, 0);
my_afree(reap);
}
static void intern_plugin_unlock(LEX *lex, plugin_ref plugin)
{
- int i;
+ ssize_t i;
st_plugin_int *pi;
DBUG_ENTER("intern_plugin_unlock");
@@ -1419,7 +1418,7 @@ void plugin_unlock(THD *thd, plugin_ref plugin)
}
-void plugin_unlock_list(THD *thd, plugin_ref *list, uint count)
+void plugin_unlock_list(THD *thd, plugin_ref *list, size_t count)
{
LEX *lex= thd ? thd->lex : 0;
DBUG_ENTER("plugin_unlock_list");
@@ -1592,7 +1591,7 @@ static void init_plugin_psi_keys(void) {}
*/
int plugin_init(int *argc, char **argv, int flags)
{
- uint i;
+ size_t i;
struct st_maria_plugin **builtins;
struct st_maria_plugin *plugin;
struct st_plugin_int tmp, *plugin_ptr, **reap;
@@ -1784,7 +1783,7 @@ int plugin_init(int *argc, char **argv, int flags)
reaped_mandatory_plugin= TRUE;
plugin_deinitialize(plugin_ptr, true);
mysql_mutex_lock(&LOCK_plugin);
- plugin_del(plugin_ptr);
+ plugin_del(plugin_ptr, 0);
}
mysql_mutex_unlock(&LOCK_plugin);
@@ -2023,7 +2022,7 @@ error:
void plugin_shutdown(void)
{
- uint i, count= plugin_array.elements;
+ size_t i, count= plugin_array.elements;
struct st_plugin_int **plugins, *plugin;
struct st_plugin_dl **dl;
DBUG_ENTER("plugin_shutdown");
@@ -2072,12 +2071,14 @@ void plugin_shutdown(void)
plugins= (struct st_plugin_int **) my_alloca(sizeof(void*) * (count+1));
/*
- If we have any plugins which did not die cleanly, we force shutdown
+ If we have any plugins which did not die cleanly, we force shutdown.
+ Don't re-deinit() plugins that failed deinit() earlier (already dying)
*/
for (i= 0; i < count; i++)
{
plugins[i]= *dynamic_element(&plugin_array, i, struct st_plugin_int **);
- /* change the state to ensure no reaping races */
+ if (plugins[i]->state == PLUGIN_IS_DYING)
+ plugins[i]->state= PLUGIN_IS_UNINITIALIZED;
if (plugins[i]->state == PLUGIN_IS_DELETED)
plugins[i]->state= PLUGIN_IS_DYING;
}
@@ -2113,9 +2114,7 @@ void plugin_shutdown(void)
if (plugins[i]->ref_count)
sql_print_error("Plugin '%s' has ref_count=%d after shutdown.",
plugins[i]->name.str, plugins[i]->ref_count);
- if (plugins[i]->state & PLUGIN_IS_UNINITIALIZED ||
- plugins[i]->state & PLUGIN_IS_DISABLED)
- plugin_del(plugins[i]);
+ plugin_del(plugins[i], PLUGIN_IS_DYING);
}
/*
@@ -2354,7 +2353,7 @@ static bool do_uninstall(THD *thd, TABLE *table, const LEX_CSTRING *name)
of the delete from the plugin table, so that it is not replicated in
row based mode.
*/
- table->file->row_logging= 0; // No logging
+ table->file->row_logging= 0; // No logging
error= table->file->ha_delete_row(table->record[0]);
if (unlikely(error))
{
@@ -2467,7 +2466,7 @@ wsrep_error_label:
bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
int type, uint state_mask, void *arg)
{
- uint idx, total= 0;
+ size_t idx, total= 0;
struct st_plugin_int *plugin;
plugin_ref *plugins;
my_bool res= FALSE;
@@ -3318,7 +3317,7 @@ static void cleanup_variables(struct system_variables *vars)
void plugin_thdvar_cleanup(THD *thd)
{
- uint idx;
+ size_t idx;
plugin_ref *list;
DBUG_ENTER("plugin_thdvar_cleanup");
@@ -4303,7 +4302,7 @@ void add_plugin_options(DYNAMIC_ARRAY *options, MEM_ROOT *mem_root)
if (!initialized)
return;
- for (uint idx= 0; idx < plugin_array.elements; idx++)
+ for (size_t idx= 0; idx < plugin_array.elements; idx++)
{
p= *dynamic_element(&plugin_array, idx, struct st_plugin_int **);
@@ -4410,7 +4409,7 @@ int thd_setspecific(MYSQL_THD thd, MYSQL_THD_KEY_T key, void *value)
DBUG_ASSERT(key != INVALID_THD_KEY);
if (key == INVALID_THD_KEY || (!thd && !(thd= current_thd)))
return EINVAL;
-
+
memcpy(intern_sys_var_ptr(thd, key, true), &value, sizeof(void*));
return 0;
}
diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h
index eaf0b40f34a..d4df8c6468f 100644
--- a/sql/sql_plugin.h
+++ b/sql/sql_plugin.h
@@ -172,7 +172,7 @@ extern plugin_ref plugin_lock(THD *thd, plugin_ref ptr);
extern plugin_ref plugin_lock_by_name(THD *thd, const LEX_CSTRING *name,
int type);
extern void plugin_unlock(THD *thd, plugin_ref plugin);
-extern void plugin_unlock_list(THD *thd, plugin_ref *list, uint count);
+extern void plugin_unlock_list(THD *thd, plugin_ref *list, size_t count);
extern bool mysql_install_plugin(THD *thd, const LEX_CSTRING *name,
const LEX_CSTRING *dl);
extern bool mysql_uninstall_plugin(THD *thd, const LEX_CSTRING *name,
diff --git a/sql/sql_plugin_services.inl b/sql/sql_plugin_services.inl
index c6f07158003..3dd41ffbed9 100644
--- a/sql/sql_plugin_services.inl
+++ b/sql/sql_plugin_services.inl
@@ -216,7 +216,7 @@ static struct my_print_error_service_st my_print_error_handler=
my_printv_error
};
-struct json_service_st json_handler=
+static struct json_service_st json_handler=
{
json_type,
json_get_array_item,
@@ -231,6 +231,92 @@ static struct thd_mdl_service_st thd_mdl_handler=
thd_mdl_context
};
+struct sql_service_st sql_service_handler=
+{
+ mysql_init,
+ mysql_real_connect_local,
+ mysql_real_connect,
+ mysql_errno,
+ mysql_error,
+ mysql_real_query,
+ mysql_affected_rows,
+ mysql_num_rows,
+ mysql_store_result,
+ mysql_free_result,
+ mysql_fetch_row,
+ mysql_close,
+};
+
+#define DEFINE_warning_function(name, ret) { \
+ static query_id_t last_query_id= -1; \
+ THD *thd= current_thd; \
+ if((thd ? thd->query_id : 0) != last_query_id) \
+ { \
+ my_error(ER_PROVIDER_NOT_LOADED, MYF(ME_ERROR_LOG|ME_WARNING), name); \
+ last_query_id= thd ? thd->query_id : 0; \
+ } \
+ return ret; \
+}
+
+#include <providers/lzma.h>
+static struct provider_service_lzma_st provider_handler_lzma=
+{
+ DEFINE_lzma_stream_buffer_decode([]) DEFINE_warning_function("LZMA compression", LZMA_PROG_ERROR),
+ DEFINE_lzma_easy_buffer_encode([]) DEFINE_warning_function("LZMA compression", LZMA_PROG_ERROR),
+
+ false // .is_loaded
+};
+struct provider_service_lzma_st *provider_service_lzma= &provider_handler_lzma;
+
+#include <providers/lzo/lzo1x.h>
+static struct provider_service_lzo_st provider_handler_lzo=
+{
+ DEFINE_lzo1x_1_15_compress([]) DEFINE_warning_function("LZO compression", LZO_E_INTERNAL_ERROR),
+ DEFINE_lzo1x_decompress_safe([]) DEFINE_warning_function("LZO compression", LZO_E_INTERNAL_ERROR),
+
+ false // .is_loaded
+};
+struct provider_service_lzo_st *provider_service_lzo= &provider_handler_lzo;
+
+#include <providers/bzlib.h>
+static struct provider_service_bzip2_st provider_handler_bzip2=
+{
+ DEFINE_BZ2_bzBuffToBuffCompress([]) DEFINE_warning_function("BZip2 compression", -1),
+ DEFINE_BZ2_bzBuffToBuffDecompress([]) DEFINE_warning_function("BZip2 compression", -1),
+ DEFINE_BZ2_bzCompress([]) DEFINE_warning_function("BZip2 compression", -1),
+ DEFINE_BZ2_bzCompressEnd([]) DEFINE_warning_function("BZip2 compression", -1),
+ DEFINE_BZ2_bzCompressInit([]) DEFINE_warning_function("BZip2 compression", -1),
+ DEFINE_BZ2_bzDecompress([]) DEFINE_warning_function("BZip2 compression", -1),
+ DEFINE_BZ2_bzDecompressEnd([]) DEFINE_warning_function("BZip2 compression", -1),
+ DEFINE_BZ2_bzDecompressInit([]) DEFINE_warning_function("BZip2 compression", -1),
+
+ false // .is_loaded
+};
+struct provider_service_bzip2_st *provider_service_bzip2= &provider_handler_bzip2;
+
+#include <providers/snappy-c.h>
+static struct provider_service_snappy_st provider_handler_snappy=
+{
+ DEFINE_snappy_max_compressed_length([]) -> size_t DEFINE_warning_function("Snappy compression", 0),
+ DEFINE_snappy_compress([]) DEFINE_warning_function("Snappy compression", SNAPPY_INVALID_INPUT),
+ DEFINE_snappy_uncompressed_length([]) DEFINE_warning_function("Snappy compression", SNAPPY_INVALID_INPUT),
+ DEFINE_snappy_uncompress([]) DEFINE_warning_function("Snappy compression", SNAPPY_INVALID_INPUT),
+
+ false // .is_loaded
+};
+struct provider_service_snappy_st *provider_service_snappy= &provider_handler_snappy;
+
+#include <providers/lz4.h>
+static struct provider_service_lz4_st provider_handler_lz4=
+{
+ DEFINE_LZ4_compressBound([]) DEFINE_warning_function("LZ4 compression", 0),
+ DEFINE_LZ4_compress_default([]) DEFINE_warning_function("LZ4 compression", 0),
+ DEFINE_LZ4_decompress_safe([]) DEFINE_warning_function("LZ4 compression", -1),
+
+ false // .is_loaded
+};
+struct provider_service_lz4_st *provider_service_lz4= &provider_handler_lz4;
+
static struct st_service_ref list_of_services[]=
{
{ "base64_service", VERSION_base64, &base64_handler },
@@ -255,5 +341,11 @@ static struct st_service_ref list_of_services[]=
{ "thd_wait_service", VERSION_thd_wait, &thd_wait_handler },
{ "wsrep_service", VERSION_wsrep, &wsrep_handler },
{ "json_service", VERSION_json, &json_handler },
- { "thd_mdl_service", VERSION_thd_mdl, &thd_mdl_handler }
+ { "thd_mdl_service", VERSION_thd_mdl, &thd_mdl_handler },
+ { "sql_service", VERSION_sql_service, &sql_service_handler },
+ { "provider_service_bzip2", VERSION_provider_bzip2, &provider_handler_bzip2 },
+ { "provider_service_lz4", VERSION_provider_lz4, &provider_handler_lz4 },
+ { "provider_service_lzma", VERSION_provider_lzma, &provider_handler_lzma },
+ { "provider_service_lzo", VERSION_provider_lzo, &provider_handler_lzo },
+ { "provider_service_snappy", VERSION_provider_snappy, &provider_handler_snappy }
};
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 7cce643efd2..83c064c63c6 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -133,6 +133,7 @@ static const uint PARAMETER_FLAG_UNSIGNED= 128U << 8;
#include "wsrep_trans_observer.h"
#endif /* WITH_WSREP */
#include "xa.h" // xa_recover_get_fields
+#include "sql_audit.h" // mysql_audit_release
/**
A result class used to send cursor rows using the binary protocol.
@@ -1314,7 +1315,6 @@ static bool mysql_test_insert_common(Prepared_statement *stmt,
if ((values= its++))
{
uint value_count;
- ulong counter= 0;
Item *unused_conds= 0;
if (table_list->table)
@@ -1340,16 +1340,18 @@ static bool mysql_test_insert_common(Prepared_statement *stmt,
}
while ((values= its++))
{
- counter++;
if (values->elements != value_count)
{
- my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), counter);
+ my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0),
+ thd->get_stmt_da()->current_row_for_warning());
goto error;
}
if (setup_fields(thd, Ref_ptr_array(),
*values, COLUMNS_READ, 0, NULL, 0))
goto error;
+ thd->get_stmt_da()->inc_current_row_for_warning();
}
+ thd->get_stmt_da()->reset_current_row_for_warning(1);
}
DBUG_RETURN(FALSE);
@@ -4052,19 +4054,22 @@ Execute_sql_statement(LEX_STRING sql_text)
executions without having to cleanup/reset THD in between.
*/
-bool
-Execute_sql_statement::execute_server_code(THD *thd)
+static bool execute_server_code(THD *thd,
+ const char *sql_text, size_t sql_len)
{
PSI_statement_locker *parent_locker;
bool error;
+ query_id_t save_query_id= thd->query_id;
+ query_id_t next_id= next_query_id();
- if (alloc_query(thd, m_sql_text.str, m_sql_text.length))
+ if (alloc_query(thd, sql_text, sql_len))
return TRUE;
Parser_state parser_state;
if (parser_state.init(thd, thd->query(), thd->query_length()))
return TRUE;
+ thd->query_id= next_id;
parser_state.m_lip.multi_statements= FALSE;
lex_start(thd);
@@ -4082,17 +4087,23 @@ Execute_sql_statement::execute_server_code(THD *thd)
/* report error issued during command execution */
if (likely(error == 0) && thd->spcont == NULL)
- general_log_write(thd, COM_STMT_EXECUTE,
+ general_log_write(thd, COM_QUERY,
thd->query(), thd->query_length());
end:
thd->lex->restore_set_statement_var();
+ thd->query_id= save_query_id;
delete_explain_query(thd->lex);
lex_end(thd->lex);
return error;
}
+bool Execute_sql_statement::execute_server_code(THD *thd)
+{
+ return ::execute_server_code(thd, m_sql_text.str, m_sql_text.length);
+}
+
/***************************************************************************
Prepared_statement
****************************************************************************/
@@ -4860,7 +4871,9 @@ Prepared_statement::execute_server_runnable(Server_runnable *server_runnable)
Statement stmt_backup;
bool error;
Query_arena *save_stmt_arena= thd->stmt_arena;
+ Reprepare_observer *save_reprepare_observer= thd->m_reprepare_observer;
Item_change_list save_change_list;
+
thd->Item_change_list::move_elements_to(&save_change_list);
state= STMT_CONVENTIONAL_EXECUTION;
@@ -4870,12 +4883,15 @@ Prepared_statement::execute_server_runnable(Server_runnable *server_runnable)
thd->set_n_backup_statement(this, &stmt_backup);
thd->set_n_backup_active_arena(this, &stmt_backup);
+
thd->stmt_arena= this;
+ thd->m_reprepare_observer= 0;
error= server_runnable->execute_server_code(thd);
thd->cleanup_after_query();
+ thd->m_reprepare_observer= save_reprepare_observer;
thd->restore_active_arena(this, &stmt_backup);
thd->restore_backup_statement(this, &stmt_backup);
thd->stmt_arena= save_stmt_arena;
@@ -5593,14 +5609,6 @@ Ed_connection::store_result_set()
return ed_result_set;
}
-/*
- MENT-56
- Protocol_local and service_sql for plugins to enable 'local' SQL query execution.
-*/
-
-#ifndef EMBEDDED_LIBRARY
-// This part is mostly copied from libmysqld/lib_sql.cc
-// TODO: get rid of code duplications
#include <mysql.h>
#include "../libmysqld/embedded_priv.h"
@@ -5616,11 +5624,14 @@ public:
char **next_field;
MYSQL_FIELD *next_mysql_field;
MEM_ROOT *alloc;
+ THD *new_thd;
+ Security_context empty_ctx;
- Protocol_local(THD *thd_arg, ulong prealloc= 0) :
+ Protocol_local(THD *thd_arg, THD *new_thd_arg, ulong prealloc) :
Protocol_text(thd_arg, prealloc),
- cur_data(0), first_data(0), data_tail(&first_data), alloc(0)
- {}
+ cur_data(0), first_data(0), data_tail(&first_data), alloc(0),
+ new_thd(new_thd_arg)
+ {}
protected:
bool net_store_data(const uchar *from, size_t length);
@@ -5692,6 +5703,20 @@ MYSQL_DATA *Protocol_local::alloc_new_dataset()
}
+void Protocol_local::clear_data_list()
+{
+ while (first_data)
+ {
+ MYSQL_DATA *data= first_data;
+ first_data= data->embedded_info->next;
+ free_rows(data);
+ }
+ data_tail= &first_data;
+ free_rows(cur_data);
+ cur_data= 0;
+}
+
+
static char *dup_str_aux(MEM_ROOT *root, const char *from, uint length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
{
@@ -5985,7 +6010,6 @@ bool Protocol_local::send_result_set_metadata(List<Item> *list, uint flags)
{
List_iterator_fast<Item> it(*list);
Item *item;
-// Protocol_local prot(thd);
DBUG_ENTER("send_result_set_metadata");
// if (!thd->mysql) // bootstrap file handling
@@ -5996,7 +6020,7 @@ bool Protocol_local::send_result_set_metadata(List<Item> *list, uint flags)
for (uint pos= 0 ; (item= it++); pos++)
{
- if (/*prot.*/store_item_metadata(thd, item, pos))
+ if (store_item_metadata(thd, item, pos))
goto err;
}
@@ -6010,6 +6034,7 @@ bool Protocol_local::send_result_set_metadata(List<Item> *list, uint flags)
DBUG_RETURN(1); /* purecov: inspected */
}
+
static void
list_fields_send_default(THD *thd, Protocol_local *p, Field *fld, uint pos)
{
@@ -6097,19 +6122,6 @@ bool Protocol_local::store_null()
#include <sql_common.h>
#include <errmsg.h>
-struct local_results
-{
- struct st_mysql_data *cur_data;
- struct st_mysql_data *first_data;
- struct st_mysql_data **data_tail;
- void clear_data_list();
- struct st_mysql_data *alloc_new_dataset();
- char **next_field;
- MYSQL_FIELD *next_mysql_field;
- MEM_ROOT *alloc;
-};
-
-
static void embedded_get_error(MYSQL *mysql, MYSQL_DATA *data)
{
NET *net= &mysql->net;
@@ -6124,11 +6136,11 @@ static void embedded_get_error(MYSQL *mysql, MYSQL_DATA *data)
static my_bool loc_read_query_result(MYSQL *mysql)
{
- local_results *thd= (local_results *) mysql->thd;
+ Protocol_local *p= (Protocol_local *) mysql->thd;
- MYSQL_DATA *res= thd->first_data;
- DBUG_ASSERT(!thd->cur_data);
- thd->first_data= res->embedded_info->next;
+ MYSQL_DATA *res= p->first_data;
+ DBUG_ASSERT(!p->cur_data);
+ p->first_data= res->embedded_info->next;
if (res->embedded_info->last_errno &&
!res->embedded_info->fields_list)
{
@@ -6156,7 +6168,7 @@ static my_bool loc_read_query_result(MYSQL *mysql)
if (res->embedded_info->fields_list)
{
mysql->status=MYSQL_STATUS_GET_RESULT;
- thd->cur_data= res;
+ p->cur_data= res;
}
else
my_free(res);
@@ -6165,174 +6177,257 @@ static my_bool loc_read_query_result(MYSQL *mysql)
}
-static MYSQL_METHODS local_methods=
+static my_bool
+loc_advanced_command(MYSQL *mysql, enum enum_server_command command,
+ const uchar *header, ulong header_length,
+ const uchar *arg, ulong arg_length, my_bool skip_check,
+ MYSQL_STMT *stmt)
{
- loc_read_query_result, /* read_query_result */
- NULL/*loc_advanced_command*/, /* advanced_command */
- NULL/*loc_read_rows*/, /* read_rows */
- NULL/*loc_use_result*/, /* use_result */
- NULL/*loc_fetch_lengths*/, /* fetch_lengths */
- NULL/*loc_flush_use_result*/, /* flush_use_result */
- NULL/*loc_read_change_user_result*/ /* read_change_user_result */
-};
+ my_bool result= 1;
+ Protocol_local *p= (Protocol_local *) mysql->thd;
+ NET *net= &mysql->net;
+ if (p->thd && p->thd->killed != NOT_KILLED)
+ {
+ if (p->thd->killed < KILL_CONNECTION)
+ p->thd->killed= NOT_KILLED;
+ else
+ return 1;
+ }
-extern "C" MYSQL *mysql_real_connect_local(MYSQL *mysql,
- const char *host, const char *user, const char *passwd, const char *db)
-{
- //char name_buff[USERNAME_LENGTH];
+ p->clear_data_list();
+ /* Check that we are calling the client functions in right order */
+ if (mysql->status != MYSQL_STATUS_READY)
+ {
+ set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate);
+ goto end;
+ }
- DBUG_ENTER("mysql_real_connect_local");
+ /* Clear result variables */
+ p->thd->clear_error(1);
+ mysql->affected_rows= ~(my_ulonglong) 0;
+ mysql->field_count= 0;
+ net_clear_error(net);
- /* Test whether we're already connected */
- if (mysql->server_version)
+ /*
+ We have to call free_old_query before we start to fill mysql->fields
+ for new query. In the case of embedded server we collect field data
+ during query execution (not during data retrieval as it is in remote
+ client). So we have to call free_old_query here
+ */
+ free_old_query(mysql);
+
+ if (header)
{
- set_mysql_error(mysql, CR_ALREADY_CONNECTED, unknown_sqlstate);
- DBUG_RETURN(0);
+ arg= header;
+ arg_length= header_length;
}
- if (!host || !host[0])
- host= mysql->options.host;
+ if (p->new_thd)
+ {
+ THD *thd_orig= current_thd;
+ set_current_thd(p->thd);
+ p->thd->thread_stack= (char*) &result;
+ p->thd->set_time();
+ result= execute_server_code(p->thd, (const char *)arg, arg_length);
+ p->thd->cleanup_after_query();
+ mysql_audit_release(p->thd);
+ p->end_statement();
+ set_current_thd(thd_orig);
+ }
+ else
+ {
+ Ed_connection con(p->thd);
+ Security_context *ctx_orig= p->thd->security_ctx;
+ MYSQL_LEX_STRING sql_text;
+ DBUG_ASSERT(current_thd == p->thd);
+ sql_text.str= (char *) arg;
+ sql_text.length= arg_length;
+ p->thd->security_ctx= &p->empty_ctx;
+ result= con.execute_direct(p, sql_text);
+ p->thd->security_ctx= ctx_orig;
+ }
+ if (skip_check)
+ result= 0;
+ p->cur_data= 0;
- mysql->methods= &local_methods;
+end:
+ return result;
+}
- if (!db || !db[0])
- db=mysql->options.db;
- if (!user || !user[0])
- user=mysql->options.user;
+/*
+ reads dataset from the next query result
- mysql->user= my_strdup(PSI_INSTRUMENT_ME, user, MYF(0));
+ SYNOPSIS
+ loc_read_rows()
+ mysql connection handle
+ other parameters are not used
+ NOTES
+ It just gets next MYSQL_DATA from the result's queue
- mysql->info_buffer= (char *) my_malloc(PSI_INSTRUMENT_ME,
- MYSQL_ERRMSG_SIZE, MYF(0));
- //mysql->thd= create_embedded_thd(client_flag);
+ RETURN
+ pointer to MYSQL_DATA with the coming recordset
+*/
+
+static MYSQL_DATA *
+loc_read_rows(MYSQL *mysql, MYSQL_FIELD *mysql_fields __attribute__((unused)),
+ unsigned int fields __attribute__((unused)))
+{
+ MYSQL_DATA *result= ((Protocol_local *)mysql->thd)->cur_data;
+ ((Protocol_local *)mysql->thd)->cur_data= 0;
+ if (result->embedded_info->last_errno)
+ {
+ embedded_get_error(mysql, result);
+ return NULL;
+ }
+ *result->embedded_info->prev_ptr= NULL;
+ return result;
+}
- //init_embedded_mysql(mysql, client_flag);
- //if (mysql_init_character_set(mysql))
- // goto error;
+/**************************************************************************
+ Get column lengths of the current row
+ If one uses mysql_use_result, res->lengths contains the length information,
+ else the lengths are calculated from the offset between pointers.
+**************************************************************************/
- //if (check_embedded_connection(mysql, db))
- // goto error;
+static void loc_fetch_lengths(ulong *to, MYSQL_ROW column,
+ unsigned int field_count)
+{
+ MYSQL_ROW end;
- mysql->server_status= SERVER_STATUS_AUTOCOMMIT;
+ for (end=column + field_count; column != end ; column++,to++)
+ *to= *column ? *(uint *)((*column) - sizeof(uint)) : 0;
+}
- //if (mysql->options.init_commands)
- //{
- // DYNAMIC_ARRAY *init_commands= mysql->options.init_commands;
- // char **ptr= (char**)init_commands->buffer;
- // char **end= ptr + init_commands->elements;
-//
- // for (; ptr<end; ptr++)
- // {
- // MYSQL_RES *res;
- // if (mysql_query(mysql,*ptr))
- // goto error;
- // if (mysql->fields)
- // {
- // if (!(res= (*mysql->methods->use_result)(mysql)))
- // goto error;
- // mysql_free_result(res);
- // }
- // }
- //}
- DBUG_PRINT("exit",("Mysql handler: %p", mysql));
- DBUG_RETURN(mysql);
+static void loc_flush_use_result(MYSQL *mysql, my_bool)
+{
+ Protocol_local *p= (Protocol_local *) mysql->thd;
+ if (p->cur_data)
+ {
+ free_rows(p->cur_data);
+ p->cur_data= 0;
+ }
+ else if (p->first_data)
+ {
+ MYSQL_DATA *data= p->first_data;
+ p->first_data= data->embedded_info->next;
+ free_rows(data);
+ }
+}
-//error:
- DBUG_PRINT("error",("message: %u (%s)",
- mysql->net.last_errno,
- mysql->net.last_error));
+
+static void loc_on_close_free(MYSQL *mysql)
+{
+ Protocol_local *p= (Protocol_local *) mysql->thd;
+ THD *thd= p->new_thd;
+ delete p;
+ if (thd)
{
- /* Free alloced memory */
- my_bool free_me=mysql->free_me;
- free_old_query(mysql);
- mysql->free_me=0;
- mysql_close(mysql);
- mysql->free_me=free_me;
+ delete thd;
+ local_connection_thread_count--;
}
- DBUG_RETURN(0);
+ my_free(mysql->info_buffer);
+ mysql->info_buffer= 0;
}
+static MYSQL_RES *loc_use_result(MYSQL *mysql)
+{
+ return mysql_store_result(mysql);
+}
-extern "C" int execute_sql_command(const char *command,
- char *hosts, char *names, char *filters)
+static MYSQL_METHODS local_methods=
{
- MYSQL_LEX_STRING sql_text;
- THD *thd= current_thd;
- THD *new_thd= 0;
- int result;
- my_bool qc_save= 0;
- Reprepare_observer *save_reprepare_observer= nullptr;
+ loc_read_query_result, /* read_query_result */
+ loc_advanced_command, /* advanced_command */
+ loc_read_rows, /* read_rows */
+ loc_use_result, /* use_result */
+ loc_fetch_lengths, /* fetch_lengths */
+ loc_flush_use_result, /* flush_use_result */
+ NULL, /* read_change_user_result */
+ loc_on_close_free /* on_close_free */
+#ifdef EMBEDDED_LIBRARY
+ ,NULL, /* list_fields */
+ NULL, /* read_prepare_result */
+ NULL, /* stmt_execute */
+ NULL, /* read_binary_rows */
+ NULL, /* unbuffered_fetch */
+ NULL, /* read_statistics */
+ NULL, /* next_result */
+ NULL /* read_rows_from_cursor */
+#endif
+};
+
- if (!thd)
+Atomic_counter<uint32_t> local_connection_thread_count;
+
+extern "C" MYSQL *mysql_real_connect_local(MYSQL *mysql)
+{
+ THD *thd_orig= current_thd;
+ THD *new_thd;
+ Protocol_local *p;
+ DBUG_ENTER("mysql_real_connect_local");
+
+ /* Test whether we're already connected */
+ if (mysql->server_version)
{
+ set_mysql_error(mysql, CR_ALREADY_CONNECTED, unknown_sqlstate);
+ DBUG_RETURN(0);
+ }
+
+ mysql->methods= &local_methods;
+ mysql->user= NULL;
+
+ mysql->info_buffer= (char *) my_malloc(PSI_INSTRUMENT_ME,
+ MYSQL_ERRMSG_SIZE, MYF(0));
+ if (!thd_orig || thd_orig->lock)
+ {
+ /*
+ When we start with the empty current_thd (that happens when plugins
+ are loaded during the server start) or when some tables are locked
+ with the current_thd already (that happens when INSTALL PLUGIN
+ calls the plugin_init or with queries), we create the new THD for
+ the local connection. So queries with this MYSQL will be run with
+ it rather than the current THD.
+ */
+
new_thd= new THD(0);
- new_thd->thread_stack= (char*) &sql_text;
+ local_connection_thread_count++;
+ new_thd->thread_stack= (char*) &thd_orig;
new_thd->store_globals();
new_thd->security_ctx->skip_grants();
new_thd->query_cache_is_applicable= 0;
new_thd->variables.wsrep_on= 0;
+ /*
+ TOSO: decide if we should turn the auditing off
+ for such threads.
+ We can do it like this:
+ new_thd->audit_class_mask[0]= ~0;
+ */
bzero((char*) &new_thd->net, sizeof(new_thd->net));
- thd= new_thd;
+ set_current_thd(thd_orig);
+ thd_orig= new_thd;
}
else
- {
- if (thd->lock)
- /* Doesn't work if the thread opened/locked tables already. */
- return 2;
-
- qc_save= thd->query_cache_is_applicable;
- thd->query_cache_is_applicable= 0;
- save_reprepare_observer= thd->m_reprepare_observer;
- thd->m_reprepare_observer= nullptr;
- }
- sql_text.str= (char *) command;
- sql_text.length= strlen(command);
- {
- Protocol_local p(thd);
- Ed_connection con(thd);
- result= con.execute_direct(&p, sql_text);
- if (!result && p.first_data)
- {
- int nr= (int) p.first_data->rows;
- MYSQL_ROWS *rows= p.first_data->data;
-
- while (nr--)
- {
- strcpy(hosts, rows->data[0]);
- hosts+= strlen(hosts) + 1;
- strcpy(names, rows->data[1]);
- names+= strlen(names) + 1;
- if (filters)
- {
- strcpy(filters, rows->data[2]);
- filters+= strlen(filters) + 1;
- }
- rows= rows->next;
- }
- }
- if (p.first_data)
- {
- if (p.alloc)
- free_root(p.alloc, MYF(0));
- my_free(p.first_data);
- }
- }
+ new_thd= NULL;
+ p= new Protocol_local(thd_orig, new_thd, 0);
if (new_thd)
- delete new_thd;
+ new_thd->protocol= p;
else
{
- thd->query_cache_is_applicable= qc_save;
- thd->m_reprepare_observer= save_reprepare_observer;
+ p->empty_ctx.init();
+ p->empty_ctx.skip_grants();
}
- *hosts= 0;
- return result;
+ mysql->thd= p;
+ mysql->server_status= SERVER_STATUS_AUTOCOMMIT;
+
+
+ DBUG_PRINT("exit",("Mysql handler: %p", mysql));
+ DBUG_RETURN(mysql);
}
-#endif /*!EMBEDDED_LIBRARY*/
diff --git a/sql/sql_prepare.h b/sql/sql_prepare.h
index 1e81b9f80e6..1a96df85a19 100644
--- a/sql/sql_prepare.h
+++ b/sql/sql_prepare.h
@@ -353,4 +353,6 @@ private:
size_t m_column_count; /* TODO: change to point to metadata */
};
+extern Atomic_counter<uint32_t> local_connection_thread_count;
+
#endif // SQL_PREPARE_H
diff --git a/sql/sql_priv.h b/sql/sql_priv.h
index 2206f71c060..f7d8ef0da67 100644
--- a/sql/sql_priv.h
+++ b/sql/sql_priv.h
@@ -416,16 +416,6 @@ inline int hexchar_to_int(char c)
/* This must match the path length limit in the ER_NOT_RW_DIR error msg. */
#define ER_NOT_RW_DIR_PATHSIZE 200
-#define IS_TABLESPACES_TABLESPACE_NAME 0
-#define IS_TABLESPACES_ENGINE 1
-#define IS_TABLESPACES_TABLESPACE_TYPE 2
-#define IS_TABLESPACES_LOGFILE_GROUP_NAME 3
-#define IS_TABLESPACES_EXTENT_SIZE 4
-#define IS_TABLESPACES_AUTOEXTEND_SIZE 5
-#define IS_TABLESPACES_MAXIMUM_SIZE 6
-#define IS_TABLESPACES_NODEGROUP_ID 7
-#define IS_TABLESPACES_TABLESPACE_COMMENT 8
-
bool db_name_is_in_ignore_db_dirs_list(const char *dbase);
#endif /* MYSQL_SERVER */
diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc
index ddada6ad892..1dfa238de50 100644
--- a/sql/sql_reload.cc
+++ b/sql/sql_reload.cc
@@ -403,7 +403,7 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options,
/* If not default connection and 'all' is used */
mi->release();
mysql_mutex_lock(&LOCK_active_mi);
- if (master_info_index->remove_master_info(mi))
+ if (master_info_index->remove_master_info(mi, 0))
result= 1;
mysql_mutex_unlock(&LOCK_active_mi);
}
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index fa33f0e0500..52deb20284c 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -2586,7 +2586,7 @@ int JOIN::optimize_stage2()
if (!conds && outer_join)
{
/* Handle the case where we have an OUTER JOIN without a WHERE */
- conds= (Item*) &Item_true;
+ conds= (Item*) Item_true;
}
if (impossible_where)
@@ -2756,9 +2756,7 @@ int JOIN::optimize_stage2()
if (conds && const_table_map != found_const_table_map &&
(select_options & SELECT_DESCRIBE))
- {
- conds= (Item*) &Item_false;
- }
+ conds= (Item*) Item_false;
/* Cache constant expressions in WHERE, HAVING, ON clauses. */
cache_const_exprs();
@@ -3070,7 +3068,7 @@ int JOIN::optimize_stage2()
having= having->remove_eq_conds(thd, &select_lex->having_value, true);
if (select_lex->having_value == Item::COND_FALSE)
{
- having= (Item*) &Item_false;
+ having= (Item*) Item_false;
zero_result_cause= "Impossible HAVING noticed after reading const tables";
error= 0;
select_lex->mark_const_derived(zero_result_cause);
@@ -5000,6 +4998,7 @@ mysql_select(THD *thd, TABLE_LIST *tables, List<Item> &fields, COND *conds,
}
}
+ thd->get_stmt_da()->reset_current_row_for_warning(1);
/* Look for a table owned by an engine with the select_handler interface */
select_lex->pushdown_select= find_select_handler(thd, select_lex);
@@ -5662,7 +5661,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
if (join->cond_value == Item::COND_FALSE)
{
join->impossible_where= true;
- conds= (Item*) &Item_false;
+ conds= (Item*) Item_false;
}
join->cond_equal= NULL;
@@ -7143,7 +7142,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
/* set a barrier for the array of SARGABLE_PARAM */
(*sargables)[0].field= 0;
- if (my_init_dynamic_array2(thd->mem_root->m_psi_key, keyuse, sizeof(KEYUSE),
+ if (my_init_dynamic_array2(thd->mem_root->psi_key, keyuse, sizeof(KEYUSE),
thd->alloc(sizeof(KEYUSE) * 20), 20, 64,
MYF(MY_THREAD_SPECIFIC)))
DBUG_RETURN(TRUE);
@@ -12007,7 +12006,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
below to check if we should use 'quick' instead.
*/
DBUG_PRINT("info", ("Item_int"));
- tmp= (Item*) &Item_true;
+ tmp= (Item*) Item_true;
}
}
@@ -12551,9 +12550,9 @@ static
bool generate_derived_keys(DYNAMIC_ARRAY *keyuse_array)
{
KEYUSE *keyuse= dynamic_element(keyuse_array, 0, KEYUSE*);
- uint elements= keyuse_array->elements;
+ size_t elements= keyuse_array->elements;
TABLE *prev_table= 0;
- for (uint i= 0; i < elements; i++, keyuse++)
+ for (size_t i= 0; i < elements; i++, keyuse++)
{
if (!keyuse->table)
break;
@@ -15597,7 +15596,7 @@ COND *Item_cond_and::build_equal_items(THD *thd,
if (!cond_args->elements &&
!cond_equal.current_level.elements &&
!eq_list.elements)
- return (Item*) &Item_true;
+ return (Item*) Item_true;
List_iterator_fast<Item_equal> it(cond_equal.current_level);
while ((item_equal= it++))
@@ -15704,7 +15703,7 @@ COND *Item_func_eq::build_equal_items(THD *thd,
Item_equal *item_equal;
int n= cond_equal.current_level.elements + eq_list.elements;
if (n == 0)
- return (Item*) &Item_true;
+ return (Item*) Item_true;
else if (n == 1)
{
if ((item_equal= cond_equal.current_level.pop()))
@@ -16108,7 +16107,7 @@ Item *eliminate_item_equal(THD *thd, COND *cond, COND_EQUAL *upper_levels,
List<Item> eq_list;
Item_func_eq *eq_item= 0;
if (((Item *) item_equal)->const_item() && !item_equal->val_int())
- return (Item*) &Item_false;
+ return (Item*) Item_false;
Item *item_const= item_equal->get_const();
Item_equal_fields_iterator it(*item_equal);
Item *head;
@@ -16253,7 +16252,7 @@ Item *eliminate_item_equal(THD *thd, COND *cond, COND_EQUAL *upper_levels,
switch (eq_list.elements)
{
case 0:
- res= cond ? cond : (Item*) &Item_true;
+ res= cond ? cond : (Item*) Item_true;
break;
case 1:
if (!cond || cond->is_bool_literal())
@@ -16506,9 +16505,9 @@ static void update_const_equal_items(THD *thd, COND *cond, JOIN_TAB *tab,
Item *item;
while ((item= li++))
update_const_equal_items(thd, item, tab,
- (((Item_cond*) cond)->top_level() &&
- ((Item_cond*) cond)->functype() ==
- Item_func::COND_AND_FUNC));
+ cond->is_top_level_item() &&
+ ((Item_cond*) cond)->functype() ==
+ Item_func::COND_AND_FUNC);
}
else if (cond->type() == Item::FUNC_ITEM &&
((Item_func*) cond)->functype() == Item_func::MULT_EQUAL_FUNC)
@@ -18091,7 +18090,7 @@ Item_func_isnull::remove_eq_conds(THD *thd, Item::cond_result *cond_value,
*/
- Item *item0= (Item*) &Item_false;
+ Item *item0= (Item*) Item_false;
Item *eq_cond= new(thd->mem_root) Item_func_eq(thd, args[0], item0);
if (!eq_cond)
return this;
@@ -18661,20 +18660,19 @@ setup_tmp_table_column_bitmaps(TABLE *table, uchar *bitmaps, uint field_count)
DBUG_ASSERT(table->s->virtual_fields == 0);
- my_bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count,
- FALSE);
+ my_bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count);
bitmaps+= bitmap_size;
my_bitmap_init(&table->tmp_set,
- (my_bitmap_map*) bitmaps, field_count, FALSE);
+ (my_bitmap_map*) bitmaps, field_count);
bitmaps+= bitmap_size;
my_bitmap_init(&table->eq_join_set,
- (my_bitmap_map*) bitmaps, field_count, FALSE);
+ (my_bitmap_map*) bitmaps, field_count);
bitmaps+= bitmap_size;
my_bitmap_init(&table->cond_set,
- (my_bitmap_map*) bitmaps, field_count, FALSE);
+ (my_bitmap_map*) bitmaps, field_count);
bitmaps+= bitmap_size;
my_bitmap_init(&table->has_value_set,
- (my_bitmap_map*) bitmaps, field_count, FALSE);
+ (my_bitmap_map*) bitmaps, field_count);
/* write_set and all_set are copies of read_set */
table->def_write_set= table->def_read_set;
table->s->all_set= table->def_read_set;
@@ -18797,7 +18795,7 @@ TABLE *Create_tmp_table::start(THD *thd,
(ulong) m_rows_limit, MY_TEST(m_group)));
if (use_temp_pool && !(test_flags & TEST_KEEP_TMP_TABLES))
- m_temp_pool_slot = bitmap_lock_set_next(&temp_pool);
+ m_temp_pool_slot = temp_pool_set_next();
if (m_temp_pool_slot != MY_BIT_NONE) // we got a slot
sprintf(path, "%s-%s-%lx-%i", tmp_file_prefix, param->tmp_name,
@@ -19701,7 +19699,7 @@ void Create_tmp_table::cleanup_on_failure(THD *thd, TABLE *table)
if (table)
free_tmp_table(thd, table);
if (m_temp_pool_slot != MY_BIT_NONE)
- bitmap_lock_clear_bit(&temp_pool, m_temp_pool_slot);
+ temp_pool_clear_bit(m_temp_pool_slot);
}
@@ -20466,7 +20464,7 @@ free_tmp_table(THD *thd, TABLE *entry)
(*ptr)->free();
if (entry->temp_pool_slot != MY_BIT_NONE)
- bitmap_lock_clear_bit(&temp_pool, entry->temp_pool_slot);
+ temp_pool_clear_bit(entry->temp_pool_slot);
plugin_unlock(0, entry->s->db_plugin);
entry->alias.free();
@@ -21148,7 +21146,7 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
if (join_tab->on_precond && !join_tab->on_precond->val_int())
rc= NESTED_LOOP_NO_MORE_ROWS;
}
- join->thd->get_stmt_da()->reset_current_row_for_warning();
+ join->thd->get_stmt_da()->reset_current_row_for_warning(1);
if (rc != NESTED_LOOP_NO_MORE_ROWS &&
(rc= join_tab_execution_startup(join_tab)) < 0)
@@ -28650,7 +28648,7 @@ JOIN::reoptimize(Item *added_where, table_map join_tables,
{
DYNAMIC_ARRAY added_keyuse;
SARGABLE_PARAM *sargables= 0; /* Used only as a dummy parameter. */
- uint org_keyuse_elements;
+ size_t org_keyuse_elements;
/* Re-run the REF optimizer to take into account the new conditions. */
if (update_ref_and_keys(thd, &added_keyuse, join_tab, table_count, added_where,
@@ -28672,7 +28670,7 @@ JOIN::reoptimize(Item *added_where, table_map join_tables,
reset_query_plan();
if (!keyuse.buffer &&
- my_init_dynamic_array(thd->mem_root->m_psi_key, &keyuse, sizeof(KEYUSE),
+ my_init_dynamic_array(thd->mem_root->psi_key, &keyuse, sizeof(KEYUSE),
20, 64, MYF(MY_THREAD_SPECIFIC)))
{
delete_dynamic(&added_keyuse);
@@ -29603,7 +29601,7 @@ AGGR_OP::end_send()
Reset the counter before copying rows from internal temporary table to
INSERT table.
*/
- join_tab->join->thd->get_stmt_da()->reset_current_row_for_warning();
+ join_tab->join->thd->get_stmt_da()->reset_current_row_for_warning(1);
while (rc == NESTED_LOOP_OK)
{
int error;
@@ -29821,7 +29819,7 @@ void JOIN::make_notnull_conds_for_range_scans()
Found a IS NULL conjunctive predicate for a null-rejected field
in the WHERE clause
*/
- conds= (Item*) &Item_false;
+ conds= (Item*) Item_false;
cond_equal= 0;
impossible_where= true;
DBUG_VOID_RETURN;
@@ -29844,7 +29842,7 @@ void JOIN::make_notnull_conds_for_range_scans()
Found a IS NULL conjunctive predicate for a null-rejected field
of the inner table of an outer join with ON expression tbl->on_expr
*/
- tbl->on_expr= (Item*) &Item_false;
+ tbl->on_expr= (Item*) Item_false;
}
}
}
@@ -29995,7 +29993,7 @@ void build_notnull_conds_for_inner_nest_of_outer_join(JOIN *join,
if (used_tables &&
build_notnull_conds_for_range_scans(join, nest_tbl->on_expr, used_tables))
{
- nest_tbl->on_expr= (Item*) &Item_false;
+ nest_tbl->on_expr= (Item*) Item_false;
}
li.rewind();
@@ -30009,7 +30007,7 @@ void build_notnull_conds_for_inner_nest_of_outer_join(JOIN *join,
}
else if (build_notnull_conds_for_range_scans(join, tbl->on_expr,
tbl->table->map))
- tbl->on_expr= (Item*) &Item_false;
+ tbl->on_expr= (Item*) Item_false;
}
}
}
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 37bc6096ecd..7ddc7f8ab24 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -231,6 +231,9 @@ static my_bool show_plugins(THD *thd, plugin_ref plugin,
case PLUGIN_IS_DISABLED:
table->field[2]->store(STRING_WITH_LEN("DISABLED"), cs);
break;
+ case PLUGIN_IS_DYING:
+ table->field[2]->store(STRING_WITH_LEN("INACTIVE"), cs);
+ break;
case PLUGIN_IS_FREED: // filtered in fill_plugins, used in fill_all_plugins
table->field[2]->store(STRING_WITH_LEN("NOT INSTALLED"), cs);
break;
@@ -324,7 +327,7 @@ int fill_plugins(THD *thd, TABLE_LIST *tables, COND *cond)
TABLE *table= tables->table;
if (plugin_foreach_with_mask(thd, show_plugins, MYSQL_ANY_PLUGIN,
- ~(PLUGIN_IS_FREED | PLUGIN_IS_DYING), table))
+ ~PLUGIN_IS_FREED, table))
DBUG_RETURN(1);
DBUG_RETURN(0);
@@ -354,7 +357,7 @@ int fill_all_plugins(THD *thd, TABLE_LIST *tables, COND *cond)
plugin_dl_foreach(thd, 0, show_plugins, table);
const char *wstr= lookup.db_value.str, *wend= wstr + lookup.db_value.length;
- for (uint i=0; i < (uint) dirp->number_of_files; i++)
+ for (size_t i=0; i < dirp->number_of_files; i++)
{
FILEINFO *file= dirp->dir_entry+i;
LEX_CSTRING dl= { file->name, strlen(file->name) };
@@ -952,7 +955,7 @@ find_files(THD *thd, Dynamic_array<LEX_CSTRING*> *files, LEX_CSTRING *db,
if (!db) /* Return databases */
{
- for (uint i=0; i < (uint) dirp->number_of_files; i++)
+ for (size_t i=0; i < dirp->number_of_files; i++)
{
FILEINFO *file= dirp->dir_entry+i;
#ifdef USE_SYMDIR
@@ -6751,7 +6754,7 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
for (uint i=0 ; i < show_table->s->keys ; i++,key_info++)
{
if ((key_info->flags & HA_INVISIBLE_KEY) &&
- DBUG_EVALUATE_IF("test_invisible_index", 0, 1))
+ !DBUG_IF("test_invisible_index"))
continue;
KEY_PART_INFO *key_part= key_info->key_part;
LEX_CSTRING *str;
@@ -6759,7 +6762,7 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
for (uint j=0 ; j < key_info->user_defined_key_parts ; j++,key_part++)
{
if (key_part->field->invisible >= INVISIBLE_SYSTEM &&
- DBUG_EVALUATE_IF("test_completely_invisible", 0, 1))
+ !DBUG_IF("test_completely_invisible"))
{
/*
NOTE: we will get SEQ_IN_INDEX gap inside the result if this key_part
@@ -7419,13 +7422,7 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table,
table->field[23]->store(STRING_WITH_LEN("default"), cs);
table->field[24]->set_notnull();
- if (part_elem->tablespace_name)
- table->field[24]->store(part_elem->tablespace_name,
- strlen(part_elem->tablespace_name), cs);
- else
- {
- table->field[24]->set_null();
- }
+ table->field[24]->set_null(); // Tablespace
}
return;
}
@@ -8256,8 +8253,7 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
DBUG_RETURN(0);
my_bitmap_map* bitmaps=
(my_bitmap_map*) thd->alloc(bitmap_buffer_size(field_count));
- my_bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count,
- FALSE);
+ my_bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count);
table->read_set= &table->def_read_set;
bitmap_clear_all(table->read_set);
table_list->schema_table_param= tmp_table_param;
@@ -9850,23 +9846,17 @@ int initialize_schema_table(st_plugin_int *plugin)
int finalize_schema_table(st_plugin_int *plugin)
{
+ int deinit_status= 0;
ST_SCHEMA_TABLE *schema_table= (ST_SCHEMA_TABLE *)plugin->data;
DBUG_ENTER("finalize_schema_table");
if (schema_table)
{
if (plugin->plugin->deinit)
- {
- DBUG_PRINT("info", ("Deinitializing plugin: '%s'", plugin->name.str));
- if (plugin->plugin->deinit(NULL))
- {
- DBUG_PRINT("warning", ("Plugin '%s' deinit function returned error.",
- plugin->name.str));
- }
- }
+ deinit_status= plugin->plugin->deinit(NULL);
my_free(schema_table);
}
- DBUG_RETURN(0);
+ DBUG_RETURN(deinit_status);
}
diff --git a/sql/sql_signal.cc b/sql/sql_signal.cc
index 8e973f9b0b3..4e86cc4d782 100644
--- a/sql/sql_signal.cc
+++ b/sql/sql_signal.cc
@@ -44,6 +44,7 @@ const LEX_CSTRING Diag_condition_item_names[]=
{ STRING_WITH_LEN("CURSOR_NAME") },
{ STRING_WITH_LEN("MESSAGE_TEXT") },
{ STRING_WITH_LEN("MYSQL_ERRNO") },
+ { STRING_WITH_LEN("ROW_NUMBER") },
{ STRING_WITH_LEN("CONDITION_IDENTIFIER") },
{ STRING_WITH_LEN("CONDITION_NUMBER") },
@@ -309,6 +310,26 @@ int Sql_cmd_common_signal::eval_signal_informations(THD *thd, Sql_condition *con
cond->m_sql_errno= (int) code;
}
+ set= m_set_signal_information.m_item[DIAG_ROW_NUMBER];
+ if (set != NULL)
+ {
+ if (set->is_null())
+ {
+ thd->raise_error_printf(ER_WRONG_VALUE_FOR_VAR,
+ "ROW_NUMBER", "NULL");
+ goto end;
+ }
+ longlong row_number_value= set->val_int();
+ if (row_number_value < 0)
+ {
+ str= set->val_str(& str_value);
+ thd->raise_error_printf(ER_WRONG_VALUE_FOR_VAR,
+ "ROW_NUMBER", str->c_ptr_safe());
+ goto end;
+ }
+ cond->m_row_number= (ulong) row_number_value;
+ }
+
/*
The various item->val_xxx() methods don't return an error code,
but flag thd in case of failure.
@@ -419,7 +440,8 @@ bool Sql_cmd_resignal::execute(THD *thd)
DBUG_RETURN(result);
}
- Sql_condition signaled_err(thd->mem_root, *signaled, signaled->message);
+ Sql_condition signaled_err(thd->mem_root, *signaled, signaled->message,
+ signaled->m_row_number);
if (m_cond)
{
diff --git a/sql/sql_string.h b/sql/sql_string.h
index fe57c8153bb..795f80c3e08 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -484,6 +484,11 @@ public:
if (str.Alloced_length)
Alloced_length= (uint32) (str.Alloced_length - offset);
}
+ LEX_CSTRING to_lex_cstring() const
+ {
+ LEX_CSTRING tmp= {Ptr, str_length};
+ return tmp;
+ }
inline LEX_CSTRING *get_value(LEX_CSTRING *res)
{
res->str= Ptr;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 304df0b35c0..929335f973e 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -667,10 +667,12 @@ void build_lower_case_table_filename(char *buff, size_t bufflen,
*/
uint build_table_shadow_filename(char *buff, size_t bufflen,
- ALTER_PARTITION_PARAM_TYPE *lpt)
+ ALTER_PARTITION_PARAM_TYPE *lpt,
+ bool backup)
{
char tmp_name[FN_REFLEN];
- my_snprintf(tmp_name, sizeof (tmp_name), "%s-shadow-%lx-%s", tmp_file_prefix,
+ my_snprintf(tmp_name, sizeof (tmp_name), "%s-%s-%lx-%s", tmp_file_prefix,
+ backup ? "backup" : "shadow",
(ulong) current_thd->thread_id, lpt->table_name.str);
return build_table_filename(buff, bufflen, lpt->db.str, tmp_name, "",
FN_IS_TMP);
@@ -704,6 +706,11 @@ uint build_table_shadow_filename(char *buff, size_t bufflen,
tables since it only handles partitioned data if it exists.
*/
+
+/*
+ TODO: Partitioning atomic DDL refactoring: WFRM_WRITE_SHADOW
+ should be merged with create_table_impl(frm_only == true).
+*/
bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
{
/*
@@ -717,8 +724,11 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
char shadow_frm_name[FN_REFLEN+1];
char frm_name[FN_REFLEN+1];
#ifdef WITH_PARTITION_STORAGE_ENGINE
+ char bak_path[FN_REFLEN+1];
+ char bak_frm_name[FN_REFLEN+1];
char *part_syntax_buf;
uint syntax_len;
+ partition_info *part_info= lpt->part_info;
#endif
DBUG_ENTER("mysql_write_frm");
@@ -777,6 +787,94 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
goto end;
}
}
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+ if (flags & WFRM_WRITE_CONVERTED_TO)
+ {
+ THD *thd= lpt->thd;
+ Alter_table_ctx *alter_ctx= lpt->alter_ctx;
+ HA_CREATE_INFO *create_info= lpt->create_info;
+
+ LEX_CSTRING new_path= { alter_ctx->get_new_path(), 0 };
+ partition_info *work_part_info= thd->work_part_info;
+ handlerton *db_type= create_info->db_type;
+ DBUG_ASSERT(lpt->table->part_info);
+ DBUG_ASSERT(lpt->table->part_info == part_info);
+ handler *file= ((ha_partition *)(lpt->table->file))->get_child_handlers()[0];
+ DBUG_ASSERT(file);
+ new_path.length= strlen(new_path.str);
+ strxnmov(frm_name, sizeof(frm_name) - 1, new_path.str, reg_ext, NullS);
+ create_info->alias= alter_ctx->table_name;
+ thd->work_part_info= NULL;
+ create_info->db_type= work_part_info->default_engine_type;
+ /* NOTE: partitioned temporary tables are not supported. */
+ DBUG_ASSERT(!create_info->tmp_table());
+ if (ddl_log_create_table(thd, part_info, create_info->db_type, &new_path,
+ &alter_ctx->new_db, &alter_ctx->new_name, true) ||
+ ERROR_INJECT("create_before_create_frm"))
+ DBUG_RETURN(TRUE);
+
+ if (mysql_prepare_create_table(thd, create_info, lpt->alter_info,
+ &lpt->db_options, file,
+ &lpt->key_info_buffer, &lpt->key_count,
+ C_ALTER_TABLE, alter_ctx->new_db,
+ alter_ctx->new_name))
+ DBUG_RETURN(TRUE);
+
+ lpt->create_info->table_options= lpt->db_options;
+ LEX_CUSTRING frm= build_frm_image(thd, alter_ctx->new_name, create_info,
+ lpt->alter_info->create_list,
+ lpt->key_count, lpt->key_info_buffer,
+ file);
+ if (unlikely(!frm.str))
+ DBUG_RETURN(TRUE);
+
+ thd->work_part_info= work_part_info;
+ create_info->db_type= db_type;
+
+ ERROR_INJECT("alter_partition_after_create_frm");
+
+ error= writefile(frm_name, alter_ctx->new_db.str, alter_ctx->new_name.str,
+ create_info->tmp_table(), frm.str, frm.length);
+ my_free((void *) frm.str);
+ if (unlikely(error) || ERROR_INJECT("alter_partition_after_write_frm"))
+ {
+ mysql_file_delete(key_file_frm, frm_name, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+
+ DBUG_RETURN(false);
+ }
+ if (flags & WFRM_BACKUP_ORIGINAL)
+ {
+ build_table_filename(path, sizeof(path) - 1, lpt->db.str,
+ lpt->table_name.str, "", 0);
+ strxnmov(frm_name, sizeof(frm_name), path, reg_ext, NullS);
+
+ build_table_shadow_filename(bak_path, sizeof(bak_path) - 1, lpt, true);
+ strxmov(bak_frm_name, bak_path, reg_ext, NullS);
+
+ DDL_LOG_MEMORY_ENTRY *main_entry= part_info->main_entry;
+ mysql_mutex_lock(&LOCK_gdl);
+ if (write_log_replace_frm(lpt, part_info->list->entry_pos,
+ (const char*) bak_path,
+ (const char*) path) ||
+ ddl_log_write_execute_entry(part_info->list->entry_pos,
+ &part_info->execute_entry))
+ {
+ mysql_mutex_unlock(&LOCK_gdl);
+ DBUG_RETURN(TRUE);
+ }
+ mysql_mutex_unlock(&LOCK_gdl);
+ part_info->main_entry= main_entry;
+ if (mysql_file_rename(key_file_frm, frm_name, bak_frm_name, MYF(MY_WME)))
+ DBUG_RETURN(TRUE);
+ if (lpt->table->file->ha_create_partitioning_metadata(bak_path, path,
+ CHF_RENAME_FLAG))
+ DBUG_RETURN(TRUE);
+ }
+#else /* !WITH_PARTITION_STORAGE_ENGINE */
+ DBUG_ASSERT(!(flags & WFRM_BACKUP_ORIGINAL));
+#endif /* !WITH_PARTITION_STORAGE_ENGINE */
if (flags & WFRM_INSTALL_SHADOW)
{
#ifdef WITH_PARTITION_STORAGE_ENGINE
@@ -798,20 +896,25 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
completing this we write a new phase to the log entry that will
deactivate it.
*/
- if (mysql_file_delete(key_file_frm, frm_name, MYF(MY_WME)) ||
+ if (!(flags & WFRM_BACKUP_ORIGINAL) && (
+ mysql_file_delete(key_file_frm, frm_name, MYF(MY_WME))
#ifdef WITH_PARTITION_STORAGE_ENGINE
- lpt->table->file->ha_create_partitioning_metadata(path, shadow_path,
+ || lpt->table->file->ha_create_partitioning_metadata(path, shadow_path,
CHF_DELETE_FLAG) ||
- ddl_log_increment_phase(part_info->frm_log_entry->entry_pos) ||
- (ddl_log_sync(), FALSE) ||
- mysql_file_rename(key_file_frm,
- shadow_frm_name, frm_name, MYF(MY_WME)) ||
- lpt->table->file->ha_create_partitioning_metadata(path, shadow_path,
- CHF_RENAME_FLAG))
-#else
- mysql_file_rename(key_file_frm,
- shadow_frm_name, frm_name, MYF(MY_WME)))
+ ddl_log_increment_phase(part_info->main_entry->entry_pos) ||
+ (ddl_log_sync(), FALSE)
#endif
+ ))
+ {
+ error= 1;
+ goto err;
+ }
+ if (mysql_file_rename(key_file_frm, shadow_frm_name, frm_name, MYF(MY_WME))
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+ || lpt->table->file->ha_create_partitioning_metadata(path, shadow_path,
+ CHF_RENAME_FLAG)
+#endif
+ )
{
error= 1;
goto err;
@@ -850,8 +953,8 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
err:
#ifdef WITH_PARTITION_STORAGE_ENGINE
- ddl_log_increment_phase(part_info->frm_log_entry->entry_pos);
- part_info->frm_log_entry= NULL;
+ ddl_log_increment_phase(part_info->main_entry->entry_pos);
+ part_info->main_entry= NULL;
(void) ddl_log_sync();
#endif
;
@@ -2760,8 +2863,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
*/
if (sql_field->stored_in_db())
record_offset+= sql_field->pack_length;
- if (sql_field->flags & VERS_SYSTEM_FIELD)
- continue;
}
/* Update virtual fields' offset and give error if
All fields are invisible */
@@ -3116,14 +3217,14 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
if (!sql_field || (sql_field->invisible > INVISIBLE_USER &&
!column->generated))
{
- my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), column->field_name.str);
+ my_error(ER_KEY_COLUMN_DOES_NOT_EXIST, MYF(0), column->field_name.str);
DBUG_RETURN(TRUE);
}
if (sql_field->invisible > INVISIBLE_USER &&
!(sql_field->flags & VERS_SYSTEM_FIELD) &&
- !key->invisible && DBUG_EVALUATE_IF("test_invisible_index", 0, 1))
+ !key->invisible && !DBUG_IF("test_invisible_index"))
{
- my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), column->field_name.str);
+ my_error(ER_KEY_COLUMN_DOES_NOT_EXIST, MYF(0), column->field_name.str);
DBUG_RETURN(TRUE);
}
while ((dup_column= cols2++) != column)
@@ -4190,7 +4291,6 @@ err:
@retval -1 table existed but IF NOT EXISTS was used
*/
-static
int create_table_impl(THD *thd,
DDL_LOG_STATE *ddl_log_state_create,
DDL_LOG_STATE *ddl_log_state_rm,
@@ -6051,9 +6151,8 @@ remove_key:
if (!part_elem)
{
push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
- ER_DROP_PARTITION_NON_EXISTENT,
- ER_THD(thd, ER_DROP_PARTITION_NON_EXISTENT),
- "DROP");
+ ER_PARTITION_DOES_NOT_EXIST,
+ ER_THD(thd, ER_PARTITION_DOES_NOT_EXIST));
names_it.remove();
}
}
@@ -8378,7 +8477,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
key_type= Key::UNIQUE;
if (dropped_key_part)
{
- my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), dropped_key_part);
+ my_error(ER_KEY_COLUMN_DOES_NOT_EXIST, MYF(0), dropped_key_part);
if (long_hash_key)
{
key_info->algorithm= HA_KEY_ALG_LONG_HASH;
@@ -9655,7 +9754,8 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db,
Table maybe does not exist, but we got an exclusive lock
on the name, now we can safely try to find out for sure.
*/
- if (ha_table_exists(thd, &alter_ctx.new_db, &alter_ctx.new_name))
+ if (!(alter_info->partition_flags & ALTER_PARTITION_CONVERT_IN) &&
+ ha_table_exists(thd, &alter_ctx.new_db, &alter_ctx.new_name))
{
/* Table will be closed in do_command() */
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), alter_ctx.new_alias.str);
@@ -9976,10 +10076,8 @@ do_continue:;
}
// In-place execution of ALTER TABLE for partitioning.
- DBUG_RETURN(fast_alter_partition_table(thd, table, alter_info,
- create_info, table_list,
- &alter_ctx.db,
- &alter_ctx.table_name));
+ DBUG_RETURN(fast_alter_partition_table(thd, table, alter_info, &alter_ctx,
+ create_info, table_list));
}
#endif
@@ -11077,7 +11175,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
if (ignore && !alter_ctx->fk_error_if_delete_row)
to->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
- thd->get_stmt_da()->reset_current_row_for_warning();
+ thd->get_stmt_da()->reset_current_row_for_warning(1);
restore_record(to, s->default_values); // Create empty record
to->reset_default_fields();
@@ -11541,16 +11639,11 @@ bool check_engine(THD *thd, const char *db_name,
if (create_info->tmp_table() &&
ha_check_storage_engine_flag(*new_engine, HTON_TEMPORARY_NOT_SUPPORTED))
{
- if (create_info->used_fields & HA_CREATE_USED_ENGINE)
- {
- my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0),
- hton_name(*new_engine)->str, "TEMPORARY");
- *new_engine= 0;
- DBUG_RETURN(true);
- }
- *new_engine= myisam_hton;
+ my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0),
+ hton_name(*new_engine)->str, "TEMPORARY");
+ *new_engine= 0;
+ DBUG_RETURN(true);
}
-
lex_string_set(&create_info->new_storage_engine_name,
ha_resolve_storage_engine_name(*new_engine));
DBUG_RETURN(false);
diff --git a/sql/sql_table.h b/sql/sql_table.h
index aacb6c99f15..eaa03bfaf8c 100644
--- a/sql/sql_table.h
+++ b/sql/sql_table.h
@@ -20,6 +20,10 @@
#include <my_sys.h> // pthread_mutex_t
#include "m_string.h" // LEX_CUSTRING
+#define ERROR_INJECT(code) \
+ ((DBUG_IF("crash_" code) && (DBUG_SUICIDE(), 0)) || \
+ (DBUG_IF("fail_" code) && (my_error(ER_UNKNOWN_ERROR, MYF(0)), 1)))
+
class Alter_info;
class Alter_table_ctx;
class Column_definition;
@@ -53,6 +57,8 @@ enum enum_explain_filename_mode
#define WFRM_WRITE_SHADOW 1
#define WFRM_INSTALL_SHADOW 2
#define WFRM_KEEP_SHARE 4
+#define WFRM_WRITE_CONVERTED_TO 8
+#define WFRM_BACKUP_ORIGINAL 16
/* Flags for conversion functions. */
static const uint FN_FROM_IS_TMP= 1 << 0;
@@ -77,7 +83,8 @@ bool check_mysql50_prefix(const char *name);
uint build_table_filename(char *buff, size_t bufflen, const char *db,
const char *table, const char *ext, uint flags);
uint build_table_shadow_filename(char *buff, size_t bufflen,
- ALTER_PARTITION_PARAM_TYPE *lpt);
+ ALTER_PARTITION_PARAM_TYPE *lpt,
+ bool backup= false);
void build_lower_case_table_filename(char *buff, size_t bufflen,
const LEX_CSTRING *db,
const LEX_CSTRING *table,
diff --git a/sql/sql_tablespace.cc b/sql/sql_tablespace.cc
deleted file mode 100644
index bfbaf185243..00000000000
--- a/sql/sql_tablespace.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
-
- 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.
-
- 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.
-
- 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-1335 USA */
-
-/* drop and alter of tablespaces */
-
-#include "mariadb.h"
-#include "sql_priv.h"
-#include "unireg.h"
-#include "sql_tablespace.h"
-#include "sql_table.h" // write_bin_log
-#include "sql_class.h" // THD
-
-int mysql_alter_tablespace(THD *thd, st_alter_tablespace *ts_info)
-{
- int error= HA_ADMIN_NOT_IMPLEMENTED;
- handlerton *hton= ts_info->storage_engine;
-
- DBUG_ENTER("mysql_alter_tablespace");
- /*
- If the user haven't defined an engine, this will fallback to using the
- default storage engine.
- */
- if (hton == NULL)
- {
- hton= ha_default_handlerton(thd);
- if (ts_info->storage_engine != 0)
- push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
- ER_WARN_USING_OTHER_HANDLER,
- ER_THD(thd, ER_WARN_USING_OTHER_HANDLER),
- hton_name(hton)->str,
- ts_info->tablespace_name ? ts_info->tablespace_name
- : ts_info->logfile_group_name);
- }
-
- if (hton->alter_tablespace)
- {
- if (unlikely((error= hton->alter_tablespace(hton, thd, ts_info))))
- {
- if (error == 1)
- DBUG_RETURN(1);
-
- if (error == HA_ADMIN_NOT_IMPLEMENTED)
- my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "");
- else
- my_error(error, MYF(0));
-
- DBUG_RETURN(error);
- }
- }
- else
- {
- push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
- ER_ILLEGAL_HA_CREATE_OPTION,
- ER_THD(thd, ER_ILLEGAL_HA_CREATE_OPTION),
- hton_name(hton)->str,
- "TABLESPACE or LOGFILE GROUP");
- }
- error= write_bin_log(thd, FALSE, thd->query(), thd->query_length());
- DBUG_RETURN(error);
-}
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index e06600700bb..0d1a8313564 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -264,7 +264,7 @@ static void print_keyuse(KEYUSE *keyuse)
void print_keyuse_array(DYNAMIC_ARRAY *keyuse_array)
{
DBUG_LOCK_FILE;
- fprintf(DBUG_FILE, "KEYUSE array (%d elements)\n", keyuse_array->elements);
+ fprintf(DBUG_FILE, "KEYUSE array (%zu elements)\n", keyuse_array->elements);
for(uint i=0; i < keyuse_array->elements; i++)
print_keyuse((KEYUSE*)dynamic_array_ptr(keyuse_array, i));
DBUG_UNLOCK_FILE;
diff --git a/sql/sql_tvc.cc b/sql/sql_tvc.cc
index 702b096231b..d80342a8395 100644
--- a/sql/sql_tvc.cc
+++ b/sql/sql_tvc.cc
@@ -422,7 +422,9 @@ bool table_value_constr::exec(SELECT_LEX *sl)
DBUG_ENTER("table_value_constr::exec");
List_iterator_fast<List_item> li(lists_of_values);
List_item *elem;
+ THD *cur_thd= sl->parent_lex->thd;
ha_rows send_records= 0;
+ int rc=0;
if (select_options & SELECT_DESCRIBE)
DBUG_RETURN(false);
@@ -438,12 +440,10 @@ bool table_value_constr::exec(SELECT_LEX *sl)
while ((elem= li++))
{
- THD *cur_thd= sl->parent_lex->thd;
+ cur_thd->get_stmt_da()->inc_current_row_for_warning();
if (send_records >= sl->master_unit()->lim.get_select_limit())
break;
- int rc=
- result->send_data_with_check(*elem, sl->master_unit(), send_records);
- cur_thd->get_stmt_da()->inc_current_row_for_warning();
+ rc= result->send_data_with_check(*elem, sl->master_unit(), send_records);
if (!rc)
send_records++;
else if (rc > 0)
diff --git a/sql/sql_type_fixedbin.h b/sql/sql_type_fixedbin.h
new file mode 100644
index 00000000000..bf771f1a878
--- /dev/null
+++ b/sql/sql_type_fixedbin.h
@@ -0,0 +1,1915 @@
+#ifndef SQL_TYPE_FIXEDBIN_H
+#define SQL_TYPE_FIXEDBIN_H
+/* Copyright (c) 2019,2021 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 Foundation; version 2 of the License.
+
+ 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.
+
+ 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-1335 USA */
+
+/*
+ This is a common code for plugin (?) types that are generally
+ handled like strings, but have their own fixed size on-disk binary storage
+ format and their own (variable size) canonical string representation.
+
+ Examples are INET6 and UUID types.
+*/
+
+#define MYSQL_SERVER
+#include "sql_class.h" // THD, SORT_FIELD_ATTR
+#include "opt_range.h" // SEL_ARG, null_element
+#include "sql_type_fixedbin_storage.h"
+
+/***********************************************************************/
+
+
+template<class FbtImpl>
+class FixedBinTypeBundle
+{
+public:
+ class Fbt: public FbtImpl
+ {
+ protected:
+ using FbtImpl::m_buffer;
+ bool make_from_item(Item *item, bool warn)
+ {
+ if (item->type_handler() == type_handler_fbt())
+ {
+ Native tmp(m_buffer, sizeof(m_buffer));
+ bool rc= item->val_native(current_thd, &tmp);
+ if (rc)
+ return true;
+ DBUG_ASSERT(tmp.length() == sizeof(m_buffer));
+ if (tmp.ptr() != m_buffer)
+ memcpy(m_buffer, tmp.ptr(), sizeof(m_buffer));
+ return false;
+ }
+ StringBuffer<FbtImpl::max_char_length()+1> tmp;
+ String *str= item->val_str(&tmp);
+ return str ? make_from_character_or_binary_string(str, warn) : true;
+ }
+
+ bool character_string_to_fbt(const char *str, size_t str_length,
+ CHARSET_INFO *cs)
+ {
+ if (cs->state & MY_CS_NONASCII)
+ {
+ char tmp[FbtImpl::max_char_length()+1];
+ String_copier copier;
+ uint length= copier.well_formed_copy(&my_charset_latin1, tmp, sizeof(tmp),
+ cs, str, str_length);
+ return FbtImpl::ascii_to_fbt(tmp, length);
+ }
+ return FbtImpl::ascii_to_fbt(str, str_length);
+ }
+ bool make_from_character_or_binary_string(const String *str, bool warn)
+ {
+ if (str->charset() != &my_charset_bin)
+ {
+ bool rc= character_string_to_fbt(str->ptr(), str->length(),
+ str->charset());
+ if (rc && warn)
+ current_thd->push_warning_wrong_value(Sql_condition::WARN_LEVEL_WARN,
+ type_handler_fbt()->name().ptr(), ErrConvString(str).ptr());
+ return rc;
+ }
+ if (str->length() != sizeof(m_buffer))
+ {
+ if (warn)
+ current_thd->push_warning_wrong_value(Sql_condition::WARN_LEVEL_WARN,
+ type_handler_fbt()->name().ptr(), ErrConvString(str).ptr());
+ return true;
+ }
+ DBUG_ASSERT(str->ptr() != m_buffer);
+ memcpy(m_buffer, str->ptr(), sizeof(m_buffer));
+ return false;
+ }
+ bool binary_to_fbt(const char *str, size_t length)
+ {
+ if (length != sizeof(m_buffer))
+ return true;
+ memcpy(m_buffer, str, length);
+ return false;
+ }
+
+ Fbt() { }
+
+ public:
+
+ static Fbt zero()
+ {
+ Fbt fbt;
+ fbt.set_zero();
+ return fbt;
+ }
+
+ static Fbt record_to_memory(const char *ptr)
+ {
+ Fbt fbt;
+ FbtImpl::record_to_memory(fbt.m_buffer, ptr);
+ return fbt;
+ }
+ /*
+ Check at Item's fix_fields() time if "item" can return a nullable value
+ on conversion to Fbt, or conversion produces a NOT NULL Fbt value.
+ */
+ static bool fix_fields_maybe_null_on_conversion_to_fbt(Item *item)
+ {
+ if (item->maybe_null())
+ return true;
+ if (item->type_handler() == type_handler_fbt())
+ return false;
+ if (!item->const_item() || item->is_expensive())
+ return true;
+ return Fbt_null(item, false).is_null();
+ }
+
+ public:
+
+ Fbt(Item *item, bool *error, bool warn= true)
+ {
+ *error= make_from_item(item, warn);
+ }
+ void to_record(char *str, size_t str_size) const
+ {
+ DBUG_ASSERT(str_size >= sizeof(m_buffer));
+ FbtImpl::memory_to_record(str, m_buffer);
+ }
+ bool to_binary(String *to) const
+ {
+ return to->copy(m_buffer, sizeof(m_buffer), &my_charset_bin);
+ }
+ bool to_native(Native *to) const
+ {
+ return to->copy(m_buffer, sizeof(m_buffer));
+ }
+ bool to_string(String *to) const
+ {
+ to->set_charset(&my_charset_latin1);
+ if (to->alloc(FbtImpl::max_char_length()+1))
+ return true;
+ to->length((uint32) FbtImpl::to_string(const_cast<char*>(to->ptr()),
+ FbtImpl::max_char_length()+1));
+ return false;
+ }
+ int cmp(const Binary_string &other) const
+ {
+ return FbtImpl::cmp(FbtImpl::to_lex_cstring(), other.to_lex_cstring());
+ }
+ int cmp(const Fbt &other) const
+ {
+ return FbtImpl::cmp(FbtImpl::to_lex_cstring(), other.to_lex_cstring());
+ }
+ };
+
+ class Fbt_null: public Fbt, public Null_flag
+ {
+ public:
+ // Initialize from a text representation
+ Fbt_null(const char *str, size_t length, CHARSET_INFO *cs)
+ :Null_flag(Fbt::character_string_to_fbt(str, length, cs)) { }
+ Fbt_null(const String &str)
+ :Fbt_null(str.ptr(), str.length(), str.charset()) { }
+ // Initialize from a binary representation
+ Fbt_null(const char *str, size_t length)
+ :Null_flag(Fbt::binary_to_fbt(str, length)) { }
+ Fbt_null(const Binary_string &str)
+ :Fbt_null(str.ptr(), str.length()) { }
+ // Initialize from an Item
+ Fbt_null(Item *item, bool warn= true)
+ :Null_flag(Fbt::make_from_item(item, warn)) { }
+ public:
+ const Fbt& to_fbt() const
+ {
+ DBUG_ASSERT(!is_null());
+ return *this;
+ }
+ void to_record(char *str, size_t str_size) const
+ {
+ to_fbt().to_record(str, str_size);
+ }
+ bool to_binary(String *to) const
+ {
+ return to_fbt().to_binary(to);
+ }
+ size_t to_string(char *dst, size_t dstsize) const
+ {
+ return to_fbt().to_string(dst, dstsize);
+ }
+ bool to_string(String *to) const
+ {
+ return to_fbt().to_string(to);
+ }
+ };
+
+ class Type_std_attributes_fbt: public Type_std_attributes
+ {
+ public:
+ Type_std_attributes_fbt()
+ :Type_std_attributes(
+ Type_numeric_attributes(FbtImpl::max_char_length(), 0, true),
+ DTCollation_numeric())
+ { }
+ };
+
+ class Type_handler_fbt: public Type_handler
+ {
+ bool character_or_binary_string_to_native(THD *thd, const String *str,
+ Native *to) const
+ {
+ if (str->charset() == &my_charset_bin)
+ {
+ // Convert from a binary string
+ if (str->length() != FbtImpl::binary_length() ||
+ to->copy(str->ptr(), str->length()))
+ {
+ thd->push_warning_wrong_value(Sql_condition::WARN_LEVEL_WARN,
+ name().ptr(), ErrConvString(str).ptr());
+ return true;
+ }
+ return false;
+ }
+ // Convert from a character string
+ Fbt_null tmp(*str);
+ if (tmp.is_null())
+ thd->push_warning_wrong_value(Sql_condition::WARN_LEVEL_WARN,
+ name().ptr(), ErrConvString(str).ptr());
+ return tmp.is_null() || tmp.to_native(to);
+ }
+
+ public:
+ ~Type_handler_fbt() override {}
+
+ const Type_collection *type_collection() const override
+ {
+ static Type_collection_fbt type_collection_fbt;
+ return &type_collection_fbt;
+ }
+
+ const Name &default_value() const override
+ {
+ return FbtImpl::default_value();
+ }
+ ulong KEY_pack_flags(uint column_nr) const override
+ {
+ return FbtImpl::KEY_pack_flags(column_nr);
+ }
+ protocol_send_type_t protocol_send_type() const override
+ {
+ return PROTOCOL_SEND_STRING;
+ }
+ bool Item_append_extended_type_info(Send_field_extended_metadata *to,
+ const Item *item) const override
+ {
+ return to->set_data_type_name(name().lex_cstring());
+ }
+
+ enum_field_types field_type() const override
+ {
+ return MYSQL_TYPE_STRING;
+ }
+
+ Item_result result_type() const override
+ {
+ return STRING_RESULT;
+ }
+
+ Item_result cmp_type() const override
+ {
+ return STRING_RESULT;
+ }
+
+ enum_dynamic_column_type dyncol_type(const Type_all_attributes *attr)
+ const override
+ {
+ return DYN_COL_STRING;
+ }
+
+ uint32 max_display_length_for_field(const Conv_source &src) const override
+ {
+ return FbtImpl::max_char_length();
+ }
+
+ const Type_handler *type_handler_for_comparison() const override
+ {
+ return this;
+ }
+
+ int stored_field_cmp_to_item(THD *thd, Field *field, Item *item) const override
+ {
+ DBUG_ASSERT(field->type_handler() == this);
+ Fbt_null ni(item); // Convert Item to Fbt
+ if (ni.is_null())
+ return 0;
+ NativeBuffer<FbtImpl::binary_length()+1> tmp;
+ if (field->val_native(&tmp))
+ {
+ DBUG_ASSERT(0);
+ return 0;
+ }
+ return -ni.cmp(tmp);
+ }
+ CHARSET_INFO *charset_for_protocol(const Item *item) const override
+ {
+ return item->collation.collation;
+ }
+
+ bool is_scalar_type() const override { return true; }
+ bool is_val_native_ready() const override { return true; }
+ bool can_return_int() const override { return false; }
+ bool can_return_decimal() const override { return false; }
+ bool can_return_real() const override { return false; }
+ bool can_return_str() const override { return true; }
+ bool can_return_text() const override { return true; }
+ bool can_return_date() const override { return false; }
+ bool can_return_time() const override { return false; }
+ bool convert_to_binary_using_val_native() const override { return true; }
+
+ decimal_digits_t Item_time_precision(THD *thd, Item *item) const override
+ {
+ return 0;
+ }
+ decimal_digits_t Item_datetime_precision(THD *thd, Item *item) const override
+ {
+ return 0;
+ }
+ decimal_digits_t Item_decimal_scale(const Item *item) const override
+ {
+ return 0;
+ }
+ decimal_digits_t Item_decimal_precision(const Item *item) const override
+ {
+ /* This will be needed if we ever allow cast from Fbt to DECIMAL. */
+ return (FbtImpl::binary_length()*8+7)/10*3; // = bytes to decimal digits
+ }
+
+ /*
+ Returns how many digits a divisor adds into a division result.
+ See Item::divisor_precision_increment() in item.h for more comments.
+ */
+ decimal_digits_t Item_divisor_precision_increment(const Item *) const override
+ {
+ return 0;
+ }
+ /**
+ Makes a temporary table Field to handle numeric aggregate functions,
+ e.g. SUM(DISTINCT expr), AVG(DISTINCT expr), etc.
+ */
+ Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *) const override
+ {
+ DBUG_ASSERT(0);
+ return 0;
+ }
+ Field *make_conversion_table_field(MEM_ROOT *root, TABLE *table, uint metadata,
+ const Field *target) const override
+ {
+ const Record_addr tmp(NULL, Bit_addr(true));
+ return new (table->in_use->mem_root) Field_fbt(&empty_clex_str, tmp);
+ }
+ // Fix attributes after the parser
+ bool Column_definition_fix_attributes(Column_definition *c) const override
+ {
+ c->length= FbtImpl::max_char_length();
+ return false;
+ }
+
+ bool Column_definition_prepare_stage1(THD *thd, MEM_ROOT *mem_root,
+ Column_definition *def, handler *file,
+ ulonglong table_flags,
+ const Column_derived_attributes *derived_attr)
+ const override
+ {
+ def->prepare_stage1_simple(&my_charset_numeric);
+ return false;
+ }
+
+ bool Column_definition_redefine_stage1(Column_definition *def,
+ const Column_definition *dup,
+ const handler *file) const override
+ {
+ def->redefine_stage1_common(dup, file);
+ def->set_compression_method(dup->compression_method());
+ def->create_length_to_internal_length_string();
+ return false;
+ }
+
+ bool Column_definition_prepare_stage2(Column_definition *def, handler *file,
+ ulonglong table_flags) const override
+ {
+ def->pack_flag= FIELDFLAG_BINARY;
+ return false;
+ }
+
+ bool partition_field_check(const LEX_CSTRING &field_name,
+ Item *item_expr) const override
+ {
+ if (item_expr->cmp_type() != STRING_RESULT)
+ {
+ my_error(ER_WRONG_TYPE_COLUMN_VALUE_ERROR, MYF(0));
+ return true;
+ }
+ return false;
+ }
+
+ bool partition_field_append_value(String *to, Item *item_expr,
+ CHARSET_INFO *field_cs,
+ partition_value_print_mode_t mode)
+ const override
+ {
+ StringBuffer<FbtImpl::max_char_length()+64> fbtstr;
+ Fbt_null fbt(item_expr);
+ if (fbt.is_null())
+ {
+ my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
+ return true;
+ }
+ return fbt.to_string(&fbtstr) ||
+ to->append('\'') ||
+ to->append(fbtstr) ||
+ to->append('\'');
+ }
+
+ Field *make_table_field(MEM_ROOT *root, const LEX_CSTRING *name,
+ const Record_addr &addr,
+ const Type_all_attributes &attr,
+ TABLE_SHARE *table) const override
+ {
+ return new (root) Field_fbt(name, addr);
+ }
+
+ Field * make_table_field_from_def(TABLE_SHARE *share, MEM_ROOT *mem_root,
+ const LEX_CSTRING *name, const Record_addr &addr,
+ const Bit_addr &bit,
+ const Column_definition_attributes *attr,
+ uint32 flags) const override
+ {
+ return new (mem_root) Field_fbt(name, addr);
+ }
+ void Column_definition_attributes_frm_pack(const Column_definition_attributes *def,
+ uchar *buff) const override
+ {
+ def->frm_pack_basic(buff);
+ def->frm_pack_charset(buff);
+ }
+ bool Column_definition_attributes_frm_unpack(Column_definition_attributes *def,
+ TABLE_SHARE *share, const uchar *buffer,
+ LEX_CUSTRING *gis_options)
+ const override
+ {
+ def->frm_unpack_basic(buffer);
+ return def->frm_unpack_charset(share, buffer);
+ }
+ void make_sort_key_part(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field,
+ Sort_param *param) const override
+ {
+ DBUG_ASSERT(item->type_handler() == this);
+ NativeBuffer<FbtImpl::binary_length()+1> tmp;
+ item->val_native_result(current_thd, &tmp);
+ if (item->maybe_null())
+ {
+ if (item->null_value)
+ {
+ memset(to, 0, FbtImpl::binary_length() + 1);
+ return;
+ }
+ *to++= 1;
+ }
+ DBUG_ASSERT(!item->null_value);
+ DBUG_ASSERT(FbtImpl::binary_length() == tmp.length());
+ DBUG_ASSERT(FbtImpl::binary_length() == sort_field->length);
+ FbtImpl::memory_to_record((char*) to, tmp.ptr());
+ }
+ uint make_packed_sort_key_part(uchar *to, Item *item,
+ const SORT_FIELD_ATTR *sort_field,
+ Sort_param *param) const override
+ {
+ DBUG_ASSERT(item->type_handler() == this);
+ NativeBuffer<FbtImpl::binary_length()+1> tmp;
+ item->val_native_result(current_thd, &tmp);
+ if (item->maybe_null())
+ {
+ if (item->null_value)
+ {
+ *to++=0;
+ return 0;
+ }
+ *to++= 1;
+ }
+ DBUG_ASSERT(!item->null_value);
+ DBUG_ASSERT(FbtImpl::binary_length() == tmp.length());
+ DBUG_ASSERT(FbtImpl::binary_length() == sort_field->length);
+ FbtImpl::memory_to_record((char*) to, tmp.ptr());
+ return tmp.length();
+ }
+ void sort_length(THD *thd, const Type_std_attributes *item,
+ SORT_FIELD_ATTR *attr) const override
+ {
+ attr->original_length= attr->length= FbtImpl::binary_length();
+ attr->suffix_length= 0;
+ }
+ uint32 max_display_length(const Item *item) const override
+ {
+ return FbtImpl::max_char_length();
+ }
+ uint32 calc_pack_length(uint32 length) const override
+ {
+ return FbtImpl::binary_length();
+ }
+ void Item_update_null_value(Item *item) const override
+ {
+ NativeBuffer<FbtImpl::binary_length()+1> tmp;
+ item->val_native(current_thd, &tmp);
+ }
+ bool Item_save_in_value(THD *thd, Item *item, st_value *value) const override
+ {
+ value->m_type= DYN_COL_STRING;
+ String *str= item->val_str(&value->m_string);
+ if (str != &value->m_string && !item->null_value)
+ {
+ // "item" returned a non-NULL value
+ if (Fbt_null(*str).is_null())
+ {
+ /*
+ The value was not-null, but conversion to FBT failed:
+ SELECT a, DECODE_ORACLE(fbtcol, 'garbage', '<NULL>', '::01', '01')
+ FROM t1;
+ */
+ thd->push_warning_wrong_value(Sql_condition::WARN_LEVEL_WARN,
+ name().ptr(), ErrConvString(str).ptr());
+ value->m_type= DYN_COL_NULL;
+ return true;
+ }
+ // "item" returned a non-NULL value, and it was a valid FBT
+ value->m_string.set(str->ptr(), str->length(), str->charset());
+ }
+ return check_null(item, value);
+ }
+ void Item_param_setup_conversion(THD *thd, Item_param *param) const override
+ {
+ param->setup_conversion_string(thd, thd->variables.character_set_client);
+ }
+ void Item_param_set_param_func(Item_param *param,
+ uchar **pos, ulong len) const override
+ {
+ param->set_param_str(pos, len);
+ }
+ bool Item_param_set_from_value(THD *thd, Item_param *param,
+ const Type_all_attributes *attr,
+ const st_value *val) const override
+ {
+ param->unsigned_flag= false;
+ param->setup_conversion_string(thd, attr->collation.collation);
+ /*
+ Exact value of max_length is not known unless fbt is converted to
+ charset of connection, so we have to set it later.
+ */
+ return param->set_str(val->m_string.ptr(), val->m_string.length(),
+ attr->collation.collation,
+ attr->collation.collation);
+ }
+ bool Item_param_val_native(THD *thd, Item_param *item, Native *to)
+ const override
+ {
+ StringBuffer<FbtImpl::max_char_length()+1> buffer;
+ String *str= item->val_str(&buffer);
+ if (!str)
+ return true;
+ Fbt_null tmp(*str);
+ return tmp.is_null() || tmp.to_native(to);
+ }
+ bool Item_send(Item *item, Protocol *p, st_value *buf) const override
+ {
+ return Item_send_str(item, p, buf);
+ }
+ int Item_save_in_field(Item *item, Field *field, bool no_conversions)
+ const override
+ {
+ if (field->type_handler() == this)
+ {
+ NativeBuffer<MAX_FIELD_WIDTH> tmp;
+ bool rc= item->val_native(current_thd, &tmp);
+ if (rc || item->null_value)
+ return set_field_to_null_with_conversions(field, no_conversions);
+ field->set_notnull();
+ return field->store_native(tmp);
+ }
+ return item->save_str_in_field(field, no_conversions);
+ }
+
+ String *print_item_value(THD *thd, Item *item, String *str) const override
+ {
+ StringBuffer<FbtImpl::max_char_length()+64> buf;
+ String *result= item->val_str(&buf);
+ /*
+ TODO: This should eventually use one of these notations:
+ 1. CAST('xxx' AS Fbt)
+ Problem: CAST is not supported as a NAME_CONST() argument.
+ 2. Fbt'xxx'
+ Problem: This syntax is not supported by the parser yet.
+ */
+ return !result || str->realloc(result->length() + 2) ||
+ str->append(STRING_WITH_LEN("'")) ||
+ str->append(result->ptr(), result->length()) ||
+ str->append(STRING_WITH_LEN("'")) ? nullptr : str;
+ }
+
+ /**
+ Check if
+ WHERE expr=value AND expr=const
+ can be rewritten as:
+ WHERE const=value AND expr=const
+
+ "this" is the comparison handler that is used by "target".
+
+ @param target - the predicate expr=value,
+ whose "expr" argument will be replaced to "const".
+ @param target_expr - the target's "expr" which will be replaced to "const".
+ @param target_value - the target's second argument, it will remain unchanged.
+ @param source - the equality predicate expr=const (or expr<=>const)
+ that can be used to rewrite the "target" part
+ (under certain conditions, see the code).
+ @param source_expr - the source's "expr". It should be exactly equal to
+ the target's "expr" to make condition rewrite possible.
+ @param source_const - the source's "const" argument, it will be inserted
+ into "target" instead of "expr".
+ */
+ bool can_change_cond_ref_to_const(Item_bool_func2 *target, Item *target_expr,
+ Item *target_value, Item_bool_func2 *source,
+ Item *source_expr, Item *source_const)
+ const override
+ {
+ /*
+ WHERE COALESCE(col)='xxx' AND COALESCE(col)=CONCAT(a); -->
+ WHERE COALESCE(col)='xxx' AND 'xxx'=CONCAT(a);
+ */
+ return target->compare_type_handler() == source->compare_type_handler();
+ }
+ bool subquery_type_allows_materialization(const Item *inner,
+ const Item *outer, bool) const override
+ {
+ /*
+ Example:
+ SELECT * FROM t1 WHERE a IN (SELECT col FROM t1 GROUP BY col);
+ Allow materialization only if the outer column is also FBT.
+ This can be changed for more relaxed rules in the future.
+ */
+ DBUG_ASSERT(inner->type_handler() == this);
+ return outer->type_handler() == this;
+ }
+ /**
+ Make a simple constant replacement item for a constant "src",
+ so the new item can futher be used for comparison with "cmp", e.g.:
+ src = cmp -> replacement = cmp
+
+ "this" is the type handler that is used to compare "src" and "cmp".
+
+ @param thd - current thread, for mem_root
+ @param src - The item that we want to replace. It's a const item,
+ but it can be complex enough to calculate on every row.
+ @param cmp - The src's comparand.
+ @retval - a pointer to the created replacement Item
+ @retval - NULL, if could not create a replacement (e.g. on EOM).
+ NULL is also returned for ROWs, because instead of replacing
+ a Item_row to a new Item_row, Type_handler_row just replaces
+ its elements.
+ */
+ Item *make_const_item_for_comparison(THD *thd, Item *src,
+ const Item *cmp) const override
+ {
+ Fbt_null tmp(src);
+ if (tmp.is_null())
+ return new (thd->mem_root) Item_null(thd, src->name.str);
+ return new (thd->mem_root) Item_literal_fbt(thd, tmp);
+ }
+ Item_cache *Item_get_cache(THD *thd, const Item *item) const override
+ {
+ return new (thd->mem_root) Item_cache_fbt(thd);
+ }
+
+ Item *create_typecast_item(THD *thd, Item *item,
+ const Type_cast_attributes &attr) const override
+ {
+ return new (thd->mem_root) Item_typecast_fbt(thd, item);
+ }
+ Item_copy *create_item_copy(THD *thd, Item *item) const override
+ {
+ return new (thd->mem_root) Item_copy_fbt(thd, item);
+ }
+ int cmp_native(const Native &a, const Native &b) const override
+ {
+ return FbtImpl::cmp(a.to_lex_cstring(), b.to_lex_cstring());
+ }
+ bool set_comparator_func(THD *thd, Arg_comparator *cmp) const override
+ {
+ return cmp->set_cmp_func_native(thd);
+ }
+ bool Item_const_eq(const Item_const *a, const Item_const *b,
+ bool binary_cmp) const override
+ {
+ return false;
+ }
+ bool Item_eq_value(THD *thd, const Type_cmp_attributes *attr,
+ Item *a, Item *b) const override
+ {
+ Fbt_null na(a), nb(b);
+ return !na.is_null() && !nb.is_null() && !na.cmp(nb);
+ }
+ bool Item_hybrid_func_fix_attributes(THD *thd, const LEX_CSTRING &name,
+ Type_handler_hybrid_field_type *h,
+ Type_all_attributes *attr,
+ Item **items, uint nitems) const override
+ {
+ attr->Type_std_attributes::operator=(Type_std_attributes_fbt());
+ h->set_handler(this);
+ /*
+ If some of the arguments cannot be safely converted to "FBT NOT NULL",
+ then mark the entire function nullability as NULL-able.
+ Otherwise, keep the generic nullability calculated by earlier stages:
+ - either by the most generic way in Item_func::fix_fields()
+ - or by Item_func_xxx::fix_length_and_dec() before the call of
+ Item_hybrid_func_fix_attributes()
+ IFNULL() is special. It does not need to test args[0].
+ */
+ uint first= dynamic_cast<Item_func_ifnull*>(attr) ? 1 : 0;
+ for (uint i= first; i < nitems; i++)
+ {
+ if (Fbt::fix_fields_maybe_null_on_conversion_to_fbt(items[i]))
+ {
+ attr->set_type_maybe_null(true);
+ break;
+ }
+ }
+ return false;
+ }
+ bool Item_func_min_max_fix_attributes(THD *thd, Item_func_min_max *func,
+ Item **items, uint nitems) const override
+ {
+ return Item_hybrid_func_fix_attributes(thd, func->func_name_cstring(),
+ func, func, items, nitems);
+
+ }
+ bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *func) const override
+ {
+ func->Type_std_attributes::operator=(Type_std_attributes_fbt());
+ func->set_handler(this);
+ return false;
+ }
+ bool Item_sum_sum_fix_length_and_dec(Item_sum_sum *func) const override
+ {
+ return Item_func_or_sum_illegal_param(func);
+ }
+ bool Item_sum_avg_fix_length_and_dec(Item_sum_avg *func) const override
+ {
+ return Item_func_or_sum_illegal_param(func);
+ }
+ bool Item_sum_variance_fix_length_and_dec(Item_sum_variance *func) const override
+ {
+ return Item_func_or_sum_illegal_param(func);
+ }
+
+ bool Item_val_native_with_conversion(THD *thd, Item *item,
+ Native *to) const override
+ {
+ if (item->type_handler() == this)
+ return item->val_native(thd, to); // No conversion needed
+ StringBuffer<FbtImpl::max_char_length()+1> buffer;
+ String *str= item->val_str(&buffer);
+ return str ? character_or_binary_string_to_native(thd, str, to) : true;
+ }
+ bool Item_val_native_with_conversion_result(THD *thd, Item *item,
+ Native *to) const override
+ {
+ if (item->type_handler() == this)
+ return item->val_native_result(thd, to); // No conversion needed
+ StringBuffer<FbtImpl::max_char_length()+1> buffer;
+ String *str= item->str_result(&buffer);
+ return str ? character_or_binary_string_to_native(thd, str, to) : true;
+ }
+
+ bool Item_val_bool(Item *item) const override
+ {
+ NativeBuffer<FbtImpl::binary_length()+1> tmp;
+ if (item->val_native(current_thd, &tmp))
+ return false;
+ return !Fbt::only_zero_bytes(tmp.ptr(), tmp.length());
+ }
+ void Item_get_date(THD *thd, Item *item, Temporal::Warn *buff,
+ MYSQL_TIME *ltime, date_mode_t fuzzydate) const override
+ {
+ set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
+ }
+
+ longlong Item_val_int_signed_typecast(Item *item) const override
+ {
+ DBUG_ASSERT(0);
+ return 0;
+ }
+
+ longlong Item_val_int_unsigned_typecast(Item *item) const override
+ {
+ DBUG_ASSERT(0);
+ return 0;
+ }
+
+ String *Item_func_hex_val_str_ascii(Item_func_hex *item, String *str)
+ const override
+ {
+ NativeBuffer<FbtImpl::binary_length()+1> tmp;
+ if ((item->null_value= item->arguments()[0]->val_native(current_thd, &tmp)))
+ return nullptr;
+ DBUG_ASSERT(tmp.length() == FbtImpl::binary_length());
+ if (str->set_hex(tmp.ptr(), tmp.length()))
+ {
+ str->length(0);
+ str->set_charset(item->collation.collation);
+ }
+ return str;
+ }
+
+ String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *item,
+ String *str) const override
+ {
+ NativeBuffer<FbtImpl::binary_length()+1> native;
+ if (item->val_native(current_thd, &native))
+ {
+ DBUG_ASSERT(item->null_value);
+ return nullptr;
+ }
+ DBUG_ASSERT(native.length() == FbtImpl::binary_length());
+ Fbt_null tmp(native.ptr(), native.length());
+ return tmp.is_null() || tmp.to_string(str) ? nullptr : str;
+ }
+ double Item_func_hybrid_field_type_val_real(Item_func_hybrid_field_type *)
+ const override
+ {
+ return 0;
+ }
+ longlong Item_func_hybrid_field_type_val_int(Item_func_hybrid_field_type *)
+ const override
+ {
+ return 0;
+ }
+ my_decimal *
+ Item_func_hybrid_field_type_val_decimal(Item_func_hybrid_field_type *,
+ my_decimal *to) const override
+ {
+ my_decimal_set_zero(to);
+ return to;
+ }
+ void Item_func_hybrid_field_type_get_date(THD *,
+ Item_func_hybrid_field_type *,
+ Temporal::Warn *,
+ MYSQL_TIME *to,
+ date_mode_t fuzzydate)
+ const override
+ {
+ set_zero_time(to, MYSQL_TIMESTAMP_TIME);
+ }
+ // WHERE is Item_func_min_max_val_native???
+ String *Item_func_min_max_val_str(Item_func_min_max *func, String *str)
+ const override
+ {
+ Fbt_null tmp(func);
+ return tmp.is_null() || tmp.to_string(str) ? nullptr : str;
+ }
+ double Item_func_min_max_val_real(Item_func_min_max *) const override
+ {
+ return 0;
+ }
+ longlong Item_func_min_max_val_int(Item_func_min_max *) const override
+ {
+ return 0;
+ }
+ my_decimal *Item_func_min_max_val_decimal(Item_func_min_max *,
+ my_decimal *to) const override
+ {
+ my_decimal_set_zero(to);
+ return to;
+ }
+ bool Item_func_min_max_get_date(THD *thd, Item_func_min_max*, MYSQL_TIME *to,
+ date_mode_t fuzzydate) const override
+ {
+ set_zero_time(to, MYSQL_TIMESTAMP_TIME);
+ return false;
+ }
+
+ bool Item_func_between_fix_length_and_dec(Item_func_between *func) const override
+ {
+ return false;
+ }
+ longlong Item_func_between_val_int(Item_func_between *func) const override
+ {
+ return func->val_int_cmp_native();
+ }
+
+ cmp_item *make_cmp_item(THD *thd, CHARSET_INFO *cs) const override
+ {
+ return new (thd->mem_root) cmp_item_fbt;
+ }
+
+ in_vector *make_in_vector(THD *thd, const Item_func_in *func,
+ uint nargs) const override
+ {
+ return new (thd->mem_root) in_fbt(thd, nargs);
+ }
+
+ bool Item_func_in_fix_comparator_compatible_types(THD *thd,
+ Item_func_in *func)
+ const override
+ {
+ if (func->compatible_types_scalar_bisection_possible())
+ {
+ return func->value_list_convert_const_to_int(thd) ||
+ func->fix_for_scalar_comparison_using_bisection(thd);
+ }
+ return
+ func->fix_for_scalar_comparison_using_cmp_items(thd,
+ 1U << (uint) STRING_RESULT);
+ }
+ bool Item_func_round_fix_length_and_dec(Item_func_round *func) const override
+ {
+ return Item_func_or_sum_illegal_param(func);
+ }
+ bool Item_func_int_val_fix_length_and_dec(Item_func_int_val *func) const override
+ {
+ return Item_func_or_sum_illegal_param(func);
+ }
+
+ bool Item_func_abs_fix_length_and_dec(Item_func_abs *func) const override
+ {
+ return Item_func_or_sum_illegal_param(func);
+ }
+
+ bool Item_func_neg_fix_length_and_dec(Item_func_neg *func) const override
+ {
+ return Item_func_or_sum_illegal_param(func);
+ }
+
+ bool Item_func_signed_fix_length_and_dec(Item_func_signed *item) const override
+ {
+ return Item_func_or_sum_illegal_param(item);
+ }
+ bool Item_func_unsigned_fix_length_and_dec(Item_func_unsigned *item) const override
+ {
+ return Item_func_or_sum_illegal_param(item);
+ }
+ bool Item_double_typecast_fix_length_and_dec(Item_double_typecast *item)
+ const override
+ {
+ return Item_func_or_sum_illegal_param(item);
+ }
+ bool Item_float_typecast_fix_length_and_dec(Item_float_typecast *item)
+ const override
+ {
+ return Item_func_or_sum_illegal_param(item);
+ }
+ bool Item_decimal_typecast_fix_length_and_dec(Item_decimal_typecast *item)
+ const override
+ {
+ return Item_func_or_sum_illegal_param(item);
+ }
+ bool Item_char_typecast_fix_length_and_dec(Item_char_typecast *item)
+ const override
+ {
+ if (item->cast_charset() == &my_charset_bin)
+ {
+ static Item_char_typecast_func_handler_fbt_to_binary
+ item_char_typecast_func_handler_fbt_to_binary;
+ item->fix_length_and_dec_native_to_binary(FbtImpl::binary_length());
+ item->set_func_handler(&item_char_typecast_func_handler_fbt_to_binary);
+ return false;
+ }
+ item->fix_length_and_dec_str();
+ return false;
+ }
+
+ bool Item_time_typecast_fix_length_and_dec(Item_time_typecast *item) const override
+ {
+ return Item_func_or_sum_illegal_param(item);
+ }
+ bool Item_date_typecast_fix_length_and_dec(Item_date_typecast *item) const override
+ {
+ return Item_func_or_sum_illegal_param(item);
+ }
+ bool Item_datetime_typecast_fix_length_and_dec(Item_datetime_typecast *item)
+ const override
+ {
+ return Item_func_or_sum_illegal_param(item);
+ }
+ bool Item_func_plus_fix_length_and_dec(Item_func_plus *item) const override
+ {
+ return Item_func_or_sum_illegal_param(item);
+ }
+ bool Item_func_minus_fix_length_and_dec(Item_func_minus *item) const override
+ {
+ return Item_func_or_sum_illegal_param(item);
+ }
+ bool Item_func_mul_fix_length_and_dec(Item_func_mul *item) const override
+ {
+ return Item_func_or_sum_illegal_param(item);
+ }
+ bool Item_func_div_fix_length_and_dec(Item_func_div *item) const override
+ {
+ return Item_func_or_sum_illegal_param(item);
+ }
+ bool Item_func_mod_fix_length_and_dec(Item_func_mod *item) const override
+ {
+ return Item_func_or_sum_illegal_param(item);
+ }
+ };
+
+ class cmp_item_fbt: public cmp_item_scalar
+ {
+ Fbt m_native;
+ public:
+ cmp_item_fbt()
+ :cmp_item_scalar(),
+ m_native(Fbt::zero())
+ { }
+ void store_value(Item *item) override
+ {
+ m_native= Fbt(item, &m_null_value);
+ }
+ int cmp_not_null(const Value *val) override
+ {
+ DBUG_ASSERT(!val->is_null());
+ DBUG_ASSERT(val->is_string());
+ Fbt_null tmp(val->m_string);
+ DBUG_ASSERT(!tmp.is_null());
+ return m_native.cmp(tmp);
+ }
+ int cmp(Item *arg) override
+ {
+ Fbt_null tmp(arg);
+ return m_null_value || tmp.is_null() ? UNKNOWN : m_native.cmp(tmp) != 0;
+ }
+ int compare(cmp_item *ci) override
+ {
+ cmp_item_fbt *tmp= static_cast<cmp_item_fbt*>(ci);
+ DBUG_ASSERT(!m_null_value);
+ DBUG_ASSERT(!tmp->m_null_value);
+ return m_native.cmp(tmp->m_native);
+ }
+ cmp_item *make_same(THD *thd) override
+ {
+ return new (thd->mem_root) cmp_item_fbt();
+ }
+ };
+
+ class Field_fbt: public Field
+ {
+ static void set_min_value(char *ptr)
+ {
+ memset(ptr, 0, FbtImpl::binary_length());
+ }
+ static void set_max_value(char *ptr)
+ {
+ memset(ptr, 0xFF, FbtImpl::binary_length());
+ }
+ void store_warning(const ErrConv &str,
+ Sql_condition::enum_warning_level level)
+ {
+ if (get_thd()->count_cuted_fields <= CHECK_FIELD_EXPRESSION)
+ return;
+ const TABLE_SHARE *s= table->s;
+ static const Name type_name= type_handler_fbt()->name();
+ get_thd()->push_warning_truncated_value_for_field(level, type_name.ptr(),
+ str.ptr(), s ? s->db.str : nullptr, s ? s->table_name.str : nullptr,
+ field_name.str);
+ }
+ int set_null_with_warn(const ErrConv &str)
+ {
+ store_warning(str, Sql_condition::WARN_LEVEL_WARN);
+ set_null();
+ return 1;
+ }
+ int set_min_value_with_warn(const ErrConv &str)
+ {
+ store_warning(str, Sql_condition::WARN_LEVEL_WARN);
+ set_min_value((char*) ptr);
+ return 1;
+ }
+ int set_max_value_with_warn(const ErrConv &str)
+ {
+ store_warning(str, Sql_condition::WARN_LEVEL_WARN);
+ set_max_value((char*) ptr);
+ return 1;
+ }
+ int store_fbt_null_with_warn(const Fbt_null &fbt,
+ const ErrConvString &err)
+ {
+ DBUG_ASSERT(marked_for_write_or_computed());
+ if (fbt.is_null())
+ return maybe_null() ? set_null_with_warn(err)
+ : set_min_value_with_warn(err);
+ fbt.to_record((char *) ptr, FbtImpl::binary_length());
+ return 0;
+ }
+
+ public:
+ Field_fbt(const LEX_CSTRING *field_name_arg, const Record_addr &rec)
+ :Field(rec.ptr(), FbtImpl::max_char_length(),
+ rec.null_ptr(), rec.null_bit(), Field::NONE, field_name_arg)
+ {
+ flags|= BINARY_FLAG | UNSIGNED_FLAG;
+ }
+ const Type_handler *type_handler() const override
+ {
+ return type_handler_fbt();
+ }
+ uint32 max_display_length() const override { return field_length; }
+ bool str_needs_quotes() const override { return true; }
+ const DTCollation &dtcollation() const override
+ {
+ static DTCollation_numeric c;
+ return c;
+ }
+ CHARSET_INFO *charset(void) const override { return &my_charset_numeric; }
+ const CHARSET_INFO *sort_charset(void) const override { return &my_charset_bin; }
+ /**
+ This makes client-server protocol convert the value according
+ to @@character_set_client.
+ */
+ bool binary() const override { return false; }
+ enum ha_base_keytype key_type() const override { return HA_KEYTYPE_BINARY; }
+
+ bool is_equal(const Column_definition &new_field) const override
+ {
+ return new_field.type_handler() == type_handler();
+ }
+ bool eq_def(const Field *field) const override
+ {
+ return Field::eq_def(field);
+ }
+ double pos_in_interval(Field *min, Field *max) override
+ {
+ return pos_in_interval_val_str(min, max, 0);
+ }
+ int cmp(const uchar *a, const uchar *b) const override
+ { return memcmp(a, b, pack_length()); }
+
+ void sort_string(uchar *to, uint length) override
+ {
+ DBUG_ASSERT(length == pack_length());
+ memcpy(to, ptr, length);
+ }
+ uint32 pack_length() const override
+ {
+ return FbtImpl::binary_length();
+ }
+ uint pack_length_from_metadata(uint field_metadata) const override
+ {
+ return FbtImpl::binary_length();
+ }
+
+ void sql_type(String &str) const override
+ {
+ static Name name= type_handler_fbt()->name();
+ str.set_ascii(name.ptr(), name.length());
+ }
+
+ void make_send_field(Send_field *to) override
+ {
+ Field::make_send_field(to);
+ to->set_data_type_name(type_handler_fbt()->name().lex_cstring());
+ }
+
+ bool validate_value_in_record(THD *thd, const uchar *record) const override
+ {
+ return false;
+ }
+
+ bool val_native(Native *to) override
+ {
+ DBUG_ASSERT(marked_for_read());
+ DBUG_ASSERT(!is_null());
+ if (to->alloc(FbtImpl::binary_length()))
+ return true;
+ to->length(FbtImpl::binary_length());
+ FbtImpl::record_to_memory((char*) to->ptr(), (const char*) ptr);
+ return false;
+ }
+
+ Fbt to_fbt() const
+ {
+ DBUG_ASSERT(marked_for_read());
+ DBUG_ASSERT(!is_null());
+ return Fbt::record_to_memory((const char*) ptr);
+ }
+
+ String *val_str(String *val_buffer, String *) override
+ {
+ return to_fbt().to_string(val_buffer) ? NULL : val_buffer;
+ }
+
+ my_decimal *val_decimal(my_decimal *to) override
+ {
+ DBUG_ASSERT(marked_for_read());
+ my_decimal_set_zero(to);
+ return to;
+ }
+
+ longlong val_int() override
+ {
+ DBUG_ASSERT(marked_for_read());
+ return 0;
+ }
+
+ double val_real() override
+ {
+ DBUG_ASSERT(marked_for_read());
+ return 0;
+ }
+
+ bool get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate) override
+ {
+ DBUG_ASSERT(marked_for_read());
+ set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
+ return false;
+ }
+
+ bool val_bool(void) override
+ {
+ DBUG_ASSERT(marked_for_read());
+ return !Fbt::only_zero_bytes((const char *) ptr, FbtImpl::binary_length());
+ }
+
+ int store_native(const Native &value) override
+ {
+ DBUG_ASSERT(marked_for_write_or_computed());
+ DBUG_ASSERT(value.length() == FbtImpl::binary_length());
+ FbtImpl::memory_to_record((char*) ptr, value.ptr());
+ return 0;
+ }
+
+ int store(const char *str, size_t length, CHARSET_INFO *cs) override
+ {
+ return cs == &my_charset_bin ? store_binary(str, length)
+ : store_text(str, length, cs);
+ }
+
+ int store_text(const char *str, size_t length, CHARSET_INFO *cs) override
+ {
+ return store_fbt_null_with_warn(Fbt_null(str, length, cs),
+ ErrConvString(str, length, cs));
+ }
+
+ int store_binary(const char *str, size_t length) override
+ {
+ return store_fbt_null_with_warn(Fbt_null(str, length),
+ ErrConvString(str, length,
+ &my_charset_bin));
+ }
+
+ int store_hex_hybrid(const char *str, size_t length) override
+ {
+ return Field_fbt::store_binary(str, length);
+ }
+
+ int store_decimal(const my_decimal *num) override
+ {
+ DBUG_ASSERT(marked_for_write_or_computed());
+ return set_min_value_with_warn(ErrConvDecimal(num));
+ }
+
+ int store(longlong nr, bool unsigned_flag) override
+ {
+ DBUG_ASSERT(marked_for_write_or_computed());
+ return set_min_value_with_warn(
+ ErrConvInteger(Longlong_hybrid(nr, unsigned_flag)));
+ }
+
+ int store(double nr) override
+ {
+ DBUG_ASSERT(marked_for_write_or_computed());
+ return set_min_value_with_warn(ErrConvDouble(nr));
+ }
+
+ int store_time_dec(const MYSQL_TIME *ltime, uint dec) override
+ {
+ DBUG_ASSERT(marked_for_write_or_computed());
+ return set_min_value_with_warn(ErrConvTime(ltime));
+ }
+
+ /*** Field conversion routines ***/
+ int store_field(Field *from) override
+ {
+ // INSERT INTO t1 (fbt_field) SELECT different_field_type FROM t2;
+ return from->save_in_field(this);
+ }
+ int save_in_field(Field *to) override
+ {
+ // INSERT INTO t2 (different_field_type) SELECT fbt_field FROM t1;
+ if (to->charset() == &my_charset_bin &&
+ dynamic_cast<const Type_handler_general_purpose_string*>
+ (to->type_handler()))
+ {
+ NativeBuffer<FbtImpl::binary_length()+1> res;
+ val_native(&res);
+ return to->store(res.ptr(), res.length(), &my_charset_bin);
+ }
+ return save_in_field_str(to);
+ }
+ Copy_func *get_copy_func(const Field *from) const override
+ {
+ // ALTER to FBT from another field
+ return do_field_string;
+ }
+
+ Copy_func *get_copy_func_to(const Field *to) const override
+ {
+ if (type_handler() == to->type_handler())
+ {
+ // ALTER from FBT to FBT
+ DBUG_ASSERT(pack_length() == to->pack_length());
+ DBUG_ASSERT(charset() == to->charset());
+ DBUG_ASSERT(sort_charset() == to->sort_charset());
+ return Field::do_field_eq;
+ }
+ // ALTER from FBT to another fbt type
+ if (to->charset() == &my_charset_bin &&
+ dynamic_cast<const Type_handler_general_purpose_string*>
+ (to->type_handler()))
+ {
+ /*
+ ALTER from FBT to a binary string type, e.g.:
+ BINARY, TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB
+ */
+ return do_field_fbt_native_to_binary;
+ }
+ return do_field_string;
+ }
+
+ static void do_field_fbt_native_to_binary(Copy_field *copy)
+ {
+ NativeBuffer<FbtImpl::binary_length()+1> res;
+ copy->from_field->val_native(&res);
+ copy->to_field->store(res.ptr(), res.length(), &my_charset_bin);
+ }
+
+ bool memcpy_field_possible(const Field *from) const override
+ {
+ // INSERT INTO t1 (fbt_field) SELECT field2 FROM t2;
+ return type_handler() == from->type_handler();
+ }
+ enum_conv_type rpl_conv_type_from(const Conv_source &source,
+ const Relay_log_info *rli,
+ const Conv_param &param) const override
+ {
+ if (type_handler() == source.type_handler() ||
+ (source.type_handler() == &type_handler_string &&
+ source.type_handler()->max_display_length_for_field(source) ==
+ FbtImpl::binary_length()))
+ return rpl_conv_type_from_same_data_type(source.metadata(), rli, param);
+ return CONV_TYPE_IMPOSSIBLE;
+ }
+
+ /*** Optimizer routines ***/
+ bool test_if_equality_guarantees_uniqueness(const Item *const_item) const override
+ {
+ /*
+ This condition:
+ WHERE fbt_field=const
+ should return a single distinct value only,
+ as comparison is done according to FBT.
+ */
+ return true;
+ }
+ bool can_be_substituted_to_equal_item(const Context &ctx,
+ const Item_equal *item_equal)
+ override
+ {
+ switch (ctx.subst_constraint()) {
+ case ANY_SUBST:
+ return ctx.compare_type_handler() == item_equal->compare_type_handler();
+ case IDENTITY_SUBST:
+ return true;
+ }
+ return false;
+ }
+ Item *get_equal_const_item(THD *thd, const Context &ctx,
+ Item *const_item) override
+ {
+ Fbt_null tmp(const_item);
+ if (tmp.is_null())
+ return NULL;
+ return new (thd->mem_root) Item_literal_fbt(thd, tmp);
+ }
+ bool can_optimize_keypart_ref(const Item_bool_func *cond,
+ const Item *item) const override
+ {
+ /*
+ Mixing of two different non-traditional types is currently prevented.
+ This may change in the future.
+ */
+ DBUG_ASSERT(item->type_handler()->type_handler_base_or_self()->
+ is_traditional_scalar_type() ||
+ item->type_handler() == type_handler());
+ return true;
+ }
+ /**
+ Test if Field can use range optimizer for a standard comparison operation:
+ <=, <, =, <=>, >, >=
+ Note, this method does not cover spatial operations.
+ */
+ bool can_optimize_range(const Item_bool_func *cond,
+ const Item *item,
+ bool is_eq_func) const override
+ {
+ // See the DBUG_ASSERT comment in can_optimize_keypart_ref()
+ DBUG_ASSERT(item->type_handler()->type_handler_base_or_self()->
+ is_traditional_scalar_type() ||
+ item->type_handler() == type_handler());
+ return true;
+ }
+ void hash(ulong *nr, ulong *nr2) override
+ {
+ if (is_null())
+ *nr^= (*nr << 1) | 1;
+ else
+ FbtImpl::hash_record(ptr, nr, nr2);
+ }
+ SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *prm, KEY_PART *key_part,
+ const Item_bool_func *cond,
+ scalar_comparison_op op, Item *value) override
+ {
+ DBUG_ENTER("Field_fbt::get_mm_leaf");
+ if (!can_optimize_scalar_range(prm, key_part, cond, op, value))
+ DBUG_RETURN(0);
+ int err= value->save_in_field_no_warnings(this, 1);
+ if ((op != SCALAR_CMP_EQUAL && is_real_null()) || err < 0)
+ DBUG_RETURN(&null_element);
+ if (err > 0)
+ {
+ if (op == SCALAR_CMP_EQ || op == SCALAR_CMP_EQUAL)
+ DBUG_RETURN(new (prm->mem_root) SEL_ARG_IMPOSSIBLE(this));
+ DBUG_RETURN(NULL); /* Cannot infer anything */
+ }
+ DBUG_RETURN(stored_field_make_mm_leaf(prm, key_part, op, value));
+ }
+ bool can_optimize_hash_join(const Item_bool_func *cond,
+ const Item *item) const override
+ {
+ return can_optimize_keypart_ref(cond, item);
+ }
+ bool can_optimize_group_min_max(const Item_bool_func *cond,
+ const Item *const_item) const override
+ {
+ return true;
+ }
+
+ uint row_pack_length() const override { return pack_length(); }
+
+ Binlog_type_info binlog_type_info() const override
+ {
+ DBUG_ASSERT(type() == binlog_type());
+ return Binlog_type_info_fixed_string(Field_fbt::binlog_type(),
+ FbtImpl::binary_length(), &my_charset_bin);
+ }
+
+ uchar *pack(uchar *to, const uchar *from, uint max_length) override
+ {
+ DBUG_PRINT("debug", ("Packing field '%s'", field_name.str));
+ return FbtImpl::pack(to, from, max_length);
+ }
+
+ const uchar *unpack(uchar *to, const uchar *from, const uchar *from_end,
+ uint param_data) override
+ {
+ return FbtImpl::unpack(to, from, from_end, param_data);
+ }
+
+ uint max_packed_col_length(uint max_length) override
+ {
+ return StringPack::max_packed_col_length(max_length);
+ }
+
+ uint packed_col_length(const uchar *fbt_ptr, uint length) override
+ {
+ return StringPack::packed_col_length(fbt_ptr, length);
+ }
+
+ uint size_of() const override { return sizeof(*this); }
+ };
+
+ class Item_typecast_fbt: public Item_func
+ {
+ public:
+ Item_typecast_fbt(THD *thd, Item *a) :Item_func(thd, a) {}
+
+ const Type_handler *type_handler() const override
+ { return type_handler_fbt(); }
+
+ enum Functype functype() const override { return CHAR_TYPECAST_FUNC; }
+ bool eq(const Item *item, bool binary_cmp) const override
+ {
+ if (this == item)
+ return true;
+ if (item->type() != FUNC_ITEM ||
+ functype() != ((Item_func*)item)->functype())
+ return false;
+ if (type_handler() != item->type_handler())
+ return false;
+ Item_typecast_fbt *cast= (Item_typecast_fbt*) item;
+ return args[0]->eq(cast->args[0], binary_cmp);
+ }
+ LEX_CSTRING func_name_cstring() const override
+ {
+ static Name name= type_handler_fbt()->name();
+ size_t len= 9+name.length()+1;
+ char *buf= (char*)current_thd->alloc(len);
+ strmov(strmov(buf, "cast_as_"), name.ptr());
+ return { buf, len };
+ }
+ void print(String *str, enum_query_type query_type) override
+ {
+ str->append(STRING_WITH_LEN("cast("));
+ args[0]->print(str, query_type);
+ str->append(STRING_WITH_LEN(" as "));
+ str->append(type_handler_fbt()->name().lex_cstring());
+ str->append(')');
+ }
+ bool fix_length_and_dec() override
+ {
+ Type_std_attributes::operator=(Type_std_attributes_fbt());
+ if (Fbt::fix_fields_maybe_null_on_conversion_to_fbt(args[0]))
+ set_maybe_null();
+ return false;
+ }
+ String *val_str(String *to) override
+ {
+ Fbt_null tmp(args[0]);
+ return (null_value= tmp.is_null() || tmp.to_string(to)) ? NULL : to;
+ }
+ longlong val_int() override
+ {
+ return 0;
+ }
+ double val_real() override
+ {
+ return 0;
+ }
+ my_decimal *val_decimal(my_decimal *to) override
+ {
+ my_decimal_set_zero(to);
+ return to;
+ }
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
+ {
+ set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
+ return false;
+ }
+ bool val_native(THD *thd, Native *to) override
+ {
+ Fbt_null tmp(args[0]);
+ return null_value= tmp.is_null() || tmp.to_native(to);
+ }
+ Item *get_copy(THD *thd) override
+ { return get_item_copy<Item_typecast_fbt>(thd, this); }
+ };
+
+ class Item_cache_fbt: public Item_cache
+ {
+ NativeBuffer<FbtImpl::binary_length()+1> m_value;
+ public:
+ Item_cache_fbt(THD *thd)
+ :Item_cache(thd, type_handler_fbt()) { }
+ Item *get_copy(THD *thd)
+ { return get_item_copy<Item_cache_fbt>(thd, this); }
+ bool cache_value()
+ {
+ if (!example)
+ return false;
+ value_cached= true;
+ null_value_inside= null_value=
+ example->val_native_with_conversion_result(current_thd,
+ &m_value, type_handler());
+ return true;
+ }
+ String* val_str(String *to)
+ {
+ if (!has_value())
+ return NULL;
+ Fbt_null tmp(m_value.ptr(), m_value.length());
+ return tmp.is_null() || tmp.to_string(to) ? NULL : to;
+ }
+ my_decimal *val_decimal(my_decimal *to)
+ {
+ if (!has_value())
+ return NULL;
+ my_decimal_set_zero(to);
+ return to;
+ }
+ longlong val_int()
+ {
+ if (!has_value())
+ return 0;
+ return 0;
+ }
+ double val_real()
+ {
+ if (!has_value())
+ return 0;
+ return 0;
+ }
+ longlong val_datetime_packed(THD *thd)
+ {
+ DBUG_ASSERT(0);
+ if (!has_value())
+ return 0;
+ return 0;
+ }
+ longlong val_time_packed(THD *thd)
+ {
+ DBUG_ASSERT(0);
+ if (!has_value())
+ return 0;
+ return 0;
+ }
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ {
+ if (!has_value())
+ return true;
+ set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
+ return false;
+ }
+ bool val_native(THD *thd, Native *to)
+ {
+ if (!has_value())
+ return true;
+ return to->copy(m_value.ptr(), m_value.length());
+ }
+ };
+
+ class Item_literal_fbt: public Item_literal
+ {
+ Fbt m_value;
+ public:
+ Item_literal_fbt(THD *thd)
+ :Item_literal(thd),
+ m_value(Fbt::zero())
+ { }
+ Item_literal_fbt(THD *thd, const Fbt &value)
+ :Item_literal(thd),
+ m_value(value)
+ { }
+ const Type_handler *type_handler() const override
+ {
+ return type_handler_fbt();
+ }
+ longlong val_int() override
+ {
+ return 0;
+ }
+ double val_real() override
+ {
+ return 0;
+ }
+ String *val_str(String *to) override
+ {
+ return m_value.to_string(to) ? NULL : to;
+ }
+ my_decimal *val_decimal(my_decimal *to) override
+ {
+ my_decimal_set_zero(to);
+ return to;
+ }
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
+ {
+ set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
+ return false;
+ }
+ bool val_native(THD *thd, Native *to) override
+ {
+ return m_value.to_native(to);
+ }
+ void print(String *str, enum_query_type query_type) override
+ {
+ StringBuffer<FbtImpl::max_char_length()+64> tmp;
+ tmp.append(type_handler_fbt()->name().lex_cstring());
+ my_caseup_str(&my_charset_latin1, tmp.c_ptr());
+ str->append(tmp);
+ str->append('\'');
+ m_value.to_string(&tmp);
+ str->append(tmp);
+ str->append('\'');
+ }
+ Item *get_copy(THD *thd) override
+ { return get_item_copy<Item_literal_fbt>(thd, this); }
+
+ // Non-overriding methods
+ void set_value(const Fbt &value)
+ {
+ m_value= value;
+ }
+ };
+
+ class Item_copy_fbt: public Item_copy
+ {
+ NativeBuffer<Fbt::binary_length()+1> m_value;
+ public:
+ Item_copy_fbt(THD *thd, Item *item_arg): Item_copy(thd, item_arg) {}
+
+ bool val_native(THD *thd, Native *to) override
+ {
+ if (null_value)
+ return true;
+ return to->copy(m_value.ptr(), m_value.length());
+ }
+ String *val_str(String *to) override
+ {
+ if (null_value)
+ return NULL;
+ Fbt_null tmp(m_value.ptr(), m_value.length());
+ return tmp.is_null() || tmp.to_string(to) ? NULL : to;
+ }
+ my_decimal *val_decimal(my_decimal *to) override
+ {
+ my_decimal_set_zero(to);
+ return to;
+ }
+ double val_real() override
+ {
+ return 0;
+ }
+ longlong val_int() override
+ {
+ return 0;
+ }
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
+ {
+ set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
+ return null_value;
+ }
+ void copy() override
+ {
+ null_value= item->val_native(current_thd, &m_value);
+ DBUG_ASSERT(null_value == item->null_value);
+ }
+ int save_in_field(Field *field, bool no_conversions) override
+ {
+ return Item::save_in_field(field, no_conversions);
+ }
+ Item *get_copy(THD *thd) override
+ { return get_item_copy<Item_copy_fbt>(thd, this); }
+ };
+
+ class in_fbt :public in_vector
+ {
+ Fbt m_value;
+ static int cmp_fbt(void *cmp_arg, Fbt *a, Fbt *b)
+ {
+ return a->cmp(*b);
+ }
+ public:
+ in_fbt(THD *thd, uint elements)
+ :in_vector(thd, elements, sizeof(Fbt), (qsort2_cmp) cmp_fbt, 0),
+ m_value(Fbt::zero())
+ { }
+ const Type_handler *type_handler() const override
+ {
+ return type_handler_fbt();
+ }
+ void set(uint pos, Item *item) override
+ {
+ Fbt *buff= &((Fbt *) base)[pos];
+ Fbt_null value(item);
+ if (value.is_null())
+ *buff= Fbt::zero();
+ else
+ *buff= value;
+ }
+ uchar *get_value(Item *item) override
+ {
+ Fbt_null value(item);
+ if (value.is_null())
+ return 0;
+ m_value= value;
+ return (uchar *) &m_value;
+ }
+ Item* create_item(THD *thd) override
+ {
+ return new (thd->mem_root) Item_literal_fbt(thd);
+ }
+ void value_to_item(uint pos, Item *item) override
+ {
+ const Fbt &buff= (((Fbt*) base)[pos]);
+ static_cast<Item_literal_fbt*>(item)->set_value(buff);
+ }
+ };
+
+ class Item_char_typecast_func_handler_fbt_to_binary:
+ public Item_handled_func::Handler_str
+ {
+ public:
+ const Type_handler *return_type_handler(const Item_handled_func *item)
+ const override
+ {
+ if (item->max_length > MAX_FIELD_VARCHARLENGTH)
+ return Type_handler::blob_type_handler(item->max_length);
+ if (item->max_length > 255)
+ return &type_handler_varchar;
+ return &type_handler_string;
+ }
+ bool fix_length_and_dec(Item_handled_func *xitem) const override
+ {
+ return false;
+ }
+ String *val_str(Item_handled_func *item, String *to) const override
+ {
+ DBUG_ASSERT(dynamic_cast<const Item_char_typecast*>(item));
+ return static_cast<Item_char_typecast*>(item)->
+ val_str_binary_from_native(to);
+ }
+ };
+
+ class Type_collection_fbt: public Type_collection
+ {
+ const Type_handler *aggregate_common(const Type_handler *a,
+ const Type_handler *b) const
+ {
+ if (a == b)
+ return a;
+ return NULL;
+ }
+ const Type_handler *aggregate_if_string(const Type_handler *a,
+ const Type_handler *b) const
+ {
+ static const Type_aggregator::Pair agg[]=
+ {
+ {type_handler_fbt(), &type_handler_null, type_handler_fbt()},
+ {type_handler_fbt(), &type_handler_varchar, type_handler_fbt()},
+ {type_handler_fbt(), &type_handler_string, type_handler_fbt()},
+ {type_handler_fbt(), &type_handler_tiny_blob, type_handler_fbt()},
+ {type_handler_fbt(), &type_handler_blob, type_handler_fbt()},
+ {type_handler_fbt(), &type_handler_medium_blob, type_handler_fbt()},
+ {type_handler_fbt(), &type_handler_long_blob, type_handler_fbt()},
+ {type_handler_fbt(), &type_handler_hex_hybrid, type_handler_fbt()},
+ {NULL,NULL,NULL}
+ };
+ return Type_aggregator::find_handler_in_array(agg, a, b, true);
+ }
+ public:
+ const Type_handler *aggregate_for_result(const Type_handler *a,
+ const Type_handler *b)
+ const override
+ {
+ const Type_handler *h;
+ if ((h= aggregate_common(a, b)) ||
+ (h= aggregate_if_string(a, b)))
+ return h;
+ return NULL;
+ }
+
+ const Type_handler *aggregate_for_min_max(const Type_handler *a,
+ const Type_handler *b)
+ const override
+ {
+ return aggregate_for_result(a, b);
+ }
+
+ const Type_handler *aggregate_for_comparison(const Type_handler *a,
+ const Type_handler *b)
+ const override
+ {
+ if (const Type_handler *h= aggregate_common(a, b))
+ return h;
+ static const Type_aggregator::Pair agg[]=
+ {
+ {type_handler_fbt(), &type_handler_null, type_handler_fbt()},
+ {type_handler_fbt(), &type_handler_long_blob, type_handler_fbt()},
+ {NULL,NULL,NULL}
+ };
+ return Type_aggregator::find_handler_in_array(agg, a, b, true);
+ }
+
+ const Type_handler *aggregate_for_num_op(const Type_handler *a,
+ const Type_handler *b)
+ const override
+ {
+ return NULL;
+ }
+
+ const Type_handler *handler_by_name(const LEX_CSTRING &name) const override
+ {
+ if (type_handler_fbt()->name().eq(name))
+ return type_handler_fbt();
+ return NULL;
+ }
+ };
+ static Type_handler_fbt *type_handler_fbt()
+ {
+ static Type_handler_fbt th;
+ return &th;
+ }
+};
+
+#endif /* SQL_TYPE_FIXEDBIN_H */
diff --git a/sql/sql_type_fixedbin_storage.h b/sql/sql_type_fixedbin_storage.h
new file mode 100644
index 00000000000..6e18335bd4c
--- /dev/null
+++ b/sql/sql_type_fixedbin_storage.h
@@ -0,0 +1,173 @@
+#ifndef SQL_TYPE_FIXEDBIN_STORAGE
+#define SQL_TYPE_FIXEDBIN_STORAGE
+/* Copyright (c) 2019,2021 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 Foundation; version 2 of the License.
+
+ 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.
+
+ 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-1335 USA */
+
+/*
+ This is a common code for plugin (?) types that are generally
+ handled like strings, but have their own fixed size on-disk binary storage
+ format and their own (variable size) canonical string representation.
+
+ Examples are INET6 and UUID types.
+
+ The MariaDB server uses three binary representations of a data type:
+
+ 1. In-memory binary representation (user visible)
+ This representation:
+ - can be used in INSERT..VALUES (X'AABBCC')
+ - can be used in WHERE conditions: WHERE c1=X'AABBCC'
+ - is returned by CAST(x AS BINARY(N))
+ - is returned by Field::val_native() and Item::val_native()
+
+ 2. In-record binary representation (user invisible)
+ This representation:
+ - is used in records (is pointed by Field::ptr)
+ - must be comparable by memcmp()
+
+ 3. Binlog binary (row) representation
+ Usually, for string data types the binlog representation
+ is based on the in-record representation with trailing byte compression:
+ - trailing space compression for text string data types
+ - trailing zero compression for binary string data types
+
+ We have to have separate in-memory and in-record representations
+ because we use HA_KEYTYPE_BINARY for indexing. The engine API
+ does not have a way to pass a comparison function as a parameter.
+
+ The default implementation below assumes that:
+ - the in-memory and in-record representations are equal
+ - the binlog representation is compatible with BINARY(N)
+ This is OK for simple data types, like INET6.
+
+ Data type implementations that need different representations
+ can override the default implementation (like e.g. UUID does).
+*/
+
+/***********************************************************************/
+
+template<size_t NATIVE_LEN, size_t MAX_CHAR_LEN>
+class FixedBinTypeStorage
+{
+protected:
+ // The buffer that stores the in-memory binary representation
+ char m_buffer[NATIVE_LEN];
+
+ // Non-initializing constructor
+ FixedBinTypeStorage()
+ { }
+
+ FixedBinTypeStorage & set_zero()
+ {
+ bzero(&m_buffer, sizeof(m_buffer));
+ return *this;
+ }
+public:
+
+ // Initialize from the in-memory binary representation
+ FixedBinTypeStorage(const char *str, size_t length)
+ {
+ if (length != binary_length())
+ set_zero();
+ else
+ memcpy(&m_buffer, str, sizeof(m_buffer));
+ }
+
+ // Return the buffer with the in-memory representation
+ Lex_cstring to_lex_cstring() const
+ {
+ return Lex_cstring(m_buffer, sizeof(m_buffer));
+ }
+
+ static constexpr uint binary_length() { return NATIVE_LEN; }
+ static constexpr uint max_char_length() { return MAX_CHAR_LEN; }
+
+ // Compare the in-memory binary representations of two values
+ static int cmp(const LEX_CSTRING &a, const LEX_CSTRING &b)
+ {
+ DBUG_ASSERT(a.length == binary_length());
+ DBUG_ASSERT(b.length == binary_length());
+ return memcmp(a.str, b.str, b.length);
+ }
+
+ /*
+ Convert from the in-memory to the in-record representation.
+ Used in Field::store_native().
+ */
+ static void memory_to_record(char *to, const char *from)
+ {
+ memcpy(to, from, NATIVE_LEN);
+ }
+ /*
+ Convert from the in-record to the in-memory representation
+ Used in Field::val_native().
+ */
+ static void record_to_memory(char *to, const char *from)
+ {
+ memcpy(to, from, NATIVE_LEN);
+ }
+
+ /*
+ Hash the in-record representation
+ Used in Field::hash().
+ */
+ static void hash_record(const uchar *ptr, ulong *nr, ulong *nr2)
+ {
+ my_charset_bin.hash_sort(ptr, binary_length(), nr, nr2);
+ }
+
+ static bool only_zero_bytes(const char *ptr, size_t length)
+ {
+ for (uint i= 0 ; i < length; i++)
+ {
+ if (ptr[i] != 0)
+ return false;
+ }
+ return true;
+ }
+
+ static ulong KEY_pack_flags(uint column_nr)
+ {
+ /*
+ Return zero by default. A particular data type can override
+ this method return some flags, e.g. HA_PACK_KEY to enable
+ key prefix compression.
+ */
+ return 0;
+ }
+
+ /*
+ Convert from the in-record to the binlog representation.
+ Used in Field::pack(), and in filesort to store the addon fields.
+ By default, do what BINARY(N) does.
+ */
+ static uchar *pack(uchar *to, const uchar *from, uint max_length)
+ {
+ return StringPack(&my_charset_bin, binary_length()).pack(to, from, max_length);
+ }
+
+ /*
+ Convert from the in-binary-log to the in-record representation.
+ Used in Field::unpack().
+ By default, do what BINARY(N) does.
+ */
+ static const uchar *unpack(uchar *to, const uchar *from, const uchar *from_end,
+ uint param_data)
+ {
+ return StringPack(&my_charset_bin, binary_length()).unpack(to, from, from_end,
+ param_data);
+ }
+
+};
+#endif /* SQL_TYPE_FIXEDBIN_STORAGE */
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 454fed52242..4da967bb115 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -271,7 +271,7 @@ static void prepare_record_for_error_message(int error, TABLE *table)
DBUG_VOID_RETURN;
/* Create unique_map with all fields used by that index. */
- my_bitmap_init(&unique_map, unique_map_buf, table->s->fields, FALSE);
+ my_bitmap_init(&unique_map, unique_map_buf, table->s->fields);
table->mark_index_columns(keynr, &unique_map);
/* Subtract read_set and write_set. */
@@ -1003,6 +1003,7 @@ update_begin:
THD_STAGE_INFO(thd, stage_updating);
fix_rownum_pointers(thd, thd->lex->current_select, &updated_or_same);
+ thd->get_stmt_da()->reset_current_row_for_warning(1);
while (!(error=info.read_record()) && !thd->killed)
{
explain->tracker.on_record_read();
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 172ea82b1a6..eb1fee2a00c 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -770,6 +770,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> CATALOG_NAME_SYM /* SQL-2003-N */
%token <kwd> CHAIN_SYM /* SQL-2003-N */
%token <kwd> CHANGED
+%token <kwd> CHANNEL_SYM
%token <kwd> CHARSET
%token <kwd> CHECKPOINT_SYM
%token <kwd> CHECKSUM_SYM
@@ -1452,7 +1453,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
field_options last_field_options
%type <ulonglong_number>
- ulonglong_num real_ulonglong_num size_number
+ ulonglong_num real_ulonglong_num
%type <longlong_number>
longlong_num
@@ -2070,6 +2071,7 @@ change:
Lex->sql_command = SQLCOM_CHANGE_MASTER;
}
master_defs
+ optional_for_channel
{}
;
@@ -2301,6 +2303,34 @@ connection_name:
}
;
+optional_for_channel:
+ /* empty */
+ {
+ /*do nothing */
+ }
+ | for_channel
+
+ ;
+
+for_channel:
+ FOR_SYM CHANNEL_SYM TEXT_STRING_sys
+ {
+ if (Lex->mi.connection_name.str != NULL)
+ {
+ my_yyabort_error((ER_WRONG_ARGUMENTS, MYF(0), "CONNECTION_NAME AND FOR CHANNEL CAN NOT BE SPECIFIED AT THE SAME TIME)"));
+ }
+ else
+ {
+ Lex->mi.connection_name= $3;
+#ifdef HAVE_REPLICATION
+ if (unlikely(check_master_connection_name(&$3)))
+ my_yyabort_error((ER_WRONG_ARGUMENTS, MYF(0), "MASTER_CONNECTION_NAME"));
+#endif
+ }
+
+ }
+ ;
+
/* create a table */
create:
@@ -2543,14 +2573,6 @@ create:
$1 | $3)))
MYSQL_YYABORT;
}
- | CREATE LOGFILE_SYM GROUP_SYM logfile_group_info
- {
- Lex->alter_tablespace_info->ts_cmd_type= CREATE_LOGFILE_GROUP;
- }
- | CREATE TABLESPACE tablespace_info
- {
- Lex->alter_tablespace_info->ts_cmd_type= CREATE_TABLESPACE;
- }
| create_or_replace { Lex->set_command(SQLCOM_CREATE_SERVER, $1); }
server_def
{ }
@@ -3467,6 +3489,8 @@ signal_condition_information_item_name:
{ $$= DIAG_MESSAGE_TEXT; }
| MYSQL_ERRNO_SYM
{ $$= DIAG_MYSQL_ERRNO; }
+ | ROW_NUMBER_SYM
+ { $$= DIAG_ROW_NUMBER; }
;
resignal_stmt:
@@ -3547,6 +3571,11 @@ simple_target_specification:
}
| '@' ident_or_text
{
+ if (!$2.length)
+ {
+ thd->parse_error();
+ MYSQL_YYABORT;
+ }
$$= new (thd->mem_root) Item_func_get_user_var(thd, &$2);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
@@ -3623,6 +3652,8 @@ condition_information_item_name:
{ $$= Condition_information_item::MYSQL_ERRNO; }
| RETURNED_SQLSTATE_SYM
{ $$= Condition_information_item::RETURNED_SQLSTATE; }
+ | ROW_NUMBER_SYM
+ { $$= Condition_information_item::ROW_NUMBER; }
;
sp_decl_ident:
@@ -4322,350 +4353,6 @@ trg_event:
| DELETE_SYM
{ Lex->trg_chistics.event= TRG_EVENT_DELETE; }
;
-/*
- This part of the parser contains common code for all TABLESPACE
- commands.
- CREATE TABLESPACE name ...
- ALTER TABLESPACE name CHANGE DATAFILE ...
- ALTER TABLESPACE name ADD DATAFILE ...
- ALTER TABLESPACE name access_mode
- CREATE LOGFILE GROUP_SYM name ...
- ALTER LOGFILE GROUP_SYM name ADD UNDOFILE ..
- ALTER LOGFILE GROUP_SYM name ADD REDOFILE ..
- DROP TABLESPACE name
- DROP LOGFILE GROUP_SYM name
-*/
-change_tablespace_access:
- tablespace_name
- ts_access_mode
- ;
-
-change_tablespace_info:
- tablespace_name
- CHANGE ts_datafile
- change_ts_option_list
- ;
-
-tablespace_info:
- tablespace_name
- ADD ts_datafile
- opt_logfile_group_name
- tablespace_option_list
- ;
-
-opt_logfile_group_name:
- /* empty */ {}
- | USE_SYM LOGFILE_SYM GROUP_SYM ident
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->logfile_group_name= $4.str;
- }
- ;
-
-alter_tablespace_info:
- tablespace_name
- ADD ts_datafile
- alter_tablespace_option_list
- {
- Lex->alter_tablespace_info->ts_alter_tablespace_type= ALTER_TABLESPACE_ADD_FILE;
- }
- | tablespace_name
- DROP ts_datafile
- alter_tablespace_option_list
- {
- Lex->alter_tablespace_info->ts_alter_tablespace_type= ALTER_TABLESPACE_DROP_FILE;
- }
- ;
-
-logfile_group_info:
- logfile_group_name
- add_log_file
- logfile_group_option_list
- ;
-
-alter_logfile_group_info:
- logfile_group_name
- add_log_file
- alter_logfile_group_option_list
- ;
-
-add_log_file:
- ADD lg_undofile
- | ADD lg_redofile
- ;
-
-change_ts_option_list:
- /* empty */ {}
- change_ts_options
- ;
-
-change_ts_options:
- change_ts_option
- | change_ts_options change_ts_option
- | change_ts_options ',' change_ts_option
- ;
-
-change_ts_option:
- opt_ts_initial_size
- | opt_ts_autoextend_size
- | opt_ts_max_size
- ;
-
-tablespace_option_list:
- tablespace_options
- ;
-
-tablespace_options:
- tablespace_option
- | tablespace_options tablespace_option
- | tablespace_options ',' tablespace_option
- ;
-
-tablespace_option:
- opt_ts_initial_size
- | opt_ts_autoextend_size
- | opt_ts_max_size
- | opt_ts_extent_size
- | opt_ts_nodegroup
- | opt_ts_engine
- | ts_wait
- | opt_ts_comment
- ;
-
-alter_tablespace_option_list:
- alter_tablespace_options
- ;
-
-alter_tablespace_options:
- alter_tablespace_option
- | alter_tablespace_options alter_tablespace_option
- | alter_tablespace_options ',' alter_tablespace_option
- ;
-
-alter_tablespace_option:
- opt_ts_initial_size
- | opt_ts_autoextend_size
- | opt_ts_max_size
- | opt_ts_engine
- | ts_wait
- ;
-
-logfile_group_option_list:
- logfile_group_options
- ;
-
-logfile_group_options:
- logfile_group_option
- | logfile_group_options logfile_group_option
- | logfile_group_options ',' logfile_group_option
- ;
-
-logfile_group_option:
- opt_ts_initial_size
- | opt_ts_undo_buffer_size
- | opt_ts_redo_buffer_size
- | opt_ts_nodegroup
- | opt_ts_engine
- | ts_wait
- | opt_ts_comment
- ;
-
-alter_logfile_group_option_list:
- alter_logfile_group_options
- ;
-
-alter_logfile_group_options:
- alter_logfile_group_option
- | alter_logfile_group_options alter_logfile_group_option
- | alter_logfile_group_options ',' alter_logfile_group_option
- ;
-
-alter_logfile_group_option:
- opt_ts_initial_size
- | opt_ts_engine
- | ts_wait
- ;
-
-
-ts_datafile:
- DATAFILE_SYM TEXT_STRING_sys
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->data_file_name= $2.str;
- }
- ;
-
-lg_undofile:
- UNDOFILE_SYM TEXT_STRING_sys
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->undo_file_name= $2.str;
- }
- ;
-
-lg_redofile:
- REDOFILE_SYM TEXT_STRING_sys
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->redo_file_name= $2.str;
- }
- ;
-
-tablespace_name:
- ident
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info= (new (thd->mem_root)
- st_alter_tablespace());
- if (unlikely(lex->alter_tablespace_info == NULL))
- MYSQL_YYABORT;
- lex->alter_tablespace_info->tablespace_name= $1.str;
- lex->sql_command= SQLCOM_ALTER_TABLESPACE;
- }
- ;
-
-logfile_group_name:
- ident
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info= (new (thd->mem_root)
- st_alter_tablespace());
- if (unlikely(lex->alter_tablespace_info == NULL))
- MYSQL_YYABORT;
- lex->alter_tablespace_info->logfile_group_name= $1.str;
- lex->sql_command= SQLCOM_ALTER_TABLESPACE;
- }
- ;
-
-ts_access_mode:
- READ_ONLY_SYM
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->ts_access_mode= TS_READ_ONLY;
- }
- | READ_WRITE_SYM
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->ts_access_mode= TS_READ_WRITE;
- }
- | NOT_SYM ACCESSIBLE_SYM
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->ts_access_mode= TS_NOT_ACCESSIBLE;
- }
- ;
-
-opt_ts_initial_size:
- INITIAL_SIZE_SYM opt_equal size_number
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->initial_size= $3;
- }
- ;
-
-opt_ts_autoextend_size:
- AUTOEXTEND_SIZE_SYM opt_equal size_number
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->autoextend_size= $3;
- }
- ;
-
-opt_ts_max_size:
- MAX_SIZE_SYM opt_equal size_number
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->max_size= $3;
- }
- ;
-
-opt_ts_extent_size:
- EXTENT_SIZE_SYM opt_equal size_number
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->extent_size= $3;
- }
- ;
-
-opt_ts_undo_buffer_size:
- UNDO_BUFFER_SIZE_SYM opt_equal size_number
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->undo_buffer_size= $3;
- }
- ;
-
-opt_ts_redo_buffer_size:
- REDO_BUFFER_SIZE_SYM opt_equal size_number
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->redo_buffer_size= $3;
- }
- ;
-
-opt_ts_nodegroup:
- NODEGROUP_SYM opt_equal real_ulong_num
- {
- LEX *lex= Lex;
- if (unlikely(lex->alter_tablespace_info->nodegroup_id != UNDEF_NODEGROUP))
- my_yyabort_error((ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0),"NODEGROUP"));
- lex->alter_tablespace_info->nodegroup_id= $3;
- }
- ;
-
-opt_ts_comment:
- COMMENT_SYM opt_equal TEXT_STRING_sys
- {
- LEX *lex= Lex;
- if (unlikely(lex->alter_tablespace_info->ts_comment != NULL))
- my_yyabort_error((ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0),"COMMENT"));
- lex->alter_tablespace_info->ts_comment= $3.str;
- }
- ;
-
-opt_ts_engine:
- opt_storage ENGINE_SYM opt_equal storage_engines
- {
- LEX *lex= Lex;
- if (unlikely(lex->alter_tablespace_info->storage_engine != NULL))
- my_yyabort_error((ER_FILEGROUP_OPTION_ONLY_ONCE, MYF(0),
- "STORAGE ENGINE"));
- lex->alter_tablespace_info->storage_engine= $4;
- }
- ;
-
-opt_ts_wait:
- /* empty */
- | ts_wait
- ;
-
-ts_wait:
- WAIT_SYM
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->wait_until_completed= TRUE;
- }
- | NO_WAIT_SYM
- {
- LEX *lex= Lex;
- if (unlikely(!(lex->alter_tablespace_info->wait_until_completed)))
- my_yyabort_error((ER_FILEGROUP_OPTION_ONLY_ONCE,MYF(0),"NO_WAIT"));
- lex->alter_tablespace_info->wait_until_completed= FALSE;
- }
- ;
-
-size_number:
- real_ulonglong_num { $$= $1;}
- | IDENT_sys
- {
- if ($1.to_size_number(&$$))
- MYSQL_YYABORT;
- }
- ;
-
-/*
- End tablespace part
-*/
create_body:
create_field_list_parens
@@ -5039,8 +4726,13 @@ part_def_list:
| part_def_list ',' part_definition {}
;
+opt_partition:
+ /* empty */
+ | PARTITION_SYM
+ ;
+
part_definition:
- PARTITION_SYM
+ opt_partition
{
partition_info *part_info= Lex->part_info;
partition_element *p_elem= new (thd->mem_root) partition_element();
@@ -5386,7 +5078,7 @@ opt_part_option_list:
opt_part_option:
TABLESPACE opt_equal ident_or_text
- { Lex->part_info->curr_part_elem->tablespace_name= $3.str; }
+ { /* Compatibility with MySQL */ }
| opt_storage ENGINE_SYM opt_equal storage_engines
{
partition_info *part_info= Lex->part_info;
@@ -5725,7 +5417,7 @@ create_table_option:
Lex->create_info.used_fields|= HA_CREATE_USED_INDEXDIR;
}
| TABLESPACE ident
- {Lex->create_info.tablespace= $2.str;}
+ { /* Compatiblity with MySQL */ }
| STORAGE_SYM DISK_SYM
{Lex->create_info.storage_media= HA_SM_DISK;}
| STORAGE_SYM MEMORY_SYM
@@ -5794,7 +5486,7 @@ versioning_option:
{
if (unlikely(Lex->create_info.options & HA_LEX_CREATE_TMP_TABLE))
{
- if (DBUG_EVALUATE_IF("sysvers_force", 0, 1))
+ if (!DBUG_IF("sysvers_force"))
{
my_error(ER_VERS_NOT_SUPPORTED, MYF(0), "CREATE TEMPORARY TABLE");
MYSQL_YYABORT;
@@ -7377,26 +7069,6 @@ alter:
Lex->pop_select(); //main select
}
- | ALTER TABLESPACE alter_tablespace_info
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->ts_cmd_type= ALTER_TABLESPACE;
- }
- | ALTER LOGFILE_SYM GROUP_SYM alter_logfile_group_info
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->ts_cmd_type= ALTER_LOGFILE_GROUP;
- }
- | ALTER TABLESPACE change_tablespace_info
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->ts_cmd_type= CHANGE_FILE_TABLESPACE;
- }
- | ALTER TABLESPACE change_tablespace_access
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->ts_cmd_type= ALTER_ACCESS_MODE_TABLESPACE;
- }
| ALTER SERVER_SYM ident_or_text
{
LEX *lex= Lex;
@@ -7630,6 +7302,54 @@ alter_commands:
if (Lex->stmt_alter_table_exchange_partition($6))
MYSQL_YYABORT;
}
+ | CONVERT_SYM PARTITION_SYM alt_part_name_item
+ TO_SYM TABLE_SYM table_ident have_partitioning
+ {
+ LEX *lex= Lex;
+ if (Lex->stmt_alter_table($6))
+ MYSQL_YYABORT;
+ lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_alter_table();
+ if (unlikely(lex->m_sql_cmd == NULL))
+ MYSQL_YYABORT;
+ lex->alter_info.partition_flags|= ALTER_PARTITION_CONVERT_OUT;
+ }
+ | CONVERT_SYM TABLE_SYM table_ident
+ {
+ LEX *lex= Lex;
+ if (!lex->first_select_lex()->add_table_to_list(thd, $3, nullptr, 0,
+ TL_READ_NO_INSERT,
+ MDL_SHARED_NO_WRITE))
+ MYSQL_YYABORT;
+
+ /*
+ This will appear as (new_db, new_name) in alter_ctx.
+ new_db will be IX-locked and new_name X-locked.
+ */
+ lex->first_select_lex()->db= $3->db;
+ lex->name= $3->table;
+ if (lex->first_select_lex()->db.str == NULL &&
+ lex->copy_db_to(&lex->first_select_lex()->db))
+ MYSQL_YYABORT;
+
+ lex->part_info= new (thd->mem_root) partition_info();
+ if (unlikely(!lex->part_info))
+ MYSQL_YYABORT;
+
+ lex->part_info->num_parts= 1;
+ /*
+ OR-ed with ALTER_PARTITION_ADD because too many checks of
+ ALTER_PARTITION_ADD required.
+ */
+ lex->alter_info.partition_flags|= ALTER_PARTITION_ADD |
+ ALTER_PARTITION_CONVERT_IN;
+ }
+ TO_SYM PARTITION_SYM part_definition
+ {
+ LEX *lex= Lex;
+ lex->m_sql_cmd= new (thd->mem_root) Sql_cmd_alter_table();
+ if (unlikely(lex->m_sql_cmd == NULL))
+ MYSQL_YYABORT;
+ }
;
remove_partitioning:
@@ -7878,17 +7598,9 @@ alter_list_item:
}
| RENAME opt_to table_ident
{
- LEX *lex=Lex;
- lex->first_select_lex()->db= $3->db;
- if (lex->first_select_lex()->db.str == NULL &&
- lex->copy_db_to(&lex->first_select_lex()->db))
+ if (Lex->stmt_alter_table($3))
MYSQL_YYABORT;
- if (unlikely(check_table_name($3->table.str,$3->table.length,
- FALSE)) ||
- ($3->db.str && unlikely(check_db_name((LEX_STRING*) &$3->db))))
- my_yyabort_error((ER_WRONG_TABLE_NAME, MYF(0), $3->table.str));
- lex->name= $3->table;
- lex->alter_info.flags|= ALTER_RENAME;
+ Lex->alter_info.flags|= ALTER_RENAME;
}
| RENAME COLUMN_SYM opt_if_exists_table_element ident TO_SYM ident
{
@@ -8055,7 +7767,7 @@ opt_to:
;
slave:
- START_SYM SLAVE optional_connection_name slave_thread_opts
+ START_SYM SLAVE optional_connection_name slave_thread_opts optional_for_channel
{
LEX *lex=Lex;
lex->sql_command = SQLCOM_SLAVE_START;
@@ -8072,7 +7784,7 @@ slave:
/* If you change this code don't forget to update STOP SLAVE too */
}
{}
- | STOP_SYM SLAVE optional_connection_name slave_thread_opts
+ | STOP_SYM SLAVE optional_connection_name slave_thread_opts optional_for_channel
{
LEX *lex=Lex;
lex->sql_command = SQLCOM_SLAVE_STOP;
@@ -11295,6 +11007,11 @@ variable_aux:
ident_or_text SET_VAR expr
{
Item_func_set_user_var *item;
+ if (!$1.length)
+ {
+ thd->parse_error();
+ MYSQL_YYABORT;
+ }
$$= item= new (thd->mem_root) Item_func_set_user_var(thd, &$1, $3);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
@@ -11304,6 +11021,11 @@ variable_aux:
}
| ident_or_text
{
+ if (!$1.length)
+ {
+ thd->parse_error();
+ MYSQL_YYABORT;
+ }
$$= new (thd->mem_root) Item_func_get_user_var(thd, &$1);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
@@ -12957,6 +12679,12 @@ select_var_ident: select_outvar
select_outvar:
'@' ident_or_text
{
+ if (!$2.length)
+ {
+ thd->parse_error();
+ MYSQL_YYABORT;
+ }
+
$$ = Lex->result ? new (thd->mem_root) my_var_user(&$2) : NULL;
}
| ident_or_text
@@ -13105,16 +12833,6 @@ drop:
lex->set_command(SQLCOM_DROP_TRIGGER, $3);
lex->spname= $4;
}
- | DROP TABLESPACE tablespace_name opt_ts_engine opt_ts_wait
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->ts_cmd_type= DROP_TABLESPACE;
- }
- | DROP LOGFILE_SYM GROUP_SYM logfile_group_name opt_ts_engine opt_ts_wait
- {
- LEX *lex= Lex;
- lex->alter_tablespace_info->ts_cmd_type= DROP_LOGFILE_GROUP;
- }
| DROP SERVER_SYM opt_if_exists ident_or_text
{
Lex->set_command(SQLCOM_DROP_SERVER, $3);
@@ -13219,6 +12937,8 @@ insert:
{
Lex->sql_command= SQLCOM_INSERT;
Lex->duplicates= DUP_ERROR;
+ thd->get_stmt_da()->opt_clear_warning_info(thd->query_id);
+ thd->get_stmt_da()->reset_current_row_for_warning(1);
}
insert_start insert_lock_option opt_ignore opt_into insert_table
{
@@ -13228,6 +12948,7 @@ insert:
stmt_end
{
Lex->mark_first_table_as_inserting();
+ thd->get_stmt_da()->reset_current_row_for_warning(0);
}
;
@@ -13236,6 +12957,8 @@ replace:
{
Lex->sql_command = SQLCOM_REPLACE;
Lex->duplicates= DUP_REPLACE;
+ thd->get_stmt_da()->opt_clear_warning_info(thd->query_id);
+ thd->get_stmt_da()->reset_current_row_for_warning(1);
}
insert_start replace_lock_option opt_into insert_table
{
@@ -13245,6 +12968,7 @@ replace:
stmt_end
{
Lex->mark_first_table_as_inserting();
+ thd->get_stmt_da()->reset_current_row_for_warning(0);
}
;
@@ -13396,6 +13120,7 @@ no_braces:
opt_values ')'
{
LEX *lex=Lex;
+ thd->get_stmt_da()->inc_current_row_for_warning();
if (unlikely(lex->many_values.push_back(lex->insert_list,
thd->mem_root)))
MYSQL_YYABORT;
@@ -13411,6 +13136,7 @@ no_braces_with_names:
opt_values_with_names ')'
{
LEX *lex=Lex;
+ thd->get_stmt_da()->inc_current_row_for_warning();
if (unlikely(lex->many_values.push_back(lex->insert_list,
thd->mem_root)))
MYSQL_YYABORT;
@@ -13972,7 +13698,8 @@ show_param:
LEX *lex= Lex;
lex->sql_command= SQLCOM_SHOW_RELAYLOG_EVENTS;
}
- opt_global_limit_clause
+ opt_global_limit_clause optional_for_channel
+ { }
| keys_or_index from_or_in table_ident opt_db opt_where_clause
{
LEX *lex= Lex;
@@ -14117,16 +13844,7 @@ show_param:
MYSQL_YYABORT;
Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
}
- | SLAVE STATUS_SYM
- {
- LEX *lex= thd->lex;
- lex->mi.connection_name= null_clex_str;
- if (!(lex->m_sql_cmd= new (thd->mem_root)
- Sql_cmd_show_slave_status()))
- MYSQL_YYABORT;
- lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
- }
- | SLAVE connection_name STATUS_SYM
+ | SLAVE optional_connection_name STATUS_SYM optional_for_channel
{
if (!(Lex->m_sql_cmd= new (thd->mem_root)
Sql_cmd_show_slave_status()))
@@ -14511,7 +14229,7 @@ flush_option:
{ Lex->type|= REFRESH_SLOW_LOG; }
| BINARY LOGS_SYM opt_delete_gtid_domain
{ Lex->type|= REFRESH_BINARY_LOG; }
- | RELAY LOGS_SYM optional_connection_name
+ | RELAY LOGS_SYM optional_connection_name optional_for_channel
{
LEX *lex= Lex;
if (unlikely(lex->type & REFRESH_RELAY_LOG))
@@ -14662,7 +14380,8 @@ reset_options:
reset_option:
SLAVE { Lex->type|= REFRESH_SLAVE; }
optional_connection_name
- slave_reset_options { }
+ slave_reset_options optional_for_channel
+ { }
| MASTER_SYM
{
Lex->type|= REFRESH_MASTER;
@@ -14952,6 +14671,12 @@ field_or_var:
simple_ident_nospvar {$$= $1;}
| '@' ident_or_text
{
+ if (!$2.length)
+ {
+ thd->parse_error();
+ MYSQL_YYABORT;
+ }
+
$$= new (thd->mem_root) Item_user_var_as_out_param(thd, &$2);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
@@ -15959,6 +15684,7 @@ keyword_sp_var_and_label:
| CASCADED
| CATALOG_NAME_SYM
| CHAIN_SYM
+ | CHANNEL_SYM
| CHANGED
| CIPHER_SYM
| CLIENT_SYM
@@ -16766,6 +16492,12 @@ option_value_no_option_type:
}
| '@' ident_or_text equal
{
+ if (!$2.length)
+ {
+ thd->parse_error();
+ MYSQL_YYABORT;
+ }
+
if (sp_create_assignment_lex(thd, $1.str))
MYSQL_YYABORT;
}
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 114714acfe6..f2a498a95d0 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -740,6 +740,23 @@ static Sys_var_charptr_fscs Sys_character_sets_dir(
READ_ONLY GLOBAL_VAR(charsets_dir), CMD_LINE(REQUIRED_ARG),
DEFAULT(0));
+static bool check_engine_supports_temporary(sys_var *self, THD *thd, set_var *var)
+{
+ plugin_ref plugin= var->save_result.plugin;
+ if (!plugin)
+ return false;
+ DBUG_ASSERT(plugin);
+ handlerton *hton= plugin_hton(plugin);
+ DBUG_ASSERT(hton);
+ if (ha_check_storage_engine_flag(hton, HTON_TEMPORARY_NOT_SUPPORTED))
+ {
+ my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0), hton_name(hton)->str,
+ "TEMPORARY");
+ return true;
+ }
+ return false;
+}
+
static bool check_not_null(sys_var *self, THD *thd, set_var *var)
{
return var->value && var->value->is_null();
@@ -4260,7 +4277,8 @@ static Sys_var_plugin Sys_storage_engine(
static Sys_var_plugin Sys_default_tmp_storage_engine(
"default_tmp_storage_engine", "The default storage engine for user-created temporary tables",
SESSION_VAR(tmp_table_plugin), NO_CMD_LINE,
- MYSQL_STORAGE_ENGINE_PLUGIN, DEFAULT(&default_tmp_storage_engine));
+ MYSQL_STORAGE_ENGINE_PLUGIN, DEFAULT(&default_tmp_storage_engine),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_engine_supports_temporary));
static Sys_var_plugin Sys_enforce_storage_engine(
"enforce_storage_engine", "Force the use of a storage engine for new tables",
@@ -6036,16 +6054,6 @@ static Sys_var_mybool Sys_wsrep_desync (
ON_CHECK(wsrep_desync_check),
ON_UPDATE(wsrep_desync_update));
-static Sys_var_mybool Sys_wsrep_strict_ddl (
- "wsrep_strict_ddl",
- "If set, reject DDL on affected tables not supporting Galera replication",
- GLOBAL_VAR(wsrep_strict_ddl),
- CMD_LINE(OPT_ARG), DEFAULT(FALSE),
- NO_MUTEX_GUARD, NOT_IN_BINLOG,
- ON_CHECK(0),
- ON_UPDATE(wsrep_strict_ddl_update),
- DEPRECATED("'@@wsrep_mode=STRICT_REPLICATION'")); // since 10.6.0
-
static const char *wsrep_reject_queries_names[]= { "NONE", "ALL", "ALL_KILL", NullS };
static Sys_var_enum Sys_wsrep_reject_queries(
"wsrep_reject_queries", "Variable to set to reject queries",
@@ -6066,13 +6074,6 @@ static Sys_var_mybool Sys_wsrep_recover_datadir(
READ_ONLY GLOBAL_VAR(wsrep_recovery),
CMD_LINE(OPT_ARG), DEFAULT(FALSE));
-static Sys_var_mybool Sys_wsrep_replicate_myisam(
- "wsrep_replicate_myisam", "To enable myisam replication",
- GLOBAL_VAR(wsrep_replicate_myisam), CMD_LINE(OPT_ARG), DEFAULT(FALSE),
- NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
- ON_UPDATE(wsrep_replicate_myisam_update),
- DEPRECATED("'@@wsrep_mode=REPLICATE_MYISAM'")); // since 10.6.0
-
static Sys_var_mybool Sys_wsrep_log_conflicts(
"wsrep_log_conflicts", "To log multi-master conflicts",
GLOBAL_VAR(wsrep_log_conflicts), CMD_LINE(OPT_ARG), DEFAULT(FALSE));
diff --git a/sql/table.cc b/sql/table.cc
index 2682641ea43..f6f293290cd 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -2666,11 +2666,9 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
{
auto field_type= handler->real_field_type();
- if (DBUG_EVALUATE_IF("error_vers_wrong_type", 1, 0))
- field_type= MYSQL_TYPE_BLOB;
+ DBUG_EXECUTE_IF("error_vers_wrong_type", field_type= MYSQL_TYPE_BLOB;);
- switch (field_type)
- {
+ switch (field_type) {
case MYSQL_TYPE_TIMESTAMP2:
break;
case MYSQL_TYPE_LONGLONG:
@@ -3349,7 +3347,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
share->column_bitmap_size *
bitmap_count)))
goto err;
- my_bitmap_init(&share->all_set, bitmaps, share->fields, FALSE);
+ my_bitmap_init(&share->all_set, bitmaps, share->fields);
bitmap_set_all(&share->all_set);
if (share->check_set)
{
@@ -3360,7 +3358,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
my_bitmap_init(share->check_set,
(my_bitmap_map*) ((uchar*) bitmaps +
share->column_bitmap_size),
- share->fields, FALSE);
+ share->fields);
bitmap_clear_all(share->check_set);
}
@@ -4378,26 +4376,26 @@ partititon_err:
goto err;
my_bitmap_init(&outparam->def_read_set,
- (my_bitmap_map*) bitmaps, share->fields, FALSE);
+ (my_bitmap_map*) bitmaps, share->fields);
bitmaps+= bitmap_size;
my_bitmap_init(&outparam->def_write_set,
- (my_bitmap_map*) bitmaps, share->fields, FALSE);
+ (my_bitmap_map*) bitmaps, share->fields);
bitmaps+= bitmap_size;
my_bitmap_init(&outparam->has_value_set,
- (my_bitmap_map*) bitmaps, share->fields, FALSE);
+ (my_bitmap_map*) bitmaps, share->fields);
bitmaps+= bitmap_size;
my_bitmap_init(&outparam->tmp_set,
- (my_bitmap_map*) bitmaps, share->fields, FALSE);
+ (my_bitmap_map*) bitmaps, share->fields);
bitmaps+= bitmap_size;
my_bitmap_init(&outparam->eq_join_set,
- (my_bitmap_map*) bitmaps, share->fields, FALSE);
+ (my_bitmap_map*) bitmaps, share->fields);
bitmaps+= bitmap_size;
my_bitmap_init(&outparam->cond_set,
- (my_bitmap_map*) bitmaps, share->fields, FALSE);
+ (my_bitmap_map*) bitmaps, share->fields);
bitmaps+= bitmap_size;
my_bitmap_init(&outparam->def_rpl_write_set,
- (my_bitmap_map*) bitmaps, share->fields, FALSE);
+ (my_bitmap_map*) bitmaps, share->fields);
outparam->default_column_bitmaps();
outparam->cond_selectivity= 1.0;
@@ -9841,6 +9839,9 @@ bool TR_table::update(ulonglong start_id, ulonglong end_id)
int error= table->file->ha_write_row(table->record[0]);
if (unlikely(error))
table->file->print_error(error, MYF(0));
+ /* extra() is used to apply the bulk insert operation
+ on mysql/transaction_registry table */
+ table->file->extra(HA_EXTRA_IGNORE_INSERT);
return error;
}
diff --git a/sql/thread_pool_info.cc b/sql/thread_pool_info.cc
index 90ac6871784..e3ffd160a11 100644
--- a/sql/thread_pool_info.cc
+++ b/sql/thread_pool_info.cc
@@ -14,9 +14,9 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/
#include <mysql_version.h>
-#include <mysql/plugin.h>
#include <my_global.h>
+#include <mysql/plugin.h>
#include <sql_class.h>
#include <sql_i_s.h>
#include <mysql/plugin.h>
diff --git a/sql/tztime.cc b/sql/tztime.cc
index e121790ab93..d7d8c1e0b6b 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -2526,7 +2526,7 @@ scan_tz_dir(char * name_end, uint symlink_recursion_level, uint verbose)
{
MY_DIR *cur_dir;
char *name_end_tmp;
- uint i;
+ size_t i;
/* Sort directory data, to pass mtr tests on different platforms. */
if (!(cur_dir= my_dir(fullname, MYF(MY_WANT_STAT|MY_WANT_SORT))))
diff --git a/sql/uniques.cc b/sql/uniques.cc
index a0cebe3e4dd..572d80f0b64 100644
--- a/sql/uniques.cc
+++ b/sql/uniques.cc
@@ -709,7 +709,7 @@ bool Unique::merge(TABLE *table, uchar *buff, size_t buff_size,
{
IO_CACHE *outfile= &sort.io_cache;
Merge_chunk *file_ptr= (Merge_chunk*) file_ptrs.buffer;
- uint maxbuffer= file_ptrs.elements - 1;
+ uint maxbuffer= (uint)file_ptrs.elements - 1;
my_off_t save_pos;
bool error= 1;
Sort_param sort_param;
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index b3d6176f8b2..f43e641c8f3 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -90,7 +90,6 @@ my_bool wsrep_drupal_282555_workaround; // Retry autoinc insert after du
my_bool wsrep_certify_nonPK; // Certify, even when no primary key
ulong wsrep_certification_rules = WSREP_CERTIFICATION_RULES_STRICT;
my_bool wsrep_recovery; // Recovery
-my_bool wsrep_replicate_myisam; // Enable MyISAM replication
my_bool wsrep_log_conflicts;
my_bool wsrep_load_data_splitting= 0; // Commit load data every 10K intervals
my_bool wsrep_slave_UK_checks; // Slave thread does UK checks
@@ -100,9 +99,6 @@ my_bool wsrep_restart_slave; // Should mysql slave thread be
my_bool wsrep_desync; // De(re)synchronize the node from the
// cluster
ulonglong wsrep_mode;
-my_bool wsrep_strict_ddl; // Deprecated: Reject DDL to
- // effected tables not
- // supporting Galera replication
bool wsrep_service_started; // If Galera was initialized
long wsrep_slave_threads; // No. of slave appliers threads
ulong wsrep_retry_autocommit; // Retry aborted autocommit trx
@@ -1692,6 +1688,7 @@ wsrep_append_fk_parent_table(THD* thd, TABLE_LIST* tables, wsrep::key_array* key
{
bool fail= false;
TABLE_LIST *table;
+ TABLE_LIST *table_last_in_list;
for (table= tables; table; table= table->next_local)
{
@@ -1707,6 +1704,12 @@ wsrep_append_fk_parent_table(THD* thd, TABLE_LIST* tables, wsrep::key_array* key
uint counter;
MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
+ for (table_last_in_list= tables;;table_last_in_list= table_last_in_list->next_local) {
+ if (!table_last_in_list->next_local) {
+ break;
+ }
+ }
+
if (open_tables(thd, &tables, &counter, MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL))
{
WSREP_DEBUG("Unable to open table for FK checks for %s", wsrep_thd_query(thd));
@@ -1737,11 +1740,19 @@ exit:
/* close the table and release MDL locks */
close_thread_tables(thd);
thd->mdl_context.rollback_to_savepoint(mdl_savepoint);
+ bool invalidate_next_global= false;
for (table= tables; table; table= table->next_local)
{
table->table= NULL;
- table->next_global= NULL;
table->mdl_request.ticket= NULL;
+ // We should invalidate `next_global` only for entries that are added
+ // in this function
+ if (table == table_last_in_list) {
+ invalidate_next_global= true;
+ }
+ if (invalidate_next_global) {
+ table->next_global= NULL;
+ }
}
return fail;
@@ -2650,6 +2661,8 @@ static int wsrep_TOI_begin(THD *thd, const char *db, const char *table,
}
thd_proc_info(thd, "acquiring total order isolation");
+ WSREP_DEBUG("wsrep_TOI_begin for %s", wsrep_thd_query(thd));
+ THD_STAGE_INFO(thd, stage_waiting_isolation);
wsrep::client_state& cs(thd->wsrep_cs());
@@ -2998,39 +3011,49 @@ void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx,
const MDL_ticket *ticket,
const MDL_key *key)
{
- /* Fallback to the non-wsrep behaviour */
- if (!WSREP_ON) return;
-
THD *request_thd= requestor_ctx->get_thd();
THD *granted_thd= ticket->get_ctx()->get_thd();
+ /* Fallback to the non-wsrep behaviour */
+ if (!WSREP(request_thd)) return;
+
const char* schema= key->db_name();
int schema_len= key->db_name_length();
mysql_mutex_lock(&request_thd->LOCK_thd_data);
- if (wsrep_thd_is_toi(request_thd) ||
- wsrep_thd_is_applying(request_thd)) {
+ if (wsrep_thd_is_toi(request_thd) ||
+ wsrep_thd_is_applying(request_thd))
+ {
+ WSREP_DEBUG("wsrep_handle_mdl_conflict request TOI/APPLY for %s",
+ wsrep_thd_query(request_thd));
+ THD_STAGE_INFO(request_thd, stage_waiting_isolation);
mysql_mutex_unlock(&request_thd->LOCK_thd_data);
WSREP_MDL_LOG(DEBUG, "MDL conflict ", schema, schema_len,
request_thd, granted_thd);
ticket->wsrep_report(wsrep_debug);
mysql_mutex_lock(&granted_thd->LOCK_thd_data);
+
if (wsrep_thd_is_toi(granted_thd) ||
wsrep_thd_is_applying(granted_thd))
{
if (wsrep_thd_is_aborting(granted_thd))
{
- WSREP_DEBUG("BF thread waiting for SR in aborting state");
+ WSREP_DEBUG("BF thread waiting for SR in aborting state for %s",
+ wsrep_thd_query(request_thd));
+ THD_STAGE_INFO(request_thd, stage_waiting_isolation);
ticket->wsrep_report(wsrep_debug);
mysql_mutex_unlock(&granted_thd->LOCK_thd_data);
}
else if (wsrep_thd_is_SR(granted_thd) && !wsrep_thd_is_SR(request_thd))
{
- WSREP_MDL_LOG(INFO, "MDL conflict, DDL vs SR",
+ WSREP_MDL_LOG(INFO, "MDL conflict, DDL vs SR",
schema, schema_len, request_thd, granted_thd);
mysql_mutex_unlock(&granted_thd->LOCK_thd_data);
+ WSREP_DEBUG("wsrep_handle_mdl_conflict DDL vs SR for %s",
+ wsrep_thd_query(request_thd));
+ THD_STAGE_INFO(request_thd, stage_waiting_isolation);
wsrep_abort_thd(request_thd, granted_thd, 1);
}
else
@@ -3045,14 +3068,18 @@ void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx,
else if (granted_thd->lex->sql_command == SQLCOM_FLUSH ||
granted_thd->mdl_context.has_explicit_locks())
{
- WSREP_DEBUG("BF thread waiting for FLUSH");
+ WSREP_DEBUG("BF thread waiting for FLUSH for %s",
+ wsrep_thd_query(request_thd));
+ THD_STAGE_INFO(request_thd, stage_waiting_ddl);
ticket->wsrep_report(wsrep_debug);
mysql_mutex_unlock(&granted_thd->LOCK_thd_data);
}
else if (request_thd->lex->sql_command == SQLCOM_DROP_TABLE)
{
- WSREP_DEBUG("DROP caused BF abort, conf %s",
- wsrep_thd_transaction_state_str(granted_thd));
+ WSREP_DEBUG("DROP caused BF abort, conf %s for %s",
+ wsrep_thd_transaction_state_str(granted_thd),
+ wsrep_thd_query(request_thd));
+ THD_STAGE_INFO(request_thd, stage_waiting_isolation);
ticket->wsrep_report(wsrep_debug);
mysql_mutex_unlock(&granted_thd->LOCK_thd_data);
wsrep_abort_thd(request_thd, granted_thd, 1);
@@ -3061,7 +3088,11 @@ void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx,
{
WSREP_MDL_LOG(DEBUG, "MDL conflict-> BF abort", schema, schema_len,
request_thd, granted_thd);
+ WSREP_DEBUG("wsrep_handle_mdl_conflict -> BF abort for %s",
+ wsrep_thd_query(request_thd));
+ THD_STAGE_INFO(request_thd, stage_waiting_isolation);
ticket->wsrep_report(wsrep_debug);
+
if (granted_thd->wsrep_trx().active())
{
mysql_mutex_unlock(&granted_thd->LOCK_thd_data);
@@ -3074,14 +3105,16 @@ void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx,
thd is BF, BF abort and wait.
*/
mysql_mutex_unlock(&granted_thd->LOCK_thd_data);
+
if (wsrep_thd_is_BF(request_thd, FALSE))
{
ha_abort_transaction(request_thd, granted_thd, TRUE);
}
else
{
- WSREP_MDL_LOG(INFO, "MDL unknown BF-BF conflict", schema, schema_len,
- request_thd, granted_thd);
+ WSREP_MDL_LOG(INFO, "MDL unknown BF-BF conflict",
+ schema, schema_len,
+ request_thd, granted_thd);
ticket->wsrep_report(true);
unireg_abort(1);
}
diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h
index 88c276e8719..88c0e84a1ee 100644
--- a/sql/wsrep_mysqld.h
+++ b/sql/wsrep_mysqld.h
@@ -85,7 +85,6 @@ extern ulong wsrep_forced_binlog_format;
extern my_bool wsrep_desync;
extern ulong wsrep_reject_queries;
extern my_bool wsrep_recovery;
-extern my_bool wsrep_replicate_myisam;
extern my_bool wsrep_log_conflicts;
extern ulong wsrep_mysql_replication_bundle;
extern my_bool wsrep_load_data_splitting;
@@ -103,7 +102,6 @@ extern bool wsrep_new_cluster;
extern bool wsrep_gtid_mode;
extern uint wsrep_gtid_domain_id;
extern ulonglong wsrep_mode;
-extern my_bool wsrep_strict_ddl;
enum enum_wsrep_reject_types {
WSREP_REJECT_NONE, /* nothing rejected */
diff --git a/sql/wsrep_trans_observer.h b/sql/wsrep_trans_observer.h
index f21eca47fa2..f99d33094df 100644
--- a/sql/wsrep_trans_observer.h
+++ b/sql/wsrep_trans_observer.h
@@ -1,4 +1,4 @@
-/* Copyright 2016-2019 Codership Oy <http://www.codership.com>
+/* Copyright 2016-2021 Codership Oy <http://www.codership.com>
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
@@ -276,12 +276,14 @@ static inline int wsrep_before_commit(THD* thd, bool all)
WSREP_DEBUG("wsrep_before_commit: %d, %lld",
wsrep_is_real(thd, all),
(long long)wsrep_thd_trx_seqno(thd));
+ THD_STAGE_INFO(thd, stage_waiting_certification);
int ret= 0;
DBUG_ASSERT(wsrep_run_commit_hook(thd, all));
+
if ((ret= thd->wsrep_cs().before_commit()) == 0)
{
DBUG_ASSERT(!thd->wsrep_trx().ws_meta().gtid().is_undefined());
- if (!thd->variables.gtid_seq_no &&
+ if (!thd->variables.gtid_seq_no &&
(thd->wsrep_trx().ws_meta().flags() & wsrep::provider::flag::commit))
{
uint64 seqno= 0;
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc
index 1790141b37d..178ec603e72 100644
--- a/sql/wsrep_var.cc
+++ b/sql/wsrep_var.cc
@@ -836,10 +836,11 @@ bool wsrep_desync_check (sys_var *self, THD* thd, set_var* var)
return true;
}
} else {
+ THD_STAGE_INFO(thd, stage_waiting_flow);
ret= Wsrep_server_state::instance().provider().resync();
if (ret != WSREP_OK) {
WSREP_WARN ("SET resync failed %d for schema: %s, query: %s", ret,
- thd->get_db(), thd->query());
+ thd->get_db(), wsrep_thd_query(thd));
my_error (ER_CANNOT_USER, MYF(0), "'resync'", thd->query());
return true;
}
@@ -1100,24 +1101,3 @@ bool wsrep_gtid_domain_id_update(sys_var* self, THD *thd, enum_var_type)
return false;
}
-bool wsrep_strict_ddl_update(sys_var *self, THD* thd, enum_var_type var_type)
-{
- // In case user still sets wsrep_strict_ddl we set new
- // option to wsrep_mode
- if (wsrep_strict_ddl)
- wsrep_mode|= WSREP_MODE_STRICT_REPLICATION;
- else
- wsrep_mode&= (~WSREP_MODE_STRICT_REPLICATION);
- return false;
-}
-
-bool wsrep_replicate_myisam_update(sys_var *self, THD* thd, enum_var_type var_type)
-{
- // In case user still sets wsrep_replicate_myisam we set new
- // option to wsrep_mode
- if (wsrep_replicate_myisam)
- wsrep_mode|= WSREP_MODE_REPLICATE_MYISAM;
- else
- wsrep_mode&= (~WSREP_MODE_REPLICATE_MYISAM);
- return false;
-}
diff --git a/sql/wsrep_var.h b/sql/wsrep_var.h
index 7908e873795..0f811d70928 100644
--- a/sql/wsrep_var.h
+++ b/sql/wsrep_var.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013 Codership Oy <info@codership.com>
+/* Copyright (C) 2013-2021 Codership Oy <info@codership.com>
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
@@ -109,8 +109,6 @@ extern bool wsrep_gtid_seq_no_check CHECK_ARGS;
extern bool wsrep_gtid_domain_id_update UPDATE_ARGS;
extern bool wsrep_mode_check CHECK_ARGS;
-extern bool wsrep_strict_ddl_update UPDATE_ARGS;
-extern bool wsrep_replicate_myisam_update UPDATE_ARGS;
#else /* WITH_WSREP */
#define wsrep_provider_init(X)
diff --git a/storage/columnstore/CMakeLists.txt b/storage/columnstore/CMakeLists.txt
index 6669862f038..ebb138c70f0 100644
--- a/storage/columnstore/CMakeLists.txt
+++ b/storage/columnstore/CMakeLists.txt
@@ -5,6 +5,10 @@ if("NO" STREQUAL "${PLUGIN_COLUMNSTORE}")
endif()
add_definitions(-DBOOST_BIND_GLOBAL_PLACEHOLDERS)
+IF(NOT PLUGIN_PERFSCHEMA STREQUAL NO)
+ add_definitions(-DHAVE_PSI_INTERFACE=)
+ENDIF()
+
# this does everything, gets the var from the correct scope, appends new
# values, sets in the correct scope
@@ -13,6 +17,11 @@ macro(APPEND_FOR_CPACK V)
set(${V} "${var}${ARGN}" PARENT_SCOPE)
endmacro()
+# don't use compression providers, there are standalone executables below
+GET_PROPERTY(dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+LIST(REMOVE_ITEM dirs ${CMAKE_SOURCE_DIR}/include/providers)
+SET_PROPERTY(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "${dirs}")
+
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64" OR
CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
diff --git a/storage/connect/bsonudf.cpp b/storage/connect/bsonudf.cpp
index f95ced5ab51..95d117113a2 100644
--- a/storage/connect/bsonudf.cpp
+++ b/storage/connect/bsonudf.cpp
@@ -9,6 +9,7 @@
/*********************************************************************************/
#include <my_global.h>
#include <mysqld.h>
+#include <mysqld_error.h>
#include <mysql.h>
#include <sql_error.h>
#include <stdio.h>
@@ -22,7 +23,7 @@
#define MEMFIX 4096
#if defined(connect_EXPORTS)
-#define PUSH_WARNING(M) push_warning(current_thd, Sql_condition::WARN_LEVEL_WARN, 0, M)
+#define PUSH_WARNING(M) push_warning(current_thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, M)
#else
#define PUSH_WARNING(M) htrc(M)
#endif
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index 9ac1571e5ac..bc3e9b0cbc7 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -516,7 +516,7 @@ void SetWorkSize(size_t)
{
// Changing the session variable value seems to be impossible here
// and should be done in a check function
- push_warning(current_thd, Sql_condition::WARN_LEVEL_WARN, 0,
+ push_warning(current_thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR,
"Work size too big, try setting a smaller value");
} // end of SetWorkSize
@@ -719,7 +719,7 @@ void PushWarning(PGLOBAL g, THD *thd, int level)
Sql_condition::enum_warning_level wlvl;
wlvl= (Sql_condition::enum_warning_level)level;
- push_warning(thd, wlvl, 0, g->Message);
+ push_warning(thd, wlvl, ER_UNKNOWN_ERROR, g->Message);
} else
htrc("%s\n", g->Message);
@@ -2298,7 +2298,7 @@ int ha_connect::MakeRecord(char *buf)
fp->field_name.str,
thd->get_stmt_da()->current_row_for_warning());
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, buf);
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, buf);
DBUG_PRINT("MakeRecord", ("%s", buf));
rc= 0;
} else if (rc < 0)
@@ -3591,7 +3591,7 @@ int ha_connect::optimize(THD* thd, HA_CHECK_OPT*)
if ((rc= ((PTDBASE)tdbp)->ResetTableOpt(g, dop, dox))) {
if (rc == RC_INFO) {
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, g->Message);
rc= 0;
} else
rc= HA_ERR_CRASHED_ON_USAGE; // Table must be repaired
@@ -4816,7 +4816,7 @@ int ha_connect::start_stmt(THD *thd, thr_lock_type lock_type)
if (newmode == MODE_ANY) {
if (CloseTable(g)) {
// Make error a warning to avoid crash
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, g->Message);
rc= 0;
} // endif Close
@@ -4898,18 +4898,18 @@ int ha_connect::external_lock(THD *thd, int lock_type)
&& sqlcom != SQLCOM_BEGIN
&& sqlcom != SQLCOM_DROP_TABLE) {
sprintf(g->Message, "external_lock: unexpected command %d", sqlcom);
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, g->Message);
DBUG_RETURN(0);
} else if (g->Xchk) {
if (!tdbp) {
if (!(tdbp= GetTDB(g))) {
// DBUG_RETURN(HA_ERR_INTERNAL_ERROR); causes assert error
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, g->Message);
DBUG_RETURN(0);
} else if (!tdbp->GetDef()->Indexable()) {
sprintf(g->Message, "external_lock: Table %s is not indexable", tdbp->GetName());
// DBUG_RETURN(HA_ERR_INTERNAL_ERROR); causes assert error
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, g->Message);
DBUG_RETURN(0);
} else if (tdbp->GetDef()->Indexable() == 1) {
bool oldsep= ((PCHK)g->Xchk)->oldsep;
@@ -4988,7 +4988,7 @@ int ha_connect::external_lock(THD *thd, int lock_type)
if (tdp->MakeIndex(g, adp, true) == RC_FX) {
// Make it a warning to avoid crash
//push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
- // 0, g->Message);
+ // ER_UNKNOWN_ERROR, g->Message);
//rc= 0;
my_message(ER_TOO_MANY_KEYS, g->Message, MYF(0));
rc= HA_ERR_INDEX_CORRUPT;
@@ -4998,7 +4998,7 @@ int ha_connect::external_lock(THD *thd, int lock_type)
if (CheckVirtualIndex(NULL)) {
// Make it a warning to avoid crash
push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
- 0, g->Message);
+ ER_UNKNOWN_ERROR, g->Message);
rc= 0;
} // endif Check
@@ -5011,7 +5011,7 @@ int ha_connect::external_lock(THD *thd, int lock_type)
if (CloseTable(g)) {
// This is an error while builing index
// Make it a warning to avoid crash
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, g->Message);
rc= 0;
} // endif Close
@@ -5722,7 +5722,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
topt->type= (src) ? "MYSQL" : (tab) ? "PROXY" : "DOS";
ttp= GetTypeID(topt->type);
snprintf(g->Message, sizeof(g->Message), "No table_type. Was set to %s", topt->type);
- push_warning(thd, Sql_condition::WARN_LEVEL_NOTE, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_NOTE, ER_UNKNOWN_ERROR, g->Message);
} else if (ttp == TAB_NIY) {
snprintf(g->Message, sizeof(g->Message), "Unsupported table type %s", topt->type);
rc= HA_ERR_INTERNAL_ERROR;
@@ -5732,7 +5732,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
if (ttp == TAB_UNDEF) {
ttr= TAB_JSON;
strcpy(g->Message, "No table_type. Was set to JSON");
- push_warning(thd, Sql_condition::WARN_LEVEL_NOTE, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_NOTE, ER_UNKNOWN_ERROR, g->Message);
} else
ttr= ttp;
@@ -6295,7 +6295,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
// Skip this column
sprintf(g->Message, "Column %s skipped (unsupported type %d)",
cnm, typ);
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, g->Message);
continue;
} else {
sprintf(g->Message, "Unsupported SQL type %d", typ);
@@ -6310,7 +6310,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
case TYPE_STRING:
if (w) {
sprintf(g->Message, "Column %s is wide characters", cnm);
- push_warning(thd, Sql_condition::WARN_LEVEL_NOTE, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_NOTE, ER_UNKNOWN_ERROR, g->Message);
} // endif w
break;
@@ -6337,7 +6337,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
// Skip this column
sprintf(g->Message, "Column %s skipped (unsupported type %d)",
cnm, typ);
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, g->Message);
continue;
} else {
sprintf(g->Message, "Unsupported SQL type %d", typ);
@@ -6502,7 +6502,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
sprintf(g->Message, "No table_type. Will be set to %s", options->type);
if (sqlcom == SQLCOM_CREATE_TABLE)
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, g->Message);
} else if (type == TAB_NIY) {
sprintf(g->Message, "Unsupported table type %s", options->type);
@@ -6551,7 +6551,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
case TAB_OCCUR:
if (options->srcdef) {
strcpy(g->Message, "Cannot check looping reference");
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, g->Message);
} else if (options->tabname) {
if (!stricmp(options->tabname, create_info->alias.str) &&
(!options->dbname ||
@@ -6847,7 +6847,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
sprintf(g->Message, "No file name. Table will use %s", buf);
if (sqlcom == SQLCOM_CREATE_TABLE)
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, g->Message);
strcat(strcat(strcpy(dbpath, "./"), table->s->db.str), "/");
} // endif part_info
@@ -6860,12 +6860,12 @@ int ha_connect::create(const char *name, TABLE *table_arg,
else
sprintf(g->Message, "Error %d creating file %s", errno, fn);
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, g->Message);
} else
::close(h);
if ((type == TAB_FMT || options->readonly) && sqlcom == SQLCOM_CREATE_TABLE)
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0,
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR,
"Congratulation, you just created a read-only void table!");
} // endif sqlcom
@@ -6911,7 +6911,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
sqlcom == SQLCOM_CREATE_INDEX || sqlcom == SQLCOM_DROP_INDEX))
// (sqlcom == SQLCOM_CREATE_INDEX && part_info) ||
// (sqlcom == SQLCOM_DROP_INDEX && part_info)))
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0,
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR,
"Unexpected command in create, please contact CONNECT team");
if (part_info && !inward)
@@ -6922,7 +6922,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
(!IsFileType(type) || FileExists(options->filename, false))) {
if (part_info) {
sprintf(g->Message, "Data repartition in %s is unchecked", partname);
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, g->Message);
} else if (sqlcom == SQLCOM_ALTER_TABLE) {
// This is an ALTER to CONNECT from another engine.
// It cannot be accepted because the table data would be modified
@@ -7035,7 +7035,7 @@ bool ha_connect::FileExists(const char *fn, bool bf)
char buf[_MAX_PATH + 20];
sprintf(buf, "Error %d for file %s", errno, filename);
- push_warning(table->in_use, Sql_condition::WARN_LEVEL_WARN, 0, buf);
+ push_warning(table->in_use, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, buf);
return true;
} else
return false;
@@ -7338,7 +7338,7 @@ fin:
DBUG_RETURN(HA_ALTER_ERROR);
} else if (outward) {
if (IsFileType(type))
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0,
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR,
"This is an outward table, table data were not modified.");
DBUG_RETURN(HA_ALTER_INPLACE_EXCLUSIVE_LOCK);
@@ -7364,7 +7364,7 @@ bool ha_connect::check_if_incompatible_data(HA_CREATE_INFO *, uint)
{
DBUG_ENTER("ha_connect::check_if_incompatible_data");
// TO DO: really implement and check it.
- push_warning(ha_thd(), Sql_condition::WARN_LEVEL_WARN, 0,
+ push_warning(ha_thd(), Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR,
"Unexpected call to check_if_incompatible_data.");
DBUG_RETURN(COMPATIBLE_DATA_NO);
} // end of check_if_incompatible_data
diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp
index 044846a6ceb..2b77061df5d 100644
--- a/storage/connect/jsonudf.cpp
+++ b/storage/connect/jsonudf.cpp
@@ -9,6 +9,7 @@
/*********************************************************************************/
#include <my_global.h>
#include <mysqld.h>
+#include <mysqld_error.h>
#include <mysql.h>
#include <sql_error.h>
#include <m_string.h>
@@ -21,7 +22,7 @@
#define MEMFIX 4096
#if defined(connect_EXPORTS)
-#define PUSH_WARNING(M) push_warning(current_thd, Sql_condition::WARN_LEVEL_WARN, 0, M)
+#define PUSH_WARNING(M) push_warning(current_thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, M)
#else
#define PUSH_WARNING(M) htrc(M)
#endif
diff --git a/storage/connect/tabrest.cpp b/storage/connect/tabrest.cpp
index 7e8b51714fb..c0c32533302 100644
--- a/storage/connect/tabrest.cpp
+++ b/storage/connect/tabrest.cpp
@@ -12,6 +12,7 @@
/***********************************************************************/
#include <my_global.h> // All MariaDB stuff
#include <mysqld.h>
+#include <mysqld_error.h>
#include <sql_error.h>
#if !defined(_WIN32) && !defined(_WINDOWS)
#include <sys/types.h>
@@ -37,7 +38,7 @@
#include "tabrest.h"
#if defined(connect_EXPORTS)
-#define PUSH_WARNING(M) push_warning(current_thd, Sql_condition::WARN_LEVEL_NOTE, 0, M)
+#define PUSH_WARNING(M) push_warning(current_thd, Sql_condition::WARN_LEVEL_NOTE, ER_UNKNOWN_ERROR, M)
#else
#define PUSH_WARNING(M) htrc(M)
#endif
diff --git a/storage/connect/tabutil.cpp b/storage/connect/tabutil.cpp
index 15305cc856b..9730f8a6981 100644
--- a/storage/connect/tabutil.cpp
+++ b/storage/connect/tabutil.cpp
@@ -205,7 +205,7 @@ PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db,
if (v == 'K') {
// Skip this column
sprintf(g->Message, "Column %s skipped (unsupported type)", colname);
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, g->Message);
continue;
} // endif v
@@ -218,7 +218,7 @@ PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db,
len = zconv;
sprintf(g->Message, "Column %s converted to varchar(%d)",
colname, len);
- push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
+ push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, g->Message);
} // endif v
crp = crp->Next; // Data_Type
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index ec569feec9d..e705ff0e7c0 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -1559,6 +1559,7 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
current_position= next_position= 0;
/* Read the file row-by-row. If everything is ok, repair is not needed. */
+ thd_inc_error_row(thd);
while (!(rc= find_current_row(buf)))
{
thd_inc_error_row(thd);
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc
index 8f2015070be..c66c33a7818 100644
--- a/storage/example/ha_example.cc
+++ b/storage/example/ha_example.cc
@@ -98,7 +98,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_config.h>
+#include <my_global.h>
#include <mysql/plugin.h>
#include "ha_example.h"
#include "sql_class.h"
diff --git a/storage/federatedx/federatedx_io_mysql.cc b/storage/federatedx/federatedx_io_mysql.cc
index d420de738b9..669a8faef63 100644
--- a/storage/federatedx/federatedx_io_mysql.cc
+++ b/storage/federatedx/federatedx_io_mysql.cc
@@ -211,7 +211,7 @@ ulong federatedx_io_mysql::last_savepoint() const
ulong federatedx_io_mysql::actual_savepoint() const
{
SAVEPT *savept= NULL;
- uint index= savepoints.elements;
+ size_t index= savepoints.elements;
DBUG_ENTER("federatedx_io_mysql::last_savepoint");
while (index)
@@ -285,7 +285,7 @@ ulong federatedx_io_mysql::savepoint_release(ulong sp)
ulong federatedx_io_mysql::savepoint_rollback(ulong sp)
{
SAVEPT *savept;
- uint index;
+ size_t index;
DBUG_ENTER("federatedx_io_mysql::savepoint_release");
DBUG_PRINT("info",("savepoint=%lu", sp));
@@ -320,7 +320,7 @@ ulong federatedx_io_mysql::savepoint_rollback(ulong sp)
void federatedx_io_mysql::savepoint_restrict(ulong sp)
{
SAVEPT *savept;
- uint index= savepoints.elements;
+ size_t index= savepoints.elements;
DBUG_ENTER("federatedx_io_mysql::savepoint_restrict");
while (index)
@@ -360,7 +360,7 @@ bool federatedx_io_mysql::test_all_restrict() const
{
bool result= FALSE;
SAVEPT *savept;
- uint index= savepoints.elements;
+ size_t index= savepoints.elements;
DBUG_ENTER("federatedx_io_mysql::test_all_restrict");
while (index)
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index c3fa33717f7..63add138703 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -377,8 +377,8 @@ btr_root_adjust_on_import(
} else {
/* Check that the table flags and the tablespace
flags match. */
- ulint tf = dict_tf_to_fsp_flags(table->flags);
- ulint sf = table->space->flags;
+ uint32_t tf = dict_tf_to_fsp_flags(table->flags);
+ uint32_t sf = table->space->flags;
sf &= ~FSP_FLAGS_MEM_MASK;
tf &= ~FSP_FLAGS_MEM_MASK;
if (fil_space_t::is_flags_equal(tf, sf)
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index adce2ed2b6f..3dfeb4aa060 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -6823,7 +6823,6 @@ btr_store_big_rec_extern_fields(
byte* field_ref;
ulint extern_len;
ulint store_len;
- ulint space_id;
ulint i;
mtr_t mtr;
mem_heap_t* heap = NULL;
@@ -6852,7 +6851,6 @@ btr_store_big_rec_extern_fields(
btr_blob_log_check_t redo_log(pcur, btr_mtr, offsets, &rec_block,
&rec, op);
page_zip = buf_block_get_page_zip(rec_block);
- space_id = rec_block->page.id().space();
if (page_zip) {
int err;
@@ -6975,6 +6973,7 @@ alloc_fail:
goto alloc_fail;
}
+ const uint32_t space_id = block->page.id().space();
const uint32_t page_no = block->page.id().page_no();
if (prev_page_no == FIL_NULL) {
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 6eb1b6d463a..2e901aab854 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -576,15 +576,12 @@ bool buf_is_zeroes(span<const byte> buf)
}
/** Check if a page is corrupt.
-@param[in] check_lsn whether the LSN should be checked
-@param[in] read_buf database page
-@param[in] fsp_flags tablespace flags
+@param check_lsn whether FIL_PAGE_LSN should be checked
+@param read_buf database page
+@param fsp_flags contents of FIL_SPACE_FLAGS
@return whether the page is corrupted */
-bool
-buf_page_is_corrupted(
- bool check_lsn,
- const byte* read_buf,
- ulint fsp_flags)
+bool buf_page_is_corrupted(bool check_lsn, const byte *read_buf,
+ uint32_t fsp_flags)
{
if (fil_space_t::full_crc32(fsp_flags)) {
bool compressed = false, corrupted = false;
@@ -4241,10 +4238,10 @@ buf_print_io(
/** Verify that post encryption checksum match with the calculated checksum.
This function should be called only if tablespace contains crypt data metadata.
-@param[in] page page frame
-@param[in] fsp_flags tablespace flags
-@return true if true if page is encrypted and OK, false otherwise */
-bool buf_page_verify_crypt_checksum(const byte* page, ulint fsp_flags)
+@param page page frame
+@param fsp_flags contents of FSP_SPACE_FLAGS
+@return whether the page is encrypted and valid */
+bool buf_page_verify_crypt_checksum(const byte *page, uint32_t fsp_flags)
{
if (!fil_space_t::full_crc32(fsp_flags)) {
return fil_space_verify_crypt_checksum(
diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc
index b9f505db56e..3c59955dbd8 100644
--- a/storage/innobase/buf/buf0dblwr.cc
+++ b/storage/innobase/buf/buf0dblwr.cc
@@ -363,7 +363,7 @@ void buf_dblwr_t::recover()
if (recv_sys.parse_start_lsn > lsn)
/* Pages written before the checkpoint are not useful for recovery. */
continue;
- const ulint space_id= page_get_space_id(page);
+ const uint32_t space_id= page_get_space_id(page);
const page_id_t page_id(space_id, page_no);
if (recv_sys.scanned_lsn < lsn)
diff --git a/storage/innobase/buf/buf0dump.cc b/storage/innobase/buf/buf0dump.cc
index 770bb74c90a..5027034e23a 100644
--- a/storage/innobase/buf/buf0dump.cc
+++ b/storage/innobase/buf/buf0dump.cc
@@ -632,7 +632,7 @@ buf_load()
/* Avoid calling the expensive fil_space_t::get() for each
page within the same tablespace. dump[] is sorted by (space, page),
so all pages from a given tablespace are consecutive. */
- ulint cur_space_id = dump[0].space();
+ uint32_t cur_space_id = dump[0].space();
fil_space_t* space = fil_space_t::get(cur_space_id);
ulint zip_size = space ? space->zip_size() : 0;
@@ -644,10 +644,9 @@ buf_load()
for (i = 0; i < dump_n && !SHUTTING_DOWN(); i++) {
/* space_id for this iteration of the loop */
- const ulint this_space_id = dump[i].space();
+ const uint32_t this_space_id = dump[i].space();
- if (this_space_id == SRV_TMP_SPACE_ID) {
- /* Ignore the innodb_temporary tablespace. */
+ if (this_space_id >= SRV_SPACE_ID_UPPER_BOUND) {
continue;
}
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
index cc2f72c9a62..89274dfc8b6 100644
--- a/storage/innobase/buf/buf0flu.cc
+++ b/storage/innobase/buf/buf0flu.cc
@@ -40,11 +40,8 @@ Created 11/11/1995 Heikki Tuuri
#include "log0crypt.h"
#include "srv0mon.h"
#include "fil0pagecompress.h"
-#ifdef HAVE_LZO
-# include "lzo/lzo1x.h"
-#elif defined HAVE_SNAPPY
-# include "snappy-c.h"
-#endif
+#include "lzo/lzo1x.h"
+#include "snappy-c.h"
/** Number of pages flushed via LRU. Protected by buf_pool.mutex.
Also included in buf_flush_page_count. */
@@ -215,7 +212,7 @@ deleting the data file of that tablespace.
The pages still remain a part of LRU and are evicted from
the list as they age towards the tail of the LRU.
@param id tablespace identifier */
-void buf_flush_remove_pages(ulint id)
+void buf_flush_remove_pages(uint32_t id)
{
const page_id_t first(id, 0), end(id + 1, 0);
ut_ad(id);
@@ -575,11 +572,10 @@ static void buf_tmp_reserve_compression_buf(buf_tmp_buffer_t* slot)
/* Both Snappy and LZO compression methods require that the output
buffer be bigger than input buffer. Adjust the allocated size. */
ulint size= srv_page_size;
-#ifdef HAVE_LZO
- size+= LZO1X_1_15_MEM_COMPRESS;
-#elif defined HAVE_SNAPPY
- size= snappy_max_compressed_length(size);
-#endif
+ if (provider_service_lzo->is_loaded)
+ size+= LZO1X_1_15_MEM_COMPRESS;
+ else if (provider_service_snappy->is_loaded)
+ size= snappy_max_compressed_length(size);
slot->comp_buf= static_cast<byte*>(aligned_malloc(size, srv_page_size));
}
diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc
index 05dde6e69e4..4eacc2c311c 100644
--- a/storage/innobase/buf/buf0rea.cc
+++ b/storage/innobase/buf/buf0rea.cc
@@ -662,11 +662,9 @@ inline bool fil_space_t::is_freed(uint32_t page)
}
/** Issues read requests for pages which recovery wants to read in.
-@param[in] space_id tablespace id
-@param[in] page_nos array of page numbers to read, with the
-highest page number the last in the array
-@param[in] n number of page numbers in the array */
-void buf_read_recv_pages(ulint space_id, const uint32_t* page_nos, ulint n)
+@param space_id tablespace identifier
+@param page_nos page numbers to read, in ascending order */
+void buf_read_recv_pages(uint32_t space_id, st_::span<uint32_t> page_nos)
{
fil_space_t* space = fil_space_t::get(space_id);
@@ -677,7 +675,7 @@ void buf_read_recv_pages(ulint space_id, const uint32_t* page_nos, ulint n)
const ulint zip_size = space->zip_size();
- for (ulint i = 0; i < n; i++) {
+ for (ulint i = 0; i < page_nos.size(); i++) {
/* Ignore if the page already present in freed ranges. */
if (space->is_freed(page_nos[i])) {
@@ -718,7 +716,7 @@ void buf_read_recv_pages(ulint space_id, const uint32_t* page_nos, ulint n)
}
- DBUG_PRINT("ib_buf", ("recovery read (%u pages) for %s", n,
- space->chain.start->name));
+ DBUG_PRINT("ib_buf", ("recovery read (%zu pages) for %s",
+ page_nos.size(), space->chain.start->name));
space->release();
}
diff --git a/storage/innobase/bzip2.cmake b/storage/innobase/bzip2.cmake
deleted file mode 100644
index 91dd2bf0fcd..00000000000
--- a/storage/innobase/bzip2.cmake
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2014, SkySQL Ab. All Rights Reserved.
-#
-# 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.
-#
-# 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.
-#
-# 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-1335 USA
-
-SET(WITH_INNODB_BZIP2 AUTO CACHE STRING
- "Build with bzip2. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'")
-
-MACRO (MYSQL_CHECK_BZIP2)
- IF (WITH_INNODB_BZIP2 STREQUAL "ON" OR WITH_INNODB_BZIP2 STREQUAL "AUTO")
- CHECK_INCLUDE_FILES(bzlib.h HAVE_BZLIB2_H)
- CHECK_LIBRARY_EXISTS(bz2 BZ2_bzBuffToBuffCompress "" HAVE_BZLIB2_COMPRESS)
- CHECK_LIBRARY_EXISTS(bz2 BZ2_bzBuffToBuffDecompress "" HAVE_BZLIB2_DECOMPRESS)
-
- IF (HAVE_BZLIB2_COMPRESS AND HAVE_BZLIB2_DECOMPRESS AND HAVE_BZLIB2_H)
- SET(HAVE_INNODB_BZLIB2 TRUE)
- ADD_DEFINITIONS(-DHAVE_BZIP2=1)
- LINK_LIBRARIES(bz2)
- ELSE()
- IF (WITH_INNODB_BZIP2 STREQUAL "ON")
- MESSAGE(FATAL_ERROR "Required bzip2 library is not found")
- ENDIF()
- ENDIF()
- ENDIF()
- ADD_FEATURE_INFO(INNODB_BZIP2 HAVE_INNODB_BZLIB2
- "BZIP2 compression in the InnoDB storage engine")
-ENDMACRO()
diff --git a/storage/innobase/dict/dict0boot.cc b/storage/innobase/dict/dict0boot.cc
index f1133bae3de..53cbde11328 100644
--- a/storage/innobase/dict/dict0boot.cc
+++ b/storage/innobase/dict/dict0boot.cc
@@ -54,7 +54,7 @@ dict_hdr_get_new_id(
(not assigned if NULL) */
index_id_t* index_id, /*!< out: index id
(not assigned if NULL) */
- ulint* space_id) /*!< out: space id
+ uint32_t* space_id) /*!< out: space id
(not assigned if NULL) */
{
ib_id_t id;
@@ -257,8 +257,8 @@ dberr_t dict_boot()
header. */
dict_sys.recover_row_id(mach_read_from_8(dict_hdr + DICT_HDR_ROW_ID));
- if (ulint max_space_id = mach_read_from_4(dict_hdr
- + DICT_HDR_MAX_SPACE_ID)) {
+ if (uint32_t max_space_id
+ = mach_read_from_4(dict_hdr + DICT_HDR_MAX_SPACE_ID)) {
max_space_id--;
fil_assign_new_space_id(&max_space_id);
}
diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc
index 4b175229971..586de840cb5 100644
--- a/storage/innobase/dict/dict0crea.cc
+++ b/storage/innobase/dict/dict0crea.cc
@@ -348,8 +348,8 @@ dict_build_table_def_step(
dict_table_t* table = node->table;
ut_ad(!table->is_temporary());
ut_ad(!table->space);
- ut_ad(table->space_id == ULINT_UNDEFINED);
- dict_hdr_get_new_id(&table->id, NULL, NULL);
+ ut_ad(table->space_id == UINT32_MAX);
+ dict_hdr_get_new_id(&table->id, nullptr, nullptr);
/* Always set this bit for all new created tables */
DICT_TF2_FLAG_SET(table, DICT_TF2_FTS_AUX_HEX_NAME);
@@ -367,10 +367,10 @@ dict_build_table_def_step(
DBUG_EXECUTE_IF(
"ib_create_table_fail_out_of_space_ids",
- table->space_id = ULINT_UNDEFINED;
+ table->space_id = UINT32_MAX;
);
- if (table->space_id == ULINT_UNDEFINED) {
+ if (table->space_id == UINT32_MAX) {
return DB_ERROR;
}
} else {
@@ -1098,8 +1098,6 @@ dict_create_table_step(
}
if (node->state == TABLE_ADD_TO_CACHE) {
- DBUG_EXECUTE_IF("ib_ddl_crash_during_create", DBUG_SUICIDE(););
-
node->table->can_be_evicted = true;
node->table->add_to_cache();
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index be2d3517547..ff16204a022 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -1065,8 +1065,18 @@ dict_table_open_on_name(
if (!(ignore_err & ~DICT_ERR_IGNORE_FK_NOKEY) &&
!table->is_readable() && table->corrupted)
{
- ib::error() << "Table " << table->name
- << " is corrupted. Please drop the table and recreate.";
+ ulint algo = table->space->get_compression_algo();
+ if (algo <= PAGE_ALGORITHM_LAST && !fil_comp_algo_loaded(algo)) {
+ my_printf_error(ER_PROVIDER_NOT_LOADED,
+ "Table %s is compressed with %s, which is not currently loaded. "
+ "Please load the %s provider plugin to open the table",
+ MYF(ME_ERROR_LOG), table->name,
+ page_compression_algorithms[algo], page_compression_algorithms[algo]);
+ } else {
+ my_printf_error(ER_TABLE_CORRUPT,
+ "Table %s is corrupted. Please drop the table and recreate.",
+ MYF(ME_ERROR_LOG), table->name);
+ }
dict_sys.unfreeze();
DBUG_RETURN(nullptr);
}
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc
index eb886a5554e..7afab64bc33 100644
--- a/storage/innobase/dict/dict0load.cc
+++ b/storage/innobase/dict/dict0load.cc
@@ -608,11 +608,10 @@ dict_sys_tables_type_valid(ulint type, bool not_redundant)
@param[in] not_redundant whether ROW_FORMAT=REDUNDANT is not used
@return table flags */
static
-ulint
-dict_sys_tables_type_to_tf(ulint type, bool not_redundant)
+uint32_t dict_sys_tables_type_to_tf(uint32_t type, bool not_redundant)
{
ut_ad(dict_sys_tables_type_valid(type, not_redundant));
- ulint flags = not_redundant ? 1 : 0;
+ uint32_t flags = not_redundant ? 1 : 0;
/* ZIP_SSIZE, ATOMIC_BLOBS, DATA_DIR, PAGE_COMPRESSION,
PAGE_COMPRESSION_LEVEL are the same. */
@@ -648,15 +647,14 @@ dict_sys_tables_rec_read(
const rec_t* rec,
mtr_t* mtr,
table_id_t* table_id,
- ulint* space_id,
- ulint* n_cols,
- ulint* flags,
- ulint* flags2,
+ uint32_t* space_id,
+ uint32_t* n_cols,
+ uint32_t* flags,
+ uint32_t* flags2,
trx_id_t* trx_id)
{
const byte* field;
ulint len;
- ulint type;
mem_heap_t* heap = nullptr;
field = rec_get_nth_field_old(
@@ -714,7 +712,7 @@ dict_sys_tables_rec_read(
field = rec_get_nth_field_old(
rec, DICT_FLD__SYS_TABLES__TYPE, &len);
ut_a(len == 4);
- type = mach_read_from_4(field);
+ uint32_t type = mach_read_from_4(field);
/* Handle MDEV-12873 InnoDB SYS_TABLES.TYPE incompatibility
for PAGE_COMPRESSED=YES in MariaDB 10.2.2 to 10.2.6.
@@ -805,8 +803,8 @@ dict_sys_tables_rec_read(
if (!dict_sys_tables_type_valid(type, not_redundant)) {
sql_print_error("InnoDB: Table %.*s in InnoDB"
" data dictionary contains invalid flags."
- " SYS_TABLES.TYPE=" ULINTPF
- " SYS_TABLES.N_COLS=" ULINTPF,
+ " SYS_TABLES.TYPE=" UINT32PF
+ " SYS_TABLES.N_COLS=" UINT32PF,
int(rec_get_field_start_offs(rec, 1)), rec,
type, *n_cols);
err_exit:
@@ -835,8 +833,8 @@ err_exit:
sql_print_error("InnoDB: Table %.*s in InnoDB"
" data dictionary"
" contains invalid flags."
- " SYS_TABLES.TYPE=" ULINTPF
- " SYS_TABLES.MIX_LEN=" ULINTPF,
+ " SYS_TABLES.TYPE=" UINT32PF
+ " SYS_TABLES.MIX_LEN=" UINT32PF,
int(rec_get_field_start_offs(rec, 1)),
rec,
type, *flags2);
@@ -872,7 +870,7 @@ was needed and force_recovery is not set.
We also scan the biggest space id, and store it to fil_system. */
void dict_check_tablespaces_and_store_max_id()
{
- ulint max_space_id = 0;
+ uint32_t max_space_id = 0;
btr_pcur_t pcur;
mtr_t mtr;
@@ -887,10 +885,10 @@ void dict_check_tablespaces_and_store_max_id()
rec; rec = dict_getnext_system_low(&pcur, &mtr)) {
ulint len;
table_id_t table_id;
- ulint space_id;
- ulint n_cols;
- ulint flags;
- ulint flags2;
+ uint32_t space_id;
+ uint32_t n_cols;
+ uint32_t flags;
+ uint32_t flags2;
/* If a table record is not useable, ignore it and continue
on to the next record. Error messages were logged. */
@@ -2126,13 +2124,9 @@ const char *dict_load_table_low(mtr_t *mtr,
const rec_t *rec, dict_table_t **table)
{
table_id_t table_id;
- ulint space_id;
- ulint n_cols;
- ulint t_num;
- ulint flags;
- ulint flags2;
+ uint32_t space_id, t_num, flags, flags2;
+ ulint n_cols, n_v_col;
trx_id_t trx_id;
- ulint n_v_col;
if (const char* error_text = dict_sys_tables_rec_check(rec)) {
*table = NULL;
diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc
index 54eaa87a850..0da0c5acf0f 100644
--- a/storage/innobase/dict/dict0mem.cc
+++ b/storage/innobase/dict/dict0mem.cc
@@ -162,7 +162,7 @@ dict_table_t *dict_table_t::create(const span<const char> &name,
table->mdl_name.m_name= table->name.m_name;
table->is_system_db= dict_mem_table_is_system(table->name.m_name);
table->space= space;
- table->space_id= space ? space->id : ULINT_UNDEFINED;
+ table->space_id= space ? space->id : UINT32_MAX;
table->n_t_cols= static_cast<unsigned>(n_cols + DATA_N_SYS_COLS) &
dict_index_t::MAX_N_FIELDS;
table->n_v_cols= static_cast<unsigned>(n_v_cols) &
diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc
index ff0b64f9b12..31d2a73466e 100644
--- a/storage/innobase/dict/dict0stats.cc
+++ b/storage/innobase/dict/dict0stats.cc
@@ -3235,6 +3235,11 @@ unlocked_free_and_exit:
}
}
+ ret= trx->bulk_insert_apply();
+ if (ret != DB_SUCCESS) {
+ goto rollback_and_exit;
+ }
+
trx->commit();
goto free_and_exit;
}
@@ -3835,6 +3840,13 @@ dict_stats_update(
return(DB_SUCCESS);
}
+ if (trx_id_t bulk_trx_id = table->bulk_trx_id) {
+ if (trx_sys.find(nullptr, bulk_trx_id, false)) {
+ dict_stats_empty_table(table, false);
+ return DB_SUCCESS;
+ }
+ }
+
switch (stats_upd_option) {
case DICT_STATS_RECALC_PERSISTENT:
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index 6c8498f96a3..e15210bddf3 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -767,20 +767,20 @@ static dberr_t fil_space_decrypt_for_non_full_checksum(
/** Decrypt a page.
@param[in] space_id tablespace id
+@param[in] fsp_flags Tablespace flags
@param[in] crypt_data crypt_data
@param[in] tmp_frame Temporary buffer
@param[in] physical_size page size
-@param[in] fsp_flags Tablespace flags
@param[in,out] src_frame Page to decrypt
@param[out] err DB_SUCCESS or DB_DECRYPTION_FAILED
@return DB_SUCCESS or error */
dberr_t
fil_space_decrypt(
- ulint space_id,
+ uint32_t space_id,
+ uint32_t fsp_flags,
fil_space_crypt_t* crypt_data,
byte* tmp_frame,
ulint physical_size,
- ulint fsp_flags,
byte* src_frame)
{
if (fil_space_t::full_crc32(fsp_flags)) {
@@ -811,9 +811,10 @@ fil_space_decrypt(
ut_ad(space->crypt_data != NULL && space->crypt_data->is_encrypted());
ut_ad(space->referenced());
- if (DB_SUCCESS != fil_space_decrypt(space->id, space->crypt_data,
+ if (DB_SUCCESS != fil_space_decrypt(space->id, space->flags,
+ space->crypt_data,
tmp_frame, physical_size,
- space->flags, src_frame)) {
+ src_frame)) {
return nullptr;
}
@@ -1386,7 +1387,7 @@ inline fil_space_t *fil_system_t::default_encrypt_next(fil_space_t *space,
mysql_mutex_assert_owner(&mutex);
auto it= space && space->is_in_default_encrypt
- ? sized_ilist<fil_space_t, rotation_list_tag_t>::iterator(space)
+ ? sized_ilist<fil_space_t, default_encrypt_tag_t>::iterator(space)
: default_encrypt_tables.begin();
const auto end= default_encrypt_tables.end();
@@ -1876,7 +1877,7 @@ fil_crypt_rotate_pages(
const key_state_t* key_state,
rotate_thread_t* state)
{
- ulint space_id = state->space->id;
+ const uint32_t space_id = state->space->id;
uint32_t end = std::min(state->offset + uint32_t(state->batch),
state->space->free_limit);
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 07f77add744..c0720f36c86 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -54,21 +54,18 @@ Created 10/25/1995 Heikki Tuuri
# include <dirent.h>
#endif
+#include "lz4.h"
+#include "lzo/lzo1x.h"
+#include "lzma.h"
+#include "bzlib.h"
+#include "snappy-c.h"
+
ATTRIBUTE_COLD void fil_space_t::set_corrupted() const
{
if (!is_stopping() && !is_corrupted.test_and_set())
sql_print_error("InnoDB: File '%s' is corrupted", chain.start->name);
}
-/** Determine if the space id is a user tablespace id or not.
-@param space_id tablespace identifier
-@return true if it is a user tablespace ID */
-inline bool fil_is_user_tablespace_id(ulint space_id)
-{
- return space_id != TRX_SYS_SPACE && space_id != SRV_TMP_SPACE_ID &&
- !srv_is_undo_tablespace(space_id);
-}
-
/** Try to close a file to adhere to the innodb_open_files limit.
@param print_info whether to diagnose why a file cannot be closed
@return whether a file was closed */
@@ -83,7 +80,7 @@ bool fil_space_t::try_to_close(bool print_info)
case FIL_TYPE_IMPORT:
break;
case FIL_TYPE_TABLESPACE:
- if (!fil_is_user_tablespace_id(space.id))
+ if (is_predefined_tablespace(space.id))
continue;
}
@@ -135,11 +132,8 @@ The tablespace must exist in the memory cache.
@param[in] new_path_in new file name,
or NULL if it is located in the normal data directory
@return true if success */
-static bool
-fil_rename_tablespace(
- ulint id,
- const char* old_path,
- const char* new_path_in);
+static bool fil_rename_tablespace(uint32_t id, const char *old_path,
+ const char *new_path_in);
/*
IMPLEMENTATION OF THE TABLESPACE MEMORY CACHE
@@ -227,14 +221,11 @@ fil_validate_skip(void)
}
#endif /* UNIV_DEBUG */
-/*******************************************************************//**
-Returns the table space by a given id, NULL if not found.
-It is unsafe to dereference the returned pointer. It is fine to check
-for NULL. */
-fil_space_t*
-fil_space_get_by_id(
-/*================*/
- ulint id) /*!< in: space id */
+/** Look up a tablespace.
+@param tablespace identifier
+@return tablespace
+@retval nullptr if not found */
+fil_space_t *fil_space_get_by_id(uint32_t id)
{
fil_space_t* space;
@@ -255,48 +246,38 @@ or the caller should be in single-threaded crash recovery mode
Normally, fil_space_t::get() should be used instead.
@param[in] id tablespace ID
@return tablespace, or NULL if not found */
-fil_space_t*
-fil_space_get(
- ulint id)
+fil_space_t *fil_space_get(uint32_t id)
{
- mysql_mutex_lock(&fil_system.mutex);
- fil_space_t* space = fil_space_get_by_id(id);
- mysql_mutex_unlock(&fil_system.mutex);
- return(space);
+ mysql_mutex_lock(&fil_system.mutex);
+ fil_space_t *space= fil_space_get_by_id(id);
+ mysql_mutex_unlock(&fil_system.mutex);
+ return space;
}
-/** Validate the compression algorithm for full crc32 format.
-@param[in] space tablespace object
-@return whether the compression algorithm support */
-static bool fil_comp_algo_validate(const fil_space_t* space)
+/** Check if the compression algorithm is loaded
+@param[in] comp_algo ulint compression algorithm
+@return whether the compression algorithm is loaded */
+bool fil_comp_algo_loaded(ulint comp_algo)
{
- if (!space->full_crc32()) {
- return true;
- }
-
- DBUG_EXECUTE_IF("fil_comp_algo_validate_fail",
- return false;);
-
- ulint comp_algo = space->get_compression_algo();
switch (comp_algo) {
case PAGE_UNCOMPRESSED:
case PAGE_ZLIB_ALGORITHM:
-#ifdef HAVE_LZ4
+ return true;
+
case PAGE_LZ4_ALGORITHM:
-#endif /* HAVE_LZ4 */
-#ifdef HAVE_LZO
+ return provider_service_lz4->is_loaded;
+
case PAGE_LZO_ALGORITHM:
-#endif /* HAVE_LZO */
-#ifdef HAVE_LZMA
+ return provider_service_lzo->is_loaded;
+
case PAGE_LZMA_ALGORITHM:
-#endif /* HAVE_LZMA */
-#ifdef HAVE_BZIP2
+ return provider_service_lzma->is_loaded;
+
case PAGE_BZIP2_ALGORITHM:
-#endif /* HAVE_BZIP2 */
-#ifdef HAVE_SNAPPY
+ return provider_service_bzip2->is_loaded;
+
case PAGE_SNAPPY_ALGORITHM:
-#endif /* HAVE_SNAPPY */
- return true;
+ return provider_service_snappy->is_loaded;
}
return false;
@@ -395,9 +376,26 @@ static bool fil_node_open_file_low(fil_node_t *node)
return false;
}
+ ulint comp_algo = node->space->get_compression_algo();
+ bool comp_algo_invalid = false;
+
if (node->size);
- else if (!node->read_page0() || !fil_comp_algo_validate(node->space))
+ else if (!node->read_page0() ||
+ // validate compression algorithm for full crc32 format
+ (node->space->full_crc32() &&
+ (comp_algo_invalid = !fil_comp_algo_loaded(comp_algo))))
{
+ if (comp_algo_invalid)
+ {
+ if (comp_algo <= PAGE_ALGORITHM_LAST)
+ ib::warn() << "'" << node->name << "' is compressed with "
+ << page_compression_algorithms[comp_algo]
+ << ", which is not currently loaded";
+ else
+ ib::warn() << "'" << node->name << "' is compressed with "
+ << "invalid algorithm: " << comp_algo;
+ }
+
os_file_close(node->handle);
node->handle= OS_FILE_CLOSED;
return false;
@@ -424,7 +422,7 @@ static bool fil_node_open_file(fil_node_t *node)
{
mysql_mutex_assert_owner(&fil_system.mutex);
ut_ad(!node->is_open());
- ut_ad(fil_is_user_tablespace_id(node->space->id) ||
+ ut_ad(!is_predefined_tablespace(node->space->id) ||
srv_operation == SRV_OPERATION_BACKUP ||
srv_operation == SRV_OPERATION_RESTORE ||
srv_operation == SRV_OPERATION_RESTORE_DELTA);
@@ -867,13 +865,10 @@ fil_space_free_low(
/** Frees a space object from the tablespace memory cache.
Closes the files in the chain but does not delete them.
There must not be any pending i/o's or flushes on the files.
-@param[in] id tablespace identifier
-@param[in] x_latched whether the caller holds X-mode space->latch
+@param id tablespace identifier
+@param x_latched whether the caller holds exclusive fil_space_t::latch
@return true if success */
-bool
-fil_space_free(
- ulint id,
- bool x_latched)
+bool fil_space_free(uint32_t id, bool x_latched)
{
ut_ad(id != TRX_SYS_SPACE);
@@ -921,7 +916,7 @@ fil_space_free(
@param mode encryption mode
@return pointer to created tablespace, to be filled in with add()
@retval nullptr on failure (such as when the same tablespace exists) */
-fil_space_t *fil_space_t::create(ulint id, ulint flags,
+fil_space_t *fil_space_t::create(uint32_t id, uint32_t flags,
fil_type_t purpose,
fil_space_crypt_t *crypt_data,
fil_encryption_t mode)
@@ -1029,18 +1024,13 @@ Assigns a new space id for a new single-table tablespace. This works simply by
incrementing the global counter. If 4 billion id's is not enough, we may need
to recycle id's.
@return true if assigned, false if not */
-bool
-fil_assign_new_space_id(
-/*====================*/
- ulint* space_id) /*!< in/out: space id */
+bool fil_assign_new_space_id(uint32_t *space_id)
{
- ulint id;
+ uint32_t id = *space_id;
bool success;
mysql_mutex_lock(&fil_system.mutex);
- id = *space_id;
-
if (id < fil_system.max_assigned_id) {
id = fil_system.max_assigned_id;
}
@@ -1066,7 +1056,7 @@ fil_assign_new_space_id(
<< ". To reset the counter to zero"
" you have to dump all your tables and"
" recreate the whole InnoDB installation.";
- *space_id = ULINT_UNDEFINED;
+ *space_id = UINT32_MAX;
}
mysql_mutex_unlock(&fil_system.mutex);
@@ -1099,7 +1089,7 @@ bool fil_space_t::read_page0()
}
/** Look up a tablespace and ensure that its first page has been validated. */
-static fil_space_t *fil_space_get_space(ulint id)
+static fil_space_t *fil_space_get_space(uint32_t id)
{
if (fil_space_t *space= fil_space_get_by_id(id))
if (space->read_page0())
@@ -1107,7 +1097,8 @@ static fil_space_t *fil_space_get_space(ulint id)
return nullptr;
}
-void fil_space_set_recv_size_and_flags(ulint id, uint32_t size, uint32_t flags)
+void fil_space_set_recv_size_and_flags(uint32_t id, uint32_t size,
+ uint32_t flags)
{
ut_ad(id < SRV_SPACE_ID_UPPER_BOUND);
mysql_mutex_lock(&fil_system.mutex);
@@ -1388,14 +1379,9 @@ void fil_space_t::close_all()
/*******************************************************************//**
Sets the max tablespace id counter if the given number is bigger than the
previous value. */
-void
-fil_set_max_space_id_if_bigger(
-/*===========================*/
- ulint max_id) /*!< in: maximum known id */
+void fil_set_max_space_id_if_bigger(uint32_t max_id)
{
- if (max_id >= SRV_SPACE_ID_UPPER_BOUND) {
- ib::fatal() << "Max tablespace id is too high, " << max_id;
- }
+ ut_a(max_id < SRV_SPACE_ID_UPPER_BOUND);
mysql_mutex_lock(&fil_system.mutex);
@@ -1431,7 +1417,7 @@ fil_write_flushed_lsn(
mach_write_to_8(buf + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION,
lsn);
- ulint fsp_flags = mach_read_from_4(
+ uint32_t fsp_flags = mach_read_from_4(
buf + FSP_HEADER_OFFSET + FSP_SPACE_FLAGS);
if (fil_space_t::full_crc32(fsp_flags)) {
@@ -1451,7 +1437,7 @@ fil_write_flushed_lsn(
@param id tablespace identifier
@return tablespace
@retval nullptr if the tablespace is missing or inaccessible */
-fil_space_t *fil_space_t::get(ulint id)
+fil_space_t *fil_space_t::get(uint32_t id)
{
mysql_mutex_lock(&fil_system.mutex);
fil_space_t *space= fil_space_get_by_id(id);
@@ -1471,7 +1457,7 @@ fil_space_t *fil_space_t::get(ulint id)
@param first_page_no first page number in the file
@param path file path
@param new_path new file path for type=FILE_RENAME */
-inline void mtr_t::log_file_op(mfile_type_t type, ulint space_id,
+inline void mtr_t::log_file_op(mfile_type_t type, uint32_t space_id,
const char *path, const char *new_path)
{
ut_ad((new_path != nullptr) == (type == FILE_RENAME));
@@ -1530,13 +1516,8 @@ inline void mtr_t::log_file_op(mfile_type_t type, ulint space_id,
@param[in] old_name tablespace file name
@param[in] new_name tablespace file name after renaming
@param[in,out] mtr mini-transaction */
-static
-void
-fil_name_write_rename_low(
- ulint space_id,
- const char* old_name,
- const char* new_name,
- mtr_t* mtr)
+static void fil_name_write_rename_low(uint32_t space_id, const char *old_name,
+ const char *new_name, mtr_t *mtr)
{
ut_ad(!is_predefined_tablespace(space_id));
mtr->log_file_op(FILE_RENAME, space_id, old_name, new_name);
@@ -1546,35 +1527,28 @@ fil_name_write_rename_low(
@param[in] space_id tablespace id
@param[in] old_name tablespace file name
@param[in] new_name tablespace file name after renaming */
-static void
-fil_name_write_rename(
- ulint space_id,
- const char* old_name,
- const char* new_name)
+static void fil_name_write_rename(uint32_t space_id,
+ const char *old_name, const char* new_name)
{
- mtr_t mtr;
- mtr.start();
- fil_name_write_rename_low(space_id, old_name, new_name, &mtr);
- mtr.commit();
- log_write_up_to(mtr.commit_lsn(), true);
+ mtr_t mtr;
+ mtr.start();
+ fil_name_write_rename_low(space_id, old_name, new_name, &mtr);
+ mtr.commit();
+ log_write_up_to(mtr.commit_lsn(), true);
}
/** Write FILE_MODIFY for a file.
@param[in] space_id tablespace id
@param[in] name tablespace file name
@param[in,out] mtr mini-transaction */
-static
-void
-fil_name_write(
- ulint space_id,
- const char* name,
- mtr_t* mtr)
+static void fil_name_write(uint32_t space_id, const char *name,
+ mtr_t *mtr)
{
ut_ad(!is_predefined_tablespace(space_id));
mtr->log_file_op(FILE_MODIFY, space_id, name);
}
-fil_space_t *fil_space_t::check_pending_operations(ulint id)
+fil_space_t *fil_space_t::check_pending_operations(uint32_t id)
{
ut_a(!is_system_tablespace(id));
mysql_mutex_lock(&fil_system.mutex);
@@ -1601,7 +1575,7 @@ being_deleted:
return nullptr;
/* Issue a warning every 10.24 seconds, starting after 2.56 seconds */
if ((count & 511) == 128)
- sql_print_warning("InnoDB: Waiting for tablespace " ULINTPF
+ sql_print_warning("InnoDB: Waiting for tablespace " UINT32PF
" to be deleted", id);
std::this_thread::sleep_for(std::chrono::milliseconds(20));
mysql_mutex_lock(&fil_system.mutex);
@@ -1640,7 +1614,7 @@ being_deleted:
/** Close a single-table tablespace on failed IMPORT TABLESPACE.
The tablespace must be cached in the memory cache.
Free all pages used by the tablespace. */
-void fil_close_tablespace(ulint id)
+void fil_close_tablespace(uint32_t id)
{
ut_ad(!is_system_tablespace(id));
fil_space_t* space = fil_space_t::check_pending_operations(id);
@@ -1680,7 +1654,7 @@ void fil_close_tablespace(ulint id)
@param id tablespace identifier
@return detached file handle (to be closed by the caller)
@return OS_FILE_CLOSED if no file existed */
-pfs_os_file_t fil_delete_tablespace(ulint id)
+pfs_os_file_t fil_delete_tablespace(uint32_t id)
{
ut_ad(!is_system_tablespace(id));
pfs_os_file_t handle= OS_FILE_CLOSED;
@@ -1890,11 +1864,8 @@ The tablespace must exist in the memory cache.
@param[in] new_path_in new file name,
or NULL if it is located in the normal data directory
@return true if success */
-static bool
-fil_rename_tablespace(
- ulint id,
- const char* old_path,
- const char* new_path_in)
+static bool fil_rename_tablespace(uint32_t id, const char *old_path,
+ const char *new_path_in)
{
fil_space_t* space;
fil_node_t* node;
@@ -1979,10 +1950,10 @@ must be >= FIL_IBD_FILE_INITIAL_SIZE
@retval NULL on error */
fil_space_t*
fil_ibd_create(
- ulint space_id,
+ uint32_t space_id,
const table_name_t name,
const char* path,
- ulint flags,
+ uint32_t flags,
uint32_t size,
fil_encryption_t mode,
uint32_t key_id,
@@ -2155,8 +2126,8 @@ fil_space_t*
fil_ibd_open(
unsigned validate,
fil_type_t purpose,
- ulint id,
- ulint flags,
+ uint32_t id,
+ uint32_t flags,
fil_space_t::name_type name,
const char* path_in,
dberr_t* err)
@@ -2176,7 +2147,7 @@ fil_ibd_open(
/* Table flags can be ULINT_UNDEFINED if
dict_tf_to_fsp_flags_failure is set. */
- if (flags == ULINT_UNDEFINED) {
+ if (flags == UINT32_MAX) {
corrupted:
local_err = DB_CORRUPTION;
func_exit:
@@ -2519,10 +2490,7 @@ of the file in validate_for_recovery().
@param[out] space the tablespace, or NULL on error
@return status of the operation */
enum fil_load_status
-fil_ibd_load(
- ulint space_id,
- const char* filename,
- fil_space_t*& space)
+fil_ibd_load(uint32_t space_id, const char *filename, fil_space_t *&space)
{
/* If the a space is already in the file system cache with this
space ID, then there is nothing to do. */
@@ -2641,7 +2609,7 @@ tablespace_check:
/* Adjust the memory-based flags that would normally be set by
dict_tf_to_fsp_flags(). In recovery, we have no data dictionary. */
- ulint flags = file.flags();
+ uint32_t flags = file.flags();
if (fil_space_t::is_compressed(flags)) {
flags |= page_zip_level
<< FSP_FLAGS_MEM_COMPRESSION_LEVEL;
@@ -2682,7 +2650,7 @@ tablespace_check:
(Typically when upgrading from MariaDB 10.1.0..10.1.20.)
@param[in,out] space tablespace
@param[in] flags desired tablespace flags */
-void fsp_flags_try_adjust(fil_space_t* space, ulint flags)
+void fsp_flags_try_adjust(fil_space_t *space, uint32_t flags)
{
ut_ad(!srv_read_only_mode);
ut_ad(fil_space_t::is_valid_flags(flags, space->id));
@@ -2732,14 +2700,15 @@ startup, there may be many tablespaces which are not yet in the memory cache.
@param[in] table_flags table flags
@return the tablespace
@retval NULL if no matching tablespace exists in the memory cache */
-fil_space_t *fil_space_for_table_exists_in_mem(ulint id, ulint table_flags)
+fil_space_t *fil_space_for_table_exists_in_mem(uint32_t id,
+ uint32_t table_flags)
{
- const ulint expected_flags = dict_tf_to_fsp_flags(table_flags);
+ const uint32_t expected_flags = dict_tf_to_fsp_flags(table_flags);
mysql_mutex_lock(&fil_system.mutex);
if (fil_space_t* space = fil_space_get_by_id(id)) {
- ulint tf = expected_flags & ~FSP_FLAGS_MEM_MASK;
- ulint sf = space->flags & ~FSP_FLAGS_MEM_MASK;
+ uint32_t tf = expected_flags & ~FSP_FLAGS_MEM_MASK;
+ uint32_t sf = space->flags & ~FSP_FLAGS_MEM_MASK;
if (!fil_space_t::is_flags_equal(tf, sf)
&& !fil_space_t::is_flags_equal(sf, tf)) {
diff --git a/storage/innobase/fil/fil0pagecompress.cc b/storage/innobase/fil/fil0pagecompress.cc
index 9961bdf056c..b6971558201 100644
--- a/storage/innobase/fil/fil0pagecompress.cc
+++ b/storage/innobase/fil/fil0pagecompress.cc
@@ -55,21 +55,11 @@ Updated 14/02/2015
#include <fcntl.h>
#endif
#include "row0mysql.h"
-#ifdef HAVE_LZ4
#include "lz4.h"
-#endif
-#ifdef HAVE_LZO
#include "lzo/lzo1x.h"
-#endif
-#ifdef HAVE_LZMA
#include "lzma.h"
-#endif
-#ifdef HAVE_BZIP2
#include "bzlib.h"
-#endif
-#ifdef HAVE_SNAPPY
#include "snappy-c.h"
-#endif
/** Compress a page for the given compression algorithm.
@param[in] buf page to be compressed
@@ -94,6 +84,7 @@ static ulint fil_page_compress_low(
/* fall through */
case PAGE_UNCOMPRESSED:
return 0;
+
case PAGE_ZLIB_ALGORITHM:
{
ulong len = uLong(write_size);
@@ -104,23 +95,15 @@ static ulint fil_page_compress_low(
}
}
break;
-#ifdef HAVE_LZ4
+
case PAGE_LZ4_ALGORITHM:
-# ifdef HAVE_LZ4_COMPRESS_DEFAULT
write_size = LZ4_compress_default(
reinterpret_cast<const char*>(buf),
reinterpret_cast<char*>(out_buf) + header_len,
int(srv_page_size), int(write_size));
-# else
- write_size = LZ4_compress_limitedOutput(
- reinterpret_cast<const char*>(buf),
- reinterpret_cast<char*>(out_buf) + header_len,
- int(srv_page_size), int(write_size));
-# endif
return write_size;
-#endif /* HAVE_LZ4 */
-#ifdef HAVE_LZO
+
case PAGE_LZO_ALGORITHM: {
lzo_uint len = write_size;
@@ -133,8 +116,7 @@ static ulint fil_page_compress_low(
}
break;
}
-#endif /* HAVE_LZO */
-#ifdef HAVE_LZMA
+
case PAGE_LZMA_ALGORITHM: {
size_t out_pos = 0;
@@ -147,9 +129,7 @@ static ulint fil_page_compress_low(
}
break;
}
-#endif /* HAVE_LZMA */
-#ifdef HAVE_BZIP2
case PAGE_BZIP2_ALGORITHM: {
unsigned len = unsigned(write_size);
if (BZ_OK == BZ2_bzBuffToBuffCompress(
@@ -163,9 +143,7 @@ static ulint fil_page_compress_low(
}
break;
}
-#endif /* HAVE_BZIP2 */
-#ifdef HAVE_SNAPPY
case PAGE_SNAPPY_ALGORITHM: {
size_t len = snappy_max_compressed_length(srv_page_size);
@@ -179,7 +157,6 @@ static ulint fil_page_compress_low(
}
break;
}
-#endif /* HAVE_SNAPPY */
}
return 0;
@@ -195,7 +172,7 @@ static ulint fil_page_compress_low(
static ulint fil_page_compress_for_full_crc32(
const byte* buf,
byte* out_buf,
- ulint flags,
+ uint32_t flags,
ulint block_size,
bool encrypted)
{
@@ -378,7 +355,7 @@ static ulint fil_page_compress_for_non_full_crc32(
ulint fil_page_compress(
const byte* buf,
byte* out_buf,
- ulint flags,
+ uint32_t flags,
ulint block_size,
bool encrypted)
{
@@ -432,7 +409,7 @@ static bool fil_page_decompress_low(
uLong(actual_size))
&& len == srv_page_size);
}
-#ifdef HAVE_LZ4
+
case PAGE_LZ4_ALGORITHM:
return LZ4_decompress_safe(
reinterpret_cast<const char*>(buf) + header_len,
@@ -440,8 +417,7 @@ static bool fil_page_decompress_low(
static_cast<int>(actual_size),
static_cast<int>(srv_page_size)) ==
static_cast<int>(srv_page_size);
-#endif /* HAVE_LZ4 */
-#ifdef HAVE_LZO
+
case PAGE_LZO_ALGORITHM:
{
lzo_uint len_lzo = srv_page_size;
@@ -450,8 +426,7 @@ static bool fil_page_decompress_low(
actual_size, tmp_buf, &len_lzo, NULL)
&& len_lzo == srv_page_size);
}
-#endif /* HAVE_LZO */
-#ifdef HAVE_LZMA
+
case PAGE_LZMA_ALGORITHM:
{
size_t src_pos = 0;
@@ -464,8 +439,7 @@ static bool fil_page_decompress_low(
srv_page_size)
&& dst_pos == srv_page_size;
}
-#endif /* HAVE_LZMA */
-#ifdef HAVE_BZIP2
+
case PAGE_BZIP2_ALGORITHM:
{
uint dst_pos = static_cast<uint>(srv_page_size);
@@ -476,8 +450,7 @@ static bool fil_page_decompress_low(
static_cast<uint>(actual_size), 1, 0)
&& dst_pos == srv_page_size;
}
-#endif /* HAVE_BZIP2 */
-#ifdef HAVE_SNAPPY
+
case PAGE_SNAPPY_ALGORITHM:
{
size_t olen = srv_page_size;
@@ -489,7 +462,6 @@ static bool fil_page_decompress_low(
reinterpret_cast<char*>(tmp_buf), &olen)
&& olen == srv_page_size;
}
-#endif /* HAVE_SNAPPY */
}
return false;
@@ -502,7 +474,8 @@ static bool fil_page_decompress_low(
@return size of the compressed data
@retval 0 if decompression failed
@retval srv_page_size if the page was not compressed */
-ulint fil_page_decompress_for_full_crc32(byte* tmp_buf, byte* buf, ulint flags)
+static size_t fil_page_decompress_for_full_crc32(byte *tmp_buf, byte *buf,
+ uint32_t flags)
{
ut_ad(fil_space_t::full_crc32(flags));
bool compressed = false;
@@ -547,9 +520,7 @@ ulint fil_page_decompress_for_full_crc32(byte* tmp_buf, byte* buf, ulint flags)
@return size of the compressed data
@retval 0 if decompression failed
@retval srv_page_size if the page was not compressed */
-ulint fil_page_decompress_for_non_full_crc32(
- byte* tmp_buf,
- byte* buf)
+static size_t fil_page_decompress_for_non_full_crc32(byte *tmp_buf, byte *buf)
{
ulint header_len;
uint comp_algo;
@@ -600,10 +571,7 @@ ulint fil_page_decompress_for_non_full_crc32(
@return size of the compressed data
@retval 0 if decompression failed
@retval srv_page_size if the page was not compressed */
-ulint fil_page_decompress(
- byte* tmp_buf,
- byte* buf,
- ulint flags)
+ulint fil_page_decompress(byte *tmp_buf, byte *buf, uint32_t flags)
{
if (fil_space_t::full_crc32(flags)) {
return fil_page_decompress_for_full_crc32(tmp_buf, buf, flags);
diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc
index d775fd9c657..e85674401ee 100644
--- a/storage/innobase/fsp/fsp0file.cc
+++ b/storage/innobase/fsp/fsp0file.cc
@@ -304,8 +304,8 @@ Datafile::read_first_page(bool read_only_mode)
+ m_first_page);
m_flags = fsp_header_get_flags(m_first_page);
if (!fil_space_t::is_valid_flags(m_flags, m_space_id)) {
- ulint cflags = fsp_flags_convert_from_101(m_flags);
- if (cflags == ULINT_UNDEFINED) {
+ uint32_t cflags = fsp_flags_convert_from_101(m_flags);
+ if (cflags == UINT32_MAX) {
ib::error()
<< "Invalid flags " << ib::hex(m_flags)
<< " in " << m_filepath;
@@ -342,8 +342,7 @@ in order for this function to validate it.
@param[in] flags The expected tablespace flags.
@retval DB_SUCCESS if tablespace is valid, DB_ERROR if not.
m_is_valid is also set true on success, else false. */
-dberr_t
-Datafile::validate_to_dd(ulint space_id, ulint flags)
+dberr_t Datafile::validate_to_dd(uint32_t space_id, uint32_t flags)
{
dberr_t err;
@@ -433,7 +432,7 @@ Datafile::validate_for_recovery()
}
}
- if (m_space_id == ULINT_UNDEFINED) {
+ if (m_space_id == UINT32_MAX) {
return DB_SUCCESS; /* empty file */
}
@@ -626,15 +625,15 @@ Datafile::find_space_id()
page_size <<= 1) {
/* map[space_id] = count of pages */
typedef std::map<
- ulint,
- ulint,
- std::less<ulint>,
- ut_allocator<std::pair<const ulint, ulint> > >
+ uint32_t,
+ uint32_t,
+ std::less<uint32_t>,
+ ut_allocator<std::pair<const uint32_t, uint32_t> > >
Pages;
Pages verify;
- ulint page_count = 64;
- ulint valid_pages = 0;
+ uint32_t page_count = 64;
+ uint32_t valid_pages = 0;
/* Adjust the number of pages to analyze based on file size */
while ((page_count * page_size) > file_size) {
@@ -648,14 +647,14 @@ Datafile::find_space_id()
byte* page = static_cast<byte*>(
aligned_malloc(page_size, page_size));
- ulint fsp_flags;
+ uint32_t fsp_flags;
/* provide dummy value if the first os_file_read() fails */
switch (srv_checksum_algorithm) {
case SRV_CHECKSUM_ALGORITHM_STRICT_FULL_CRC32:
case SRV_CHECKSUM_ALGORITHM_FULL_CRC32:
fsp_flags = 1U << FSP_FLAGS_FCRC32_POS_MARKER
| FSP_FLAGS_FCRC32_PAGE_SSIZE()
- | innodb_compression_algorithm
+ | uint(innodb_compression_algorithm)
<< FSP_FLAGS_FCRC32_POS_COMPRESSED_ALGO;
break;
default:
@@ -695,7 +694,7 @@ Datafile::find_space_id()
if (noncompressed_ok || compressed_ok) {
- ulint space_id = mach_read_from_4(page
+ uint32_t space_id = mach_read_from_4(page
+ FIL_PAGE_SPACE_ID);
if (space_id > 0) {
@@ -773,14 +772,14 @@ Datafile::restore_from_doublewrite()
return(true);
}
- ulint flags = mach_read_from_4(
+ uint32_t flags = mach_read_from_4(
FSP_HEADER_OFFSET + FSP_SPACE_FLAGS + page);
if (!fil_space_t::is_valid_flags(flags, m_space_id)) {
flags = fsp_flags_convert_from_101(flags);
/* recv_dblwr_t::validate_page() inside find_page()
checked this already. */
- ut_ad(flags != ULINT_UNDEFINED);
+ ut_ad(flags != UINT32_MAX);
/* The flags on the page should be converted later. */
}
diff --git a/storage/innobase/fsp/fsp0fsp.cc b/storage/innobase/fsp/fsp0fsp.cc
index 54a43b920bb..f6b4470c242 100644
--- a/storage/innobase/fsp/fsp0fsp.cc
+++ b/storage/innobase/fsp/fsp0fsp.cc
@@ -1516,7 +1516,7 @@ static
fseg_inode_t*
fseg_inode_try_get(
const fseg_header_t* header,
- ulint space,
+ uint32_t space,
ulint zip_size,
mtr_t* mtr,
buf_block_t** block,
@@ -2238,13 +2238,12 @@ fseg_alloc_free_page_general(
dberr_t* err) /*!< out: error code */
{
fseg_inode_t* inode;
- ulint space_id;
fil_space_t* space;
buf_block_t* iblock;
buf_block_t* block;
uint32_t n_reserved;
- space_id = page_get_space_id(page_align(seg_header));
+ const uint32_t space_id = page_get_space_id(page_align(seg_header));
space = mtr->x_lock_space(space_id);
inode = fseg_inode_try_get(seg_header, space_id, space->zip_size(),
mtr, &iblock, err);
diff --git a/storage/innobase/fsp/fsp0space.cc b/storage/innobase/fsp/fsp0space.cc
index b069250ff9f..6bdf9fcc4d8 100644
--- a/storage/innobase/fsp/fsp0space.cc
+++ b/storage/innobase/fsp/fsp0space.cc
@@ -59,7 +59,7 @@ Tablespace::shutdown()
m_files.clear();
ut_free(m_path);
m_path = NULL;
- m_space_id = ULINT_UNDEFINED;
+ m_space_id = UINT32_MAX;
}
/** Note that the data file was found.
@@ -118,7 +118,7 @@ Tablespace::open_or_create(bool is_temp)
/* Create the tablespace entry for the multi-file
tablespace in the tablespace manager. */
- ulint fsp_flags = 0;
+ uint32_t fsp_flags;
switch (srv_checksum_algorithm) {
case SRV_CHECKSUM_ALGORITHM_FULL_CRC32:
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 11b17cdf5f1..caf7fc29dcc 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -79,7 +79,6 @@ this program; if not, write to the Free Software Foundation, Inc.,
#include "dict0load.h"
#include "btr0defragment.h"
#include "dict0crea.h"
-#include "dict0dict.h"
#include "dict0stats.h"
#include "dict0stats_bg.h"
#include "fil0fil.h"
@@ -94,9 +93,9 @@ this program; if not, write to the Free Software Foundation, Inc.,
#include "mtr0mtr.h"
#include "os0file.h"
#include "page0zip.h"
-#include "rem0types.h"
#include "row0import.h"
#include "row0ins.h"
+#include "row0log.h"
#include "row0merge.h"
#include "row0mysql.h"
#include "row0quiesce.h"
@@ -114,6 +113,12 @@ this program; if not, write to the Free Software Foundation, Inc.,
#include "ut0mem.h"
#include "row0ext.h"
+#include "lz4.h"
+#include "lzo/lzo1x.h"
+#include "lzma.h"
+#include "bzlib.h"
+#include "snappy-c.h"
+
#include <limits>
#define thd_get_trx_isolation(X) ((enum_tx_isolation)thd_tx_isolation(X))
@@ -853,11 +858,6 @@ innodb_compression_algorithm_validate(
for update function */
struct st_mysql_value* value); /*!< in: incoming string */
-static ibool innodb_have_lzo=IF_LZO(1, 0);
-static ibool innodb_have_lz4=IF_LZ4(1, 0);
-static ibool innodb_have_lzma=IF_LZMA(1, 0);
-static ibool innodb_have_bzip2=IF_BZIP2(1, 0);
-static ibool innodb_have_snappy=IF_SNAPPY(1, 0);
static ibool innodb_have_punch_hole=IF_PUNCH_HOLE(1, 0);
static
@@ -1045,11 +1045,11 @@ static SHOW_VAR innodb_status_variables[]= {
&export_vars.innodb_pages_encrypted, SHOW_LONGLONG},
{"num_pages_decrypted",
&export_vars.innodb_pages_decrypted, SHOW_LONGLONG},
- {"have_lz4", &innodb_have_lz4, SHOW_BOOL},
- {"have_lzo", &innodb_have_lzo, SHOW_BOOL},
- {"have_lzma", &innodb_have_lzma, SHOW_BOOL},
- {"have_bzip2", &innodb_have_bzip2, SHOW_BOOL},
- {"have_snappy", &innodb_have_snappy, SHOW_BOOL},
+ {"have_lz4", &(provider_service_lz4->is_loaded), SHOW_BOOL},
+ {"have_lzo", &(provider_service_lzo->is_loaded), SHOW_BOOL},
+ {"have_lzma", &(provider_service_lzma->is_loaded), SHOW_BOOL},
+ {"have_bzip2", &(provider_service_bzip2->is_loaded), SHOW_BOOL},
+ {"have_snappy", &(provider_service_snappy->is_loaded), SHOW_BOOL},
{"have_punch_hole", &innodb_have_punch_hole, SHOW_BOOL},
/* Defragmentation */
@@ -1776,16 +1776,11 @@ If correct, set the associated page_size_shift which is the power of 2
for this page size.
@param[in] page_size Page Size to evaluate
@return an associated page_size_shift if valid, 0 if invalid. */
-inline
-ulong
-innodb_page_size_validate(
- ulong page_size)
+inline uint32_t innodb_page_size_validate(ulong page_size)
{
- ulong n;
-
DBUG_ENTER("innodb_page_size_validate");
- for (n = UNIV_PAGE_SIZE_SHIFT_MIN;
+ for (uint32_t n = UNIV_PAGE_SIZE_SHIFT_MIN;
n <= UNIV_PAGE_SIZE_SHIFT_MAX;
n++) {
if (page_size == static_cast<ulong>(1 << n)) {
@@ -3787,23 +3782,36 @@ static const char* ha_innobase_exts[] = {
@retval 0 if no system-versioned data was affected by the transaction */
static ulonglong innodb_prepare_commit_versioned(THD* thd, ulonglong *trx_id)
{
- if (const trx_t* trx = thd_to_trx(thd)) {
- *trx_id = trx->id;
-
- for (const auto& t : trx->mod_tables) {
- if (t.second.is_versioned()) {
- DBUG_ASSERT(t.first->versioned_by_id());
- DBUG_ASSERT(trx->rsegs.m_redo.rseg);
+ if (trx_t *trx= thd_to_trx(thd))
+ {
+ *trx_id= trx->id;
+ bool versioned= false;
- return trx_sys.get_new_trx_id();
- }
- }
+ for (auto &t : trx->mod_tables)
+ {
+ if (t.second.is_versioned())
+ {
+ DBUG_ASSERT(t.first->versioned_by_id());
+ DBUG_ASSERT(trx->rsegs.m_redo.rseg);
+ versioned= true;
+ if (!trx->bulk_insert)
+ break;
+ }
+ if (t.second.is_bulk_insert())
+ {
+ ut_ad(trx->bulk_insert);
+ ut_ad(!trx->check_unique_secondary);
+ ut_ad(!trx->check_foreigns);
+ if (t.second.write_bulk(t.first, trx))
+ return ULONGLONG_MAX;
+ }
+ }
- return 0;
- }
+ return versioned ? trx_sys.get_new_trx_id() : 0;
+ }
- *trx_id = 0;
- return 0;
+ *trx_id= 0;
+ return 0;
}
/** Initialize and normalize innodb_buffer_pool_size. */
@@ -3819,6 +3827,25 @@ static void innodb_buffer_pool_size_init()
innobase_buffer_pool_size = srv_buf_pool_size;
}
+
+static bool
+compression_algorithm_is_not_loaded(ulong compression_algorithm, myf flags)
+{
+ bool is_loaded[PAGE_ALGORITHM_LAST+1]= { 1, 1, provider_service_lz4->is_loaded,
+ provider_service_lzo->is_loaded, provider_service_lzma->is_loaded,
+ provider_service_bzip2->is_loaded, provider_service_snappy->is_loaded };
+
+ DBUG_ASSERT(compression_algorithm <= PAGE_ALGORITHM_LAST);
+
+ if (is_loaded[compression_algorithm])
+ return 0;
+
+ my_printf_error(HA_ERR_UNSUPPORTED, "InnoDB: compression algorithm %s (%u)"
+ " is not available. Please, load the corresponding provider plugin.", flags,
+ page_compression_algorithms[compression_algorithm], compression_algorithm);
+ return 1;
+}
+
/** Initialize, validate and normalize the InnoDB startup parameters.
@return failure code
@retval 0 on success
@@ -3854,50 +3881,8 @@ static int innodb_init_params()
DBUG_RETURN(HA_ERR_INITIALIZATION);
}
-#ifndef HAVE_LZ4
- if (innodb_compression_algorithm == PAGE_LZ4_ALGORITHM) {
- sql_print_error("InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
- "InnoDB: liblz4 is not installed. \n",
- innodb_compression_algorithm);
- DBUG_RETURN(HA_ERR_INITIALIZATION);
- }
-#endif
-
-#ifndef HAVE_LZO
- if (innodb_compression_algorithm == PAGE_LZO_ALGORITHM) {
- sql_print_error("InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
- "InnoDB: liblzo is not installed. \n",
- innodb_compression_algorithm);
- DBUG_RETURN(HA_ERR_INITIALIZATION);
- }
-#endif
-
-#ifndef HAVE_LZMA
- if (innodb_compression_algorithm == PAGE_LZMA_ALGORITHM) {
- sql_print_error("InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
- "InnoDB: liblzma is not installed. \n",
- innodb_compression_algorithm);
- DBUG_RETURN(HA_ERR_INITIALIZATION);
- }
-#endif
-
-#ifndef HAVE_BZIP2
- if (innodb_compression_algorithm == PAGE_BZIP2_ALGORITHM) {
- sql_print_error("InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
- "InnoDB: libbz2 is not installed. \n",
- innodb_compression_algorithm);
- DBUG_RETURN(HA_ERR_INITIALIZATION);
- }
-#endif
-
-#ifndef HAVE_SNAPPY
- if (innodb_compression_algorithm == PAGE_SNAPPY_ALGORITHM) {
- sql_print_error("InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
- "InnoDB: libsnappy is not installed. \n",
- innodb_compression_algorithm);
- DBUG_RETURN(HA_ERR_INITIALIZATION);
- }
-#endif
+ if (compression_algorithm_is_not_loaded(innodb_compression_algorithm, ME_ERROR_LOG))
+ DBUG_RETURN(HA_ERR_INITIALIZATION);
if ((srv_encrypt_tables || srv_encrypt_log
|| innodb_encrypt_temporary_tables)
@@ -4617,9 +4602,6 @@ innobase_commit(
if (commit_trx
|| (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) {
- DBUG_EXECUTE_IF("crash_innodb_before_commit",
- DBUG_SUICIDE(););
-
/* Run the fast part of commit if we did not already. */
if (!trx->active_commit_ordered) {
innobase_commit_ordered_2(trx, thd);
@@ -4654,6 +4636,10 @@ innobase_commit(
SQL statement */
trx_mark_sql_stat_end(trx);
+ if (UNIV_UNLIKELY(trx->error_state != DB_SUCCESS)) {
+ trx_rollback_for_mysql(trx);
+ DBUG_RETURN(1);
+ }
}
/* Reset the number AUTO-INC rows required */
@@ -10887,9 +10873,6 @@ err_col:
ut_ad(dict_sys.sys_tables_exist());
err = row_create_table_for_mysql(table, m_trx);
-
- DBUG_EXECUTE_IF("ib_crash_during_create_for_encryption",
- DBUG_SUICIDE(););
}
switch (err) {
@@ -15704,6 +15687,7 @@ ha_innobase::extra(
row_ins_duplicate_error_in_clust() will acquire a
shared lock instead of an exclusive lock. */
stmt_boundary:
+ trx->bulk_insert_apply();
trx->end_bulk_insert(*m_prebuilt->table);
trx->bulk_insert = false;
break;
@@ -15724,6 +15708,9 @@ ha_innobase::extra(
if (trx->is_bulk_insert()) {
/* Allow a subsequent INSERT into an empty table
if !unique_checks && !foreign_key_checks. */
+ if (dberr_t err = trx->bulk_insert_apply()) {
+ return err;
+ }
break;
}
goto stmt_boundary;
@@ -15837,6 +15824,12 @@ ha_innobase::start_stmt(
if (!trx->bulk_insert) {
break;
}
+
+ /* Trigger could've initiated another stmt.
+ So apply all bulk operation and mark as
+ end bulk insert for all tables */
+ trx->bulk_insert_apply();
+ trx->end_bulk_insert();
trx->bulk_insert = false;
trx->last_sql_stat_start.least_undo_no = trx->undo_no;
}
@@ -17038,6 +17031,10 @@ innobase_xa_prepare(
SQL statement */
trx_mark_sql_stat_end(trx);
+ if (UNIV_UNLIKELY(trx->error_state != DB_SUCCESS)) {
+ trx_rollback_for_mysql(trx);
+ return 1;
+ }
}
if (thd_sql_command(thd) != SQLCOM_XA_PREPARE
@@ -18903,10 +18900,23 @@ static MYSQL_SYSVAR_ULONG(purge_batch_size, srv_purge_batch_size,
1, /* Minimum value */
5000, 0); /* Maximum value */
+extern void srv_update_purge_thread_count(uint n);
+
+static
+void
+innodb_purge_threads_update(THD*, struct st_mysql_sys_var*, void*, const void*save )
+{
+ srv_update_purge_thread_count(*static_cast<const uint*>(save));
+}
+
static MYSQL_SYSVAR_UINT(purge_threads, srv_n_purge_threads,
- PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
+ PLUGIN_VAR_OPCMDARG,
"Number of tasks for purging transaction history",
- NULL, NULL, 4, 1, innodb_purge_threads_MAX, 0);
+ NULL, innodb_purge_threads_update,
+ 4, /* Default setting */
+ 1, /* Minimum value */
+ innodb_purge_threads_MAX, /* Maximum value */
+ 0);
static MYSQL_SYSVAR_UINT(fast_shutdown, srv_fast_shutdown,
PLUGIN_VAR_OPCMDARG,
@@ -19406,7 +19416,7 @@ static MYSQL_SYSVAR_STR(undo_directory, srv_undo_dir,
"Directory where undo tablespace files live, this path can be absolute.",
NULL, NULL, NULL);
-static MYSQL_SYSVAR_ULONG(undo_tablespaces, srv_undo_tablespaces,
+static MYSQL_SYSVAR_UINT(undo_tablespaces, srv_undo_tablespaces,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Number of undo tablespaces to use.",
NULL, NULL,
@@ -19659,7 +19669,7 @@ static MYSQL_SYSVAR_BOOL(force_primary_key,
"Do not allow creating a table without primary key (off by default)",
NULL, NULL, FALSE);
-static const char *page_compression_algorithms[]= { "none", "zlib", "lz4", "lzo", "lzma", "bzip2", "snappy", 0 };
+const char *page_compression_algorithms[]= { "none", "zlib", "lz4", "lzo", "lzma", "bzip2", "snappy", 0 };
static TYPELIB page_compression_algorithms_typelib=
{
array_elements(page_compression_algorithms) - 1, 0,
@@ -20937,70 +20947,14 @@ innodb_compression_algorithm_validate(
for update function */
struct st_mysql_value* value) /*!< in: incoming string */
{
- ulong compression_algorithm;
DBUG_ENTER("innobase_compression_algorithm_validate");
if (check_sysvar_enum(thd, var, save, value)) {
DBUG_RETURN(1);
}
- compression_algorithm = *reinterpret_cast<ulong*>(save);
- (void)compression_algorithm;
-
-#ifndef HAVE_LZ4
- if (compression_algorithm == PAGE_LZ4_ALGORITHM) {
- push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
- HA_ERR_UNSUPPORTED,
- "InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
- "InnoDB: liblz4 is not installed. \n",
- compression_algorithm);
- DBUG_RETURN(1);
- }
-#endif
-
-#ifndef HAVE_LZO
- if (compression_algorithm == PAGE_LZO_ALGORITHM) {
- push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
- HA_ERR_UNSUPPORTED,
- "InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
- "InnoDB: liblzo is not installed. \n",
- compression_algorithm);
- DBUG_RETURN(1);
- }
-#endif
-
-#ifndef HAVE_LZMA
- if (compression_algorithm == PAGE_LZMA_ALGORITHM) {
- push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
- HA_ERR_UNSUPPORTED,
- "InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
- "InnoDB: liblzma is not installed. \n",
- compression_algorithm);
- DBUG_RETURN(1);
- }
-#endif
-
-#ifndef HAVE_BZIP2
- if (compression_algorithm == PAGE_BZIP2_ALGORITHM) {
- push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
- HA_ERR_UNSUPPORTED,
- "InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
- "InnoDB: libbz2 is not installed. \n",
- compression_algorithm);
- DBUG_RETURN(1);
- }
-#endif
-
-#ifndef HAVE_SNAPPY
- if (compression_algorithm == PAGE_SNAPPY_ALGORITHM) {
- push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
- HA_ERR_UNSUPPORTED,
- "InnoDB: innodb_compression_algorithm = %lu unsupported.\n"
- "InnoDB: libsnappy is not installed. \n",
- compression_algorithm);
- DBUG_RETURN(1);
- }
-#endif
+ if (compression_algorithm_is_not_loaded(*(ulong*)save, ME_WARNING))
+ DBUG_RETURN(1);
DBUG_RETURN(0);
}
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index d63f5b33654..d7a4e72f901 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -10537,8 +10537,8 @@ commit_cache_norebuild(
space->flags
|= FSP_FLAGS_MASK_PAGE_COMPRESSION;
} else if (!space->is_compressed()) {
- space->flags
- |= innodb_compression_algorithm
+ space->flags |= static_cast<uint32_t>(
+ innodb_compression_algorithm)
<< FSP_FLAGS_FCRC32_POS_COMPRESSED_ALGO;
}
mysql_mutex_unlock(&fil_system.mutex);
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc
index 94c01f5108a..bd4e4306914 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.cc
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc
@@ -2269,7 +2269,7 @@ static void ibuf_read_merge_pages(const uint32_t* space_ids,
#endif
for (ulint i = 0; i < n_stored; i++) {
- const ulint space_id = space_ids[i];
+ const uint32_t space_id = space_ids[i];
fil_space_t* s = fil_space_t::get(space_id);
if (!s) {
tablespace_deleted:
@@ -4439,7 +4439,7 @@ reset_bit:
/** Delete all change buffer entries for a tablespace,
in DISCARD TABLESPACE, IMPORT TABLESPACE, or crash recovery.
@param[in] space missing or to-be-discarded tablespace */
-void ibuf_delete_for_discarded_space(ulint space)
+void ibuf_delete_for_discarded_space(uint32_t space)
{
mem_heap_t* heap;
btr_pcur_t pcur;
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index 9440672aba1..b620e818798 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -321,16 +321,13 @@ buf_block_get_modify_clock(
bool buf_is_zeroes(st_::span<const byte> buf);
/** Check if a page is corrupt.
-@param[in] check_lsn whether the LSN should be checked
-@param[in] read_buf database page
-@param[in] fsp_flags tablespace flags
+@param check_lsn whether FIL_PAGE_LSN should be checked
+@param read_buf database page
+@param fsp_flags contents of FIL_SPACE_FLAGS
@return whether the page is corrupted */
-bool
-buf_page_is_corrupted(
- bool check_lsn,
- const byte* read_buf,
- ulint fsp_flags)
- MY_ATTRIBUTE((warn_unused_result));
+bool buf_page_is_corrupted(bool check_lsn, const byte *read_buf,
+ uint32_t fsp_flags)
+ MY_ATTRIBUTE((warn_unused_result));
inline void *aligned_malloc(size_t size, size_t align)
{
@@ -359,7 +356,8 @@ stored in 26th position.
@param[in] read_buf database page
@param[in] fsp_flags tablespace flags
@return key version of the page. */
-inline uint32_t buf_page_get_key_version(const byte* read_buf, ulint fsp_flags)
+inline uint32_t buf_page_get_key_version(const byte* read_buf,
+ uint32_t fsp_flags)
{
static_assert(FIL_PAGE_FCRC32_KEY_VERSION == 0, "compatibility");
return fil_space_t::full_crc32(fsp_flags)
@@ -374,7 +372,7 @@ stored in page type.
@param[in] read_buf database page
@param[in] fsp_flags tablespace flags
@return true if page is compressed. */
-inline bool buf_page_is_compressed(const byte* read_buf, ulint fsp_flags)
+inline bool buf_page_is_compressed(const byte* read_buf, uint32_t fsp_flags)
{
uint16_t page_type= fil_page_get_type(read_buf);
return fil_space_t::full_crc32(fsp_flags)
@@ -477,12 +475,10 @@ buf_pool_size_align(
/** Verify that post encryption checksum match with the calculated checksum.
This function should be called only if tablespace contains crypt data metadata.
-@param[in] page page frame
-@param[in] fsp_flags tablespace flags
-@return true if page is encrypted and OK, false otherwise */
-bool buf_page_verify_crypt_checksum(
- const byte* page,
- ulint fsp_flags);
+@param page page frame
+@param fsp_flags contents of FSP_SPACE_FLAGS
+@return whether the page is encrypted and valid */
+bool buf_page_verify_crypt_checksum(const byte *page, uint32_t fsp_flags);
/** Calculate a ROW_FORMAT=COMPRESSED page checksum and update the page.
@param[in,out] page page to update
diff --git a/storage/innobase/include/buf0flu.h b/storage/innobase/include/buf0flu.h
index c07ff679a80..665fd1115e7 100644
--- a/storage/innobase/include/buf0flu.h
+++ b/storage/innobase/include/buf0flu.h
@@ -46,7 +46,7 @@ deleting the data file of that tablespace.
The pages still remain a part of LRU and are evicted from
the list as they age towards the tail of the LRU.
@param id tablespace identifier */
-void buf_flush_remove_pages(ulint id);
+void buf_flush_remove_pages(uint32_t id);
/*******************************************************************//**
Relocates a buffer control block on the flush_list.
diff --git a/storage/innobase/include/buf0rea.h b/storage/innobase/include/buf0rea.h
index 8d6b28194dc..986a792b97e 100644
--- a/storage/innobase/include/buf0rea.h
+++ b/storage/innobase/include/buf0rea.h
@@ -101,12 +101,10 @@ which could result in a deadlock if the OS does not support asynchronous io.
ulint
buf_read_ahead_linear(const page_id_t page_id, ulint zip_size, bool ibuf);
-/** Issues read requests for pages which recovery wants to read in.
-@param[in] space_id tablespace id
-@param[in] page_nos array of page numbers to read, with the
-highest page number the last in the array
-@param[in] n number of page numbers in the array */
-void buf_read_recv_pages(ulint space_id, const uint32_t* page_nos, ulint n);
+/** Issue read requests for pages that need to be recovered.
+@param space_id tablespace identifier
+@param page_nos page numbers to read, in ascending order */
+void buf_read_recv_pages(uint32_t space_id, st_::span<uint32_t> page_nos);
/** @name Modes used in read-ahead @{ */
/** read only pages belonging to the insert buffer tree */
diff --git a/storage/innobase/include/buf0types.h b/storage/innobase/include/buf0types.h
index 3cc71a3f503..bad3fd79571 100644
--- a/storage/innobase/include/buf0types.h
+++ b/storage/innobase/include/buf0types.h
@@ -90,9 +90,9 @@ class page_id_t
{
public:
/** Constructor from (space, page_no).
- @param[in] space tablespace id
- @param[in] page_no page number */
- constexpr page_id_t(ulint space, uint32_t page_no) :
+ @param space tablespace id
+ @param page_no page number */
+ constexpr page_id_t(uint32_t space, uint32_t page_no) :
m_id(uint64_t{space} << 32 | page_no) {}
constexpr page_id_t(uint64_t id) : m_id(id) {}
diff --git a/storage/innobase/include/dict0boot.h b/storage/innobase/include/dict0boot.h
index 3e14e0ace69..a65287476ef 100644
--- a/storage/innobase/include/dict0boot.h
+++ b/storage/innobase/include/dict0boot.h
@@ -42,7 +42,7 @@ dict_hdr_get_new_id(
(not assigned if NULL) */
index_id_t* index_id, /*!< out: index id
(not assigned if NULL) */
- ulint* space_id); /*!< out: space id
+ uint32_t* space_id); /*!< out: space id
(not assigned if NULL) */
/** Update dict_sys.row_id in the dictionary header file page. */
void dict_hdr_flush_row_id(row_id_t id);
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index f02ee0ddf9d..57af86bcf85 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -855,11 +855,8 @@ fil_space_t::flags | 0 | 0 | 1 | 1
==================================================================
@param[in] table_flags dict_table_t::flags
@return tablespace flags (fil_space_t::flags) */
-UNIV_INLINE
-ulint
-dict_tf_to_fsp_flags(ulint table_flags)
- MY_ATTRIBUTE((const));
-
+inline uint32_t dict_tf_to_fsp_flags(unsigned table_flags)
+ MY_ATTRIBUTE((const));
/** Extract the ROW_FORMAT=COMPRESSED page size from table flags.
@param[in] flags flags
diff --git a/storage/innobase/include/dict0dict.inl b/storage/innobase/include/dict0dict.inl
index a210c839020..4cc3eae96ab 100644
--- a/storage/innobase/include/dict0dict.inl
+++ b/storage/innobase/include/dict0dict.inl
@@ -618,19 +618,16 @@ fil_space_t::flags | 0 | 0 | 1 | 1
==================================================================
@param[in] table_flags dict_table_t::flags
@return tablespace flags (fil_space_t::flags) */
-UNIV_INLINE
-ulint
-dict_tf_to_fsp_flags(ulint table_flags)
+inline uint32_t dict_tf_to_fsp_flags(unsigned table_flags)
{
- ulint fsp_flags;
- ulint page_compression_level = DICT_TF_GET_PAGE_COMPRESSION_LEVEL(
+ uint32_t fsp_flags;
+ uint32_t page_compression_level = DICT_TF_GET_PAGE_COMPRESSION_LEVEL(
table_flags);
ut_ad((DICT_TF_GET_PAGE_COMPRESSION(table_flags) == 0)
== (page_compression_level == 0));
- DBUG_EXECUTE_IF("dict_tf_to_fsp_flags_failure",
- return(ULINT_UNDEFINED););
+ DBUG_EXECUTE_IF("dict_tf_to_fsp_flags_failure", return UINT32_MAX;);
/* No ROW_FORMAT=COMPRESSED for innodb_checksum_algorithm=full_crc32 */
if ((srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_FULL_CRC32
@@ -641,7 +638,8 @@ dict_tf_to_fsp_flags(ulint table_flags)
| FSP_FLAGS_FCRC32_PAGE_SSIZE();
if (page_compression_level) {
- fsp_flags |= innodb_compression_algorithm
+ fsp_flags |= static_cast<uint32_t>(
+ innodb_compression_algorithm)
<< FSP_FLAGS_FCRC32_POS_COMPRESSED_ALGO;
}
} else {
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index da96d07e260..aaf232366e3 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -112,7 +112,7 @@ are described in fsp0fsp.h. */
/** This bitmask is used in SYS_TABLES.N_COLS to set and test whether
the Compact page format is used, i.e ROW_FORMAT != REDUNDANT */
-#define DICT_N_COLS_COMPACT 0x80000000UL
+constexpr uint32_t DICT_N_COLS_COMPACT= 1U << 31;
/** Width of the COMPACT flag */
#define DICT_TF_WIDTH_COMPACT 1
@@ -2049,7 +2049,7 @@ public:
/** The tablespace of the table */
fil_space_t* space;
/** Tablespace ID */
- ulint space_id;
+ uint32_t space_id;
/** Stores information about:
1 row format (redundant or compact),
@@ -2407,6 +2407,16 @@ public:
static dict_table_t *create(const span<const char> &name, fil_space_t *space,
ulint n_cols, ulint n_v_cols, ulint flags,
ulint flags2);
+
+ /** Check whether the table has any spatial indexes */
+ bool has_spatial_index() const
+ {
+ for (auto i= UT_LIST_GET_FIRST(indexes);
+ (i= UT_LIST_GET_NEXT(indexes, i)) != nullptr; )
+ if (i->is_spatial())
+ return true;
+ return false;
+ }
};
inline void dict_index_t::set_modified(mtr_t& mtr) const
diff --git a/storage/innobase/include/fil0crypt.h b/storage/innobase/include/fil0crypt.h
index c3abdad90ed..d5df0ca126a 100644
--- a/storage/innobase/include/fil0crypt.h
+++ b/storage/innobase/include/fil0crypt.h
@@ -291,19 +291,19 @@ byte* fil_space_encrypt(
/** Decrypt a page.
@param]in] space_id space id
+@param[in] fsp_flags Tablespace flags
@param[in] crypt_data crypt_data
@param[in] tmp_frame Temporary buffer
@param[in] physical_size page size
-@param[in] fsp_flags Tablespace flags
@param[in,out] src_frame Page to decrypt
@return DB_SUCCESS or error */
dberr_t
fil_space_decrypt(
- ulint space_id,
+ uint32_t space_id,
+ uint32_t fsp_flags,
fil_space_crypt_t* crypt_data,
byte* tmp_frame,
ulint physical_size,
- ulint fsp_flags,
byte* src_frame);
/******************************************************************
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
index 8889604a919..ce84e835195 100644
--- a/storage/innobase/include/fil0fil.h
+++ b/storage/innobase/include/fil0fil.h
@@ -43,7 +43,7 @@ Created 10/25/1995 Heikki Tuuri
#include <mutex>
struct unflushed_spaces_tag_t;
-struct rotation_list_tag_t;
+struct default_encrypt_tag_t;
struct space_list_tag_t;
struct named_spaces_tag_t;
@@ -82,14 +82,14 @@ enum srv_flush_t
extern ulong srv_file_flush_method;
/** Undo tablespaces starts with space_id. */
-extern ulint srv_undo_space_id_start;
+extern uint32_t srv_undo_space_id_start;
/** The number of UNDO tablespaces that are open and ready to use. */
-extern ulint srv_undo_tablespaces_open;
+extern uint32_t srv_undo_tablespaces_open;
/** Check whether given space id is undo tablespace id
@param[in] space_id space id to check
@return true if it is undo tablespace else false. */
-inline bool srv_is_undo_tablespace(ulint space_id)
+inline bool srv_is_undo_tablespace(uint32_t space_id)
{
return srv_undo_space_id_start > 0 &&
space_id >= srv_undo_space_id_start &&
@@ -336,7 +336,7 @@ enum fil_encryption_t
};
struct fil_space_t final : ilist_node<unflushed_spaces_tag_t>,
- ilist_node<rotation_list_tag_t>,
+ ilist_node<default_encrypt_tag_t>,
ilist_node<space_list_tag_t>,
ilist_node<named_spaces_tag_t>
#else
@@ -352,8 +352,6 @@ struct fil_space_t final
latch.destroy();
}
- ulint id; /*!< space id */
-
/** fil_system.spaces chain node */
fil_space_t *hash;
lsn_t max_lsn;
@@ -363,6 +361,8 @@ struct fil_space_t final
Protected by log_sys.mutex.
If and only if this is nonzero, the
tablespace will be in named_spaces. */
+ /** tablespace identifier */
+ uint32_t id;
/** whether undo tablespace truncation is in progress */
bool is_being_truncated;
fil_type_t purpose;/*!< purpose */
@@ -535,7 +535,7 @@ public:
@param id tablespace identifier
@return tablespace
@retval nullptr if no tablespace was found */
- static fil_space_t *check_pending_operations(ulint id);
+ static fil_space_t *check_pending_operations(uint32_t id);
private:
MY_ATTRIBUTE((warn_unused_result))
@@ -681,92 +681,78 @@ public:
freed_ranges.clear();
}
#endif /* !UNIV_INNOCHECKSUM */
- /** FSP_SPACE_FLAGS and FSP_FLAGS_MEM_ flags;
- check fsp0types.h to more info about flags. */
- ulint flags;
-
- /** Determine if full_crc32 is used for a data file
- @param[in] flags tablespace flags (FSP_SPACE_FLAGS)
- @return whether the full_crc32 algorithm is active */
- static bool full_crc32(ulint flags) {
- return flags & FSP_FLAGS_FCRC32_MASK_MARKER;
- }
- /** Determine if full_crc32 is used along with compression */
- static bool is_full_crc32_compressed(ulint flags)
+ /** FSP_SPACE_FLAGS and FSP_FLAGS_MEM_ flags;
+ check fsp0types.h to more info about flags. */
+ uint32_t flags;
+
+ /** Determine if full_crc32 is used for a data file
+ @param[in] flags tablespace flags (FSP_SPACE_FLAGS)
+ @return whether the full_crc32 algorithm is active */
+ static bool full_crc32(uint32_t flags)
+ { return flags & FSP_FLAGS_FCRC32_MASK_MARKER; }
+ /** @return whether innodb_checksum_algorithm=full_crc32 is active */
+ bool full_crc32() const { return full_crc32(flags); }
+ /** Determine if full_crc32 is used along with PAGE_COMPRESSED */
+ static bool is_full_crc32_compressed(uint32_t flags)
{
- if (full_crc32(flags))
- {
- ulint algo= FSP_FLAGS_FCRC32_GET_COMPRESSED_ALGO(flags);
- DBUG_ASSERT(algo <= PAGE_ALGORITHM_LAST);
- return algo > 0;
+ if (!full_crc32(flags))
+ return false;
+ auto algo= FSP_FLAGS_FCRC32_GET_COMPRESSED_ALGO(flags);
+ DBUG_ASSERT(algo <= PAGE_ALGORITHM_LAST);
+ return algo != 0;
+ }
+ /** Determine the logical page size.
+ @param flags tablespace flags (FSP_SPACE_FLAGS)
+ @return the logical page size
+ @retval 0 if the flags are invalid */
+ static unsigned logical_size(uint32_t flags)
+ {
+ switch (full_crc32(flags)
+ ? FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(flags)
+ : FSP_FLAGS_GET_PAGE_SSIZE(flags)) {
+ case 3: return 4096;
+ case 4: return 8192;
+ case 5: return full_crc32(flags) ? 16384 : 0;
+ case 0: return full_crc32(flags) ? 0 : 16384;
+ case 6: return 32768;
+ case 7: return 65536;
+ default: return 0;
}
-
- return false;
}
- /** @return whether innodb_checksum_algorithm=full_crc32 is active */
- bool full_crc32() const { return full_crc32(flags); }
- /** Determine the logical page size.
- @param flags tablespace flags (FSP_FLAGS)
- @return the logical page size
- @retval 0 if the flags are invalid */
- static unsigned logical_size(ulint flags) {
-
- ulint page_ssize = 0;
-
- if (full_crc32(flags)) {
- page_ssize = FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(flags);
- } else {
- page_ssize = FSP_FLAGS_GET_PAGE_SSIZE(flags);
- }
-
- switch (page_ssize) {
- case 3: return 4096;
- case 4: return 8192;
- case 5:
- { ut_ad(full_crc32(flags)); return 16384; }
- case 0:
- { ut_ad(!full_crc32(flags)); return 16384; }
- case 6: return 32768;
- case 7: return 65536;
- default: return 0;
- }
- }
- /** Determine the ROW_FORMAT=COMPRESSED page size.
- @param flags tablespace flags (FSP_FLAGS)
- @return the ROW_FORMAT=COMPRESSED page size
- @retval 0 if ROW_FORMAT=COMPRESSED is not used */
- static unsigned zip_size(ulint flags) {
-
- if (full_crc32(flags)) {
- return 0;
- }
+ /** Determine the ROW_FORMAT=COMPRESSED page size.
+ @param flags tablespace flags (FSP_SPACE_FLAGS)
+ @return the ROW_FORMAT=COMPRESSED page size
+ @retval 0 if ROW_FORMAT=COMPRESSED is not used */
+ static unsigned zip_size(uint32_t flags)
+ {
+ if (full_crc32(flags))
+ return 0;
+ const uint32_t zip_ssize= FSP_FLAGS_GET_ZIP_SSIZE(flags);
+ return zip_ssize ? (UNIV_ZIP_SIZE_MIN >> 1) << zip_ssize : 0;
+ }
+ /** Determine the physical page size.
+ @param flags tablespace flags (FSP_SPACE_FLAGS)
+ @return the physical page size */
+ static unsigned physical_size(uint32_t flags)
+ {
+ if (full_crc32(flags))
+ return logical_size(flags);
- ulint zip_ssize = FSP_FLAGS_GET_ZIP_SSIZE(flags);
- return zip_ssize
- ? (UNIV_ZIP_SIZE_MIN >> 1) << zip_ssize : 0;
- }
- /** Determine the physical page size.
- @param flags tablespace flags (FSP_FLAGS)
- @return the physical page size */
- static unsigned physical_size(ulint flags) {
+ const uint32_t zip_ssize= FSP_FLAGS_GET_ZIP_SSIZE(flags);
+ return zip_ssize
+ ? (UNIV_ZIP_SIZE_MIN >> 1) << zip_ssize
+ : unsigned(srv_page_size);
+ }
- if (full_crc32(flags)) {
- return logical_size(flags);
- }
+ /** @return the ROW_FORMAT=COMPRESSED page size
+ @retval 0 if ROW_FORMAT=COMPRESSED is not used */
+ unsigned zip_size() const { return zip_size(flags); }
+ /** @return the physical page size */
+ unsigned physical_size() const { return physical_size(flags); }
- ulint zip_ssize = FSP_FLAGS_GET_ZIP_SSIZE(flags);
- return zip_ssize
- ? (UNIV_ZIP_SIZE_MIN >> 1) << zip_ssize
- : unsigned(srv_page_size);
- }
- /** @return the ROW_FORMAT=COMPRESSED page size
- @retval 0 if ROW_FORMAT=COMPRESSED is not used */
- unsigned zip_size() const { return zip_size(flags); }
- /** @return the physical page size */
- unsigned physical_size() const { return physical_size(flags); }
- /** Check whether the compression enabled in tablespace.
+ /** Check whether PAGE_COMPRESSED is enabled.
@param[in] flags tablespace flags */
- static bool is_compressed(ulint flags)
+ static bool is_compressed(uint32_t flags)
{
return is_full_crc32_compressed(flags) ||
FSP_FLAGS_HAS_PAGE_COMPRESSION(flags);
@@ -774,187 +760,151 @@ public:
/** @return whether the compression enabled for the tablespace. */
bool is_compressed() const { return is_compressed(flags); }
- /** Get the compression algorithm for full crc32 format.
- @param[in] flags tablespace flags
- @return algorithm type of tablespace */
- static ulint get_compression_algo(ulint flags)
- {
- return full_crc32(flags)
- ? FSP_FLAGS_FCRC32_GET_COMPRESSED_ALGO(flags)
- : 0;
- }
- /** @return the page_compressed algorithm
- @retval 0 if not page_compressed */
- ulint get_compression_algo() const {
- return fil_space_t::get_compression_algo(flags);
- }
- /** Determine if the page_compressed page contains an extra byte
- for exact compressed stream length
- @param[in] flags tablespace flags
- @return whether the extra byte is needed */
- static bool full_crc32_page_compressed_len(ulint flags)
- {
- DBUG_ASSERT(full_crc32(flags));
- switch (get_compression_algo(flags)) {
- case PAGE_LZ4_ALGORITHM:
- case PAGE_LZO_ALGORITHM:
- case PAGE_SNAPPY_ALGORITHM:
- return true;
- }
- return false;
- }
-
- /** Whether the full checksum matches with non full checksum flags.
- @param[in] flags flags present
- @param[in] expected expected flags
- @return true if it is equivalent */
- static bool is_flags_full_crc32_equal(ulint flags, ulint expected)
- {
- ut_ad(full_crc32(flags));
- ulint fcrc32_psize = FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(flags);
-
- if (full_crc32(expected)) {
- /* The data file may have been created with a
- different innodb_compression_algorithm. But
- we only support one innodb_page_size for all files. */
- return fcrc32_psize
- == FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(expected);
- }
-
- ulint non_fcrc32_psize = FSP_FLAGS_GET_PAGE_SSIZE(expected);
-
- if (!non_fcrc32_psize) {
- if (fcrc32_psize != 5) {
- return false;
- }
- } else if (fcrc32_psize != non_fcrc32_psize) {
- return false;
- }
-
- return true;
- }
- /** Whether old tablespace flags match full_crc32 flags.
- @param[in] flags flags present
- @param[in] expected expected flags
- @return true if it is equivalent */
- static bool is_flags_non_full_crc32_equal(ulint flags, ulint expected)
- {
- ut_ad(!full_crc32(flags));
-
- if (!full_crc32(expected)) {
- return false;
- }
-
- ulint non_fcrc32_psize = FSP_FLAGS_GET_PAGE_SSIZE(flags);
- ulint fcrc32_psize = FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(
- expected);
-
- if (!non_fcrc32_psize) {
- if (fcrc32_psize != 5) {
- return false;
- }
- } else if (fcrc32_psize != non_fcrc32_psize) {
- return false;
- }
-
- return true;
- }
- /** Whether both fsp flags are equivalent */
- static bool is_flags_equal(ulint flags, ulint expected)
- {
- if (!((flags ^ expected) & ~(1U << FSP_FLAGS_POS_RESERVED))) {
- return true;
- }
-
- return full_crc32(flags)
- ? is_flags_full_crc32_equal(flags, expected)
- : is_flags_non_full_crc32_equal(flags, expected);
- }
- /** Validate the tablespace flags for full crc32 format.
- @param[in] flags the content of FSP_SPACE_FLAGS
- @return whether the flags are correct in full crc32 format */
- static bool is_fcrc32_valid_flags(ulint flags)
- {
- ut_ad(flags & FSP_FLAGS_FCRC32_MASK_MARKER);
- const ulint page_ssize = physical_size(flags);
- if (page_ssize < 3 || page_ssize & 8) {
- return false;
- }
-
- flags >>= FSP_FLAGS_FCRC32_POS_COMPRESSED_ALGO;
-
- return flags <= PAGE_ALGORITHM_LAST;
- }
- /** Validate the tablespace flags.
- @param[in] flags content of FSP_SPACE_FLAGS
- @param[in] is_ibd whether this is an .ibd file
- (not system tablespace)
- @return whether the flags are correct. */
- static bool is_valid_flags(ulint flags, bool is_ibd)
- {
- DBUG_EXECUTE_IF("fsp_flags_is_valid_failure",
- return false;);
-
- if (full_crc32(flags)) {
- return is_fcrc32_valid_flags(flags);
- }
+ /** Get the compression algorithm for full crc32 format.
+ @param flags contents of FSP_SPACE_FLAGS
+ @return PAGE_COMPRESSED algorithm of full_crc32 tablespace
+ @retval 0 if not PAGE_COMPRESSED or not full_crc32 */
+ static unsigned get_compression_algo(uint32_t flags)
+ {
+ return full_crc32(flags)
+ ? FSP_FLAGS_FCRC32_GET_COMPRESSED_ALGO(flags)
+ : 0;
+ }
+ /** @return the page_compressed algorithm
+ @retval 0 if not page_compressed */
+ unsigned get_compression_algo() const { return get_compression_algo(flags); }
+ /** Determine if the page_compressed page contains an extra byte
+ for exact compressed stream length
+ @param flags contents of FSP_SPACE_FLAGS
+ @return whether the extra byte is needed */
+ static bool full_crc32_page_compressed_len(uint32_t flags)
+ {
+ DBUG_ASSERT(full_crc32(flags));
+ switch (get_compression_algo(flags)) {
+ case PAGE_LZ4_ALGORITHM:
+ case PAGE_LZO_ALGORITHM:
+ case PAGE_SNAPPY_ALGORITHM:
+ return true;
+ }
+ return false;
+ }
- if (flags == 0) {
- return true;
- }
+ /** Whether the full checksum matches with non full checksum flags.
+ @param flags contents of FSP_SPACE_FLAGS
+ @param expected expected flags
+ @return true if it is equivalent */
+ static bool is_flags_full_crc32_equal(uint32_t flags, uint32_t expected)
+ {
+ ut_ad(full_crc32(flags));
+ uint32_t fcrc32_psize= FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(flags);
+
+ if (full_crc32(expected))
+ /* The data file may have been created with a
+ different innodb_compression_algorithm. But
+ we only support one innodb_page_size for all files. */
+ return fcrc32_psize == FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(expected);
+
+ uint32_t non_fcrc32_psize = FSP_FLAGS_GET_PAGE_SSIZE(expected);
+ if (!non_fcrc32_psize)
+ return fcrc32_psize == 5;
+ return fcrc32_psize == non_fcrc32_psize;
+ }
- if (flags & ~FSP_FLAGS_MASK) {
- return false;
- }
+ /** Whether old tablespace flags match full_crc32 flags.
+ @param flags contents of FSP_SPACE_FLAGS
+ @param expected expected flags
+ @return true if it is equivalent */
+ static bool is_flags_non_full_crc32_equal(uint32_t flags, uint32_t expected)
+ {
+ ut_ad(!full_crc32(flags));
+ if (!full_crc32(expected))
+ return false;
- if ((flags & (FSP_FLAGS_MASK_POST_ANTELOPE
- | FSP_FLAGS_MASK_ATOMIC_BLOBS))
- == FSP_FLAGS_MASK_ATOMIC_BLOBS) {
- /* If the "atomic blobs" flag (indicating
- ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED) flag
- is set, then the "post Antelope"
- (ROW_FORMAT!=REDUNDANT) flag must also be set. */
- return false;
- }
+ uint32_t non_fcrc32_psize= FSP_FLAGS_GET_PAGE_SSIZE(flags);
+ uint32_t fcrc32_psize = FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(expected);
- /* Bits 10..14 should be 0b0000d where d is the DATA_DIR flag
- of MySQL 5.6 and MariaDB 10.0, which we ignore.
- In the buggy FSP_SPACE_FLAGS written by MariaDB 10.1.0 to 10.1.20,
- bits 10..14 would be nonzero 0bsssaa where sss is
- nonzero PAGE_SSIZE (3, 4, 6, or 7)
- and aa is ATOMIC_WRITES (not 0b11). */
- if (FSP_FLAGS_GET_RESERVED(flags) & ~1U) {
- return false;
- }
+ if (!non_fcrc32_psize)
+ return fcrc32_psize == 5;
+ return fcrc32_psize == non_fcrc32_psize;
+ }
- const ulint ssize = FSP_FLAGS_GET_PAGE_SSIZE(flags);
- if (ssize == 1 || ssize == 2 || ssize == 5 || ssize & 8) {
- /* the page_size is not between 4k and 64k;
- 16k should be encoded as 0, not 5 */
- return false;
- }
+ /** Whether both fsp flags are equivalent */
+ static bool is_flags_equal(uint32_t flags, uint32_t expected)
+ {
+ if (!((flags ^ expected) & ~(1U << FSP_FLAGS_POS_RESERVED)))
+ return true;
+ return full_crc32(flags)
+ ? is_flags_full_crc32_equal(flags, expected)
+ : is_flags_non_full_crc32_equal(flags, expected);
+ }
- const ulint zssize = FSP_FLAGS_GET_ZIP_SSIZE(flags);
- if (zssize == 0) {
- /* not ROW_FORMAT=COMPRESSED */
- } else if (zssize > (ssize ? ssize : 5)) {
- /* Invalid KEY_BLOCK_SIZE */
- return false;
- } else if (~flags & (FSP_FLAGS_MASK_POST_ANTELOPE
- | FSP_FLAGS_MASK_ATOMIC_BLOBS)) {
- /* both these flags should be set for
- ROW_FORMAT=COMPRESSED */
- return false;
- }
+ /** Validate the tablespace flags for full crc32 format.
+ @param flags contents of FSP_SPACE_FLAGS
+ @return whether the flags are correct in full crc32 format */
+ static bool is_fcrc32_valid_flags(uint32_t flags)
+ {
+ ut_ad(flags & FSP_FLAGS_FCRC32_MASK_MARKER);
+ const ulint page_ssize= physical_size(flags);
+ if (page_ssize < 3 || page_ssize & 8)
+ return false;
+ flags >>= FSP_FLAGS_FCRC32_POS_COMPRESSED_ALGO;
+ return flags <= PAGE_ALGORITHM_LAST;
+ }
+ /** Validate the tablespace flags.
+ @param flags contents of FSP_SPACE_FLAGS
+ @param is_ibd whether this is an .ibd file (not system tablespace)
+ @return whether the flags are correct */
+ static bool is_valid_flags(uint32_t flags, bool is_ibd)
+ {
+ DBUG_EXECUTE_IF("fsp_flags_is_valid_failure", return false;);
+ if (full_crc32(flags))
+ return is_fcrc32_valid_flags(flags);
- /* The flags do look valid. But, avoid misinterpreting
- buggy MariaDB 10.1 format flags for
- PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL={0,2,3}
- as valid-looking PAGE_SSIZE if this is known to be
- an .ibd file and we are using the default innodb_page_size=16k. */
- return(ssize == 0 || !is_ibd
- || srv_page_size != UNIV_PAGE_SIZE_ORIG);
- }
+ if (flags == 0)
+ return true;
+ if (~FSP_FLAGS_MASK & flags)
+ return false;
+
+ if (FSP_FLAGS_MASK_ATOMIC_BLOBS ==
+ (flags & (FSP_FLAGS_MASK_POST_ANTELOPE | FSP_FLAGS_MASK_ATOMIC_BLOBS)))
+ /* If the "atomic blobs" flag (indicating
+ ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED) flag is set, then the
+ ROW_FORMAT!=REDUNDANT flag must also be set. */
+ return false;
+
+ /* Bits 10..14 should be 0b0000d where d is the DATA_DIR flag
+ of MySQL 5.6 and MariaDB 10.0, which we ignore.
+ In the buggy FSP_SPACE_FLAGS written by MariaDB 10.1.0 to 10.1.20,
+ bits 10..14 would be nonzero 0bsssaa where sss is
+ nonzero PAGE_SSIZE (3, 4, 6, or 7)
+ and aa is ATOMIC_WRITES (not 0b11). */
+ if (FSP_FLAGS_GET_RESERVED(flags) & ~1U)
+ return false;
+
+ const uint32_t ssize= FSP_FLAGS_GET_PAGE_SSIZE(flags);
+ if (ssize == 1 || ssize == 2 || ssize == 5 || ssize & 8)
+ /* the page_size is not between 4k and 64k;
+ 16k should be encoded as 0, not 5 */
+ return false;
+
+ const uint32_t zssize= FSP_FLAGS_GET_ZIP_SSIZE(flags);
+ if (zssize == 0)
+ /* not ROW_FORMAT=COMPRESSED */;
+ else if (zssize > (ssize ? ssize : 5))
+ /* Invalid KEY_BLOCK_SIZE */
+ return false;
+ else if (~flags &
+ (FSP_FLAGS_MASK_POST_ANTELOPE | FSP_FLAGS_MASK_ATOMIC_BLOBS))
+ /* both these flags must set for ROW_FORMAT=COMPRESSED */
+ return false;
+
+ /* The flags do look valid. But, avoid misinterpreting
+ buggy MariaDB 10.1 format flags for
+ PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL={0,2,3}
+ as valid-looking PAGE_SSIZE if this is known to be
+ an .ibd file and we are using the default innodb_page_size=16k. */
+ return(ssize == 0 || !is_ibd || srv_page_size != UNIV_PAGE_SIZE_ORIG);
+ }
#ifndef UNIV_INNOCHECKSUM
MY_ATTRIBUTE((warn_unused_result))
@@ -966,7 +916,7 @@ public:
@param mode encryption mode
@return pointer to created tablespace, to be filled in with add()
@retval nullptr on failure (such as when the same tablespace exists) */
- static fil_space_t *create(ulint id, ulint flags,
+ static fil_space_t *create(uint32_t id, uint32_t flags,
fil_type_t purpose, fil_space_crypt_t *crypt_data,
fil_encryption_t mode= FIL_ENCRYPTION_DEFAULT);
@@ -975,7 +925,7 @@ public:
@param id tablespace identifier
@return tablespace
@retval nullptr if the tablespace is missing or inaccessible */
- static fil_space_t *get(ulint id);
+ static fil_space_t *get(uint32_t id);
/** Add/remove the free page in the freed ranges list.
@param[in] offset page number to be added
@@ -1426,14 +1376,12 @@ or the caller should be in single-threaded crash recovery mode
Normally, fil_space_t::get() should be used instead.
@param[in] id tablespace ID
@return tablespace, or NULL if not found */
-fil_space_t*
-fil_space_get(
- ulint id)
- MY_ATTRIBUTE((warn_unused_result));
+fil_space_t *fil_space_get(uint32_t id)
+ MY_ATTRIBUTE((warn_unused_result));
-/** The tablespace memory cache; also the totality of logs (the log
-data space) is stored here; below we talk about tablespaces */
-struct fil_system_t {
+/** The tablespace memory cache */
+struct fil_system_t
+{
/**
Constructor.
@@ -1492,12 +1440,8 @@ public:
ulint n_open;
/** last time we noted n_open exceeding the limit; protected by mutex */
time_t n_open_exceeded_time;
- ulint max_assigned_id;/*!< maximum space id in the existing
- tables, or assigned during the time
- mysqld has been up; at an InnoDB
- startup we scan the data dictionary
- and set here the maximum of the
- space id's of the tables there */
+ /** maximum persistent tablespace id that has ever been assigned */
+ uint32_t max_assigned_id;
/** nonzero if fil_node_open_file_low() should avoid moving the tablespace
to the end of space_list, for FIFO policy of try_to_close() */
ulint freeze_space_list;
@@ -1510,13 +1454,13 @@ public:
the latest redo log checkpoint.
Protected only by log_sys.mutex. */
- /** List of all file spaces need key rotation */
- ilist<fil_space_t, rotation_list_tag_t> default_encrypt_tables;
+ /** list of all ENCRYPTED=DEFAULT tablespaces that need
+ to be converted to the current value of innodb_encrypt_tables */
+ ilist<fil_space_t, default_encrypt_tag_t> default_encrypt_tables;
- bool space_id_reuse_warned;
- /*!< whether fil_space_t::create()
- has issued a warning about
- potential space_id reuse */
+ /** whether fil_space_t::create() has issued a warning about
+ potential space_id reuse */
+ bool space_id_reuse_warned;
/** Return the next tablespace from default_encrypt_tables list.
@param space previous tablespace (nullptr to start from the start)
@@ -1638,36 +1582,27 @@ Assigns a new space id for a new single-table tablespace. This works simply by
incrementing the global counter. If 4 billion id's is not enough, we may need
to recycle id's.
@return true if assigned, false if not */
-bool
-fil_assign_new_space_id(
-/*====================*/
- ulint* space_id); /*!< in/out: space id */
+bool fil_assign_new_space_id(uint32_t *space_id);
/** Frees a space object from the tablespace memory cache.
Closes the files in the chain but does not delete them.
There must not be any pending i/o's or flushes on the files.
-@param[in] id tablespace identifier
-@param[in] x_latched whether the caller holds X-mode space->latch
+@param id tablespace identifier
+@param x_latched whether the caller holds exclusive fil_space_t::latch
@return true if success */
-bool
-fil_space_free(
- ulint id,
- bool x_latched);
+bool fil_space_free(uint32_t id, bool x_latched);
/** Set the recovered size of a tablespace in pages.
@param id tablespace ID
@param size recovered size in pages
@param flags tablespace flags */
-void fil_space_set_recv_size_and_flags(ulint id, uint32_t size,
+void fil_space_set_recv_size_and_flags(uint32_t id, uint32_t size,
uint32_t flags);
/*******************************************************************//**
Sets the max tablespace id counter if the given number is bigger than the
previous value. */
-void
-fil_set_max_space_id_if_bigger(
-/*===========================*/
- ulint max_id);/*!< in: maximum known id */
+void fil_set_max_space_id_if_bigger(uint32_t max_id);
/** Write the flushed LSN to the page header of the first page in the
system tablespace.
@@ -1683,12 +1618,12 @@ MY_ATTRIBUTE((warn_unused_result))
@param id tablespace identifier
@return detached file handle (to be closed by the caller)
@return OS_FILE_CLOSED if no file existed */
-pfs_os_file_t fil_delete_tablespace(ulint id);
+pfs_os_file_t fil_delete_tablespace(uint32_t id);
/** Close a single-table tablespace on failed IMPORT TABLESPACE.
The tablespace must be cached in the memory cache.
Free all pages used by the tablespace. */
-void fil_close_tablespace(ulint id);
+void fil_close_tablespace(uint32_t id);
/*******************************************************************//**
Allocates and builds a file name from a path, a table or tablespace name
@@ -1718,10 +1653,10 @@ must be >= FIL_IBD_FILE_INITIAL_SIZE
@retval NULL on error */
fil_space_t*
fil_ibd_create(
- ulint space_id,
+ uint32_t space_id,
const table_name_t name,
const char* path,
- ulint flags,
+ uint32_t flags,
uint32_t size,
fil_encryption_t mode,
uint32_t key_id,
@@ -1732,7 +1667,7 @@ fil_ibd_create(
(Typically when upgrading from MariaDB 10.1.0..10.1.20.)
@param[in,out] space tablespace
@param[in] flags desired tablespace flags */
-void fsp_flags_try_adjust(fil_space_t* space, ulint flags);
+void fsp_flags_try_adjust(fil_space_t *space, uint32_t flags);
/********************************************************************//**
Tries to open a single-table tablespace and optionally checks the space id is
@@ -1765,8 +1700,8 @@ fil_space_t*
fil_ibd_open(
unsigned validate,
fil_type_t purpose,
- ulint id,
- ulint flags,
+ uint32_t id,
+ uint32_t flags,
fil_space_t::name_type name,
const char* path_in,
dberr_t* err = NULL)
@@ -1791,12 +1726,8 @@ enum fil_load_status {
@param[out] space the tablespace, or NULL on error
@return status of the operation */
enum fil_load_status
-fil_ibd_load(
- ulint space_id,
- const char* filename,
- fil_space_t*& space)
- MY_ATTRIBUTE((warn_unused_result));
-
+fil_ibd_load(uint32_t space_id, const char *filename, fil_space_t *&space)
+ MY_ATTRIBUTE((warn_unused_result));
/** Determine if a matching tablespace exists in the InnoDB tablespace
memory cache. Note that if we have not done a crash recovery at the database
@@ -1805,7 +1736,8 @@ startup, there may be many tablespaces which are not yet in the memory cache.
@param[in] table_flags table flags
@return the tablespace
@retval NULL if no matching tablespace exists in the memory cache */
-fil_space_t *fil_space_for_table_exists_in_mem(ulint id, ulint table_flags);
+fil_space_t *fil_space_for_table_exists_in_mem(uint32_t id,
+ uint32_t table_flags);
/** Try to extend a tablespace if it is smaller than the specified size.
@param[in,out] space tablespace
@@ -1836,12 +1768,11 @@ fil_delete_file(
/*============*/
const char* path); /*!< in: filepath of the ibd tablespace */
-/*******************************************************************//**
-Returns the table space by a given id, NULL if not found. */
-fil_space_t*
-fil_space_get_by_id(
-/*================*/
- ulint id); /*!< in: space id */
+/** Look up a tablespace.
+@param tablespace identifier
+@return tablespace
+@retval nullptr if not found */
+fil_space_t *fil_space_get_by_id(uint32_t id);
/** Note that a non-predefined persistent tablespace has been modified
by redo log.
@@ -1880,6 +1811,9 @@ inline bool fil_names_write_if_was_clean(fil_space_t* space)
return(was_clean);
}
+
+bool fil_comp_algo_loaded(ulint comp_algo);
+
/** On a log checkpoint, reset fil_names_dirty_and_write() flags
and write out FILE_MODIFY and FILE_CHECKPOINT if needed.
@param[in] lsn checkpoint LSN
diff --git a/storage/innobase/include/fil0pagecompress.h b/storage/innobase/include/fil0pagecompress.h
index a22867ad56a..2927da3c2fb 100644
--- a/storage/innobase/include/fil0pagecompress.h
+++ b/storage/innobase/include/fil0pagecompress.h
@@ -40,7 +40,7 @@ Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com
ulint fil_page_compress(
const byte* buf,
byte* out_buf,
- ulint flags,
+ uint32_t flags,
ulint block_size,
bool encrypted)
MY_ATTRIBUTE((nonnull, warn_unused_result));
@@ -52,9 +52,6 @@ ulint fil_page_compress(
@return size of the compressed data
@retval 0 if decompression failed
@retval srv_page_size if the page was not compressed */
-ulint fil_page_decompress(
- byte* tmp_buf,
- byte* buf,
- ulint flags)
- MY_ATTRIBUTE((nonnull, warn_unused_result));
+ulint fil_page_decompress(byte *tmp_buf, byte *buf, uint32_t flags)
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif
diff --git a/storage/innobase/include/fsp0file.h b/storage/innobase/include/fsp0file.h
index 8c11d61c5aa..9dfb3cc7561 100644
--- a/storage/innobase/include/fsp0file.h
+++ b/storage/innobase/include/fsp0file.h
@@ -56,7 +56,7 @@ public:
m_size(),
m_order(),
m_type(SRV_NOT_RAW),
- m_space_id(ULINT_UNDEFINED),
+ m_space_id(UINT32_MAX),
m_flags(),
m_exists(),
m_is_valid(),
@@ -67,7 +67,7 @@ public:
/* No op */
}
- Datafile(ulint flags, uint32_t size, ulint order)
+ Datafile(uint32_t flags, uint32_t size, ulint order)
:
m_filepath(),
m_filename(),
@@ -76,7 +76,7 @@ public:
m_size(size),
m_order(order),
m_type(SRV_NOT_RAW),
- m_space_id(ULINT_UNDEFINED),
+ m_space_id(UINT32_MAX),
m_flags(flags),
m_exists(),
m_is_valid(),
@@ -154,7 +154,7 @@ public:
}
/** Initialize the tablespace flags */
- void init(ulint flags) { m_flags= flags; }
+ void init(uint32_t flags) { m_flags= flags; }
/** Release the resources. */
virtual void shutdown();
@@ -198,7 +198,7 @@ public:
@param[in] flags The expected tablespace flags.
@retval DB_SUCCESS if tablespace is valid, DB_ERROR if not.
m_is_valid is also set true on success, else false. */
- dberr_t validate_to_dd(ulint space_id, ulint flags)
+ dberr_t validate_to_dd(uint32_t space_id, uint32_t flags)
MY_ATTRIBUTE((warn_unused_result));
/** Validates this datafile for the purpose of recovery.
@@ -254,24 +254,15 @@ public:
/** Get Datafile::m_space_id.
@return m_space_id */
- ulint space_id() const
- {
- return(m_space_id);
- }
+ uint32_t space_id() const { return m_space_id; }
/** Get Datafile::m_flags.
@return m_flags */
- ulint flags() const
- {
- return(m_flags);
- }
+ uint32_t flags() const { return m_flags; }
/**
@return true if m_handle is open, false if not */
- bool is_open() const
- {
- return(m_handle != OS_FILE_CLOSED);
- }
+ bool is_open() const { return m_handle != OS_FILE_CLOSED; }
/** Get Datafile::m_is_valid.
@return m_is_valid */
@@ -324,9 +315,9 @@ public:
@return the first data page */
const byte* get_first_page() const { return(m_first_page); }
- void set_space_id(ulint space_id) { m_space_id= space_id; }
+ void set_space_id(uint32_t space_id) { m_space_id= space_id; }
- void set_flags(ulint flags) { m_flags = flags; }
+ void set_flags(uint32_t flags) { m_flags = flags; }
private:
/** Free the filepath buffer. */
void free_filepath();
@@ -425,12 +416,12 @@ private:
/** Tablespace ID. Contained in the datafile header.
If this is a system tablespace, FSP_SPACE_ID is only valid
in the first datafile. */
- ulint m_space_id;
+ uint32_t m_space_id;
/** Tablespace flags. Contained in the datafile header.
If this is a system tablespace, FSP_SPACE_FLAGS are only valid
in the first datafile. */
- ulint m_flags;
+ uint32_t m_flags;
/** true if file already existed on startup */
bool m_exists;
diff --git a/storage/innobase/include/fsp0fsp.h b/storage/innobase/include/fsp0fsp.h
index 7b66e58e488..52334056353 100644
--- a/storage/innobase/include/fsp0fsp.h
+++ b/storage/innobase/include/fsp0fsp.h
@@ -590,14 +590,11 @@ fseg_print(
/** Convert FSP_SPACE_FLAGS from the buggy MariaDB 10.1.0..10.1.20 format.
@param[in] flags the contents of FSP_SPACE_FLAGS
@return the flags corrected from the buggy MariaDB 10.1 format
-@retval ULINT_UNDEFINED if the flags are not in the buggy 10.1 format */
+@retval UINT32_MAX if the flags are not in the buggy 10.1 format */
MY_ATTRIBUTE((warn_unused_result, const))
-UNIV_INLINE
-ulint
-fsp_flags_convert_from_101(ulint flags)
+inline uint32_t fsp_flags_convert_from_101(uint32_t flags)
{
- DBUG_EXECUTE_IF("fsp_flags_is_valid_failure",
- return(ULINT_UNDEFINED););
+ DBUG_EXECUTE_IF("fsp_flags_is_valid_failure", return UINT32_MAX;);
if (flags == 0 || fil_space_t::full_crc32(flags)) {
return(flags);
}
@@ -606,7 +603,7 @@ fsp_flags_convert_from_101(ulint flags)
/* The most significant FSP_SPACE_FLAGS bit that was ever set
by MariaDB 10.1.0 to 10.1.20 was bit 17 (misplaced DATA_DIR flag).
The flags must be less than 1<<18 in order to be valid. */
- return(ULINT_UNDEFINED);
+ return UINT32_MAX;
}
if ((flags & (FSP_FLAGS_MASK_POST_ANTELOPE | FSP_FLAGS_MASK_ATOMIC_BLOBS))
@@ -615,7 +612,7 @@ fsp_flags_convert_from_101(ulint flags)
ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED) flag
is set, then the "post Antelope" (ROW_FORMAT!=REDUNDANT) flag
must also be set. */
- return(ULINT_UNDEFINED);
+ return UINT32_MAX;
}
/* Bits 6..10 denote compression in MariaDB 10.1.0 to 10.1.20.
@@ -644,19 +641,19 @@ fsp_flags_convert_from_101(ulint flags)
invalid (COMPRESSION_LEVEL=3 but COMPRESSION=0)
+0b00000: innodb_page_size=16k (looks like COMPRESSION=0)
??? Could actually be compressed; see PAGE_SSIZE below */
- const ulint level = FSP_FLAGS_GET_PAGE_COMPRESSION_LEVEL_MARIADB101(
+ const uint32_t level = FSP_FLAGS_GET_PAGE_COMPRESSION_LEVEL_MARIADB101(
flags);
if (FSP_FLAGS_GET_PAGE_COMPRESSION_MARIADB101(flags) != (level != 0)
|| level > 9) {
/* The compression flags are not in the buggy MariaDB
10.1 format. */
- return(ULINT_UNDEFINED);
+ return UINT32_MAX;
}
if (!(~flags & FSP_FLAGS_MASK_ATOMIC_WRITES_MARIADB101)) {
/* The ATOMIC_WRITES flags cannot be 0b11.
(The bits 11..12 should actually never be 0b11,
because in MySQL they would be SHARED|TEMPORARY.) */
- return(ULINT_UNDEFINED);
+ return UINT32_MAX;
}
/* Bits 13..16 are the wrong position for PAGE_SSIZE, and they
@@ -671,23 +668,23 @@ fsp_flags_convert_from_101(ulint flags)
will be properly rejected by older MariaDB 10.1.x because they
would read as PAGE_SSIZE>=8 which is not valid. */
- const ulint ssize = FSP_FLAGS_GET_PAGE_SSIZE_MARIADB101(flags);
+ const uint32_t ssize = FSP_FLAGS_GET_PAGE_SSIZE_MARIADB101(flags);
if (ssize == 1 || ssize == 2 || ssize == 5 || ssize & 8) {
/* the page_size is not between 4k and 64k;
16k should be encoded as 0, not 5 */
- return(ULINT_UNDEFINED);
+ return UINT32_MAX;
}
- const ulint zssize = FSP_FLAGS_GET_ZIP_SSIZE(flags);
+ const uint32_t zssize = FSP_FLAGS_GET_ZIP_SSIZE(flags);
if (zssize == 0) {
/* not ROW_FORMAT=COMPRESSED */
} else if (zssize > (ssize ? ssize : 5)) {
/* invalid KEY_BLOCK_SIZE */
- return(ULINT_UNDEFINED);
+ return UINT32_MAX;
} else if (~flags & (FSP_FLAGS_MASK_POST_ANTELOPE
| FSP_FLAGS_MASK_ATOMIC_BLOBS)) {
/* both these flags should be set for
ROW_FORMAT=COMPRESSED */
- return(ULINT_UNDEFINED);
+ return UINT32_MAX;
}
flags = ((flags & 0x3f) | ssize << FSP_FLAGS_POS_PAGE_SSIZE
@@ -702,19 +699,11 @@ fsp_flags_convert_from_101(ulint flags)
@param[in] actual flags read from FSP_SPACE_FLAGS
@return whether the flags match */
MY_ATTRIBUTE((warn_unused_result))
-UNIV_INLINE
-bool
-fsp_flags_match(ulint expected, ulint actual)
+inline bool fsp_flags_match(uint32_t expected, uint32_t actual)
{
- expected &= ~FSP_FLAGS_MEM_MASK;
- ut_ad(fil_space_t::is_valid_flags(expected, false));
-
- if (actual == expected) {
- return(true);
- }
-
- actual = fsp_flags_convert_from_101(actual);
- return(actual == expected);
+ expected&= ~FSP_FLAGS_MEM_MASK;
+ ut_ad(fil_space_t::is_valid_flags(expected, false));
+ return actual == expected || fsp_flags_convert_from_101(actual) == expected;
}
/** Determine the descriptor index within a descriptor page.
diff --git a/storage/innobase/include/fsp0space.h b/storage/innobase/include/fsp0space.h
index ed65af52bc8..a2bb46d3125 100644
--- a/storage/innobase/include/fsp0space.h
+++ b/storage/innobase/include/fsp0space.h
@@ -47,22 +47,13 @@ public:
/** Data file iterator */
typedef files_t::const_iterator const_iterator;
- Tablespace()
- :
- m_files(),
- m_space_id(ULINT_UNDEFINED),
- m_path(),
- m_flags(),
- m_ignore_read_only(false)
- {
- /* No op */
- }
+ Tablespace() {}
virtual ~Tablespace()
{
shutdown();
ut_ad(m_files.empty());
- ut_ad(m_space_id == ULINT_UNDEFINED);
+ ut_ad(m_space_id == UINT32_MAX);
}
// Disable copying
@@ -104,22 +95,19 @@ public:
/** Set the space id of the tablespace
@param[in] space_id tablespace ID to set */
- void set_space_id(ulint space_id)
+ void set_space_id(uint32_t space_id)
{
- ut_ad(m_space_id == ULINT_UNDEFINED);
+ ut_ad(m_space_id == UINT32_MAX);
m_space_id = space_id;
}
/** Get the space id of the tablespace
@return m_space_id space id of the tablespace */
- ulint space_id() const
- {
- return(m_space_id);
- }
+ uint32_t space_id() const { return m_space_id; }
/** Set the tablespace flags
@param[in] fsp_flags tablespace flags */
- void set_flags(ulint fsp_flags)
+ void set_flags(uint32_t fsp_flags)
{
ut_ad(fil_space_t::is_valid_flags(fsp_flags, false));
m_flags = fsp_flags;
@@ -127,24 +115,15 @@ public:
/** Get the tablespace flags
@return m_flags tablespace flags */
- ulint flags() const
- {
- return(m_flags);
- }
+ uint32_t flags() const { return m_flags; }
/** Get the tablespace encryption mode
@return m_mode tablespace encryption mode */
- fil_encryption_t encryption_mode() const
- {
- return (m_mode);
- }
+ fil_encryption_t encryption_mode() const { return m_mode; }
/** Get the tablespace encryption key_id
@return m_key_id tablespace encryption key_id */
- uint32_t key_id() const
- {
- return (m_key_id);
- }
+ uint32_t key_id() const { return m_key_id; }
/** Set Ignore Read Only Status for tablespace.
@param[in] read_only_status read only status indicator */
@@ -210,24 +189,21 @@ private:
@param[in] file data file object */
void file_found(Datafile& file);
- /* DATA MEMBERS */
-
/** Tablespace ID */
- ulint m_space_id;
+ uint32_t m_space_id = UINT32_MAX;
+ /** Tablespace flags */
+ uint32_t m_flags = UINT32_MAX;
- /** Path where tablespace files will reside, not including a filename.*/
+ /** Path where tablespace files will reside, excluding a filename */
char* m_path;
- /** Tablespace flags */
- ulint m_flags;
-
/** Encryption mode and key_id */
fil_encryption_t m_mode;
uint32_t m_key_id;
protected:
/** Ignore server read only configuration for this tablespace. */
- bool m_ignore_read_only;
+ bool m_ignore_read_only = false;
};
#endif /* fsp0space_h */
diff --git a/storage/innobase/include/fsp0sysspace.h b/storage/innobase/include/fsp0sysspace.h
index 2e0a395f71c..b6bdadd3501 100644
--- a/storage/innobase/include/fsp0sysspace.h
+++ b/storage/innobase/include/fsp0sysspace.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2016, 2021, 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
@@ -266,24 +267,15 @@ extern SysTablespace srv_tmp_space;
/** Check if the space_id is for a system-tablespace (shared + temp).
@param[in] id Space ID to check
@return true if id is a system tablespace, false if not. */
-UNIV_INLINE
-bool
-is_system_tablespace(ulint id)
+inline bool is_system_tablespace(uint32_t id)
{
- return(id == TRX_SYS_SPACE || id == SRV_TMP_SPACE_ID);
+ return id == TRX_SYS_SPACE || id == SRV_TMP_SPACE_ID;
}
/** Check if predefined shared tablespace.
@return true if predefined shared tablespace */
-UNIV_INLINE
-bool
-is_predefined_tablespace(
- ulint id)
+inline bool is_predefined_tablespace(uint32_t id)
{
- ut_ad(srv_sys_space.space_id() == TRX_SYS_SPACE);
- ut_ad(TRX_SYS_SPACE == 0);
- return(id == TRX_SYS_SPACE
- || id == SRV_TMP_SPACE_ID
- || srv_is_undo_tablespace(id));
+ return is_system_tablespace(id) || srv_is_undo_tablespace(id);
}
#endif /* fsp0sysspace_h */
diff --git a/storage/innobase/include/fsp0types.h b/storage/innobase/include/fsp0types.h
index 1912c31b744..9a23e840380 100644
--- a/storage/innobase/include/fsp0types.h
+++ b/storage/innobase/include/fsp0types.h
@@ -25,25 +25,24 @@ Created May 26, 2009 Vasil Dimov
*******************************************************/
#pragma once
-#include <cstddef>
+#include "ut0byte.h"
-/** The fil_space_t::id of the redo log. All persistent tablespaces
-have a smaller fil_space_t::id. */
-static constexpr size_t SRV_SPACE_ID_UPPER_BOUND= 0xFFFFFFF0;
+/** All persistent tablespaces have a smaller fil_space_t::id than this. */
+constexpr uint32_t SRV_SPACE_ID_UPPER_BOUND= 0xFFFFFFF0U;
/** The fil_space_t::id of the innodb_temporary tablespace. */
-#define SRV_TMP_SPACE_ID 0xFFFFFFFEU
-
-#include "ut0byte.h"
+constexpr uint32_t SRV_TMP_SPACE_ID= 0xFFFFFFFEU;
/* Possible values of innodb_compression_algorithm */
-#define PAGE_UNCOMPRESSED 0
-#define PAGE_ZLIB_ALGORITHM 1
-#define PAGE_LZ4_ALGORITHM 2
-#define PAGE_LZO_ALGORITHM 3
-#define PAGE_LZMA_ALGORITHM 4
+#define PAGE_UNCOMPRESSED 0
+#define PAGE_ZLIB_ALGORITHM 1
+#define PAGE_LZ4_ALGORITHM 2
+#define PAGE_LZO_ALGORITHM 3
+#define PAGE_LZMA_ALGORITHM 4
#define PAGE_BZIP2_ALGORITHM 5
#define PAGE_SNAPPY_ALGORITHM 6
-#define PAGE_ALGORITHM_LAST PAGE_SNAPPY_ALGORITHM
+#define PAGE_ALGORITHM_LAST PAGE_SNAPPY_ALGORITHM
+
+extern const char *page_compression_algorithms[];
/** @name Flags for inserting records in order
If records are inserted in order, there are the following
diff --git a/storage/innobase/include/ibuf0ibuf.h b/storage/innobase/include/ibuf0ibuf.h
index 93e46e7b0be..23d5258cfbc 100644
--- a/storage/innobase/include/ibuf0ibuf.h
+++ b/storage/innobase/include/ibuf0ibuf.h
@@ -336,7 +336,7 @@ dberr_t ibuf_merge_or_delete_for_page(buf_block_t *block,
/** Delete all change buffer entries for a tablespace,
in DISCARD TABLESPACE, IMPORT TABLESPACE, or crash recovery.
@param[in] space missing or to-be-discarded tablespace */
-void ibuf_delete_for_discarded_space(ulint space);
+void ibuf_delete_for_discarded_space(uint32_t space);
/** Contract the change buffer by reading pages to the buffer pool.
@return a lower limit for the combined size in bytes of entries which
diff --git a/storage/innobase/include/log0log.inl b/storage/innobase/include/log0log.inl
index c29c0bfa55f..73434737925 100644
--- a/storage/innobase/include/log0log.inl
+++ b/storage/innobase/include/log0log.inl
@@ -184,8 +184,8 @@ log_block_convert_lsn_to_no(
lsn_t lsn) /*!< in: lsn of a byte within the block */
{
return(((ulint) (lsn / OS_FILE_LOG_BLOCK_SIZE) &
- DBUG_EVALUATE_IF("innodb_small_log_block_no_limit",
- 0xFUL, 0x3FFFFFFFUL)) + 1);
+ (DBUG_IF("innodb_small_log_block_no_limit")
+ ? 0xFUL : 0x3FFFFFFFUL)) + 1);
}
/** Calculate the CRC-32C checksum of a log block.
diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h
index b1c09cfa2bc..6c47c135526 100644
--- a/storage/innobase/include/log0recv.h
+++ b/storage/innobase/include/log0recv.h
@@ -88,13 +88,13 @@ void recv_sys_justify_left_parsing_buf();
@param[in] len length of name, in bytes
@param[in] new_name new file name (NULL if not rename)
@param[in] new_len length of new_name, in bytes (0 if NULL) */
-extern void (*log_file_op)(ulint space_id, int type,
+extern void (*log_file_op)(uint32_t space_id, int type,
const byte* name, ulint len,
const byte* new_name, ulint new_len);
/** Report an operation which does INIT_PAGE for page0 during backup.
@param space_id tablespace identifier */
-extern void (*first_page_init)(ulint space_id);
+extern void (*first_page_init)(uint32_t space_id);
/** Stored redo log record */
struct log_rec_t
diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h
index 02f469e3a53..ad525b41d89 100644
--- a/storage/innobase/include/mtr0mtr.h
+++ b/storage/innobase/include/mtr0mtr.h
@@ -188,10 +188,10 @@ struct mtr_t {
(needed for generating a FILE_MODIFY record)
@param[in] space_id user or system tablespace ID
@return the tablespace */
- fil_space_t* set_named_space_id(ulint space_id)
+ fil_space_t* set_named_space_id(uint32_t space_id)
{
ut_ad(!m_user_space_id);
- ut_d(m_user_space_id = static_cast<uint32_t>(space_id));
+ ut_d(m_user_space_id = space_id);
if (!space_id) {
return fil_system.sys_space;
} else {
@@ -209,7 +209,7 @@ struct mtr_t {
void set_named_space(fil_space_t* space)
{
ut_ad(!m_user_space_id);
- ut_d(m_user_space_id = static_cast<uint32_t>(space->id));
+ ut_d(m_user_space_id = space->id);
if (space->id) {
m_user_space = space;
}
@@ -220,7 +220,7 @@ struct mtr_t {
(needed for generating a FILE_MODIFY record)
@param[in] space tablespace
@return whether the mini-transaction is associated with the space */
- bool is_named_space(ulint space) const;
+ bool is_named_space(uint32_t space) const;
/** Check the tablespace associated with the mini-transaction
(needed for generating a FILE_MODIFY record)
@param[in] space tablespace
@@ -228,10 +228,10 @@ struct mtr_t {
bool is_named_space(const fil_space_t* space) const;
#endif /* UNIV_DEBUG */
- /** Acquire a tablespace X-latch.
- @param[in] space_id tablespace ID
- @return the tablespace object (never NULL) */
- fil_space_t* x_lock_space(ulint space_id);
+ /** Acquire a tablespace X-latch.
+ @param space_id tablespace ID
+ @return the tablespace object (never NULL) */
+ fil_space_t *x_lock_space(uint32_t space_id);
/** Acquire a shared rw-latch. */
void s_lock(
@@ -568,7 +568,7 @@ public:
@param space_id tablespace identifier
@param path file path
@param new_path new file path for type=FILE_RENAME */
- inline void log_file_op(mfile_type_t type, ulint space_id,
+ inline void log_file_op(mfile_type_t type, uint32_t space_id,
const char *path,
const char *new_path= nullptr);
diff --git a/storage/innobase/include/row0merge.h b/storage/innobase/include/row0merge.h
index e9e250435f0..f29fd98ad30 100644
--- a/storage/innobase/include/row0merge.h
+++ b/storage/innobase/include/row0merge.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2005, 2016, 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
@@ -24,8 +24,7 @@ Index build routines using a merge sort
Created 13/06/2005 Jan Lindstrom
*******************************************************/
-#ifndef row0merge_h
-#define row0merge_h
+#pragma once
#include "que0types.h"
#include "trx0types.h"
@@ -36,7 +35,8 @@ Created 13/06/2005 Jan Lindstrom
#include "row0mysql.h"
#include "lock0types.h"
#include "srv0srv.h"
-#include "ut0stage.h"
+
+class ut_stage_alter_t;
/* Reserve free space from every block for key_version */
#define ROW_MERGE_RESERVE_SIZE 4
@@ -266,15 +266,16 @@ row_merge_build_indexes(
bool allow_non_null)
MY_ATTRIBUTE((warn_unused_result));
-/********************************************************************//**
-Write a buffer to a block. */
-void
-row_merge_buf_write(
-/*================*/
- const row_merge_buf_t* buf, /*!< in: sorted buffer */
- const merge_file_t* of, /*!< in: output file */
- row_merge_block_t* block) /*!< out: buffer for writing to file */
- MY_ATTRIBUTE((nonnull));
+/** Write a buffer to a block.
+@param buf sorted buffer
+@param block buffer for writing to file
+@param blob_file blob file handle for doing bulk insert operation */
+dberr_t row_merge_buf_write(const row_merge_buf_t *buf,
+#ifndef DBUG_OFF
+ const merge_file_t *of, /*!< output file */
+#endif
+ row_merge_block_t *block,
+ merge_file_t *blob_file= nullptr);
/********************************************************************//**
Sort a buffer. */
@@ -409,4 +410,75 @@ row_merge_read_rec(
row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */
ulint space) /*!< in: space id */
MY_ATTRIBUTE((warn_unused_result));
-#endif /* row0merge.h */
+
+/** Buffer for bulk insert */
+class row_merge_bulk_t
+{
+ /** Buffer for each index in the table. main memory
+ buffer for sorting the index */
+ row_merge_buf_t *m_merge_buf;
+ /** Block for IO operation */
+ row_merge_block_t *m_block= nullptr;
+ /** File to store the buffer and used for merge sort */
+ merge_file_t *m_merge_files= nullptr;
+ /** Temporary file to be used for merge sort */
+ pfs_os_file_t m_tmpfd;
+ /** Allocate memory for merge file data structure */
+ ut_allocator<row_merge_block_t> m_alloc;
+ /** Storage for description for the m_alloc */
+ ut_new_pfx_t m_block_pfx;
+ /** Temporary file to store the blob */
+ merge_file_t m_blob_file;
+public:
+ /** Constructor.
+ Create all merge files, merge buffer for all the table indexes
+ expect fts indexes.
+ Create a merge block which is used to write IO operation
+ @param table table which undergoes bulk insert operation */
+ row_merge_bulk_t(dict_table_t *table);
+
+ /** Destructor.
+ Remove all merge files, merge buffer for all table indexes. */
+ ~row_merge_bulk_t();
+
+ /** Remove all buffer for the table indexes */
+ void remove_all_bulk_buffer();
+
+ /** Clean the merge buffer for the given index number */
+ void clean_bulk_buffer(ulint index_no);
+
+ /** Create the temporary file for the given index number
+ @retval true if temporary file creation went well */
+ bool create_tmp_file(ulint index_no);
+
+ /** Write the merge buffer to the tmp file for the given
+ index number.
+ @param index_no buffer to be written for the index */
+ dberr_t write_to_tmp_file(ulint index_no);
+
+ /** Add the tuple to the merge buffer for the given index.
+ If the buffer ran out of memory then write the buffer into
+ the temporary file and do insert the tuple again.
+ @param row tuple to be inserted
+ @param ind index to be buffered
+ @param trx bulk transaction */
+ dberr_t bulk_insert_buffered(const dtuple_t &row, const dict_index_t &ind,
+ trx_t *trx);
+
+ /** Do bulk insert operation into the index tree from
+ buffer or merge file if exists
+ @param index_no index to be inserted
+ @param trx bulk transaction */
+ dberr_t write_to_index(ulint index_no, trx_t *trx);
+
+ /** Do bulk insert for the buffered insert for the table.
+ @param table table which undergoes for bulk insert operation
+ @param trx bulk transaction */
+ dberr_t write_to_table(dict_table_t *table, trx_t *trx);
+
+ /** Allocate block for writing the buffer into disk */
+ dberr_t alloc_block();
+
+ /** Init temporary files for each index */
+ void init_tmp_file();
+};
diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
index ad892ac9ae9..4cd77b08a60 100644
--- a/storage/innobase/include/srv0srv.h
+++ b/storage/innobase/include/srv0srv.h
@@ -254,12 +254,12 @@ extern bool srv_was_started;
extern char* srv_undo_dir;
/** Number of undo tablespaces to use. */
-extern ulong srv_undo_tablespaces;
+extern uint srv_undo_tablespaces;
/** The number of UNDO tablespaces that are active (hosting some rollback
segment). It is quite possible that some of the tablespaces doesn't host
any of the rollback-segment based on configuration used. */
-extern ulint srv_undo_tablespaces_active;
+extern uint32_t srv_undo_tablespaces_active;
/** Maximum size of undo tablespace. */
extern unsigned long long srv_max_undo_log_size;
diff --git a/storage/innobase/include/trx0rec.h b/storage/innobase/include/trx0rec.h
index 8143fd419fa..28b049ca729 100644
--- a/storage/innobase/include/trx0rec.h
+++ b/storage/innobase/include/trx0rec.h
@@ -196,7 +196,7 @@ trx_undo_report_row_operation(
const rec_offs* offsets, /*!< in: rec_get_offsets(rec) */
roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the
undo log record */
- MY_ATTRIBUTE((nonnull(1,2,8), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2), warn_unused_result));
/** status bit used for trx_undo_prev_version_build() */
diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
index a45bbac0334..bf9a2acd622 100644
--- a/storage/innobase/include/trx0trx.h
+++ b/storage/innobase/include/trx0trx.h
@@ -36,6 +36,7 @@ Created 3/26/1996 Heikki Tuuri
#include "fts0fts.h"
#include "read0types.h"
#include "ilist.h"
+#include "row0merge.h"
#include <vector>
@@ -435,6 +436,9 @@ class trx_mod_table_time_t
/** First modification of a system versioned column
(NONE= no versioning, BULK= the table was dropped) */
undo_no_t first_versioned= NONE;
+
+ /** Buffer to store insert opertion */
+ row_merge_bulk_t *bulk_store= nullptr;
public:
/** Constructor
@param rows number of modified rows so far */
@@ -468,8 +472,14 @@ public:
first_versioned= BULK;
}
- /** Notify the start of a bulk insert operation */
- void start_bulk_insert() { first|= BULK; }
+ /** Notify the start of a bulk insert operation
+ @param table table to do bulk operation */
+ void start_bulk_insert(dict_table_t *table)
+ {
+ first|= BULK;
+ if (!table->is_temporary())
+ bulk_store= new row_merge_bulk_t(table);
+ }
/** Notify the end of a bulk insert operation */
void end_bulk_insert() { first&= ~BULK; }
@@ -489,6 +499,36 @@ public:
first_versioned= NONE;
return false;
}
+
+ /** Add the tuple to the transaction bulk buffer for the given index.
+ @param entry tuple to be inserted
+ @param index bulk insert for the index
+ @param trx transaction */
+ dberr_t bulk_insert_buffered(const dtuple_t &entry,
+ const dict_index_t &index, trx_t *trx)
+ {
+ return bulk_store->bulk_insert_buffered(entry, index, trx);
+ }
+
+ /** Do bulk insert operation present in the buffered operation
+ @return DB_SUCCESS or error code */
+ dberr_t write_bulk(dict_table_t *table, trx_t *trx)
+ {
+ if (!bulk_store)
+ return DB_SUCCESS;
+ dberr_t err= bulk_store->write_to_table(table, trx);
+ delete bulk_store;
+ bulk_store= nullptr;
+ return err;
+ }
+
+ /** @return whether the buffer storage exist */
+ bool bulk_buffer_exist()
+ {
+ if (is_bulk_insert() && bulk_store)
+ return true;
+ return false;
+ }
};
/** Collection of persistent tables and their first modification
@@ -1078,6 +1118,36 @@ public:
return false;
}
+ /** @return logical modification time of a table only
+ if the table has bulk buffer exist in the transaction */
+ trx_mod_table_time_t *check_bulk_buffer(dict_table_t *table)
+ {
+ if (UNIV_LIKELY(!bulk_insert))
+ return nullptr;
+ ut_ad(!check_unique_secondary);
+ ut_ad(!check_foreigns);
+ auto it= mod_tables.find(table);
+ if (it == mod_tables.end() || !it->second.bulk_buffer_exist())
+ return nullptr;
+ return &it->second;
+ }
+
+ /** Do the bulk insert for the buffered insert operation
+ for the transaction.
+ @return DB_SUCCESS or error code */
+ dberr_t bulk_insert_apply()
+ {
+ if (UNIV_LIKELY(!bulk_insert))
+ return DB_SUCCESS;
+ ut_ad(!check_unique_secondary);
+ ut_ad(!check_foreigns);
+ for (auto& t : mod_tables)
+ if (t.second.is_bulk_insert())
+ if (dberr_t err= t.second.write_bulk(t.first, this))
+ return err;
+ return DB_SUCCESS;
+ }
+
private:
/** Assign a rollback segment for modifying temporary tables.
@return the assigned rollback segment */
diff --git a/storage/innobase/include/trx0types.h b/storage/innobase/include/trx0types.h
index 07c1c6a756b..d6ce902977c 100644
--- a/storage/innobase/include/trx0types.h
+++ b/storage/innobase/include/trx0types.h
@@ -38,7 +38,7 @@ the terminating NUL character. */
static const ulint TRX_ID_MAX_LEN = 17;
/** Space id of the transaction system page (the system tablespace) */
-static const ulint TRX_SYS_SPACE = 0;
+static constexpr uint32_t TRX_SYS_SPACE= 0;
/** Page number of the transaction system page */
#define TRX_SYS_PAGE_NO FSP_TRX_SYS_PAGE_NO
diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
index c2b60a9ea41..567554f34c3 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -214,36 +214,6 @@ management to ensure correct alignment for doubles etc. */
========================
*/
-#ifdef HAVE_LZO
-#define IF_LZO(A,B) A
-#else
-#define IF_LZO(A,B) B
-#endif
-
-#ifdef HAVE_LZ4
-#define IF_LZ4(A,B) A
-#else
-#define IF_LZ4(A,B) B
-#endif
-
-#ifdef HAVE_LZMA
-#define IF_LZMA(A,B) A
-#else
-#define IF_LZMA(A,B) B
-#endif
-
-#ifdef HAVE_BZIP2
-#define IF_BZIP2(A,B) A
-#else
-#define IF_BZIP2(A,B) B
-#endif
-
-#ifdef HAVE_SNAPPY
-#define IF_SNAPPY(A,B) A
-#else
-#define IF_SNAPPY(A,B) B
-#endif
-
#if defined (HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE) || defined(_WIN32)
#define IF_PUNCH_HOLE(A,B) A
#else
@@ -518,7 +488,7 @@ it is read or written. */
#include "ut0lst.h"
#include "ut0ut.h"
-extern ulong srv_page_size_shift;
+extern uint32_t srv_page_size_shift;
extern ulong srv_page_size;
/* Dimension of spatial object we support so far. It has its root in
diff --git a/storage/innobase/include/ut0pool.h b/storage/innobase/include/ut0pool.h
index ccea69fe549..bce443a51b2 100644
--- a/storage/innobase/include/ut0pool.h
+++ b/storage/innobase/include/ut0pool.h
@@ -311,12 +311,9 @@ private:
pool = UT_NEW_NOKEY(PoolType(m_size));
if (pool != NULL) {
-
- ut_ad(n_pools <= m_pools.size());
-
m_pools.push_back(pool);
- ib::info() << "Number of pools: "
+ ib::info() << "Number of transaction pools: "
<< m_pools.size();
added = true;
diff --git a/storage/innobase/innodb.cmake b/storage/innobase/innodb.cmake
index ae83fe8f97d..b28ba506875 100644
--- a/storage/innobase/innodb.cmake
+++ b/storage/innobase/innodb.cmake
@@ -19,19 +19,9 @@
INCLUDE(CheckFunctionExists)
INCLUDE(CheckCSourceCompiles)
INCLUDE(CheckCSourceRuns)
-INCLUDE(lz4.cmake)
-INCLUDE(lzo.cmake)
-INCLUDE(lzma.cmake)
-INCLUDE(bzip2.cmake)
-INCLUDE(snappy.cmake)
INCLUDE(numa)
INCLUDE(TestBigEndian)
-MYSQL_CHECK_LZ4()
-MYSQL_CHECK_LZO()
-MYSQL_CHECK_LZMA()
-MYSQL_CHECK_BZIP2()
-MYSQL_CHECK_SNAPPY()
MYSQL_CHECK_NUMA()
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake)
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 377c08b9290..ee274765a98 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -608,10 +608,10 @@ struct file_name_t {
/** Map of dirty tablespaces during recovery */
typedef std::map<
- ulint,
+ uint32_t,
file_name_t,
- std::less<ulint>,
- ut_allocator<std::pair<const ulint, file_name_t> > > recv_spaces_t;
+ std::less<uint32_t>,
+ ut_allocator<std::pair<const uint32_t, file_name_t> > > recv_spaces_t;
static recv_spaces_t recv_spaces;
@@ -997,11 +997,11 @@ fail:
@param[in] len length of name, in bytes
@param[in] new_name new file name (NULL if not rename)
@param[in] new_len length of new_name, in bytes (0 if NULL) */
-void (*log_file_op)(ulint space_id, int type,
+void (*log_file_op)(uint32_t space_id, int type,
const byte* name, ulint len,
const byte* new_name, ulint new_len);
-void (*first_page_init)(ulint space_id);
+void (*first_page_init)(uint32_t space_id);
/** Information about initializing page contents during redo log processing.
FIXME: Rely on recv_sys.pages! */
@@ -1203,7 +1203,7 @@ inline size_t recv_sys_t::files_size()
stored */
static
void
-fil_name_process(char* name, ulint len, ulint space_id,
+fil_name_process(char* name, ulint len, uint32_t space_id,
bool deleted, lsn_t lsn, store_t *store)
{
if (srv_operation == SRV_OPERATION_BACKUP
@@ -1270,10 +1270,15 @@ same_space:
f.name = fname.name;
f.status = file_name_t::NORMAL;
} else {
- ib::error() << "Tablespace " << space_id
- << " has been found in two places: '"
- << f.name << "' and '" << name << "'."
- " You must delete one of them.";
+ sql_print_error("InnoDB: Tablespace " UINT32PF
+ " has been found"
+ " in two places:"
+ " '%.*s' and '%s'."
+ " You must delete"
+ " one of them.",
+ space_id,
+ int(f.name.size()),
+ f.name.data(), name);
recv_sys.set_corrupt_fs();
}
break;
@@ -1296,10 +1301,12 @@ same_space:
Enable some more diagnostics when
forcing recovery. */
- ib::info()
- << "At LSN: " << recv_sys.recovered_lsn
- << ": unable to open file " << name
- << " for tablespace " << space_id;
+ sql_print_information(
+ "InnoDB: At LSN: " LSN_PF
+ ": unable to open file %s"
+ " for tablespace " UINT32PF,
+ recv_sys.recovered_lsn,
+ name, space_id);
}
break;
@@ -1315,34 +1322,39 @@ same_space:
case FIL_LOAD_INVALID:
ut_ad(space == NULL);
if (srv_force_recovery == 0) {
- ib::warn() << "We do not continue the crash"
+ sql_print_warning(
+ "InnoDB: We do not continue the crash"
" recovery, because the table may"
" become corrupt if we cannot apply"
" the log records in the InnoDB log to"
" it. To fix the problem and start"
- " mysqld:";
- ib::info() << "1) If there is a permission"
+ " mariadbd:");
+ sql_print_information(
+ "InnoDB: 1) If there is a permission"
" problem in the file and mysqld"
" cannot open the file, you should"
- " modify the permissions.";
- ib::info() << "2) If the tablespace is not"
+ " modify the permissions.");
+ sql_print_information(
+ "InnoDB: 2) If the tablespace is not"
" needed, or you can restore an older"
" version from a backup, then you can"
" remove the .ibd file, and use"
" --innodb_force_recovery=1 to force"
- " startup without this file.";
- ib::info() << "3) If the file system or the"
+ " startup without this file.");
+ sql_print_information(
+ "InnoDB: 3) If the file system or the"
" disk is broken, and you cannot"
" remove the .ibd file, you can set"
- " --innodb_force_recovery.";
+ " --innodb_force_recovery.");
recv_sys.set_corrupt_fs();
break;
}
- ib::info() << "innodb_force_recovery was set to "
- << srv_force_recovery << ". Continuing crash"
- " recovery even though we cannot access the"
- " files for tablespace " << space_id << ".";
+ sql_print_information(
+ "InnoDB: innodb_force_recovery was set to %lu."
+ " Continuing crash recovery even though"
+ " we cannot access the files for tablespace "
+ UINT32PF ".", srv_force_recovery, space_id);
break;
}
}
@@ -1617,10 +1629,11 @@ fail:
}
if (recv_sys.report(time(NULL))) {
- ib::info() << "Read redo log up to LSN=" << *start_lsn;
- service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
- "Read redo log up to LSN=" LSN_PF,
- *start_lsn);
+ sql_print_information("InnoDB: Read redo log up to LSN="
+ LSN_PF, *start_lsn);
+ service_manager_extend_timeout(
+ INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "Read redo log up to LSN=" LSN_PF, *start_lsn);
}
if (*start_lsn != end_lsn) {
@@ -1691,9 +1704,9 @@ static bool redo_file_sizes_are_correct()
if (it == paths.end())
return true;
- ib::error() << "Log file " << *it << " is of different size "
- << get_size(*it) << " bytes than other log files " << size
- << " bytes!";
+ sql_print_error("InnoDB: Log file %.*s is of different size " UINT64PF
+ " bytes than other log files " UINT64PF " bytes!",
+ int(it->size()), it->data(), get_size(*it), size);
return false;
}
@@ -1760,7 +1773,7 @@ ATTRIBUTE_COLD static dberr_t recv_log_recover_pre_10_2()
if (!log_crypt_101_read_checkpoint(buf))
{
- ib::error() << "Decrypting checkpoint failed";
+ sql_print_error("InnoDB: Decrypting checkpoint failed");
continue;
}
@@ -1782,11 +1795,11 @@ ATTRIBUTE_COLD static dberr_t recv_log_recover_pre_10_2()
if (!lsn)
{
- ib::error() << "Upgrade after a crash is not supported."
- " This redo log was created before MariaDB 10.2.2,"
- " and we did not find a valid checkpoint."
- " Please follow the instructions at"
- " https://mariadb.com/kb/en/library/upgrading/";
+ sql_print_error("InnoDB: Upgrade after a crash is not supported."
+ " This redo log was created before MariaDB 10.2.2,"
+ " and we did not find a valid checkpoint."
+ " Please follow the instructions at"
+ " https://mariadb.com/kb/en/library/upgrading/");
return DB_ERROR;
}
@@ -1794,7 +1807,7 @@ ATTRIBUTE_COLD static dberr_t recv_log_recover_pre_10_2()
log_sys.set_flushed_lsn(lsn);
const lsn_t source_offset= log_sys.log.calc_lsn_offset_old(lsn);
- static constexpr char NO_UPGRADE_RECOVERY_MSG[]=
+ static const char NO_UPGRADE_RECOVERY_MSG[]=
"Upgrade after a crash is not supported."
" This redo log was created before MariaDB 10.2.2";
@@ -1803,7 +1816,8 @@ ATTRIBUTE_COLD static dberr_t recv_log_recover_pre_10_2()
if (log_block_calc_checksum_format_0(buf) != log_block_get_checksum(buf) &&
!log_crypt_101_read_block(buf, lsn))
{
- ib::error() << NO_UPGRADE_RECOVERY_MSG << ", and it appears corrupted.";
+ sql_print_error("InnoDB: %s, and it appears corrupted.",
+ NO_UPGRADE_RECOVERY_MSG);
return DB_CORRUPTION;
}
@@ -1820,10 +1834,10 @@ ATTRIBUTE_COLD static dberr_t recv_log_recover_pre_10_2()
}
if (buf[20 + 32 * 9] == 2)
- ib::error() << "Cannot decrypt log for upgrading."
- " The encrypted log was created before MariaDB 10.2.2.";
+ sql_print_error("InnoDB: Cannot decrypt log for upgrading."
+ " The encrypted log was created before MariaDB 10.2.2.");
else
- ib::error() << NO_UPGRADE_RECOVERY_MSG << ".";
+ sql_print_error("InnoDB: %s.", NO_UPGRADE_RECOVERY_MSG);
return DB_ERROR;
}
@@ -1869,13 +1883,11 @@ static dberr_t recv_log_recover_10_4()
ulint cksum = log_block_get_checksum(buf);
if (UNIV_UNLIKELY(crc != cksum)) {
- ib::error() << "Invalid log block checksum."
- << " block: "
- << log_block_get_hdr_no(buf)
- << " checkpoint no: "
- << log_block_get_checkpoint_no(buf)
- << " expected: " << crc
- << " found: " << cksum;
+ sql_print_error("InnoDB: Invalid log block checksum."
+ " block: " ULINTPF " checkpoint no: " ULINTPF
+ " expected: " ULINTPF " found: " ULINTPF,
+ log_block_get_hdr_no(buf),
+ log_block_get_checkpoint_no(buf), crc, cksum);
return DB_CORRUPTION;
}
@@ -1930,7 +1942,7 @@ recv_find_max_checkpoint(ulint* max_field)
: 0;
if (log_sys.log.format != log_t::FORMAT_3_23
&& !recv_check_log_header_checksum(buf)) {
- ib::error() << "Invalid redo log header checksum.";
+ sql_print_error("InnoDB: Invalid redo log header checksum.");
return(DB_CORRUPTION);
}
@@ -1953,8 +1965,8 @@ recv_find_max_checkpoint(ulint* max_field)
case log_t::FORMAT_10_5 | log_t::FORMAT_ENCRYPTED:
break;
default:
- ib::error() << "Unsupported redo log format."
- " The redo log was created with " << creator << ".";
+ sql_print_error("InnoDB: Unsupported redo log format."
+ " The redo log was created with %s.", creator);
return(DB_ERROR);
}
@@ -1977,8 +1989,8 @@ recv_find_max_checkpoint(ulint* max_field)
if (log_sys.is_encrypted()
&& !log_crypt_read_checkpoint_buf(buf)) {
- ib::error() << "Reading checkpoint"
- " encryption info failed.";
+ sql_print_error("InnoDB: Reading checkpoint"
+ " encryption info failed.");
continue;
}
@@ -2003,14 +2015,14 @@ recv_find_max_checkpoint(ulint* max_field)
if (*max_field == 0) {
/* Before 10.2.2, we could get here during database
- initialization if we created an LOG_FILE_NAME file that
+ initialization if we created an ib_logfile0 file that
was filled with zeroes, and were killed. After
10.2.2, we would reject such a file already earlier,
when checking the file header. */
- ib::error() << "No valid checkpoint found"
- " (corrupted redo log)."
- " You can try --innodb-force-recovery=6"
- " as a last resort.";
+ sql_print_error("InnoDB: No valid checkpoint found"
+ " (corrupted redo log)."
+ " You can try --innodb-force-recovery=6"
+ " as a last resort.");
return(DB_ERROR);
}
@@ -2020,11 +2032,12 @@ recv_find_max_checkpoint(ulint* max_field)
break;
default:
if (dberr_t err = recv_log_recover_10_4()) {
- ib::error()
- << "Upgrade after a crash is not supported."
- " The redo log was created with " << creator
- << (err == DB_ERROR
- ? "." : ", and it appears corrupted.");
+ sql_print_error("InnoDB: Upgrade after a crash"
+ " is not supported."
+ " The redo log was created with %s%s.",
+ creator,
+ (err == DB_ERROR
+ ? "" : ", and it appears corrupted"));
return err;
}
}
@@ -2211,17 +2224,19 @@ loop:
goto eom_found;
if (UNIV_LIKELY((*l & 0x70) != RESERVED));
else if (srv_force_recovery)
- ib::warn() << "Ignoring unknown log record at LSN " << recovered_lsn;
+ sql_print_warning("InnoDB: Ignoring unknown log record at LSN " LSN_PF,
+ recovered_lsn);
else
{
malformed:
- ib::error() << "Malformed log record;"
- " set innodb_force_recovery=1 to ignore.";
+ sql_print_error("InnoDB: Malformed log record;"
+ " set innodb_force_recovery=1 to ignore.");
corrupted:
const size_t trailing_bytes= std::min<size_t>(100, size_t(end - l));
- ib::info() << "Dump from the start of the mini-transaction (LSN="
- << start_lsn << ") to "
- << trailing_bytes << " bytes after the record:";
+ sql_print_information("InnoDB: Dump from the start of the"
+ " mini-transaction (LSN=" LSN_PF ") to %zu"
+ " bytes after the record:",
+ start_lsn, trailing_bytes);
ut_print_buf(stderr, log, l - log + trailing_bytes);
putc('\n', stderr);
found_corrupt_log= true;
@@ -2238,7 +2253,7 @@ corrupted:
const uint32_t addlen= mlog_decode_varint(l);
if (UNIV_UNLIKELY(addlen == MLOG_DECODE_ERROR))
{
- ib::error() << "Corrupted record length";
+ sql_print_error("InnoDB: Corrupted record length");
goto corrupted;
}
rlen= addlen + 15;
@@ -2302,7 +2317,8 @@ record_corrupted:
/* FREE_PAGE,INIT_PAGE cannot be with same_page flag */
if (!srv_force_recovery)
goto malformed;
- ib::warn() << "Ignoring malformed log record at LSN " << recovered_lsn;
+ sql_print_warning("InnoDB: Ignoring malformed log record at LSN "
+ LSN_PF, recovered_lsn);
last_offset= 1; /* the next record must not be same_page */
continue;
}
@@ -2315,12 +2331,13 @@ record_corrupted:
page_id_corrupted:
if (!srv_force_recovery)
{
- ib::error() << "Corrupted page identifier at " << recovered_lsn
- << "; set innodb_force_recovery=1 to ignore the record.";
+ sql_print_error("InnoDB: Corrupted page identifier at " LSN_PF
+ "; set innodb_force_recovery=1 to ignore the record.",
+ recovered_lsn);
goto corrupted;
}
- ib::warn() << "Ignoring corrupted page identifier at LSN "
- << recovered_lsn;
+ sql_print_warning("InnoDB: Ignoring corrupted page identifier at LSN "
+ LSN_PF, recovered_lsn);
continue;
}
space_id= mlog_decode_varint(l);
@@ -2581,7 +2598,8 @@ same_page:
default:
if (!srv_force_recovery)
goto malformed;
- ib::warn() << "Ignoring malformed log record at LSN " << recovered_lsn;
+ sql_print_warning("InnoDB: Ignoring malformed log record at LSN "
+ LSN_PF, recovered_lsn);
continue;
case FILE_DELETE:
case FILE_MODIFY:
@@ -2591,13 +2609,13 @@ same_page:
file_rec_error:
if (!srv_force_recovery)
{
- ib::error() << "Corrupted file-level record;"
- " set innodb_force_recovery=1 to ignore.";
+ sql_print_error("InnoDB: Corrupted file-level record;"
+ " set innodb_force_recovery=1 to ignore.");
goto corrupted;
}
- ib::warn() << "Ignoring corrupted file-level record at LSN "
- << recovered_lsn;
+ sql_print_warning("InnoDB: Ignoring corrupted file-level record"
+ " at LSN " LSN_PF, recovered_lsn);
continue;
}
/* fall through */
@@ -2753,12 +2771,13 @@ static buf_block_t *recv_recover_page(buf_block_t *block, mtr_t &mtr,
if (skipped_after_init) {
skipped_after_init = false;
ut_ad(end_lsn == page_lsn);
- if (end_lsn != page_lsn)
- ib::warn()
- << "The last skipped log record LSN "
- << end_lsn
- << " is not equal to page LSN "
- << page_lsn;
+ if (end_lsn != page_lsn) {
+ sql_print_warning(
+ "InnoDB: The last skipped log record"
+ " LSN " LSN_PF
+ " is not equal to page LSN " LSN_PF,
+ end_lsn, page_lsn);
+ }
}
end_lsn = l->lsn;
@@ -2903,10 +2922,12 @@ done:
ut_ad(!block || !recv_sys.pages.empty());
if (recv_sys.report(now)) {
- const ulint n = recv_sys.pages.size();
- ib::info() << "To recover: " << n << " pages from log";
- service_manager_extend_timeout(
- INNODB_EXTEND_TIMEOUT_INTERVAL, "To recover: " ULINTPF " pages from log", n);
+ const size_t n = recv_sys.pages.size();
+ sql_print_information("InnoDB: To recover: %zu pages from log",
+ n);
+ service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
+ "To recover: %zu pages"
+ " from log", n);
}
return block;
@@ -3028,7 +3049,7 @@ static void recv_read_in_area(page_id_t page_id, recv_sys_t::map::iterator i)
if (p != page_nos)
{
mysql_mutex_unlock(&recv_sys.mutex);
- buf_read_recv_pages(page_id.space(), page_nos, ulint(p - page_nos));
+ buf_read_recv_pages(page_id.space(), {page_nos, p});
mysql_mutex_lock(&recv_sys.mutex);
}
}
@@ -3224,8 +3245,8 @@ void recv_sys_t::apply(bool last_batch)
const char *msg= last_batch
? "Starting final batch to recover "
: "Starting a batch to recover ";
- const ulint n= pages.size();
- ib::info() << msg << n << " pages from redo log.";
+ const size_t n= pages.size();
+ sql_print_information("InnoDB: %s %zu pages from redo log.", msg, n);
sd_notifyf(0, "STATUS=%s" ULINTPF " pages from redo log", msg, n);
apply_log_recs= true;
@@ -3337,7 +3358,8 @@ next_free_block:
continue;
}
if (is_corrupt_fs() && !srv_force_recovery)
- ib::info() << "Set innodb_force_recovery=1 to ignore corrupted pages.";
+ sql_print_information("InnoDB: Set innodb_force_recovery=1"
+ " to ignore corrupted pages.");
mysql_mutex_unlock(&mutex);
return;
}
@@ -3582,14 +3604,18 @@ static bool recv_scan_log_recs(
recv_needed_recovery = true;
if (srv_read_only_mode) {
- ib::warn() << "innodb_read_only"
- " prevents crash recovery";
+ sql_print_warning(
+ "InnoDB: innodb_read_only"
+ " prevents crash recovery");
return(true);
}
- ib::info() << "Starting crash recovery from"
- " checkpoint LSN=" << checkpoint_lsn
- << "," << recv_sys.scanned_lsn;
+ sql_print_information("InnoDB: Starting"
+ " crash recovery from"
+ " checkpoint LSN=" LSN_PF
+ "," LSN_PF,
+ checkpoint_lsn,
+ recv_sys.scanned_lsn);
}
/* We were able to find more log data: add it to the
@@ -3603,15 +3629,17 @@ static bool recv_scan_log_recs(
if (recv_sys.len + 4 * OS_FILE_LOG_BLOCK_SIZE
>= recv_parsing_buf_size) {
- ib::error() << "Log parsing buffer overflow."
- " Recovery may have failed!";
+ sql_print_error("InnoDB: Log parsing buffer"
+ " overflow."
+ " Recovery may have failed!");
recv_sys.set_corrupt_log();
if (!srv_force_recovery) {
- ib::error()
- << "Set innodb_force_recovery"
- " to ignore this error.";
+ sql_print_information(
+ "InnoDB: Set"
+ " innodb_force_recovery"
+ " to ignore this error.");
return(true);
}
} else if (!recv_sys.is_corrupt_log()) {
@@ -3758,29 +3786,38 @@ recv_init_missing_space(dberr_t err, const recv_spaces_t::const_iterator& i)
case SRV_OPERATION_RESTORE:
case SRV_OPERATION_RESTORE_EXPORT:
if (i->second.name.find("/#sql") != std::string::npos) {
- ib::warn() << "Tablespace " << i->first << " was not"
- " found at " << i->second.name << " when"
- " restoring a (partial?) backup. All redo log"
- " for this file will be ignored!";
+ sql_print_warning("InnoDB: Tablespace " UINT32PF
+ " was not found at %.*s when"
+ " restoring a (partial?) backup."
+ " All redo log"
+ " for this file will be ignored!",
+ i->first, int(i->second.name.size()),
+ i->second.name.data());
}
return(err);
}
if (srv_force_recovery == 0) {
- ib::error() << "Tablespace " << i->first << " was not"
- " found at " << i->second.name << ".";
+ sql_print_error("InnoDB: Tablespace " UINT32PF " was not"
+ " found at %.*s.", i->first,
+ int(i->second.name.size()),
+ i->second.name.data());
if (err == DB_SUCCESS) {
- ib::error() << "Set innodb_force_recovery=1 to"
+ sql_print_information(
+ "InnoDB: Set innodb_force_recovery=1 to"
" ignore this and to permanently lose"
- " all changes to the tablespace.";
+ " all changes to the tablespace.");
err = DB_TABLESPACE_NOT_FOUND;
}
} else {
- ib::warn() << "Tablespace " << i->first << " was not"
- " found at " << i->second.name << ", and"
- " innodb_force_recovery was set. All redo log"
- " for this tablespace will be ignored!";
+ sql_print_warning("InnoDB: Tablespace " UINT32PF
+ " was not found at %.*s"
+ ", and innodb_force_recovery was set."
+ " All redo log for this tablespace"
+ " will be ignored!",
+ i->first, int(i->second.name.size()),
+ i->second.name.data());
}
return(err);
@@ -3803,7 +3840,7 @@ recv_validate_tablespace(bool rescan, bool& missing_tablespace)
for (recv_sys_t::map::iterator p = recv_sys.pages.begin();
p != recv_sys.pages.end();) {
ut_ad(!p->second.log.empty());
- const ulint space = p->first.space();
+ const uint32_t space = p->first.space();
if (is_predefined_tablespace(space)) {
next:
p++;
@@ -3855,20 +3892,25 @@ func_exit:
missing_tablespace = true;
- if (srv_force_recovery > 0) {
- ib::warn() << "Tablespace " << rs.first
- <<" was not found at " << rs.second.name
- <<", and innodb_force_recovery was set."
- <<" All redo log for this tablespace"
- <<" will be ignored!";
+ if (srv_force_recovery) {
+ sql_print_warning("InnoDB: Tablespace " UINT32PF
+ " was not found at %.*s,"
+ " and innodb_force_recovery was set."
+ " All redo log for this tablespace"
+ " will be ignored!",
+ rs.first, int(rs.second.name.size()),
+ rs.second.name.data());
continue;
}
if (!rescan) {
- ib::info() << "Tablespace " << rs.first
- << " was not found at '"
- << rs.second.name << "', but there"
- <<" were no modifications either.";
+ sql_print_information("InnoDB: Tablespace " UINT32PF
+ " was not found at '%.*s',"
+ " but there were"
+ " no modifications either.",
+ rs.first,
+ int(rs.second.name.size()),
+ rs.second.name.data());
}
}
@@ -3917,9 +3959,10 @@ recv_init_crash_recovery_spaces(bool rescan, bool& missing_tablespace)
std::move(rs.second.freed_ranges));
}
} else if (rs.second.name == "") {
- ib::error() << "Missing FILE_CREATE, FILE_DELETE"
- " or FILE_MODIFY before FILE_CHECKPOINT"
- " for tablespace " << rs.first;
+ sql_print_error("InnoDB: Missing FILE_CREATE,"
+ " FILE_DELETE or FILE_MODIFY"
+ " before FILE_CHECKPOINT"
+ " for tablespace " UINT32PF, rs.first);
recv_sys.set_corrupt_log();
return(DB_CORRUPTION);
} else {
@@ -3976,18 +4019,19 @@ static dberr_t recv_rename_files()
only be possible if the recovery of both files was deferred
(no valid page 0 is contained in either file). We shall not
rename the file, just rename the metadata. */
- ib::info() << "Renaming tablespace metadata " << id
- << " from '" << old << "' to '" << r.second
- << "' that is also associated with tablespace "
- << other->id;
+ sql_print_information("InnoDB: Renaming tablespace metadata " UINT32PF
+ " from '%s' to '%s' that is also associated"
+ " with tablespace " UINT32PF,
+ id, old, new_name, other->id);
space->chain.start->name= mem_strdup(new_name);
ut_free(old);
}
else if (!os_file_status(new_name, &exists, &ftype) || exists)
{
- ib::error() << "Cannot replay rename of tablespace " << id
- << " from '" << old << "' to '" << r.second <<
- (exists ? "' because the target file exists" : "'");
+ sql_print_error("InnoDB: Cannot replay rename of tablespace " UINT32PF
+ " from '%s' to '%s'%s",
+ id, old, new_name, exists ?
+ " because the target file exists" : "");
err= DB_TABLESPACE_EXISTS;
}
else
@@ -3995,8 +4039,8 @@ static dberr_t recv_rename_files()
mysql_mutex_unlock(&fil_system.mutex);
err= space->rename(new_name, false);
if (err != DB_SUCCESS)
- ib::error() << "Cannot replay rename of tablespace " << id
- << " to '" << r.second << "': " << err;
+ sql_print_error("InnoDB: Cannot replay rename of tablespace "
+ UINT32PF " to '%s: %s", new_name, ut_strerr(err));
goto done;
}
mysql_mutex_unlock(&fil_system.mutex);
@@ -4037,9 +4081,8 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn)
ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex));
if (srv_force_recovery >= SRV_FORCE_NO_LOG_REDO) {
-
- ib::info() << "innodb_force_recovery=6 skips redo log apply";
-
+ sql_print_information("InnoDB: innodb_force_recovery=6"
+ " skips redo log apply");
return(DB_SUCCESS);
}
@@ -4050,7 +4093,6 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn)
err = recv_find_max_checkpoint(&max_cp_field);
if (err != DB_SUCCESS) {
-
recv_sys.recovered_lsn = log_sys.get_lsn();
mysql_mutex_unlock(&log_sys.mutex);
return(err);
@@ -4111,7 +4153,8 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn)
if (recv_sys.is_corrupt_log() && !srv_force_recovery) {
mysql_mutex_unlock(&log_sys.mutex);
- ib::warn() << "Log scan aborted at LSN " << contiguous_lsn;
+ sql_print_warning("InnoDB: Log scan aborted at LSN " LSN_PF,
+ contiguous_lsn);
return(DB_ERROR);
}
@@ -4119,13 +4162,11 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn)
lsn_t scan_lsn = log_sys.log.scanned_lsn;
if (!srv_read_only_mode && scan_lsn != checkpoint_lsn) {
mysql_mutex_unlock(&log_sys.mutex);
- ib::error err;
- err << "Missing FILE_CHECKPOINT";
- if (end_lsn) {
- err << " at " << end_lsn;
- }
- err << " between the checkpoint " << checkpoint_lsn
- << " and the end " << scan_lsn << ".";
+ sql_print_error("InnoDB: Missing FILE_CHECKPOINT"
+ " at " LSN_PF
+ " between the checkpoint " LSN_PF
+ " and the end " LSN_PF ".",
+ end_lsn, checkpoint_lsn, scan_lsn);
return(DB_ERROR);
}
@@ -4155,29 +4196,26 @@ completed:
ut_ad(!srv_log_file_created);
if (checkpoint_lsn + sizeof_checkpoint < flush_lsn) {
- ib::warn()
- << "Are you sure you are using the right "
- << LOG_FILE_NAME
- << " to start up the database? Log sequence "
- "number in the "
- << LOG_FILE_NAME << " is " << checkpoint_lsn
- << ", less than the log sequence number in "
- "the first system tablespace file header, "
- << flush_lsn << ".";
+ sql_print_warning("InnoDB: Are you sure you are using"
+ " the right ib_logfile0"
+ " to start up the database?"
+ " The checkpoint is " LSN_PF
+ ", less than the"
+ " log sequence number " LSN_PF
+ " in the system tablespace.",
+ checkpoint_lsn, flush_lsn);
}
if (!recv_needed_recovery) {
-
- ib::info()
- << "The log sequence number " << flush_lsn
- << " in the system tablespace does not match"
- " the log sequence number "
- << checkpoint_lsn << " in the "
- << LOG_FILE_NAME << "!";
+ sql_print_information(
+ "InnoDB: The log sequence number " LSN_PF
+ " in the system tablespace does not match"
+ " the log checkpoint " LSN_PF
+ " in ib_logfile0!", flush_lsn, checkpoint_lsn);
if (srv_read_only_mode) {
- ib::error() << "innodb_read_only"
- " prevents crash recovery";
+ sql_print_error("InnoDB: innodb_read_only"
+ " prevents crash recovery");
mysql_mutex_unlock(&log_sys.mutex);
return(DB_READ_ONLY);
}
@@ -4267,21 +4305,20 @@ completed:
&& (log_sys.log.scanned_lsn < checkpoint_lsn
|| log_sys.log.scanned_lsn < recv_max_page_lsn)) {
- ib::error() << "We scanned the log up to "
- << log_sys.log.scanned_lsn
- << ". A checkpoint was at " << checkpoint_lsn << " and"
- " the maximum LSN on a database page was "
- << recv_max_page_lsn << ". It is possible that the"
- " database is now corrupt!";
+ sql_print_error("InnoDB: We scanned the log up to " LSN_PF "."
+ " A checkpoint was at " LSN_PF
+ " and the maximum LSN on a database page was "
+ LSN_PF ". It is possible that the"
+ " database is now corrupt!",
+ log_sys.log.scanned_lsn, checkpoint_lsn,
+ recv_max_page_lsn);
}
if (recv_sys.recovered_lsn < checkpoint_lsn) {
mysql_mutex_unlock(&log_sys.mutex);
-
- ib::error() << "Recovered only to lsn:"
- << recv_sys.recovered_lsn
- << " checkpoint_lsn: " << checkpoint_lsn;
-
+ sql_print_error("InnoDB: Recovered only to lsn: " LSN_PF
+ " checkpoint_lsn: " LSN_PF,
+ recv_sys.recovered_lsn, checkpoint_lsn);
return(DB_ERROR);
}
@@ -4342,11 +4379,11 @@ bool recv_dblwr_t::validate_page(const page_id_t page_id,
{
if (page_id.page_no() == 0)
{
- ulint flags= fsp_header_get_flags(page);
+ uint32_t flags= fsp_header_get_flags(page);
if (!fil_space_t::is_valid_flags(flags, page_id.space()))
{
- ulint cflags= fsp_flags_convert_from_101(flags);
- if (cflags == ULINT_UNDEFINED)
+ uint32_t cflags= fsp_flags_convert_from_101(flags);
+ if (cflags == UINT32_MAX)
{
ib::warn() << "Ignoring a doublewrite copy of page " << page_id
<< "due to invalid flags " << ib::hex(flags);
diff --git a/storage/innobase/lz4.cmake b/storage/innobase/lz4.cmake
deleted file mode 100644
index a908dd3b73e..00000000000
--- a/storage/innobase/lz4.cmake
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2014, SkySQL Ab. All Rights Reserved.
-#
-# 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.
-#
-# 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.
-#
-# 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-1335 USA
-
-SET(WITH_INNODB_LZ4 AUTO CACHE STRING
- "Build with lz4. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'")
-
-MACRO (MYSQL_CHECK_LZ4)
- IF (WITH_INNODB_LZ4 STREQUAL "ON" OR WITH_INNODB_LZ4 STREQUAL "AUTO")
- CHECK_INCLUDE_FILES(lz4.h HAVE_LZ4_H)
- CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_limitedOutput "" HAVE_LZ4_SHARED_LIB)
- CHECK_LIBRARY_EXISTS(lz4 LZ4_compress_default "" HAVE_LZ4_COMPRESS_DEFAULT)
-
- IF (HAVE_LZ4_SHARED_LIB AND HAVE_LZ4_H)
- SET(HAVE_INNODB_LZ4 TRUE)
- ADD_DEFINITIONS(-DHAVE_LZ4=1)
- IF (HAVE_LZ4_COMPRESS_DEFAULT)
- ADD_DEFINITIONS(-DHAVE_LZ4_COMPRESS_DEFAULT=1)
- ENDIF()
- LINK_LIBRARIES(lz4)
- ELSE()
- IF (WITH_INNODB_LZ4 STREQUAL "ON")
- MESSAGE(FATAL_ERROR "Required lz4 library is not found")
- ENDIF()
- ENDIF()
- ENDIF()
- ADD_FEATURE_INFO(INNODB_LZ4 HAVE_INNODB_LZ4 "LZ4 compression in the InnoDB storage engine")
-ENDMACRO()
diff --git a/storage/innobase/lzma.cmake b/storage/innobase/lzma.cmake
deleted file mode 100644
index 3060139c27c..00000000000
--- a/storage/innobase/lzma.cmake
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2014, SkySQL Ab. All Rights Reserved.
-#
-# 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.
-#
-# 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.
-#
-# 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-1335 USA
-
-SET(WITH_INNODB_LZMA AUTO CACHE STRING
- "Build with lzma. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'")
-
-MACRO (MYSQL_CHECK_LZMA)
- IF (WITH_INNODB_LZMA STREQUAL "ON" OR WITH_INNODB_LZMA STREQUAL "AUTO")
- CHECK_INCLUDE_FILES(lzma.h HAVE_LZMA_H)
- CHECK_LIBRARY_EXISTS(lzma lzma_stream_buffer_decode "" HAVE_LZMA_DECODE)
- CHECK_LIBRARY_EXISTS(lzma lzma_easy_buffer_encode "" HAVE_LZMA_ENCODE)
-
- IF (HAVE_LZMA_DECODE AND HAVE_LZMA_ENCODE AND HAVE_LZMA_H)
- SET(HAVE_INNODB_LZMA TRUE)
- ADD_DEFINITIONS(-DHAVE_LZMA=1)
- LINK_LIBRARIES(lzma)
- ELSE()
- IF (WITH_INNODB_LZMA STREQUAL "ON")
- MESSAGE(FATAL_ERROR "Required lzma library is not found")
- ENDIF()
- ENDIF()
- ENDIF()
- ADD_FEATURE_INFO(INNODB_LZMA HAVE_INNODB_LZMA "LZMA compression in the InnoDB storage engine")
-ENDMACRO()
diff --git a/storage/innobase/lzo.cmake b/storage/innobase/lzo.cmake
deleted file mode 100644
index ca2de6ab1c5..00000000000
--- a/storage/innobase/lzo.cmake
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2014, SkySQL Ab. All Rights Reserved.
-#
-# 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.
-#
-# 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.
-#
-# 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-1335 USA
-
-SET(WITH_INNODB_LZO AUTO CACHE STRING
- "Build with lzo. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'")
-
-MACRO (MYSQL_CHECK_LZO)
- IF (WITH_INNODB_LZO STREQUAL "ON" OR WITH_INNODB_LZO STREQUAL "AUTO")
- CHECK_INCLUDE_FILES(lzo/lzo1x.h HAVE_LZO_H)
- CHECK_LIBRARY_EXISTS(lzo2 lzo1x_1_compress "" HAVE_LZO_SHARED_LIB)
-
- IF(HAVE_LZO_SHARED_LIB AND HAVE_LZO_H)
- SET(HAVE_INNODB_LZO TRUE)
- ADD_DEFINITIONS(-DHAVE_LZO=1)
- LINK_LIBRARIES(lzo2)
- ELSE()
- IF (WITH_INNODB_LZO STREQUAL "ON")
- MESSAGE(FATAL_ERROR "Required lzo library is not found")
- ENDIF()
- ENDIF()
- ENDIF()
- ADD_FEATURE_INFO(INNODB_LZO HAVE_INNODB_LZO "LZO compression in the InnoDB storage engine")
-ENDMACRO()
diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc
index 4a5b5f7124a..b6d520d2e76 100644
--- a/storage/innobase/mtr/mtr0mtr.cc
+++ b/storage/innobase/mtr/mtr0mtr.cc
@@ -672,7 +672,7 @@ void mtr_t::commit_files(lsn_t checkpoint_lsn)
@param[in] space tablespace
@return whether the mini-transaction is associated with the space */
bool
-mtr_t::is_named_space(ulint space) const
+mtr_t::is_named_space(uint32_t space) const
{
ut_ad(!m_user_space || m_user_space->id != TRX_SYS_SPACE);
return !is_logged() || m_user_space_id == space ||
@@ -694,8 +694,7 @@ bool mtr_t::is_named_space(const fil_space_t* space) const
/** Acquire a tablespace X-latch.
@param[in] space_id tablespace ID
@return the tablespace object (never NULL) */
-fil_space_t*
-mtr_t::x_lock_space(ulint space_id)
+fil_space_t *mtr_t::x_lock_space(uint32_t space_id)
{
fil_space_t* space;
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index 5155f6d0de0..39994fdb42f 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -4169,14 +4169,14 @@ corrupted:
FSP_HEADER_OFFSET + FSP_SPACE_ID + page, 4)
? ULINT_UNDEFINED
: mach_read_from_4(FIL_PAGE_SPACE_ID + page);
- ulint flags= fsp_header_get_flags(page);
+ uint32_t flags= fsp_header_get_flags(page);
const uint32_t size= fsp_header_get_field(page, FSP_SIZE);
const uint32_t free_limit= fsp_header_get_field(page, FSP_FREE_LIMIT);
const uint32_t free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page);
if (!fil_space_t::is_valid_flags(flags, space->id))
{
- ulint cflags= fsp_flags_convert_from_101(flags);
- if (cflags == ULINT_UNDEFINED)
+ uint32_t cflags= fsp_flags_convert_from_101(flags);
+ if (cflags == UINT32_MAX)
{
invalid:
ib::error() << "Expected tablespace flags "
@@ -4186,8 +4186,8 @@ invalid:
goto corrupted;
}
- ulint cf= cflags & ~FSP_FLAGS_MEM_MASK;
- ulint sf= space->flags & ~FSP_FLAGS_MEM_MASK;
+ uint32_t cf= cflags & ~FSP_FLAGS_MEM_MASK;
+ uint32_t sf= space->flags & ~FSP_FLAGS_MEM_MASK;
if (!fil_space_t::is_flags_equal(cf, sf) &&
!fil_space_t::is_flags_equal(sf, cf))
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc
index cc8844c3bd4..86e9662439a 100644
--- a/storage/innobase/row/row0ftsort.cc
+++ b/storage/innobase/row/row0ftsort.cc
@@ -875,7 +875,9 @@ loop:
if (t_ctx.rows_added[t_ctx.buf_used] && !processed) {
row_merge_buf_sort(buf[t_ctx.buf_used], NULL);
row_merge_buf_write(buf[t_ctx.buf_used],
+#ifndef DBUG_OFF
merge_file[t_ctx.buf_used],
+#endif
block[t_ctx.buf_used]);
if (!row_merge_write(merge_file[t_ctx.buf_used]->fd,
@@ -941,8 +943,11 @@ exit:
for (i = 0; i < FTS_NUM_AUX_INDEX; i++) {
if (t_ctx.rows_added[i]) {
row_merge_buf_sort(buf[i], NULL);
- row_merge_buf_write(
- buf[i], merge_file[i], block[i]);
+ row_merge_buf_write(buf[i],
+#ifndef DBUG_OFF
+ merge_file[i],
+#endif
+ block[i]);
/* Write to temp file, only if records have
been flushed to temp file before (offset > 0):
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index 96202311198..716817f9a30 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -41,12 +41,8 @@ Created 2012-02-08 by Sunny Bains.
#include "fil0pagecompress.h"
#include "trx0undo.h"
#include "lock0lock.h"
-#ifdef HAVE_LZO
#include "lzo/lzo1x.h"
-#endif
-#ifdef HAVE_SNAPPY
#include "snappy-c.h"
-#endif
#include "scope.h"
@@ -83,9 +79,9 @@ struct row_index_t {
in the exporting server */
byte* m_name; /*!< Index name */
- ulint m_space; /*!< Space where it is placed */
+ uint32_t m_space; /*!< Space where it is placed */
- ulint m_page_no; /*!< Root page number */
+ uint32_t m_page_no; /*!< Root page number */
ulint m_type; /*!< Index type */
@@ -408,14 +404,14 @@ class AbstractCallback
public:
/** Constructor
@param trx covering transaction */
- AbstractCallback(trx_t* trx, ulint space_id)
+ AbstractCallback(trx_t* trx, uint32_t space_id)
:
m_zip_size(0),
m_trx(trx),
m_space(space_id),
m_xdes(),
- m_xdes_page_no(ULINT_UNDEFINED),
- m_space_flags(ULINT_UNDEFINED) UNIV_NOTHROW { }
+ m_xdes_page_no(UINT32_MAX),
+ m_space_flags(UINT32_MAX) UNIV_NOTHROW { }
/** Free any extent descriptor instance */
virtual ~AbstractCallback()
@@ -438,10 +434,7 @@ public:
}
/** @return the tablespace flags */
- ulint get_space_flags() const
- {
- return(m_space_flags);
- }
+ uint32_t get_space_flags() const { return m_space_flags; }
/**
Set the name of the physical file and the file handle that is used
@@ -472,7 +465,7 @@ public:
virtual dberr_t operator()(buf_block_t* block) UNIV_NOTHROW = 0;
/** @return the tablespace identifier */
- ulint get_space_id() const { return m_space; }
+ uint32_t get_space_id() const { return m_space; }
bool is_interrupted() const { return trx_is_interrupted(m_trx); }
@@ -515,7 +508,7 @@ protected:
@param page page contents
@return DB_SUCCESS or error code. */
dberr_t set_current_xdes(
- ulint page_no,
+ uint32_t page_no,
const page_t* page) UNIV_NOTHROW
{
m_xdes_page_no = page_no;
@@ -580,19 +573,16 @@ protected:
trx_t* m_trx;
/** Space id of the file being iterated over. */
- ulint m_space;
-
- /** Current size of the space in pages */
- ulint m_size;
+ uint32_t m_space;
/** Current extent descriptor page */
xdes_t* m_xdes;
/** Physical page offset in the file of the extent descriptor */
- ulint m_xdes_page_no;
+ uint32_t m_xdes_page_no;
/** Flags value read from the header page */
- ulint m_space_flags;
+ uint32_t m_space_flags;
};
/** Determine the page size to use for traversing the tablespace
@@ -608,8 +598,8 @@ AbstractCallback::init(
m_space_flags = fsp_header_get_flags(page);
if (!fil_space_t::is_valid_flags(m_space_flags, true)) {
- ulint cflags = fsp_flags_convert_from_101(m_space_flags);
- if (cflags == ULINT_UNDEFINED) {
+ uint32_t cflags = fsp_flags_convert_from_101(m_space_flags);
+ if (cflags == UINT32_MAX) {
return(DB_CORRUPTION);
}
m_space_flags = cflags;
@@ -638,8 +628,7 @@ AbstractCallback::init(
return(DB_CORRUPTION);
}
- m_size = mach_read_from_4(page + FSP_SIZE);
- if (m_space == ULINT_UNDEFINED) {
+ if (m_space == UINT32_MAX) {
m_space = mach_read_from_4(FSP_HEADER_OFFSET + FSP_SPACE_ID
+ page);
}
@@ -673,13 +662,13 @@ struct FetchIndexRootPages : public AbstractCallback {
/** Index information gathered from the .ibd file. */
struct Index {
- Index(index_id_t id, ulint page_no)
+ Index(index_id_t id, uint32_t page_no)
:
m_id(id),
m_page_no(page_no) { }
index_id_t m_id; /*!< Index id */
- ulint m_page_no; /*!< Root page number */
+ uint32_t m_page_no; /*!< Root page number */
};
/** Constructor
@@ -687,7 +676,7 @@ struct FetchIndexRootPages : public AbstractCallback {
@param table table definition in server .*/
FetchIndexRootPages(const dict_table_t* table, trx_t* trx)
:
- AbstractCallback(trx, ULINT_UNDEFINED),
+ AbstractCallback(trx, UINT32_MAX),
m_table(table), m_index(0, 0) UNIV_NOTHROW { }
/** Destructor */
@@ -732,7 +721,7 @@ dberr_t FetchIndexRootPages::operator()(buf_block_t* block) UNIV_NOTHROW
m_index.m_page_no = block->page.id().page_no();
/* Check that the tablespace flags match the table flags. */
- ulint expected = dict_tf_to_fsp_flags(m_table->flags);
+ const uint32_t expected = dict_tf_to_fsp_flags(m_table->flags);
if (!fsp_flags_match(expected, m_space_flags)) {
ib_errf(m_trx->mysql_thd, IB_LOG_LEVEL_ERROR,
ER_TABLE_SCHEMA_MISMATCH,
@@ -849,7 +838,7 @@ public:
@param cfg config of table being imported.
@param space_id tablespace identifier
@param trx transaction covering the import */
- PageConverter(row_import* cfg, ulint space_id, trx_t* trx)
+ PageConverter(row_import* cfg, uint32_t space_id, trx_t* trx)
:
AbstractCallback(trx, space_id),
m_cfg(cfg),
@@ -1421,7 +1410,7 @@ row_import::set_root_by_name() UNIV_NOTHROW
/* We've already checked that it exists. */
ut_a(index != 0);
- index->page = static_cast<uint32_t>(cfg_index->m_page_no);
+ index->page = cfg_index->m_page_no;
}
}
@@ -1478,8 +1467,7 @@ row_import::set_root_by_heuristic() UNIV_NOTHROW
cfg_index[i].m_srv_index = index;
- index->page = static_cast<uint32_t>(
- cfg_index[i++].m_page_no);
+ index->page = cfg_index[i++].m_page_no;
}
}
@@ -3056,8 +3044,8 @@ row_import_read_meta_data(
/* decrypt and decompress page if needed */
static dberr_t decrypt_decompress(fil_space_crypt_t *space_crypt,
- size_t space_flags, span<byte> page,
- size_t space_id, byte *page_compress_buf)
+ uint32_t space_flags, span<byte> page,
+ uint32_t space_id, byte *page_compress_buf)
{
auto *data= page.data();
@@ -3066,8 +3054,8 @@ static dberr_t decrypt_decompress(fil_space_crypt_t *space_crypt,
if (!buf_page_verify_crypt_checksum(data, space_flags))
return DB_CORRUPTION;
- if (dberr_t err= fil_space_decrypt(space_id, space_crypt, data,
- page.size(), space_flags, data))
+ if (dberr_t err= fil_space_decrypt(space_id, space_flags, space_crypt,
+ data, page.size(), data))
return err;
}
@@ -3100,13 +3088,11 @@ static dberr_t decrypt_decompress(fil_space_crypt_t *space_crypt,
static size_t get_buf_size()
{
- return srv_page_size
-#ifdef HAVE_LZO
- + LZO1X_1_15_MEM_COMPRESS
-#elif defined HAVE_SNAPPY
- + snappy_max_compressed_length(srv_page_size)
-#endif
- ;
+ return srv_page_size + (
+ provider_service_lzo->is_loaded ? LZO1X_1_15_MEM_COMPRESS :
+ provider_service_snappy->is_loaded ? snappy_max_compressed_length(srv_page_size) :
+ 0
+ );
}
/* find, parse instant metadata, performing variaous checks,
@@ -3157,7 +3143,7 @@ static dberr_t handle_instant_metadata(dict_table_t *table,
if (!fil_space_t::is_valid_flags(space_flags, true))
{
auto cflags= fsp_flags_convert_from_101(space_flags);
- if (cflags == ULINT_UNDEFINED)
+ if (cflags == UINT32_MAX)
{
ib::error() << "Invalid FSP_SPACE_FLAGS=" << ib::hex(space_flags);
return DB_CORRUPTION;
@@ -3772,12 +3758,8 @@ page_corrupted:
if (!buf_page_verify_crypt_checksum(readptr, m_space_flags))
goto page_corrupted;
- if (ENCRYPTION_KEY_NOT_ENCRYPTED ==
- buf_page_get_key_version(readptr, m_space_flags))
- goto page_corrupted;
-
- if ((err= fil_space_decrypt(get_space_id(), iter.crypt_data, readptr, size,
- m_space_flags, readptr)))
+ if ((err= fil_space_decrypt(get_space_id(), m_space_flags, iter.crypt_data,
+ readptr, size, readptr)))
goto func_exit;
}
@@ -3820,7 +3802,7 @@ static dberr_t fil_iterate(
return DB_OUT_OF_MEMORY;
}
- ulint actual_space_id = 0;
+ uint32_t actual_space_id = 0;
const bool full_crc32 = fil_space_t::full_crc32(
callback.get_space_flags());
@@ -3948,9 +3930,9 @@ page_corrupted:
if ((err = fil_space_decrypt(
actual_space_id,
+ callback.get_space_flags(),
iter.crypt_data, dst,
callback.physical_size(),
- callback.get_space_flags(),
src))) {
goto func_exit;
}
@@ -4493,11 +4475,9 @@ row_import_for_mysql(
we will not be writing any redo log for it before we have invoked
fil_space_t::set_imported() to declare it a persistent tablespace. */
- ulint fsp_flags = dict_tf_to_fsp_flags(table->flags);
-
table->space = fil_ibd_open(
2, FIL_TYPE_IMPORT, table->space_id,
- fsp_flags, name, filepath, &err);
+ dict_tf_to_fsp_flags(table->flags), name, filepath, &err);
ut_ad((table->space == NULL) == (err != DB_SUCCESS));
DBUG_EXECUTE_IF("ib_import_open_tablespace_failure",
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index b51251094b9..c491030070c 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -2631,19 +2631,25 @@ commit_exit:
&& !index->table->skip_alter_undo
&& !index->table->n_rec_locks
&& !index->table->is_active_ddl()
+ && !index->table->has_spatial_index()
&& !trx->is_wsrep() /* FIXME: MDEV-24623 */
&& !thd_is_slave(trx->mysql_thd) /* FIXME: MDEV-24622 */) {
DEBUG_SYNC_C("empty_root_page_insert");
+ trx->bulk_insert = true;
+
if (!index->table->is_temporary()) {
err = lock_table(index->table, NULL, LOCK_X, thr);
if (err != DB_SUCCESS) {
trx->error_state = err;
+ trx->bulk_insert = false;
goto commit_exit;
}
if (index->table->n_rec_locks) {
+avoid_bulk:
+ trx->bulk_insert = false;
goto skip_bulk_insert;
}
@@ -2658,9 +2664,20 @@ commit_exit:
#else /* BTR_CUR_HASH_ADAPT */
index->table->bulk_trx_id = trx->id;
#endif /* BTR_CUR_HASH_ADAPT */
- }
- trx->bulk_insert = true;
+ /* Write TRX_UNDO_EMPTY undo log and
+ start buffering the insert operation */
+ err = trx_undo_report_row_operation(
+ thr, index, entry,
+ nullptr, 0, nullptr, nullptr,
+ nullptr);
+
+ if (err != DB_SUCCESS) {
+ goto avoid_bulk;
+ }
+
+ goto commit_exit;
+ }
}
skip_bulk_insert:
@@ -3185,7 +3202,7 @@ row_ins_sec_index_entry(
bool check_foreign) /*!< in: true if check
foreign table is needed, false otherwise */
{
- dberr_t err;
+ dberr_t err = DB_SUCCESS;
mem_heap_t* offsets_heap;
mem_heap_t* heap;
trx_id_t trx_id = 0;
@@ -3262,13 +3279,24 @@ row_ins_index_entry(
dtuple_t* entry, /*!< in/out: index entry to insert */
que_thr_t* thr) /*!< in: query thread */
{
- ut_ad(thr_get_trx(thr)->id || index->table->no_rollback()
+ trx_t* trx = thr_get_trx(thr);
+
+ ut_ad(trx->id || index->table->no_rollback()
|| index->table->is_temporary());
DBUG_EXECUTE_IF("row_ins_index_entry_timeout", {
DBUG_SET("-d,row_ins_index_entry_timeout");
return(DB_LOCK_WAIT);});
+ if (index->is_btree()) {
+ if (auto t= trx->check_bulk_buffer(index->table)) {
+ /* MDEV-25036 FIXME: check also foreign key
+ constraints */
+ ut_ad(!trx->check_foreigns);
+ return t->bulk_insert_buffered(*entry, *index, trx);
+ }
+ }
+
if (index->is_primary()) {
return row_ins_clust_index_entry(index, entry, thr, 0);
} else {
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index f01231fda16..0416fb482cb 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -268,9 +268,18 @@ private:
@param[in] row_buf row_buf the sorted data tuples,
or NULL if fd, block will be used instead
@param[in,out] btr_bulk btr bulk instance
+@param[in] table_total_rows total rows of old table
+@param[in] pct_progress total progress percent untill now
+@param[in] pct_cost current progress percent
+@param[in] crypt_block buffer for encryption or NULL
+@param[in] space space id
@param[in,out] stage performance schema accounting object, used by
ALTER TABLE. If not NULL stage->begin_phase_insert() will be called initially
and then stage->inc() will be called for each record that is processed.
+@param[in] blob_file To read big column field data from
+ the given blob file. It is
+ applicable only for bulk insert
+ operation
@return DB_SUCCESS or error number */
static MY_ATTRIBUTE((warn_unused_result))
dberr_t
@@ -281,14 +290,13 @@ row_merge_insert_index_tuples(
row_merge_block_t* block,
const row_merge_buf_t* row_buf,
BtrBulk* btr_bulk,
- const ib_uint64_t table_total_rows, /*!< in: total rows of old table */
- const double pct_progress, /*!< in: total progress
- percent until now */
- const double pct_cost, /*!< in: current progress percent
- */
- row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */
- ulint space, /*!< in: space id */
- ut_stage_alter_t* stage = NULL);
+ const ib_uint64_t table_total_rows,
+ double pct_progress,
+ double pct_cost,
+ row_merge_block_t* crypt_block,
+ ulint space,
+ ut_stage_alter_t* stage= nullptr,
+ merge_file_t* blob_file= nullptr);
/******************************************************//**
Encode an index record. */
@@ -326,35 +334,23 @@ row_merge_buf_encode(
*b += size;
}
-/******************************************************//**
-Allocate a sort buffer.
-@return own: sort buffer */
static MY_ATTRIBUTE((malloc, nonnull))
row_merge_buf_t*
row_merge_buf_create_low(
-/*=====================*/
- mem_heap_t* heap, /*!< in: heap where allocated */
- dict_index_t* index, /*!< in: secondary index */
- ulint max_tuples, /*!< in: maximum number of
- data tuples */
- ulint buf_size) /*!< in: size of the buffer,
- in bytes */
+ row_merge_buf_t *buf, mem_heap_t *heap, dict_index_t *index)
{
- row_merge_buf_t* buf;
-
- ut_ad(max_tuples > 0);
-
- ut_ad(max_tuples <= srv_sort_buf_size);
-
- buf = static_cast<row_merge_buf_t*>(mem_heap_zalloc(heap, buf_size));
- buf->heap = heap;
- buf->index = index;
- buf->max_tuples = max_tuples;
- buf->tuples = static_cast<mtuple_t*>(
- ut_malloc_nokey(2 * max_tuples * sizeof *buf->tuples));
- buf->tmp_tuples = buf->tuples + max_tuples;
-
- return(buf);
+ ulint max_tuples = srv_sort_buf_size
+ / std::max<ulint>(1, dict_index_get_min_size(index));
+ ut_ad(max_tuples > 0);
+ ut_ad(max_tuples <= srv_sort_buf_size);
+
+ buf->heap = heap;
+ buf->index = index;
+ buf->max_tuples = max_tuples;
+ buf->tuples = static_cast<mtuple_t*>(
+ ut_malloc_nokey(2 * max_tuples * sizeof *buf->tuples));
+ buf->tmp_tuples = buf->tuples + max_tuples;
+ return(buf);
}
/******************************************************//**
@@ -366,18 +362,16 @@ row_merge_buf_create(
dict_index_t* index) /*!< in: secondary index */
{
row_merge_buf_t* buf;
- ulint max_tuples;
ulint buf_size;
mem_heap_t* heap;
- max_tuples = srv_sort_buf_size
- / std::max<ulint>(1, dict_index_get_min_size(index));
-
buf_size = (sizeof *buf);
heap = mem_heap_create(buf_size);
- buf = row_merge_buf_create_low(heap, index, max_tuples, buf_size);
+ buf = static_cast<row_merge_buf_t*>(
+ mem_heap_zalloc(heap, buf_size));
+ row_merge_buf_create_low(buf, heap, index);
return(buf);
}
@@ -470,6 +464,68 @@ row_merge_buf_redundant_convert(
dfield_set_data(field, buf, len);
}
+/** Insert the tuple into bulk buffer insert operation
+@param buf merge buffer for the index operation
+@param table bulk insert operation for the table
+@param row tuple to be inserted
+@return number of rows inserted */
+static ulint row_merge_bulk_buf_add(row_merge_buf_t* buf,
+ const dict_table_t &table,
+ const dtuple_t &row)
+{
+ if (buf->n_tuples >= buf->max_tuples)
+ return 0;
+
+ const dict_index_t *index= buf->index;
+ ulint n_fields= dict_index_get_n_fields(index);
+ mtuple_t *entry= &buf->tuples[buf->n_tuples];
+ ulint data_size= 0;
+ ulint extra_size= UT_BITS_IN_BYTES(unsigned(index->n_nullable));
+ dfield_t *field= entry->fields= static_cast<dfield_t*>(
+ mem_heap_alloc(buf->heap, n_fields * sizeof *entry->fields));
+ const dict_field_t *ifield= dict_index_get_nth_field(index, 0);
+
+ for (ulint i = 0; i < n_fields; i++, field++, ifield++)
+ {
+ dfield_copy(field, &row.fields[i]);
+ ulint len= dfield_get_len(field);
+ const dict_col_t* const col= ifield->col;
+
+ if (dfield_is_null(field))
+ continue;
+
+ ulint fixed_len= ifield->fixed_len;
+
+ if (fixed_len);
+ else if (len < 128 || (!DATA_BIG_COL(col)))
+ extra_size++;
+ else
+ extra_size += 2;
+ data_size += len;
+ }
+
+ /* Add to the total size of the record in row_merge_block_t
+ the encoded length of extra_size and the extra bytes (extra_size).
+ See row_merge_buf_write() for the variable-length encoding
+ of extra_size. */
+ data_size += (extra_size + 1) + ((extra_size + 1) >= 0x80);
+
+ /* Reserve bytes for the end marker of row_merge_block_t. */
+ if (buf->total_size + data_size >= srv_sort_buf_size)
+ return 0;
+
+ buf->total_size += data_size;
+ buf->n_tuples++;
+
+ field= entry->fields;
+
+ do
+ dfield_dup(field++, buf->heap);
+ while (--n_fields);
+
+ return 1;
+}
+
/** Insert a data tuple into a sort buffer.
@param[in,out] buf sort buffer
@param[in] fts_index fts index to be created
@@ -990,25 +1046,135 @@ row_merge_buf_sort(
buf->tuples, buf->tmp_tuples, 0, buf->n_tuples);
}
-/******************************************************//**
-Write a buffer to a block. */
-void
-row_merge_buf_write(
-/*================*/
- const row_merge_buf_t* buf, /*!< in: sorted buffer */
- const merge_file_t* of UNIV_UNUSED,
- /*!< in: output file */
- row_merge_block_t* block) /*!< out: buffer for writing to file */
+/** Write the blob field data to temporary file and fill the offset,
+length in the field data
+@param field tuple field
+@param blob_file file to store the blob data
+@param heap heap to store the blob offset and length
+@return DB_SUCCESS if successful */
+static dberr_t row_merge_write_blob_to_tmp_file(
+ dfield_t *field, merge_file_t *blob_file,mem_heap_t **heap)
+{
+ if (blob_file->fd == OS_FILE_CLOSED)
+ {
+ blob_file->fd= row_merge_file_create_low(nullptr);
+ if (blob_file->fd == OS_FILE_CLOSED)
+ return DB_OUT_OF_MEMORY;
+ }
+ uint64_t val= blob_file->offset;
+ uint32_t len= field->len;
+ dberr_t err= os_file_write(
+ IORequestWrite, "(bulk insert)", blob_file->fd,
+ field->data, blob_file->offset * srv_page_size, len);
+
+ if (err != DB_SUCCESS)
+ return err;
+
+ byte *data= static_cast<byte*>
+ (mem_heap_alloc(*heap, BTR_EXTERN_FIELD_REF_SIZE));
+
+ /* Write zeroes for first 8 bytes */
+ memset(data, 0, 8);
+ /* Write offset for next 8 bytes */
+ mach_write_to_8(data + 8, val);
+ /* Write length of the blob in 4 bytes */
+ mach_write_to_4(data + 16, len);
+ blob_file->offset+= field->len;
+ blob_file->n_rec++;
+ dfield_set_data(field, data, BTR_EXTERN_FIELD_REF_SIZE);
+ dfield_set_ext(field);
+ return err;
+}
+
+/** This function is invoked when tuple size is greater than
+innodb_sort_buffer_size. Basically it recreates the tuple
+by writing the blob field to the temporary file.
+@param entry index fields to be encode the blob
+@param blob_file file to store the blob data
+@param heap heap to store the blob offset and blob length
+@return tuple which fits into sort_buffer_size */
+static dtuple_t* row_merge_buf_large_tuple(const dtuple_t &entry,
+ merge_file_t *blob_file,
+ mem_heap_t **heap)
+{
+ if (!*heap)
+ *heap= mem_heap_create(DTUPLE_EST_ALLOC(entry.n_fields));
+
+ dtuple_t *tuple= dtuple_copy(&entry, *heap);
+ for (ulint i= 0; i < tuple->n_fields; i++)
+ {
+ dfield_t *field= &tuple->fields[i];
+ if (dfield_is_null(field) || field->len <= 2000)
+ continue;
+
+ dberr_t err= row_merge_write_blob_to_tmp_file(field, blob_file, heap);
+ if (err != DB_SUCCESS)
+ return nullptr;
+ }
+
+ return tuple;
+}
+
+
+/** Write the field data whose length is more than 2000 bytes
+into blob temporary file and write offset, length into the
+tuple field
+@param entry index fields to be encode the blob
+@param n_fields number of fields in the entry
+@param heap heap to store the blob offset and blob length
+@param blob_file file to store the blob data */
+static dberr_t row_merge_buf_blob(const mtuple_t *entry, ulint n_fields,
+ mem_heap_t **heap, merge_file_t *blob_file)
+{
+
+ if (!*heap)
+ *heap= mem_heap_create(100);
+
+ for (ulint i= 0; i < n_fields; i++)
+ {
+ dfield_t *field= &entry->fields[i];
+ if (dfield_is_null(field) || field->len <= 2000)
+ continue;
+
+ dberr_t err= row_merge_write_blob_to_tmp_file(field, blob_file, heap);
+ if (err != DB_SUCCESS)
+ return err;
+ }
+
+ return DB_SUCCESS;
+}
+
+/** Write a buffer to a block.
+@param buf sorted buffer
+@param block buffer for writing to file
+@param blob_file blob file handle for doing bulk insert operation */
+dberr_t row_merge_buf_write(const row_merge_buf_t *buf,
+#ifndef DBUG_OFF
+ const merge_file_t *of, /*!< output file */
+#endif
+ row_merge_block_t *block,
+ merge_file_t *blob_file)
{
const dict_index_t* index = buf->index;
ulint n_fields= dict_index_get_n_fields(index);
byte* b = &block[0];
+ mem_heap_t* blob_heap = nullptr;
+ dberr_t err = DB_SUCCESS;
DBUG_ENTER("row_merge_buf_write");
for (ulint i = 0; i < buf->n_tuples; i++) {
const mtuple_t* entry = &buf->tuples[i];
+ if (blob_file) {
+ ut_ad(buf->index->is_primary());
+ err = row_merge_buf_blob(
+ entry, n_fields, &blob_heap, blob_file);
+ if (err != DB_SUCCESS) {
+ goto func_exit;
+ }
+ }
+
row_merge_buf_encode(&b, index, entry, n_fields);
ut_ad(b < &block[srv_sort_buf_size]);
@@ -1021,7 +1187,7 @@ row_merge_buf_write(
/* Write an "end-of-chunk" marker. */
ut_a(b < &block[srv_sort_buf_size]);
- ut_a(b == &block[0] + buf->total_size);
+ ut_a(b == &block[0] + buf->total_size || blob_file);
*b++ = 0;
#ifdef HAVE_valgrind
/* The rest of the block is uninitialized. Initialize it
@@ -1031,7 +1197,12 @@ row_merge_buf_write(
DBUG_LOG("ib_merge_sort",
"write " << reinterpret_cast<const void*>(b) << ','
<< of->fd << ',' << of->offset << " EOF");
- DBUG_VOID_RETURN;
+func_exit:
+ if (blob_heap) {
+ mem_heap_free(blob_heap);
+ }
+
+ DBUG_RETURN(err);
}
/******************************************************//**
@@ -2671,7 +2842,11 @@ write_buffers:
ut_ad(file->n_rec > 0);
- row_merge_buf_write(buf, file, block);
+ row_merge_buf_write(buf,
+#ifndef DBUG_OFF
+ file,
+#endif
+ block);
if (!row_merge_write(
file->fd, file->offset++,
@@ -3350,7 +3525,7 @@ row_merge_sort(
*/
#ifndef UNIV_SOLARIS
/* Progress report only for "normal" indexes. */
- if (!(dup->index->type & DICT_FTS)) {
+ if (dup && !(dup->index->type & DICT_FTS)) {
thd_progress_init(trx->mysql_thd, 1);
}
#endif /* UNIV_SOLARIS */
@@ -3367,7 +3542,7 @@ row_merge_sort(
show processlist progress field */
/* Progress report only for "normal" indexes. */
#ifndef UNIV_SOLARIS
- if (!(dup->index->type & DICT_FTS)) {
+ if (dup && !(dup->index->type & DICT_FTS)) {
thd_progress_report(trx->mysql_thd, file->offset - num_runs, file->offset);
}
#endif /* UNIV_SOLARIS */
@@ -3397,7 +3572,7 @@ row_merge_sort(
/* Progress report only for "normal" indexes. */
#ifndef UNIV_SOLARIS
- if (!(dup->index->type & DICT_FTS)) {
+ if (dup && !(dup->index->type & DICT_FTS)) {
thd_progress_end(trx->mysql_thd);
}
#endif /* UNIV_SOLARIS */
@@ -3405,6 +3580,39 @@ row_merge_sort(
DBUG_RETURN(error);
}
+/** Copy the blob from the given blob file and store it
+in field data for the tuple
+@param tuple tuple to be inserted
+@param heap heap to allocate the memory for the blob storage
+@param blob_file file to handle blob data */
+static dberr_t row_merge_copy_blob_from_file(dtuple_t *tuple, mem_heap_t *heap,
+ merge_file_t *blob_file)
+{
+ for (ulint i = 0; i < dtuple_get_n_fields(tuple); i++)
+ {
+ dfield_t *field= dtuple_get_nth_field(tuple, i);
+ const byte *field_data= static_cast<byte*>(dfield_get_data(field));
+ ulint field_len= dfield_get_len(field);
+ if (!dfield_is_ext(field))
+ continue;
+
+ ut_a(field_len >= BTR_EXTERN_FIELD_REF_SIZE);
+ ut_ad(!dfield_is_null(field));
+
+ ut_ad(mach_read_from_8(field_data) == 0);
+ uint64_t offset= mach_read_from_8(field_data + 8);
+ uint32_t len= mach_read_from_4(field_data + 16);
+
+ byte *data= (byte*) mem_heap_alloc(heap, len);
+ if (dberr_t err= os_file_read(IORequestRead, blob_file->fd, data,
+ offset, len))
+ return err;
+ dfield_set_data(field, data, len);
+ }
+
+ return DB_SUCCESS;
+}
+
/** Copy externally stored columns to the data tuple.
@param[in] mrec record containing BLOB pointers,
or NULL to use tuple instead
@@ -3490,18 +3698,6 @@ row_merge_mtuple_to_dtuple(
dtuple->n_fields * sizeof *mtuple->fields);
}
-/** Insert sorted data tuples to the index.
-@param[in] index index to be inserted
-@param[in] old_table old table
-@param[in] fd file descriptor
-@param[in,out] block file buffer
-@param[in] row_buf row_buf the sorted data tuples,
-or NULL if fd, block will be used instead
-@param[in,out] btr_bulk btr bulk instance
-@param[in,out] stage performance schema accounting object, used by
-ALTER TABLE. If not NULL stage->begin_phase_insert() will be called initially
-and then stage->inc() will be called for each record that is processed.
-@return DB_SUCCESS or error number */
static MY_ATTRIBUTE((warn_unused_result))
dberr_t
row_merge_insert_index_tuples(
@@ -3511,14 +3707,13 @@ row_merge_insert_index_tuples(
row_merge_block_t* block,
const row_merge_buf_t* row_buf,
BtrBulk* btr_bulk,
- const ib_uint64_t table_total_rows, /*!< in: total rows of old table */
- const double pct_progress, /*!< in: total progress
- percent until now */
- const double pct_cost, /*!< in: current progress percent
- */
- row_merge_block_t* crypt_block, /*!< in: crypt buf or NULL */
- ulint space, /*!< in: space id */
- ut_stage_alter_t* stage)
+ const ib_uint64_t table_total_rows,
+ double pct_progress,
+ double pct_cost,
+ row_merge_block_t* crypt_block,
+ ulint space,
+ ut_stage_alter_t* stage,
+ merge_file_t* blob_file)
{
const byte* b;
mem_heap_t* heap;
@@ -3629,7 +3824,16 @@ row_merge_insert_index_tuples(
}
}
- if (dict_index_is_clust(index) && dtuple_get_n_ext(dtuple)) {
+ ut_ad(!dtuple_get_n_ext(dtuple) || index->is_primary());
+
+ if (!dtuple_get_n_ext(dtuple)) {
+ } else if (blob_file) {
+ error = row_merge_copy_blob_from_file(
+ dtuple, tuple_heap, blob_file);
+ if (error != DB_SUCCESS) {
+ break;
+ }
+ } else {
/* Off-page columns can be fetched safely
when concurrent modifications to the table
are disabled. (Purge can process delete-marked
@@ -3646,7 +3850,8 @@ row_merge_insert_index_tuples(
row_merge_read_clustered_index() scan
will go through row_log_table_apply(). */
row_merge_copy_blobs(
- mrec, offsets, old_table->space->zip_size(),
+ mrec, offsets,
+ old_table->space->zip_size(),
dtuple, tuple_heap);
}
@@ -4833,6 +5038,287 @@ func_exit:
clust_index->lock.x_unlock();
}
- DBUG_EXECUTE_IF("ib_index_crash_after_bulk_load", DBUG_SUICIDE(););
DBUG_RETURN(error);
}
+
+dberr_t row_merge_bulk_t::alloc_block()
+{
+ if (m_block)
+ return DB_SUCCESS;
+ m_block= m_alloc.allocate_large_dontdump(
+ 3 * srv_sort_buf_size, &m_block_pfx);
+ if (m_block == nullptr)
+ return DB_OUT_OF_MEMORY;
+ return DB_SUCCESS;
+}
+
+row_merge_bulk_t::row_merge_bulk_t(dict_table_t *table)
+{
+ ulint n_index= 0;
+ for (dict_index_t *index= UT_LIST_GET_FIRST(table->indexes);
+ index; index= UT_LIST_GET_NEXT(indexes, index))
+ {
+ if (!index->is_btree())
+ continue;
+ n_index++;
+ }
+
+ m_merge_buf= static_cast<row_merge_buf_t*>(
+ ut_zalloc_nokey(n_index * sizeof *m_merge_buf));
+
+ ulint i= 0;
+ for (dict_index_t *index= UT_LIST_GET_FIRST(table->indexes);
+ index; index= UT_LIST_GET_NEXT(indexes, index))
+ {
+ if (!index->is_btree())
+ continue;
+
+ mem_heap_t *heap= mem_heap_create(100);
+ row_merge_buf_create_low(&m_merge_buf[i], heap, index);
+ i++;
+ }
+
+ m_tmpfd= OS_FILE_CLOSED;
+ m_blob_file.fd= OS_FILE_CLOSED;
+ m_blob_file.offset= 0;
+ m_blob_file.n_rec= 0;
+}
+
+row_merge_bulk_t::~row_merge_bulk_t()
+{
+ ulint i= 0;
+ dict_table_t *table= m_merge_buf[0].index->table;
+ for (dict_index_t *index= UT_LIST_GET_FIRST(table->indexes);
+ index; index= UT_LIST_GET_NEXT(indexes, index))
+ {
+ if (!index->is_btree())
+ continue;
+ row_merge_buf_free(&m_merge_buf[i]);
+ if (m_merge_files)
+ row_merge_file_destroy(&m_merge_files[i]);
+ i++;
+ }
+
+ row_merge_file_destroy_low(m_tmpfd);
+
+ row_merge_file_destroy(&m_blob_file);
+
+ ut_free(m_merge_buf);
+
+ ut_free(m_merge_files);
+
+ if (m_block)
+ m_alloc.deallocate_large(m_block, &m_block_pfx);
+}
+
+void row_merge_bulk_t::init_tmp_file()
+{
+ if (m_merge_files)
+ return;
+
+ ulint n_index= 0;
+ dict_table_t *table= m_merge_buf[0].index->table;
+ for (dict_index_t *index= UT_LIST_GET_FIRST(table->indexes);
+ index; index= UT_LIST_GET_NEXT(indexes, index))
+ {
+ if (!index->is_btree())
+ continue;
+ n_index++;
+ }
+
+ m_merge_files= static_cast<merge_file_t*>(
+ ut_malloc_nokey(n_index * sizeof *m_merge_files));
+
+ for (ulint i= 0; i < n_index; i++)
+ {
+ m_merge_files[i].fd= OS_FILE_CLOSED;
+ m_merge_files[i].offset= 0;
+ m_merge_files[i].n_rec= 0;
+ }
+}
+
+void row_merge_bulk_t::clean_bulk_buffer(ulint index_no)
+{
+ mem_heap_empty(m_merge_buf[index_no].heap);
+ m_merge_buf[index_no].total_size = m_merge_buf[index_no].n_tuples = 0;
+}
+
+bool row_merge_bulk_t::create_tmp_file(ulint index_no)
+{
+ return row_merge_file_create_if_needed(
+ &m_merge_files[index_no], &m_tmpfd,
+ m_merge_buf[index_no].n_tuples, NULL);
+}
+
+dberr_t row_merge_bulk_t::write_to_tmp_file(ulint index_no)
+{
+ if (!create_tmp_file(index_no))
+ return DB_OUT_OF_MEMORY;
+ merge_file_t *file= &m_merge_files[index_no];
+ row_merge_buf_t *buf= &m_merge_buf[index_no];
+
+ alloc_block();
+
+ if (dberr_t err= row_merge_buf_write(buf,
+#ifndef DBUG_OFF
+ file,
+#endif
+ m_block,
+ index_no == 0 ? &m_blob_file : nullptr))
+ return err;
+
+ if (!row_merge_write(file->fd, file->offset++,
+ m_block, nullptr,
+ buf->index->table->space->id))
+ return DB_TEMP_FILE_WRITE_FAIL;
+ MEM_UNDEFINED(&m_block[0], srv_sort_buf_size);
+ return DB_SUCCESS;
+}
+
+dberr_t row_merge_bulk_t::bulk_insert_buffered(const dtuple_t &row,
+ const dict_index_t &ind,
+ trx_t *trx)
+{
+ dberr_t err= DB_SUCCESS;
+ ulint i= 0;
+ mem_heap_t *large_tuple_heap= nullptr;
+ for (dict_index_t *index= UT_LIST_GET_FIRST(ind.table->indexes);
+ index; index= UT_LIST_GET_NEXT(indexes, index))
+ {
+ if (!index->is_btree())
+ continue;
+
+ if (index != &ind)
+ {
+ i++;
+ continue;
+ }
+ row_merge_buf_t *buf= &m_merge_buf[i];
+add_to_buf:
+ if (row_merge_bulk_buf_add(buf, *ind.table, row))
+ {
+ i++;
+ goto func_exit;
+ }
+
+ if (buf->n_tuples == 0)
+ {
+ /* Tuple data size is greater than srv_sort_buf_size */
+ dtuple_t *big_tuple= row_merge_buf_large_tuple(
+ row, &m_blob_file, &large_tuple_heap);
+ if (row_merge_bulk_buf_add(buf, *ind.table, *big_tuple))
+ {
+ i++;
+ goto func_exit;
+ }
+ }
+
+ if (index->is_unique())
+ {
+ row_merge_dup_t dup{index, nullptr, nullptr, 0};
+ row_merge_buf_sort(buf, &dup);
+ if (dup.n_dup)
+ {
+ trx->error_info= index;
+ err= DB_DUPLICATE_KEY;
+ goto func_exit;
+ }
+ }
+ else
+ row_merge_buf_sort(buf, NULL);
+ init_tmp_file();
+ merge_file_t *file= &m_merge_files[i];
+ file->n_rec+= buf->n_tuples;
+ err= write_to_tmp_file(i);
+ if (err != DB_SUCCESS)
+ {
+ trx->error_info= index;
+ goto func_exit;
+ }
+ clean_bulk_buffer(i);
+ buf= &m_merge_buf[i];
+ goto add_to_buf;
+ }
+
+func_exit:
+ if (large_tuple_heap)
+ mem_heap_free(large_tuple_heap);
+ return err;
+}
+
+dberr_t row_merge_bulk_t::write_to_index(ulint index_no, trx_t *trx)
+{
+ dberr_t err= DB_SUCCESS;
+ row_merge_buf_t buf= m_merge_buf[index_no];
+ merge_file_t *file= m_merge_files ?
+ &m_merge_files[index_no] : nullptr;
+ dict_index_t *index= buf.index;
+ dict_table_t *table= index->table;
+ BtrBulk btr_bulk(index, trx);
+ row_merge_dup_t dup = {index, nullptr, nullptr, 0};
+
+ if (buf.n_tuples)
+ {
+ if (dict_index_is_unique(index))
+ {
+ row_merge_buf_sort(&buf, &dup);
+ if (dup.n_dup)
+ {
+ err= DB_DUPLICATE_KEY;
+ goto func_exit;
+ }
+ }
+ else row_merge_buf_sort(&buf, NULL);
+ if (file && file->fd != OS_FILE_CLOSED)
+ {
+ file->n_rec+= buf.n_tuples;
+ err= write_to_tmp_file(index_no);
+ if (err!= DB_SUCCESS)
+ goto func_exit;
+ }
+ else
+ {
+ /* Data got fit in merge buffer. */
+ err= row_merge_insert_index_tuples(
+ index, table, OS_FILE_CLOSED, nullptr,
+ &buf, &btr_bulk, 0, 0, 0, nullptr, table->space_id, nullptr,
+ m_blob_file.fd == OS_FILE_CLOSED ? nullptr : &m_blob_file);
+ goto func_exit;
+ }
+ }
+
+ err= row_merge_sort(trx, &dup, file,
+ m_block, &m_tmpfd, true, 0, 0,
+ nullptr, table->space_id, nullptr);
+ if (err != DB_SUCCESS)
+ goto func_exit;
+
+ err= row_merge_insert_index_tuples(
+ index, table, file->fd, m_block, nullptr,
+ &btr_bulk, 0, 0, 0, nullptr, table->space_id,
+ nullptr, &m_blob_file);
+
+func_exit:
+ if (err != DB_SUCCESS)
+ trx->error_info= index;
+ err= btr_bulk.finish(err);
+ return err;
+}
+
+dberr_t row_merge_bulk_t::write_to_table(dict_table_t *table, trx_t *trx)
+{
+ ulint i= 0;
+ for (dict_index_t *index= UT_LIST_GET_FIRST(table->indexes);
+ index; index= UT_LIST_GET_NEXT(indexes, index))
+ {
+ if (!index->is_btree())
+ continue;
+
+ dberr_t err= write_to_index(i, trx);
+ if (err != DB_SUCCESS)
+ return err;
+ i++;
+ }
+
+ return DB_SUCCESS;
+}
diff --git a/storage/innobase/snappy.cmake b/storage/innobase/snappy.cmake
deleted file mode 100644
index 3a2d828ee5c..00000000000
--- a/storage/innobase/snappy.cmake
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2015, MariaDB Corporation. All Rights Reserved.
-#
-# 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.
-#
-# 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.
-#
-# 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-1335 USA
-
-SET(WITH_INNODB_SNAPPY AUTO CACHE STRING
- "Build with snappy. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'")
-
-MACRO (MYSQL_CHECK_SNAPPY)
- IF (WITH_INNODB_SNAPPY STREQUAL "ON" OR WITH_INNODB_SNAPPY STREQUAL "AUTO")
- CHECK_INCLUDE_FILES(snappy-c.h HAVE_SNAPPY_H)
- CHECK_LIBRARY_EXISTS(snappy snappy_uncompress "" HAVE_SNAPPY_SHARED_LIB)
-
- IF(HAVE_SNAPPY_SHARED_LIB AND HAVE_SNAPPY_H)
- SET(HAVE_INNODB_SNAPPY TRUE)
- ADD_DEFINITIONS(-DHAVE_SNAPPY=1)
- LINK_LIBRARIES(snappy)
- ELSE()
- IF (WITH_INNODB_SNAPPY STREQUAL "ON")
- MESSAGE(FATAL_ERROR "Required snappy library is not found")
- ENDIF()
- ENDIF()
- ENDIF()
- ADD_FEATURE_INFO(INNODB_SNAPPY HAVE_INNODB_SNAPPY "Snappy compression in the InnoDB storage engine")
-ENDMACRO()
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index f7526edc6f6..dcef270caf3 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -97,15 +97,15 @@ char* srv_data_home;
char* srv_undo_dir;
/** The number of tablespaces to use for rollback segments. */
-ulong srv_undo_tablespaces;
+uint srv_undo_tablespaces;
/** The number of UNDO tablespaces that are open and ready to use. */
-ulint srv_undo_tablespaces_open;
+uint32_t srv_undo_tablespaces_open;
/** The number of UNDO tablespaces that are active (hosting some rollback
segment). It is quite possible that some of the tablespaces doesn't host
any of the rollback-segment based on configuration used. */
-ulint srv_undo_tablespaces_active;
+uint32_t srv_undo_tablespaces_active;
/** Rate at which UNDO records should be purged. */
ulong srv_purge_rseg_truncate_frequency;
@@ -162,7 +162,7 @@ uint srv_flush_log_at_timeout;
/** innodb_page_size */
ulong srv_page_size;
/** log2 of innodb_page_size; @see innodb_init_params() */
-ulong srv_page_size_shift;
+uint32_t srv_page_size_shift;
/** innodb_log_write_ahead_size */
ulong srv_log_write_ahead_size;
@@ -1668,7 +1668,8 @@ std::mutex purge_thread_count_mtx;
void srv_update_purge_thread_count(uint n)
{
std::lock_guard<std::mutex> lk(purge_thread_count_mtx);
- purge_create_background_thds(n);
+ ut_ad(n > 0);
+ ut_ad(n <= innodb_purge_threads_MAX);
srv_n_purge_threads = n;
srv_purge_thread_count_changed = 1;
}
@@ -1911,7 +1912,7 @@ static void purge_coordinator_callback(void*)
void srv_init_purge_tasks()
{
- purge_create_background_thds(srv_n_purge_threads);
+ purge_create_background_thds(innodb_purge_threads_MAX);
purge_coordinator_timer= srv_thread_pool->create_timer
(purge_coordinator_callback, nullptr);
}
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index 0ffb665c26d..3872b1fab26 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -112,7 +112,7 @@ ibool srv_start_raw_disk_in_use;
uint srv_n_file_io_threads;
/** UNDO tablespaces starts with space id. */
-ulint srv_undo_space_id_start;
+uint32_t srv_undo_space_id_start;
/** TRUE if the server is being started, before rolling back any
incomplete transactions */
@@ -462,7 +462,7 @@ static dberr_t srv_validate_undo_tablespaces()
}
/** @return the number of active undo tablespaces (except system tablespace) */
-static ulint trx_rseg_get_n_undo_tablespaces()
+static uint32_t trx_rseg_get_n_undo_tablespaces()
{
std::set<uint32_t> space_ids;
mtr_t mtr;
@@ -474,7 +474,7 @@ static ulint trx_rseg_get_n_undo_tablespaces()
if (uint32_t space= trx_sysf_rseg_get_space(sys_header, rseg_id))
space_ids.insert(space);
mtr.commit();
- return space_ids.size();
+ return static_cast<uint32_t>(space_ids.size());
}
/** Open an undo tablespace.
@@ -483,11 +483,12 @@ static ulint trx_rseg_get_n_undo_tablespaces()
@param[in] i undo tablespace count
@return undo tablespace identifier
@retval 0 on failure */
-static ulint srv_undo_tablespace_open(bool create, const char* name, ulint i)
+static uint32_t srv_undo_tablespace_open(bool create, const char *name,
+ uint32_t i)
{
bool success;
- ulint space_id= 0;
- ulint fsp_flags= 0;
+ uint32_t space_id= 0;
+ uint32_t fsp_flags= 0;
if (create)
{
@@ -643,20 +644,21 @@ srv_check_undo_redo_logs_exists()
return(DB_SUCCESS);
}
-static dberr_t srv_all_undo_tablespaces_open(bool create_new_db, ulint n_undo)
+static dberr_t srv_all_undo_tablespaces_open(bool create_new_db,
+ uint32_t n_undo)
{
/* Open all the undo tablespaces that are currently in use. If we
fail to open any of these it is a fatal error. The tablespace ids
should be contiguous. It is a fatal error because they are required
for recovery and are referenced by the UNDO logs (a.k.a RBS). */
- ulint prev_id= create_new_db ? srv_undo_space_id_start - 1 : 0;
+ uint32_t prev_id= create_new_db ? srv_undo_space_id_start - 1 : 0;
- for (ulint i= 0; i < n_undo; ++i)
+ for (uint32_t i= 0; i < n_undo; ++i)
{
char name[OS_FILE_MAX_PATH];
- snprintf(name, sizeof name, "%s/undo%03zu", srv_undo_dir, i + 1);
- ulint space_id= srv_undo_tablespace_open(create_new_db, name, i);
+ snprintf(name, sizeof name, "%s/undo%03u", srv_undo_dir, i + 1);
+ uint32_t space_id= srv_undo_tablespace_open(create_new_db, name, i);
if (!space_id)
{
if (!create_new_db)
@@ -681,11 +683,11 @@ static dberr_t srv_all_undo_tablespaces_open(bool create_new_db, ulint n_undo)
not in use and therefore not required by recovery. We only check
that there are no gaps. */
- for (ulint i= prev_id + 1; i < srv_undo_space_id_start + TRX_SYS_N_RSEGS;
+ for (uint32_t i= prev_id + 1; i < srv_undo_space_id_start + TRX_SYS_N_RSEGS;
++i)
{
char name[OS_FILE_MAX_PATH];
- snprintf(name, sizeof name, "%s/undo%03zu", srv_undo_dir, i);
+ snprintf(name, sizeof name, "%s/undo%03u", srv_undo_dir, i);
if (!srv_undo_tablespace_open(create_new_db, name, i))
break;
++srv_undo_tablespaces_open;
@@ -697,8 +699,7 @@ static dberr_t srv_all_undo_tablespaces_open(bool create_new_db, ulint n_undo)
/** Open the configured number of dedicated undo tablespaces.
@param[in] create_new_db whether the database is being initialized
@return DB_SUCCESS or error code */
-dberr_t
-srv_undo_tablespaces_init(bool create_new_db)
+dberr_t srv_undo_tablespaces_init(bool create_new_db)
{
srv_undo_tablespaces_open= 0;
@@ -734,8 +735,8 @@ srv_undo_tablespaces_init(bool create_new_db)
already exist. */
srv_undo_tablespaces_active= srv_undo_tablespaces;
- ulint n_undo= (create_new_db || srv_operation == SRV_OPERATION_BACKUP ||
- srv_operation == SRV_OPERATION_RESTORE_DELTA)
+ uint32_t n_undo= (create_new_db || srv_operation == SRV_OPERATION_BACKUP ||
+ srv_operation == SRV_OPERATION_RESTORE_DELTA)
? srv_undo_tablespaces : TRX_SYS_N_RSEGS;
if (dberr_t err= srv_all_undo_tablespaces_open(create_new_db, n_undo))
@@ -749,7 +750,7 @@ srv_undo_tablespaces_init(bool create_new_db)
if (create_new_db)
{
mtr_t mtr;
- for (ulint i= 0; i < srv_undo_tablespaces; ++i)
+ for (uint32_t i= 0; i < srv_undo_tablespaces; ++i)
{
mtr.start();
dberr_t err= fsp_header_init(fil_space_get(srv_undo_space_id_start + i),
@@ -1500,8 +1501,9 @@ file_checked:
fil_system.space_id_reuse_warned = false;
if (!srv_read_only_mode) {
- const ulint flags = FSP_FLAGS_PAGE_SSIZE();
- for (ulint id = 0; id <= srv_undo_tablespaces; id++) {
+ const uint32_t flags = FSP_FLAGS_PAGE_SSIZE();
+ for (uint32_t id = 0; id <= srv_undo_tablespaces;
+ id++) {
if (fil_space_t* space = fil_space_get(id)) {
fsp_flags_try_adjust(space, flags);
}
@@ -2061,6 +2063,10 @@ void innodb_shutdown()
}
srv_tmp_space.shutdown();
+ if (srv_stats.pages_page_compression_error)
+ ib::warn() << "Page compression errors: "
+ << srv_stats.pages_page_compression_error;
+
if (srv_was_started && srv_print_verbose_log) {
ib::info() << "Shutdown completed; log sequence number "
<< srv_shutdown_lsn
diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc
index 84d7d785490..27555a0360f 100644
--- a/storage/innobase/trx/trx0purge.cc
+++ b/storage/innobase/trx/trx0purge.cc
@@ -630,11 +630,11 @@ TRANSACTIONAL_TARGET static void trx_purge_truncate_history()
{
const ulint threshold=
ulint(srv_max_undo_log_size >> srv_page_size_shift);
- for (ulint i= purge_sys.truncate.last
+ for (uint32_t i= purge_sys.truncate.last
? purge_sys.truncate.last->id - srv_undo_space_id_start : 0,
j= i;; )
{
- const auto space_id= srv_undo_space_id_start + i;
+ const uint32_t space_id= srv_undo_space_id_start + i;
ut_ad(srv_is_undo_tablespace(space_id));
fil_space_t *space= fil_space_get(space_id);
ut_a(UT_LIST_GET_LEN(space->chain) == 1);
diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc
index 59c84e9119d..98954cff684 100644
--- a/storage/innobase/trx/trx0rec.cc
+++ b/storage/innobase/trx/trx0rec.cc
@@ -1935,8 +1935,7 @@ TRANSACTIONAL_TARGET ATTRIBUTE_NOINLINE
/** @return whether the transaction holds an exclusive lock on a table */
static bool trx_has_lock_x(const trx_t &trx, dict_table_t& table)
{
- if (table.is_temporary())
- return true;
+ ut_ad(!table.is_temporary());
uint32_t n;
@@ -2037,9 +2036,17 @@ trx_undo_report_row_operation(
ut_ad(que_node_get_type(thr->run_node) == QUE_NODE_INSERT);
ut_ad(trx->bulk_insert);
return DB_SUCCESS;
- } else if (m.second && trx->bulk_insert
- && trx_has_lock_x(*trx, *index->table)) {
- m.first->second.start_bulk_insert();
+ } else if (!m.second || !trx->bulk_insert) {
+ bulk = false;
+ } else if (index->table->is_temporary()) {
+ } else if (trx_has_lock_x(*trx, *index->table)
+ && index->table->bulk_trx_id == trx->id) {
+ m.first->second.start_bulk_insert(index->table);
+
+ if (dberr_t err = m.first->second.bulk_insert_buffered(
+ *clust_entry, *index, trx)) {
+ return err;
+ }
} else {
bulk = false;
}
diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc
index 2479e5a4cc1..1113c72fcbb 100644
--- a/storage/innobase/trx/trx0sys.cc
+++ b/storage/innobase/trx/trx0sys.cc
@@ -246,7 +246,7 @@ TPOOL_SUPPRESS_TSAN size_t trx_sys_t::history_size_approx() const
@param space_id system or undo tablespace id
@return pointer to new rollback segment
@retval nullptr on failure */
-static trx_rseg_t *trx_rseg_create(ulint space_id)
+static trx_rseg_t *trx_rseg_create(uint32_t space_id)
{
trx_rseg_t *rseg= nullptr;
mtr_t mtr;
@@ -307,11 +307,11 @@ bool trx_sys_create_rsegs()
in the system tablespace. */
ut_a(srv_available_undo_logs > 0);
- for (ulint i = 0; srv_available_undo_logs < TRX_SYS_N_RSEGS;
+ for (uint32_t i = 0; srv_available_undo_logs < TRX_SYS_N_RSEGS;
i++, srv_available_undo_logs++) {
/* Tablespace 0 is the system tablespace.
Dedicated undo log tablespaces start from 1. */
- ulint space = srv_undo_tablespaces > 0
+ uint32_t space = srv_undo_tablespaces > 0
? (i % srv_undo_tablespaces)
+ srv_undo_space_id_start
: TRX_SYS_SPACE;
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index 95bc6273e48..b1837167a1e 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -1648,6 +1648,9 @@ trx_mark_sql_stat_end(
}
if (trx->is_bulk_insert()) {
+ /* MDEV-25036 FIXME: we support buffered
+ insert only for the first insert statement */
+ trx->error_state = trx->bulk_insert_apply();
/* Allow a subsequent INSERT into an empty table
if !unique_checks && !foreign_key_checks. */
return;
@@ -1859,8 +1862,6 @@ trx_prepare(
lsn_t lsn = trx_prepare_low(trx);
- DBUG_EXECUTE_IF("ib_trx_crash_during_xa_prepare_step", DBUG_SUICIDE(););
-
ut_a(trx->state == TRX_STATE_ACTIVE);
{
TMTrxGuard tg{*trx};
diff --git a/storage/innobase/ut/ut0ut.cc b/storage/innobase/ut/ut0ut.cc
index 5542d5410c2..21502358d1f 100644
--- a/storage/innobase/ut/ut0ut.cc
+++ b/storage/innobase/ut/ut0ut.cc
@@ -446,7 +446,7 @@ ut_strerr(
case DB_FTS_TOO_MANY_WORDS_IN_PHRASE:
return("Too many words in a FTS phrase or proximity search");
case DB_DECRYPTION_FAILED:
- return("Table is encrypted but decrypt failed.");
+ return("Table is compressed or encrypted but uncompress or decrypt failed.");
case DB_IO_PARTIAL_FAILED:
return("Partial IO failed");
case DB_FORCED_ABORT:
diff --git a/storage/maria/aria_chk.c b/storage/maria/aria_chk.c
index 266b11d99f5..7d5598f06b5 100644
--- a/storage/maria/aria_chk.c
+++ b/storage/maria/aria_chk.c
@@ -1592,7 +1592,7 @@ static void descript(HA_CHECK *param, register MARIA_HA *info, char *name)
}
compile_time_assert((MY_UUID_STRING_LENGTH + 1) <= sizeof(buff));
buff[MY_UUID_STRING_LENGTH]= 0;
- my_uuid2str(share->base.uuid, buff);
+ my_uuid2str(share->base.uuid, buff, 1);
printf("UUID: %s\n", buff);
if (ma_control_file_inited() &&
memcmp(share->base.uuid, maria_uuid, MY_UUID_SIZE))
diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c
index 49604fa43f6..ea1dd2c23dc 100644
--- a/storage/maria/ma_bitmap.c
+++ b/storage/maria/ma_bitmap.c
@@ -661,7 +661,7 @@ static void _ma_bitmap_unpin_all(MARIA_SHARE *share)
dynamic_array_ptr(&bitmap->pinned_pages, 0));
MARIA_PINNED_PAGE *pinned_page= page_link + bitmap->pinned_pages.elements;
DBUG_ENTER("_ma_bitmap_unpin_all");
- DBUG_PRINT("info", ("pinned: %u", bitmap->pinned_pages.elements));
+ DBUG_PRINT("info", ("pinned: %zu", bitmap->pinned_pages.elements));
while (pinned_page-- != page_link)
pagecache_unlock_by_link(share->pagecache, pinned_page->link,
pinned_page->unlock, PAGECACHE_UNPIN,
@@ -1731,7 +1731,7 @@ static my_bool find_head(MARIA_HA *info, uint length, uint position)
1 error
*/
-static my_bool find_tail(MARIA_HA *info, uint length, uint position)
+static my_bool find_tail(MARIA_HA *info, uint length, size_t position)
{
MARIA_FILE_BITMAP *bitmap= &info->s->bitmap;
MARIA_BITMAP_BLOCK *block;
@@ -1812,7 +1812,7 @@ static my_bool find_blob(MARIA_HA *info, ulong length)
uint full_page_size= FULL_PAGE_SIZE(info->s);
ulong pages;
uint rest_length, used;
- uint UNINIT_VAR(first_block_pos);
+ size_t UNINIT_VAR(first_block_pos);
MARIA_BITMAP_BLOCK *first_block= 0;
DBUG_ENTER("find_blob");
DBUG_PRINT("enter", ("length: %lu", length));
@@ -1862,7 +1862,8 @@ static my_bool find_blob(MARIA_HA *info, ulong length)
DBUG_RETURN(1);
first_block= dynamic_element(&info->bitmap_blocks, first_block_pos,
MARIA_BITMAP_BLOCK*);
- first_block->sub_blocks= info->bitmap_blocks.elements - first_block_pos;
+ first_block->sub_blocks= (uint)(info->bitmap_blocks.elements
+ - first_block_pos);
DBUG_RETURN(0);
}
@@ -1883,7 +1884,7 @@ static my_bool find_blob(MARIA_HA *info, ulong length)
static my_bool allocate_blobs(MARIA_HA *info, MARIA_ROW *row)
{
ulong *length, *end;
- uint elements;
+ size_t elements;
/*
Reserve size for:
head block
@@ -1897,7 +1898,7 @@ static my_bool allocate_blobs(MARIA_HA *info, MARIA_ROW *row)
if (*length && find_blob(info, *length))
return 1;
}
- row->extents_count= (info->bitmap_blocks.elements - elements);
+ row->extents_count= (uint)(info->bitmap_blocks.elements - elements);
return 0;
}
@@ -2170,7 +2171,7 @@ end:
MARIA_BITMAP_BLOCK*);
blocks->block->sub_blocks= ELEMENTS_RESERVED_FOR_MAIN_PART - position;
/* First block's page_count is for all blocks */
- blocks->count= info->bitmap_blocks.elements - position;
+ blocks->count= (uint)(info->bitmap_blocks.elements - position);
res= 0;
abort:
@@ -2271,7 +2272,7 @@ end:
MARIA_BITMAP_BLOCK*);
blocks->block->sub_blocks= ELEMENTS_RESERVED_FOR_MAIN_PART - position;
/* First block's page_count is for all blocks */
- blocks->count= info->bitmap_blocks.elements - position;
+ blocks->count= (uint)(info->bitmap_blocks.elements - position);
res= 0;
abort:
diff --git a/storage/maria/ma_control_file.c b/storage/maria/ma_control_file.c
index 87e8c0eac18..bcf9a7041e4 100644
--- a/storage/maria/ma_control_file.c
+++ b/storage/maria/ma_control_file.c
@@ -705,7 +705,7 @@ my_bool print_aria_log_control()
checkpoint_lsn= lsn_korr(buffer + new_cf_create_time_size +
CF_LSN_OFFSET);
logno= uint4korr(buffer + new_cf_create_time_size + CF_FILENO_OFFSET);
- my_uuid2str(buffer + CF_UUID_OFFSET, uuid_str);
+ my_uuid2str(buffer + CF_UUID_OFFSET, uuid_str, 1);
uuid_str[MY_UUID_STRING_LENGTH]= 0;
printf("Block size: %u\n", uint2korr(buffer + CF_BLOCKSIZE_OFFSET));
diff --git a/storage/maria/ma_ft_update.c b/storage/maria/ma_ft_update.c
index 8e1bf397c86..b048a8a2c5a 100644
--- a/storage/maria/ma_ft_update.c
+++ b/storage/maria/ma_ft_update.c
@@ -320,7 +320,7 @@ my_bool _ma_ft_convert_to_ft2(MARIA_HA *info, MARIA_KEY *key)
/* we'll generate one pageful at once, and insert the rest one-by-one */
/* calculating the length of this page ...*/
length=(keyinfo->block_length-2) / keyinfo->keylength;
- set_if_smaller(length, da->elements);
+ set_if_smaller(length, (uint)da->elements);
length=length * keyinfo->keylength;
get_key_full_length_rdonly(key_length, key->data);
diff --git a/storage/maria/ma_init.c b/storage/maria/ma_init.c
index 029ce4b9128..14c4c9963f1 100644
--- a/storage/maria/ma_init.c
+++ b/storage/maria/ma_init.c
@@ -140,7 +140,7 @@ my_bool maria_upgrade()
We start by renaming all log files, so that if we get a crash
we will continue from where we left.
*/
- uint i;
+ size_t i;
MY_DIR *dir= my_dir(maria_data_root, MYF(MY_WME));
if (!dir)
DBUG_RETURN(1);
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index 86e7fa93eaa..e168fe5c8cb 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -1342,7 +1342,7 @@ struct st_file_counter
static void translog_mark_file_unfinished(uint32 file)
{
- int place, i;
+ ssize_t place, i;
struct st_file_counter fc, *fc_ptr;
DBUG_ENTER("translog_mark_file_unfinished");
@@ -1375,7 +1375,7 @@ static void translog_mark_file_unfinished(uint32 file)
goto end;
}
- if (place == (int)log_descriptor.unfinished_files.elements)
+ if (place == (ssize_t)log_descriptor.unfinished_files.elements)
{
insert_dynamic(&log_descriptor.unfinished_files, (uchar*) &fc);
DBUG_PRINT("info", ("The last element inserted"));
@@ -3502,7 +3502,7 @@ my_bool translog_walk_filenames(const char *directory,
const char *))
{
MY_DIR *dirp;
- uint i;
+ size_t i;
my_bool rc= FALSE;
/* Finds and removes transaction log files */
@@ -5625,8 +5625,8 @@ translog_write_variable_record_mgroup(LSN *lsn,
TRANSLOG_ADDRESS horizon;
struct st_buffer_cursor cursor;
int rc= 0;
- uint i, chunk2_page, full_pages;
- uint curr_group= 0;
+ size_t i, curr_group= 0;
+ uint chunk2_page, full_pages;
translog_size_t record_rest, first_page, chunk3_pages, chunk0_pages= 1;
translog_size_t done= 0;
struct st_translog_group_descriptor group;
@@ -5892,11 +5892,11 @@ translog_write_variable_record_mgroup(LSN *lsn,
DBUG_ASSERT(cursor.buffs.unlck_ptr == cursor.buffs.wrt_ptr);
rc= translog_advance_pointer(pages_to_skip + (int)(chunk0_pages - 1),
- record_rest + header_fixed_part +
- (groups.elements -
+ (uint16)(record_rest + header_fixed_part +
+ ((uint)groups.elements -
((page_capacity -
header_fixed_part) / (7 + 1)) *
- (chunk0_pages - 1)) * (7 + 1),
+ (chunk0_pages - 1)) * (7 + 1)),
&cursor.buffs);
buffer_of_last_lsn= log_descriptor.bc.buffer;
translog_unlock();
@@ -5984,7 +5984,7 @@ translog_write_variable_record_mgroup(LSN *lsn,
header_length);
do
{
- int limit;
+ size_t limit;
if (new_page_before_chunk0 &&
translog_chaser_page_next(&horizon, &cursor))
{
@@ -6026,9 +6026,8 @@ translog_write_variable_record_mgroup(LSN *lsn,
*/
limit= (groups_per_page < groups.elements - curr_group ?
groups_per_page : groups.elements - curr_group);
- DBUG_PRINT("info", ("Groups: %u curr: %u limit: %u",
- (uint) groups.elements, (uint) curr_group,
- (uint) limit));
+ DBUG_PRINT("info", ("Groups: %zu curr: %zu limit: %zu",
+ groups.elements, curr_group, limit));
if (chunk0_pages == 1)
{
diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c
index 09f156722cf..08579bd233f 100644
--- a/storage/maria/ma_open.c
+++ b/storage/maria/ma_open.c
@@ -156,8 +156,7 @@ static MARIA_HA *maria_clone_internal(MARIA_SHARE *share,
info.lock_type= F_WRLCK;
_ma_set_data_pagecache_callbacks(&info.dfile, share);
- my_bitmap_init(&info.changed_fields, changed_fields_bitmap,
- share->base.fields, 0);
+ my_bitmap_init(&info.changed_fields, changed_fields_bitmap, share->base.fields);
if ((*share->init)(&info))
goto err;
@@ -1025,7 +1024,8 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags,
MARIA_STATE_HISTORY_CLOSED *history;
if ((history= (MARIA_STATE_HISTORY_CLOSED *)
my_hash_search(&maria_stored_state,
- (uchar*) &share->state.create_rename_lsn, 0)))
+ (uchar*) &share->state.create_rename_lsn,
+ sizeof(share->state.create_rename_lsn))))
{
/*
Move history from hash to share. This is safe to do as we
diff --git a/storage/maria/ma_page.c b/storage/maria/ma_page.c
index 13f5b7d698b..95e2002116b 100644
--- a/storage/maria/ma_page.c
+++ b/storage/maria/ma_page.c
@@ -119,7 +119,7 @@ my_bool _ma_fetch_keypage(MARIA_PAGE *page, MARIA_HA *info,
PAGECACHE_LOCK_READ_UNLOCK);
page_link.changed= 0;
push_dynamic(&info->pinned_pages, (void*) &page_link);
- page->link_offset= info->pinned_pages.elements-1;
+ page->link_offset= (uint)info->pinned_pages.elements-1;
}
if (tmp == info->buff)
diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c
index b9d6fffda86..f02a7a81020 100644
--- a/storage/maria/ma_sort.c
+++ b/storage/maria/ma_sort.c
@@ -50,7 +50,7 @@ extern void print_error(const char *fmt,...);
static ha_rows find_all_keys(MARIA_SORT_PARAM *info, ha_keys keys,
uchar **sort_keys,
- DYNAMIC_ARRAY *buffpek,uint *maxbuffer,
+ DYNAMIC_ARRAY *buffpek,size_t *maxbuffer,
IO_CACHE *tempfile,
IO_CACHE *tempfile_for_exceptions);
static int write_keys(MARIA_SORT_PARAM *info,uchar **sort_keys,
@@ -61,7 +61,7 @@ static int write_index(MARIA_SORT_PARAM *info, uchar **sort_keys,
ha_keys count);
static int merge_many_buff(MARIA_SORT_PARAM *info, ha_keys keys,
uchar **sort_keys,
- BUFFPEK *buffpek, uint *maxbuffer,
+ BUFFPEK *buffpek, size_t *maxbuffer,
IO_CACHE *t_file);
static my_off_t read_to_buffer(IO_CACHE *fromfile,BUFFPEK *buffpek,
uint sort_length);
@@ -69,7 +69,7 @@ static int merge_buffers(MARIA_SORT_PARAM *info, ha_keys keys,
IO_CACHE *from_file, IO_CACHE *to_file,
uchar **sort_keys, BUFFPEK *lastbuff,
BUFFPEK *Fb, BUFFPEK *Tb);
-static int merge_index(MARIA_SORT_PARAM *,ha_keys,uchar **,BUFFPEK *, uint,
+static int merge_index(MARIA_SORT_PARAM *,ha_keys,uchar **,BUFFPEK *, size_t,
IO_CACHE *);
static int flush_maria_ft_buf(MARIA_SORT_PARAM *info);
@@ -126,8 +126,8 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
size_t sortbuff_size)
{
int error;
- uint sort_length, maxbuffer;
- size_t memavl, old_memavl;
+ uint sort_length;
+ size_t memavl, old_memavl, maxbuffer;
DYNAMIC_ARRAY buffpek;
ha_rows records, UNINIT_VAR(keys);
uchar **sort_keys;
@@ -165,7 +165,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
will be allocated when needed.
*/
keys= memavl / (sort_length+sizeof(char*));
- maxbuffer= (uint) MY_MIN((ulonglong) 1000, (records / keys)+1);
+ maxbuffer= (size_t) MY_MIN((ulonglong) 1000, (records / keys)+1);
}
else
{
@@ -173,7 +173,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
All keys can't fit in memory.
Calculate how many keys + buffers we can keep in memory
*/
- uint maxbuffer_org;
+ size_t maxbuffer_org;
do
{
maxbuffer_org= maxbuffer;
@@ -190,7 +190,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
goto err;
}
}
- while ((maxbuffer= (uint) (records/(keys-1)+1)) != maxbuffer_org);
+ while ((maxbuffer= (size_t) (records/(keys-1)+1)) != maxbuffer_org);
}
if ((sort_keys= ((uchar**)
@@ -310,7 +310,7 @@ err:
static ha_rows find_all_keys(MARIA_SORT_PARAM *info, ha_rows keys,
uchar **sort_keys, DYNAMIC_ARRAY *buffpek,
- uint *maxbuffer, IO_CACHE *tempfile,
+ size_t *maxbuffer, IO_CACHE *tempfile,
IO_CACHE *tempfile_for_exceptions)
{
int error;
@@ -371,7 +371,7 @@ static my_bool _ma_thr_find_all_keys_exec(MARIA_SORT_PARAM* sort_param)
longlong sortbuff_size;
ha_keys UNINIT_VAR(keys), idx;
uint sort_length;
- uint maxbuffer;
+ size_t maxbuffer;
uchar **sort_keys= NULL;
DBUG_ENTER("_ma_thr_find_all_keys_exec");
DBUG_PRINT("enter", ("master: %d", sort_param->master));
@@ -406,11 +406,11 @@ static my_bool _ma_thr_find_all_keys_exec(MARIA_SORT_PARAM* sort_param)
will be allocated when needed.
*/
keys= memavl / (sort_length+sizeof(char*));
- maxbuffer= (uint) MY_MIN((ulonglong) 1000, (idx / keys)+1);
+ maxbuffer= (size_t) MY_MIN((ulonglong) 1000, (idx / keys)+1);
}
else
{
- uint maxbuffer_org;
+ size_t maxbuffer_org;
do
{
maxbuffer_org= maxbuffer;
@@ -622,7 +622,7 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param)
if (sinfo->buffpek.elements)
{
- uint maxbuffer=sinfo->buffpek.elements-1;
+ size_t maxbuffer=sinfo->buffpek.elements-1;
if (!mergebuf)
{
length=(size_t)param->sort_buffer_length;
@@ -838,9 +838,9 @@ static int write_index(MARIA_SORT_PARAM *info, register uchar **sort_keys,
static int merge_many_buff(MARIA_SORT_PARAM *info, ha_keys keys,
uchar **sort_keys, BUFFPEK *buffpek,
- uint *maxbuffer, IO_CACHE *t_file)
+ size_t *maxbuffer, IO_CACHE *t_file)
{
- uint tmp, merges, max_merges;
+ size_t tmp, merges, max_merges;
IO_CACHE t_file2, *from_file, *to_file, *temp;
BUFFPEK *lastbuff;
DBUG_ENTER("merge_many_buff");
@@ -866,7 +866,7 @@ static int merge_many_buff(MARIA_SORT_PARAM *info, ha_keys keys,
from_file= t_file ; to_file= &t_file2;
while (*maxbuffer >= MERGEBUFF2)
{
- uint i;
+ size_t i;
reinit_io_cache(from_file,READ_CACHE,0L,0,0);
reinit_io_cache(to_file,WRITE_CACHE,0L,0,0);
lastbuff=buffpek;
@@ -884,7 +884,7 @@ static int merge_many_buff(MARIA_SORT_PARAM *info, ha_keys keys,
if (flush_io_cache(to_file))
break; /* purecov: inspected */
temp=from_file; from_file=to_file; to_file=temp;
- *maxbuffer= (uint) (lastbuff-buffpek)-1;
+ *maxbuffer= (size_t) (lastbuff-buffpek)-1;
if (info->sort_info->param->max_stage != 1) /* If not parallel */
_ma_report_progress(info->sort_info->param, merges++, max_merges);
}
@@ -1140,7 +1140,7 @@ err:
static int
merge_index(MARIA_SORT_PARAM *info, ha_keys keys, uchar **sort_keys,
- BUFFPEK *buffpek, uint maxbuffer, IO_CACHE *tempfile)
+ BUFFPEK *buffpek, size_t maxbuffer, IO_CACHE *tempfile)
{
DBUG_ENTER("merge_index");
if (merge_buffers(info,keys,tempfile,(IO_CACHE*) 0,sort_keys,buffpek,buffpek,
diff --git a/storage/maria/unittest/ma_maria_log_cleanup.c b/storage/maria/unittest/ma_maria_log_cleanup.c
index 0d75fdbf95c..a4d0609f686 100644
--- a/storage/maria/unittest/ma_maria_log_cleanup.c
+++ b/storage/maria/unittest/ma_maria_log_cleanup.c
@@ -21,7 +21,7 @@
my_bool maria_log_remove(const char *testdir)
{
MY_DIR *dirp;
- uint i;
+ size_t i;
MY_STAT stat_buff;
char file_name[FN_REFLEN];
diff --git a/storage/mroonga/CMakeLists.txt b/storage/mroonga/CMakeLists.txt
index c048b214658..bea0eecc8b7 100644
--- a/storage/mroonga/CMakeLists.txt
+++ b/storage/mroonga/CMakeLists.txt
@@ -110,19 +110,9 @@ if(MRN_GROONGA_BUNDLED)
set(GROONGA_NORMALIZER_MYSQL_EMBED ON)
endif()
- file(READ "${MRN_BUNDLED_GROONGA_DIR}/bundled_lz4_version"
- MRN_BUNDLED_LZ4_VERSION)
- string(STRIP
- "${MRN_BUNDLED_LZ4_VERSION}"
- MRN_BUNDLED_LZ4_VERSION)
- set(MRN_BUNDLED_LZ4_DIR
- "${MRN_BUNDLED_GROONGA_DIR}/vendor/lz4-${MRN_BUNDLED_LZ4_VERSION}")
- if(EXISTS ${MRN_BUNDLED_LZ4_DIR})
- set(GRN_WITH_BUNDLED_LZ4 ON)
- set(GRN_WITH_LZ4 "yes")
- else()
- set(GRN_WITH_LZ4 "no")
- endif()
+ set(GRN_WITH_LZ4 "yes")
+ set(LIBLZ4_FOUND TRUE)
+ set(LZ4_LIBS "" CACHE STRING "" FORCE)
add_subdirectory("${MRN_BUNDLED_GROONGA_RELATIVE_DIR}")
else()
diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp
index 1cddd8fc4a8..83c2d15a36c 100644
--- a/storage/mroonga/ha_mroonga.cpp
+++ b/storage/mroonga/ha_mroonga.cpp
@@ -4926,7 +4926,7 @@ int ha_mroonga::open(const char *name,
DBUG_RETURN(error);
thr_lock_data_init(&share->lock,&thr_lock_data,NULL);
- if (bitmap_init(&multiple_column_key_bitmap, NULL, table->s->fields, false))
+ if (my_bitmap_init(&multiple_column_key_bitmap, NULL, table->s->fields))
{
mrn_free_share(share);
share = NULL;
@@ -4942,7 +4942,7 @@ int ha_mroonga::open(const char *name,
if (error)
{
- bitmap_free(&multiple_column_key_bitmap);
+ my_bitmap_free(&multiple_column_key_bitmap);
mrn_free_share(share);
share = NULL;
}
@@ -5009,7 +5009,7 @@ int ha_mroonga::close()
{
error = add_wrap_hton(share->table_name, share->hton);
}
- bitmap_free(&multiple_column_key_bitmap);
+ my_bitmap_free(&multiple_column_key_bitmap);
if (share->use_count == 1) {
mrn_free_long_term_share(share->long_term_share);
}
diff --git a/storage/mroonga/lib/mrn_smart_bitmap.cpp b/storage/mroonga/lib/mrn_smart_bitmap.cpp
index f8fd4f727bb..cdedeb677cd 100644
--- a/storage/mroonga/lib/mrn_smart_bitmap.cpp
+++ b/storage/mroonga/lib/mrn_smart_bitmap.cpp
@@ -26,7 +26,7 @@ namespace mrn {
SmartBitmap::~SmartBitmap() {
if (bitmap_) {
- bitmap_free(bitmap_);
+ my_bitmap_free(bitmap_);
}
}
diff --git a/storage/myisam/ft_update.c b/storage/myisam/ft_update.c
index 0c97a926746..157e5423168 100644
--- a/storage/myisam/ft_update.c
+++ b/storage/myisam/ft_update.c
@@ -301,7 +301,8 @@ uint _mi_ft_convert_to_ft2(MI_INFO *info, uint keynr, uchar *key)
DYNAMIC_ARRAY *da=info->ft1_to_ft2;
MI_KEYDEF *keyinfo=&info->s->ft2_keyinfo;
uchar *key_ptr= (uchar*) dynamic_array_ptr(da, 0), *end;
- uint length, key_length;
+ size_t length;
+ uint key_length;
DBUG_ENTER("_mi_ft_convert_to_ft2");
/* we'll generate one pageful at once, and insert the rest one-by-one */
diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c
index fe0c0f8f02e..198e669bbb4 100644
--- a/storage/myisam/sort.c
+++ b/storage/myisam/sort.c
@@ -47,7 +47,7 @@ extern void print_error(const char *fmt,...);
static ha_rows find_all_keys(MI_SORT_PARAM *info, ha_keys keys,
uchar **sort_keys,
- DYNAMIC_ARRAY *buffpek,uint *maxbuffer,
+ DYNAMIC_ARRAY *buffpek, size_t *maxbuffer,
IO_CACHE *tempfile,
IO_CACHE *tempfile_for_exceptions);
static int write_keys(MI_SORT_PARAM *info,uchar **sort_keys,
@@ -58,7 +58,7 @@ static int write_index(MI_SORT_PARAM *info,uchar * *sort_keys,
ha_keys count);
static int merge_many_buff(MI_SORT_PARAM *info, ha_keys keys,
uchar * *sort_keys,
- BUFFPEK *buffpek, uint *maxbuffer,
+ BUFFPEK *buffpek, size_t *maxbuffer,
IO_CACHE *t_file);
static my_off_t read_to_buffer(IO_CACHE *fromfile,BUFFPEK *buffpek,
uint sort_length);
@@ -66,7 +66,7 @@ static int merge_buffers(MI_SORT_PARAM *info, ha_keys keys,
IO_CACHE *from_file, IO_CACHE *to_file,
uchar * *sort_keys, BUFFPEK *lastbuff,
BUFFPEK *Fb, BUFFPEK *Tb);
-static int merge_index(MI_SORT_PARAM *,ha_keys,uchar **,BUFFPEK *, uint,
+static int merge_index(MI_SORT_PARAM *,ha_keys,uchar **,BUFFPEK *, size_t,
IO_CACHE *);
static int flush_ft_buf(MI_SORT_PARAM *info);
@@ -124,7 +124,8 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
ulonglong sortbuff_size)
{
int error;
- uint sort_length, maxbuffer;
+ uint sort_length;
+ size_t maxbuffer;
ulonglong memavl, old_memavl;
DYNAMIC_ARRAY buffpek;
ha_rows records, UNINIT_VAR(keys);
@@ -161,7 +162,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
will be allocated when needed.
*/
keys= memavl / (sort_length+sizeof(char*));
- maxbuffer= (uint) MY_MIN((ulonglong) 1000, (records / keys)+1);
+ maxbuffer= (size_t) MY_MIN((ulonglong) 1000, (records / keys)+1);
}
else
{
@@ -169,7 +170,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
All keys can't fit in memory.
Calculate how many keys + buffers we can keep in memory
*/
- uint maxbuffer_org;
+ size_t maxbuffer_org;
do
{
maxbuffer_org= maxbuffer;
@@ -186,7 +187,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
goto err;
}
}
- while ((maxbuffer= (uint) (records/(keys-1)+1)) != maxbuffer_org);
+ while ((maxbuffer= (size_t) (records/(keys-1)+1)) != maxbuffer_org);
}
if ((sort_keys= ((uchar **)
@@ -298,7 +299,7 @@ err:
static ha_rows find_all_keys(MI_SORT_PARAM *info, ha_rows keys,
uchar **sort_keys, DYNAMIC_ARRAY *buffpek,
- uint *maxbuffer, IO_CACHE *tempfile,
+ size_t *maxbuffer, IO_CACHE *tempfile,
IO_CACHE *tempfile_for_exceptions)
{
int error;
@@ -349,7 +350,7 @@ static my_bool thr_find_all_keys_exec(MI_SORT_PARAM *sort_param)
ulonglong memavl, old_memavl, sortbuff_size;
ha_keys UNINIT_VAR(keys), idx;
uint sort_length;
- uint maxbuffer;
+ size_t maxbuffer;
uchar **sort_keys= NULL;
int error= 0;
DBUG_ENTER("thr_find_all_keys");
@@ -386,18 +387,18 @@ static my_bool thr_find_all_keys_exec(MI_SORT_PARAM *sort_param)
will be allocated when needed.
*/
keys= memavl / (sort_length+sizeof(char*));
- maxbuffer= (uint) MY_MIN((ulonglong) 1000, (idx / keys)+1);
+ maxbuffer= (size_t) MY_MIN((ulonglong) 1000, (idx / keys)+1);
}
else
{
- uint maxbuffer_org;
+ size_t maxbuffer_org;
do
{
maxbuffer_org= maxbuffer;
if (memavl < sizeof(BUFFPEK)*maxbuffer ||
(keys=(memavl-sizeof(BUFFPEK)*maxbuffer)/
(sort_length+sizeof(char*))) <= 1 ||
- keys < (uint) maxbuffer)
+ keys < maxbuffer)
{
mi_check_print_error(sort_param->sort_info->param,
"myisam_sort_buffer_size is too small. Current myisam_sort_buffer_size: %llu rows: %llu sort_length: %u",
@@ -405,7 +406,7 @@ static my_bool thr_find_all_keys_exec(MI_SORT_PARAM *sort_param)
DBUG_RETURN(TRUE);
}
}
- while ((maxbuffer= (uint) (idx/(keys-1)+1)) != maxbuffer_org);
+ while ((maxbuffer= (size_t) (idx/(keys-1)+1)) != maxbuffer_org);
}
if ((sort_keys= (uchar**) my_malloc(PSI_INSTRUMENT_ME,
(size_t)(keys * (sort_length + sizeof(char*)) +
@@ -604,7 +605,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
if (sinfo->buffpek.elements)
{
- uint maxbuffer=sinfo->buffpek.elements-1;
+ size_t maxbuffer=sinfo->buffpek.elements-1;
if (!mergebuf)
{
length=param->sort_buffer_length;
@@ -806,9 +807,9 @@ static int write_index(MI_SORT_PARAM *info, register uchar **sort_keys,
static int merge_many_buff(MI_SORT_PARAM *info, ha_keys keys,
uchar **sort_keys, BUFFPEK *buffpek,
- uint *maxbuffer, IO_CACHE *t_file)
+ size_t *maxbuffer, IO_CACHE *t_file)
{
- register uint i;
+ register size_t i;
IO_CACHE t_file2, *from_file, *to_file, *temp;
BUFFPEK *lastbuff;
DBUG_ENTER("merge_many_buff");
@@ -838,7 +839,7 @@ static int merge_many_buff(MI_SORT_PARAM *info, ha_keys keys,
if (flush_io_cache(to_file))
break; /* purecov: inspected */
temp=from_file; from_file=to_file; to_file=temp;
- *maxbuffer= (uint) (lastbuff-buffpek)-1;
+ *maxbuffer= (size_t) (lastbuff-buffpek)-1;
}
cleanup:
close_cached_file(to_file); /* This holds old result */
@@ -1099,7 +1100,7 @@ err:
static int
merge_index(MI_SORT_PARAM *info, ha_keys keys, uchar **sort_keys,
- BUFFPEK *buffpek, uint maxbuffer, IO_CACHE *tempfile)
+ BUFFPEK *buffpek, size_t maxbuffer, IO_CACHE *tempfile)
{
DBUG_ENTER("merge_index");
if (merge_buffers(info,keys,tempfile,(IO_CACHE*) 0,sort_keys,buffpek,buffpek,
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 70a4d6aa284..d37636abab7 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -121,7 +121,7 @@ ha_myisammrg::ha_myisammrg(handlerton *hton, TABLE_SHARE *table_arg)
:handler(hton, table_arg), file(0), is_cloned(0)
{
init_sql_alloc(rg_key_memory_children, &children_mem_root,
- FN_REFLEN + ALLOC_ROOT_MIN_BLOCK_SIZE, 0, MYF(0));
+ FN_REFLEN, 0, MYF(0));
}
diff --git a/storage/oqgraph/cmake/FindJudy.cmake b/storage/oqgraph/cmake/FindJudy.cmake
index d9ecfdc4a4f..37aed8b631c 100644
--- a/storage/oqgraph/cmake/FindJudy.cmake
+++ b/storage/oqgraph/cmake/FindJudy.cmake
@@ -16,7 +16,7 @@
# Once done this will define
#
# Judy_FOUND - system has Judy
-# Judy_INCLUDE_DIR - the Judy include directory
+# Judy_INCLUDE_DIRS - the Judy include directory
# Judy_LIBRARIES - Link these to use Judy
# Judy_DEFINITIONS - Compiler switches required for using Judy
@@ -24,21 +24,21 @@ IF(MSVC)
# For now, assume Judy built according to the above instructions
if (NOT "$ENV{JUDY_ROOT}" STREQUAL "")
# Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing.
- string(REPLACE "\\" "/" Judy_INCLUDE_DIR_search $ENV{JUDY_ROOT}/src)
+ string(REPLACE "\\" "/" Judy_INCLUDE_DIRS_search $ENV{JUDY_ROOT}/src)
string(REPLACE "\\" "/" Judy_LIBRARIES_search $ENV{JUDY_ROOT}/src)
endif()
ELSE(MSVC)
- IF (Judy_INCLUDE_DIR AND Judy_LIBRARIES)
+ IF (Judy_INCLUDE_DIRS AND Judy_LIBRARIES)
SET(Judy_FIND_QUIETLY TRUE)
- ENDIF (Judy_INCLUDE_DIR AND Judy_LIBRARIES)
+ ENDIF (Judy_INCLUDE_DIRS AND Judy_LIBRARIES)
ENDIF(MSVC)
-FIND_PATH(Judy_INCLUDE_DIR Judy.h PATHS ${Judy_INCLUDE_DIR_search})
+FIND_PATH(Judy_INCLUDE_DIRS Judy.h PATHS ${Judy_INCLUDE_DIRS_search})
FIND_LIBRARY(Judy_LIBRARIES Judy PATHS ${Judy_LIBRARIES_search})
-IF (Judy_INCLUDE_DIR AND Judy_LIBRARIES)
+IF (Judy_INCLUDE_DIRS AND Judy_LIBRARIES)
SET(Judy_FOUND TRUE)
-ELSE (Judy_INCLUDE_DIR AND Judy_LIBRARIES)
+ELSE (Judy_INCLUDE_DIRS AND Judy_LIBRARIES)
SET(Judy_FOUND FALSE)
if (MSVC)
MESSAGE(STATUS "How to build Judy on Windows:")
@@ -51,7 +51,7 @@ ELSE (Judy_INCLUDE_DIR AND Judy_LIBRARIES)
MESSAGE(STATUS "3. Execute the command: 'build'")
MESSAGE(STATUS "4. Rerun this cmake with the environment variable: 'set JUDY_ROOT=x:\\path\\to\\judy'")
endif(MSVC)
-ENDIF (Judy_INCLUDE_DIR AND Judy_LIBRARIES)
+ENDIF (Judy_INCLUDE_DIRS AND Judy_LIBRARIES)
IF (Judy_FOUND)
IF (NOT Judy_FIND_QUIETLY)
@@ -63,5 +63,5 @@ ELSE (Judy_FOUND)
ENDIF (Judy_FIND_REQUIRED)
ENDIF (Judy_FOUND)
-MARK_AS_ADVANCED(Judy_INCLUDE_DIR Judy_LIBRARIES)
+MARK_AS_ADVANCED(Judy_INCLUDE_DIRS Judy_LIBRARIES)
diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt
index 315a3ddaabc..f76f91c66bf 100644
--- a/storage/rocksdb/CMakeLists.txt
+++ b/storage/rocksdb/CMakeLists.txt
@@ -139,8 +139,12 @@ else()
SET(ATOMIC_EXTRA_LIBS)
endif()
+# don't use compression providers, there are standalone executables below
+GET_PROPERTY(dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+LIST(REMOVE_ITEM dirs ${CMAKE_SOURCE_DIR}/include/providers)
+SET_PROPERTY(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "${dirs}")
+
MYSQL_ADD_PLUGIN(rocksdb ${ROCKSDB_SE_SOURCES} MODULE_ONLY STORAGE_ENGINE
- MODULE_OUTPUT_NAME ha_rocksdb
LINK_LIBRARIES ${ATOMIC_EXTRA_LIBS}
COMPONENT rocksdb-engine)
@@ -149,8 +153,6 @@ IF(NOT TARGET rocksdb)
RETURN()
ENDIF()
-
-
CHECK_CXX_SOURCE_COMPILES("
#if defined(_MSC_VER) && !defined(__thread)
#define __thread __declspec(thread)
diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake
index fd23b7ba470..29b2d83a759 100644
--- a/storage/rocksdb/build_rocksdb.cmake
+++ b/storage/rocksdb/build_rocksdb.cmake
@@ -35,48 +35,48 @@ endif()
# Optional compression libraries.
include(CheckFunctionExists)
-macro(check_lib package var)
- STRING(TOUPPER ${package} PACKAGE_NAME)
+macro(check_lib package)
SET(WITH_ROCKSDB_${package} AUTO CACHE STRING
"Build RocksDB with ${package} compression. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'")
+ STRING(TOUPPER ${package} var)
IF (NOT ${WITH_ROCKSDB_${package}} STREQUAL "OFF")
FIND_PACKAGE(${package} QUIET)
- SET(HAVE_ROCKSDB_${PACKAGE_NAME} TRUE)
- IF (${${PACKAGE_NAME}_FOUND})
- IF(${ARGC} GREATER 2)
+ SET(HAVE_ROCKSDB_${package} TRUE)
+ IF (${${package}_FOUND})
+ IF(${ARGC} GREATER 1)
SET(CMAKE_REQUIRED_LIBRARIES ${${var}_LIBRARIES})
- CHECK_FUNCTION_EXISTS(${ARGV2} ${var}_VALID)
+ CHECK_FUNCTION_EXISTS(${ARGV1} ${package}_VALID)
UNSET(CMAKE_REQUIRED_LIBRARIES)
ELSE()
- SET(${var}_VALID TRUE)
+ SET(${package}_VALID TRUE)
ENDIF()
ENDIF()
ENDIF()
- ADD_FEATURE_INFO(ROCKSDB_${PACKAGE_NAME} HAVE_ROCKSDB_${PACKAGE_NAME} "${package} Compression in the RocksDB storage engine")
+ ADD_FEATURE_INFO(ROCKSDB_${package} HAVE_ROCKSDB_${package} "${package} Compression in the RocksDB storage engine")
- IF(${${var}_VALID})
- MESSAGE_ONCE(rocksdb_${var} "Found ${package}: ${${var}_LIBRARIES}")
- add_definitions(-D${PACKAGE_NAME})
+ IF(${${package}_VALID})
+ MESSAGE_ONCE(rocksdb_${package} "Found ${package}: ${${var}_LIBRARIES}")
+ add_definitions(-D${var})
include_directories(${${var}_INCLUDE_DIR})
list(APPEND THIRDPARTY_LIBS ${${var}_LIBRARIES})
- ELSEIF(${${PACKAGE_NAME}_FOUND})
- MESSAGE_ONCE(rocksdb_${var} "Found unusable ${package}: ${${var}_LIBRARIES} [${ARGV2}]")
+ ELSEIF(${${package}_FOUND})
+ MESSAGE_ONCE(rocksdb_${package} "Found unusable ${package}: ${${var}_LIBRARIES} [${ARGV1}]")
ELSE()
- MESSAGE_ONCE(rocksdb_${var} "Could NOT find ${package}")
+ MESSAGE_ONCE(rocksdb_${package} "Could NOT find ${package}")
ENDIF()
- IF (${WITH_ROCKSDB_${package}} STREQUAL "ON" AND NOT ${${PACKAGE_NAME}_FOUND})
+ IF (${WITH_ROCKSDB_${package}} STREQUAL "ON" AND NOT ${${package}_FOUND})
MESSAGE(FATAL_ERROR
"${package} library was not found, but WITH_ROCKSDB_${package} option is ON.\
Either set WITH_ROCKSDB_${package} to OFF, or make sure ${package} is installed")
endif()
endmacro()
-check_lib(LZ4 LZ4)
-check_lib(BZip2 BZIP2)
-check_lib(snappy snappy) # rocksdb/cmake/modules/Findsnappy.cmake violates the convention
-check_lib(ZSTD ZSTD ZDICT_trainFromBuffer)
+check_lib(LZ4)
+check_lib(BZip2)
+check_lib(Snappy)
+check_lib(ZSTD ZDICT_trainFromBuffer)
add_definitions(-DZLIB)
list(APPEND THIRDPARTY_LIBS ${ZLIB_LIBRARY})
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index 32300d7e0c6..82a85a0be7d 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -704,7 +704,7 @@ static int rmdir_force(const char *dir) {
if (!dir_info)
return 1;
- for (uint i = 0; i < dir_info->number_of_files; i++) {
+ for (size_t i = 0; i < dir_info->number_of_files; i++) {
FILEINFO *file = dir_info->dir_entry + i;
strxnmov(path, sizeof(path), dir, sep, file->name, NULL);
@@ -5216,9 +5216,6 @@ static rocksdb::Status check_rocksdb_options_compatibility(
return status;
}
-bool prevent_myrocks_loading= false;
-
-
static int rocksdb_check_version(handlerton *hton,
const char *path,
const LEX_CUSTRING *version,
@@ -5239,14 +5236,6 @@ static int rocksdb_init_func(void *const p) {
DBUG_ENTER_FUNC();
- if (prevent_myrocks_loading)
- {
- my_error(ER_INTERNAL_ERROR, MYF(0),
- "Loading MyRocks plugin after it has been unloaded is not "
- "supported. Please restart mariadbd");
- DBUG_RETURN(1);
- }
-
if (rocksdb_ignore_datadic_errors)
{
sql_print_information(
@@ -5821,8 +5810,6 @@ static int rocksdb_init_func(void *const p) {
static int rocksdb_done_func(void *const p) {
DBUG_ENTER_FUNC();
- int error = 0;
-
// signal the drop index thread to stop
rdb_drop_idx_thread.signal(true);
@@ -5866,12 +5853,6 @@ static int rocksdb_done_func(void *const p) {
"RocksDB: Couldn't stop the manual compaction thread: (errno=%d)", err);
}
- if (rdb_open_tables.count()) {
- // Looks like we are getting unloaded and yet we have some open tables
- // left behind.
- error = 1;
- }
-
rdb_open_tables.free();
/*
destructors for static objects can be called at _exit(),
@@ -5923,7 +5904,7 @@ static int rocksdb_done_func(void *const p) {
MariaDB: don't clear rocksdb_db_options and rocksdb_tbl_options.
MyRocks' plugin variables refer to them.
- The plugin cannot be loaded again (see prevent_myrocks_loading) but plugin
+ The plugin cannot be loaded again but plugin
variables are processed before myrocks::rocksdb_init_func is invoked, so
they must point to valid memory.
*/
@@ -5938,12 +5919,12 @@ static int rocksdb_done_func(void *const p) {
my_error_unregister(HA_ERR_ROCKSDB_FIRST, HA_ERR_ROCKSDB_LAST);
/*
- Prevent loading the plugin after it has been loaded and then unloaded. This
- doesn't work currently.
+ returning non-zero status from the plugin deinit function will prevent
+ the server from unloading the plugin. it will only be marked unusable.
+ This is needed here, because RocksDB cannot be fully unloaded
+ and reloaded (see sql_plugin.cc near STB_GNU_UNIQUE).
*/
- prevent_myrocks_loading= true;
-
- DBUG_RETURN(error);
+ DBUG_RETURN(1);
}
static inline void rocksdb_smart_seek(bool seek_backward,
@@ -10833,7 +10814,7 @@ int ha_rocksdb::index_end() {
release_scan_iterator();
- bitmap_free(&m_lookup_bitmap);
+ my_bitmap_free(&m_lookup_bitmap);
active_index = MAX_KEY;
in_range_check_pushed_down = FALSE;
diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h
index 63279bc1b62..63bf7ffd602 100644
--- a/storage/rocksdb/ha_rocksdb.h
+++ b/storage/rocksdb/ha_rocksdb.h
@@ -397,7 +397,7 @@ class ha_rocksdb : public my_core::handler {
current lookup to be covered. If the bitmap field is null, that means this
index does not cover the current lookup for any record.
*/
- MY_BITMAP m_lookup_bitmap = {nullptr, nullptr, nullptr, 0, 0};
+ MY_BITMAP m_lookup_bitmap = {nullptr, nullptr, 0, 0};
int alloc_key_buffers(const TABLE *const table_arg,
const Rdb_tbl_def *const tbl_def_arg,
@@ -1062,8 +1062,6 @@ std::string rdb_corruption_marker_file_name();
const int MYROCKS_MARIADB_PLUGIN_MATURITY_LEVEL= MariaDB_PLUGIN_MATURITY_STABLE;
-extern bool prevent_myrocks_loading;
-
extern uint32_t rocksdb_ignore_datadic_errors;
void sql_print_verbose_info(const char *format, ...);
diff --git a/storage/rocksdb/mysql-test/rocksdb/r/col_opt_not_null.result b/storage/rocksdb/mysql-test/rocksdb/r/col_opt_not_null.result
index b3df869a0a7..a3a138555ee 100644
--- a/storage/rocksdb/mysql-test/rocksdb/r/col_opt_not_null.result
+++ b/storage/rocksdb/mysql-test/rocksdb/r/col_opt_not_null.result
@@ -1455,7 +1455,7 @@ pk INT AUTO_INCREMENT PRIMARY KEY,
c DECIMAL NOT NULL DEFAULT 1.1
) ENGINE=rocksdb;
Warnings:
-Note 1265 Data truncated for column 'c' at row 1
+Note 1265 Data truncated for column 'c' at row 0
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
pk int(11) NO PRI NULL auto_increment
diff --git a/storage/rocksdb/mysql-test/rocksdb/r/col_opt_null.result b/storage/rocksdb/mysql-test/rocksdb/r/col_opt_null.result
index f0cd1a7e8b3..f0d377890c5 100644
--- a/storage/rocksdb/mysql-test/rocksdb/r/col_opt_null.result
+++ b/storage/rocksdb/mysql-test/rocksdb/r/col_opt_null.result
@@ -1246,7 +1246,7 @@ c2 DECIMAL NULL DEFAULT 1.1,
pk INT AUTO_INCREMENT PRIMARY KEY
) ENGINE=rocksdb;
Warnings:
-Note 1265 Data truncated for column 'c2' at row 1
+Note 1265 Data truncated for column 'c2' at row 0
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
c decimal(10,0) YES NULL
diff --git a/storage/rocksdb/mysql-test/rocksdb/r/mariadb_plugin.result b/storage/rocksdb/mysql-test/rocksdb/r/mariadb_plugin.result
index 6d6cb1db54e..a8e42a4e2b2 100644
--- a/storage/rocksdb/mysql-test/rocksdb/r/mariadb_plugin.result
+++ b/storage/rocksdb/mysql-test/rocksdb/r/mariadb_plugin.result
@@ -10,26 +10,35 @@ connection default;
UNINSTALL SONAME 'ha_rocksdb';
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
+Warning 1620 Plugin is busy and will be uninstalled on shutdown
SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='ROCKSDB';
ENGINE SUPPORT
ROCKSDB NO
disconnect con1;
+select engine, support from information_schema.engines where engine='rocksdb';
+engine support
+select plugin_name,plugin_status from information_schema.plugins where plugin_name='rocksdb';
+plugin_name plugin_status
+ROCKSDB INACTIVE
#
# MDEV-15686: Loading MyRocks plugin back after it has been unloaded causes a crash
#
-call mtr.add_suppression("Plugin 'ROCKSDB.*' init function returned error.");
-call mtr.add_suppression("Plugin 'ROCKSDB.*' registration as a INFORMATION SCHEMA failed.");
-call mtr.add_suppression("Plugin 'ROCKSDB' registration as a STORAGE ENGINE failed");
-#
-# There are two possible scenarios:
-# ha_rocksdb.{dll,so} is still loaded into mysqld's address space. Its
-# global variables are in the state that doesn't allow it to be
-# initialized back (this is what MDEV-15686 is about). This is handled
-# by intentionally returning an error from rocksdb_init_func.
-#
-# The second case is when ha_rocksdb.{ddl,so} has been fully unloaded
-# and so it will be now loaded as if it happens for the first time.
-INSTALL SONAME 'ha_rocksdb';
-# Whatever happened on the previous step, restore things to the way they
-# were at testcase start.
-UNINSTALL SONAME 'ha_rocksdb';
+INSTALL PLUGIN rocksdb SONAME 'ha_rocksdb';
+ERROR HY000: Plugin 'rocksdb' already installed
+select engine, support from information_schema.engines where engine='rocksdb';
+engine support
+select plugin_name,plugin_status from information_schema.plugins where plugin_name='rocksdb';
+plugin_name plugin_status
+ROCKSDB INACTIVE
diff --git a/storage/rocksdb/mysql-test/rocksdb/t/mariadb_plugin.test b/storage/rocksdb/mysql-test/rocksdb/t/mariadb_plugin.test
index 0cf56c0cbd5..8f30d7c42b6 100644
--- a/storage/rocksdb/mysql-test/rocksdb/t/mariadb_plugin.test
+++ b/storage/rocksdb/mysql-test/rocksdb/t/mariadb_plugin.test
@@ -31,29 +31,15 @@ disconnect con1;
let $wait_condition= SELECT VARIABLE_VALUE=1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='Threads_cached';
--source include/wait_condition.inc
---echo #
---echo # MDEV-15686: Loading MyRocks plugin back after it has been unloaded causes a crash
---echo #
-call mtr.add_suppression("Plugin 'ROCKSDB.*' init function returned error.");
-call mtr.add_suppression("Plugin 'ROCKSDB.*' registration as a INFORMATION SCHEMA failed.");
-call mtr.add_suppression("Plugin 'ROCKSDB' registration as a STORAGE ENGINE failed");
+select engine, support from information_schema.engines where engine='rocksdb';
+select plugin_name,plugin_status from information_schema.plugins where plugin_name='rocksdb';
--echo #
---echo # There are two possible scenarios:
-
---echo # ha_rocksdb.{dll,so} is still loaded into mysqld's address space. Its
---echo # global variables are in the state that doesn't allow it to be
---echo # initialized back (this is what MDEV-15686 is about). This is handled
---echo # by intentionally returning an error from rocksdb_init_func.
+--echo # MDEV-15686: Loading MyRocks plugin back after it has been unloaded causes a crash
--echo #
---echo # The second case is when ha_rocksdb.{ddl,so} has been fully unloaded
---echo # and so it will be now loaded as if it happens for the first time.
-
---error 0,ER_INTERNAL_ERROR
-INSTALL SONAME 'ha_rocksdb';
---echo # Whatever happened on the previous step, restore things to the way they
---echo # were at testcase start.
---error 0,ER_SP_DOES_NOT_EXIST
-UNINSTALL SONAME 'ha_rocksdb';
+--error ER_PLUGIN_INSTALLED
+INSTALL PLUGIN rocksdb SONAME 'ha_rocksdb';
+select engine, support from information_schema.engines where engine='rocksdb';
+select plugin_name,plugin_status from information_schema.plugins where plugin_name='rocksdb';
diff --git a/storage/rocksdb/rdb_datadic.cc b/storage/rocksdb/rdb_datadic.cc
index e6113d437cf..164f6ba8205 100644
--- a/storage/rocksdb/rdb_datadic.cc
+++ b/storage/rocksdb/rdb_datadic.cc
@@ -1102,12 +1102,12 @@ size_t Rdb_key_def::get_unpack_header_size(char tag) {
*/
void Rdb_key_def::get_lookup_bitmap(const TABLE *table, MY_BITMAP *map) const {
DBUG_ASSERT(map->bitmap == nullptr);
- bitmap_init(map, nullptr, MAX_REF_PARTS, false);
+ my_bitmap_init(map, nullptr, MAX_REF_PARTS);
uint curr_bitmap_pos = 0;
// Indicates which columns in the read set might be covered.
MY_BITMAP maybe_covered_bitmap;
- bitmap_init(&maybe_covered_bitmap, nullptr, table->read_set->n_bits, false);
+ my_bitmap_init(&maybe_covered_bitmap, nullptr, table->read_set->n_bits);
for (uint i = 0; i < m_key_parts; i++) {
if (table_has_hidden_pk(table) && i + 1 == m_key_parts) {
@@ -1135,8 +1135,8 @@ void Rdb_key_def::get_lookup_bitmap(const TABLE *table, MY_BITMAP *map) const {
}
curr_bitmap_pos++;
} else {
- bitmap_free(&maybe_covered_bitmap);
- bitmap_free(map);
+ my_bitmap_free(&maybe_covered_bitmap);
+ my_bitmap_free(map);
return;
}
break;
@@ -1144,8 +1144,8 @@ void Rdb_key_def::get_lookup_bitmap(const TABLE *table, MY_BITMAP *map) const {
// know this lookup will never be covered.
default:
if (bitmap_is_set(table->read_set, field->field_index)) {
- bitmap_free(&maybe_covered_bitmap);
- bitmap_free(map);
+ my_bitmap_free(&maybe_covered_bitmap);
+ my_bitmap_free(map);
return;
}
break;
@@ -1155,9 +1155,9 @@ void Rdb_key_def::get_lookup_bitmap(const TABLE *table, MY_BITMAP *map) const {
// If there are columns which are not covered in the read set, the lookup
// can't be covered.
if (!bitmap_cmp(table->read_set, &maybe_covered_bitmap)) {
- bitmap_free(map);
+ my_bitmap_free(map);
}
- bitmap_free(&maybe_covered_bitmap);
+ my_bitmap_free(&maybe_covered_bitmap);
}
/*
@@ -1187,7 +1187,7 @@ bool Rdb_key_def::covers_lookup(const rocksdb::Slice *const unpack_info,
MY_BITMAP covered_bitmap;
my_bitmap_map covered_bits;
- bitmap_init(&covered_bitmap, &covered_bits, MAX_REF_PARTS, false);
+ my_bitmap_init(&covered_bitmap, &covered_bits, MAX_REF_PARTS);
covered_bits = rdb_netbuf_to_uint16((const uchar *)unpack_header +
sizeof(RDB_UNPACK_COVERED_DATA_TAG) +
RDB_UNPACK_COVERED_DATA_LEN_SIZE);
@@ -1356,7 +1356,7 @@ uint Rdb_key_def::pack_record(const TABLE *const tbl, uchar *const pack_buffer,
MY_BITMAP covered_bitmap;
my_bitmap_map covered_bits;
uint curr_bitmap_pos = 0;
- bitmap_init(&covered_bitmap, &covered_bits, MAX_REF_PARTS, false);
+ my_bitmap_init(&covered_bitmap, &covered_bits, MAX_REF_PARTS);
for (uint i = 0; i < n_key_parts; i++) {
// Fill hidden pk id into the last key part for secondary keys for tables
@@ -1661,7 +1661,7 @@ int Rdb_key_def::unpack_record(TABLE *const table, uchar *const buf,
bool has_covered_bitmap =
has_unpack_info && (unpack_header[0] == RDB_UNPACK_COVERED_DATA_TAG);
if (has_covered_bitmap) {
- bitmap_init(&covered_bitmap, &covered_bits, MAX_REF_PARTS, false);
+ my_bitmap_init(&covered_bitmap, &covered_bits, MAX_REF_PARTS);
covered_bits = rdb_netbuf_to_uint16((const uchar *)unpack_header +
sizeof(RDB_UNPACK_COVERED_DATA_TAG) +
RDB_UNPACK_COVERED_DATA_LEN_SIZE);
@@ -3852,7 +3852,7 @@ bool Rdb_validate_tbls::scan_for_frms(const std::string &datadir,
/* Scan through the files in the directory */
struct fileinfo *file_info = dir_info->dir_entry;
- for (uint ii = 0; ii < dir_info->number_of_files; ii++, file_info++) {
+ for (size_t ii = 0; ii < dir_info->number_of_files; ii++, file_info++) {
/* Find .frm files that are not temp files (those that contain '#sql') */
const char *ext = strrchr(file_info->name, '.');
if (ext != nullptr && strstr(file_info->name, tmp_file_prefix) == nullptr &&
@@ -3897,7 +3897,7 @@ bool Rdb_validate_tbls::compare_to_actual_tables(const std::string &datadir,
}
file_info = dir_info->dir_entry;
- for (uint ii = 0; ii < dir_info->number_of_files; ii++, file_info++) {
+ for (size_t ii = 0; ii < dir_info->number_of_files; ii++, file_info++) {
/* Ignore files/dirs starting with '.' */
if (file_info->name[0] == '.') continue;
diff --git a/storage/rocksdb/rdb_i_s.cc b/storage/rocksdb/rdb_i_s.cc
index 5350ec3bce9..a3d284dfa64 100644
--- a/storage/rocksdb/rdb_i_s.cc
+++ b/storage/rocksdb/rdb_i_s.cc
@@ -145,9 +145,6 @@ static int rdb_i_s_cfstats_fill_table(
static int rdb_i_s_cfstats_init(void *p) {
DBUG_ENTER_FUNC();
- if (prevent_myrocks_loading)
- DBUG_RETURN(1);
-
DBUG_ASSERT(p != nullptr);
my_core::ST_SCHEMA_TABLE *schema;
@@ -241,9 +238,6 @@ static int rdb_i_s_dbstats_fill_table(
static int rdb_i_s_dbstats_init(void *const p) {
DBUG_ENTER_FUNC();
- if (prevent_myrocks_loading)
- DBUG_RETURN(1);
-
DBUG_ASSERT(p != nullptr);
my_core::ST_SCHEMA_TABLE *schema;
@@ -344,8 +338,6 @@ static int rdb_i_s_perf_context_fill_table(
static int rdb_i_s_perf_context_init(void *const p) {
DBUG_ENTER_FUNC();
- if (prevent_myrocks_loading)
- DBUG_RETURN(1);
DBUG_ASSERT(p != nullptr);
my_core::ST_SCHEMA_TABLE *schema;
@@ -413,9 +405,6 @@ static int rdb_i_s_perf_context_global_fill_table(
static int rdb_i_s_perf_context_global_init(void *const p) {
DBUG_ENTER_FUNC();
- if (prevent_myrocks_loading)
- DBUG_RETURN(1);
-
DBUG_ASSERT(p != nullptr);
my_core::ST_SCHEMA_TABLE *schema;
@@ -1045,9 +1034,6 @@ static int rdb_i_s_ddl_fill_table(my_core::THD *const thd,
static int rdb_i_s_ddl_init(void *const p) {
DBUG_ENTER_FUNC();
- if (prevent_myrocks_loading)
- DBUG_RETURN(1);
-
my_core::ST_SCHEMA_TABLE *schema;
DBUG_ASSERT(p != nullptr);
@@ -1063,9 +1049,6 @@ static int rdb_i_s_ddl_init(void *const p) {
static int rdb_i_s_cfoptions_init(void *const p) {
DBUG_ENTER_FUNC();
- if (prevent_myrocks_loading)
- DBUG_RETURN(1);
-
DBUG_ASSERT(p != nullptr);
my_core::ST_SCHEMA_TABLE *schema;
@@ -1081,9 +1064,6 @@ static int rdb_i_s_cfoptions_init(void *const p) {
static int rdb_i_s_global_info_init(void *const p) {
DBUG_ENTER_FUNC();
- if (prevent_myrocks_loading)
- DBUG_RETURN(1);
-
DBUG_ASSERT(p != nullptr);
my_core::ST_SCHEMA_TABLE *schema;
@@ -1101,9 +1081,6 @@ static int rdb_i_s_compact_stats_init(void *p) {
DBUG_ENTER_FUNC();
- if (prevent_myrocks_loading)
- DBUG_RETURN(1);
-
DBUG_ASSERT(p != nullptr);
schema = reinterpret_cast<my_core::ST_SCHEMA_TABLE *>(p);
@@ -1438,9 +1415,6 @@ static int rdb_i_s_index_file_map_fill_table(
static int rdb_i_s_index_file_map_init(void *const p) {
DBUG_ENTER_FUNC();
- if (prevent_myrocks_loading)
- DBUG_RETURN(1);
-
DBUG_ASSERT(p != nullptr);
my_core::ST_SCHEMA_TABLE *schema;
@@ -1523,9 +1497,6 @@ static int rdb_i_s_lock_info_fill_table(
static int rdb_i_s_lock_info_init(void *const p) {
DBUG_ENTER_FUNC();
- if (prevent_myrocks_loading)
- DBUG_RETURN(1);
-
DBUG_ASSERT(p != nullptr);
my_core::ST_SCHEMA_TABLE *schema;
@@ -1651,9 +1622,6 @@ static int rdb_i_s_trx_info_fill_table(
static int rdb_i_s_trx_info_init(void *const p) {
DBUG_ENTER_FUNC();
- if (prevent_myrocks_loading)
- DBUG_RETURN(1);
-
DBUG_ASSERT(p != nullptr);
my_core::ST_SCHEMA_TABLE *schema;
@@ -1781,7 +1749,8 @@ static int rdb_i_s_deadlock_info_init(void *const p) {
static int rdb_i_s_deinit(void *p MY_ATTRIBUTE((__unused__))) {
DBUG_ENTER_FUNC();
- DBUG_RETURN(0);
+ /* see the comment at the end of rocksdb_done_func() */
+ DBUG_RETURN(1);
}
static struct st_mysql_information_schema rdb_i_s_info = {
@@ -1955,7 +1924,7 @@ struct st_maria_plugin rdb_i_s_lock_info = {
"RocksDB lock information",
PLUGIN_LICENSE_GPL,
rdb_i_s_lock_info_init,
- nullptr,
+ rdb_i_s_deinit,
0x0001, /* version number (0.1) */
nullptr, /* status variables */
nullptr, /* system variables */
@@ -1971,7 +1940,7 @@ struct st_maria_plugin rdb_i_s_trx_info = {
"RocksDB transaction information",
PLUGIN_LICENSE_GPL,
rdb_i_s_trx_info_init,
- nullptr,
+ rdb_i_s_deinit,
0x0001, /* version number (0.1) */
nullptr, /* status variables */
nullptr, /* system variables */
@@ -1987,7 +1956,7 @@ struct st_maria_plugin rdb_i_s_deadlock_info = {
"RocksDB transaction information",
PLUGIN_LICENSE_GPL,
rdb_i_s_deadlock_info_init,
- nullptr,
+ rdb_i_s_deinit,
0x0001, /* version number (0.1) */
nullptr, /* status variables */
nullptr, /* system variables */
diff --git a/storage/rocksdb/rdb_sst_info.cc b/storage/rocksdb/rdb_sst_info.cc
index 45ae89c1bd4..ae3938c3918 100644
--- a/storage/rocksdb/rdb_sst_info.cc
+++ b/storage/rocksdb/rdb_sst_info.cc
@@ -542,7 +542,7 @@ void Rdb_sst_info::init(const rocksdb::DB *const db) {
// Scan through the files in the directory
const struct fileinfo *file_info = dir_info->dir_entry;
- for (uint ii= 0; ii < dir_info->number_of_files; ii++, file_info++) {
+ for (size_t ii= 0; ii < dir_info->number_of_files; ii++, file_info++) {
// find any files ending with m_suffix ...
const std::string name = file_info->name;
const size_t pos = name.find(m_suffix);
diff --git a/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result b/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result
index aa734573a1a..484ef1a00bd 100644
--- a/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result
+++ b/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result
@@ -36,6 +36,10 @@ SELECT 1;
3.1
auto_increment
connection master_1;
+SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode;
+SET SESSION spider_auto_increment_mode = -1;
+Warnings:
+Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
connection slave1_1;
connection master_1;
DROP TABLE IF EXISTS t1, t2;
@@ -190,6 +194,7 @@ LAST_INSERT_ID()
SELECT MAX(id) FROM t2;
MAX(id)
10000
+SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode;
connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
diff --git a/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result b/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result
index b793346df4b..d4b05f75660 100644
--- a/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result
+++ b/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result
@@ -34,6 +34,10 @@ SELECT 1;
1
auto_increment with partition
connection master_1;
+SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode;
+SET SESSION spider_auto_increment_mode = -1;
+Warnings:
+Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
connection slave1_1;
connection master_1;
DROP TABLE IF EXISTS t1, t2;
@@ -188,6 +192,7 @@ LAST_INSERT_ID()
SELECT MAX(id) FROM t2;
MAX(id)
10000
+SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode;
connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
diff --git a/storage/spider/mysql-test/spider/bg/r/spider_fixes.result b/storage/spider/mysql-test/spider/bg/r/spider_fixes.result
index 1db31ca9f95..0b0514a9346 100644
--- a/storage/spider/mysql-test/spider/bg/r/spider_fixes.result
+++ b/storage/spider/mysql-test/spider/bg/r/spider_fixes.result
@@ -413,6 +413,10 @@ connection master_1;
read only
connection master_1;
+SET @original_spider_read_only_mode = @@SESSION.spider_read_only_mode;
+SET SESSION spider_read_only_mode = -1;
+Warnings:
+Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL,
@@ -441,10 +445,19 @@ DELETE FROM t1;
ERROR HY000: Table 'auto_test_local.t1' is read only
TRUNCATE t1;
ERROR HY000: Table 'auto_test_local.t1' is read only
+SET SESSION spider_read_only_mode = @original_spider_read_only_mode;
2.27
error mode
connection master_1;
+SET @original_spider_error_read_mode = @@SESSION.spider_error_read_mode;
+SET @original_spider_error_write_mode = @@SESSION.spider_error_write_mode;
+SET SESSION spider_error_read_mode = -1;
+Warnings:
+Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
+SET SESSION spider_error_write_mode = -1;
+Warnings:
+Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL,
@@ -466,6 +479,8 @@ Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist
TRUNCATE t1;
Warnings:
Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist
+SET SESSION spider_error_read_mode = @original_spider_error_read_mode;
+SET SESSION spider_error_write_mode = @original_spider_error_write_mode;
3.0
is null
diff --git a/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test b/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test
index 64d3b657ae8..30d22a6a16f 100644
--- a/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test
+++ b/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test
@@ -97,6 +97,8 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
+SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode;
+SET SESSION spider_auto_increment_mode = -1;
if ($USE_REPLICATION)
{
save_master_pos;
@@ -222,6 +224,7 @@ SELECT MAX(id) FROM t1;
INSERT INTO t2 (id) VALUES (1000);
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t2;
+SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode;
if ($USE_REPLICATION)
{
save_master_pos;
diff --git a/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test b/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test
index bcd85f42b81..e9c9c194e5c 100644
--- a/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test
+++ b/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test
@@ -131,6 +131,8 @@ if ($HAVE_PARTITION)
}
}
--connection master_1
+ SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode;
+ SET SESSION spider_auto_increment_mode = -1;
if ($USE_REPLICATION)
{
save_master_pos;
@@ -256,6 +258,7 @@ if ($HAVE_PARTITION)
INSERT INTO t2 (id) VALUES (1000);
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t2;
+ SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode;
if ($USE_REPLICATION)
{
save_master_pos;
diff --git a/storage/spider/mysql-test/spider/bg/t/spider_fixes.test b/storage/spider/mysql-test/spider/bg/t/spider_fixes.test
index 9f7ada052ed..b222f494ba1 100644
--- a/storage/spider/mysql-test/spider/bg/t/spider_fixes.test
+++ b/storage/spider/mysql-test/spider/bg/t/spider_fixes.test
@@ -1172,6 +1172,8 @@ let $MASTER_1_ENGINE_IS_SPIDER=
if ($MASTER_1_ENGINE_IS_SPIDER)
{
--connection master_1
+ SET @original_spider_read_only_mode = @@SESSION.spider_read_only_mode;
+ SET SESSION spider_read_only_mode = -1;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
@@ -1197,6 +1199,7 @@ if ($MASTER_1_ENGINE_IS_SPIDER)
DELETE FROM t1;
--error 12518
TRUNCATE t1;
+ SET SESSION spider_read_only_mode = @original_spider_read_only_mode;
}
if (!$MASTER_1_ENGINE_IS_SPIDER)
{
@@ -1210,6 +1213,10 @@ if (!$MASTER_1_ENGINE_IS_SPIDER)
if ($MASTER_1_ENGINE_IS_SPIDER)
{
--connection master_1
+ SET @original_spider_error_read_mode = @@SESSION.spider_error_read_mode;
+ SET @original_spider_error_write_mode = @@SESSION.spider_error_write_mode;
+ SET SESSION spider_error_read_mode = -1;
+ SET SESSION spider_error_write_mode = -1;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
@@ -1227,6 +1234,8 @@ if ($MASTER_1_ENGINE_IS_SPIDER)
INSERT INTO t1 (id) VALUES (1);
DELETE FROM t1;
TRUNCATE t1;
+ SET SESSION spider_error_read_mode = @original_spider_error_read_mode;
+ SET SESSION spider_error_write_mode = @original_spider_error_write_mode;
}
if (!$MASTER_1_ENGINE_IS_SPIDER)
{
diff --git a/storage/spider/mysql-test/spider/handler/r/spider3_fixes.result b/storage/spider/mysql-test/spider/handler/r/spider3_fixes.result
index 9a8a59153f0..abe543fe193 100644
--- a/storage/spider/mysql-test/spider/handler/r/spider3_fixes.result
+++ b/storage/spider/mysql-test/spider/handler/r/spider3_fixes.result
@@ -36,6 +36,10 @@ SELECT 1;
3.1
auto_increment
connection master_1;
+SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode;
+SET SESSION spider_auto_increment_mode = -1;
+Warnings:
+Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
connection slave1_1;
connection master_1;
DROP TABLE IF EXISTS t1, t2;
@@ -206,6 +210,7 @@ LAST_INSERT_ID()
SELECT MAX(id) FROM t2;
MAX(id)
46
+SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode;
connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
diff --git a/storage/spider/mysql-test/spider/handler/r/spider3_fixes_part.result b/storage/spider/mysql-test/spider/handler/r/spider3_fixes_part.result
index f8747cff5ea..6c3a1802f1d 100644
--- a/storage/spider/mysql-test/spider/handler/r/spider3_fixes_part.result
+++ b/storage/spider/mysql-test/spider/handler/r/spider3_fixes_part.result
@@ -34,6 +34,10 @@ SELECT 1;
1
auto_increment with partition
connection master_1;
+SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode;
+SET SESSION spider_auto_increment_mode = -1;
+Warnings:
+Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
connection slave1_1;
connection master_1;
DROP TABLE IF EXISTS t1, t2;
@@ -204,6 +208,7 @@ LAST_INSERT_ID()
SELECT MAX(id) FROM t2;
MAX(id)
26
+SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode;
connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
diff --git a/storage/spider/mysql-test/spider/handler/r/spider_fixes.result b/storage/spider/mysql-test/spider/handler/r/spider_fixes.result
index c171167a1b7..f11b1d9b32c 100644
--- a/storage/spider/mysql-test/spider/handler/r/spider_fixes.result
+++ b/storage/spider/mysql-test/spider/handler/r/spider_fixes.result
@@ -306,6 +306,10 @@ UNLOCK TABLES;
auto_increment
connection master_1;
+SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode;
+SET SESSION spider_auto_increment_mode = -1;
+Warnings:
+Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
connection slave1_1;
connection master_1;
DROP TABLE IF EXISTS t1;
@@ -399,6 +403,7 @@ LAST_INSERT_ID()
SELECT MAX(id) FROM t1;
MAX(id)
42
+SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode;
connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
@@ -417,6 +422,10 @@ connection master_1;
read only
connection master_1;
+SET @original_spider_read_only_mode = @@SESSION.spider_read_only_mode;
+SET SESSION spider_read_only_mode = -1;
+Warnings:
+Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL,
@@ -445,10 +454,19 @@ DELETE FROM t1;
ERROR HY000: Table 'auto_test_local.t1' is read only
TRUNCATE t1;
ERROR HY000: Table 'auto_test_local.t1' is read only
+SET SESSION spider_read_only_mode = @original_spider_read_only_mode;
2.27
error mode
connection master_1;
+SET @original_spider_error_read_mode = @@SESSION.spider_error_read_mode;
+SET @original_spider_error_write_mode = @@SESSION.spider_error_write_mode;
+SET SESSION spider_error_read_mode = -1;
+Warnings:
+Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
+SET SESSION spider_error_write_mode = -1;
+Warnings:
+Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL,
@@ -470,6 +488,8 @@ Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist
TRUNCATE t1;
Warnings:
Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist
+SET SESSION spider_error_read_mode = @original_spider_error_read_mode;
+SET SESSION spider_error_write_mode = @original_spider_error_write_mode;
3.0
is null
diff --git a/storage/spider/mysql-test/spider/handler/r/spider_fixes_part.result b/storage/spider/mysql-test/spider/handler/r/spider_fixes_part.result
index c99c02071b6..249f39520c2 100644
--- a/storage/spider/mysql-test/spider/handler/r/spider_fixes_part.result
+++ b/storage/spider/mysql-test/spider/handler/r/spider_fixes_part.result
@@ -109,6 +109,10 @@ a b c
2.26
auto_increment with partition
connection master_1;
+SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode;
+SET SESSION spider_auto_increment_mode = -1;
+Warnings:
+Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
connection slave1_1;
connection master_1;
DROP TABLE IF EXISTS t1;
@@ -202,6 +206,7 @@ LAST_INSERT_ID()
SELECT MAX(id) FROM t1;
MAX(id)
26
+SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode;
connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
diff --git a/storage/spider/mysql-test/spider/handler/t/spider3_fixes.test b/storage/spider/mysql-test/spider/handler/t/spider3_fixes.test
index 64d3b657ae8..30d22a6a16f 100644
--- a/storage/spider/mysql-test/spider/handler/t/spider3_fixes.test
+++ b/storage/spider/mysql-test/spider/handler/t/spider3_fixes.test
@@ -97,6 +97,8 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
+SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode;
+SET SESSION spider_auto_increment_mode = -1;
if ($USE_REPLICATION)
{
save_master_pos;
@@ -222,6 +224,7 @@ SELECT MAX(id) FROM t1;
INSERT INTO t2 (id) VALUES (1000);
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t2;
+SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode;
if ($USE_REPLICATION)
{
save_master_pos;
diff --git a/storage/spider/mysql-test/spider/handler/t/spider3_fixes_part.test b/storage/spider/mysql-test/spider/handler/t/spider3_fixes_part.test
index bcd85f42b81..e9c9c194e5c 100644
--- a/storage/spider/mysql-test/spider/handler/t/spider3_fixes_part.test
+++ b/storage/spider/mysql-test/spider/handler/t/spider3_fixes_part.test
@@ -131,6 +131,8 @@ if ($HAVE_PARTITION)
}
}
--connection master_1
+ SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode;
+ SET SESSION spider_auto_increment_mode = -1;
if ($USE_REPLICATION)
{
save_master_pos;
@@ -256,6 +258,7 @@ if ($HAVE_PARTITION)
INSERT INTO t2 (id) VALUES (1000);
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t2;
+ SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode;
if ($USE_REPLICATION)
{
save_master_pos;
diff --git a/storage/spider/mysql-test/spider/handler/t/spider_fixes.test b/storage/spider/mysql-test/spider/handler/t/spider_fixes.test
index 9f7ada052ed..5a3c1d1c893 100644
--- a/storage/spider/mysql-test/spider/handler/t/spider_fixes.test
+++ b/storage/spider/mysql-test/spider/handler/t/spider_fixes.test
@@ -1049,6 +1049,8 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
+SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode;
+SET SESSION spider_auto_increment_mode = -1;
if ($USE_REPLICATION)
{
save_master_pos;
@@ -1120,6 +1122,7 @@ SELECT MAX(id) FROM t1;
INSERT INTO t1 (id) VALUES (1000);
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t1;
+SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode;
if ($USE_REPLICATION)
{
save_master_pos;
@@ -1172,6 +1175,8 @@ let $MASTER_1_ENGINE_IS_SPIDER=
if ($MASTER_1_ENGINE_IS_SPIDER)
{
--connection master_1
+ SET @original_spider_read_only_mode = @@SESSION.spider_read_only_mode;
+ SET SESSION spider_read_only_mode = -1;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
@@ -1197,6 +1202,7 @@ if ($MASTER_1_ENGINE_IS_SPIDER)
DELETE FROM t1;
--error 12518
TRUNCATE t1;
+ SET SESSION spider_read_only_mode = @original_spider_read_only_mode;
}
if (!$MASTER_1_ENGINE_IS_SPIDER)
{
@@ -1210,6 +1216,10 @@ if (!$MASTER_1_ENGINE_IS_SPIDER)
if ($MASTER_1_ENGINE_IS_SPIDER)
{
--connection master_1
+ SET @original_spider_error_read_mode = @@SESSION.spider_error_read_mode;
+ SET @original_spider_error_write_mode = @@SESSION.spider_error_write_mode;
+ SET SESSION spider_error_read_mode = -1;
+ SET SESSION spider_error_write_mode = -1;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
@@ -1227,6 +1237,8 @@ if ($MASTER_1_ENGINE_IS_SPIDER)
INSERT INTO t1 (id) VALUES (1);
DELETE FROM t1;
TRUNCATE t1;
+ SET SESSION spider_error_read_mode = @original_spider_error_read_mode;
+ SET SESSION spider_error_write_mode = @original_spider_error_write_mode;
}
if (!$MASTER_1_ENGINE_IS_SPIDER)
{
diff --git a/storage/spider/mysql-test/spider/handler/t/spider_fixes_part.test b/storage/spider/mysql-test/spider/handler/t/spider_fixes_part.test
index e6c4456edcb..22ba6102405 100644
--- a/storage/spider/mysql-test/spider/handler/t/spider_fixes_part.test
+++ b/storage/spider/mysql-test/spider/handler/t/spider_fixes_part.test
@@ -485,6 +485,8 @@ if ($HAVE_PARTITION)
}
}
--connection master_1
+ SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode;
+ SET SESSION spider_auto_increment_mode = -1;
if ($USE_REPLICATION)
{
save_master_pos;
@@ -556,6 +558,7 @@ if ($HAVE_PARTITION)
INSERT INTO t1 (id) VALUES (1000);
SELECT LAST_INSERT_ID();
SELECT MAX(id) FROM t1;
+ SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode;
if ($USE_REPLICATION)
{
save_master_pos;
diff --git a/storage/spider/mysql-test/spider/include/init_spider.inc b/storage/spider/mysql-test/spider/include/init_spider.inc
index 6a22ffcc1fd..b3fb4df239b 100644
--- a/storage/spider/mysql-test/spider/include/init_spider.inc
+++ b/storage/spider/mysql-test/spider/include/init_spider.inc
@@ -149,13 +149,7 @@ if (!$VERSION_COMPILE_OS_WIN)
}
}
-let $SERVER_NAME=
- `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(version(), '-', 2), '-', -1)`;
-if (`SELECT IF('$SERVER_NAME' REGEXP '^[0-9]+\$', 1, 0)`)
-{
- let $SERVER_NAME=
- `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(version(), '-', 3), '-', -1)`;
-}
+let $SERVER_NAME=MariaDB;
let $SERVER_MAJOR_VERSION=
`SELECT SUBSTRING_INDEX(version(), '.', 1)`;
let $SERVER_MINOR_VERSION=
diff --git a/storage/spider/mysql-test/spider/r/error_row_number.result b/storage/spider/mysql-test/spider/r/error_row_number.result
new file mode 100644
index 00000000000..cc2b54878a0
--- /dev/null
+++ b/storage/spider/mysql-test/spider/r/error_row_number.result
@@ -0,0 +1,45 @@
+#
+# MDEV-26693 ROW_NUMBER is wrong upon INSERT or UPDATE on Spider table
+#
+for master_1
+for child2
+child2_1
+child2_2
+child2_3
+for child3
+child3_1
+child3_2
+child3_3
+connection child2_1;
+create database auto_test_remote;
+use auto_test_remote;
+create table ta_r (id int primary key);
+connection master_1;
+create table spd (id int primary key) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
+insert into spd values (1),(2),(1);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+get diagnostics condition 1 @n = row_number;
+select @n;
+@n
+0
+delete from spd;
+insert into spd values (1),(2),(3),(13);
+update spd set id = id + 10;
+ERROR 23000: Duplicate entry '13' for key 'PRIMARY'
+get diagnostics condition 1 @n = row_number;
+select @n;
+@n
+0
+drop table spd;
+connection child2_1;
+drop database auto_test_remote;
+connection master_1;
+for master_1
+for child2
+child2_1
+child2_2
+child2_3
+for child3
+child3_1
+child3_2
+child3_3
diff --git a/storage/spider/mysql-test/spider/r/spider_fixes.result b/storage/spider/mysql-test/spider/r/spider_fixes.result
index b2a2fad5238..6ece4b6255e 100644
--- a/storage/spider/mysql-test/spider/r/spider_fixes.result
+++ b/storage/spider/mysql-test/spider/r/spider_fixes.result
@@ -413,6 +413,10 @@ connection master_1;
read only
connection master_1;
+SET @original_spider_read_only_mode = @@SESSION.spider_read_only_mode;
+SET SESSION spider_read_only_mode = -1;
+Warnings:
+Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL,
@@ -441,10 +445,19 @@ DELETE FROM t1;
ERROR HY000: Table 'auto_test_local.t1' is read only
TRUNCATE t1;
ERROR HY000: Table 'auto_test_local.t1' is read only
+SET SESSION spider_read_only_mode = @original_spider_read_only_mode;
2.27
error mode
connection master_1;
+SET @original_spider_error_read_mode = @@SESSION.spider_error_read_mode;
+SET @original_spider_error_write_mode = @@SESSION.spider_error_write_mode;
+SET SESSION spider_error_read_mode = -1;
+Warnings:
+Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
+SET SESSION spider_error_write_mode = -1;
+Warnings:
+Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL,
@@ -466,6 +479,8 @@ Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist
TRUNCATE t1;
Warnings:
Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist
+SET SESSION spider_error_read_mode = @original_spider_error_read_mode;
+SET SESSION spider_error_write_mode = @original_spider_error_write_mode;
3.0
is null
diff --git a/storage/spider/mysql-test/spider/r/variable_deprecation.result b/storage/spider/mysql-test/spider/r/variable_deprecation.result
new file mode 100644
index 00000000000..8840f1da892
--- /dev/null
+++ b/storage/spider/mysql-test/spider/r/variable_deprecation.result
@@ -0,0 +1,223 @@
+#
+# MDEV-27228 Deprecate Spider plugin variables that result in excessive tweak
+#
+for master_1
+for child2
+child2_1
+child2_2
+child2_3
+for child3
+child3_1
+child3_2
+child3_3
+connection master_1;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+# MDEV-27923 Deprecate spider_use_handler
+SET spider_use_handler = 3;
+Warnings:
+Warning 1287 '@@spider_use_handler' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_use_handler";
+Variable_name Value
+spider_use_handler 3
+CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='uhd "3"';
+Warnings:
+Warning 1287 The table parameter 'uhd' is deprecated and will be removed in a future release
+CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='use_handler "3"';
+Warnings:
+Warning 1287 The table parameter 'use_handler' is deprecated and will be removed in a future release
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+# MDEV-28297 Deprecate spider_internal_offset
+SET spider_internal_offset = 1;
+Warnings:
+Warning 1287 '@@spider_internal_offset' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_internal_offset";
+Variable_name Value
+spider_internal_offset 1
+CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='ios "1"';
+Warnings:
+Warning 1287 The table parameter 'ios' is deprecated and will be removed in a future release
+CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='internal_offset "1"';
+Warnings:
+Warning 1287 The table parameter 'internal_offset' is deprecated and will be removed in a future release
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+# MDEV-28005 Deprecate Spider plugin variables regarding UDFs
+SET GLOBAL spider_udf_ds_bulk_insert_rows = 1;
+Warnings:
+Warning 1287 '@@spider_udf_ds_bulk_insert_rows' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_udf_ds_bulk_insert_rows";
+Variable_name Value
+spider_udf_ds_bulk_insert_rows -1
+SET spider_udf_ds_table_loop_mode = 1;
+Warnings:
+Warning 1287 '@@spider_udf_ds_table_loop_mode' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_udf_ds_table_loop_mode";
+Variable_name Value
+spider_udf_ds_table_loop_mode 1
+SET spider_udf_ds_use_real_table = 1;
+Warnings:
+Warning 1287 '@@spider_udf_ds_use_real_table' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_udf_ds_use_real_table";
+Variable_name Value
+spider_udf_ds_use_real_table 1
+SET GLOBAL spider_udf_ct_bulk_insert_interval = 1;
+Warnings:
+Warning 1287 '@@spider_udf_ct_bulk_insert_interval' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_udf_ct_bulk_insert_interval";
+Variable_name Value
+spider_udf_ct_bulk_insert_interval 1
+SET GLOBAL spider_udf_ct_bulk_insert_rows = 1;
+Warnings:
+Warning 1287 '@@spider_udf_ct_bulk_insert_rows' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_udf_ct_bulk_insert_rows";
+Variable_name Value
+spider_udf_ct_bulk_insert_rows 1
+# MDEV-27981 Deprecate spider_internal_limit
+SET spider_internal_limit = 1;
+Warnings:
+Warning 1287 '@@spider_internal_limit' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_internal_limit";
+Variable_name Value
+spider_internal_limit 9223372032559808513
+CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='ilm "1"';
+Warnings:
+Warning 1287 The table parameter 'ilm' is deprecated and will be removed in a future release
+CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='internal_limit "1"';
+Warnings:
+Warning 1287 The table parameter 'internal_limit' is deprecated and will be removed in a future release
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+# MDEV-28244 Deprecate spider_xa_register_mode
+SET spider_xa_register_mode = 0;
+Warnings:
+Warning 1287 '@@spider_xa_register_mode' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_xa_register_mode";
+Variable_name Value
+spider_xa_register_mode 0
+# MDEV-28007 Deprecate Spider plugin variables regarding statistics persistence
+SET GLOBAL spider_store_last_sts = 0;
+Warnings:
+Warning 1287 '@@spider_store_last_sts' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_store_last_sts";
+Variable_name Value
+spider_store_last_sts 0
+SET GLOBAL spider_store_last_crd = 0;
+Warnings:
+Warning 1287 '@@spider_store_last_crd' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_store_last_crd";
+Variable_name Value
+spider_store_last_crd 0
+SET GLOBAL spider_load_sts_at_startup = 0;
+Warnings:
+Warning 1287 '@@spider_load_sts_at_startup' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_load_sts_at_startup";
+Variable_name Value
+spider_load_sts_at_startup 0
+SET GLOBAL spider_load_crd_at_startup = 0;
+Warnings:
+Warning 1287 '@@spider_load_crd_at_startup' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_load_crd_at_startup";
+Variable_name Value
+spider_load_crd_at_startup 0
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+# MDEV-28008 Deprecate spider_crd_mode and spider_sts_mode
+SET spider_crd_mode = 1;
+Warnings:
+Warning 1287 '@@spider_crd_mode' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_crd_mode";
+Variable_name Value
+spider_crd_mode 1
+CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='cmd "3"';
+Warnings:
+Warning 1287 The table parameter 'cmd' is deprecated and will be removed in a future release
+CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='crd_mode "3"';
+Warnings:
+Warning 1287 The table parameter 'crd_mode' is deprecated and will be removed in a future release
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+SET spider_sts_mode = 1;
+Warnings:
+Warning 1287 '@@spider_sts_mode' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_sts_mode";
+Variable_name Value
+spider_sts_mode 1
+CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='smd "3"';
+Warnings:
+Warning 1287 The table parameter 'smd' is deprecated and will be removed in a future release
+CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='sts_mode "3"';
+Warnings:
+Warning 1287 The table parameter 'sts_mode' is deprecated and will be removed in a future release
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+# MDEV-28010 Deprecate spider_crd_type and spider_crd_weight
+SET spider_crd_type = 1;
+Warnings:
+Warning 1287 '@@spider_crd_type' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_crd_type";
+Variable_name Value
+spider_crd_type 1
+CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='ctp "1"';
+Warnings:
+Warning 1287 The table parameter 'ctp' is deprecated and will be removed in a future release
+CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='crd_type "1"';
+Warnings:
+Warning 1287 The table parameter 'crd_type' is deprecated and will be removed in a future release
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+SET spider_crd_weight = 1;
+Warnings:
+Warning 1287 '@@spider_crd_weight' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_crd_weight";
+Variable_name Value
+spider_crd_weight 1
+CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='cwg "1"';
+Warnings:
+Warning 1287 The table parameter 'cwg' is deprecated and will be removed in a future release
+CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='crd_weight "1"';
+Warnings:
+Warning 1287 The table parameter 'crd_weight' is deprecated and will be removed in a future release
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+# MDEV-28560 Deprecate spider_buffer_size
+SET spider_buffer_size = 1;
+Warnings:
+Warning 1287 '@@spider_buffer_size' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_buffer_size";
+Variable_name Value
+spider_buffer_size 1
+CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='bfz "1"';
+Warnings:
+Warning 1287 The table parameter 'bfz' is deprecated and will be removed in a future release
+CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='buffer_size "1"';
+Warnings:
+Warning 1287 The table parameter 'buffer_size' is deprecated and will be removed in a future release
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+# MDEV-27926 Deprecate spider_init_sql_alloc_size
+SET spider_init_sql_alloc_size = 1;
+Warnings:
+Warning 1287 '@@spider_init_sql_alloc_size' is deprecated and will be removed in a future release
+SHOW VARIABLES LIKE "spider_init_sql_alloc_size";
+Variable_name Value
+spider_init_sql_alloc_size 1
+CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='isa "1"';
+Warnings:
+Warning 1287 The table parameter 'isa' is deprecated and will be removed in a future release
+CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='init_sql_alloc_size "1"';
+Warnings:
+Warning 1287 The table parameter 'init_sql_alloc_size' is deprecated and will be removed in a future release
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+DROP DATABASE auto_test_local;
+for master_1
+for child2
+child2_1
+child2_2
+child2_3
+for child3
+child3_1
+child3_2
+child3_3
diff --git a/storage/spider/mysql-test/spider/t/error_row_number.test b/storage/spider/mysql-test/spider/t/error_row_number.test
new file mode 100644
index 00000000000..408e739656a
--- /dev/null
+++ b/storage/spider/mysql-test/spider/t/error_row_number.test
@@ -0,0 +1,37 @@
+--echo #
+--echo # MDEV-26693 ROW_NUMBER is wrong upon INSERT or UPDATE on Spider table
+--echo #
+
+--disable_query_log
+--disable_result_log
+--source test_init.inc
+--enable_result_log
+--enable_query_log
+
+--connection child2_1
+create database auto_test_remote;
+use auto_test_remote;
+create table ta_r (id int primary key);
+
+--connection master_1
+evalp create table spd (id int primary key) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
+
+--error ER_DUP_ENTRY
+insert into spd values (1),(2),(1);
+get diagnostics condition 1 @n = row_number;
+select @n;
+
+delete from spd;
+insert into spd values (1),(2),(3),(13);
+--error ER_DUP_ENTRY
+update spd set id = id + 10;
+get diagnostics condition 1 @n = row_number;
+select @n;
+
+drop table spd;
+--connection child2_1
+drop database auto_test_remote;
+--connection master_1
+--disable_query_log
+--disable_result_log
+--source test_deinit.inc
diff --git a/storage/spider/mysql-test/spider/t/spider_fixes.test b/storage/spider/mysql-test/spider/t/spider_fixes.test
index 56e143060e6..47bc225d614 100644
--- a/storage/spider/mysql-test/spider/t/spider_fixes.test
+++ b/storage/spider/mysql-test/spider/t/spider_fixes.test
@@ -1172,6 +1172,8 @@ let $MASTER_1_ENGINE_IS_SPIDER=
if ($MASTER_1_ENGINE_IS_SPIDER)
{
--connection master_1
+ SET @original_spider_read_only_mode = @@SESSION.spider_read_only_mode;
+ SET SESSION spider_read_only_mode = -1;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
@@ -1197,6 +1199,7 @@ if ($MASTER_1_ENGINE_IS_SPIDER)
DELETE FROM t1;
--error 12518
TRUNCATE t1;
+ SET SESSION spider_read_only_mode = @original_spider_read_only_mode;
}
if (!$MASTER_1_ENGINE_IS_SPIDER)
{
@@ -1210,6 +1213,10 @@ if (!$MASTER_1_ENGINE_IS_SPIDER)
if ($MASTER_1_ENGINE_IS_SPIDER)
{
--connection master_1
+ SET @original_spider_error_read_mode = @@SESSION.spider_error_read_mode;
+ SET @original_spider_error_write_mode = @@SESSION.spider_error_write_mode;
+ SET SESSION spider_error_read_mode = -1;
+ SET SESSION spider_error_write_mode = -1;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
@@ -1227,6 +1234,8 @@ if ($MASTER_1_ENGINE_IS_SPIDER)
INSERT INTO t1 (id) VALUES (1);
DELETE FROM t1;
TRUNCATE t1;
+ SET SESSION spider_error_read_mode = @original_spider_error_read_mode;
+ SET SESSION spider_error_write_mode = @original_spider_error_write_mode;
}
if (!$MASTER_1_ENGINE_IS_SPIDER)
{
diff --git a/storage/spider/mysql-test/spider/t/variable_deprecation.test b/storage/spider/mysql-test/spider/t/variable_deprecation.test
new file mode 100644
index 00000000000..6c59deba5d0
--- /dev/null
+++ b/storage/spider/mysql-test/spider/t/variable_deprecation.test
@@ -0,0 +1,135 @@
+--echo #
+--echo # MDEV-27228 Deprecate Spider plugin variables that result in excessive tweak
+--echo #
+
+--disable_query_log
+--disable_result_log
+--source test_init.inc
+--enable_result_log
+--enable_query_log
+
+--connection master_1
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+
+--echo # MDEV-27923 Deprecate spider_use_handler
+SET spider_use_handler = 3;
+SHOW VARIABLES LIKE "spider_use_handler";
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='uhd "3"';
+eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='use_handler "3"';
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+
+--echo # MDEV-28297 Deprecate spider_internal_offset
+SET spider_internal_offset = 1;
+SHOW VARIABLES LIKE "spider_internal_offset";
+
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='ios "1"';
+eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='internal_offset "1"';
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+
+--echo # MDEV-28005 Deprecate Spider plugin variables regarding UDFs
+SET GLOBAL spider_udf_ds_bulk_insert_rows = 1;
+SHOW VARIABLES LIKE "spider_udf_ds_bulk_insert_rows";
+
+SET spider_udf_ds_table_loop_mode = 1;
+SHOW VARIABLES LIKE "spider_udf_ds_table_loop_mode";
+
+SET spider_udf_ds_use_real_table = 1;
+SHOW VARIABLES LIKE "spider_udf_ds_use_real_table";
+
+SET GLOBAL spider_udf_ct_bulk_insert_interval = 1;
+SHOW VARIABLES LIKE "spider_udf_ct_bulk_insert_interval";
+
+SET GLOBAL spider_udf_ct_bulk_insert_rows = 1;
+SHOW VARIABLES LIKE "spider_udf_ct_bulk_insert_rows";
+
+--echo # MDEV-27981 Deprecate spider_internal_limit
+SET spider_internal_limit = 1;
+SHOW VARIABLES LIKE "spider_internal_limit";
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='ilm "1"';
+eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='internal_limit "1"';
+
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+
+--echo # MDEV-28244 Deprecate spider_xa_register_mode
+SET spider_xa_register_mode = 0;
+SHOW VARIABLES LIKE "spider_xa_register_mode";
+
+--echo # MDEV-28007 Deprecate Spider plugin variables regarding statistics persistence
+SET GLOBAL spider_store_last_sts = 0;
+SHOW VARIABLES LIKE "spider_store_last_sts";
+
+SET GLOBAL spider_store_last_crd = 0;
+SHOW VARIABLES LIKE "spider_store_last_crd";
+
+SET GLOBAL spider_load_sts_at_startup = 0;
+SHOW VARIABLES LIKE "spider_load_sts_at_startup";
+
+SET GLOBAL spider_load_crd_at_startup = 0;
+SHOW VARIABLES LIKE "spider_load_crd_at_startup";
+
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+
+--echo # MDEV-28008 Deprecate spider_crd_mode and spider_sts_mode
+SET spider_crd_mode = 1;
+SHOW VARIABLES LIKE "spider_crd_mode";
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='cmd "3"';
+eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='crd_mode "3"';
+
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+
+SET spider_sts_mode = 1;
+SHOW VARIABLES LIKE "spider_sts_mode";
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='smd "3"';
+eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='sts_mode "3"';
+
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+
+--echo # MDEV-28010 Deprecate spider_crd_type and spider_crd_weight
+SET spider_crd_type = 1;
+SHOW VARIABLES LIKE "spider_crd_type";
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='ctp "1"';
+eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='crd_type "1"';
+
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+
+SET spider_crd_weight = 1;
+SHOW VARIABLES LIKE "spider_crd_weight";
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='cwg "1"';
+eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='crd_weight "1"';
+
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+
+--echo # MDEV-28560 Deprecate spider_buffer_size
+SET spider_buffer_size = 1;
+SHOW VARIABLES LIKE "spider_buffer_size";
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='bfz "1"';
+eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='buffer_size "1"';
+
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+
+--echo # MDEV-27926 Deprecate spider_init_sql_alloc_size
+SET spider_init_sql_alloc_size = 1;
+SHOW VARIABLES LIKE "spider_init_sql_alloc_size";
+eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='isa "1"';
+eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='init_sql_alloc_size "1"';
+
+DROP TABLE tbl_a;
+DROP TABLE tbl_b;
+
+DROP DATABASE auto_test_local;
+
+--disable_query_log
+--disable_result_log
+--source test_deinit.inc
+--enable_result_log
+--enable_query_log
diff --git a/storage/spider/spd_init_query.h b/storage/spider/spd_init_query.h
index 19b04d50b82..0dcbcd50230 100644
--- a/storage/spider/spd_init_query.h
+++ b/storage/spider/spd_init_query.h
@@ -224,12 +224,7 @@ static LEX_STRING spider_init_queries[] = {
{C_STRING_WITH_LEN(
"create procedure mysql.spider_fix_system_tables()"
"begin"
- " select substring_index(substring_index(version(), '-', 2), '-', -1)"
- " into @server_name;"
- " if @server_name regexp '^[0-9]+$' then"
- " select substring_index(substring_index(version(), '-', 3), '-', -1)"
- " into @server_name;"
- " end if;"
+ " select 'MariaDB' into @server_name;"
" select substring_index(version(), '.', 1)"
" into @server_major_version;"
" select substring_index(substring_index(version(), '.', 2), '.', -1)"
@@ -548,7 +543,7 @@ static LEX_STRING spider_init_queries[] = {
" @server_major_version > 10 or"
" ("
" @server_major_version = 10 and"
- " @server_minor_version >= 7"
+ " @server_minor_version >= 8"
" )"
" )"
" then"
@@ -808,7 +803,7 @@ static LEX_STRING spider_init_queries[] = {
" @server_major_version > 10 or"
" ("
" @server_major_version = 10 and"
- " @server_minor_version >= 7"
+ " @server_minor_version >= 8"
" )"
" )"
" then"
diff --git a/storage/spider/spd_param.cc b/storage/spider/spd_param.cc
index b23877ca92a..80db478f2d3 100644
--- a/storage/spider/spd_param.cc
+++ b/storage/spider/spd_param.cc
@@ -174,6 +174,20 @@ static MYSQL_SYSVAR_BOOL(
TRUE
);
+static void spider_use_table_value_deprecated(THD *thd, st_mysql_sys_var *,
+ void *var_ptr, const void *save)
+{
+ int val= *static_cast<const int *>(save);
+ *static_cast<int *>(var_ptr)= val;
+ if (val == -1)
+ {
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
+ HA_ERR_UNSUPPORTED,
+ "The option value -1 (use table value) is deprecated "
+ "and will be removed in a future release");
+ }
+}
+
my_bool spider_param_support_xa()
{
DBUG_ENTER("spider_param_support_xa");
@@ -255,8 +269,8 @@ static MYSQL_SYSVAR_INT(
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Use table charset for remote access",
NULL,
- NULL,
- -1,
+ spider_use_table_value_deprecated,
+ 1,
-1,
1,
0
@@ -432,7 +446,7 @@ uint spider_param_force_commit(
*/
static MYSQL_THDVAR_UINT(
xa_register_mode, /* name */
- PLUGIN_VAR_RQCMDARG, /* opt */
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Mode of XA transaction register into system table", /* comment */
NULL, /* check */
NULL, /* update */
@@ -455,11 +469,11 @@ uint spider_param_xa_register_mode(
*/
static MYSQL_THDVAR_LONGLONG(
internal_offset, /* name */
- PLUGIN_VAR_RQCMDARG, /* opt */
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Internal offset", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
9223372036854775807LL, /* max */
0 /* blk */
@@ -480,11 +494,11 @@ longlong spider_param_internal_offset(
*/
static MYSQL_THDVAR_LONGLONG(
internal_limit, /* name */
- PLUGIN_VAR_RQCMDARG, /* opt */
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Internal limit", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 9223372036854775807LL, /* def */
-1, /* min */
9223372036854775807LL, /* max */
0 /* blk */
@@ -508,8 +522,8 @@ static MYSQL_THDVAR_LONGLONG(
PLUGIN_VAR_RQCMDARG, /* opt */
"Number of rows at a select", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 9223372036854775807LL, /* def */
-1, /* min */
9223372036854775807LL, /* max */
0 /* blk */
@@ -534,8 +548,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Use offset and limit parameter in SQL for split_read parameter.", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 2, /* def */
-1, /* min */
2147483647, /* max */
0 /* blk */
@@ -559,8 +573,8 @@ static MYSQL_THDVAR_LONGLONG(
PLUGIN_VAR_RQCMDARG, /* opt */
"The limit value for semi_split_read", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 9223372036854775807LL, /* def */
-1, /* min */
9223372036854775807LL, /* max */
0 /* blk */
@@ -582,11 +596,11 @@ longlong spider_param_semi_split_read_limit(
*/
static MYSQL_THDVAR_INT(
init_sql_alloc_size, /* name */
- PLUGIN_VAR_RQCMDARG, /* opt */
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Initial sql string alloc size", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 1024, /* def */
-1, /* min */
2147483647, /* max */
0 /* blk */
@@ -611,8 +625,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Reset sql string alloc after execute", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 1, /* def */
-1, /* min */
1, /* max */
0 /* blk */
@@ -664,8 +678,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Sprit read mode for multi range", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 100, /* def */
-1, /* min */
2147483647, /* max */
0 /* blk */
@@ -689,8 +703,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Max columns for order by", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 32767, /* def */
-1, /* min */
32767, /* max */
0 /* blk */
@@ -845,8 +859,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Use different connection if semi_table_lock is enabled", /* comment */
&spider_param_semi_table_lock_connection_check, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 1, /* def */
-1, /* min */
1, /* max */
0 /* blk */
@@ -894,8 +908,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Lock for select with update", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 1, /* def */
-1, /* min */
2, /* max */
0 /* blk */
@@ -983,8 +997,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Bulk insert size", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 16000, /* def */
-1, /* min */
2147483647, /* max */
0 /* blk */
@@ -1012,8 +1026,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"The mode of bulk updating and deleting", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
2, /* max */
0 /* blk */
@@ -1037,8 +1051,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Bulk update size", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 16000, /* def */
-1, /* min */
2147483647, /* max */
0 /* blk */
@@ -1059,11 +1073,11 @@ int spider_param_bulk_update_size(
*/
static MYSQL_THDVAR_INT(
buffer_size, /* name */
- PLUGIN_VAR_RQCMDARG, /* opt */
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Buffer size", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 16000, /* def */
-1, /* min */
2147483647, /* max */
0 /* blk */
@@ -1088,8 +1102,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Execute optimize to remote server", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
1, /* max */
0 /* blk */
@@ -1114,8 +1128,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Execute optimize to remote server with local", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
1, /* max */
0 /* blk */
@@ -1263,8 +1277,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Wait timeout of connecting to remote server", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 6, /* def */
-1, /* min */
2147483647, /* max */
0 /* blk */
@@ -1290,8 +1304,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Wait timeout of receiving data from remote server", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 600, /* def */
-1, /* min */
2147483647, /* max */
0 /* blk */
@@ -1317,8 +1331,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Wait timeout of sending data to remote server", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 600, /* def */
-1, /* min */
2147483647, /* max */
0 /* blk */
@@ -1348,8 +1362,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"The retrieval result from a remote server is acquired by acquisition one by one", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 3, /* def */
-1, /* min */
3, /* max */
0 /* blk */
@@ -1373,8 +1387,8 @@ static MYSQL_THDVAR_LONGLONG(
PLUGIN_VAR_RQCMDARG, /* opt */
"Number of records in a page when acquisition one by one", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 1024, /* def */
-1, /* min */
9223372036854775807LL, /* max */
0 /* blk */
@@ -1398,8 +1412,8 @@ static MYSQL_THDVAR_LONGLONG(
PLUGIN_VAR_RQCMDARG, /* opt */
"The limitation of memory size in a page when acquisition one by one", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 10485760, /* def */
-1, /* min */
9223372036854775807LL, /* max */
0 /* blk */
@@ -1424,8 +1438,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Use low memory mode when SQL(SELECT) internally issued to a remote server is executed and get a result list", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 1, /* def */
-1, /* min */
1, /* max */
0 /* blk */
@@ -1451,8 +1465,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"The mode of using columns at select clause", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 1, /* def */
-1, /* min */
1, /* max */
0 /* blk */
@@ -1480,8 +1494,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Mode of background search", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
3, /* max */
0 /* blk */
@@ -1506,8 +1520,8 @@ static MYSQL_THDVAR_LONGLONG(
PLUGIN_VAR_RQCMDARG, /* opt */
"Number of first read records when background search is used", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 2, /* def */
-1, /* min */
9223372036854775807LL, /* max */
0 /* blk */
@@ -1532,8 +1546,8 @@ static MYSQL_THDVAR_LONGLONG(
PLUGIN_VAR_RQCMDARG, /* opt */
"Number of second read records when background search is used", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 100, /* def */
-1, /* min */
9223372036854775807LL, /* max */
0 /* blk */
@@ -1559,8 +1573,8 @@ static MYSQL_THDVAR_LONGLONG(
PLUGIN_VAR_RQCMDARG, /* opt */
"Number of first read records", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
9223372036854775807LL, /* max */
0 /* blk */
@@ -1585,8 +1599,8 @@ static MYSQL_THDVAR_LONGLONG(
PLUGIN_VAR_RQCMDARG, /* opt */
"Number of second read records", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
9223372036854775807LL, /* max */
0 /* blk */
@@ -1611,8 +1625,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Interval of cardinality confirmation.(second)", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 51, /* def */
-1, /* min */
2147483647, /* max */
0 /* blk */
@@ -1636,11 +1650,11 @@ double spider_param_crd_interval(
*/
static MYSQL_THDVAR_INT(
crd_mode, /* name */
- PLUGIN_VAR_RQCMDARG, /* opt */
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Mode of cardinality confirmation.", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 1, /* def */
-1, /* min */
3, /* max */
0 /* blk */
@@ -1668,8 +1682,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Cardinality synchronization in partitioned table.", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
2, /* max */
0 /* blk */
@@ -1693,11 +1707,11 @@ int spider_param_crd_sync(
*/
static MYSQL_THDVAR_INT(
crd_type, /* name */
- PLUGIN_VAR_RQCMDARG, /* opt */
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Type of cardinality calculation.", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 2, /* def */
-1, /* min */
2, /* max */
0 /* blk */
@@ -1718,11 +1732,11 @@ int spider_param_crd_type(
*/
static MYSQL_THDVAR_INT(
crd_weight, /* name */
- PLUGIN_VAR_RQCMDARG, /* opt */
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Weight coefficient to calculate effectiveness of index from cardinality of column.", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 2, /* def */
-1, /* min */
2147483647, /* max */
0 /* blk */
@@ -1749,8 +1763,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Mode of cardinality confirmation at background.", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 2, /* def */
-1, /* min */
2, /* max */
0 /* blk */
@@ -1776,8 +1790,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Interval of table state confirmation.(second)", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 10, /* def */
-1, /* min */
2147483647, /* max */
0 /* blk */
@@ -1800,11 +1814,11 @@ double spider_param_sts_interval(
*/
static MYSQL_THDVAR_INT(
sts_mode, /* name */
- PLUGIN_VAR_RQCMDARG, /* opt */
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Mode of table state confirmation.", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 1, /* def */
-1, /* min */
2, /* max */
0 /* blk */
@@ -1832,8 +1846,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Table state synchronization in partitioned table.", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
2, /* max */
0 /* blk */
@@ -1861,8 +1875,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Mode of table state confirmation at background.", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 2, /* def */
-1, /* min */
2, /* max */
0 /* blk */
@@ -1937,8 +1951,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Mode of auto increment.", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
3, /* max */
0 /* blk */
@@ -2030,8 +2044,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Execute \"REPLACE\" and \"INSERT IGNORE\" on remote server and avoid duplicate check on local server", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
1, /* max */
0 /* blk */
@@ -2097,7 +2111,7 @@ uint spider_param_udf_table_mon_mutex_count()
*/
static MYSQL_THDVAR_LONGLONG(
udf_ds_bulk_insert_rows, /* name */
- PLUGIN_VAR_RQCMDARG, /* opt */
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Number of rows for bulk inserting", /* comment */
NULL, /* check */
NULL, /* update */
@@ -2124,7 +2138,7 @@ longlong spider_param_udf_ds_bulk_insert_rows(
*/
static MYSQL_THDVAR_INT(
udf_ds_table_loop_mode, /* name */
- PLUGIN_VAR_RQCMDARG, /* opt */
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Table loop mode if the number of tables in table list are less than the number of result sets", /* comment */
NULL, /* check */
NULL, /* update */
@@ -2457,8 +2471,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Mode of BKA for Spider", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 1, /* def */
-1, /* min */
2, /* max */
0 /* blk */
@@ -2481,7 +2495,7 @@ static int spider_udf_ct_bulk_insert_interval;
static MYSQL_SYSVAR_INT(
udf_ct_bulk_insert_interval,
spider_udf_ct_bulk_insert_interval,
- PLUGIN_VAR_RQCMDARG,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED,
"The interval time between bulk insert and next bulk insert at coping",
NULL,
NULL,
@@ -2507,7 +2521,7 @@ static longlong spider_udf_ct_bulk_insert_rows;
static MYSQL_SYSVAR_LONGLONG(
udf_ct_bulk_insert_rows,
spider_udf_ct_bulk_insert_rows,
- PLUGIN_VAR_RQCMDARG,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED,
"The number of rows inserted with bulk insert of one time at coping",
NULL,
NULL,
@@ -2680,11 +2694,11 @@ int spider_param_use_hs_write(
*/
static MYSQL_THDVAR_INT(
use_handler, /* name */
- PLUGIN_VAR_RQCMDARG, /* opt */
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Use handler for reading", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
3, /* max */
0 /* blk */
@@ -2709,8 +2723,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Read error mode if error", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
1, /* max */
0 /* blk */
@@ -2735,8 +2749,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Write error mode if error", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
1, /* max */
0 /* blk */
@@ -2761,8 +2775,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Skip generating internal default condition", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
1, /* max */
0 /* blk */
@@ -2789,8 +2803,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Skip parallel search by specific conditions", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
3, /* max */
0 /* blk */
@@ -2815,8 +2829,8 @@ static MYSQL_THDVAR_LONGLONG(
PLUGIN_VAR_RQCMDARG, /* opt */
"Send 'ORDER BY' and 'LIMIT' to remote server directly", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 9223372036854775807LL, /* def */
-1, /* min */
9223372036854775807LL, /* max */
0 /* blk */
@@ -2841,8 +2855,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Read only", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
1, /* max */
0 /* blk */
@@ -2895,7 +2909,7 @@ int spider_param_bulk_access_free(
*/
static MYSQL_THDVAR_INT(
udf_ds_use_real_table, /* name */
- PLUGIN_VAR_RQCMDARG, /* opt */
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Use real table for temporary table list", /* comment */
NULL, /* check */
NULL, /* update */
@@ -3090,8 +3104,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Read casually if it is possible", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
63, /* max */
0 /* blk */
@@ -3133,8 +3147,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"The type of delete_all_rows", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 1, /* def */
-1, /* min */
1, /* max */
0 /* blk */
@@ -3159,8 +3173,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"The type of temporary table name for bka", /* comment */
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 0, /* def */
-1, /* min */
1, /* max */
0 /* blk */
@@ -3208,11 +3222,11 @@ static int spider_store_last_sts;
static MYSQL_SYSVAR_INT(
store_last_sts,
spider_store_last_sts,
- PLUGIN_VAR_RQCMDARG,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED,
"Store last sts result into system table",
NULL,
- NULL,
- -1,
+ spider_use_table_value_deprecated,
+ 1,
-1,
1,
0
@@ -3235,11 +3249,11 @@ static int spider_store_last_crd;
static MYSQL_SYSVAR_INT(
store_last_crd,
spider_store_last_crd,
- PLUGIN_VAR_RQCMDARG,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED,
"Store last crd result into system table",
NULL,
- NULL,
- -1,
+ spider_use_table_value_deprecated,
+ 1,
-1,
1,
0
@@ -3262,11 +3276,11 @@ static int spider_load_sts_at_startup;
static MYSQL_SYSVAR_INT(
load_sts_at_startup,
spider_load_sts_at_startup,
- PLUGIN_VAR_RQCMDARG,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED,
"Load sts from system table at startup",
NULL,
- NULL,
- -1,
+ spider_use_table_value_deprecated,
+ 1,
-1,
1,
0
@@ -3289,11 +3303,11 @@ static int spider_load_crd_at_startup;
static MYSQL_SYSVAR_INT(
load_crd_at_startup,
spider_load_crd_at_startup,
- PLUGIN_VAR_RQCMDARG,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED,
"Load crd from system table at startup",
NULL,
- NULL,
- -1,
+ spider_use_table_value_deprecated,
+ 1,
-1,
1,
0
@@ -3462,8 +3476,8 @@ static MYSQL_THDVAR_INT(
PLUGIN_VAR_RQCMDARG, /* opt */
"Use columns in select clause strictly for group by clause",
NULL, /* check */
- NULL, /* update */
- -1, /* def */
+ spider_use_table_value_deprecated, /* update */
+ 1, /* def */
-1, /* min */
1, /* max */
0 /* blk */
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index 21a77a8a565..8a0c264bb12 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -2060,6 +2060,16 @@ int st_spider_param_string_parse::print_param_error()
} \
break; \
}
+#define SPIDER_PARAM_DEPRECATED_WARNING(title_name) \
+ if (!strncasecmp(tmp_ptr, title_name, title_length) && create_table) \
+ { \
+ THD *thd= current_thd; \
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, \
+ ER_WARN_DEPRECATED_SYNTAX, \
+ "The table parameter '%s' is deprecated and will be " \
+ "removed in a future release", \
+ title_name); \
+ }
int spider_parse_connect_info(
SPIDER_SHARE *share,
@@ -2309,6 +2319,7 @@ int spider_parse_connect_info(
#ifdef HA_CAN_BULK_ACCESS
SPIDER_PARAM_INT_WITH_MAX("baf", bulk_access_free, 0, 1);
#endif
+ SPIDER_PARAM_DEPRECATED_WARNING("bfz");
SPIDER_PARAM_INT("bfz", buffer_size, 0);
#ifndef WITHOUT_SPIDER_BG_SEARCH
SPIDER_PARAM_LONGLONG("bfr", bgs_first_read, 0);
@@ -2326,6 +2337,7 @@ int spider_parse_connect_info(
SPIDER_PARAM_INT_WITH_MAX("cbm", crd_bg_mode, 0, 2);
#endif
SPIDER_PARAM_DOUBLE("civ", crd_interval, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("cmd");
SPIDER_PARAM_INT_WITH_MAX("cmd", crd_mode, 0, 3);
SPIDER_PARAM_INT_WITH_MAX("csr", casual_read, 0, 63);
#ifdef WITH_PARTITION_STORAGE_ENGINE
@@ -2333,7 +2345,9 @@ int spider_parse_connect_info(
#endif
SPIDER_PARAM_LONG_LIST_WITH_MAX("cto", connect_timeouts, 0,
2147483647);
+ SPIDER_PARAM_DEPRECATED_WARNING("ctp");
SPIDER_PARAM_INT_WITH_MAX("ctp", crd_type, 0, 2);
+ SPIDER_PARAM_DEPRECATED_WARNING("cwg");
SPIDER_PARAM_DOUBLE("cwg", crd_weight, 1);
SPIDER_PARAM_INT_WITH_MAX("dat", delete_all_rows_type, 0, 1);
SPIDER_PARAM_INT_WITH_MAX("ddi", direct_dup_insert, 0, 1);
@@ -2363,9 +2377,12 @@ int spider_parse_connect_info(
"hwr", hs_write_to_reads, 0, 1);
SPIDER_PARAM_STR_LIST("hws", hs_write_socks);
#endif
+ SPIDER_PARAM_DEPRECATED_WARNING("isa");
SPIDER_PARAM_INT("isa", init_sql_alloc_size, 0);
SPIDER_PARAM_INT_WITH_MAX("idl", internal_delayed, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("ilm");
SPIDER_PARAM_LONGLONG("ilm", internal_limit, 0);
+ SPIDER_PARAM_DEPRECATED_WARNING("ios");
SPIDER_PARAM_LONGLONG("ios", internal_offset, 0);
SPIDER_PARAM_INT_WITH_MAX("iom", internal_optimize, 0, 1);
SPIDER_PARAM_INT_WITH_MAX("iol", internal_optimize_local, 0, 1);
@@ -2418,6 +2435,7 @@ int spider_parse_connect_info(
SPIDER_PARAM_INT_WITH_MAX("slc", store_last_crd, 0, 1);
SPIDER_PARAM_INT_WITH_MAX("slm", selupd_lock_mode, 0, 2);
SPIDER_PARAM_INT_WITH_MAX("sls", store_last_sts, 0, 1);
+ SPIDER_PARAM_DEPRECATED_WARNING("smd");
SPIDER_PARAM_INT_WITH_MAX("smd", sts_mode, 1, 2);
SPIDER_PARAM_LONGLONG("smr", static_mean_rec_length, 0);
SPIDER_PARAM_LONGLONG("spr", split_read, 0);
@@ -2437,6 +2455,7 @@ int spider_parse_connect_info(
SPIDER_PARAM_LONG_LIST_WITH_MAX("svc", tgt_ssl_vscs, 0, 1);
SPIDER_PARAM_STR_LIST("tbl", tgt_table_names);
SPIDER_PARAM_INT_WITH_MAX("tcm", table_count_mode, 0, 3);
+ SPIDER_PARAM_DEPRECATED_WARNING("uhd");
SPIDER_PARAM_LONG_LIST_WITH_MAX("uhd", use_handlers, 0, 3);
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
SPIDER_PARAM_LONG_LIST_WITH_MAX(
@@ -2479,14 +2498,17 @@ int spider_parse_connect_info(
case 8:
SPIDER_PARAM_STR_LIST("database", tgt_dbs);
SPIDER_PARAM_STR_LIST("password", tgt_passwords);
+ SPIDER_PARAM_DEPRECATED_WARNING("sts_mode");
SPIDER_PARAM_INT_WITH_MAX("sts_mode", sts_mode, 1, 2);
#ifdef WITH_PARTITION_STORAGE_ENGINE
SPIDER_PARAM_INT_WITH_MAX("sts_sync", sts_sync, 0, 2);
#endif
+ SPIDER_PARAM_DEPRECATED_WARNING("crd_mode");
SPIDER_PARAM_INT_WITH_MAX("crd_mode", crd_mode, 0, 3);
#ifdef WITH_PARTITION_STORAGE_ENGINE
SPIDER_PARAM_INT_WITH_MAX("crd_sync", crd_sync, 0, 2);
#endif
+ SPIDER_PARAM_DEPRECATED_WARNING("crd_type");
SPIDER_PARAM_INT_WITH_MAX("crd_type", crd_type, 0, 2);
SPIDER_PARAM_LONGLONG("priority", priority, 0);
#ifndef WITHOUT_SPIDER_BG_SEARCH
@@ -2504,6 +2526,7 @@ int spider_parse_connect_info(
error_num = connect_string_parse.print_param_error();
goto error;
case 10:
+ SPIDER_PARAM_DEPRECATED_WARNING("crd_weight");
SPIDER_PARAM_DOUBLE("crd_weight", crd_weight, 1);
SPIDER_PARAM_LONGLONG("split_read", split_read, 0);
SPIDER_PARAM_INT_WITH_MAX("quick_mode", quick_mode, 0, 3);
@@ -2520,11 +2543,13 @@ int spider_parse_connect_info(
SPIDER_PARAM_INT_WITH_MAX("sts_bg_mode", sts_bg_mode, 0, 2);
#endif
SPIDER_PARAM_LONG_LIST_WITH_MAX("link_status", link_statuses, 0, 3);
+ SPIDER_PARAM_DEPRECATED_WARNING("use_handler");
SPIDER_PARAM_LONG_LIST_WITH_MAX("use_handler", use_handlers, 0, 3);
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
SPIDER_PARAM_LONG_LIST_WITH_MAX("use_hs_read", use_hs_reads, 0, 1);
#endif
SPIDER_PARAM_INT_WITH_MAX("casual_read", casual_read, 0, 63);
+ SPIDER_PARAM_DEPRECATED_WARNING("buffer_size");
SPIDER_PARAM_INT("buffer_size", buffer_size, 0);
error_num = connect_string_parse.print_param_error();
goto error;
@@ -2551,6 +2576,7 @@ int spider_parse_connect_info(
error_num = connect_string_parse.print_param_error();
goto error;
case 14:
+ SPIDER_PARAM_DEPRECATED_WARNING("internal_limit");
SPIDER_PARAM_LONGLONG("internal_limit", internal_limit, 0);
#ifndef WITHOUT_SPIDER_BG_SEARCH
SPIDER_PARAM_LONGLONG("bgs_first_read", bgs_first_read, 0);
@@ -2568,6 +2594,7 @@ int spider_parse_connect_info(
error_num = connect_string_parse.print_param_error();
goto error;
case 15:
+ SPIDER_PARAM_DEPRECATED_WARNING("internal_offset");
SPIDER_PARAM_LONGLONG("internal_offset", internal_offset, 0);
SPIDER_PARAM_INT_WITH_MAX("reset_sql_alloc", reset_sql_alloc, 0, 1);
SPIDER_PARAM_INT_WITH_MAX("semi_table_lock", semi_table_lock, 0, 1);
@@ -2656,6 +2683,7 @@ int spider_parse_connect_info(
error_num = connect_string_parse.print_param_error();
goto error;
case 19:
+ SPIDER_PARAM_DEPRECATED_WARNING("init_sql_alloc_size");
SPIDER_PARAM_INT("init_sql_alloc_size", init_sql_alloc_size, 0);
SPIDER_PARAM_INT_WITH_MAX(
"auto_increment_mode", auto_increment_mode, 0, 3);
diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt
index 0e62f9e34ad..54612256adc 100644
--- a/strings/CMakeLists.txt
+++ b/strings/CMakeLists.txt
@@ -23,7 +23,7 @@ SET(STRINGS_SOURCES bchange.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c
str2int.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c
strxmov.c strxnmov.c xml.c
strmov_overlapp.c
- my_strchr.c strcont.c strappend.c json_lib.c)
+ my_strchr.c strcont.c strappend.c json_lib.c json_normalize.c)
IF(NOT HAVE_STRNLEN)
# OSX below 10.7 did not have strnlen
diff --git a/strings/ctype-ascii.h b/strings/ctype-ascii.h
new file mode 100644
index 00000000000..540d01b1a0d
--- /dev/null
+++ b/strings/ctype-ascii.h
@@ -0,0 +1,189 @@
+#ifndef CTYPE_ASCII_INCLUDED
+#define CTYPE_ASCII_INCLUDED
+
+#include "myisampack.h"
+
+/*
+ Magic expression. It uses the fact that for any byte value X in
+ the range 0..31 (0x00..0x1F) the expression (X+31)*5 returns
+ the 7th bit (0x80) set only for the following six (out of 32) values:
+ 0x00, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F.
+ These values correspond to offsets of non-letter characters
+ in the ASCII table:
+
+ The following macro sets the bit 0x20 for the following characters:
+ ---------------- --------------------------------
+ Magic bit 10000000000000000000000000011111
+ ASCII 0x00..0x1F ................................ Control
+ ASCII 0x20..0x3F ................................ Punctuation, digits
+ ASCII 0x40..0x5F @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
+ ASCII 0x60..0x7F `abcdefghijklmnopqrstuvwxyz{|}~.
+ ---------------- --------------------------------
+ We shift the magic bit 0x80 right twice to make it 0x20.
+ So on the ranges [40..5F] and [60..7F] the expression
+ has the bit 0x20 set for all non-letter characters.
+ Note, other bits contain garbage.
+
+ Requirements:
+ All bytes must be in the range [00..7F],
+ to avoid overflow and carry to the next byte.
+*/
+#define MY_ASCII_20_IS_SET_IF_NOT_LETTER_MAGIC(i) \
+ (((((i)+0x1F1F1F1F1F1F1F1FULL) & 0x1F1F1F1F1F1F1F1F) * 5) >> 2)
+
+
+/*
+ The following macro returns the bit 0x20 set to:
+ - 1 for input bytes in the ranges [60..7F] or [E0..FF]
+ - 0 otherwise
+ Bytes in the ranges [40..7F] and [C0..FF] have the bit 0x40 set.
+ Bytes in the ranges [60..7F] and [E0..FF] have the bit 0x20 set.
+ Hex BinHi BinLo
+ ---- -1-- ----
+ 0x[4C]X .10. ....
+ 0x[5D]X .10. ....
+ 0x[6E]X .11. ....
+ 0x[7F]X .11. ....
+*/
+#define MY_ASCII_20_IS_SET_IF_RANGE_60_7F_OR_E0_FF(i) (((i) >> 1) & ((i)))
+
+
+/*
+ The following macro evaluates to exactly 0x20 for all
+ lower case ASCII letters [a-z], and to 0x00 otherwise:
+
+ Value Range Character range Subrange
+ -------- -------- -------------------------------- -------
+ 00000000 0x00..0x3F Control, punctuation, digits
+ 00100000 0x40..0x5F @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ letters A-Z
+ 00000000 0x40..0x5F @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ non-letters
+ 00100000 0x60..0x7F `abcdefghijklmnopqrstuvwxyz{|}~. letters a-z
+ 00000000 0x60..0x7F `abcdefghijklmnopqrstuvwxyz{|}~. non-letters
+
+ Requirements:
+ All bytes must be in the range [00..7F].
+ See the comments in MY_ASCII_20_IS_SET_IF_NOT_LETTER_MAGIC().
+*/
+
+#define MY_ASCII_20_IF_IS_LOWER_LETTER(i) \
+ (MY_ASCII_20_IS_SET_IF_RANGE_60_7F_OR_E0_FF(i) & \
+ ~MY_ASCII_20_IS_SET_IF_NOT_LETTER_MAGIC(i) & \
+ 0x2020202020202020)
+
+/*
+ Convert lower case ASCII letters to upper case by unsetting
+ the bit 0x20 with help of the magic expression.
+
+ Requirements:
+ All bytes must be in the range [00..7F].
+ See the comments in MY_ASCII_20_IS_SET_IF_NOT_LETTER_MAGIC()
+*/
+#define MY_ASCII_TOUPPER_MAGIC(i) \
+ (i ^ MY_ASCII_20_IF_IS_LOWER_LETTER(i))
+
+
+/*
+ Convert a string (consisting of 8 bytes stored in uint64)
+ to upper case algorithmically.
+
+ Requirements:
+ All bytes must be in the range [00..0x7F].
+ See the comments in MY_ASCII_20_IS_SET_IF_NOT_LETTER_MAGIC().
+ The result on 8bit data is unpredictable!!!
+ The caller should make sure not to pass 8bit data.
+*/
+static inline ulonglong my_ascii_to_upper_magic_uint64(ulonglong i)
+{
+ return MY_ASCII_TOUPPER_MAGIC(i);
+}
+
+
+/*
+ Check if:
+ - both strings "a" and "b" have at least 4 bytes, and
+ - both strings have only 7bit data.
+*/
+static inline int
+my_strcoll_ascii_4bytes_found(const uchar *a, const uchar *ae,
+ const uchar *b, const uchar *be)
+{
+ return a + 4 <= ae && b + 4 <= be &&
+ (uint4korr(b) & 0x80808080) == 0 &&
+ (uint4korr(a) & 0x80808080) == 0;
+}
+
+
+/*
+ Compare the leading four 7bit ASCII bytes in two strings case insensitively
+ by converting letters [a-z] to upper case [A-Z].
+
+ Requirements:
+ - The input strings must have at least four bytes, and
+ - The leading four bytes in both strings must be 7bit ASCII.
+ The caller must make sure to provide only strings that meet
+ these requirements. The result on 8-bit data is unpredictable
+ as 8-bit bytes may cause overflow in my_ascii_to_upper_magic_uint64().
+ See comments above.
+*/
+static inline int
+my_strcoll_ascii_toupper_4bytes(const uchar *a, const uchar *b)
+{
+ ulonglong abn= (((ulonglong) mi_uint4korr(a)) << 32) | mi_uint4korr(b);
+ abn= my_ascii_to_upper_magic_uint64(abn);
+ if ((uint32) (abn >> 32) == (uint32) abn)
+ return 0;
+ return ((uint32) (abn >> 32)) < ((uint32) abn) ? -1 : + 1;
+}
+
+
+/*
+ Compare the leading eight 7bit ASCII bytes in two strings case insensitively
+ by converting letters [a-z] to upper case [A-Z].
+
+ Requirements:
+ - The input strings must have at least eight bytes, and
+ - The leading eight bytes in both strings must be 7bit ASCII.
+ See comments in my_strcoll_ascii_toupper_4bytes().
+*/
+static inline int
+my_strcoll_ascii_toupper_8bytes(const uchar *a, const uchar *b)
+{
+ /*
+ TODO:
+ Try to get advantage of SIMD instructions by massive comparison
+ (16 bytes at a time) of characters against (x>='a' && x<='z') using:
+ - either explicit intrinsics
+ - or a loop that can get vectorized automatically by some compilers.
+ */
+ ulonglong an= mi_uint8korr(a);
+ ulonglong bn= mi_uint8korr(b);
+ an= my_ascii_to_upper_magic_uint64(an);
+ bn= my_ascii_to_upper_magic_uint64(bn);
+ return an == bn ? 0 : an < bn ? -1 : +1;
+}
+
+
+/*
+ Compare the leading four 7bit ASCII bytes in two strings in binary style.
+*/
+static inline int
+my_strcoll_mb7_bin_4bytes(const uchar *a, const uchar *b)
+{
+ uint32 an= mi_uint4korr(a);
+ uint32 bn= mi_uint4korr(b);
+ return an == bn ? 0 : an < bn ? -1 : +1;
+}
+
+
+/*
+ Compare the leading four 7bit ASCII bytes in two strings in binary style.
+*/
+static inline int
+my_strcoll_mb7_bin_8bytes(const uchar *a, const uchar *b)
+{
+ ulonglong an= mi_uint8korr(a);
+ ulonglong bn= mi_uint8korr(b);
+ return an == bn ? 0 : an < bn ? -1 : +1;
+}
+
+#endif /* CTYPE_ASCII_INCLUDED */
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index d66a2bf8593..2491a5ff7ed 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -6691,6 +6691,7 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)),
#define MY_FUNCTION_NAME(x) my_ ## x ## _big5_bin
#define WEIGHT_MB1(x) ((uchar) (x))
#define WEIGHT_MB2(x,y) (big5code(x, y))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
@@ -6707,6 +6708,7 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)),
#define MY_FUNCTION_NAME(x) my_ ## x ## _big5_nopad_bin
#define WEIGHT_MB1(x) ((uchar) (x))
#define WEIGHT_MB2(x,y) (big5code(x, y))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c
index 9971750ca1c..af3de05509d 100644
--- a/strings/ctype-cp932.c
+++ b/strings/ctype-cp932.c
@@ -34639,6 +34639,7 @@ size_t my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)),
#define WEIGHT_PAD_SPACE (256 * (int) ' ')
#define WEIGHT_MB1(x) (256 * (int) sort_order_cp932[(uchar) (x)])
#define WEIGHT_MB2(x,y) (cp932code(x, y))
+#define STRCOLL_MB7_TOUPPER
#include "strcoll.inl"
@@ -34646,6 +34647,7 @@ size_t my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)),
#define WEIGHT_PAD_SPACE (256 * (int) ' ')
#define WEIGHT_MB1(x) (256 * (int) (uchar) (x))
#define WEIGHT_MB2(x,y) (cp932code(x, y))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
@@ -34654,6 +34656,7 @@ size_t my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)),
#define WEIGHT_PAD_SPACE (256 * (int) ' ')
#define WEIGHT_MB1(x) (256 * (int) sort_order_cp932[(uchar) (x)])
#define WEIGHT_MB2(x,y) (cp932code(x, y))
+#define STRCOLL_MB7_TOUPPER
#include "strcoll.inl"
@@ -34662,6 +34665,7 @@ size_t my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)),
#define WEIGHT_PAD_SPACE (256 * (int) ' ')
#define WEIGHT_MB1(x) (256 * (int) (uchar) (x))
#define WEIGHT_MB2(x,y) (cp932code(x, y))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c
index 4d159b29494..1f62ebaf636 100644
--- a/strings/ctype-euc_kr.c
+++ b/strings/ctype-euc_kr.c
@@ -9932,12 +9932,14 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
#define MY_FUNCTION_NAME(x) my_ ## x ## _euckr_korean_ci
#define WEIGHT_MB1(x) (sort_order_euc_kr[(uchar) (x)])
#define WEIGHT_MB2(x,y) (euckrcode(x, y))
+#define STRCOLL_MB7_TOUPPER
#include "strcoll.inl"
#define MY_FUNCTION_NAME(x) my_ ## x ## _euckr_bin
#define WEIGHT_MB1(x) ((uchar) (x))
#define WEIGHT_MB2(x,y) (euckrcode(x, y))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
@@ -9945,6 +9947,7 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
#define MY_FUNCTION_NAME(x) my_ ## x ## _euckr_korean_nopad_ci
#define WEIGHT_MB1(x) (sort_order_euc_kr[(uchar) (x)])
#define WEIGHT_MB2(x,y) (euckrcode(x, y))
+#define STRCOLL_MB7_TOUPPER
#include "strcoll.inl"
@@ -9952,6 +9955,7 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
#define MY_FUNCTION_NAME(x) my_ ## x ## _euckr_nopad_bin
#define WEIGHT_MB1(x) ((uchar) (x))
#define WEIGHT_MB2(x,y) (euckrcode(x, y))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c
index 72b18b5ec76..ed48917e333 100644
--- a/strings/ctype-eucjpms.c
+++ b/strings/ctype-eucjpms.c
@@ -212,6 +212,7 @@ static const uchar sort_order_eucjpms[]=
#define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \
(((uint) (uchar) (y)) << 8))
#define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z))
+#define STRCOLL_MB7_TOUPPER
#include "strcoll.inl"
@@ -221,6 +222,7 @@ static const uchar sort_order_eucjpms[]=
#define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \
(((uint) (uchar) (y)) << 8))
#define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
@@ -231,6 +233,7 @@ static const uchar sort_order_eucjpms[]=
#define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \
(((uint) (uchar) (y)) << 8))
#define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z))
+#define STRCOLL_MB7_TOUPPER
#include "strcoll.inl"
@@ -241,6 +244,7 @@ static const uchar sort_order_eucjpms[]=
#define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \
(((uint) (uchar) (y)) << 8))
#define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c
index 7b6b0b080f0..dd3581366fe 100644
--- a/strings/ctype-gb2312.c
+++ b/strings/ctype-gb2312.c
@@ -6344,6 +6344,7 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)),
#define MY_FUNCTION_NAME(x) my_ ## x ## _gb2312_bin
#define WEIGHT_MB1(x) ((uchar) (x))
#define WEIGHT_MB2(x,y) (gb2312code(x, y))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
@@ -6358,6 +6359,7 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)),
#define MY_FUNCTION_NAME(x) my_ ## x ## _gb2312_nopad_bin
#define WEIGHT_MB1(x) ((uchar) (x))
#define WEIGHT_MB2(x,y) (gb2312code(x, y))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index 2501c293fb2..2e72d5bd7a4 100644
--- a/strings/ctype-gbk.c
+++ b/strings/ctype-gbk.c
@@ -10625,6 +10625,7 @@ my_mb_wc_gbk(CHARSET_INFO *cs __attribute__((unused)),
#define MY_FUNCTION_NAME(x) my_ ## x ## _gbk_bin
#define WEIGHT_MB1(x) ((uchar) (x))
#define WEIGHT_MB2(x,y) (gbkcode(x,y))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
@@ -10640,6 +10641,7 @@ my_mb_wc_gbk(CHARSET_INFO *cs __attribute__((unused)),
#define MY_FUNCTION_NAME(x) my_ ## x ## _gbk_nopad_bin
#define WEIGHT_MB1(x) ((uchar) (x))
#define WEIGHT_MB2(x,y) (gbkcode(x,y))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index 313dfaa8f90..c3e64ce0d11 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -34027,6 +34027,7 @@ my_wc_to_printable_sjis(CHARSET_INFO *cs, my_wc_t wc,
#define WEIGHT_PAD_SPACE (256 * (int) ' ')
#define WEIGHT_MB1(x) (256 * (int) sort_order_sjis[(uchar) (x)])
#define WEIGHT_MB2(x,y) (sjiscode(x, y))
+#define STRCOLL_MB7_TOUPPER
#include "strcoll.inl"
@@ -34034,6 +34035,7 @@ my_wc_to_printable_sjis(CHARSET_INFO *cs, my_wc_t wc,
#define WEIGHT_PAD_SPACE (256 * (int) ' ')
#define WEIGHT_MB1(x) (256 * (int) (uchar) (x))
#define WEIGHT_MB2(x,y) (sjiscode(x, y))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
@@ -34042,6 +34044,7 @@ my_wc_to_printable_sjis(CHARSET_INFO *cs, my_wc_t wc,
#define WEIGHT_PAD_SPACE (256 * (int) ' ')
#define WEIGHT_MB1(x) (256 * (int) sort_order_sjis[(uchar) (x)])
#define WEIGHT_MB2(x,y) (sjiscode(x, y))
+#define STRCOLL_MB7_TOUPPER
#include "strcoll.inl"
@@ -34050,6 +34053,7 @@ my_wc_to_printable_sjis(CHARSET_INFO *cs, my_wc_t wc,
#define WEIGHT_PAD_SPACE (256 * (int) ' ')
#define WEIGHT_MB1(x) (256 * (int) (uchar) (x))
#define WEIGHT_MB2(x,y) (sjiscode(x, y))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index fb0ab7be6a6..adcd4825d88 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -211,6 +211,7 @@ static const uchar sort_order_ujis[]=
#define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \
(((uint) (uchar) (y)) << 8))
#define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z))
+#define STRCOLL_MB7_TOUPPER
#include "strcoll.inl"
@@ -220,6 +221,7 @@ static const uchar sort_order_ujis[]=
#define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \
(((uint) (uchar) (y)) << 8))
#define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
@@ -230,6 +232,7 @@ static const uchar sort_order_ujis[]=
#define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \
(((uint) (uchar) (y)) << 8))
#define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z))
+#define STRCOLL_MB7_TOUPPER
#include "strcoll.inl"
@@ -240,6 +243,7 @@ static const uchar sort_order_ujis[]=
#define WEIGHT_MB2(x,y) ((((uint) (uchar)(x)) << 16) | \
(((uint) (uchar) (y)) << 8))
#define WEIGHT_MB3(x,y,z) (WEIGHT_MB2(x,y) | ((uint) (uchar) z))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 742eeb912e3..40a01d4cba6 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -1036,6 +1036,268 @@ static MY_UNICASE_CHARACTER plane05[]={
{0x05FE,0x05FE,0x05FE}, {0x05FF,0x05FF,0x05FF}
};
+static MY_UNICASE_CHARACTER plane06[]={ /* This page is dummy */
+ {0x0600,0x0600,0x0600}, {0x0601,0x0601,0x0601}, /* 0600 */
+ {0x0602,0x0602,0x0602}, {0x0603,0x0603,0x0603}, /* 0602 */
+ {0x0604,0x0604,0x0604}, {0x0605,0x0605,0x0605}, /* 0604 */
+ {0x0606,0x0606,0x0606}, {0x0607,0x0607,0x0607}, /* 0606 */
+ {0x0608,0x0608,0x0608}, {0x0609,0x0609,0x0609}, /* 0608 */
+ {0x060A,0x060A,0x060A}, {0x060B,0x060B,0x060B}, /* 060A */
+ {0x060C,0x060C,0x060C}, {0x060D,0x060D,0x060D}, /* 060C */
+ {0x060E,0x060E,0x060E}, {0x060F,0x060F,0x060F}, /* 060E */
+ {0x0610,0x0610,0x0610}, {0x0611,0x0611,0x0611}, /* 0610 */
+ {0x0612,0x0612,0x0612}, {0x0613,0x0613,0x0613}, /* 0612 */
+ {0x0614,0x0614,0x0614}, {0x0615,0x0615,0x0615}, /* 0614 */
+ {0x0616,0x0616,0x0616}, {0x0617,0x0617,0x0617}, /* 0616 */
+ {0x0618,0x0618,0x0618}, {0x0619,0x0619,0x0619}, /* 0618 */
+ {0x061A,0x061A,0x061A}, {0x061B,0x061B,0x061B}, /* 061A */
+ {0x061C,0x061C,0x061C}, {0x061D,0x061D,0x061D}, /* 061C */
+ {0x061E,0x061E,0x061E}, {0x061F,0x061F,0x061F}, /* 061E */
+ {0x0620,0x0620,0x0620}, {0x0621,0x0621,0x0621}, /* 0620 */
+ {0x0622,0x0622,0x0622}, {0x0623,0x0623,0x0623}, /* 0622 */
+ {0x0624,0x0624,0x0624}, {0x0625,0x0625,0x0625}, /* 0624 */
+ {0x0626,0x0626,0x0626}, {0x0627,0x0627,0x0627}, /* 0626 */
+ {0x0628,0x0628,0x0628}, {0x0629,0x0629,0x0629}, /* 0628 */
+ {0x062A,0x062A,0x062A}, {0x062B,0x062B,0x062B}, /* 062A */
+ {0x062C,0x062C,0x062C}, {0x062D,0x062D,0x062D}, /* 062C */
+ {0x062E,0x062E,0x062E}, {0x062F,0x062F,0x062F}, /* 062E */
+ {0x0630,0x0630,0x0630}, {0x0631,0x0631,0x0631}, /* 0630 */
+ {0x0632,0x0632,0x0632}, {0x0633,0x0633,0x0633}, /* 0632 */
+ {0x0634,0x0634,0x0634}, {0x0635,0x0635,0x0635}, /* 0634 */
+ {0x0636,0x0636,0x0636}, {0x0637,0x0637,0x0637}, /* 0636 */
+ {0x0638,0x0638,0x0638}, {0x0639,0x0639,0x0639}, /* 0638 */
+ {0x063A,0x063A,0x063A}, {0x063B,0x063B,0x063B}, /* 063A */
+ {0x063C,0x063C,0x063C}, {0x063D,0x063D,0x063D}, /* 063C */
+ {0x063E,0x063E,0x063E}, {0x063F,0x063F,0x063F}, /* 063E */
+ {0x0640,0x0640,0x0640}, {0x0641,0x0641,0x0641}, /* 0640 */
+ {0x0642,0x0642,0x0642}, {0x0643,0x0643,0x0643}, /* 0642 */
+ {0x0644,0x0644,0x0644}, {0x0645,0x0645,0x0645}, /* 0644 */
+ {0x0646,0x0646,0x0646}, {0x0647,0x0647,0x0647}, /* 0646 */
+ {0x0648,0x0648,0x0648}, {0x0649,0x0649,0x0649}, /* 0648 */
+ {0x064A,0x064A,0x064A}, {0x064B,0x064B,0x064B}, /* 064A */
+ {0x064C,0x064C,0x064C}, {0x064D,0x064D,0x064D}, /* 064C */
+ {0x064E,0x064E,0x064E}, {0x064F,0x064F,0x064F}, /* 064E */
+ {0x0650,0x0650,0x0650}, {0x0651,0x0651,0x0651}, /* 0650 */
+ {0x0652,0x0652,0x0652}, {0x0653,0x0653,0x0653}, /* 0652 */
+ {0x0654,0x0654,0x0654}, {0x0655,0x0655,0x0655}, /* 0654 */
+ {0x0656,0x0656,0x0656}, {0x0657,0x0657,0x0657}, /* 0656 */
+ {0x0658,0x0658,0x0658}, {0x0659,0x0659,0x0659}, /* 0658 */
+ {0x065A,0x065A,0x065A}, {0x065B,0x065B,0x065B}, /* 065A */
+ {0x065C,0x065C,0x065C}, {0x065D,0x065D,0x065D}, /* 065C */
+ {0x065E,0x065E,0x065E}, {0x065F,0x065F,0x065F}, /* 065E */
+ {0x0660,0x0660,0x0660}, {0x0661,0x0661,0x0661}, /* 0660 */
+ {0x0662,0x0662,0x0662}, {0x0663,0x0663,0x0663}, /* 0662 */
+ {0x0664,0x0664,0x0664}, {0x0665,0x0665,0x0665}, /* 0664 */
+ {0x0666,0x0666,0x0666}, {0x0667,0x0667,0x0667}, /* 0666 */
+ {0x0668,0x0668,0x0668}, {0x0669,0x0669,0x0669}, /* 0668 */
+ {0x066A,0x066A,0x066A}, {0x066B,0x066B,0x066B}, /* 066A */
+ {0x066C,0x066C,0x066C}, {0x066D,0x066D,0x066D}, /* 066C */
+ {0x066E,0x066E,0x066E}, {0x066F,0x066F,0x066F}, /* 066E */
+ {0x0670,0x0670,0x0670}, {0x0671,0x0671,0x0671}, /* 0670 */
+ {0x0672,0x0672,0x0672}, {0x0673,0x0673,0x0673}, /* 0672 */
+ {0x0674,0x0674,0x0674}, {0x0675,0x0675,0x0675}, /* 0674 */
+ {0x0676,0x0676,0x0676}, {0x0677,0x0677,0x0677}, /* 0676 */
+ {0x0678,0x0678,0x0678}, {0x0679,0x0679,0x0679}, /* 0678 */
+ {0x067A,0x067A,0x067A}, {0x067B,0x067B,0x067B}, /* 067A */
+ {0x067C,0x067C,0x067C}, {0x067D,0x067D,0x067D}, /* 067C */
+ {0x067E,0x067E,0x067E}, {0x067F,0x067F,0x067F}, /* 067E */
+ {0x0680,0x0680,0x0680}, {0x0681,0x0681,0x0681}, /* 0680 */
+ {0x0682,0x0682,0x0682}, {0x0683,0x0683,0x0683}, /* 0682 */
+ {0x0684,0x0684,0x0684}, {0x0685,0x0685,0x0685}, /* 0684 */
+ {0x0686,0x0686,0x0686}, {0x0687,0x0687,0x0687}, /* 0686 */
+ {0x0688,0x0688,0x0688}, {0x0689,0x0689,0x0689}, /* 0688 */
+ {0x068A,0x068A,0x068A}, {0x068B,0x068B,0x068B}, /* 068A */
+ {0x068C,0x068C,0x068C}, {0x068D,0x068D,0x068D}, /* 068C */
+ {0x068E,0x068E,0x068E}, {0x068F,0x068F,0x068F}, /* 068E */
+ {0x0690,0x0690,0x0690}, {0x0691,0x0691,0x0691}, /* 0690 */
+ {0x0692,0x0692,0x0692}, {0x0693,0x0693,0x0693}, /* 0692 */
+ {0x0694,0x0694,0x0694}, {0x0695,0x0695,0x0695}, /* 0694 */
+ {0x0696,0x0696,0x0696}, {0x0697,0x0697,0x0697}, /* 0696 */
+ {0x0698,0x0698,0x0698}, {0x0699,0x0699,0x0699}, /* 0698 */
+ {0x069A,0x069A,0x069A}, {0x069B,0x069B,0x069B}, /* 069A */
+ {0x069C,0x069C,0x069C}, {0x069D,0x069D,0x069D}, /* 069C */
+ {0x069E,0x069E,0x069E}, {0x069F,0x069F,0x069F}, /* 069E */
+ {0x06A0,0x06A0,0x06A0}, {0x06A1,0x06A1,0x06A1}, /* 06A0 */
+ {0x06A2,0x06A2,0x06A2}, {0x06A3,0x06A3,0x06A3}, /* 06A2 */
+ {0x06A4,0x06A4,0x06A4}, {0x06A5,0x06A5,0x06A5}, /* 06A4 */
+ {0x06A6,0x06A6,0x06A6}, {0x06A7,0x06A7,0x06A7}, /* 06A6 */
+ {0x06A8,0x06A8,0x06A8}, {0x06A9,0x06A9,0x06A9}, /* 06A8 */
+ {0x06AA,0x06AA,0x06AA}, {0x06AB,0x06AB,0x06AB}, /* 06AA */
+ {0x06AC,0x06AC,0x06AC}, {0x06AD,0x06AD,0x06AD}, /* 06AC */
+ {0x06AE,0x06AE,0x06AE}, {0x06AF,0x06AF,0x06AF}, /* 06AE */
+ {0x06B0,0x06B0,0x06B0}, {0x06B1,0x06B1,0x06B1}, /* 06B0 */
+ {0x06B2,0x06B2,0x06B2}, {0x06B3,0x06B3,0x06B3}, /* 06B2 */
+ {0x06B4,0x06B4,0x06B4}, {0x06B5,0x06B5,0x06B5}, /* 06B4 */
+ {0x06B6,0x06B6,0x06B6}, {0x06B7,0x06B7,0x06B7}, /* 06B6 */
+ {0x06B8,0x06B8,0x06B8}, {0x06B9,0x06B9,0x06B9}, /* 06B8 */
+ {0x06BA,0x06BA,0x06BA}, {0x06BB,0x06BB,0x06BB}, /* 06BA */
+ {0x06BC,0x06BC,0x06BC}, {0x06BD,0x06BD,0x06BD}, /* 06BC */
+ {0x06BE,0x06BE,0x06BE}, {0x06BF,0x06BF,0x06BF}, /* 06BE */
+ {0x06C0,0x06C0,0x06C0}, {0x06C1,0x06C1,0x06C1}, /* 06C0 */
+ {0x06C2,0x06C2,0x06C2}, {0x06C3,0x06C3,0x06C3}, /* 06C2 */
+ {0x06C4,0x06C4,0x06C4}, {0x06C5,0x06C5,0x06C5}, /* 06C4 */
+ {0x06C6,0x06C6,0x06C6}, {0x06C7,0x06C7,0x06C7}, /* 06C6 */
+ {0x06C8,0x06C8,0x06C8}, {0x06C9,0x06C9,0x06C9}, /* 06C8 */
+ {0x06CA,0x06CA,0x06CA}, {0x06CB,0x06CB,0x06CB}, /* 06CA */
+ {0x06CC,0x06CC,0x06CC}, {0x06CD,0x06CD,0x06CD}, /* 06CC */
+ {0x06CE,0x06CE,0x06CE}, {0x06CF,0x06CF,0x06CF}, /* 06CE */
+ {0x06D0,0x06D0,0x06D0}, {0x06D1,0x06D1,0x06D1}, /* 06D0 */
+ {0x06D2,0x06D2,0x06D2}, {0x06D3,0x06D3,0x06D3}, /* 06D2 */
+ {0x06D4,0x06D4,0x06D4}, {0x06D5,0x06D5,0x06D5}, /* 06D4 */
+ {0x06D6,0x06D6,0x06D6}, {0x06D7,0x06D7,0x06D7}, /* 06D6 */
+ {0x06D8,0x06D8,0x06D8}, {0x06D9,0x06D9,0x06D9}, /* 06D8 */
+ {0x06DA,0x06DA,0x06DA}, {0x06DB,0x06DB,0x06DB}, /* 06DA */
+ {0x06DC,0x06DC,0x06DC}, {0x06DD,0x06DD,0x06DD}, /* 06DC */
+ {0x06DE,0x06DE,0x06DE}, {0x06DF,0x06DF,0x06DF}, /* 06DE */
+ {0x06E0,0x06E0,0x06E0}, {0x06E1,0x06E1,0x06E1}, /* 06E0 */
+ {0x06E2,0x06E2,0x06E2}, {0x06E3,0x06E3,0x06E3}, /* 06E2 */
+ {0x06E4,0x06E4,0x06E4}, {0x06E5,0x06E5,0x06E5}, /* 06E4 */
+ {0x06E6,0x06E6,0x06E6}, {0x06E7,0x06E7,0x06E7}, /* 06E6 */
+ {0x06E8,0x06E8,0x06E8}, {0x06E9,0x06E9,0x06E9}, /* 06E8 */
+ {0x06EA,0x06EA,0x06EA}, {0x06EB,0x06EB,0x06EB}, /* 06EA */
+ {0x06EC,0x06EC,0x06EC}, {0x06ED,0x06ED,0x06ED}, /* 06EC */
+ {0x06EE,0x06EE,0x06EE}, {0x06EF,0x06EF,0x06EF}, /* 06EE */
+ {0x06F0,0x06F0,0x06F0}, {0x06F1,0x06F1,0x06F1}, /* 06F0 */
+ {0x06F2,0x06F2,0x06F2}, {0x06F3,0x06F3,0x06F3}, /* 06F2 */
+ {0x06F4,0x06F4,0x06F4}, {0x06F5,0x06F5,0x06F5}, /* 06F4 */
+ {0x06F6,0x06F6,0x06F6}, {0x06F7,0x06F7,0x06F7}, /* 06F6 */
+ {0x06F8,0x06F8,0x06F8}, {0x06F9,0x06F9,0x06F9}, /* 06F8 */
+ {0x06FA,0x06FA,0x06FA}, {0x06FB,0x06FB,0x06FB}, /* 06FA */
+ {0x06FC,0x06FC,0x06FC}, {0x06FD,0x06FD,0x06FD}, /* 06FC */
+ {0x06FE,0x06FE,0x06FE}, {0x06FF,0x06FF,0x06FF} /* 06FE */
+};
+
+static MY_UNICASE_CHARACTER plane07[]={ /* This page is dummy */
+ {0x0700,0x0700,0x0700}, {0x0701,0x0701,0x0701}, /* 0700 */
+ {0x0702,0x0702,0x0702}, {0x0703,0x0703,0x0703}, /* 0702 */
+ {0x0704,0x0704,0x0704}, {0x0705,0x0705,0x0705}, /* 0704 */
+ {0x0706,0x0706,0x0706}, {0x0707,0x0707,0x0707}, /* 0706 */
+ {0x0708,0x0708,0x0708}, {0x0709,0x0709,0x0709}, /* 0708 */
+ {0x070A,0x070A,0x070A}, {0x070B,0x070B,0x070B}, /* 070A */
+ {0x070C,0x070C,0x070C}, {0x070D,0x070D,0x070D}, /* 070C */
+ {0x070E,0x070E,0x070E}, {0x070F,0x070F,0x070F}, /* 070E */
+ {0x0710,0x0710,0x0710}, {0x0711,0x0711,0x0711}, /* 0710 */
+ {0x0712,0x0712,0x0712}, {0x0713,0x0713,0x0713}, /* 0712 */
+ {0x0714,0x0714,0x0714}, {0x0715,0x0715,0x0715}, /* 0714 */
+ {0x0716,0x0716,0x0716}, {0x0717,0x0717,0x0717}, /* 0716 */
+ {0x0718,0x0718,0x0718}, {0x0719,0x0719,0x0719}, /* 0718 */
+ {0x071A,0x071A,0x071A}, {0x071B,0x071B,0x071B}, /* 071A */
+ {0x071C,0x071C,0x071C}, {0x071D,0x071D,0x071D}, /* 071C */
+ {0x071E,0x071E,0x071E}, {0x071F,0x071F,0x071F}, /* 071E */
+ {0x0720,0x0720,0x0720}, {0x0721,0x0721,0x0721}, /* 0720 */
+ {0x0722,0x0722,0x0722}, {0x0723,0x0723,0x0723}, /* 0722 */
+ {0x0724,0x0724,0x0724}, {0x0725,0x0725,0x0725}, /* 0724 */
+ {0x0726,0x0726,0x0726}, {0x0727,0x0727,0x0727}, /* 0726 */
+ {0x0728,0x0728,0x0728}, {0x0729,0x0729,0x0729}, /* 0728 */
+ {0x072A,0x072A,0x072A}, {0x072B,0x072B,0x072B}, /* 072A */
+ {0x072C,0x072C,0x072C}, {0x072D,0x072D,0x072D}, /* 072C */
+ {0x072E,0x072E,0x072E}, {0x072F,0x072F,0x072F}, /* 072E */
+ {0x0730,0x0730,0x0730}, {0x0731,0x0731,0x0731}, /* 0730 */
+ {0x0732,0x0732,0x0732}, {0x0733,0x0733,0x0733}, /* 0732 */
+ {0x0734,0x0734,0x0734}, {0x0735,0x0735,0x0735}, /* 0734 */
+ {0x0736,0x0736,0x0736}, {0x0737,0x0737,0x0737}, /* 0736 */
+ {0x0738,0x0738,0x0738}, {0x0739,0x0739,0x0739}, /* 0738 */
+ {0x073A,0x073A,0x073A}, {0x073B,0x073B,0x073B}, /* 073A */
+ {0x073C,0x073C,0x073C}, {0x073D,0x073D,0x073D}, /* 073C */
+ {0x073E,0x073E,0x073E}, {0x073F,0x073F,0x073F}, /* 073E */
+ {0x0740,0x0740,0x0740}, {0x0741,0x0741,0x0741}, /* 0740 */
+ {0x0742,0x0742,0x0742}, {0x0743,0x0743,0x0743}, /* 0742 */
+ {0x0744,0x0744,0x0744}, {0x0745,0x0745,0x0745}, /* 0744 */
+ {0x0746,0x0746,0x0746}, {0x0747,0x0747,0x0747}, /* 0746 */
+ {0x0748,0x0748,0x0748}, {0x0749,0x0749,0x0749}, /* 0748 */
+ {0x074A,0x074A,0x074A}, {0x074B,0x074B,0x074B}, /* 074A */
+ {0x074C,0x074C,0x074C}, {0x074D,0x074D,0x074D}, /* 074C */
+ {0x074E,0x074E,0x074E}, {0x074F,0x074F,0x074F}, /* 074E */
+ {0x0750,0x0750,0x0750}, {0x0751,0x0751,0x0751}, /* 0750 */
+ {0x0752,0x0752,0x0752}, {0x0753,0x0753,0x0753}, /* 0752 */
+ {0x0754,0x0754,0x0754}, {0x0755,0x0755,0x0755}, /* 0754 */
+ {0x0756,0x0756,0x0756}, {0x0757,0x0757,0x0757}, /* 0756 */
+ {0x0758,0x0758,0x0758}, {0x0759,0x0759,0x0759}, /* 0758 */
+ {0x075A,0x075A,0x075A}, {0x075B,0x075B,0x075B}, /* 075A */
+ {0x075C,0x075C,0x075C}, {0x075D,0x075D,0x075D}, /* 075C */
+ {0x075E,0x075E,0x075E}, {0x075F,0x075F,0x075F}, /* 075E */
+ {0x0760,0x0760,0x0760}, {0x0761,0x0761,0x0761}, /* 0760 */
+ {0x0762,0x0762,0x0762}, {0x0763,0x0763,0x0763}, /* 0762 */
+ {0x0764,0x0764,0x0764}, {0x0765,0x0765,0x0765}, /* 0764 */
+ {0x0766,0x0766,0x0766}, {0x0767,0x0767,0x0767}, /* 0766 */
+ {0x0768,0x0768,0x0768}, {0x0769,0x0769,0x0769}, /* 0768 */
+ {0x076A,0x076A,0x076A}, {0x076B,0x076B,0x076B}, /* 076A */
+ {0x076C,0x076C,0x076C}, {0x076D,0x076D,0x076D}, /* 076C */
+ {0x076E,0x076E,0x076E}, {0x076F,0x076F,0x076F}, /* 076E */
+ {0x0770,0x0770,0x0770}, {0x0771,0x0771,0x0771}, /* 0770 */
+ {0x0772,0x0772,0x0772}, {0x0773,0x0773,0x0773}, /* 0772 */
+ {0x0774,0x0774,0x0774}, {0x0775,0x0775,0x0775}, /* 0774 */
+ {0x0776,0x0776,0x0776}, {0x0777,0x0777,0x0777}, /* 0776 */
+ {0x0778,0x0778,0x0778}, {0x0779,0x0779,0x0779}, /* 0778 */
+ {0x077A,0x077A,0x077A}, {0x077B,0x077B,0x077B}, /* 077A */
+ {0x077C,0x077C,0x077C}, {0x077D,0x077D,0x077D}, /* 077C */
+ {0x077E,0x077E,0x077E}, {0x077F,0x077F,0x077F}, /* 077E */
+ {0x0780,0x0780,0x0780}, {0x0781,0x0781,0x0781}, /* 0780 */
+ {0x0782,0x0782,0x0782}, {0x0783,0x0783,0x0783}, /* 0782 */
+ {0x0784,0x0784,0x0784}, {0x0785,0x0785,0x0785}, /* 0784 */
+ {0x0786,0x0786,0x0786}, {0x0787,0x0787,0x0787}, /* 0786 */
+ {0x0788,0x0788,0x0788}, {0x0789,0x0789,0x0789}, /* 0788 */
+ {0x078A,0x078A,0x078A}, {0x078B,0x078B,0x078B}, /* 078A */
+ {0x078C,0x078C,0x078C}, {0x078D,0x078D,0x078D}, /* 078C */
+ {0x078E,0x078E,0x078E}, {0x078F,0x078F,0x078F}, /* 078E */
+ {0x0790,0x0790,0x0790}, {0x0791,0x0791,0x0791}, /* 0790 */
+ {0x0792,0x0792,0x0792}, {0x0793,0x0793,0x0793}, /* 0792 */
+ {0x0794,0x0794,0x0794}, {0x0795,0x0795,0x0795}, /* 0794 */
+ {0x0796,0x0796,0x0796}, {0x0797,0x0797,0x0797}, /* 0796 */
+ {0x0798,0x0798,0x0798}, {0x0799,0x0799,0x0799}, /* 0798 */
+ {0x079A,0x079A,0x079A}, {0x079B,0x079B,0x079B}, /* 079A */
+ {0x079C,0x079C,0x079C}, {0x079D,0x079D,0x079D}, /* 079C */
+ {0x079E,0x079E,0x079E}, {0x079F,0x079F,0x079F}, /* 079E */
+ {0x07A0,0x07A0,0x07A0}, {0x07A1,0x07A1,0x07A1}, /* 07A0 */
+ {0x07A2,0x07A2,0x07A2}, {0x07A3,0x07A3,0x07A3}, /* 07A2 */
+ {0x07A4,0x07A4,0x07A4}, {0x07A5,0x07A5,0x07A5}, /* 07A4 */
+ {0x07A6,0x07A6,0x07A6}, {0x07A7,0x07A7,0x07A7}, /* 07A6 */
+ {0x07A8,0x07A8,0x07A8}, {0x07A9,0x07A9,0x07A9}, /* 07A8 */
+ {0x07AA,0x07AA,0x07AA}, {0x07AB,0x07AB,0x07AB}, /* 07AA */
+ {0x07AC,0x07AC,0x07AC}, {0x07AD,0x07AD,0x07AD}, /* 07AC */
+ {0x07AE,0x07AE,0x07AE}, {0x07AF,0x07AF,0x07AF}, /* 07AE */
+ {0x07B0,0x07B0,0x07B0}, {0x07B1,0x07B1,0x07B1}, /* 07B0 */
+ {0x07B2,0x07B2,0x07B2}, {0x07B3,0x07B3,0x07B3}, /* 07B2 */
+ {0x07B4,0x07B4,0x07B4}, {0x07B5,0x07B5,0x07B5}, /* 07B4 */
+ {0x07B6,0x07B6,0x07B6}, {0x07B7,0x07B7,0x07B7}, /* 07B6 */
+ {0x07B8,0x07B8,0x07B8}, {0x07B9,0x07B9,0x07B9}, /* 07B8 */
+ {0x07BA,0x07BA,0x07BA}, {0x07BB,0x07BB,0x07BB}, /* 07BA */
+ {0x07BC,0x07BC,0x07BC}, {0x07BD,0x07BD,0x07BD}, /* 07BC */
+ {0x07BE,0x07BE,0x07BE}, {0x07BF,0x07BF,0x07BF}, /* 07BE */
+ {0x07C0,0x07C0,0x07C0}, {0x07C1,0x07C1,0x07C1}, /* 07C0 */
+ {0x07C2,0x07C2,0x07C2}, {0x07C3,0x07C3,0x07C3}, /* 07C2 */
+ {0x07C4,0x07C4,0x07C4}, {0x07C5,0x07C5,0x07C5}, /* 07C4 */
+ {0x07C6,0x07C6,0x07C6}, {0x07C7,0x07C7,0x07C7}, /* 07C6 */
+ {0x07C8,0x07C8,0x07C8}, {0x07C9,0x07C9,0x07C9}, /* 07C8 */
+ {0x07CA,0x07CA,0x07CA}, {0x07CB,0x07CB,0x07CB}, /* 07CA */
+ {0x07CC,0x07CC,0x07CC}, {0x07CD,0x07CD,0x07CD}, /* 07CC */
+ {0x07CE,0x07CE,0x07CE}, {0x07CF,0x07CF,0x07CF}, /* 07CE */
+ {0x07D0,0x07D0,0x07D0}, {0x07D1,0x07D1,0x07D1}, /* 07D0 */
+ {0x07D2,0x07D2,0x07D2}, {0x07D3,0x07D3,0x07D3}, /* 07D2 */
+ {0x07D4,0x07D4,0x07D4}, {0x07D5,0x07D5,0x07D5}, /* 07D4 */
+ {0x07D6,0x07D6,0x07D6}, {0x07D7,0x07D7,0x07D7}, /* 07D6 */
+ {0x07D8,0x07D8,0x07D8}, {0x07D9,0x07D9,0x07D9}, /* 07D8 */
+ {0x07DA,0x07DA,0x07DA}, {0x07DB,0x07DB,0x07DB}, /* 07DA */
+ {0x07DC,0x07DC,0x07DC}, {0x07DD,0x07DD,0x07DD}, /* 07DC */
+ {0x07DE,0x07DE,0x07DE}, {0x07DF,0x07DF,0x07DF}, /* 07DE */
+ {0x07E0,0x07E0,0x07E0}, {0x07E1,0x07E1,0x07E1}, /* 07E0 */
+ {0x07E2,0x07E2,0x07E2}, {0x07E3,0x07E3,0x07E3}, /* 07E2 */
+ {0x07E4,0x07E4,0x07E4}, {0x07E5,0x07E5,0x07E5}, /* 07E4 */
+ {0x07E6,0x07E6,0x07E6}, {0x07E7,0x07E7,0x07E7}, /* 07E6 */
+ {0x07E8,0x07E8,0x07E8}, {0x07E9,0x07E9,0x07E9}, /* 07E8 */
+ {0x07EA,0x07EA,0x07EA}, {0x07EB,0x07EB,0x07EB}, /* 07EA */
+ {0x07EC,0x07EC,0x07EC}, {0x07ED,0x07ED,0x07ED}, /* 07EC */
+ {0x07EE,0x07EE,0x07EE}, {0x07EF,0x07EF,0x07EF}, /* 07EE */
+ {0x07F0,0x07F0,0x07F0}, {0x07F1,0x07F1,0x07F1}, /* 07F0 */
+ {0x07F2,0x07F2,0x07F2}, {0x07F3,0x07F3,0x07F3}, /* 07F2 */
+ {0x07F4,0x07F4,0x07F4}, {0x07F5,0x07F5,0x07F5}, /* 07F4 */
+ {0x07F6,0x07F6,0x07F6}, {0x07F7,0x07F7,0x07F7}, /* 07F6 */
+ {0x07F8,0x07F8,0x07F8}, {0x07F9,0x07F9,0x07F9}, /* 07F8 */
+ {0x07FA,0x07FA,0x07FA}, {0x07FB,0x07FB,0x07FB}, /* 07FA */
+ {0x07FC,0x07FC,0x07FC}, {0x07FD,0x07FD,0x07FD}, /* 07FC */
+ {0x07FE,0x07FE,0x07FE}, {0x07FF,0x07FF,0x07FF} /* 07FE */
+};
+
static MY_UNICASE_CHARACTER plane1E[]={
{0x1E00,0x1E01,0x0041}, {0x1E00,0x1E01,0x0041},
{0x1E02,0x1E03,0x0042}, {0x1E02,0x1E03,0x0042},
@@ -1695,7 +1957,7 @@ static MY_UNICASE_CHARACTER planeFF[]={
MY_UNICASE_CHARACTER *my_unicase_default_pages[256]=
{
my_unicase_default_page00,
- plane01, plane02, plane03, plane04, plane05, NULL, NULL,
+ plane01, plane02, plane03, plane04, plane05, plane06, plane07,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, plane1E, plane1F,
@@ -1742,7 +2004,7 @@ MY_UNICASE_INFO my_unicase_default=
*/
MY_UNICASE_CHARACTER *my_unicase_pages_mysql500[256]={
plane00_mysql500,
- plane01, plane02, plane03, plane04, plane05, NULL, NULL,
+ plane01, plane02, plane03, plane04, plane05, plane06, plane07,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, plane1E, plane1F,
@@ -1929,7 +2191,7 @@ static MY_UNICASE_CHARACTER turk00[]=
static MY_UNICASE_CHARACTER *my_unicase_pages_turkish[256]=
{
- turk00, plane01, plane02, plane03, plane04, plane05, NULL, NULL,
+ turk00, plane01, plane02, plane03, plane04, plane05, plane06, plane07,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, plane1E, plane1F,
@@ -4333,7 +4595,7 @@ static MY_UNICASE_CHARACTER u520p104[]={
MY_UNICASE_CHARACTER *my_unicase_pages_unicode520[4352]=
{
- u520p00, u520p01, u520p02, u520p03, u520p04, u520p05, NULL, NULL,
+ u520p00, u520p01, u520p02, u520p03, u520p04, u520p05, plane06, plane06,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
u520p10, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, u520p1D, u520p1E, u520p1F,
@@ -5231,7 +5493,17 @@ static inline int my_weight_mb2_utf8mb3_general_ci(uchar b0, uchar b1)
{
my_wc_t wc= UTF8MB2_CODE(b0, b1);
MY_UNICASE_CHARACTER *page= my_unicase_default_pages[wc >> 8];
- return (int) (page ? page[wc & 0xFF].sort : wc);
+ /*
+ 2-byte utf8 sequences encode Unicode characters up to U+07FF.
+ my_unicase_default_pages[N] has non-NULL page pointers
+ for all N in the range [0..7].
+ - my_unicase_default_pages[0..5] point to real translation data
+ - my_unicase_default_pages[6..7] point to dummy pages
+ (without real translation).
+ By adding these dummy pages we can avoid testing 'page' against NULL.
+ This gives up to 20% performance improvement.
+ */
+ return (int) page[wc & 0xFF].sort;
}
@@ -5255,6 +5527,7 @@ static inline int my_weight_mb3_utf8mb3_general_ci(uchar b0, uchar b1, uchar b2)
#define WEIGHT_MB1(x) my_weight_mb1_utf8mb3_general_ci(x)
#define WEIGHT_MB2(x,y) my_weight_mb2_utf8mb3_general_ci(x,y)
#define WEIGHT_MB3(x,y,z) my_weight_mb3_utf8mb3_general_ci(x,y,z)
+#define STRCOLL_MB7_TOUPPER
#include "strcoll.inl"
@@ -5264,6 +5537,7 @@ static inline int my_weight_mb3_utf8mb3_general_ci(uchar b0, uchar b1, uchar b2)
#define WEIGHT_MB1(x) my_weight_mb1_utf8mb3_general_ci(x)
#define WEIGHT_MB2(x,y) my_weight_mb2_utf8mb3_general_ci(x,y)
#define WEIGHT_MB3(x,y,z) my_weight_mb3_utf8mb3_general_ci(x,y,z)
+#define STRCOLL_MB7_TOUPPER
#include "strcoll.inl"
@@ -5277,7 +5551,11 @@ static inline int my_weight_mb2_utf8mb3_general_mysql500_ci(uchar b0, uchar b1)
{
my_wc_t wc= UTF8MB2_CODE(b0, b1);
MY_UNICASE_CHARACTER *page= my_unicase_pages_mysql500[wc >> 8];
- return (int) (page ? page[wc & 0xFF].sort : wc);
+ /*
+ `page` should never be NULL for 2-byte utf8 characters.
+ See comments in my_weight_mb2_utf8mb3_general_ci().
+ */
+ return (int) page[wc & 0xFF].sort;
}
@@ -5301,6 +5579,7 @@ my_weight_mb3_utf8mb3_general_mysql500_ci(uchar b0, uchar b1, uchar b2)
#define WEIGHT_MB1(x) my_weight_mb1_utf8mb3_general_mysql500_ci(x)
#define WEIGHT_MB2(x,y) my_weight_mb2_utf8mb3_general_mysql500_ci(x,y)
#define WEIGHT_MB3(x,y,z) my_weight_mb3_utf8mb3_general_mysql500_ci(x,y,z)
+#define STRCOLL_MB7_TOUPPER
#include "strcoll.inl"
@@ -5312,6 +5591,7 @@ my_weight_mb3_utf8mb3_general_mysql500_ci(uchar b0, uchar b1, uchar b2)
#define WEIGHT_MB1(x) ((int) (uchar) (x))
#define WEIGHT_MB2(x,y) ((int) UTF8MB2_CODE(x,y))
#define WEIGHT_MB3(x,y,z) ((int) UTF8MB3_CODE(x,y,z))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
@@ -5321,6 +5601,7 @@ my_weight_mb3_utf8mb3_general_mysql500_ci(uchar b0, uchar b1, uchar b2)
#define WEIGHT_MB1(x) ((int) (uchar) (x))
#define WEIGHT_MB2(x,y) ((int) UTF8MB2_CODE(x,y))
#define WEIGHT_MB3(x,y,z) ((int) UTF8MB3_CODE(x,y,z))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
/*
@@ -7692,6 +7973,7 @@ my_charlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)),
All non-BMP characters have the same weight.
*/
#define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER
+#define STRCOLL_MB7_TOUPPER
#include "strcoll.inl"
@@ -7701,6 +7983,7 @@ my_charlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)),
#define WEIGHT_MB2(b0,b1) ((int) UTF8MB2_CODE(b0,b1))
#define WEIGHT_MB3(b0,b1,b2) ((int) UTF8MB3_CODE(b0,b1,b2))
#define WEIGHT_MB4(b0,b1,b2,b3) ((int) UTF8MB4_CODE(b0,b1,b2,b3))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
@@ -7715,6 +7998,7 @@ my_charlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)),
All non-BMP characters have the same weight.
*/
#define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER
+#define STRCOLL_MB7_TOUPPER
#include "strcoll.inl"
@@ -7725,6 +8009,7 @@ my_charlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)),
#define WEIGHT_MB2(b0,b1) ((int) UTF8MB2_CODE(b0,b1))
#define WEIGHT_MB3(b0,b1,b2) ((int) UTF8MB3_CODE(b0,b1,b2))
#define WEIGHT_MB4(b0,b1,b2,b3) ((int) UTF8MB4_CODE(b0,b1,b2,b3))
+#define STRCOLL_MB7_BIN
#include "strcoll.inl"
diff --git a/strings/json_lib.c b/strings/json_lib.c
index e55394bbeb8..65058587a93 100644
--- a/strings/json_lib.c
+++ b/strings/json_lib.c
@@ -844,7 +844,7 @@ static int skip_key(json_engine_t *j)
{
int t_next, c_len;
- if (json_instr_chr_map[j->s.c_next] == S_BKSL &&
+ if (j->s.c_next< 128 && json_instr_chr_map[j->s.c_next] == S_BKSL &&
json_handle_esc(&j->s))
return 1;
@@ -951,7 +951,7 @@ int json_read_value(json_engine_t *j)
{
int t_next, c_len, res;
- j->value_type= JSON_VALUE_UNINITALIZED;
+ j->value_type= JSON_VALUE_UNINITIALIZED;
if (j->state == JST_KEY)
{
while (json_read_keyname_chr(j) == 0) {}
diff --git a/strings/json_normalize.c b/strings/json_normalize.c
new file mode 100644
index 00000000000..0b7f172dae6
--- /dev/null
+++ b/strings/json_normalize.c
@@ -0,0 +1,852 @@
+/* Copyright (c) 2021 Eric Herman and MariaDB Foundation.
+
+ 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.
+
+ 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.
+
+ 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-1335 USA */
+
+#include <my_global.h>
+#include <json_lib.h>
+
+#ifndef PSI_JSON
+#define PSI_JSON PSI_NOT_INSTRUMENTED
+#endif
+
+#ifndef JSON_MALLOC_FLAGS
+#define JSON_MALLOC_FLAGS MYF(MY_THREAD_SPECIFIC|MY_WME)
+#endif
+
+/*
+From the EXPIRED DRAFT JSON Canonical Form
+https://datatracker.ietf.org/doc/html/draft-staykov-hu-json-canonical-form-00
+
+2. JSON canonical form
+
+ The canonical form is defined by the following rules:
+ * The document MUST be encoded in UTF-8 [UTF-8]
+ * Non-significant(1) whitespace characters MUST NOT be used
+ * Non-significant(1) line endings MUST NOT be used
+ * Entries (set of name/value pairs) in JSON objects MUST be sorted
+ lexicographically(2) by their names
+ * Arrays MUST preserve their initial ordering
+
+ (1)As defined in JSON data-interchange format [JSON], JSON objects
+ consists of multiple "name"/"value" pairs and JSON arrays consists
+ of multiple "value" fields. Non-significant means not part of
+ "name" or "value".
+
+
+ (2)Lexicographic comparison, which orders strings from least to
+ greatest alphabetically based on the UCS (Unicode Character Set)
+ codepoint values.
+*/
+
+
+struct json_norm_array {
+ DYNAMIC_ARRAY values;
+};
+
+
+struct json_norm_object {
+ DYNAMIC_ARRAY kv_pairs;
+};
+
+
+struct json_norm_value {
+ enum json_value_types type;
+ union {
+ DYNAMIC_STRING number;
+ LEX_STRING string;
+ struct json_norm_array array;
+ struct json_norm_object object;
+ } value;
+};
+
+
+struct json_norm_kv {
+ LEX_STRING key;
+ struct json_norm_value value;
+};
+
+
+static void *
+json_norm_malloc(size_t size)
+{
+ return my_malloc(PSI_JSON, size, JSON_MALLOC_FLAGS);
+}
+
+
+int
+json_norm_string_init(LEX_STRING *string, const char *str, size_t len)
+{
+ string->length= len + 1;
+ string->str= json_norm_malloc(string->length);
+ if (!string->str)
+ {
+ string->length= 0;
+ return 1;
+ }
+ strncpy(string->str, str, len);
+ string->str[len]= 0;
+ return 0;
+}
+
+
+void
+json_norm_string_free(LEX_STRING *string)
+{
+ my_free(string->str);
+ string->str= NULL;
+ string->length= 0;
+}
+
+
+void
+json_norm_number_free(DYNAMIC_STRING *number)
+{
+ dynstr_free(number);
+ number->length= 0;
+}
+
+
+int
+json_normalize_number(DYNAMIC_STRING *out, const char *str, size_t str_len)
+{
+ int err= 0;
+ long int magnitude= 0;
+ int negative= 0;
+ size_t i= 0;
+ size_t j= 0;
+ size_t k= 0;
+ char *buf= NULL;
+ size_t buf_size = str_len + 1;
+
+ buf= json_norm_malloc(buf_size);
+ if (!buf)
+ return 1;
+
+ memset(buf, 0x00, buf_size);
+
+ if (str[0] == '-')
+ {
+ negative= 1;
+ ++i;
+ }
+
+ /* grab digits preceding the decimal */
+ for (; i < str_len && str[i] != '.' && str[i] != 'e' && str[i] != 'E'; ++i)
+ buf[j++] = str[i];
+
+ magnitude = (long)(j - 1);
+
+ /* skip the . */
+ if (str[i] == '.')
+ ++i;
+
+ /* grab rest of digits before the E */
+ for (; i < str_len && str[i] != 'e' && str[i] != 'E'; ++i)
+ buf[j++] = str[i];
+
+ /* trim trailing zeros */
+ for (k = j - 1; k && buf[k] == '0'; --k, --j)
+ buf[k] = '\0';
+
+ /* trim the leading zeros */
+ for (k = 0; buf[k] && buf[k] == '0'; ++k);
+ if (k)
+ {
+ memmove(buf, buf + k, j - k);
+ j = j - k;
+ buf[j] = '\0';
+ magnitude -= (long)k;
+ }
+
+ if (!j)
+ {
+ err= dynstr_append_mem(out, STRING_WITH_LEN("0.0E0"));
+ my_free(buf);
+ return err;
+ }
+
+ if (negative)
+ err|= dynstr_append_mem(out, STRING_WITH_LEN("-"));
+ err|= dynstr_append_mem(out, buf, 1);
+ err|= dynstr_append_mem(out, STRING_WITH_LEN("."));
+ if (j == 1)
+ err|= dynstr_append_mem(out, STRING_WITH_LEN("0"));
+ else
+ err|= dynstr_append(out, buf + 1);
+
+ err|= dynstr_append_mem(out, STRING_WITH_LEN("E"));
+
+ if (str[i] == 'e' || str[i] == 'E')
+ {
+ char *endptr = NULL;
+ /* skip the [eE] */
+ ++i;
+ /* combine the exponent with current magnitude */
+ magnitude += strtol(str + i, &endptr, 10);
+ }
+ snprintf(buf, buf_size, "%ld", magnitude);
+ err|= dynstr_append(out, buf);
+
+ my_free(buf);
+ return err ? 1 : 0;
+}
+
+
+static int
+json_norm_object_append_key_value(struct json_norm_object *obj,
+ DYNAMIC_STRING *key,
+ struct json_norm_value *val)
+{
+ struct json_norm_kv pair;
+ int err= json_norm_string_init(&pair.key, key->str, key->length);
+
+ if (err)
+ return 1;
+
+ pair.value= *val;
+
+ err|= insert_dynamic(&obj->kv_pairs, &pair);
+ if (err)
+ {
+ json_norm_string_free(&pair.key);
+ return 1;
+ }
+
+ return 0;
+}
+
+
+static struct json_norm_kv*
+json_norm_object_get_last_element(struct json_norm_object *obj)
+{
+ struct json_norm_kv *kv;
+
+ DBUG_ASSERT(obj->kv_pairs.elements > 0);
+ kv= dynamic_element(&obj->kv_pairs,
+ obj->kv_pairs.elements - 1,
+ struct json_norm_kv*);
+ return kv;
+}
+
+
+static struct json_norm_value*
+json_norm_array_get_last_element(struct json_norm_array *arr)
+{
+ struct json_norm_value *val;
+
+ DBUG_ASSERT(arr->values.elements > 0);
+ val= dynamic_element(&arr->values,
+ arr->values.elements - 1,
+ struct json_norm_value*);
+ return val;
+}
+
+
+static int
+json_norm_array_append_value(struct json_norm_array *arr,
+ struct json_norm_value *val)
+{
+ return insert_dynamic(&arr->values, val);
+}
+
+
+int
+json_norm_init_dynamic_array(size_t element_size, void *where)
+{
+ const size_t init_alloc= 20;
+ const size_t alloc_increment= 20;
+ return my_init_dynamic_array(PSI_JSON, where, element_size,
+ init_alloc, alloc_increment,
+ JSON_MALLOC_FLAGS);
+}
+
+
+int
+json_norm_value_object_init(struct json_norm_value *val)
+{
+ const size_t element_size= sizeof(struct json_norm_kv);
+ struct json_norm_object *obj= &val->value.object;
+
+ val->type= JSON_VALUE_OBJECT;
+
+ return json_norm_init_dynamic_array(element_size, &obj->kv_pairs);
+}
+
+
+int
+json_norm_value_array_init(struct json_norm_value *val)
+{
+ const size_t element_size= sizeof(struct json_norm_value);
+ struct json_norm_array *array= &val->value.array;
+
+ val->type= JSON_VALUE_ARRAY;
+
+ return json_norm_init_dynamic_array(element_size, &array->values);
+}
+
+
+static int
+json_norm_value_string_init(struct json_norm_value *val,
+ const char *str, size_t len)
+{
+ val->type= JSON_VALUE_STRING;
+ return json_norm_string_init(&val->value.string, str, len);
+}
+
+
+static int
+json_norm_kv_comp(const struct json_norm_kv *a,
+ const struct json_norm_kv *b)
+{
+ return my_strnncoll(&my_charset_utf8mb4_bin,
+ (const uchar *)a->key.str, a->key.length,
+ (const uchar *)b->key.str, b->key.length);
+}
+
+
+static void
+json_normalize_sort(struct json_norm_value *val)
+{
+ switch (val->type) {
+ case JSON_VALUE_OBJECT:
+ {
+ size_t i;
+ DYNAMIC_ARRAY *pairs= &val->value.object.kv_pairs;
+ for (i= 0; i < pairs->elements; ++i)
+ {
+ struct json_norm_kv *kv= dynamic_element(pairs, i, struct json_norm_kv*);
+ json_normalize_sort(&kv->value);
+ }
+
+ my_qsort(dynamic_element(pairs, 0, struct json_norm_kv*),
+ pairs->elements, sizeof(struct json_norm_kv),
+ (qsort_cmp) json_norm_kv_comp);
+ break;
+ }
+ case JSON_VALUE_ARRAY:
+ {
+ /* Arrays in JSON must keep the order. Just recursively sort values. */
+ size_t i;
+ DYNAMIC_ARRAY *values= &val->value.array.values;
+ for (i= 0; i < values->elements; ++i)
+ {
+ struct json_norm_value *value;
+ value= dynamic_element(values, i, struct json_norm_value*);
+ json_normalize_sort(value);
+ }
+
+ break;
+ }
+ case JSON_VALUE_UNINITIALIZED:
+ DBUG_ASSERT(0);
+ break;
+ default: /* Nothing to do for other types. */
+ break;
+ }
+}
+
+
+static void
+json_norm_value_free(struct json_norm_value *val)
+{
+ size_t i;
+ switch (val->type) {
+ case JSON_VALUE_OBJECT:
+ {
+ struct json_norm_object *obj= &val->value.object;
+
+ DYNAMIC_ARRAY *pairs_arr= &obj->kv_pairs;
+ for (i= 0; i < pairs_arr->elements; ++i)
+ {
+ struct json_norm_kv *kv;
+ kv= dynamic_element(pairs_arr, i, struct json_norm_kv *);
+ json_norm_string_free(&kv->key);
+ json_norm_value_free(&kv->value);
+ }
+ delete_dynamic(pairs_arr);
+ break;
+ }
+ case JSON_VALUE_ARRAY:
+ {
+ struct json_norm_array *arr= &val->value.array;
+
+ DYNAMIC_ARRAY *values_arr= &arr->values;
+ for (i= 0; i < arr->values.elements; ++i)
+ {
+ struct json_norm_value *jt_value;
+ jt_value= dynamic_element(values_arr, i, struct json_norm_value *);
+ json_norm_value_free(jt_value);
+ }
+ delete_dynamic(values_arr);
+ break;
+ }
+ case JSON_VALUE_STRING:
+ {
+ json_norm_string_free(&val->value.string);
+ break;
+ }
+ case JSON_VALUE_NUMBER:
+ json_norm_number_free(&val->value.number);
+ break;
+ case JSON_VALUE_NULL:
+ case JSON_VALUE_TRUE:
+ case JSON_VALUE_FALSE:
+ case JSON_VALUE_UNINITIALIZED:
+ break;
+ }
+ val->type= JSON_VALUE_UNINITIALIZED;
+}
+
+
+static int
+json_norm_to_string(DYNAMIC_STRING *buf, struct json_norm_value *val)
+{
+ switch (val->type)
+ {
+ case JSON_VALUE_OBJECT:
+ {
+ size_t i;
+ struct json_norm_object *obj= &val->value.object;
+ DYNAMIC_ARRAY *pairs_arr= &obj->kv_pairs;
+
+ if (dynstr_append_mem(buf, STRING_WITH_LEN("{")))
+ return 1;
+
+ for (i= 0; i < pairs_arr->elements; ++i)
+ {
+ struct json_norm_kv *kv;
+ kv= dynamic_element(pairs_arr, i, struct json_norm_kv *);
+
+ if (dynstr_append_mem(buf, STRING_WITH_LEN("\"")) ||
+ dynstr_append(buf, kv->key.str) ||
+ dynstr_append_mem(buf, STRING_WITH_LEN("\":")) ||
+ json_norm_to_string(buf, &kv->value))
+ return 1;
+
+ if (i != (pairs_arr->elements - 1))
+ if (dynstr_append_mem(buf, STRING_WITH_LEN(",")))
+ return 1;
+ }
+ if (dynstr_append_mem(buf, STRING_WITH_LEN("}")))
+ return 1;
+ break;
+ }
+ case JSON_VALUE_ARRAY:
+ {
+ size_t i;
+ struct json_norm_array *arr= &val->value.array;
+ DYNAMIC_ARRAY *values_arr= &arr->values;
+
+ if (dynstr_append_mem(buf, STRING_WITH_LEN("[")))
+ return 1;
+ for (i= 0; i < values_arr->elements; ++i)
+ {
+ struct json_norm_value *jt_value;
+ jt_value= dynamic_element(values_arr, i, struct json_norm_value *);
+
+ if (json_norm_to_string(buf, jt_value))
+ return 1;
+ if (i != (values_arr->elements - 1))
+ if (dynstr_append_mem(buf, STRING_WITH_LEN(",")))
+ return 1;
+ }
+ if (dynstr_append_mem(buf, STRING_WITH_LEN("]")))
+ return 1;
+ break;
+ }
+ case JSON_VALUE_STRING:
+ {
+ if (dynstr_append(buf, val->value.string.str))
+ return 1;
+ break;
+ }
+ case JSON_VALUE_NULL:
+ {
+ if (dynstr_append_mem(buf, STRING_WITH_LEN("null")))
+ return 1;
+ break;
+ }
+ case JSON_VALUE_TRUE:
+ {
+ if (dynstr_append_mem(buf, STRING_WITH_LEN("true")))
+ return 1;
+ break;
+ }
+ case JSON_VALUE_FALSE:
+ {
+ if (dynstr_append_mem(buf, STRING_WITH_LEN("false")))
+ return 1;
+ break;
+ }
+ case JSON_VALUE_NUMBER:
+ {
+ if (dynstr_append(buf, val->value.number.str))
+ return 1;
+ break;
+ }
+ case JSON_VALUE_UNINITIALIZED:
+ {
+ DBUG_ASSERT(0);
+ break;
+ }
+ }
+ return 0;
+}
+
+
+static int
+json_norm_value_number_init(struct json_norm_value *val,
+ const char *number, size_t num_len)
+{
+ int err;
+ val->type= JSON_VALUE_NUMBER;
+ err= init_dynamic_string(&val->value.number, NULL, 0, 0);
+ if (err)
+ return 1;
+ err= json_normalize_number(&val->value.number, number, num_len);
+ if (err)
+ dynstr_free(&val->value.number);
+ return err;
+}
+
+
+static void
+json_norm_value_null_init(struct json_norm_value *val)
+{
+ val->type= JSON_VALUE_NULL;
+}
+
+
+static void
+json_norm_value_false_init(struct json_norm_value *val)
+{
+ val->type= JSON_VALUE_FALSE;
+}
+
+
+static void
+json_norm_value_true_init(struct json_norm_value *val)
+{
+ val->type= JSON_VALUE_TRUE;
+}
+
+
+static int
+json_norm_value_init(struct json_norm_value *val, json_engine_t *je)
+{
+ int err= 0;
+ switch (je->value_type) {
+ case JSON_VALUE_STRING:
+ {
+ const char *je_value_begin= (const char *)je->value_begin;
+ size_t je_value_len= (je->value_end - je->value_begin);
+ err= json_norm_value_string_init(val, je_value_begin, je_value_len);
+ break;
+ }
+ case JSON_VALUE_NULL:
+ {
+ json_norm_value_null_init(val);
+ break;
+ }
+ case JSON_VALUE_TRUE:
+ {
+ json_norm_value_true_init(val);
+ break;
+ }
+ case JSON_VALUE_FALSE:
+ {
+ json_norm_value_false_init(val);
+ break;
+ }
+ case JSON_VALUE_ARRAY:
+ {
+ err= json_norm_value_array_init(val);
+ break;
+ }
+ case JSON_VALUE_OBJECT:
+ {
+ err= json_norm_value_object_init(val);
+ break;
+ }
+ case JSON_VALUE_NUMBER:
+ {
+ const char *je_number_begin= (const char *)je->value_begin;
+ size_t je_number_len= (je->value_end - je->value_begin);
+ err= json_norm_value_number_init(val, je_number_begin, je_number_len);
+ break;
+ }
+ default:
+ DBUG_ASSERT(0);
+ return 1;
+ }
+ return err;
+}
+
+
+static int
+json_norm_append_to_array(struct json_norm_value *val,
+ json_engine_t *je)
+{
+ int err= 0;
+ struct json_norm_value tmp;
+
+ DBUG_ASSERT(val->type == JSON_VALUE_ARRAY);
+ DBUG_ASSERT(je->value_type != JSON_VALUE_UNINITIALIZED);
+
+ err= json_norm_value_init(&tmp, je);
+
+ if (err)
+ return 1;
+
+ err= json_norm_array_append_value(&val->value.array, &tmp);
+
+ if (err)
+ json_norm_value_free(&tmp);
+
+ return err;
+}
+
+
+static int
+json_norm_append_to_object(struct json_norm_value *val,
+ DYNAMIC_STRING *key, json_engine_t *je)
+{
+ int err= 0;
+ struct json_norm_value tmp;
+
+ DBUG_ASSERT(val->type == JSON_VALUE_OBJECT);
+ DBUG_ASSERT(je->value_type != JSON_VALUE_UNINITIALIZED);
+
+ err= json_norm_value_init(&tmp, je);
+
+ if (err)
+ return 1;
+
+ err= json_norm_object_append_key_value(&val->value.object, key, &tmp);
+
+ if (err)
+ json_norm_value_free(&tmp);
+
+ return err;
+}
+
+
+static int
+json_norm_parse(struct json_norm_value *root, json_engine_t *je)
+{
+ size_t current;
+ struct json_norm_value *stack[JSON_DEPTH_LIMIT];
+ int err= 0;
+ DYNAMIC_STRING key;
+
+ err= init_dynamic_string(&key, NULL, 0, 0);
+ if (err)
+ goto json_norm_parse_end;
+
+ memset(stack, 0x00, sizeof(stack));
+ current= 0;
+ stack[current]= root;
+
+ do {
+ switch (je->state)
+ {
+ case JST_KEY:
+ {
+ const uchar *key_start= je->s.c_str;
+ const uchar *key_end;
+
+ DBUG_ASSERT(stack[current]->type == JSON_VALUE_OBJECT);
+ do
+ {
+ key_end= je->s.c_str;
+ } while (json_read_keyname_chr(je) == 0);
+
+ /* we have the key name */
+ /* reset the dynstr: */
+ dynstr_trunc(&key, key.length);
+ dynstr_append_mem(&key, (char *)key_start, (key_end - key_start));
+
+ /* After reading the key, we have a follow-up value. */
+ err= json_read_value(je);
+ if (err)
+ goto json_norm_parse_end;
+
+ err= json_norm_append_to_object(stack[current], &key, je);
+ if (err)
+ goto json_norm_parse_end;
+
+ if (je->value_type == JSON_VALUE_ARRAY ||
+ je->value_type == JSON_VALUE_OBJECT)
+ {
+ struct json_norm_kv *kv;
+
+ err= ((current + 1) == JSON_DEPTH_LIMIT);
+ if (err)
+ goto json_norm_parse_end;
+
+ kv= json_norm_object_get_last_element(&stack[current]->value.object);
+ stack[++current]= &kv->value;
+ }
+ break;
+ }
+ case JST_VALUE:
+ {
+ struct json_norm_array *current_arr= &stack[current]->value.array;
+ err= json_read_value(je);
+ if (err)
+ goto json_norm_parse_end;
+
+ DBUG_ASSERT(stack[current]->type == JSON_VALUE_ARRAY);
+
+ err= json_norm_append_to_array(stack[current], je);
+ if (err)
+ goto json_norm_parse_end;
+
+ if (je->value_type == JSON_VALUE_ARRAY ||
+ je->value_type == JSON_VALUE_OBJECT)
+ {
+
+ err= ((current + 1) == JSON_DEPTH_LIMIT);
+ if (err)
+ goto json_norm_parse_end;
+
+ stack[++current]= json_norm_array_get_last_element(current_arr);
+ }
+
+ break;
+ }
+ case JST_OBJ_START:
+ /* parser found an object (the '{' in JSON) */
+ break;
+ case JST_OBJ_END:
+ /* parser found the end of the object (the '}' in JSON) */
+ /* pop stack */
+ --current;
+ break;
+ case JST_ARRAY_START:
+ /* parser found an array (the '[' in JSON) */
+ break;
+ case JST_ARRAY_END:
+ /* parser found the end of the array (the ']' in JSON) */
+ /* pop stack */
+ --current;
+ break;
+ };
+ } while (json_scan_next(je) == 0);
+
+json_norm_parse_end:
+ dynstr_free(&key);
+ return err;
+}
+
+
+static int
+json_norm_build(struct json_norm_value *root,
+ const char *s, size_t size, CHARSET_INFO *cs)
+{
+ int err= 0;
+ json_engine_t je;
+
+ DBUG_ASSERT(s);
+ memset(&je, 0x00, sizeof(je));
+
+ memset(root, 0x00, sizeof(struct json_norm_value));
+ root->type= JSON_VALUE_UNINITIALIZED;
+
+ err= json_scan_start(&je, cs, (const uchar *)s, (const uchar *)(s + size));
+ if (json_read_value(&je))
+ return err;
+
+ err= json_norm_value_init(root, &je);
+
+ if (root->type == JSON_VALUE_OBJECT ||
+ root->type == JSON_VALUE_ARRAY)
+ {
+ err= json_norm_parse(root, &je);
+ if (err)
+ return err;
+ }
+ return err;
+}
+
+
+int
+json_normalize(DYNAMIC_STRING *result,
+ const char *s, size_t size, CHARSET_INFO *cs)
+{
+ int err= 0;
+ uint convert_err= 0;
+ struct json_norm_value root;
+ char *s_utf8= NULL;
+ size_t in_size;
+ const char *in;
+
+ DBUG_ASSERT(result);
+
+ memset(&root, 0x00, sizeof(root));
+ root.type = JSON_VALUE_UNINITIALIZED;
+
+ /*
+ Convert the incoming string to utf8mb4_bin before doing any other work.
+ According to JSON RFC 8259, between systems JSON must be UTF-8
+ https://datatracker.ietf.org/doc/html/rfc8259#section-8.1
+ */
+ if (cs == &my_charset_utf8mb4_bin)
+ {
+ in= s;
+ in_size= size;
+ }
+ else
+ {
+ in_size= (size * my_charset_utf8mb4_bin.mbmaxlen) + 1;
+ s_utf8= json_norm_malloc(in_size);
+ if (!s_utf8)
+ return 1;
+ memset(s_utf8, 0x00, in_size);
+ my_convert(s_utf8, (uint32)in_size, &my_charset_utf8mb4_bin,
+ s, (uint32)size, cs, &convert_err);
+ if (convert_err)
+ {
+ my_free(s_utf8);
+ return 1;
+ }
+ in= s_utf8;
+ in_size= strlen(s_utf8);
+ }
+
+
+ if (!json_valid(in, in_size, &my_charset_utf8mb4_bin))
+ {
+ err= 1;
+ goto json_normalize_end;
+ }
+
+ err= json_norm_build(&root, in, in_size, &my_charset_utf8mb4_bin);
+ if (err)
+ goto json_normalize_end;
+
+ json_normalize_sort(&root);
+
+ err= json_norm_to_string(result, &root);
+
+json_normalize_end:
+ json_norm_value_free(&root);
+ if (err)
+ dynstr_free(result);
+ if (s_utf8)
+ my_free(s_utf8);
+ return err;
+}
+
+
diff --git a/strings/strcoll.inl b/strings/strcoll.inl
index 50849c06e7d..eb5c6e3c717 100644
--- a/strings/strcoll.inl
+++ b/strings/strcoll.inl
@@ -16,6 +16,8 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
*/
+#include "ctype-ascii.h"
+
#ifndef MY_FUNCTION_NAME
#error MY_FUNCTION_NAME is not defined
#endif
@@ -40,6 +42,42 @@
/*
+ For binary collations:
+ - on 32bit platforms perform only 4 byte optimization
+ - on 64bit platforms perform both 4 byte and 8 byte optimization
+*/
+#if defined(STRCOLL_MB7_BIN)
+#define MY_STRCOLL_MB7_4BYTES(a,b) my_strcoll_mb7_bin_4bytes((a),(b))
+#if SIZEOF_VOIDP == 8
+#define STRCOLL_MB7_8BYTES
+#define MY_STRCOLL_MB7_8BYTES(a,b) my_strcoll_mb7_bin_8bytes((a),(b))
+#endif /* Architecture test */
+#endif /* STRCOLL_MB7_BIN */
+
+
+/*
+ For case insensitive collations with trivial mapping from [a-z] to [A-Z]
+ perform optimization only on 64 bit platforms.
+ There is no sense to perform my_ascii_to_upper_magic_uint64() based
+ optimization on 32bit platforms. The idea of this optimization
+ is that it handles 8bytes at a time, using 64bit CPU registers.
+ Enabling this optimization on 32bit platform may only slow things down.
+*/
+#if defined(STRCOLL_MB7_TOUPPER)
+#if SIZEOF_VOIDP == 8
+#define MY_STRCOLL_MB7_4BYTES(a,b) my_strcoll_ascii_toupper_4bytes((a),(b))
+#define MY_STRCOLL_MB7_8BYTES(a,b) my_strcoll_ascii_toupper_8bytes((a),(b))
+#endif /* Architecture test */
+#endif /* STRCOLL_MB7_TOUPPER */
+
+
+/*
+ A helper macro to shift two pointers forward, to the given amount.
+*/
+#define MY_STRING_SHIFT_PTR_PTR(a,b,len) do { a+= len; b+= len; } while(0)
+
+
+/*
Weight of an illegal byte, must follow these rules:
1. Must be greater than weight of any normal character in the collation.
2. Two different bad bytes must have different weights and must be
@@ -182,7 +220,31 @@ MY_FUNCTION_NAME(strnncoll)(CHARSET_INFO *cs __attribute__((unused)),
{
int a_weight, b_weight, res;
uint a_wlen= MY_FUNCTION_NAME(scan_weight)(&a_weight, a, a_end);
- uint b_wlen= MY_FUNCTION_NAME(scan_weight)(&b_weight, b, b_end);
+ uint b_wlen;
+
+#ifdef MY_STRCOLL_MB7_4BYTES
+ if (a_wlen == 1 && my_strcoll_ascii_4bytes_found(a, a_end, b, b_end))
+ {
+ int res;
+#ifdef MY_STRCOLL_MB7_8BYTES
+ /*TODO: a a loop here >='a' <='z' here, for automatic vectorization*/
+ if (my_strcoll_ascii_4bytes_found(a + 4, a_end, b + 4, b_end))
+ {
+ if ((res= MY_STRCOLL_MB7_8BYTES(a, b)))
+ return res;
+ MY_STRING_SHIFT_PTR_PTR(a, b, 8);
+ continue;
+ }
+#endif
+ if ((res= MY_STRCOLL_MB7_4BYTES(a, b)))
+ return res;
+ MY_STRING_SHIFT_PTR_PTR(a, b, 4);
+ continue;
+ }
+#endif /* MY_STRCOLL_MB7_4BYTES */
+
+ b_wlen= MY_FUNCTION_NAME(scan_weight)(&b_weight, b, b_end);
+
/*
a_wlen b_wlen Comment
------ ------ -------
@@ -253,7 +315,30 @@ MY_FUNCTION_NAME(strnncollsp)(CHARSET_INFO *cs __attribute__((unused)),
{
int a_weight, b_weight, res;
uint a_wlen= MY_FUNCTION_NAME(scan_weight)(&a_weight, a, a_end);
- uint b_wlen= MY_FUNCTION_NAME(scan_weight)(&b_weight, b, b_end);
+ uint b_wlen;
+
+#ifdef MY_STRCOLL_MB7_4BYTES
+ if (a_wlen == 1 && my_strcoll_ascii_4bytes_found(a, a_end, b, b_end))
+ {
+ int res;
+#ifdef MY_STRCOLL_MB7_8BYTES
+ if (my_strcoll_ascii_4bytes_found(a + 4, a_end, b + 4, b_end))
+ {
+ if ((res= MY_STRCOLL_MB7_8BYTES(a, b)))
+ return res;
+ MY_STRING_SHIFT_PTR_PTR(a, b, 8);
+ continue;
+ }
+#endif
+ if ((res= MY_STRCOLL_MB7_4BYTES(a, b)))
+ return res;
+ MY_STRING_SHIFT_PTR_PTR(a, b, 4);
+ continue;
+ }
+#endif /* MY_STRCOLL_MB7_4BYTES */
+
+ b_wlen= MY_FUNCTION_NAME(scan_weight)(&b_weight, b, b_end);
+
if ((res= (a_weight - b_weight)))
{
/*
@@ -286,7 +371,7 @@ MY_FUNCTION_NAME(strnncollsp)(CHARSET_INFO *cs __attribute__((unused)),
DBUG_ASSERT(0);
return 0;
}
-#endif
+#endif /* DEFINE_STRNNCOLLSP_NOPAD */
/**
@@ -652,3 +737,8 @@ MY_FUNCTION_NAME(strnxfrm_nopad)(CHARSET_INFO *cs,
#undef DEFINE_STRNXFRM_UNICODE_BIN2
#undef DEFINE_STRNNCOLL
#undef DEFINE_STRNNCOLLSP_NOPAD
+
+#undef STRCOLL_MB7_TOUPPER
+#undef STRCOLL_MB7_BIN
+#undef MY_STRCOLL_MB7_4BYTES
+#undef MY_STRCOLL_MB7_8BYTES
diff --git a/support-files/rpm/server.cnf b/support-files/rpm/server.cnf
index 589a185fb3d..9b384c9c6ee 100644
--- a/support-files/rpm/server.cnf
+++ b/support-files/rpm/server.cnf
@@ -39,8 +39,8 @@
# you can put MariaDB-only options here
[mariadb]
-# This group is only read by MariaDB-10.6 servers.
+# This group is only read by MariaDB-10.7 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
-[mariadb-10.6]
+[mariadb-10.7]
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index f89ad33c2ff..0f32477bcf8 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -21614,6 +21614,95 @@ static void test_cache_metadata()
mysql_stmt_close(stmt);
}
+void test_mdev_10075()
+{
+ MYSQL_STMT *stmt;
+ int rc;
+ MYSQL_RES *result;
+ MYSQL_BIND my_bind[1];
+ MYSQL_BIND my_bind2[1];
+
+ struct st_data {
+ unsigned long id;
+ char id_ind;
+ };
+
+ struct st_data data[]= {
+ {0, STMT_INDICATOR_NONE},
+ {1, STMT_INDICATOR_NONE},
+ {2, STMT_INDICATOR_NONE}
+ };
+
+ struct st_data data2[]= {
+ {3, STMT_INDICATOR_NONE},
+ {2, STMT_INDICATOR_NONE},
+ {4, STMT_INDICATOR_NONE}
+ };
+
+ myheader("test_mdev_10075");
+
+ rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
+ myquery(rc);
+
+ rc= mysql_query(mysql, "CREATE TABLE t1(id INT PRIMARY KEY)");
+ myquery(rc);
+
+ /* insert by prepare */
+ stmt= mysql_simple_prepare(mysql,
+ "INSERT INTO t1 VALUES(?)");
+ check_stmt(stmt);
+ verify_param_count(stmt, 1);
+
+ /* bzero bind structure */
+ bzero((char*) my_bind, sizeof(my_bind));
+ my_bind[0].buffer_type= MYSQL_TYPE_LONG;
+ my_bind[0].buffer= (void *)&data[0].id;
+
+ rc= mysql_stmt_bind_param(stmt, my_bind);
+ check_execute(stmt, rc);
+
+ /* Set array size, row size and bind the parameter */
+ mysql_stmt_bind_param(stmt, my_bind);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ mysql_stmt_close(stmt);
+
+ stmt= mysql_simple_prepare(mysql,
+ "INSERT IGNORE INTO t1 VALUES(?)");
+ check_stmt(stmt);
+ verify_param_count(stmt, 1);
+
+ /* bzero bind structure */
+ bzero((char*) my_bind2, sizeof(my_bind2));
+ my_bind2[0].buffer_type= MYSQL_TYPE_LONG;
+ my_bind2[0].buffer= (void *)&data2[0].id;
+
+ rc= mysql_stmt_bind_param(stmt, my_bind2);
+ check_execute(stmt, rc);
+
+ mysql_stmt_bind_param(stmt, my_bind2);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ mysql_stmt_close(stmt);
+
+ rc= mysql_query(mysql, "GET DIAGNOSTICS CONDITION 1 @var1 = ROW_NUMBER");
+ myquery(rc);
+
+ rc= mysql_query(mysql, "SELECT @var1");
+ myquery(rc);
+
+ result= mysql_store_result(mysql);
+ mytest(result);
+
+ rc= my_process_result_set(result);
+ DIE_UNLESS(rc == 1);
+
+ mysql_free_result(result);
+}
static struct my_tests_st my_tests[]= {
{ "test_mdev_20516", test_mdev_20516 },
@@ -21920,6 +22009,7 @@ static struct my_tests_st my_tests[]= {
{ "test_mdev20261", test_mdev20261 },
{ "test_execute_direct", test_execute_direct },
{ "test_cache_metadata", test_cache_metadata},
+ { "test_mdev_10075", test_mdev_10075},
{ 0, 0 }
};
diff --git a/tpool/CMakeLists.txt b/tpool/CMakeLists.txt
index 3a49ea22837..115e3d58634 100644
--- a/tpool/CMakeLists.txt
+++ b/tpool/CMakeLists.txt
@@ -15,11 +15,11 @@ ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
SET(TPOOL_DEFINES "-DHAVE_URING" PARENT_SCOPE)
ADD_DEFINITIONS(-DHAVE_URING)
LINK_LIBRARIES(${URING_LIBRARIES})
- INCLUDE_DIRECTORIES(${URING_INCLUDE_DIR})
+ INCLUDE_DIRECTORIES(${URING_INCLUDE_DIRS})
SET(EXTRA_SOURCES aio_liburing.cc)
SET(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
SET(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
- SET(CMAKE_REQUIRED_INCLUDES ${URING_INCLUDE_DIR})
+ SET(CMAKE_REQUIRED_INCLUDES ${URING_INCLUDE_DIRS})
SET(CMAKE_REQUIRED_LIBRARIES ${URING_LIBRARIES})
CHECK_SYMBOL_EXISTS(io_uring_mlock_size "liburing.h" HAVE_IO_URING_MLOCK_SIZE)
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
@@ -32,7 +32,7 @@ ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
IF(LIBAIO_FOUND)
SET(TPOOL_DEFINES "-DLINUX_NATIVE_AIO" PARENT_SCOPE)
ADD_DEFINITIONS(-DLINUX_NATIVE_AIO)
- INCLUDE_DIRECTORIES(${LIBAIO_INCLUDE_DIR})
+ INCLUDE_DIRECTORIES(${LIBAIO_INCLUDE_DIRS})
LINK_LIBRARIES(${LIBAIO_LIBRARIES})
SET(EXTRA_SOURCES aio_linux.cc)
ENDIF()
diff --git a/unittest/json_lib/CMakeLists.txt b/unittest/json_lib/CMakeLists.txt
index 1b2a89b28cd..157f37291e9 100644
--- a/unittest/json_lib/CMakeLists.txt
+++ b/unittest/json_lib/CMakeLists.txt
@@ -19,4 +19,4 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/unittest/mytap)
#
-MY_ADD_TESTS(json_lib LINK_LIBRARIES strings dbug)
+MY_ADD_TESTS(json_lib json_normalize LINK_LIBRARIES strings dbug)
diff --git a/unittest/json_lib/json_normalize-t.c b/unittest/json_lib/json_normalize-t.c
new file mode 100644
index 00000000000..f72e90175e2
--- /dev/null
+++ b/unittest/json_lib/json_normalize-t.c
@@ -0,0 +1,280 @@
+/* Copyright (c) 2021 Eric Herman and MariaDB Foundation.
+
+ 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.
+
+ 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.
+
+ 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 */
+
+#include "my_config.h"
+#include "config.h"
+#include <tap.h>
+#include <my_global.h>
+#include <json_lib.h>
+
+
+static void
+check_json_normalize(const char *in, const char *expected)
+{
+ int err;
+ DYNAMIC_STRING result;
+
+ CHARSET_INFO *cs= &my_charset_utf8mb4_general_ci;
+
+ init_dynamic_string(&result, NULL, 0, 0);
+
+ err= json_normalize(&result, in, strlen(in), cs);
+
+ ok(err == 0, "normalize err?");
+
+ ok(strcmp(expected, result.str) == 0,
+ "expected '%s' from '%s' but was '%s'",
+ expected, in, result.str);
+
+ dynstr_free(&result);
+}
+
+
+static void
+test_json_normalize_invalid(void)
+{
+ DYNAMIC_STRING result;
+
+ CHARSET_INFO *cs= &my_charset_utf8mb4_general_ci;
+
+ init_dynamic_string(&result, NULL, 0, 0);
+ ok(json_normalize(&result, STRING_WITH_LEN(""), cs) != 0,
+ "expected normalized error");
+ dynstr_free(&result);
+
+ init_dynamic_string(&result, NULL, 0, 0);
+ ok(json_normalize(&result, STRING_WITH_LEN("["), cs) != 0,
+ "expected normalized error");
+ dynstr_free(&result);
+
+ init_dynamic_string(&result, NULL, 0, 0);
+ ok(json_normalize(&result, STRING_WITH_LEN("}"), cs) != 0,
+ "expected normalized error");
+ dynstr_free(&result);
+
+ init_dynamic_string(&result, NULL, 0, 0);
+ ok(json_normalize(&result, NULL, 0, cs) != 0,
+ "expected normalized error");
+ dynstr_free(&result);
+}
+
+
+static void
+test_json_normalize_single_kv(void)
+{
+ const char *in= ""
+ "{\n"
+ " \"foo\": \"value\"\n"
+ "}\n";
+
+ const char *expected= "{\"foo\":\"value\"}";
+ check_json_normalize(in, expected);
+}
+
+
+static void
+test_json_normalize_multi_kv(void)
+{
+ const char *in= ""
+ "{\n"
+ " \"bar\": \"baz\",\n"
+ " \"foo\": \"value\"\n"
+ "}\n";
+
+ const char *expected= "{\"bar\":\"baz\",\"foo\":\"value\"}";
+ check_json_normalize(in, expected);
+}
+
+
+static void
+test_json_normalize_array(void)
+{
+ const char *in= "[ \"a\", \"b\", true, false, null ]";
+ const char *expected= "[\"a\",\"b\",true,false,null]";
+ check_json_normalize(in, expected);
+}
+
+
+static void
+test_json_normalize_values(void)
+{
+ check_json_normalize("\"foo\"", "\"foo\"");
+ check_json_normalize("true", "true");
+ check_json_normalize("false", "false");
+ check_json_normalize("null", "null");
+ check_json_normalize("\"\"", "\"\"");
+ check_json_normalize("{}", "{}");
+ check_json_normalize("[]", "[]");
+ check_json_normalize("5", "5.0E0");
+ check_json_normalize("5.1", "5.1E0");
+ check_json_normalize("-5.1", "-5.1E0");
+ check_json_normalize("12345.67890", "1.23456789E4");
+ check_json_normalize("2.99792458e8", "2.99792458E8");
+ check_json_normalize("6.02214076e23", "6.02214076E23");
+ check_json_normalize("6.62607015e-34", "6.62607015E-34");
+ check_json_normalize("-6.62607015e-34", "-6.62607015E-34");
+}
+
+
+static void
+test_json_normalize_nested_objects(void)
+{
+ const char *in = ""
+ "{\n"
+ " \"wiz\": {\n"
+ "\t\t\"bang\": \"a\",\n\t\t\"alpha\": false\n\t},\n"
+ " \"foo\": {\"value\":true}\n"
+ "}";
+
+ const char *expected= "{\"foo\":{\"value\":true},"
+ "\"wiz\":{\"alpha\":false,\"bang\":\"a\"}}";
+ check_json_normalize(in, expected);
+}
+
+
+static void
+test_json_normalize_nested_arrays(void)
+{
+ const char *in = ""
+ "[\n"
+ " \"wiz\",\n"
+ " [\"bang\", \t\t\"alpha\"\t]\n"
+ "]";
+
+ const char *expected= "[\"wiz\",[\"bang\",\"alpha\"]]";
+ check_json_normalize(in, expected);
+}
+
+
+static void
+test_json_normalize_nested_deep(void)
+{
+ const char *in = ""
+ "{\n"
+ " \"foo\": \"value\",\n"
+ " \"wiz\": [true, false, {\n"
+ "\t\t\"bang\": \"a\",\n\t\t\"alpha\": 12345.67890\n\t},\n \"string\",\n"
+ "\t{ \"b\": \"one\", \"a\": \"two\", \"c\": \"three\"}, false,\n"
+ "\t\t[-1.20, \"w\", \"x\"]],\n"
+ " \"bar\": \"value2\"\n"
+ "}\n";
+
+ const char *expected= ""
+ "{"
+ "\"bar\":\"value2\","
+ "\"foo\":\"value\","
+ "\"wiz\":["
+ "true,false,"
+ "{\"alpha\":1.23456789E4,\"bang\":\"a\"},"
+ "\"string\","
+ "{\"a\":\"two\",\"b\":\"one\",\"c\":\"three\"},"
+ "false,"
+ "[-1.2E0,\"w\",\"x\"]"
+ "]"
+ "}";
+ check_json_normalize(in, expected);
+}
+
+
+/* a "friend" function */
+int
+json_normalize_number(DYNAMIC_STRING *out, const char *str, size_t str_len);
+
+
+static void
+test_json_normalize_non_utf8(void)
+{
+ int err;
+ const char utf8[]= { 0x22, 0xC3, 0x8A, 0x22, 0x00 };
+ const char latin[] = { 0x22, 0xCA, 0x22, 0x00 };
+ DYNAMIC_STRING result;
+ CHARSET_INFO *cs_utf8= &my_charset_utf8mb4_bin;
+ CHARSET_INFO *cs_latin= &my_charset_latin1;
+
+ init_dynamic_string(&result, NULL, 0, 0);
+ err= json_normalize(&result, utf8, strlen(utf8), cs_utf8);
+ ok(err == 0, "normalize err?");
+ ok((strcmp(utf8, result.str) == 0), "utf8 round trip");
+ dynstr_free(&result);
+
+ init_dynamic_string(&result, NULL, 0, 0);
+ err= json_normalize(&result, latin, strlen(latin), cs_latin);
+ ok(err == 0, "normalize err?");
+ ok((strcmp(utf8, result.str) == 0), "latin to utf8 round trip");
+ dynstr_free(&result);
+}
+
+
+void
+check_number_normalize(const char *in, const char *expected)
+{
+ int err;
+ DYNAMIC_STRING buf;
+
+ init_dynamic_string(&buf, NULL, 0, 0);
+
+ err= json_normalize_number(&buf, in, strlen(in));
+ ok(err == 0, "normalize number err?");
+
+ ok(strcmp(buf.str, expected) == 0,
+ "expected: %s\n"
+ " but was: %s\n"
+ " from: %s\n",
+ expected,
+ buf.str,
+ in);
+
+ dynstr_free(&buf);
+}
+
+
+int
+main(void)
+{
+ plan(88);
+ diag("Testing json_normalization.");
+
+ check_number_normalize("0", "0.0E0");
+ check_number_normalize("-0.0", "0.0E0");
+ check_number_normalize("0E100", "0.0E0");
+ check_number_normalize("0.000000E100", "0.0E0");
+ check_number_normalize("-0E100", "0.0E0");
+ check_number_normalize("-0.000E100", "0.0E0");
+ check_number_normalize("1", "1.0E0");
+ check_number_normalize("-1", "-1.0E0");
+ check_number_normalize("36", "3.6E1");
+ check_number_normalize("37.000", "3.7E1");
+ check_number_normalize("3.000", "3.0E0");
+ check_number_normalize("0.00012345", "1.2345E-4");
+ check_number_normalize("32.14e234", "3.214E235");
+ check_number_normalize("0.00357e-23", "3.57E-26");
+ check_number_normalize("0.00357e23", "3.57E20");
+ check_number_normalize("123.456e10", "1.23456E12");
+ check_number_normalize("123.456e-9", "1.23456E-7");
+ check_number_normalize("0000123.456000000e-9", "1.23456E-7");
+ check_number_normalize("0000123.456000000e+9", "1.23456E11");
+
+ test_json_normalize_invalid();
+ test_json_normalize_values();
+ test_json_normalize_single_kv();
+ test_json_normalize_multi_kv();
+ test_json_normalize_array();
+ test_json_normalize_nested_objects();
+ test_json_normalize_nested_arrays();
+ test_json_normalize_nested_deep();
+ test_json_normalize_non_utf8();
+
+ return exit_status();
+}
diff --git a/unittest/mysys/bitmap-t.c b/unittest/mysys/bitmap-t.c
index e8f41b32d2c..22466355191 100644
--- a/unittest/mysys/bitmap-t.c
+++ b/unittest/mysys/bitmap-t.c
@@ -129,8 +129,8 @@ my_bool test_compare_operators(MY_BITMAP *map, uint bitsize)
MY_BITMAP *map2= &map2_obj, *map3= &map3_obj;
my_bitmap_map map2buf[MAX_TESTED_BITMAP_SIZE];
my_bitmap_map map3buf[MAX_TESTED_BITMAP_SIZE];
- my_bitmap_init(&map2_obj, map2buf, bitsize, FALSE);
- my_bitmap_init(&map3_obj, map3buf, bitsize, FALSE);
+ my_bitmap_init(&map2_obj, map2buf, bitsize);
+ my_bitmap_init(&map3_obj, map3buf, bitsize);
bitmap_clear_all(map2);
bitmap_clear_all(map3);
for (i=0; i < no_loops; i++)
@@ -374,7 +374,7 @@ my_bool test_compare(MY_BITMAP *map, uint bitsize)
uint32 map2buf[MAX_TESTED_BITMAP_SIZE];
uint i, test_bit;
uint no_loops= bitsize > 128 ? 128 : bitsize;
- if (my_bitmap_init(&map2, map2buf, bitsize, FALSE))
+ if (my_bitmap_init(&map2, map2buf, bitsize))
{
diag("init error for bitsize %d", bitsize);
return TRUE;
@@ -433,7 +433,7 @@ my_bool test_intersect(MY_BITMAP *map, uint bitsize)
MY_BITMAP map2;
uint32 map2buf[MAX_TESTED_BITMAP_SIZE];
uint i, test_bit1, test_bit2, test_bit3;
- if (my_bitmap_init(&map2, map2buf, bitsize2, FALSE))
+ if (my_bitmap_init(&map2, map2buf, bitsize2))
{
diag("init error for bitsize %d", bitsize2);
return TRUE;
@@ -481,7 +481,7 @@ my_bool do_test(uint bitsize)
{
MY_BITMAP map;
my_bitmap_map buf[MAX_TESTED_BITMAP_SIZE];
- if (my_bitmap_init(&map, buf, bitsize, FALSE))
+ if (my_bitmap_init(&map, buf, bitsize))
{
diag("init error for bitsize %d", bitsize);
goto error;