summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2023-05-17 14:58:11 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2023-05-17 14:58:11 +0200
commit2543673dd22782f59299fd2e72179601892bd967 (patch)
treeb73641bd88c9d1572203c75da618fce1937518e8
parent4e5b771e980edfdad5c5414aa62c81d409d585a4 (diff)
parentef911553f442cbb1baaac2af44c38b54fd058c41 (diff)
downloadmariadb-git-bb-11.1-release.tar.gz
Merge branch '11.0' into 11.1bb-11.1-release
-rw-r--r--.github/pull_request_template.md52
-rw-r--r--.gitignore1
-rw-r--r--.gitlab-ci.yml67
-rw-r--r--.gitmodules6
-rwxr-xr-xBUILD/SETUP.sh5
-rwxr-xr-xBUILD/compile-amd64-debug-all5
-rwxr-xr-xBUILD/compile-amd64-debug-max7
-rwxr-xr-xBUILD/compile-pentium64-debug-all2
-rwxr-xr-xBUILD/compile-pentium64-debug-max1
-rw-r--r--CODING_STANDARDS.md36
-rw-r--r--THIRDPARTY360
-rw-r--r--client/client_priv.h48
-rw-r--r--client/mysql.cc65
-rw-r--r--client/mysql_plugin.c110
-rw-r--r--client/mysql_upgrade.c17
-rw-r--r--client/mysqladmin.cc64
-rw-r--r--client/mysqlbinlog.cc84
-rw-r--r--client/mysqlcheck.c60
-rw-r--r--client/mysqldump.c105
-rw-r--r--client/mysqlimport.c58
-rw-r--r--client/mysqlshow.c59
-rw-r--r--client/mysqlslap.c65
-rw-r--r--client/mysqltest.cc27
-rwxr-xr-xdebian/autobake-deb.sh64
-rw-r--r--debian/control44
-rw-r--r--debian/libmariadb-dev.install2
-rw-r--r--debian/libmariadb-dev.lintian-overrides1
-rw-r--r--debian/mariadb-server.preinst16
-rwxr-xr-xdebian/rules18
-rw-r--r--debian/salsa-ci.yml351
-rw-r--r--extra/mariabackup/backup_copy.cc260
-rw-r--r--extra/mariabackup/backup_copy.h19
-rw-r--r--extra/mariabackup/backup_mysql.cc40
-rw-r--r--extra/mariabackup/backup_mysql.h15
-rw-r--r--extra/mariabackup/datasink.h29
-rw-r--r--extra/mariabackup/write_filt.cc14
-rw-r--r--extra/mariabackup/write_filt.h3
-rw-r--r--extra/mariabackup/xbcloud.cc2
-rw-r--r--extra/mariabackup/xtrabackup.cc272
-rw-r--r--extra/mariabackup/xtrabackup.h11
-rw-r--r--include/m_ctype.h50
-rw-r--r--include/m_string.h19
-rw-r--r--include/my_alloca.h6
-rw-r--r--include/my_base.h11
-rw-r--r--include/my_rdtsc.h53
-rw-r--r--include/mysql/psi/mysql_file.h2
-rw-r--r--include/mysql/psi/mysql_idle.h2
-rw-r--r--include/mysql/psi/mysql_mdl.h2
-rw-r--r--include/mysql/psi/mysql_memory.h2
-rw-r--r--include/mysql/psi/mysql_ps.h2
-rw-r--r--include/mysql/psi/mysql_socket.h2
-rw-r--r--include/mysql/psi/mysql_sp.h2
-rw-r--r--include/mysql/psi/mysql_stage.h2
-rw-r--r--include/mysql/psi/mysql_statement.h2
-rw-r--r--include/mysql/psi/mysql_table.h2
-rw-r--r--include/mysql/psi/mysql_thread.h2
-rw-r--r--include/mysql/psi/mysql_transaction.h2
-rw-r--r--include/mysql/psi/psi.h2
-rw-r--r--include/mysql/psi/psi_abi_v0.h2
-rw-r--r--include/mysql/psi/psi_abi_v1.h2
-rw-r--r--include/mysql/psi/psi_abi_v2.h2
-rw-r--r--include/mysql/psi/psi_base.h2
-rw-r--r--include/mysql/psi/psi_memory.h2
-rw-r--r--include/mysql/service_encryption.h2
-rw-r--r--include/ssl_compat.h3
m---------libmariadb0
-rw-r--r--libmysqld/lib_sql.cc2
-rw-r--r--libmysqld/libmysql.c10
-rw-r--r--man/mariadb-upgrade.13
-rw-r--r--mysql-test/include/analyze-format.inc2
-rw-r--r--mysql-test/include/ctype_casefolding.inc6
-rw-r--r--mysql-test/include/ctype_casefolding_supplementary.inc16
-rw-r--r--mysql-test/include/ctype_nopad_prefix_unique.inc85
-rw-r--r--mysql-test/include/expect_crash.inc4
-rw-r--r--mysql-test/include/explain_non_select.inc16
-rw-r--r--mysql-test/include/kill_galera.inc4
-rw-r--r--mysql-test/include/kill_mysqld.inc4
-rw-r--r--mysql-test/include/shutdown_mysqld.inc4
-rw-r--r--mysql-test/include/sql_mode_pad_char_to_full_length.inc31
-rw-r--r--mysql-test/lib/My/CoreDump.pm33
-rw-r--r--mysql-test/main/alter_table.result22
-rw-r--r--mysql-test/main/alter_table.test14
-rw-r--r--mysql-test/main/analyze_format_json.result177
-rw-r--r--mysql-test/main/analyze_format_json.test42
-rw-r--r--mysql-test/main/analyze_format_json_emb.result11
-rw-r--r--mysql-test/main/analyze_format_json_emb.test18
-rw-r--r--mysql-test/main/analyze_format_json_timings.result199
-rw-r--r--mysql-test/main/analyze_format_json_timings.test127
-rw-r--r--mysql-test/main/analyze_stmt_orderby.result10
-rw-r--r--mysql-test/main/bootstrap.result45
-rw-r--r--mysql-test/main/bootstrap.test108
-rw-r--r--mysql-test/main/cli_options_force_protocol_not_win.result20
-rw-r--r--mysql-test/main/cli_options_force_protocol_not_win.test34
-rw-r--r--mysql-test/main/cli_options_force_protocol_win.result25
-rw-r--r--mysql-test/main/cli_options_force_protocol_win.test38
-rw-r--r--mysql-test/main/ctype_ldml.result47
-rw-r--r--mysql-test/main/ctype_ldml.test7
-rw-r--r--mysql-test/main/ctype_uca_partitions.result40
-rw-r--r--mysql-test/main/ctype_uca_partitions.test32
-rw-r--r--mysql-test/main/ctype_ucs.result17
-rw-r--r--mysql-test/main/ctype_ucs.test12
-rw-r--r--mysql-test/main/ctype_ucs2_general_mysql500_ci_ws.result3
-rw-r--r--mysql-test/main/ctype_upgrade.result53
-rw-r--r--mysql-test/main/ctype_upgrade.test35
-rw-r--r--mysql-test/main/ctype_utf8_uca.result211
-rw-r--r--mysql-test/main/ctype_utf8_uca.test18
-rw-r--r--mysql-test/main/ctype_utf8mb4_uca.result165
-rw-r--r--mysql-test/main/ctype_utf8mb4_uca.test5
-rw-r--r--mysql-test/main/ctype_utf8mb4_uca1400_ai_ci_casefold.result2927
-rw-r--r--mysql-test/main/ctype_utf8mb4_uca1400_ai_ci_casefold.test15
-rw-r--r--mysql-test/main/derived.result63
-rw-r--r--mysql-test/main/derived.test54
-rw-r--r--mysql-test/main/derived_cond_pushdown.result97
-rw-r--r--mysql-test/main/derived_cond_pushdown.test30
-rw-r--r--mysql-test/main/derived_split_innodb.result585
-rw-r--r--mysql-test/main/derived_split_innodb.test247
-rw-r--r--mysql-test/main/derived_view.result550
-rw-r--r--mysql-test/main/derived_view.test359
-rw-r--r--mysql-test/main/disabled.def1
-rw-r--r--mysql-test/main/distinct.result51
-rw-r--r--mysql-test/main/distinct.test35
-rw-r--r--mysql-test/main/except.result20
-rw-r--r--mysql-test/main/except_all.result20
-rw-r--r--mysql-test/main/explain_innodb.result18
-rw-r--r--mysql-test/main/explain_innodb.test19
-rw-r--r--mysql-test/main/explain_json.result5
-rw-r--r--mysql-test/main/explain_non_select.result4
-rw-r--r--mysql-test/main/flush_corruption.result (renamed from mysql-test/main/merge-big.result)0
-rw-r--r--mysql-test/main/flush_corruption.test (renamed from mysql-test/main/merge-big.test)2
-rw-r--r--mysql-test/main/func_group.result9
-rw-r--r--mysql-test/main/func_group.test11
-rw-r--r--mysql-test/main/func_json.result20
-rw-r--r--mysql-test/main/func_json.test22
-rw-r--r--mysql-test/main/func_str.result9
-rw-r--r--mysql-test/main/func_str.test10
-rw-r--r--mysql-test/main/grant5.result9
-rw-r--r--mysql-test/main/grant5.test12
-rw-r--r--mysql-test/main/group_by.result10
-rw-r--r--mysql-test/main/group_by.test23
-rw-r--r--mysql-test/main/group_min_max.result12
-rw-r--r--mysql-test/main/group_min_max.test11
-rw-r--r--mysql-test/main/insert_innodb.result2
-rw-r--r--mysql-test/main/insert_innodb.test2
-rw-r--r--mysql-test/main/insert_returning.result10
-rw-r--r--mysql-test/main/insert_update.result42
-rw-r--r--mysql-test/main/insert_update.test27
-rw-r--r--mysql-test/main/intersect.result10
-rw-r--r--mysql-test/main/intersect_all.result10
-rw-r--r--mysql-test/main/join_cache.result24
-rw-r--r--mysql-test/main/join_cache_cardinality.result105
-rw-r--r--mysql-test/main/join_cache_cardinality.test41
-rw-r--r--mysql-test/main/join_nested_jcl6.result68
-rw-r--r--mysql-test/main/join_outer_jcl6.result22
-rw-r--r--mysql-test/main/kill-2.result31
-rw-r--r--mysql-test/main/kill-2.test27
-rw-r--r--mysql-test/main/locale.result52
-rw-r--r--mysql-test/main/locale.test40
-rw-r--r--mysql-test/main/long_unique_bugs.result6
-rw-r--r--mysql-test/main/long_unique_bugs.test7
-rw-r--r--mysql-test/main/myisam_explain_non_select_all.result193
-rw-r--r--mysql-test/main/mysql_tzinfo_to_sql_symlink.result42
-rw-r--r--mysql-test/main/mysqlbinlog.test2
-rw-r--r--mysql-test/main/mysqld--help,win.rdiff12
-rw-r--r--mysql-test/main/mysqld--help.result8
-rw-r--r--mysql-test/main/mysqltest_tracking_info.result2
-rw-r--r--mysql-test/main/name_resolution_cache_debug.result25
-rw-r--r--mysql-test/main/name_resolution_cache_debug.test36
-rw-r--r--mysql-test/main/old-mode.result36
-rw-r--r--mysql-test/main/old-mode.test20
-rw-r--r--mysql-test/main/opt_trace.result682
-rw-r--r--mysql-test/main/opt_trace.test102
-rw-r--r--mysql-test/main/parser.result28
-rw-r--r--mysql-test/main/parser.test17
-rw-r--r--mysql-test/main/partition.result38
-rw-r--r--mysql-test/main/partition.test39
-rw-r--r--mysql-test/main/ps.result4
-rw-r--r--mysql-test/main/rowid_filter_innodb.result10
-rw-r--r--mysql-test/main/rownum.result33
-rw-r--r--mysql-test/main/rownum.test42
-rw-r--r--mysql-test/main/selectivity.result6
-rw-r--r--mysql-test/main/selectivity.test7
-rw-r--r--mysql-test/main/selectivity_innodb.result6
-rw-r--r--mysql-test/main/selectivity_innodb_notembedded.result104
-rw-r--r--mysql-test/main/selectivity_innodb_notembedded.test16
-rw-r--r--mysql-test/main/selectivity_no_engine.result29
-rw-r--r--mysql-test/main/selectivity_no_engine.test21
-rw-r--r--mysql-test/main/selectivity_notembedded.result95
-rw-r--r--mysql-test/main/selectivity_notembedded.test121
-rw-r--r--mysql-test/main/shutdown.test4
-rw-r--r--mysql-test/main/skr.result54
-rw-r--r--mysql-test/main/skr.test56
-rw-r--r--mysql-test/main/sql_mode_pad_char_to_full_length.result94
-rw-r--r--mysql-test/main/sql_mode_pad_char_to_full_length.test19
-rw-r--r--mysql-test/main/status.result19
-rw-r--r--mysql-test/main/status.test40
-rw-r--r--mysql-test/main/subselect.result262
-rw-r--r--mysql-test/main/subselect.test215
-rw-r--r--mysql-test/main/subselect3_jcl6.result8
-rw-r--r--mysql-test/main/subselect4.result4
-rw-r--r--mysql-test/main/subselect_no_exists_to_in.result262
-rw-r--r--mysql-test/main/subselect_no_mat.result262
-rw-r--r--mysql-test/main/subselect_no_opts.result262
-rw-r--r--mysql-test/main/subselect_no_scache.result262
-rw-r--r--mysql-test/main/subselect_no_semijoin.result262
-rw-r--r--mysql-test/main/subselect_sj.test6
-rw-r--r--mysql-test/main/subselect_sj2.result2
-rw-r--r--mysql-test/main/subselect_sj2.test3
-rw-r--r--mysql-test/main/subselect_sj2_jcl6.result23
-rw-r--r--mysql-test/main/subselect_sj2_mat.result22
-rw-r--r--mysql-test/main/subselect_sj_jcl6.result4
-rw-r--r--mysql-test/main/system_mysql_db_fix50030.result4
-rw-r--r--mysql-test/main/system_mysql_db_fix50117.result4
-rw-r--r--mysql-test/main/system_mysql_db_fix50568.result297
-rw-r--r--mysql-test/main/system_mysql_db_fix50568.test99
-rw-r--r--mysql-test/main/table_value_constr.result119
-rw-r--r--mysql-test/main/table_value_constr.test74
-rw-r--r--mysql-test/main/type_datetime.result4
-rw-r--r--mysql-test/main/type_time.result26
-rw-r--r--mysql-test/main/type_time.test19
-rw-r--r--mysql-test/main/update.result29
-rw-r--r--mysql-test/main/update.test23
-rw-r--r--mysql-test/main/view.result18
-rw-r--r--mysql-test/main/view.test19
-rwxr-xr-xmysql-test/mariadb-test-run.pl34
-rw-r--r--mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYDbin0 -> 60 bytes
-rw-r--r--mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYIbin0 -> 2048 bytes
-rw-r--r--mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.frmbin0 -> 982 bytes
-rw-r--r--mysql-test/std_data/rpl/master-bin-seq_10.3.36.000001bin0 -> 1245 bytes
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result4
-rw-r--r--mysql-test/suite/binlog/r/flashback.result4
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_raw_flush.test9
-rw-r--r--mysql-test/suite/binlog/t/binlog_truncate_multi_engine.inc8
-rw-r--r--mysql-test/suite/binlog/t/flashback.test8
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.cnf (renamed from mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.cnf)0
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.result (renamed from mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.result)1
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.test (renamed from mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.test)30
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.cnf8
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result84
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test154
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_binlog_errors.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_checksum.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_checksum_cache.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_corruption.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_gtid_basic.result24
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_gtid_basic.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_incident.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_loaddata_local.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_loadfile.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_packet.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_relayrotate.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_semi_sync.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_skip_replication.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_special_charset.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_sporadic_master.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_ssl.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_sync.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_typeconv.test2
-rw-r--r--mysql-test/suite/encryption/r/import_4k.result10
-rw-r--r--mysql-test/suite/encryption/t/import_4k.opt1
-rw-r--r--mysql-test/suite/encryption/t/import_4k.test20
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test2
-rw-r--r--mysql-test/suite/events/disabled.def12
-rw-r--r--mysql-test/suite/events/events_1.result (renamed from mysql-test/main/events_1.result)0
-rw-r--r--mysql-test/suite/events/events_1.test (renamed from mysql-test/main/events_1.test)0
-rw-r--r--mysql-test/suite/events/events_2.result (renamed from mysql-test/main/events_2.result)0
-rw-r--r--mysql-test/suite/events/events_2.test (renamed from mysql-test/main/events_2.test)0
-rw-r--r--mysql-test/suite/events/events_bugs-master.opt (renamed from mysql-test/main/events_bugs-master.opt)0
-rw-r--r--mysql-test/suite/events/events_bugs.result (renamed from mysql-test/main/events_bugs.result)0
-rw-r--r--mysql-test/suite/events/events_bugs.test (renamed from mysql-test/main/events_bugs.test)0
-rw-r--r--mysql-test/suite/events/events_embedded.result (renamed from mysql-test/main/events_embedded.result)0
-rw-r--r--mysql-test/suite/events/events_embedded.test (renamed from mysql-test/main/events_embedded.test)0
-rw-r--r--mysql-test/suite/events/events_grant.result (renamed from mysql-test/main/events_grant.result)0
-rw-r--r--mysql-test/suite/events/events_grant.test (renamed from mysql-test/main/events_grant.test)0
-rw-r--r--mysql-test/suite/events/events_logs_tests-master.opt (renamed from mysql-test/main/events_logs_tests-master.opt)0
-rw-r--r--mysql-test/suite/events/events_logs_tests.result (renamed from mysql-test/main/events_logs_tests.result)0
-rw-r--r--mysql-test/suite/events/events_logs_tests.test (renamed from mysql-test/main/events_logs_tests.test)0
-rw-r--r--mysql-test/suite/events/events_microsec.result (renamed from mysql-test/main/events_microsec.result)0
-rw-r--r--mysql-test/suite/events/events_microsec.test (renamed from mysql-test/main/events_microsec.test)0
-rw-r--r--mysql-test/suite/events/events_restart-master.opt (renamed from mysql-test/main/events_restart-master.opt)0
-rw-r--r--mysql-test/suite/events/events_restart.result (renamed from mysql-test/main/events_restart.result)0
-rw-r--r--mysql-test/suite/events/events_restart.test (renamed from mysql-test/main/events_restart.test)0
-rw-r--r--mysql-test/suite/events/events_scheduling.result (renamed from mysql-test/main/events_scheduling.result)0
-rw-r--r--mysql-test/suite/events/events_scheduling.test (renamed from mysql-test/main/events_scheduling.test)0
-rw-r--r--mysql-test/suite/events/events_slowlog.result (renamed from mysql-test/main/events_slowlog.result)0
-rw-r--r--mysql-test/suite/events/events_slowlog.test (renamed from mysql-test/main/events_slowlog.test)0
-rw-r--r--mysql-test/suite/events/events_stress.result (renamed from mysql-test/main/events_stress.result)0
-rw-r--r--mysql-test/suite/events/events_stress.test (renamed from mysql-test/main/events_stress.test)0
-rw-r--r--mysql-test/suite/events/events_time_zone.result (renamed from mysql-test/main/events_time_zone.result)0
-rw-r--r--mysql-test/suite/events/events_time_zone.test (renamed from mysql-test/main/events_time_zone.test)0
-rw-r--r--mysql-test/suite/events/events_trans.result (renamed from mysql-test/main/events_trans.result)0
-rw-r--r--mysql-test/suite/events/events_trans.test (renamed from mysql-test/main/events_trans.test)0
-rw-r--r--mysql-test/suite/events/events_trans_notembedded.result (renamed from mysql-test/main/events_trans_notembedded.result)0
-rw-r--r--mysql-test/suite/events/events_trans_notembedded.test (renamed from mysql-test/main/events_trans_notembedded.test)0
-rw-r--r--mysql-test/suite/galera/galera_2x2nodes.cnf77
-rw-r--r--mysql-test/suite/galera/include/kill_galera.inc4
-rw-r--r--mysql-test/suite/galera/include/shutdown_mysqld.inc4
-rw-r--r--mysql-test/suite/galera/r/MDEV-30804.result11
-rw-r--r--mysql-test/suite/galera/r/MDEV-30955.result26
-rw-r--r--mysql-test/suite/galera/r/galera_query_cache_invalidate.result119
-rw-r--r--mysql-test/suite/galera/r/galera_sequences.result61
-rw-r--r--mysql-test/suite/galera/r/galera_var_replicate_aria_on.result5
-rw-r--r--mysql-test/suite/galera/r/galera_var_retry_autocommit.result12
-rw-r--r--mysql-test/suite/galera/r/mdev-26175.result24
-rw-r--r--mysql-test/suite/galera/t/MDEV-30804.cnf7
-rw-r--r--mysql-test/suite/galera/t/MDEV-30804.test21
-rw-r--r--mysql-test/suite/galera/t/MDEV-30955.test70
-rw-r--r--mysql-test/suite/galera/t/galera_ist_restart_joiner.test4
-rw-r--r--mysql-test/suite/galera/t/galera_query_cache_invalidate.cnf25
-rw-r--r--mysql-test/suite/galera/t/galera_query_cache_invalidate.test120
-rw-r--r--mysql-test/suite/galera/t/galera_sequences.cnf9
-rw-r--r--mysql-test/suite/galera/t/galera_sequences.test54
-rw-r--r--mysql-test/suite/galera/t/galera_var_replicate_aria_on.test8
-rw-r--r--mysql-test/suite/galera/t/galera_var_retry_autocommit.test19
-rw-r--r--mysql-test/suite/galera/t/mdev-26175.test27
-rw-r--r--mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf2
-rw-r--r--mysql-test/suite/galera_3nodes_sr/t/GCF-832.test4
-rw-r--r--mysql-test/suite/galera_sr/r/MDEV-30838.result15
-rw-r--r--mysql-test/suite/galera_sr/r/MDEV-30862.result11
-rw-r--r--mysql-test/suite/galera_sr/t/MDEV-30838.test18
-rw-r--r--mysql-test/suite/galera_sr/t/MDEV-30862.test24
-rw-r--r--mysql-test/suite/gcol/r/gcol_rollback.result21
-rw-r--r--mysql-test/suite/gcol/t/gcol_rollback.test23
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_alter.result20
-rw-r--r--mysql-test/suite/innodb/r/full_crc32_import.result11
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5522.result14
-rw-r--r--mysql-test/suite/innodb/r/innodb_buffer_pool_dump_pct.result3
-rw-r--r--mysql-test/suite/innodb/r/innodb_ctype_utf8.result98
-rw-r--r--mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_sys_var_valgrind.result21
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_crash.result24
-rw-r--r--mysql-test/suite/innodb/r/sql_mode_pad_char_to_full_length.result51
-rw-r--r--mysql-test/suite/innodb/t/alter_crash.test4
-rw-r--r--mysql-test/suite/innodb/t/default_row_format_alter.test17
-rw-r--r--mysql-test/suite/innodb/t/full_crc32_import.test10
-rw-r--r--mysql-test/suite/innodb/t/import_tablespace_race.test8
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-tempfile.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-wl5522-debug.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-wl5522.test21
-rw-r--r--mysql-test/suite/innodb/t/innodb_buffer_pool_dump_pct.test10
-rw-r--r--mysql-test/suite/innodb/t/innodb_ctype_utf8.test12
-rw-r--r--mysql-test/suite/innodb/t/innodb_sys_var_valgrind.test18
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_crash.test26
-rw-r--r--mysql-test/suite/innodb/t/purge_thread_shutdown.test4
-rw-r--r--mysql-test/suite/innodb/t/restart.test25
-rw-r--r--mysql-test/suite/innodb/t/sql_mode_pad_char_to_full_length.test18
-rw-r--r--mysql-test/suite/innodb/t/temporary_table.test4
-rw-r--r--mysql-test/suite/innodb_fts/r/concurrent_insert.result2
-rw-r--r--mysql-test/suite/innodb_fts/r/sync.result16
-rw-r--r--mysql-test/suite/innodb_fts/r/sync_block.result83
-rw-r--r--mysql-test/suite/innodb_fts/t/concurrent_insert.test2
-rw-r--r--mysql-test/suite/innodb_fts/t/sync.test7
-rw-r--r--mysql-test/suite/innodb_fts/t/sync_block.test124
-rw-r--r--mysql-test/suite/innodb_gis/r/rtree_optimize.result44
-rw-r--r--mysql-test/suite/innodb_gis/t/rtree_optimize.test44
-rw-r--r--mysql-test/suite/innodb_i_s/innodb_sys_indexes.result4
-rw-r--r--mysql-test/suite/maria/aria_log_dir_path.result29
-rw-r--r--mysql-test/suite/maria/aria_log_dir_path.test65
-rw-r--r--mysql-test/suite/maria/maria3.result1
-rw-r--r--mysql-test/suite/mariabackup/aria_log_dir_path.result41
-rw-r--r--mysql-test/suite/mariabackup/aria_log_dir_path.test105
-rw-r--r--mysql-test/suite/mariabackup/aria_log_dir_path_rel.result41
-rw-r--r--mysql-test/suite/mariabackup/aria_log_dir_path_rel.test4
-rw-r--r--mysql-test/suite/mariabackup/include/restart_and_restore.inc2
-rw-r--r--mysql-test/suite/mariabackup/partial_exclude.result7
-rw-r--r--mysql-test/suite/mariabackup/partial_exclude.test20
-rw-r--r--mysql-test/suite/mariabackup/relative_path.opt1
-rw-r--r--mysql-test/suite/mariabackup/relative_path.result20
-rw-r--r--mysql-test/suite/mariabackup/relative_path.test35
-rw-r--r--mysql-test/suite/merge/alter_table.result22
-rw-r--r--mysql-test/suite/merge/alter_table.test12
-rw-r--r--mysql-test/suite/merge/merge.result (renamed from mysql-test/main/merge.result)14
-rw-r--r--mysql-test/suite/merge/merge.test (renamed from mysql-test/main/merge.test)10
-rw-r--r--mysql-test/suite/merge/merge_debug.result (renamed from mysql-test/main/merge_debug.result)0
-rw-r--r--mysql-test/suite/merge/merge_debug.test (renamed from mysql-test/main/merge_debug.test)0
-rw-r--r--mysql-test/suite/merge/merge_innodb.result (renamed from mysql-test/main/merge_innodb.result)0
-rw-r--r--mysql-test/suite/merge/merge_innodb.test (renamed from mysql-test/main/merge_innodb.test)0
-rw-r--r--mysql-test/suite/merge/merge_mmap-master.opt (renamed from mysql-test/main/merge_mmap-master.opt)0
-rw-r--r--mysql-test/suite/merge/merge_mmap.result (renamed from mysql-test/main/merge_mmap.result)0
-rw-r--r--mysql-test/suite/merge/merge_mmap.test (renamed from mysql-test/main/merge_mmap.test)0
-rw-r--r--mysql-test/suite/perfschema/r/digest_view.result50
-rw-r--r--mysql-test/suite/perfschema/r/events_waits_current_MDEV-29091.result41
-rw-r--r--mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result120
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result180
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result120
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result180
-rw-r--r--mysql-test/suite/perfschema/t/events_waits_current_MDEV-29091.test62
-rw-r--r--mysql-test/suite/period/r/overlaps.result98
-rw-r--r--mysql-test/suite/period/t/overlaps.test110
-rw-r--r--mysql-test/suite/plugins/r/feedback_plugin_install.result2
-rw-r--r--mysql-test/suite/plugins/r/feedback_plugin_load.result2
-rw-r--r--mysql-test/suite/plugins/r/feedback_plugin_send.result4
-rw-r--r--mysql-test/suite/plugins/r/locales.result4
-rw-r--r--mysql-test/suite/roles/role_grant_propagate.result13
-rw-r--r--mysql-test/suite/roles/role_grant_propagate.test11
-rw-r--r--mysql-test/suite/rpl/include/rpl_binlog_errors.inc443
-rw-r--r--mysql-test/suite/rpl/include/rpl_cant_read_event_incident.inc88
-rw-r--r--mysql-test/suite/rpl/include/rpl_checksum.inc342
-rw-r--r--mysql-test/suite/rpl/include/rpl_checksum_cache.inc261
-rw-r--r--mysql-test/suite/rpl/include/rpl_corruption.inc181
-rw-r--r--mysql-test/suite/rpl/include/rpl_gtid_basic.inc572
-rw-r--r--mysql-test/suite/rpl/include/rpl_incident.inc61
-rw-r--r--mysql-test/suite/rpl/include/rpl_init_slave_errors.inc96
-rw-r--r--mysql-test/suite/rpl/include/rpl_loadfile.inc120
-rw-r--r--mysql-test/suite/rpl/include/rpl_packet.inc184
-rw-r--r--mysql-test/suite/rpl/include/rpl_parallel_ignored_errors.inc115
-rw-r--r--mysql-test/suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc38
-rw-r--r--mysql-test/suite/rpl/include/rpl_relayrotate.inc18
-rw-r--r--mysql-test/suite/rpl/include/rpl_semi_sync.inc532
-rw-r--r--mysql-test/suite/rpl/include/rpl_skip_replication.inc408
-rw-r--r--mysql-test/suite/rpl/include/rpl_special_charset.inc32
-rw-r--r--mysql-test/suite/rpl/include/rpl_sporadic_master.inc32
-rw-r--r--mysql-test/suite/rpl/include/rpl_ssl.inc116
-rw-r--r--mysql-test/suite/rpl/include/rpl_stm_relay_ign_space.inc107
-rw-r--r--mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc633
-rw-r--r--mysql-test/suite/rpl/include/rpl_sync_test.inc159
-rw-r--r--mysql-test/suite/rpl/include/rpl_temporal_format_default_to_default.inc82
-rw-r--r--mysql-test/suite/rpl/include/rpl_typeconv.inc78
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_local.result (renamed from mysql-test/suite/rpl/r/rpl_loaddatalocal.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_optimistic_error_stop.result81
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_seq.result85
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_xa_prepare_gtid_fail.result51
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_errors.test444
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_index.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test89
-rw-r--r--mysql-test/suite/rpl/t/rpl_checksum.test343
-rw-r--r--mysql-test/suite/rpl/t/rpl_checksum_cache.test262
-rw-r--r--mysql-test/suite/rpl/t/rpl_corruption.test182
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_basic.test573
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_stop_start.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_incident.test62
-rw-r--r--mysql-test/suite/rpl/t/rpl_init_slave_errors.test97
-rw-r--r--mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_local.test (renamed from mysql-test/suite/rpl/include/rpl_loaddata_local.inc)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddatalocal.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loadfile.test121
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev12179.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev382.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet.test185
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_ignored_errors.test116
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_optimistic_error_stop.test180
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_seq.test131
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test39
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayrotate.test19
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync.test533
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_event.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_skip_replication.test409
-rw-r--r--mysql-test/suite/rpl/t/rpl_special_charset.test33
-rw-r--r--mysql-test/suite/rpl/t/rpl_sporadic_master.test33
-rw-r--r--mysql-test/suite/rpl/t/rpl_ssl.test117
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test108
-rw-r--r--mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test634
-rw-r--r--mysql-test/suite/rpl/t/rpl_sync.test159
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporal_format_default_to_default.test83
-rw-r--r--mysql-test/suite/rpl/t/rpl_typeconv.test79
-rw-r--r--mysql-test/suite/rpl/t/rpl_xa_prepare_gtid_fail.test106
-rw-r--r--mysql-test/suite/sys_vars/r/aria_log_dir_path_basic.result36
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_client_basic.result11
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_connection_basic.result16
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_results_basic.resultbin16427 -> 16895 bytes
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_server_basic.result16
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_switch_basic.result32
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_aria.result12
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb.result2
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded.result16
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result16
-rw-r--r--mysql-test/suite/sys_vars/t/all_vars.test2
-rw-r--r--mysql-test/suite/sys_vars/t/aria_log_dir_path_basic.test35
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_client_basic.test9
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_connection_basic.test13
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_results_basic.test12
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_server_basic.test12
-rw-r--r--mysql-test/suite/sys_vars/t/sysvars_aria.test4
-rw-r--r--mysql-test/suite/sysschema/r/optimizer_switch.result1
-rw-r--r--mysql-test/suite/versioning/r/delete_history.result2
-rw-r--r--mysql-test/suite/versioning/r/rpl.result24
-rw-r--r--mysql-test/suite/versioning/t/rpl.test34
-rw-r--r--mysys/my_addr_resolve.c7
-rw-r--r--mysys/my_atomic_writes.c16
-rw-r--r--mysys/my_likely.c2
-rw-r--r--mysys/my_rdtsc.c24
-rw-r--r--mysys/my_thr_init.c2
-rw-r--r--plugin/auth_pam/testing/pam_mariadb_mtr.c1
-rw-r--r--plugin/feedback/feedback.cc2
-rw-r--r--scripts/mariadb_system_tables_fix.sql6
-rw-r--r--scripts/wsrep_sst_mariabackup.sh35
-rw-r--r--sql-common/client.c2
-rw-r--r--sql/debug_sync.cc2
-rw-r--r--sql/field.cc23
-rw-r--r--sql/field.h8
-rw-r--r--sql/filesort.cc36
-rw-r--r--sql/ha_partition.h13
-rw-r--r--sql/ha_sequence.cc2
-rw-r--r--sql/handler.cc62
-rw-r--r--sql/item.cc29
-rw-r--r--sql/item.h27
-rw-r--r--sql/item_cmpfunc.cc26
-rw-r--r--sql/item_cmpfunc.h6
-rw-r--r--sql/item_jsonfunc.h11
-rw-r--r--sql/item_strfunc.cc2
-rw-r--r--sql/item_subselect.cc16
-rw-r--r--sql/item_sum.cc3
-rw-r--r--sql/key.cc3
-rw-r--r--sql/log.cc5
-rw-r--r--sql/log_event.h4
-rw-r--r--sql/log_event_server.cc200
-rw-r--r--sql/mysqld.cc30
-rw-r--r--sql/mysqld.h4
-rw-r--r--sql/opt_range.cc49
-rw-r--r--sql/opt_split.cc216
-rw-r--r--sql/opt_subselect.cc19
-rw-r--r--sql/opt_subselect.h1
-rw-r--r--sql/rpl_parallel.cc53
-rw-r--r--sql/rpl_parallel.h3
-rw-r--r--sql/rpl_rli.cc5
-rw-r--r--sql/semisync_master.cc6
-rw-r--r--sql/signal_handler.cc29
-rw-r--r--sql/slave.cc35
-rw-r--r--sql/slave.h3
-rw-r--r--sql/sql_acl.cc9
-rw-r--r--sql/sql_analyze_stmt.h74
-rw-r--r--sql/sql_base.cc33
-rw-r--r--sql/sql_class.h4
-rw-r--r--sql/sql_delete.cc5
-rw-r--r--sql/sql_derived.cc21
-rw-r--r--sql/sql_explain.cc42
-rw-r--r--sql/sql_explain.h17
-rw-r--r--sql/sql_insert.cc5
-rw-r--r--sql/sql_join_cache.cc6
-rw-r--r--sql/sql_lex.cc141
-rw-r--r--sql/sql_lex.h58
-rw-r--r--sql/sql_locale.cc21
-rw-r--r--sql/sql_parse.cc26
-rw-r--r--sql/sql_priv.h65
-rw-r--r--sql/sql_repl.cc2
-rw-r--r--sql/sql_schema.cc61
-rw-r--r--sql/sql_schema.h11
-rw-r--r--sql/sql_select.cc1069
-rw-r--r--sql/sql_select.h32
-rw-r--r--sql/sql_sequence.cc17
-rw-r--r--sql/sql_show.cc4
-rw-r--r--sql/sql_sort.h1
-rw-r--r--sql/sql_statistics.cc50
-rw-r--r--sql/sql_string.cc2
-rw-r--r--sql/sql_string.h77
-rw-r--r--sql/sql_table.cc13
-rw-r--r--sql/sql_tvc.cc1
-rw-r--r--sql/sql_type.cc6
-rw-r--r--sql/sql_type.h32
-rw-r--r--sql/sql_type_fixedbin.h4
-rw-r--r--sql/sql_update.cc8
-rw-r--r--sql/sql_view.cc11
-rw-r--r--sql/sql_yacc.yy115
-rw-r--r--sql/structs.h24
-rw-r--r--sql/sys_vars.cc30
-rw-r--r--sql/table.cc107
-rw-r--r--sql/table.h21
-rw-r--r--sql/tztime.cc4
-rw-r--r--sql/wsrep_client_service.cc2
-rw-r--r--sql/wsrep_high_priority_service.cc15
-rw-r--r--sql/wsrep_schema.cc5
-rw-r--r--sql/wsrep_thd.h9
-rw-r--r--sql/wsrep_trans_observer.h15
-rw-r--r--storage/connect/catalog.h4
-rw-r--r--storage/connect/mysql-test/connect/r/mysql.result11
-rw-r--r--storage/connect/mysql-test/connect/t/mysql.test15
-rw-r--r--storage/connect/myutil.cpp2
-rw-r--r--storage/connect/reldef.cpp26
-rw-r--r--storage/connect/tabbson.cpp47
-rw-r--r--storage/connect/tabdos.cpp61
-rw-r--r--storage/connect/tabext.cpp57
-rw-r--r--storage/connect/tabfmt.cpp38
-rw-r--r--storage/connect/tabjdbc.cpp45
-rw-r--r--storage/connect/tabjson.cpp54
-rw-r--r--storage/connect/value.cpp8
-rw-r--r--storage/connect/value.h2
-rw-r--r--storage/innobase/btr/btr0btr.cc2
-rw-r--r--storage/innobase/btr/btr0cur.cc4
-rw-r--r--storage/innobase/buf/buf0buf.cc14
-rw-r--r--storage/innobase/buf/buf0dblwr.cc43
-rw-r--r--storage/innobase/buf/buf0dump.cc2
-rw-r--r--storage/innobase/buf/buf0flu.cc133
-rw-r--r--storage/innobase/buf/buf0lru.cc15
-rw-r--r--storage/innobase/buf/buf0rea.cc25
-rw-r--r--storage/innobase/dict/drop.cc1
-rw-r--r--storage/innobase/fil/fil0fil.cc75
-rw-r--r--storage/innobase/fsp/fsp0file.cc2
-rw-r--r--storage/innobase/fsp/fsp0space.cc24
-rw-r--r--storage/innobase/fsp/fsp0sysspace.cc12
-rw-r--r--storage/innobase/fts/fts0fts.cc325
-rw-r--r--storage/innobase/fts/fts0opt.cc56
-rw-r--r--storage/innobase/gis/gis0rtree.cc3
-rw-r--r--storage/innobase/handler/ha_innodb.cc93
-rw-r--r--storage/innobase/handler/handler0alter.cc8
-rw-r--r--storage/innobase/handler/i_s.cc8
-rw-r--r--storage/innobase/include/buf0buf.h16
-rw-r--r--storage/innobase/include/buf0dblwr.h45
-rw-r--r--storage/innobase/include/fil0fil.h4
-rw-r--r--storage/innobase/include/fts0fts.h9
-rw-r--r--storage/innobase/include/fts0types.h32
-rw-r--r--storage/innobase/include/ha_prototypes.h10
-rw-r--r--storage/innobase/include/log0log.h10
-rw-r--r--storage/innobase/include/mtr0mtr.h14
-rw-r--r--storage/innobase/include/os0file.h32
-rw-r--r--storage/innobase/include/srv0srv.h3
-rw-r--r--storage/innobase/include/trx0purge.h7
-rw-r--r--storage/innobase/include/trx0rseg.h3
-rw-r--r--storage/innobase/include/trx0undo.h10
-rw-r--r--storage/innobase/log/log0log.cc10
-rw-r--r--storage/innobase/log/log0recv.cc43
-rw-r--r--storage/innobase/mtr/mtr0mtr.cc12
-rw-r--r--storage/innobase/os/os0file.cc115
-rw-r--r--storage/innobase/page/page0zip.cc5
-rw-r--r--storage/innobase/rem/rem0cmp.cc5
-rw-r--r--storage/innobase/rem/rem0rec.cc10
-rw-r--r--storage/innobase/row/row0import.cc1
-rw-r--r--storage/innobase/row/row0ins.cc48
-rw-r--r--storage/innobase/row/row0merge.cc5
-rw-r--r--storage/innobase/row/row0mysql.cc26
-rw-r--r--storage/innobase/row/row0purge.cc5
-rw-r--r--storage/innobase/row/row0quiesce.cc2
-rw-r--r--storage/innobase/row/row0uins.cc5
-rw-r--r--storage/innobase/row/row0vers.cc28
-rw-r--r--storage/innobase/srv/srv0mon.cc40
-rw-r--r--storage/innobase/srv/srv0srv.cc34
-rw-r--r--storage/innobase/srv/srv0start.cc39
-rw-r--r--storage/innobase/trx/trx0purge.cc307
-rw-r--r--storage/innobase/trx/trx0rec.cc10
-rw-r--r--storage/innobase/trx/trx0rseg.cc3
-rw-r--r--storage/innobase/trx/trx0trx.cc27
-rw-r--r--storage/innobase/trx/trx0undo.cc120
-rw-r--r--storage/maria/ha_maria.cc5
-rw-r--r--storage/myisammrg/ha_myisammrg.cc25
-rw-r--r--storage/perfschema/CMakeLists.txt2
-rw-r--r--storage/perfschema/cursor_by_account.cc2
-rw-r--r--storage/perfschema/cursor_by_account.h2
-rw-r--r--storage/perfschema/cursor_by_host.cc2
-rw-r--r--storage/perfschema/cursor_by_host.h2
-rw-r--r--storage/perfschema/cursor_by_thread.cc2
-rw-r--r--storage/perfschema/cursor_by_thread.h2
-rw-r--r--storage/perfschema/cursor_by_thread_connect_attr.cc2
-rw-r--r--storage/perfschema/cursor_by_thread_connect_attr.h2
-rw-r--r--storage/perfschema/cursor_by_user.cc2
-rw-r--r--storage/perfschema/cursor_by_user.h2
-rw-r--r--storage/perfschema/ha_perfschema.cc2
-rw-r--r--storage/perfschema/ha_perfschema.h2
-rw-r--r--storage/perfschema/pfs.cc5
-rw-r--r--storage/perfschema/pfs.h2
-rw-r--r--storage/perfschema/pfs_account.cc2
-rw-r--r--storage/perfschema/pfs_account.h2
-rw-r--r--storage/perfschema/pfs_atomic.h2
-rw-r--r--storage/perfschema/pfs_autosize.cc2
-rw-r--r--storage/perfschema/pfs_buffer_container.cc2
-rw-r--r--storage/perfschema/pfs_buffer_container.h2
-rw-r--r--storage/perfschema/pfs_builtin_memory.cc2
-rw-r--r--storage/perfschema/pfs_builtin_memory.h2
-rw-r--r--storage/perfschema/pfs_column_types.h2
-rw-r--r--storage/perfschema/pfs_column_values.cc2
-rw-r--r--storage/perfschema/pfs_column_values.h2
-rw-r--r--storage/perfschema/pfs_con_slice.cc2
-rw-r--r--storage/perfschema/pfs_con_slice.h2
-rw-r--r--storage/perfschema/pfs_defaults.cc2
-rw-r--r--storage/perfschema/pfs_defaults.h2
-rw-r--r--storage/perfschema/pfs_digest.cc2
-rw-r--r--storage/perfschema/pfs_digest.h2
-rw-r--r--storage/perfschema/pfs_engine_table.cc2
-rw-r--r--storage/perfschema/pfs_engine_table.h2
-rw-r--r--storage/perfschema/pfs_events.h2
-rw-r--r--storage/perfschema/pfs_events_stages.cc2
-rw-r--r--storage/perfschema/pfs_events_stages.h2
-rw-r--r--storage/perfschema/pfs_events_statements.cc2
-rw-r--r--storage/perfschema/pfs_events_transactions.cc2
-rw-r--r--storage/perfschema/pfs_events_transactions.h2
-rw-r--r--storage/perfschema/pfs_events_waits.cc2
-rw-r--r--storage/perfschema/pfs_events_waits.h2
-rw-r--r--storage/perfschema/pfs_global.cc2
-rw-r--r--storage/perfschema/pfs_global.h2
-rw-r--r--storage/perfschema/pfs_host.cc2
-rw-r--r--storage/perfschema/pfs_host.h2
-rw-r--r--storage/perfschema/pfs_instr.cc2
-rw-r--r--storage/perfschema/pfs_instr.h2
-rw-r--r--storage/perfschema/pfs_instr_class.cc2
-rw-r--r--storage/perfschema/pfs_instr_class.h2
-rw-r--r--storage/perfschema/pfs_lock.h2
-rw-r--r--storage/perfschema/pfs_memory.cc2
-rw-r--r--storage/perfschema/pfs_memory.h2
-rw-r--r--storage/perfschema/pfs_prepared_stmt.cc2
-rw-r--r--storage/perfschema/pfs_prepared_stmt.h2
-rw-r--r--storage/perfschema/pfs_program.cc2
-rw-r--r--storage/perfschema/pfs_program.h2
-rw-r--r--storage/perfschema/pfs_server.cc2
-rw-r--r--storage/perfschema/pfs_server.h2
-rw-r--r--storage/perfschema/pfs_setup_actor.cc2
-rw-r--r--storage/perfschema/pfs_setup_actor.h2
-rw-r--r--storage/perfschema/pfs_setup_object.cc2
-rw-r--r--storage/perfschema/pfs_setup_object.h2
-rw-r--r--storage/perfschema/pfs_stat.h2
-rw-r--r--storage/perfschema/pfs_status.cc2
-rw-r--r--storage/perfschema/pfs_status.h2
-rw-r--r--storage/perfschema/pfs_timer.cc2
-rw-r--r--storage/perfschema/pfs_timer.h2
-rw-r--r--storage/perfschema/pfs_user.cc2
-rw-r--r--storage/perfschema/pfs_user.h2
-rw-r--r--storage/perfschema/pfs_variable.cc2
-rw-r--r--storage/perfschema/pfs_variable.h2
-rw-r--r--storage/perfschema/pfs_visitor.cc2
-rw-r--r--storage/perfschema/pfs_visitor.h2
-rw-r--r--storage/perfschema/table_accounts.cc2
-rw-r--r--storage/perfschema/table_accounts.h2
-rw-r--r--storage/perfschema/table_all_instr.cc2
-rw-r--r--storage/perfschema/table_all_instr.h2
-rw-r--r--storage/perfschema/table_esgs_by_account_by_event_name.cc2
-rw-r--r--storage/perfschema/table_esgs_by_account_by_event_name.h2
-rw-r--r--storage/perfschema/table_esgs_by_host_by_event_name.cc2
-rw-r--r--storage/perfschema/table_esgs_by_host_by_event_name.h2
-rw-r--r--storage/perfschema/table_esgs_by_thread_by_event_name.cc2
-rw-r--r--storage/perfschema/table_esgs_by_thread_by_event_name.h2
-rw-r--r--storage/perfschema/table_esgs_by_user_by_event_name.cc2
-rw-r--r--storage/perfschema/table_esgs_by_user_by_event_name.h2
-rw-r--r--storage/perfschema/table_esgs_global_by_event_name.cc2
-rw-r--r--storage/perfschema/table_esgs_global_by_event_name.h2
-rw-r--r--storage/perfschema/table_esms_by_account_by_event_name.cc2
-rw-r--r--storage/perfschema/table_esms_by_account_by_event_name.h2
-rw-r--r--storage/perfschema/table_esms_by_digest.cc2
-rw-r--r--storage/perfschema/table_esms_by_digest.h2
-rw-r--r--storage/perfschema/table_esms_by_host_by_event_name.cc2
-rw-r--r--storage/perfschema/table_esms_by_host_by_event_name.h2
-rw-r--r--storage/perfschema/table_esms_by_program.cc2
-rw-r--r--storage/perfschema/table_esms_by_program.h2
-rw-r--r--storage/perfschema/table_esms_by_thread_by_event_name.cc2
-rw-r--r--storage/perfschema/table_esms_by_thread_by_event_name.h2
-rw-r--r--storage/perfschema/table_esms_by_user_by_event_name.cc2
-rw-r--r--storage/perfschema/table_esms_by_user_by_event_name.h2
-rw-r--r--storage/perfschema/table_esms_global_by_event_name.cc2
-rw-r--r--storage/perfschema/table_esms_global_by_event_name.h2
-rw-r--r--storage/perfschema/table_ets_by_account_by_event_name.cc2
-rw-r--r--storage/perfschema/table_ets_by_account_by_event_name.h2
-rw-r--r--storage/perfschema/table_ets_by_host_by_event_name.cc2
-rw-r--r--storage/perfschema/table_ets_by_host_by_event_name.h2
-rw-r--r--storage/perfschema/table_ets_by_thread_by_event_name.cc2
-rw-r--r--storage/perfschema/table_ets_by_thread_by_event_name.h2
-rw-r--r--storage/perfschema/table_ets_by_user_by_event_name.cc2
-rw-r--r--storage/perfschema/table_ets_by_user_by_event_name.h2
-rw-r--r--storage/perfschema/table_ets_global_by_event_name.cc2
-rw-r--r--storage/perfschema/table_ets_global_by_event_name.h2
-rw-r--r--storage/perfschema/table_events_stages.cc2
-rw-r--r--storage/perfschema/table_events_stages.h2
-rw-r--r--storage/perfschema/table_events_statements.cc2
-rw-r--r--storage/perfschema/table_events_statements.h2
-rw-r--r--storage/perfschema/table_events_transactions.cc2
-rw-r--r--storage/perfschema/table_events_transactions.h2
-rw-r--r--storage/perfschema/table_events_waits.cc2
-rw-r--r--storage/perfschema/table_events_waits.h2
-rw-r--r--storage/perfschema/table_events_waits_summary.cc2
-rw-r--r--storage/perfschema/table_events_waits_summary.h2
-rw-r--r--storage/perfschema/table_ews_by_account_by_event_name.cc2
-rw-r--r--storage/perfschema/table_ews_by_account_by_event_name.h2
-rw-r--r--storage/perfschema/table_ews_by_host_by_event_name.cc2
-rw-r--r--storage/perfschema/table_ews_by_host_by_event_name.h2
-rw-r--r--storage/perfschema/table_ews_by_thread_by_event_name.cc2
-rw-r--r--storage/perfschema/table_ews_by_thread_by_event_name.h2
-rw-r--r--storage/perfschema/table_ews_by_user_by_event_name.cc2
-rw-r--r--storage/perfschema/table_ews_by_user_by_event_name.h2
-rw-r--r--storage/perfschema/table_ews_global_by_event_name.cc2
-rw-r--r--storage/perfschema/table_ews_global_by_event_name.h2
-rw-r--r--storage/perfschema/table_file_instances.cc2
-rw-r--r--storage/perfschema/table_file_instances.h2
-rw-r--r--storage/perfschema/table_file_summary_by_event_name.cc2
-rw-r--r--storage/perfschema/table_file_summary_by_event_name.h2
-rw-r--r--storage/perfschema/table_file_summary_by_instance.cc2
-rw-r--r--storage/perfschema/table_file_summary_by_instance.h2
-rw-r--r--storage/perfschema/table_global_status.cc2
-rw-r--r--storage/perfschema/table_global_status.h2
-rw-r--r--storage/perfschema/table_global_variables.cc2
-rw-r--r--storage/perfschema/table_global_variables.h2
-rw-r--r--storage/perfschema/table_helper.cc2
-rw-r--r--storage/perfschema/table_helper.h2
-rw-r--r--storage/perfschema/table_host_cache.cc2
-rw-r--r--storage/perfschema/table_host_cache.h2
-rw-r--r--storage/perfschema/table_hosts.cc2
-rw-r--r--storage/perfschema/table_hosts.h2
-rw-r--r--storage/perfschema/table_md_locks.cc2
-rw-r--r--storage/perfschema/table_md_locks.h2
-rw-r--r--storage/perfschema/table_mems_by_account_by_event_name.cc2
-rw-r--r--storage/perfschema/table_mems_by_account_by_event_name.h2
-rw-r--r--storage/perfschema/table_mems_by_host_by_event_name.cc2
-rw-r--r--storage/perfschema/table_mems_by_host_by_event_name.h2
-rw-r--r--storage/perfschema/table_mems_by_thread_by_event_name.cc2
-rw-r--r--storage/perfschema/table_mems_by_thread_by_event_name.h2
-rw-r--r--storage/perfschema/table_mems_by_user_by_event_name.cc2
-rw-r--r--storage/perfschema/table_mems_by_user_by_event_name.h2
-rw-r--r--storage/perfschema/table_mems_global_by_event_name.cc2
-rw-r--r--storage/perfschema/table_mems_global_by_event_name.h2
-rw-r--r--storage/perfschema/table_os_global_by_type.cc2
-rw-r--r--storage/perfschema/table_os_global_by_type.h2
-rw-r--r--storage/perfschema/table_performance_timers.cc2
-rw-r--r--storage/perfschema/table_performance_timers.h2
-rw-r--r--storage/perfschema/table_prepared_stmt_instances.cc2
-rw-r--r--storage/perfschema/table_prepared_stmt_instances.h2
-rw-r--r--storage/perfschema/table_processlist.cc2
-rw-r--r--storage/perfschema/table_processlist.h2
-rw-r--r--storage/perfschema/table_replication_applier_configuration.cc2
-rw-r--r--storage/perfschema/table_replication_applier_configuration.h2
-rw-r--r--storage/perfschema/table_replication_applier_status.cc2
-rw-r--r--storage/perfschema/table_replication_applier_status.h2
-rw-r--r--storage/perfschema/table_replication_applier_status_by_coordinator.cc2
-rw-r--r--storage/perfschema/table_replication_applier_status_by_coordinator.h2
-rw-r--r--storage/perfschema/table_replication_applier_status_by_worker.cc2
-rw-r--r--storage/perfschema/table_replication_applier_status_by_worker.h2
-rw-r--r--storage/perfschema/table_replication_connection_configuration.cc2
-rw-r--r--storage/perfschema/table_replication_connection_configuration.h2
-rw-r--r--storage/perfschema/table_replication_connection_status.cc2
-rw-r--r--storage/perfschema/table_replication_connection_status.h2
-rw-r--r--storage/perfschema/table_replication_group_member_stats.cc2
-rw-r--r--storage/perfschema/table_replication_group_member_stats.h2
-rw-r--r--storage/perfschema/table_replication_group_members.cc2
-rw-r--r--storage/perfschema/table_replication_group_members.h2
-rw-r--r--storage/perfschema/table_session_account_connect_attrs.cc2
-rw-r--r--storage/perfschema/table_session_account_connect_attrs.h2
-rw-r--r--storage/perfschema/table_session_connect.cc2
-rw-r--r--storage/perfschema/table_session_connect.h2
-rw-r--r--storage/perfschema/table_session_connect_attrs.cc2
-rw-r--r--storage/perfschema/table_session_connect_attrs.h2
-rw-r--r--storage/perfschema/table_session_status.cc2
-rw-r--r--storage/perfschema/table_session_status.h2
-rw-r--r--storage/perfschema/table_session_variables.cc2
-rw-r--r--storage/perfschema/table_session_variables.h2
-rw-r--r--storage/perfschema/table_setup_actors.cc2
-rw-r--r--storage/perfschema/table_setup_actors.h2
-rw-r--r--storage/perfschema/table_setup_consumers.cc2
-rw-r--r--storage/perfschema/table_setup_consumers.h2
-rw-r--r--storage/perfschema/table_setup_instruments.cc2
-rw-r--r--storage/perfschema/table_setup_instruments.h2
-rw-r--r--storage/perfschema/table_setup_objects.cc2
-rw-r--r--storage/perfschema/table_setup_objects.h2
-rw-r--r--storage/perfschema/table_setup_timers.cc2
-rw-r--r--storage/perfschema/table_setup_timers.h2
-rw-r--r--storage/perfschema/table_socket_instances.cc2
-rw-r--r--storage/perfschema/table_socket_instances.h2
-rw-r--r--storage/perfschema/table_socket_summary_by_event_name.cc2
-rw-r--r--storage/perfschema/table_socket_summary_by_event_name.h2
-rw-r--r--storage/perfschema/table_socket_summary_by_instance.cc2
-rw-r--r--storage/perfschema/table_socket_summary_by_instance.h2
-rw-r--r--storage/perfschema/table_status_by_account.cc2
-rw-r--r--storage/perfschema/table_status_by_account.h2
-rw-r--r--storage/perfschema/table_status_by_host.cc2
-rw-r--r--storage/perfschema/table_status_by_host.h2
-rw-r--r--storage/perfschema/table_status_by_thread.cc2
-rw-r--r--storage/perfschema/table_status_by_thread.h2
-rw-r--r--storage/perfschema/table_status_by_user.cc2
-rw-r--r--storage/perfschema/table_status_by_user.h2
-rw-r--r--storage/perfschema/table_sync_instances.cc2
-rw-r--r--storage/perfschema/table_sync_instances.h2
-rw-r--r--storage/perfschema/table_table_handles.cc2
-rw-r--r--storage/perfschema/table_table_handles.h2
-rw-r--r--storage/perfschema/table_threads.cc2
-rw-r--r--storage/perfschema/table_threads.h2
-rw-r--r--storage/perfschema/table_tiws_by_index_usage.cc2
-rw-r--r--storage/perfschema/table_tiws_by_index_usage.h2
-rw-r--r--storage/perfschema/table_tiws_by_table.cc2
-rw-r--r--storage/perfschema/table_tiws_by_table.h2
-rw-r--r--storage/perfschema/table_tlws_by_table.cc2
-rw-r--r--storage/perfschema/table_tlws_by_table.h2
-rw-r--r--storage/perfschema/table_users.cc2
-rw-r--r--storage/perfschema/table_users.h2
-rw-r--r--storage/perfschema/table_uvar_by_thread.cc2
-rw-r--r--storage/perfschema/table_uvar_by_thread.h2
-rw-r--r--storage/perfschema/table_variables_by_thread.cc2
-rw-r--r--storage/perfschema/table_variables_by_thread.h2
-rw-r--r--storage/perfschema/unittest/CMakeLists.txt2
-rw-r--r--storage/perfschema/unittest/conf.txt2
-rw-r--r--storage/perfschema/unittest/pfs-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_account-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_connect_attr-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_host-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_instr-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_instr-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_instr_class-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_instr_class-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_misc-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_noop-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_server_stubs.cc2
-rw-r--r--storage/perfschema/unittest/pfs_timer-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_user-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/stub_global_status_var.h2
-rw-r--r--storage/perfschema/unittest/stub_pfs_defaults.h2
-rw-r--r--storage/perfschema/unittest/stub_pfs_global.h2
-rw-r--r--storage/perfschema/unittest/stub_print_error.h2
-rw-r--r--storage/rocksdb/CMakeLists.txt5
-rw-r--r--storage/rocksdb/build_rocksdb.cmake2
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc4
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result4
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test1
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test4
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test4
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test4
-rw-r--r--storage/rocksdb/ut0counter.h2
-rw-r--r--storage/spider/ha_spider.cc16
-rw-r--r--storage/spider/ha_spider.h4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/disabled.def1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc8
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result1
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29644.result41
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29676.result47
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/mdev_29904.result4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result21
-rw-r--r--storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result4
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test2
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29644.cnf3
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29644.test56
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29676.test41
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/mdev_29904.test6
-rw-r--r--storage/spider/mysql-test/spider/bugfix/t/self_reference_multi.test29
-rw-r--r--storage/spider/mysql-test/spider/r/slave_trx_isolation.result4
-rw-r--r--storage/spider/spd_conn.cc148
-rw-r--r--storage/spider/spd_copy_tables.cc2
-rw-r--r--storage/spider/spd_db_include.h12
-rw-r--r--storage/spider/spd_db_mysql.cc994
-rw-r--r--storage/spider/spd_db_mysql.h10
-rw-r--r--storage/spider/spd_err.h2
-rw-r--r--storage/spider/spd_include.h57
-rw-r--r--storage/spider/spd_param.cc2
-rw-r--r--storage/spider/spd_param.h1
-rw-r--r--storage/spider/spd_ping_table.cc2
-rw-r--r--storage/spider/spd_sys_table.cc107
-rw-r--r--storage/spider/spd_sys_table.h7
-rw-r--r--storage/spider/spd_table.cc2017
-rw-r--r--storage/spider/spd_table.h22
-rw-r--r--storage/spider/spd_trx.cc51
-rw-r--r--strings/CMakeLists.txt1
-rw-r--r--strings/conf_to_src.c6
-rw-r--r--strings/ctype-big5.c7
-rw-r--r--strings/ctype-bin.c7
-rw-r--r--strings/ctype-cp932.c7
-rw-r--r--strings/ctype-czech.c1
-rw-r--r--strings/ctype-euc_kr.c7
-rw-r--r--strings/ctype-eucjpms.c7
-rw-r--r--strings/ctype-extra.c108
-rw-r--r--strings/ctype-gb2312.c7
-rw-r--r--strings/ctype-gbk.c7
-rw-r--r--strings/ctype-latin1.c5
-rw-r--r--strings/ctype-simple.c3
-rw-r--r--strings/ctype-sjis.c7
-rw-r--r--strings/ctype-tis620.c7
-rw-r--r--strings/ctype-uca.c454
-rw-r--r--strings/ctype-uca.inl26
-rw-r--r--strings/ctype-ucs2.c257
-rw-r--r--strings/ctype-ujis.c7
-rw-r--r--strings/ctype-unicode1400-casefold-tr.h704
-rw-r--r--strings/ctype-unicode1400-casefold.h4240
-rw-r--r--strings/ctype-unicode300-casefold-tr.h193
-rw-r--r--strings/ctype-unicode300-casefold.h1764
-rw-r--r--strings/ctype-unicode300-general_ci.h610
-rw-r--r--strings/ctype-unicode300-general_mysql500_ci.h190
-rw-r--r--strings/ctype-unicode520-casefold.h3192
-rw-r--r--strings/ctype-unidata.c97
-rw-r--r--strings/ctype-unidata.h127
-rw-r--r--strings/ctype-utf8.c4764
-rw-r--r--strings/ctype-win1250ch.c1
-rw-r--r--strings/ctype.c6
-rw-r--r--strings/json_normalize.c17
-rw-r--r--strings/strcoll.inl31
-rw-r--r--strings/strings_def.h6
-rw-r--r--strings/uctypedump.c4
-rw-r--r--strings/unidata-dump.c1110
-rw-r--r--strings/xml.c16
-rw-r--r--tests/code_quality/cppcheck_ignorelist.txt252
-rw-r--r--tests/code_quality/flawfinder_ignorelist.json706
-rw-r--r--tpool/tpool_structs.h83
-rw-r--r--unittest/strings/strings-t.c420
m---------wsrep-lib0
-rw-r--r--zlib/ChangeLog24
-rw-r--r--zlib/LICENSE22
-rw-r--r--zlib/README4
-rw-r--r--zlib/compress.c6
-rw-r--r--zlib/crc32.c33
-rw-r--r--zlib/deflate.c218
-rw-r--r--zlib/deflate.h4
-rw-r--r--zlib/gzlib.c2
-rw-r--r--zlib/gzread.c8
-rw-r--r--zlib/gzwrite.c2
-rw-r--r--zlib/infback.c17
-rw-r--r--zlib/inflate.c7
-rw-r--r--zlib/inftrees.c4
-rw-r--r--zlib/inftrees.h2
-rw-r--r--zlib/make_vms.com4
-rw-r--r--zlib/qnx/package.qpg10
-rw-r--r--zlib/treebuild.xml4
-rw-r--r--zlib/trees.c123
-rw-r--r--zlib/uncompr.c4
-rw-r--r--zlib/win32/README-WIN32.txt4
-rw-r--r--zlib/win32/zlib1.rc2
-rw-r--r--zlib/zconf.h.cmakein19
-rw-r--r--zlib/zconf.h.in19
-rw-r--r--zlib/zlib.34
-rw-r--r--zlib/zlib.h18
-rwxr-xr-xzlib/zlib2ansi4
-rw-r--r--zlib/zutil.c16
-rw-r--r--zlib/zutil.h1
1012 files changed, 40595 insertions, 18069 deletions
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index fbba6e12f12..c97f9827e59 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -1,61 +1,47 @@
<!--
Thank you for contributing to the MariaDB Server repository!
-You can help us review your changes faster by filling this template <3
+You can help us review your changes faster by filling in this template <3
-If you have any questions related to MariaDB or you just want to
-hang out and meet other community members, please join us on
-https://mariadb.zulipchat.com/ .
+If you have any questions related to MariaDB or you just want to hang out and meet other community members, please join us on https://mariadb.zulipchat.com/ .
-->
<!--
-If you've already identified a https://jira.mariadb.org/ issue
-that seems to track this bug/feature, please add its number below.
+If you've already identified a https://jira.mariadb.org/ issue that seems to track this bug/feature, please add its number below.
-->
-- [x] *The Jira issue number for this PR is: MDEV-_____*
+- [x] *The Jira issue number for this PR is: MDEV-______*
<!--
An amazing description should answer some questions like:
1. What problem is the patch trying to solve?
-2. If some output changed, what was it looking like before
- the change and how it's looking with this patch applied
-3. Do you think this patch might introduce side-effects in
- other parts of the server?
+2. If some output changed that is not visible in a test case, what was it looking like before the change and how it's looking with this patch applied?
+3. Do you think this patch might introduce side-effects in other parts of the server?
-->
## Description
TODO: fill description here
## How can this PR be tested?
-TODO: modify the automated test suite to verify that the PR causes MariaDB to
-behave as intended. Consult the documentation on
-["Writing good test cases"](https://mariadb.org/get-involved/getting-started-for-developers/writing-good-test-cases-mariadb-server).
-In many cases, this will be as simple as modifying one `.test` and one `.result`
-file in the `mysql-test/` subdirectory. Without _automated_ tests, future regressions
-in the expected behavior can't be automatically detected and verified.
+TODO: modify the automated test suite to verify that the PR causes MariaDB to behave as intended.
+Consult the documentation on ["Writing good test cases"](https://mariadb.org/get-involved/getting-started-for-developers/writing-good-test-cases-mariadb-server).
+<!--
+In many cases, this will be as simple as modifying one `.test` and one `.result` file in the `mysql-test/` subdirectory.
+Without automated tests, future regressions in the expected behavior can't be automatically detected and verified.
+-->
-If the changes are not amenable to automated testing, please explain why not and
-carefully describe how to test manually.
+If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.
<!--
-Tick one of the following boxes [x] to help us understand
-if the base branch for the PR is correct
-(Currently the earliest maintained branch is 10.3)
+Tick one of the following boxes [x] to help us understand if the base branch for the PR is correct. (Currently the earliest maintained branch is 10.3)
-->
## Basing the PR against the correct MariaDB version
-- [ ] *This is a new feature and the PR is based against the latest MariaDB development branch*
-- [ ] *This is a bug fix and the PR is based against the earliest maintained branch in which the bug can be reproduced*
+- [ ] *This is a new feature and the PR is based against the latest MariaDB development branch.*
+- [ ] *This is a bug fix and the PR is based against the earliest maintained branch in which the bug can be reproduced.*
<!--
-You might consider answering some questions like:
-1. Does this affect the on-disk format used by MariaDB?
-2. Does this change any behavior experienced by a user
- who upgrades from a version prior to this patch?
-3. Would a user be able to start MariaDB on a datadir
- created prior to your fix?
+ All code merged into the MariaDB codebase must meet a quality standard and codying style.
+ Maintainers are happy to point out inconsistencies but in order to speed up the review and merge process we ask you to check the CODING standards.
-->
-## Backward compatibility
-TODO: fill details here, if applicable, or remove the section
-
## PR quality check
- [ ] I checked the [CODING_STANDARDS.md](https://github.com/MariaDB/server/blob/11.0/CODING_STANDARDS.md) file and my PR conforms to this where appropriate.
+- [ ] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.
diff --git a/.gitignore b/.gitignore
index 56c15100dd6..ac67886c51c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -267,7 +267,6 @@ support-files/mysql.10.0.11.spec
support-files/mysql.server
support-files/mysql.service
support-files/mysql.spec
-support-files/mysql-log-rotate
support-files/mysqld.service
support-files/mysqld_multi.server
support-files/policy/selinux/mysqld-safe.pp
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3f02a76beb0..2b9c34e48dc 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -27,6 +27,7 @@ stages:
- build
- test
- Salsa-CI
+ - sast
default:
# Base image for builds and tests unless otherwise defined
@@ -42,7 +43,7 @@ variables:
CMAKE_FLAGS: "-DWITH_SSL=system -DPLUGIN_COLUMNSTORE=NO -DPLUGIN_ROCKSDB=NO -DPLUGIN_S3=NO -DPLUGIN_MROONGA=NO -DPLUGIN_CONNECT=NO -DPLUGIN_MROONGA=NO -DPLUGIN_TOKUDB=NO -DPLUGIN_PERFSCHEMA=NO -DWITH_WSREP=OFF"
# Major version dictates which branches share the same ccache. E.g. 10.6-abc
# and 10.6-xyz will have the same cache.
- MARIADB_MAJOR_VERSION: "10.8"
+ MARIADB_MAJOR_VERSION: "11.0"
# NOTE! Currently ccache is only used on the Centos8 build. As each job has
# sufficiently different environments they are unable to benefit from each
# other's ccaches. As each build generates about 1 GB of ccache, having
@@ -515,6 +516,70 @@ mini-benchmark:
metrics:
- metrics.txt
+cppcheck:
+ stage: sast
+ needs: []
+ variables:
+ GIT_STRATEGY: fetch
+ GIT_SUBMODULE_STRATEGY: normal
+ script:
+ - yum install -y cppcheck diffutils
+ # --template: use a single-line template
+ # --force: check large directories without warning
+ # -i<directory>: ignore this directory when scanning
+ # -j: run multiple cppcheck threads
+ # Use newline to escape colon in yaml
+ - >
+ cppcheck --template="{file}:{line}: {severity}: {message}" --force
+ client dbug extra include libmariadb libmysqld libservices mysql-test mysys mysys_ssl pcre plugin
+ strings tests unittest vio wsrep-lib sql sql-common storage
+ -istorage/mroonga -istorage/tokudb -istorage/spider -istorage/rocksdb -iextra/ -ilibmariadb/ -istorage/columnstore
+ --output-file=cppcheck.txt -j $(nproc)
+ # Parallel jobs may output findings in an nondeterministic order. Sort to match ignorelist.
+ - cat cppcheck.txt | sort > cppcheck_sorted.txt
+ # Remove line numbers for diff
+ - sed 's/:[^:]*:/:/' cppcheck_sorted.txt > cppcheck_sorted_no_line_numbers.txt
+ # Only print new issues not found in ignore list
+ - echo "Problems found in ignore list that were not discovered by cppcheck (may have been fixed)."
+ - diff --changed-group-format='%>' --unchanged-group-format='' cppcheck_sorted_no_line_numbers.txt tests/code_quality/cppcheck_ignorelist.txt || true
+ - echo "Problems found by cppcheck that were not in ignore list."
+ - diff --changed-group-format='%<' --unchanged-group-format='' cppcheck_sorted_no_line_numbers.txt tests/code_quality/cppcheck_ignorelist.txt > lines_not_ignored.txt || true
+ - cat lines_not_ignored.txt && test ! -s lines_not_ignored.txt
+ artifacts:
+ when: always
+ paths:
+ - cppcheck_sorted.txt
+
+flawfinder:
+ stage: sast
+ needs: []
+ variables:
+ GIT_STRATEGY: fetch
+ GIT_SUBMODULE_STRATEGY: normal
+ script:
+ - yum install -y python3 python3-pip jq diffutils git
+ - pip install flawfinder
+ - flawfinder --falsepositive --quiet --html . > flawfinder-all-vulnerabilities.html
+ - cat flawfinder-all-vulnerabilities.html | grep "Hits ="
+ - flawfinder --falsepositive --quiet --minlevel=5 --sarif . > flawfinder-output.json
+ # FlawFinder's --sarif output will display all vulnerabilities despite having --minlevel=5 specified.
+ # Therefore, we postprocess the results with jq and filter out findings where the vulnerability level is less than 5.
+ # Also in the SARIF output format, the vulnerabilities are ranked as 0.2/0.4/0.6/0.8/1.0 which correspond to the --minlevel=1/2/3/4/5 of FlawFinder.
+ # Additionally, we sort the results because individual findings are consistent across different runs, but their ordering may not be.
+ # Vulnerabilities can also be ignored in-line (/* Flawfinder: ignore */), but this option was chosen as to not clutter the codebase.
+ - jq 'del(.runs[] | .tool | .driver | .rules) | del(.runs[] | .results[] | select(.rank < 1)) | del(.runs[] | .results[] | .locations[] | .physicalLocation | .region | .startLine) | .runs[0].results|=sort_by(.fingerprints)' flawfinder-output.json > flawfinder-min-level5.json
+ # Diff against known vulnerabilities, but ignore the line number.
+ - echo "Problems found in ignore list that were not discovered by flawfinder (may have been fixed)."
+ - diff --changed-group-format='%>' --unchanged-group-format='' flawfinder-min-level5.json tests/code_quality/flawfinder_ignorelist.json || true
+ - echo "Problems found by flawfinder that were not in ignore list."
+ - diff --changed-group-format='%<' --unchanged-group-format='' flawfinder-min-level5.json tests/code_quality/flawfinder_ignorelist.json > lines_not_ignored.txt || true
+ - cat lines_not_ignored.txt && test ! -s lines_not_ignored.txt
+ artifacts:
+ when: always
+ paths:
+ - flawfinder-all-vulnerabilities.html
+ - flawfinder-min-level5.json
+
# Once all RPM builds and tests have passed, also run the DEB builds and tests
# @NOTE: This is likely to work well only on salsa.debian.org as the Gitlab.com
# runners are too small for everything this stage does.
diff --git a/.gitmodules b/.gitmodules
index 3847bf6bff3..18bcb465fa2 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,25 +1,19 @@
[submodule "libmariadb"]
path = libmariadb
url = https://github.com/MariaDB/mariadb-connector-c.git
- ignore = all
[submodule "storage/rocksdb/rocksdb"]
path = storage/rocksdb/rocksdb
url = https://github.com/facebook/rocksdb.git
- ignore = all
[submodule "wsrep-lib"]
path = wsrep-lib
url = https://github.com/codership/wsrep-lib.git
branch = master
- ignore = all
[submodule "extra/wolfssl/wolfssl"]
path = extra/wolfssl/wolfssl
url = https://github.com/wolfSSL/wolfssl.git
- ignore = all
[submodule "storage/maria/libmarias3"]
path = storage/maria/libmarias3
url = https://github.com/mariadb-corporation/libmarias3.git
- ignore = all
[submodule "storage/columnstore/columnstore"]
path = storage/columnstore/columnstore
url = https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
- ignore = all
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index 9b3a584bbab..5975ba2b592 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -216,15 +216,14 @@ max_plugins="--with-plugins=max"
max_no_embedded_configs="$max_plugins"
max_no_qc_configs="$max_plugins --without-query-cache"
max_configs="$max_plugins --with-embedded-server --with-libevent --with-plugin-rocksdb=dynamic --with-plugin-test_sql_discovery=DYNAMIC --with-plugin-file_key_management=DYNAMIC --with-plugin-hashicorp_key_management=DYNAMIC --with-plugin-auth_gssapi=DYNAMIC"
-all_configs="$max_plugins --with-embedded-server --with-innodb_plugin --with-libevent"
+all_configs="$max_configs"
#
# CPU and platform specific compilation flags.
#
alpha_cflags="$check_cpu_cflags -Wa,-m$cpu_flag"
-amd64_cflags="$check_cpu_cflags"
-amd64_cxxflags="" # If dropping '--with-big-tables', add here "-DBIG_TABLES"
pentium_cflags="$check_cpu_cflags -m32"
+amd64_cflags="$check_cpu_cflags -m64"
pentium64_cflags="$check_cpu_cflags -m64"
ppc_cflags="$check_cpu_cflags"
sparc_cflags=""
diff --git a/BUILD/compile-amd64-debug-all b/BUILD/compile-amd64-debug-all
index b8b2ed05402..66f6f3309e2 100755
--- a/BUILD/compile-amd64-debug-all
+++ b/BUILD/compile-amd64-debug-all
@@ -1,7 +1,10 @@
#! /bin/sh
+
path=`dirname $0`
+set -- "$@" --with-debug=full
. "$path/SETUP.sh"
+
extra_flags="$amd64_cflags $debug_cflags"
extra_configs="$amd64_configs $debug_configs $all_configs"
-
+CC="$CC --pipe"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-amd64-debug-max b/BUILD/compile-amd64-debug-max
index 281f2775cb1..0af32f5decd 100755
--- a/BUILD/compile-amd64-debug-max
+++ b/BUILD/compile-amd64-debug-max
@@ -1,7 +1,6 @@
#! /bin/sh
-# Copyright (c) 2005, 2006 MySQL AB
-# Use is subject to license terms
+# Copyright (c) 2005, 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
@@ -14,11 +13,13 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
path=`dirname $0`
. "$path/SETUP.sh"
+
extra_flags="$amd64_cflags $debug_cflags"
extra_configs="$amd64_configs $debug_configs $max_configs"
+CC="$CC --pipe"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium64-debug-all b/BUILD/compile-pentium64-debug-all
index 7824f7ad47f..8733ad00c02 100755
--- a/BUILD/compile-pentium64-debug-all
+++ b/BUILD/compile-pentium64-debug-all
@@ -6,7 +6,5 @@ set -- "$@" --with-debug=full
extra_flags="$pentium64_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs $all_configs"
-
-extra_configs="$extra_configs "
CC="$CC --pipe"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium64-debug-max b/BUILD/compile-pentium64-debug-max
index 09061de6891..c68a6326e7f 100755
--- a/BUILD/compile-pentium64-debug-max
+++ b/BUILD/compile-pentium64-debug-max
@@ -21,6 +21,5 @@ path=`dirname $0`
extra_flags="$pentium64_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs $max_configs"
-extra_configs="$extra_configs "
CC="$CC --pipe"
. "$path/FINISH.sh"
diff --git a/CODING_STANDARDS.md b/CODING_STANDARDS.md
index a35ce57d45c..3ecf73768e3 100644
--- a/CODING_STANDARDS.md
+++ b/CODING_STANDARDS.md
@@ -118,6 +118,23 @@ if (!condition)
return success;
```
+#### Functions
+
+Consecutive functions should be separated with 2 empty lines in between
+
+```cpp
+void my_function_1()
+{
+ <logic>
+}
+
+
+void my_function_2()
+{
+ <logic>
+}
+```
+
### File names
File names should be lower case with underscore word separators.
@@ -218,11 +235,28 @@ Variables should be declared at the start of it's context (start of function, in
The benefits of this:
- Code lines gets shorter
- It is easier to see the stack space used by a function.
-- It is easer to find the declaration of the variable.
+- It is easier to find the declaration of the variable.
- If one has to add an 'if (error) goto end' construct, one can do
that without having to move variable declarations around.
+### Variable initializations
+Variables can be initialized using assignment operator or initializer and expression list.
+For Example:
+
+```cpp
+int milliseconds= 1000;
+char type= 't';
+```
+
+Or
+
+```cpp
+int milliseconds{1000};
+char type{'t'};
+```
+
+
### Constant integers
Constant integers that are used to define elements such as buffer sizes should be defined rather than used directly.
diff --git a/THIRDPARTY b/THIRDPARTY
index 35bb238ed1e..87f9bb7a3b5 100644
--- a/THIRDPARTY
+++ b/THIRDPARTY
@@ -930,180 +930,202 @@ archived older versions of code and data; there is also a smaller HTTP mirror.
***************************************************************************
%%The following software may be included in this product:
-UnicodeData.txt
-
-Use of any of this software is governed by the terms of the license below:
-
-Unicode Terms of Use
-
- For the general privacy policy governing access to this site, see the
- Unicode Privacy Policy. For trademark usage, see the Unicode
- Consortium (R) Trademarks and Logo Policy.
- Notice to End User: Terms of Use
- Carefully read the following legal agreement ("Agreement"). Use or
- copying of the software and/or codes provided with this agreement (The
- "Software") constitutes your acceptance of these terms
-
- 1. Unicode Copyright.
- 1. Copyright (c) 1991-2008 Unicode, Inc. All rights reserved.
- 2. Certain documents and files on this website contain a
- legend indicating that "Modification is permitted." Any person
- is hereby authorized, without fee, to modify such documents
- and files to create derivative works conforming to the
- Unicode (R) Standard, subject to Terms and Conditions herein.
- 3. Any person is hereby authorized, without fee, to view, use,
- reproduce, and distribute all documents and files solely for
- informational purposes in the creation of products supporting
- the Unicode Standard, subject to the Terms and Conditions
- herein.
- 4. Further specifications of rights and restrictions
- pertaining to the use of the particular set of data files
- known as the "Unicode Character Database" can be found in
- Exhibit 1.
- 5. Each version of the Unicode Standard has further
- specifications of rights and restrictions of use. For the book
- editions, these are found on the back of the title page. For
- the online edition, certain files (such as the PDF files for
- book chapters and code charts) carry specific restrictions.
- All other files are covered under these general Terms of Use.
- To request a permission to reproduce any part of the Unicode
- Standard, please contact the Unicode Consortium.
- 6. No license is granted to "mirror" the Unicode website where
- a fee is charged for access to the "mirror" site.
- 7. Modification is not permitted with respect to this
- document. All copies of this document must be verbatim.
- 2. Restricted Rights Legend. Any technical data or software which is
- licensed to the United States of America, its agencies and/or
- instrumentalities under this Agreement is commercial technical data
- or commercial computer software developed exclusively at private
- expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995),
- as applicable. For technical data, use, duplication, or disclosure
- by the Government is subject to restrictions as set forth in DFARS
- 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and
- this Agreement. For Software, in accordance with FAR 12-212 or DFARS
- 227-7202, as applicable, use, duplication or disclosure by the
- Government is subject to the restrictions set forth in this
- Agreement.
- 3. Warranties and Disclaimers.
- 1. This publication and/or website may include technical or
- typographical errors or other inaccuracies . Changes are
- periodically added to the information herein; these changes
- will be incorporated in new editions of the publication and/or
- website. Unicode may make improvements and/or changes in the
- product(s) and/or program(s) described in this publication
- and/or website at any time.
- 2. If this file has been purchased on magnetic or optical
- media from Unicode, Inc. the sole and exclusive remedy for any
- claim will be exchange of the defective media within ninety
- (90) days of original purchase.
- 3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR
- SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND
- EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT
- LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE AND ITS
- LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN
- THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE
- REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE
- WEBSITE.
- 4. Waiver of Damages. In no event shall Unicode or its licensors be
- liable for any special, incidental, indirect or consequential
- damages of any kind, or any damages whatsoever, whether or not
- Unicode was advised of the possibility of the damage, including,
- without limitation, those resulting from the following: loss of use,
- data or profits, in connection with the use, modification or
- distribution of this information or its derivatives.
- 5. Trademarks.
- 1. Unicode and the Unicode logo are registered trademarks of
- Unicode, Inc.
- 2. This site contains product names and corporate names of
- other companies. All product names and company names and logos
- mentioned herein are the trademarks or registered trademarks
- of their respective owners. Other products and corporate names
- mentioned herein which are trademarks of a third party are
- used only for explanation and for the owners' benefit and with
- no intent to infringe.
- 3. Use of third party products or information referred to
- herein is at the user's risk.
- 6. Miscellaneous.
- 1. Jurisdiction and Venue. This server is operated from a
- location in the State of California, United States of America.
- Unicode makes no representation that the materials are
- appropriate for use in other locations. If you access this
- server from other locations, you are responsible for
- compliance with local laws. This Agreement, all use of this
- site and any claims and damages resulting from use of this
- site are governed solely by the laws of the State of
- California without regard to any principles which would apply
- the laws of a different jurisdiction. The user agrees that any
- disputes regarding this site shall be resolved solely in the
- courts located in Santa Clara County, California. The user
- agrees said courts have personal jurisdiction and agree to
- waive any right to transfer the dispute to any other forum.
- 2. Modification by Unicode Unicode shall have the right to
- modify this Agreement at any time by posting it to this site.
- The user may not assign any part of this Agreement without
- Unicode's prior written consent.
- 3. Taxes. The user agrees to pay any taxes arising from access
- to this website or use of the information herein, except for
- those based on Unicode's net income.
- 4. Severability. If any provision of this Agreement is
- declared invalid or unenforceable, the remaining provisions of
- this Agreement shall remain in effect.
- 5. Entire Agreement. This Agreement constitutes the entire
- agreement between the parties.
+http://www.unicode.org/copyright.html
+
+ Unicode® Copyright and Terms of Use
+
+ For the general privacy policy governing access to this site, see the Unicode Privacy Policy.
+
+ Unicode Copyright
+ Copyright © 1991-2023 Unicode, Inc. All rights reserved.
+ Definitions
+
+ Unicode Data Files ("DATA FILES") include all data files under the directories:
+ https://www.unicode.org/Public/
+ https://www.unicode.org/reports/
+ https://www.unicode.org/ivd/data/
+
+ Unicode Data Files do not include PDF online code charts under the directory:
+ https://www.unicode.org/Public/
+
+ Unicode Software ("SOFTWARE") includes any source code published in the Unicode Standard
+ or any source code or compiled code under the directories:
+ https://www.unicode.org/Public/PROGRAMS/
+ https://www.unicode.org/Public/cldr/
+ http://site.icu-project.org/download/
+
+ Terms of Use
+ Certain documents and files on this website contain a legend
+ indicating that "Modification is permitted." Any person is hereby
+ authorized, without fee, to modify such documents and files to
+ create derivative works conforming to the Unicode® Standard, subject
+ to Terms and Conditions herein.
+
+ Any person is hereby authorized, without fee, to view, use,
+ reproduce, and distribute all documents and files, subject to the
+ Terms and Conditions herein.
+
+ Further specifications of rights and restrictions pertaining to the
+ use of the Unicode DATA FILES and SOFTWARE can be found in the
+ Unicode Data Files and Software License.
+
+ Each version of the Unicode Standard has further specifications of
+ rights and restrictions of use. For the book editions (Unicode 5.0
+ and earlier), these are found on the back of the title page.
+
+ The Unicode PDF online code charts carry specific restrictions.
+ Those restrictions are incorporated as the first page of each PDF
+ code chart.
+
+ All other files, including online documentation of the core
+ specification for Unicode 6.0 and later, are covered under these
+ general Terms of Use.
+
+ No license is granted to "mirror" the Unicode website where a fee is
+ charged for access to the "mirror" site.
+
+ Modification is not permitted with respect to this document. All
+ copies of this document must be verbatim.
+
+ Restricted Rights Legend
+
+ Any technical data or software which is licensed to the United
+ States of America, its agencies and/or instrumentalities under this
+ Agreement is commercial technical data or commercial computer
+ software developed exclusively at private expense as defined in FAR
+ 2.101, or DFARS 252.227-7014 (June 1995), as applicable. For
+ technical data, use, duplication, or disclosure by the Government is
+ subject to restrictions as set forth in DFARS 202.227-7015 Technical
+ Data, Commercial and Items (Nov 1995) and this Agreement. For
+ Software, in accordance with FAR 12-212 or DFARS 227-7202, as
+ applicable, use, duplication or disclosure by the Government is
+ subject to the restrictions set forth in this Agreement.
+
+ Warranties and Disclaimers
+ This publication and/or website may include technical or
+ typographical errors or other inaccuracies. Changes are periodically
+ added to the information herein; these changes will be incorporated
+ in new editions of the publication and/or website. Unicode, Inc. may
+ make improvements and/or changes in the product(s) and/or program(s)
+ described in this publication and/or website at any time.
+
+ If this file has been purchased on magnetic or optical media from
+ Unicode, Inc. the sole and exclusive remedy for any claim will be
+ exchange of the defective media within ninety (90) days of original
+ purchase.
+
+ EXCEPT AS PROVIDED IN SECTION E.2, THIS PUBLICATION AND/OR SOFTWARE
+ IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS,
+ IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+ NON-INFRINGEMENT. UNICODE, INC. AND ITS LICENSORS ASSUME NO
+ RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS PUBLICATION AND/OR
+ SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED TO
+ THIS PUBLICATION OR THE UNICODE WEBSITE.
+
+ Waiver of Damages
+ In no event shall Unicode, Inc. or its licensors be liable for any
+ special, incidental, indirect or consequential damages of any kind,
+ or any damages whatsoever, whether or not Unicode, Inc. was advised
+ of the possibility of the damage, including, without limitation,
+ those resulting from the following: loss of use, data or profits, in
+ connection with the use, modification or distribution of this
+ information or its derivatives.
+
+ Trademarks & Logos
+ The Unicode Word Mark and the Unicode Logo are trademarks of
+ Unicode, Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade
+ names of Unicode, Inc. Use of the information and materials found on
+ this website indicates your acknowledgement of Unicode, Inc.’s
+ exclusive worldwide rights in the Unicode Word Mark, the Unicode
+ Logo, and the Unicode trade names.
+
+ The Unicode Consortium Name and Trademark Usage Policy (“Trademark
+ Policy”) are incorporated herein by reference and you agree to abide
+ by the provisions of the Trademark Policy, which may be changed from
+ time to time in the sole discretion of Unicode, Inc.
+
+ All third party trademarks referenced herein are the property of
+ their respective owners.
+
+ Miscellaneous
+ Jurisdiction and Venue. This website is operated from a location in
+ the State of California, United States of America. Unicode, Inc.
+ makes no representation that the materials are appropriate for use
+ in other locations. If you access this website from other locations,
+ you are responsible for compliance with local laws. This Agreement,
+ all use of this website and any claims and damages resulting from
+ use of this website are governed solely by the laws of the State of
+ California without regard to any principles which would apply the
+ laws of a different jurisdiction. The user agrees that any disputes
+ regarding this website shall be resolved solely in the courts
+ located in Santa Clara County, California. The user agrees said
+ courts have personal jurisdiction and agree to waive any right to
+ transfer the dispute to any other forum.
+
+ Modification by Unicode, Inc. Unicode, Inc. shall have the right to
+ modify this Agreement at any time by posting it to this website. The
+ user may not assign any part of this Agreement without Unicode,
+ Inc.’s prior written consent.
+
+ Taxes. The user agrees to pay any taxes arising from access to this
+ website or use of the information herein, except for those based on
+ Unicode’s net income.
+
+ Severability. If any provision of this Agreement is declared
+ invalid or unenforceable, the remaining provisions of this Agreement
+ shall remain in effect.
+
+ Entire Agreement. This Agreement constitutes the entire agreement
+ between the parties.
EXHIBIT 1
UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
- Unicode Data Files include all data files under the directories
-http://www.unicode.org/Public/, http://www.unicode.org/reports/, and
-http://www.unicode.org/cldr/data/ . Unicode Software includes any source code
-published in the Unicode Standard or under the directories
-http://www.unicode.org/Public/, http://www.unicode.org/reports/, and
-http://www.unicode.org/cldr/data/.
-
- NOTICE TO USER: Carefully read the following legal agreement. BY
-DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES
-("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND
-AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU
-DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES
-OR SOFTWARE.
-
- COPYRIGHT AND PERMISSION NOTICE
-
- Copyright (c) 1991-2008 Unicode, Inc. All rights reserved. Distributed under
-the Terms of Use in http://www.unicode.org/copyright.html.
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
-of the Unicode data files and any associated documentation (the "Data Files") or
-Unicode software and any associated documentation (the "Software") to deal in
-the Data Files or Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, and/or sell copies of
-the Data Files or Software, and to permit persons to whom the Data Files or
-Software are furnished to do so, provided that (a) the above copyright notice(s)
-and this permission notice appear with all copies of the Data Files or Software,
-(b) both the above copyright notice(s) and this permission notice appear in
-associated documentation, and (c) there is clear notice in each modified Data
-File or in the Software as well as in the documentation associated with the Data
-File(s) or Software that the data or software has been modified.
-
- THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD
-PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
+See Terms of Use <https://www.unicode.org/copyright.html>
+for definitions of Unicode Inc.’s Data Files and Software.
+
+NOTICE TO USER: Carefully read the following legal agreement.
+BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
+DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
+YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
+TERMS AND CONDITIONS OF THIS AGREEMENT.
+IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
+THE DATA FILES OR SOFTWARE.
+
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright © 1991-2023 Unicode, Inc. All rights reserved.
+Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Unicode data files and any associated documentation
+(the "Data Files") or Unicode software and any associated documentation
+(the "Software") to deal in the Data Files or Software
+without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, and/or sell copies of
+the Data Files or Software, and to permit persons to whom the Data Files
+or Software are furnished to do so, provided that either
+(a) this copyright and permission notice appear with all copies
+of the Data Files or Software, or
+(b) this copyright and permission notice appear in associated
+Documentation.
+
+THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
-DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.
-
- Except as contained in this notice, the name of a copyright holder shall not
-be used in advertising or otherwise to promote the sale, use or other dealings
-in these Data Files or Software without prior written authorization of the
-copyright holder.
-
- Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be
-registered in some jurisdictions. All other trademarks and registered trademarks
-mentioned herein are the property of their respective owners.
+DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale,
+use or other dealings in these Data Files or Software without prior
+written authorization of the copyright holder.
***************************************************************************
diff --git a/client/client_priv.h b/client/client_priv.h
index bd768d1874c..597c074c9c2 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -153,51 +153,3 @@ enum options_client
#else
#define SOCKET_PROTOCOL_TO_FORCE MYSQL_PROTOCOL_PIPE
#endif
-
-/**
- Utility function to implicitly change the connection protocol to a
- consistent value given the command line arguments. Additionally,
- warns the user that the protocol has been changed.
-
- Arguments:
- @param [in] host Name of the host to connect to
- @param [in, out] opt_protocol Location of the protocol option
- variable to update
- @param [in] new_protocol New protocol to force
-*/
-static inline void warn_protocol_override(char *host,
- uint *opt_protocol,
- uint new_protocol)
-{
- DBUG_ASSERT(new_protocol == MYSQL_PROTOCOL_TCP
- || new_protocol == SOCKET_PROTOCOL_TO_FORCE);
-
-
- if ((host == NULL
- || strncmp(host, LOCAL_HOST, sizeof(LOCAL_HOST)-1) == 0))
- {
- const char *protocol_name;
-
- if (*opt_protocol == MYSQL_PROTOCOL_DEFAULT
-#ifndef _WIN32
- && new_protocol == MYSQL_PROTOCOL_SOCKET
-#else
- && new_protocol == MYSQL_PROTOCOL_TCP
-#endif
- )
- {
- /* This is already the default behavior, do nothing */
- return;
- }
-
- protocol_name= sql_protocol_typelib.type_names[new_protocol-1];
-
- fprintf(stderr, "%s %s %s\n",
- "WARNING: Forcing protocol to ",
- protocol_name,
- " due to option specification. "
- "Please explicitly state intended protocol.");
-
- *opt_protocol = new_protocol;
- }
-}
diff --git a/client/mysql.cc b/client/mysql.cc
index eb6508903b6..70bb4514dbc 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -299,8 +299,6 @@ unsigned short terminal_width= 80;
static uint opt_protocol=0;
static const char *opt_protocol_type= "";
-static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT;
-
#include "sslopt-vars.h"
const char *default_dbug_option="d:t:o,/tmp/mariadb.trace";
@@ -1273,14 +1271,6 @@ int main(int argc,char *argv[])
exit(status.exit_status);
}
- /* Command line options override configured protocol */
- if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT
- && protocol_to_force != opt_protocol)
- {
- warn_protocol_override(current_host, &opt_protocol, protocol_to_force);
- }
-
-
if (status.batch && !status.line_buff &&
!(status.line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, stdin)))
{
@@ -1890,11 +1880,9 @@ static void usage(int version)
my_bool
-get_one_option(const struct my_option *opt, const char *argument, const char *filename)
+get_one_option(const struct my_option *opt, const char *argument,
+ const char *filename)
{
- /* Track when protocol is set via CLI to not force port TCP protocol override */
- static my_bool ignore_protocol_override = FALSE;
-
switch(opt->id) {
case OPT_CHARSETS_DIR:
strmake_buf(mysql_charsets_dir, argument);
@@ -1955,18 +1943,11 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
#ifndef EMBEDDED_LIBRARY
if (!argument[0])
opt_protocol= 0;
- else if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
+ else if ((opt_protocol=
+ find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0)
exit(1);
#endif
-
- /* Specification of protocol via CLI trumps implicit overrides */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
break;
case OPT_SERVER_ARG:
#ifdef EMBEDDED_LIBRARY
@@ -2066,13 +2047,6 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
#ifdef _WIN32
opt_protocol = MYSQL_PROTOCOL_PIPE;
opt_protocol_type= "pipe";
-
- /* Prioritize pipe if explicit via command line */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
#endif
break;
#include <sslopt-case.h>
@@ -2085,35 +2059,17 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
mysql_end(-1);
break;
case 'P':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* If port is set via CLI, try to force protocol to TCP */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = MYSQL_PROTOCOL_TCP;
+ /* Port given on command line, switch protocol to use TCP */
+ opt_protocol= MYSQL_PROTOCOL_TCP;
}
break;
case 'S':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == MYSQL_PROTOCOL_TCP)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* Prioritize socket if set via command line */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = SOCKET_PROTOCOL_TO_FORCE;
+ /* Socket given on command line, switch protocol to use SOCKETSt */
+ opt_protocol= MYSQL_PROTOCOL_SOCKET;
}
break;
case 'I':
@@ -5660,6 +5616,7 @@ static void init_username()
full_username=my_strdup(PSI_NOT_INSTRUMENTED, cur[0],MYF(MY_WME));
part_username=my_strdup(PSI_NOT_INSTRUMENTED, strtok(cur[0],"@"),MYF(MY_WME));
(void) mysql_fetch_row(result); // Read eof
+ mysql_free_result(result);
}
}
diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c
index ad50f64d663..44abe8614e9 100644
--- a/client/mysql_plugin.c
+++ b/client/mysql_plugin.c
@@ -99,7 +99,7 @@ int main(int argc,char *argv[])
MY_INIT(argv[0]);
sf_leaking_memory=1; /* don't report memory leaks on early exits */
plugin_data.name= 0; /* initialize name */
-
+
/*
The following operations comprise the method for enabling or disabling
a plugin. We begin by processing the command options then check the
@@ -107,15 +107,15 @@ int main(int argc,char *argv[])
--plugin-ini (if specified). If the directories are Ok, we then look
for the mysqld executable and the plugin soname. Finally, we build a
bootstrap command file for use in bootstraping the server.
-
+
If any step fails, the method issues an error message and the tool exits.
-
+
1) Parse, execute, and verify command options.
2) Check access to directories.
3) Look for mysqld executable.
4) Look for the plugin.
5) Build a bootstrap file with commands to enable or disable plugin.
-
+
*/
if ((error= process_options(argc, argv, operation)) ||
(error= check_access()) ||
@@ -123,11 +123,11 @@ int main(int argc,char *argv[])
(error= find_plugin(tp_path)) ||
(error= build_bootstrap_file(operation, bootstrap)))
goto exit;
-
+
/* Dump the bootstrap file if --verbose specified. */
if (opt_verbose && ((error= dump_bootstrap_file(bootstrap))))
goto exit;
-
+
/* Start the server in bootstrap mode and execute bootstrap commands */
error= bootstrap_server(server_path, bootstrap);
@@ -235,7 +235,7 @@ static int run_command(char* cmd, const char *mode)
#ifdef _WIN32
/**
Check to see if there are spaces in a path.
-
+
@param[in] path The Windows path to examine.
@retval int spaces found = 1, no spaces = 0
@@ -250,7 +250,7 @@ static int has_spaces(const char *path)
/**
Convert a Unix path to a Windows path.
-
+
@param[in] path The Windows path to examine.
@returns string containing path with / changed to \\
@@ -332,12 +332,12 @@ static int get_default_values()
#ifdef _WIN32
{
char *format_str= 0;
-
+
if (has_spaces(tool_path) || has_spaces(defaults_file))
format_str = "\"%s --mysqld > %s\"";
else
format_str = "%s --mysqld > %s";
-
+
snprintf(defaults_cmd, sizeof(defaults_cmd), format_str,
add_quotes(tool_path), add_quotes(defaults_file));
if (opt_verbose)
@@ -672,7 +672,7 @@ static int load_plugin_data(char *plugin_name, char *config_file)
{
reason= "Bad format in plugin configuration file.";
fclose(file_ptr);
- goto error;
+ goto error;
}
break;
}
@@ -706,7 +706,7 @@ static int load_plugin_data(char *plugin_name, char *config_file)
}
}
}
-
+
fclose(file_ptr);
return 0;
@@ -737,7 +737,7 @@ static int check_options(int argc, char **argv, char *operation)
int num_found= 0; /* number of options found (shortcut loop) */
char config_file[FN_REFLEN]; /* configuration file name */
char plugin_name[FN_REFLEN]; /* plugin name */
-
+
/* Form prefix strings for the options. */
const char *basedir_prefix = "--basedir=";
size_t basedir_len= strlen(basedir_prefix);
@@ -812,7 +812,7 @@ static int check_options(int argc, char **argv, char *operation)
return 1;
}
/* If a plugin was specified, read the config file. */
- else if (strlen(plugin_name) > 0)
+ else if (strlen(plugin_name) > 0)
{
if (load_plugin_data(plugin_name, config_file))
{
@@ -844,22 +844,22 @@ static int check_options(int argc, char **argv, char *operation)
/**
Parse, execute, and verify command options.
-
+
This method handles all of the option processing including the optional
features for displaying data (--print-defaults, --help ,etc.) that do not
result in an attempt to ENABLE or DISABLE of a plugin.
-
+
@param[in] arc Count of arguments
@param[in] argv Array of arguments
@param[out] operation Operation (ENABLE or DISABLE)
-
+
@retval int error = 1, success = 0, exit program = -1
*/
static int process_options(int argc, char *argv[], char *operation)
{
int error= 0;
-
+
/* Parse and execute command-line options */
if ((error= handle_options(&argc, &argv, my_long_options, get_one_option)))
return error;
@@ -887,7 +887,7 @@ static int process_options(int argc, char *argv[], char *operation)
opt_basedir= my_strdup(PSI_NOT_INSTRUMENTED, buff, MYF(MY_FAE));
}
}
-
+
/*
If the user did not specify the option to skip loading defaults from a
config file and the required options are not present or there was an error
@@ -922,18 +922,18 @@ static int process_options(int argc, char *argv[], char *operation)
/**
Check access
-
+
This method checks to ensure all of the directories (opt_basedir,
opt_plugin_dir, opt_datadir, and opt_plugin_ini) are accessible by
the user.
-
+
@retval int error = 1, success = 0
*/
static int check_access()
{
int error= 0;
-
+
if ((error= my_access(opt_basedir, F_OK)))
{
fprintf(stderr, "ERROR: Cannot access basedir at '%s'.\n",
@@ -1045,13 +1045,13 @@ static int find_plugin(char *tp_path)
/**
Build the bootstrap file.
-
+
Create a new file and populate it with SQL commands to ENABLE or DISABLE
the plugin via REPLACE and DELETE operations on the mysql.plugin table.
param[in] operation The type of operation (ENABLE or DISABLE)
param[out] bootstrap A FILE* pointer
-
+
@retval int error = 1, success = 0
*/
@@ -1059,7 +1059,7 @@ static int build_bootstrap_file(char *operation, char *bootstrap)
{
int error= 0;
FILE *file= 0;
-
+
/*
Perform plugin operation : ENABLE or DISABLE
@@ -1070,10 +1070,10 @@ static int build_bootstrap_file(char *operation, char *bootstrap)
<plugin_name>.ini configuration file. Once the file is built, a call to
mysqld is made in read only, bootstrap modes to read the SQL statements
and execute them.
-
+
Note: Replace was used so that if a user loads a newer version of a
library with a different library name, the new library name is
- used for symbols that match.
+ used for symbols that match.
*/
if ((error= make_tempfile(bootstrap, "sql")))
{
@@ -1120,7 +1120,7 @@ static int build_bootstrap_file(char *operation, char *bootstrap)
printf("# Disabling %s...\n", plugin_data.name);
}
}
-
+
exit:
fclose(file);
return error;
@@ -1129,11 +1129,11 @@ exit:
/**
Dump bootstrap file.
-
+
Read the contents of the bootstrap file and print it out.
-
+
@param[in] bootstrap_file Name of bootstrap file to read
-
+
@retval int error = 1, success = 0
*/
@@ -1170,7 +1170,7 @@ exit:
/**
Bootstrap the server
-
+
Create a command line sequence to launch mysqld in bootstrap mode. This
will allow mysqld to launch a minimal server instance to read and
execute SQL commands from a file piped in (the bootstrap file). We use
@@ -1191,47 +1191,39 @@ exit:
static int bootstrap_server(char *server_path, char *bootstrap_file)
{
- char bootstrap_cmd[FN_REFLEN];
+ char bootstrap_cmd[FN_REFLEN]= {0};
+ char lc_messages_dir_str[FN_REFLEN]= {0};
int error= 0;
#ifdef _WIN32
char *format_str= 0;
const char *verbose_str= NULL;
-
-
+#endif
+
+ if (opt_lc_messages_dir != NULL)
+ snprintf(lc_messages_dir_str, sizeof(lc_messages_dir_str), "--lc-messages-dir=%s",
+ opt_lc_messages_dir);
+
+#ifdef _WIN32
if (opt_verbose)
verbose_str= "--console";
else
verbose_str= "";
+
if (has_spaces(opt_datadir) || has_spaces(opt_basedir) ||
- has_spaces(bootstrap_file))
- {
- if (opt_lc_messages_dir != NULL)
- format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s --lc-messages-dir=%s <%s\"";
- else
- format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s <%s\"";
- }
+ has_spaces(bootstrap_file) || has_spaces(lc_messages_dir_str))
+ format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s %s <%s\"";
else
- {
- if (opt_lc_messages_dir != NULL)
- format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s --lc-messages-dir=%s <%s\"";
- else
- format_str= "%s %s --bootstrap --datadir=%s --basedir=%s <%s";
- }
+ format_str= "%s %s --bootstrap --datadir=%s --basedir=%s %s <%s";
+
snprintf(bootstrap_cmd, sizeof(bootstrap_cmd), format_str,
add_quotes(convert_path(server_path)), verbose_str,
add_quotes(opt_datadir), add_quotes(opt_basedir),
- add_quotes(bootstrap_file));
+ add_quotes(lc_messages_dir_str), add_quotes(bootstrap_file));
#else
- if (opt_lc_messages_dir != NULL)
- snprintf(bootstrap_cmd, sizeof(bootstrap_cmd),
- "%s --no-defaults --bootstrap --datadir=%s --basedir=%s --lc-messages-dir=%s"
- " <%s", server_path, opt_datadir, opt_basedir, opt_lc_messages_dir, bootstrap_file);
- else
- snprintf(bootstrap_cmd, sizeof(bootstrap_cmd),
- "%s --no-defaults --bootstrap --datadir=%s --basedir=%s"
- " <%s", server_path, opt_datadir, opt_basedir, bootstrap_file);
-
+ snprintf(bootstrap_cmd, sizeof(bootstrap_cmd),
+ "%s --no-defaults --bootstrap --datadir=%s --basedir=%s %s"
+ " <%s", server_path, opt_datadir, opt_basedir, lc_messages_dir_str, bootstrap_file);
#endif
/* Execute the command */
@@ -1244,6 +1236,6 @@ static int bootstrap_server(char *server_path, char *bootstrap_file)
fprintf(stderr,
"ERROR: Unexpected result from bootstrap. Error code: %d.\n",
error);
-
+
return error;
}
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 5855f9d79a7..d5c81409eaf 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -75,6 +75,8 @@ char upgrade_from_version[1024];
static my_bool opt_write_binlog;
+static void print_conn_args(const char *tool_name);
+
#define OPT_SILENT OPT_MAX_CLIENT_OPTION
static struct my_option my_long_options[]=
@@ -154,7 +156,10 @@ static struct my_option my_long_options[]=
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"user", 'u', "User for login.", &opt_user,
&opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"verbose", 'v', "Display more output about the process; Using it twice will print connection argument; Using it 3 times will print out all CHECK, RENAME and ALTER TABLE during the check phase.",
+ {"verbose", 'v', "Display more output about the process; Using it twice will print connection argument;"
+ "Using it 3 times will print out all CHECK, RENAME and ALTER TABLE during the check phase;"
+ "Using it 4 times (added in MariaDB 10.0.14) will also write out all mariadb-check commands used;"
+ "Using it 5 times will print all the mariadb commands used and their results while running mysql_fix_privilege_tables script.",
&opt_not_used, &opt_not_used, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -209,6 +214,7 @@ static void die(const char *fmt, ...)
DBUG_ENTER("die");
/* Print the error message */
+ print_conn_args("mariadb-check");
fflush(stdout);
va_start(args, fmt);
if (fmt)
@@ -638,6 +644,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
"--database=mysql",
"--batch", /* Turns off pager etc. */
force ? "--force": "--skip-force",
+ opt_verbose >= 5 ? "--verbose" : "",
ds_res || opt_silent ? "--silent": "",
"<",
query_file_path,
@@ -873,8 +880,7 @@ static int upgrade_already_done(int silent)
"There is no need to run mariadb-upgrade again for %s.",
upgrade_from_version, version);
if (!opt_check_upgrade)
- verbose("You can use --force if you still want to run mariadb-upgrade",
- upgrade_from_version, version);
+ verbose("You can use --force if you still want to run mariadb-upgrade");
}
return 0;
}
@@ -1336,9 +1342,7 @@ static int run_sql_fix_privilege_tables(void)
dynstr_append(&ds_script, *query_ptr);
}
- run_query(ds_script.str,
- &ds_result, /* Collect result */
- TRUE);
+ run_query(ds_script.str, (opt_verbose >= 5) ? NULL : &ds_result, TRUE);
{
/*
@@ -1509,6 +1513,7 @@ int main(int argc, char **argv)
DBUG_ASSERT(phase == phases_total);
end:
+ print_conn_args("mariadb-check");
free_used_memory();
my_end(my_end_arg);
exit(0);
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index 1b99b5ce085..80f99baab7d 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -54,8 +54,6 @@ static bool sql_log_bin_off= false;
static uint opt_protocol=0;
static myf error_flags; /* flags to pass to my_printf_error, like ME_BELL */
-static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT;
-
/*
When using extended-status relatively, ex_val_max_len is the estimated
maximum length for any relative value printed by extended-status. The
@@ -243,12 +241,9 @@ static const char *load_default_groups[]=
0 };
my_bool
-get_one_option(const struct my_option *opt, const char *argument, const char *filename)
+get_one_option(const struct my_option *opt, const char *argument,
+ const char *filename)
{
-
- /* Track when protocol is set via CLI to not force overrides */
- static my_bool ignore_protocol_override = FALSE;
-
switch(opt->id) {
case 'c':
opt_count_iterations= 1;
@@ -280,13 +275,6 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
case 'W':
#ifdef _WIN32
opt_protocol = MYSQL_PROTOCOL_PIPE;
-
- /* Prioritize pipe if explicit via command line */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
#endif
break;
case '#':
@@ -322,45 +310,19 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
-
- /* Specification of protocol via CLI trumps implicit overrides */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
break;
case 'P':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* If port is set via CLI, try to force protocol to TCP */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = MYSQL_PROTOCOL_TCP;
+ /* Port given on command line, switch protocol to use TCP */
+ opt_protocol= MYSQL_PROTOCOL_TCP;
}
break;
case 'S':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == MYSQL_PROTOCOL_TCP)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* Prioritize socket if set via command line */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = SOCKET_PROTOCOL_TO_FORCE;
+ /* Socket given on command line, switch protocol to use SOCKETSt */
+ opt_protocol= MYSQL_PROTOCOL_SOCKET;
}
break;
}
@@ -388,13 +350,6 @@ int main(int argc,char *argv[])
temp_argv= mask_password(argc, &argv);
temp_argc= argc;
- /* Command line options override configured protocol */
- if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT
- && protocol_to_force != opt_protocol)
- {
- warn_protocol_override(host, &opt_protocol, protocol_to_force);
- }
-
if (debug_info_flag)
my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
if (debug_check_flag)
@@ -1593,7 +1548,8 @@ static void print_relative_row_vert(MYSQL_RES *result __attribute__((unused)),
llstr((tmp - last_values[row]), buff));
/* Find the minimum row length needed to output the relative value */
- if ((length=(uint) strlen(buff) > ex_val_max_len[row]) && ex_status_printed)
+ length=(uint) strlen(buff);
+ if (length > ex_val_max_len[row] && ex_status_printed)
ex_val_max_len[row] = length;
last_values[row] = tmp;
}
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index d7fc64d730a..33f0bf609ed 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -100,8 +100,6 @@ static const char *output_prefix= "";
static char **defaults_argv= 0;
static MEM_ROOT glob_root;
-static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT;
-
#ifndef DBUG_OFF
static const char *default_dbug_option = "d:t:o,/tmp/mariadb-binlog.trace";
const char *current_dbug_option= default_dbug_option;
@@ -1817,6 +1815,11 @@ static void cleanup()
my_free_open_file_info();
load_processor.destroy();
mysql_server_end();
+ if (opt_flashback)
+ {
+ delete_dynamic(&binlog_events);
+ delete_dynamic(&events_in_stmt);
+ }
DBUG_VOID_RETURN;
}
@@ -1904,11 +1907,11 @@ static void extend_main_gtid_event_filter(Gtid_event_filter *new_filter)
}
}
-static void die()
+static void die(int err)
{
cleanup();
my_end(MY_DONT_FREE_DBUG);
- exit(1);
+ exit(err);
}
@@ -1939,7 +1942,7 @@ static my_time_t convert_str_to_timestamp(const char* str)
l_time.time_type != MYSQL_TIMESTAMP_DATETIME || status.warnings)
{
error("Incorrect date and time argument: %s", str);
- die();
+ die(1);
}
/*
Note that Feb 30th, Apr 31st cause no error messages and are mapped to
@@ -2056,13 +2059,11 @@ int parse_gtid_filter_option(
}
extern "C" my_bool
-get_one_option(const struct my_option *opt, const char *argument, const char *filename)
+get_one_option(const struct my_option *opt, const char *argument,
+ const char *filename)
{
bool tty_password=0;
- /* Track when protocol is set via CLI to not force overrides */
- static my_bool ignore_protocol_override = FALSE;
-
switch (opt->id) {
#ifndef DBUG_OFF
case '#':
@@ -2110,16 +2111,8 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
- die();
+ die(1);
}
-
- /* Specification of protocol via CLI trumps implicit overrides */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
break;
#ifdef WHEN_FLASHBACK_REVIEW_READY
case opt_flashback_review:
@@ -2139,7 +2132,7 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
- die();
+ die(1);
}
opt_base64_output_mode= (enum_base64_output_mode)(val - 1);
break;
@@ -2160,35 +2153,17 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
print_row_event_positions_used= 1;
break;
case 'P':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* If port is set via CLI, try to force protocol to TCP */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = MYSQL_PROTOCOL_TCP;
+ /* Port given on command line, switch protocol to use TCP */
+ opt_protocol= MYSQL_PROTOCOL_TCP;
}
break;
case 'S':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == MYSQL_PROTOCOL_TCP)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* Prioritize socket if set via command line */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = SOCKET_PROTOCOL_TO_FORCE;
+ /* Socket given on command line, switch protocol to use SOCKETSt */
+ opt_protocol= MYSQL_PROTOCOL_SOCKET;
}
break;
case 'v':
@@ -2289,7 +2264,7 @@ static int parse_args(int *argc, char*** argv)
if ((ho_error=handle_options(argc, argv, my_options, get_one_option)))
{
- die();
+ die(ho_error);
}
if (debug_info_flag)
my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
@@ -2322,7 +2297,7 @@ static int parse_args(int *argc, char*** argv)
quit in error. Note that any specific error messages will have
already been written.
*/
- die();
+ die(1);
}
extend_main_gtid_event_filter(position_gtid_filter);
@@ -3256,13 +3231,6 @@ int main(int argc, char** argv)
parse_args(&argc, (char***)&argv);
- /* Command line options override configured protocol */
- if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT
- && protocol_to_force != opt_protocol)
- {
- warn_protocol_override(host, &opt_protocol, protocol_to_force);
- }
-
if (!argc || opt_version)
{
if (!opt_version)
@@ -3278,6 +3246,12 @@ int main(int argc, char** argv)
my_set_max_open_files(open_files_limit);
+ if (opt_flashback && opt_raw_mode)
+ {
+ error("The --raw mode is not allowed with --flashback mode");
+ die(1);
+ }
+
if (opt_flashback)
{
my_init_dynamic_array(PSI_NOT_INSTRUMENTED, &binlog_events,
@@ -3293,7 +3267,7 @@ int main(int argc, char** argv)
if (!remote_opt)
{
error("The --raw mode only works with --read-from-remote-server");
- die();
+ die(1);
}
if (one_database)
warning("The --database option is ignored in raw mode");
@@ -3315,7 +3289,7 @@ int main(int argc, char** argv)
O_WRONLY | O_BINARY, MYF(MY_WME))))
{
error("Could not create log file '%s'", result_file_name);
- die();
+ die(1);
}
}
else
@@ -3404,7 +3378,7 @@ int main(int argc, char** argv)
/* Set delimiter back to semicolon */
if (retval != ERROR_STOP)
{
- if (!stop_event_string.is_empty())
+ if (!stop_event_string.is_empty() && result_file)
fprintf(result_file, "%s", stop_event_string.ptr());
if (!opt_raw_mode && opt_flashback)
fprintf(result_file, "DELIMITER ;\n");
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 0a5a4e1a446..6076a8cddaa 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -57,8 +57,6 @@ DYNAMIC_ARRAY tables4repair, tables4rebuild, alter_table_cmds;
DYNAMIC_ARRAY views4repair;
static uint opt_protocol=0;
-static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT;
-
enum operations { DO_CHECK=1, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_FIX_NAMES };
const char *operation_name[]=
{
@@ -283,10 +281,6 @@ get_one_option(const struct my_option *opt,
const char *filename)
{
int orig_what_to_do= what_to_do;
-
- /* Track when protocol is set via CLI to not force overrides */
- static my_bool ignore_protocol_override = FALSE;
-
DBUG_ENTER("get_one_option");
switch(opt->id) {
@@ -349,13 +343,6 @@ get_one_option(const struct my_option *opt,
case 'W':
#ifdef _WIN32
opt_protocol = MYSQL_PROTOCOL_PIPE;
-
- /* Prioritize pipe if explicit via command line */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
#endif
break;
case '#':
@@ -379,45 +366,19 @@ get_one_option(const struct my_option *opt,
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
-
- /* Specification of protocol via CLI trumps implicit overrides */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
break;
case 'P':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* If port is set via CLI, try to force protocol to TCP */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = MYSQL_PROTOCOL_TCP;
+ /* Port given on command line, switch protocol to use TCP */
+ opt_protocol= MYSQL_PROTOCOL_TCP;
}
break;
case 'S':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == MYSQL_PROTOCOL_TCP)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* Prioritize socket if set via command line */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = SOCKET_PROTOCOL_TO_FORCE;
+ /* Socket given on command line, switch protocol to use SOCKETSt */
+ opt_protocol= MYSQL_PROTOCOL_SOCKET;
}
break;
}
@@ -994,6 +955,7 @@ static int handle_request_for_tables(char *tables, size_t length,
DBUG_RETURN(1);
if (dont_quote)
{
+ DBUG_ASSERT(op);
DBUG_ASSERT(strlen(op)+strlen(tables)+strlen(options)+8+1 <= query_size);
/* No backticks here as we added them before */
@@ -1240,14 +1202,6 @@ int main(int argc, char **argv)
if (get_options(&argc, &argv))
goto end1;
-
- /* Command line options override configured protocol */
- if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT
- && protocol_to_force != opt_protocol)
- {
- warn_protocol_override(current_host, &opt_protocol, protocol_to_force);
- }
-
sf_leaking_memory=0; /* from now on we cleanup properly */
ret= EX_MYSQLERR;
diff --git a/client/mysqldump.c b/client/mysqldump.c
index ebfaec5e693..ffba37ef4ea 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -195,12 +195,10 @@ FILE *stderror_file=0;
static uint opt_protocol= 0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
-static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT;
-
/*
-Dynamic_string wrapper functions. In this file use these
-wrappers, they will terminate the process if there is
-an allocation failure.
+ Dynamic_string wrapper functions. In this file use these
+ wrappers, they will terminate the process if there is
+ an allocation failure.
*/
static void init_dynamic_string_checked(DYNAMIC_STRING *str, const char *init_str,
size_t init_alloc, size_t alloc_increment);
@@ -880,9 +878,6 @@ get_one_option(const struct my_option *opt,
const char *filename)
{
- /* Track when protocol is set via CLI to not force overrides */
- static my_bool ignore_protocol_override = FALSE;
-
switch (opt->id) {
case 'p':
if (argument == disabled_my_option)
@@ -913,13 +908,6 @@ get_one_option(const struct my_option *opt,
case 'W':
#ifdef _WIN32
opt_protocol= MYSQL_PROTOCOL_PIPE;
-
- /* Prioritize pipe if explicit via command line */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
#endif
break;
case 'N':
@@ -1070,49 +1058,23 @@ get_one_option(const struct my_option *opt,
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
-
- /* Specification of protocol via CLI trumps implicit overrides */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
break;
case (int) OPT_DEFAULT_CHARSET:
if (default_charset == disabled_my_option)
default_charset= (char *)mysql_universal_client_charset;
break;
case 'P':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* If port is set via CLI, try to force protocol to TCP */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = MYSQL_PROTOCOL_TCP;
+ /* Port given on command line, switch protocol to use TCP */
+ opt_protocol= MYSQL_PROTOCOL_TCP;
}
break;
case 'S':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == MYSQL_PROTOCOL_TCP)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* Prioritize socket if set via command line */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = SOCKET_PROTOCOL_TO_FORCE;
+ /* Socket given on command line, switch protocol to use SOCKETSt */
+ opt_protocol= MYSQL_PROTOCOL_SOCKET;
}
break;
}
@@ -1161,19 +1123,9 @@ static int get_options(int *argc, char ***argv)
return(ho_error);
/*
- Command line options override configured protocol
- */
- if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT
- && protocol_to_force != opt_protocol)
- {
- warn_protocol_override(current_host, &opt_protocol, protocol_to_force);
- }
-
-
- /*
- Dumping under --system=stats with --replace or --insert-ignore is safe and will not
- result into race condition. Otherwise dump only structure and ignore data by default
- while dumping.
+ Dumping under --system=stats with --replace or --insert-ignore is
+ safe and will not result into race condition. Otherwise dump only
+ structure and ignore data by default while dumping.
*/
if (!(opt_system & OPT_SYSTEM_STATS) && !(opt_ignore || opt_replace_into))
{
@@ -2645,7 +2597,10 @@ static uint dump_events_for_db(char *db)
/* Get database collation. */
if (fetch_db_collation(db_name_buff, db_cl_name, sizeof (db_cl_name)))
+ {
+ mysql_free_result(event_list_res);
DBUG_RETURN(1);
+ }
}
if (switch_character_set_results(mysql, "binary"))
@@ -3498,7 +3453,10 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
if (path)
{
if (!(sql_file= open_sql_file_for_table(table, O_WRONLY)))
+ {
+ mysql_free_result(result);
DBUG_RETURN(0);
+ }
write_header(sql_file, db);
}
@@ -3887,7 +3845,7 @@ static int dump_triggers_for_table(char *table_name, char *db_name)
char name_buff[NAME_LEN*4+3];
char query_buff[QUERY_LENGTH];
uint old_opt_compatible_mode= opt_compatible_mode;
- MYSQL_RES *show_triggers_rs;
+ MYSQL_RES *show_triggers_rs= NULL;
MYSQL_ROW row;
FILE *sql_file= md_result_file;
@@ -3971,8 +3929,6 @@ static int dump_triggers_for_table(char *table_name, char *db_name)
}
skip:
- mysql_free_result(show_triggers_rs);
-
if (switch_character_set_results(mysql, default_charset))
goto done;
@@ -3987,7 +3943,7 @@ skip:
done:
if (path)
my_fclose(sql_file, MYF(0));
-
+ mysql_free_result(show_triggers_rs);
DBUG_RETURN(ret);
}
@@ -4108,7 +4064,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
size_t total_length, init_length;
my_bool versioned= 0;
- MYSQL_RES *res;
+ MYSQL_RES *res= NULL;
MYSQL_FIELD *field;
MYSQL_ROW row;
DBUG_ENTER("dump_table");
@@ -4322,6 +4278,8 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
fprintf(stderr,"%s: Error in field count for table: %s ! Aborting.\n",
my_progname_short, result_table);
error= EX_CONSCHECK;
+ if (!quick)
+ mysql_free_result(res);
goto err;
}
@@ -4640,6 +4598,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
err:
dynstr_free(&query_string);
maybe_exit(error);
+ mysql_free_result(res);
DBUG_VOID_RETURN;
} /* dump_table */
@@ -4911,7 +4870,11 @@ static int dump_all_users_roles_and_grants()
" '@', QUOTE(DEFAULT_ROLE_HOST))) as r,"
" CONCAT(QUOTE(mu.USER),'@',QUOTE(mu.HOST)) as u "
"FROM mysql.user mu LEFT JOIN mysql.default_roles using (USER, HOST)"))
+ {
+ mysql_free_result(tableres);
return 1;
+ }
+
while ((row= mysql_fetch_row(tableres)))
{
if (dump_grants(row[1]))
@@ -5996,7 +5959,8 @@ static int get_sys_var_lower_case_table_names()
lower_case_table_names= atoi(row[1]);
mysql_free_result(table_res);
}
-
+ if (!row)
+ mysql_free_result(table_res);
return lower_case_table_names;
}
@@ -6239,7 +6203,11 @@ static int do_show_master_status(MYSQL *mysql_con, int consistent_binlog_pos,
}
if (have_mariadb_gtid && get_gtid_pos(gtid_pos, 1))
+ {
+ mysql_free_result(master);
return 1;
+ }
+
}
/* SHOW MASTER STATUS reports file and position */
@@ -6361,7 +6329,10 @@ static int do_show_slave_status(MYSQL *mysql_con, int use_gtid,
{
char gtid_pos[MAX_GTID_LENGTH];
if (have_mariadb_gtid && get_gtid_pos(gtid_pos, 0))
+ {
+ mysql_free_result(slave);
return 1;
+ }
if (opt_comments)
fprintf(md_result_file, "\n--\n-- Gtid position to start replication "
"from\n--\n\n");
@@ -6557,7 +6528,7 @@ static ulong find_set(TYPELIB *lib, const char *x, size_t length,
{
const char *end= x + length;
ulong found= 0;
- uint find;
+ int find;
char buff[255];
*err_pos= 0; /* No error yet */
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 6307cd0c46e..00daec49499 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -64,8 +64,6 @@ static char * opt_mysql_unix_port=0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static longlong opt_ignore_lines= -1;
-static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT;
-
#include <sslopt-vars.h>
static char **argv_to_free;
@@ -220,9 +218,6 @@ static my_bool
get_one_option(const struct my_option *opt, const char *argument,
const char *filename)
{
- /* Track when protocol is set via CLI to not force overrides */
- static my_bool ignore_protocol_override = FALSE;
-
switch(opt->id) {
case 'p':
if (argument == disabled_my_option)
@@ -249,14 +244,6 @@ get_one_option(const struct my_option *opt, const char *argument,
case 'W':
opt_protocol = MYSQL_PROTOCOL_PIPE;
opt_local_file=1;
-
- /* Prioritize pipe if explicit via command line */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
break;
#endif
case OPT_MYSQL_PROTOCOL:
@@ -266,45 +253,19 @@ get_one_option(const struct my_option *opt, const char *argument,
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
-
- /* Specification of protocol via CLI trumps implicit overrides */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
break;
case 'P':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* If port is set via CLI, try to force protocol to TCP */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = MYSQL_PROTOCOL_TCP;
+ /* Port given on command line, switch protocol to use TCP */
+ opt_protocol= MYSQL_PROTOCOL_TCP;
}
break;
case 'S':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == MYSQL_PROTOCOL_TCP)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* Prioritize socket if set via command line */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = SOCKET_PROTOCOL_TO_FORCE;
+ /* Socket given on command line, switch protocol to use SOCKETSt */
+ opt_protocol= MYSQL_PROTOCOL_SOCKET;
}
break;
case '#':
@@ -706,13 +667,6 @@ int main(int argc, char **argv)
return(1);
}
- /* Command line options override configured protocol */
- if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT
- && protocol_to_force != opt_protocol)
- {
- warn_protocol_override(current_host, &opt_protocol, protocol_to_force);
- }
-
sf_leaking_memory=0; /* from now on we cleanup properly */
if (opt_use_threads && !lock_tables)
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 236fa1e25fd..c7c200fcdfd 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -41,8 +41,6 @@ static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static uint opt_protocol=0;
-static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT;
-
static void get_options(int *argc,char ***argv);
static uint opt_mysql_port=0;
static int list_dbs(MYSQL *mysql,const char *wild);
@@ -81,14 +79,6 @@ int main(int argc, char **argv)
get_options(&argc,&argv);
-
- /* Command line options override configured protocol */
- if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT
- && protocol_to_force != opt_protocol)
- {
- warn_protocol_override(host, &opt_protocol, protocol_to_force);
- }
-
sf_leaking_memory=0; /* from now on we cleanup properly */
wild=0;
if (argc)
@@ -301,9 +291,6 @@ get_one_option(const struct my_option *opt, const char *argument,
const char *filename)
{
- /* Track when protocol is set via CLI to not force overrides */
- static my_bool ignore_protocol_override = FALSE;
-
switch(opt->id) {
case 'v':
opt_verbose++;
@@ -332,13 +319,6 @@ get_one_option(const struct my_option *opt, const char *argument,
case 'W':
#ifdef _WIN32
opt_protocol = MYSQL_PROTOCOL_PIPE;
-
- /* Prioritize pipe if explicit via command line */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
#endif
break;
case OPT_MYSQL_PROTOCOL:
@@ -348,47 +328,22 @@ get_one_option(const struct my_option *opt, const char *argument,
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
-
- /* Specification of protocol via CLI trumps implicit overrides */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
break;
case 'P':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* If port is set via CLI, try to force protocol to TCP */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = MYSQL_PROTOCOL_TCP;
+ /* Port given on command line, switch protocol to use TCP */
+ opt_protocol= MYSQL_PROTOCOL_TCP;
}
break;
case 'S':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == MYSQL_PROTOCOL_TCP)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* Prioritize socket if set via command line */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = SOCKET_PROTOCOL_TO_FORCE;
+ /* Socket given on command line, switch protocol to use SOCKETSt */
+ opt_protocol= MYSQL_PROTOCOL_SOCKET;
}
break;
+ break;
case '#':
DBUG_PUSH(argument ? argument : "d:t:o");
debug_check_flag= 1;
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 4ca69c9ed0a..54301576ba9 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -172,8 +172,6 @@ File csv_file;
static uint opt_protocol= 0;
-static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT;
-
static int get_options(int *argc,char ***argv);
static uint opt_mysql_port= 0;
@@ -335,13 +333,6 @@ int main(int argc, char **argv)
exit(1);
}
- /* Command line options override configured protocol */
- if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT
- && protocol_to_force != opt_protocol)
- {
- warn_protocol_override(host, &opt_protocol, protocol_to_force);
- }
-
sf_leaking_memory=0; /* from now on we cleanup properly */
/* Seed the random number generator if we will be using it. */
@@ -737,9 +728,6 @@ static my_bool
get_one_option(const struct my_option *opt, const char *argument,
const char *filename)
{
- /* Track when protocol is set via CLI to not force overrides */
- static my_bool ignore_protocol_override = FALSE;
-
DBUG_ENTER("get_one_option");
switch(opt->id) {
case 'v':
@@ -769,13 +757,6 @@ get_one_option(const struct my_option *opt, const char *argument,
case 'W':
#ifdef _WIN32
opt_protocol= MYSQL_PROTOCOL_PIPE;
-
- /* Prioritize pipe if explicit via command line */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
#endif
break;
case OPT_MYSQL_PROTOCOL:
@@ -785,45 +766,19 @@ get_one_option(const struct my_option *opt, const char *argument,
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
-
- /* Specification of protocol via CLI trumps implicit overrides */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
break;
case 'P':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* If port is set via CLI, try to force protocol to TCP */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = MYSQL_PROTOCOL_TCP;
+ /* Port given on command line, switch protocol to use TCP */
+ opt_protocol= MYSQL_PROTOCOL_TCP;
}
break;
case 'S':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == MYSQL_PROTOCOL_TCP)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* Prioritize socket if set via command line */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = SOCKET_PROTOCOL_TO_FORCE;
+ /* Socket given on command line, switch protocol to use SOCKETSt */
+ opt_protocol= MYSQL_PROTOCOL_SOCKET;
}
break;
case '#':
@@ -1828,6 +1783,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
uint x;
struct timeval start_time, end_time;
thread_context con;
+ int error;
pthread_t mainthread; /* Thread descriptor */
pthread_attr_t attr; /* Thread attributes */
DBUG_ENTER("run_scheduler");
@@ -1836,8 +1792,11 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
con.limit= limit;
pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr,
- PTHREAD_CREATE_DETACHED);
+ if ((error= pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED)))
+ {
+ printf("Got error: %d from pthread_attr_setdetachstate\n", error);
+ exit(1);
+ }
pthread_mutex_lock(&counter_mutex);
thread_counter= 0;
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 75e9e913074..272c14f7635 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -3630,9 +3630,11 @@ void do_system(struct st_command *command)
/* returns TRUE if path is inside a sandbox */
bool is_sub_path(const char *path, size_t plen, const char *sandbox)
{
- size_t len= strlen(sandbox);
- if (!sandbox || !len || plen <= len || memcmp(path, sandbox, len - 1)
- || path[len] != '/')
+ size_t len;
+ if (!sandbox)
+ return false;
+ len= strlen(sandbox);
+ if (plen <= len || memcmp(path, sandbox, len-1) || path[len] != '/')
return false;
return true;
}
@@ -3878,9 +3880,21 @@ void do_move_file(struct st_command *command)
sizeof(move_file_args)/sizeof(struct command_arg),
' ');
- if (bad_path(ds_to_file.str))
- DBUG_VOID_RETURN;
+ size_t from_plen = strlen(ds_from_file.str);
+ size_t to_plen = strlen(ds_to_file.str);
+ const char *vardir= getenv("MYSQLTEST_VARDIR");
+ const char *tmpdir= getenv("MYSQL_TMP_DIR");
+ if (!((is_sub_path(ds_from_file.str, from_plen, vardir) &&
+ is_sub_path(ds_to_file.str, to_plen, vardir)) ||
+ (is_sub_path(ds_from_file.str, from_plen, tmpdir) &&
+ is_sub_path(ds_to_file.str, to_plen, tmpdir)))) {
+ report_or_die("Paths '%s' and '%s' are not both under MYSQLTEST_VARDIR '%s'"
+ "or both under MYSQL_TMP_DIR '%s'",
+ ds_from_file, ds_to_file, vardir, tmpdir);
+ DBUG_VOID_RETURN;
+ }
+
DBUG_PRINT("info", ("Move %s to %s", ds_from_file.str, ds_to_file.str));
error= (my_rename(ds_from_file.str, ds_to_file.str,
MYF(disable_warnings ? 0 : MY_WME)) != 0);
@@ -5248,6 +5262,7 @@ void do_shutdown_server(struct st_command *command)
if (!timeout || wait_until_dead(pid, timeout < 5 ? 5 : timeout))
{
(void) my_kill(pid, SIGKILL);
+ wait_until_dead(pid, 5);
}
}
DBUG_VOID_RETURN;
@@ -11883,7 +11898,7 @@ void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input,
/* Sort array */
qsort(lines.buffer, lines.elements,
- sizeof(char**), (qsort_cmp)comp_lines);
+ sizeof(uchar *), (qsort_cmp)comp_lines);
/* Create new result */
for (i= 0; i < lines.elements ; i++)
diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh
index caef33b2b7d..4fb69be0947 100755
--- a/debian/autobake-deb.sh
+++ b/debian/autobake-deb.sh
@@ -16,6 +16,7 @@ set -e
# Buildbot, running the test suite from installed .debs on a clean VM.
export DEB_BUILD_OPTIONS="nocheck $DEB_BUILD_OPTIONS"
+# shellcheck source=/dev/null
source ./VERSION
# General CI optimizations to keep build output smaller
@@ -55,17 +56,26 @@ remove_rocksdb_tools()
fi
}
+add_lsb_base_depends()
+{
+ # Make sure one can run this multiple times remove
+ # lines 'sysvinit-utils' and 'lsb-base'.
+ sed -e '/sysvinit-utils/d' -e '/lsb-base/d' -i debian/control
+ # Add back lsb-base before lsof
+ sed -e 's#lsof #lsb-base (>= 3.0-10),\n lsof #' -i debian/control
+}
+
replace_uring_with_aio()
{
sed 's/liburing-dev/libaio-dev/g' -i debian/control
- sed -e '/-DIGNORE_AIO_CHECK=YES/d' \
- -e '/-DWITH_URING=YES/d' -i debian/rules
+ sed -e '/-DIGNORE_AIO_CHECK=ON/d' \
+ -e '/-DWITH_URING=ON/d' -i debian/rules
}
disable_pmem()
{
sed '/libpmem-dev/d' -i debian/control
- sed '/-DWITH_PMEM=YES/d' -i debian/rules
+ sed '/-DWITH_PMEM=ON/d' -i debian/rules
}
disable_libfmt()
@@ -98,13 +108,14 @@ fi
# If not known, use 'unknown' in .deb version identifier
if [ -z "${LSBID}" ]
then
- LSBID="unknown"
+ LSBID="unknown"
fi
case "${LSBNAME}"
in
# Debian
- buster)
+ "buster")
+ add_lsb_base_depends
disable_libfmt
replace_uring_with_aio
if [ ! "$architecture" = amd64 ]
@@ -112,7 +123,11 @@ in
disable_pmem
fi
;&
- bullseye|bookworm)
+ "bullseye"|"bookworm")
+ if [[ "${LSBNAME}" == "bullseye" ]]
+ then
+ add_lsb_base_depends
+ fi
# mariadb-plugin-rocksdb in control is 4 arches covered by the distro rocksdb-tools
# so no removal is necessary.
if [[ ! "$architecture" =~ amd64|arm64|ppc64el ]]
@@ -124,20 +139,23 @@ in
replace_uring_with_aio
fi
;&
- sid)
+ "sid")
# The default packaging should always target Debian Sid, so in this case
# there is intentionally no customizations whatsoever.
;;
# Ubuntu
- bionic)
+ "bionic")
+ add_lsb_base_depends
remove_rocksdb_tools
[ "$architecture" != amd64 ] && disable_pmem
;&
- focal)
+ "focal")
+ add_lsb_base_depends
replace_uring_with_aio
disable_libfmt
;&
- impish|jammy|kinetic|lunar)
+ "impish"|"jammy"|"kinetic"|"lunar")
+ add_lsb_base_depends
# mariadb-plugin-rocksdb s390x not supported by us (yet)
# ubuntu doesn't support mips64el yet, so keep this just
# in case something changes.
@@ -178,17 +196,39 @@ dch -b -D "${LSBNAME}" -v "${VERSION}" "Automatic build with ${LOGSTRING}." --co
echo "Creating package version ${VERSION} ... "
+BUILDPACKAGE_DPKGCMD=()
+
+# Fakeroot test
+if fakeroot true; then
+ BUILDPACKAGE_DPKGCMD+=( "fakeroot" "--" )
+fi
+
# Use eatmydata is available to build faster with less I/O, skipping fsync()
# during the entire build process (safe because a build can always be restarted)
if which eatmydata > /dev/null
then
- BUILDPACKAGE_PREPEND=eatmydata
+ BUILDPACKAGE_DPKGCMD+=("eatmydata")
+fi
+
+BUILDPACKAGE_DPKGCMD+=("dpkg-buildpackage")
+
+# Using dpkg-buildpackage args
+# -us Allow unsigned sources
+# -uc Allow unsigned changes
+# -I Tar ignore
+BUILDPACKAGE_DPKGCMD+=(-us -uc -I)
+
+# There can be also extra flags that are appended to args
+if [ -n "$BUILDPACKAGE_FLAGS" ]
+then
+ read -ra BUILDPACKAGE_TMP_ARGS <<< "$BUILDPACKAGE_FLAGS"
+ BUILDPACKAGE_DPKGCMD+=( "${BUILDPACKAGE_TMP_ARGS[@]}" )
fi
# Build the package
# Pass -I so that .git and other unnecessary temporary and source control files
# will be ignored by dpkg-source when creating the tar.gz source package.
-fakeroot $BUILDPACKAGE_PREPEND dpkg-buildpackage -us -uc -I $BUILDPACKAGE_FLAGS
+"${BUILDPACKAGE_DPKGCMD[@]}"
# If the step above fails due to missing dependencies, you can manually run
# sudo mk-build-deps debian/control -r -i
diff --git a/debian/control b/debian/control
index ae4b5e3ba95..09d5dce0e6c 100644
--- a/debian/control
+++ b/debian/control
@@ -320,13 +320,17 @@ Breaks: mariadb-client (<< ${source:Version}),
mariadb-server-core-10.6,
mariadb-server-core-10.7,
mariadb-server-core-10.8,
+ mysql-cluster-community-client-plugins,
mysql-server-core-5.5,
mysql-server-core-5.6,
mysql-server-core-5.7,
mysql-server-core-8.0,
percona-server-server-5.6,
+ percona-server-server-5.7,
+ percona-server-server-8.0,
percona-xtradb-cluster-server-5.6,
- percona-xtradb-cluster-server-5.7
+ percona-xtradb-cluster-server-5.7,
+ percona-xtradb-cluster-server-8.0
Replaces: mariadb-client (<< ${source:Version}),
mariadb-client-10.0,
mariadb-client-10.1,
@@ -375,13 +379,17 @@ Replaces: mariadb-client (<< ${source:Version}),
mysql-client-core-5.6,
mysql-client-core-5.7,
mysql-client-core-8.0,
+ mysql-cluster-community-client-plugins,
mysql-server-core-5.5,
mysql-server-core-5.6,
mysql-server-core-5.7,
mysql-server-core-8.0,
percona-server-server-5.6,
+ percona-server-server-5.7,
+ percona-server-server-8.0,
percona-xtradb-cluster-server-5.6,
percona-xtradb-cluster-server-5.7,
+ percona-xtradb-cluster-server-8.0,
virtual-mysql-client-core
Provides: default-mysql-client-core,
virtual-mysql-client-core
@@ -669,6 +677,7 @@ Breaks: mariadb-client (<< ${source:Version}),
mariadb-server (<< ${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,
@@ -696,6 +705,7 @@ Replaces: mariadb-client (<< ${source:Version}),
mariadb-server (<< ${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,
@@ -753,7 +763,6 @@ Depends: galera-4 (>= 26.4),
gawk,
iproute2 [linux-any],
libdbi-perl,
- lsb-base (>= 3.0-10),
lsof [linux-any],
mariadb-client (>= ${source:Version}),
mariadb-server-core (>= ${source:Version}),
@@ -900,9 +909,11 @@ Package: mariadb-backup
Architecture: any
Breaks: mariadb-backup-10.1,
mariadb-backup-10.2,
+ mariadb-backup-10.3,
mariadb-client-10.1
Replaces: mariadb-backup-10.1,
mariadb-backup-10.2,
+ mariadb-backup-10.3,
mariadb-client-10.1
Depends: mariadb-client-core (= ${binary:Version}),
${misc:Depends},
@@ -921,16 +932,21 @@ Depends: libxml2,
unixodbc,
${misc:Depends},
${shlibs:Depends}
+Recommends: curl
Breaks: mariadb-connect-engine-10.0,
mariadb-connect-engine-10.1,
mariadb-connect-engine-10.2,
mariadb-connect-engine-10.3,
- mariadb-connect-engine-10.4
+ mariadb-connect-engine-10.4,
+ mariadb-server-10.0,
+ mariadb-server-10.1
Replaces: mariadb-connect-engine-10.0,
mariadb-connect-engine-10.1,
mariadb-connect-engine-10.2,
mariadb-connect-engine-10.3,
- mariadb-connect-engine-10.4
+ mariadb-connect-engine-10.4,
+ mariadb-server-10.0,
+ mariadb-server-10.1
Description: Connect storage engine for MariaDB
Connect engine supports a number of file formats (dbf, xml, txt, bin, etc),
connections to ODBC tables and remote MySQL tables, as well as a number of
@@ -951,7 +967,7 @@ Description: Amazon S3 archival storage engine for MariaDB
Package: mariadb-plugin-rocksdb
Architecture: amd64 arm64 mips64el ppc64el
Depends: mariadb-server (= ${server:Version}),
- python3,
+ python3:any,
rocksdb-tools,
${misc:Depends},
${shlibs:Depends}
@@ -977,12 +993,16 @@ Breaks: mariadb-oqgraph-engine-10.0,
mariadb-oqgraph-engine-10.1,
mariadb-oqgraph-engine-10.2,
mariadb-oqgraph-engine-10.3,
- mariadb-oqgraph-engine-10.4
+ mariadb-oqgraph-engine-10.4,
+ mariadb-server-10.0,
+ mariadb-server-10.1
Replaces: mariadb-oqgraph-engine-10.0,
mariadb-oqgraph-engine-10.1,
mariadb-oqgraph-engine-10.2,
mariadb-oqgraph-engine-10.3,
- mariadb-oqgraph-engine-10.4
+ mariadb-oqgraph-engine-10.4,
+ mariadb-server-10.0,
+ mariadb-server-10.1
Description: OQGraph storage engine for MariaDB
The OQGraph engine is a computation engine plugin for handling hierarchies
(trees) and graphs (friend-of-a-friend, etc) cleanly through standard SQL.
@@ -1038,11 +1058,15 @@ Depends: libgssapi-krb5-2,
Breaks: mariadb-gssapi-server-10.1,
mariadb-gssapi-server-10.2,
mariadb-gssapi-server-10.3,
- mariadb-gssapi-server-10.4
+ mariadb-gssapi-server-10.4,
+ mariadb-server-10.0,
+ mariadb-server-10.1
Replaces: mariadb-gssapi-server-10.1,
mariadb-gssapi-server-10.2,
mariadb-gssapi-server-10.3,
- mariadb-gssapi-server-10.4
+ mariadb-gssapi-server-10.4,
+ mariadb-server-10.0,
+ mariadb-server-10.1
Description: GSSAPI authentication plugin for MariaDB server
This plugin includes support for Kerberos on Unix, but can also be used for
Windows authentication with or without domain environment.
@@ -1201,6 +1225,8 @@ Replaces: mariadb-test-10.0,
mariadb-test-5.5,
mysql-client-5.5,
mysql-server-5.5,
+ mysql-server-5.7,
+ mysql-server-core-8.0,
mysql-testsuite,
mysql-testsuite-5.5,
mysql-testsuite-5.6,
diff --git a/debian/libmariadb-dev.install b/debian/libmariadb-dev.install
index 0f82ac68d7d..c015d59ae9b 100644
--- a/debian/libmariadb-dev.install
+++ b/debian/libmariadb-dev.install
@@ -12,10 +12,10 @@ usr/include/mariadb/mariadb_dyncol.h
usr/include/mariadb/mariadb_rpl.h
usr/include/mariadb/mariadb_stmt.h
usr/include/mariadb/mariadb_version.h
+usr/include/mariadb/my_alloca.h
usr/include/mariadb/my_config.h
usr/include/mariadb/my_global.h
usr/include/mariadb/my_sys.h
-usr/include/mariadb/my_alloca.h
usr/include/mariadb/mysql.h
usr/include/mariadb/mysql/
usr/include/mariadb/mysql/client_plugin.h
diff --git a/debian/libmariadb-dev.lintian-overrides b/debian/libmariadb-dev.lintian-overrides
index 345b537a521..6a162120f24 100644
--- a/debian/libmariadb-dev.lintian-overrides
+++ b/debian/libmariadb-dev.lintian-overrides
@@ -1 +1,2 @@
+# This is how upstream does it, wont' fix
arch-dependent-file-not-in-arch-specific-directory usr/bin/mariadb_config
diff --git a/debian/mariadb-server.preinst b/debian/mariadb-server.preinst
index e2d8e670bbf..2204d230bdd 100644
--- a/debian/mariadb-server.preinst
+++ b/debian/mariadb-server.preinst
@@ -118,6 +118,18 @@ then
fi
+# If there is no debian-*.flag, and no version was detected, but a file that
+# indicated MySQL 8.0 is found (undo_001 is created by default in MySQL 8.0+
+# installs), then that file is enough of additional indication to trigger the
+# move of the data directory.
+if [ -z "$found_version" ] &&
+ [ -z "$(find $mysql_datadir/debian-*.flag 2> /dev/null)" ] &&
+ [ -f "$mysql_datadir/undo_001" ]
+then
+ echo "$mysql_datadir: no server version flag found, assuming MySQL 8.0 data encountered"
+ downgrade_detected=true
+ found_version="previous" # Just use dummy name as we don't know real version
+fi
# Don't abort dpkg if downgrade is detected (as was done previously).
# Instead simply move the old datadir and create a new for this_version.
@@ -132,8 +144,8 @@ then
echo "Please manually export/import your data (e.g. with mysqldump) if needed." 1>&2
mv -f "$mysql_datadir" "$mysql_datadir-$found_version"
# Also move away the old debian.cnf file that included credentials that are
- # no longer valid
- mv -f /etc/mysql/debian.cnf "/etc/mysql/debian.cnf-$found_version"
+ # no longer valid. If none existed, ignore error and let dpkg continue.
+ mv -f /etc/mysql/debian.cnf "/etc/mysql/debian.cnf-$found_version" || true
fi
# to be sure
diff --git a/debian/rules b/debian/rules
index 85ba7d0da12..08ca3b8f96e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,10 +1,7 @@
#!/usr/bin/make -f
-export DH_VERBOSE=1
-export DEB_BUILD_HARDENING=1
-
-# enable Debian Hardening
-# see: https://wiki.debian.org/Hardening
+# Enable Debian Hardening
+# https://wiki.debian.org/Hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# Disable LTO on Ubuntu, see LP: #1970634 and https://jira.mariadb.org/browse/MDEV-25633
@@ -66,8 +63,8 @@ endif
# Only attempt to build with PMEM on archs that have package libpmem-dev available
# See https://packages.debian.org/search?searchon=names&keywords=libpmem-dev
-ifneq (,$(filter $(DEB_HOST_ARCH_CPU),amd64 arm64 ppc64el riscv64))
- CMAKEFLAGS += -DWITH_PMEM=YES
+ifneq (,$(filter $(DEB_HOST_ARCH),amd64 arm64 ppc64el riscv64))
+ CMAKEFLAGS += -DWITH_PMEM=ON
endif
# Add support for verbose builds
@@ -99,6 +96,9 @@ endif
# quality standards in Debian. Also building it requires an extra 4 GB of disk
# space which makes native Debian builds fail as the total disk space needed
# for MariaDB becomes over 10 GB. Only build CS via autobake-deb.sh.
+ #
+ # Note: Don't use '-DWITH_URING=ON' as some Buildbot builders are missing it
+ # and would fail permanently.
PATH=$${MYSQL_BUILD_PATH:-"/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin"} \
NO_UPDATE_BUILD_VERSION=1 \
dh_auto_configure --builddirectory=$(BUILDDIR) -- \
@@ -113,8 +113,7 @@ endif
-DCONC_DEFAULT_CHARSET=utf8mb4 \
-DPLUGIN_AWS_KEY_MANAGEMENT=NO \
-DPLUGIN_COLUMNSTORE=NO \
- -DIGNORE_AIO_CHECK=YES \
- -DWITH_URING=YES \
+ -DIGNORE_AIO_CHECK=ON \
-DDEB=$(DEB_VENDOR)
# This is needed, otherwise 'make test' will run before binaries have been built
@@ -129,6 +128,7 @@ override_dh_auto_test:
dh_testdir
# Ensure at least an empty file exists
touch mysql-test/unstable-tests
+ # Skip unstable tests if such are defined for arch
[ ! -f debian/unstable-tests.$(DEB_HOST_ARCH) ] || cat debian/unstable-tests.$(DEB_HOST_ARCH) >> mysql-test/unstable-tests
# Run testsuite
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml
index 91013f2ca03..15626d2afbc 100644
--- a/debian/salsa-ci.yml
+++ b/debian/salsa-ci.yml
@@ -7,7 +7,7 @@ include:
# Override Salsa-CI with MariaDB specific variations
variables:
DEB_BUILD_OPTIONS: "nocheck noautodbgsym"
- RELEASE: sid
+ RELEASE: bullseye
SALSA_CI_DISABLE_REPROTEST: 1
SALSA_CI_DISABLE_MISSING_BREAKS: 0
SALSA_CI_DISABLE_RC_BUGS: 1
@@ -25,8 +25,8 @@ stages:
- provisioning
- build
- test
- - upgrade in Sid
- - upgrade from Bullseye
+ - upgrade in Bullseye
+ - upgrade from Buster
- upgrade extras
- test extras
- publish # Stage referenced by Salsa-CI template aptly stanza, so must exist even though not used
@@ -51,26 +51,26 @@ build:
- ccache -s # Show ccache stats to validate it worked
- mv ${CCACHE_TMP_DIR} ${CCACHE_WORK_DIR}
-build bullseye-backports:
- extends: .build-package
- variables:
- RELEASE: bullseye-backports
-
-# base image missing git
build i386:
+ extends: .build-package-i386
+ script:
+ - *autobake-deb-steps
+
+build sid:
extends: .build-package
script:
- - apt-get update && apt-get install -y --no-install-recommends git
- *autobake-deb-steps
- image: $SALSA_CI_IMAGES_BASE_I386
variables:
- ARCH: 'i386'
+ RELEASE: sid
# Build native deb without using autobake-deb.sh. This way we will detect
# if the debian/control file and other packaging is correct as-is for Debian Sid.
-build native deb:
+build native deb amd64:
extends: .build-package
+build native deb i386:
+ extends: .build-package-i386
+
autopkgtest:
extends: .test-autopkgtest
artifacts:
@@ -86,7 +86,7 @@ blhc:
stage: test extras
# Build log checker needs a .build file and thus only works on native build
needs:
- - job: build native deb
+ - job: build native deb amd64
# In addition to Salsa-CI, also run these fully MariaDB specific build jobs
@@ -101,13 +101,7 @@ blhc:
# Avoid the warnings of "debconf: unable to initialize frontend: Dialog"
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# Prime the apt cache so later apt commands can run
- apt-get update
-
-# Readline was removed from Debian Sid (and Bullseye) in Feb 2021. To be able to install older
-# versions of MariaDB that depend on it, fetch and install it from Buster.
-.test-install-readline-in-sid-for-backwards-compat: &test-install-readline-in-sid-for-backwards-compat |
- curl -O http://ftp.de.debian.org/debian/pool/main/r/readline5/libreadline5_5.2+dfsg-3+b13_amd64.deb
- apt install -y ./libreadline5_5.2+dfsg-3+b13_amd64.deb
+ apt-get update -qq
.test-verify-initial: &test-verify-initial |
dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
@@ -118,12 +112,23 @@ blhc:
mysql --table -e "SELECT * FROM plugin;" mysql
mysql --table -e "SHOW PLUGINS;" mysql
-.test-enable-sid-repos: &test-enable-sid-repos |
+.test-enable-bullseye-repos: &test-enable-bullseye-repos
# Replace any old repos with just Sid
- echo 'deb http://deb.debian.org/debian sid main' > /etc/apt/sources.list
+ - echo 'deb http://deb.debian.org/debian bullseye main' > /etc/apt/sources.list
# Upgrade minimal stack first
- apt-get update
- apt-get install -y apt
+ - apt-get update -qq
+ - apt-get install -y apt
+
+.test-enable-bullseye-backports-repos: &test-enable-bullseye-backports-repos |
+ # Enable bullseye-backports (assumes environment already Debian Bullseye)
+ echo 'deb http://deb.debian.org/debian bullseye-backports main' > /etc/apt/sources.list.d/bullseye-backports.list
+ # Increase default backports priority policy from '100' to '500' so it can actually be used
+ cat << EOF > /etc/apt/preferences.d/enable-backports-to-satisfy-dependencies
+ Package: *
+ Pin: release n=bullseye-*
+ Pin-Priority: 500
+ EOF
+ apt-get update -qq
.test-enable-buster-backports-repos: &test-enable-buster-backports-repos |
# Enable buster-backports (assumes environment already Debian Buster)
@@ -134,14 +139,14 @@ blhc:
Pin: release n=buster-*
Pin-Priority: 500
EOF
- apt-get update
+ apt-get update -qq
-.test-install: &test-install |
+.test-install: &test-install
# Install MariaDB built in this commit
- apt-get install -y ./*.deb
+ - apt-get install -y ./*.deb
# Verify installation of MariaDB built in this commit
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- mariadb --version # Client version
+ - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
+ - mariadb --version # Client version
.test-verify-final: &test-verify-final |
mkdir -p debug # Ensure dir exists before using it
@@ -223,8 +228,8 @@ fresh install:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-mariadb Sid upgrade:
- stage: upgrade in Sid
+mariadb-10.5 Bullseye upgrade:
+ stage: upgrade in Bullseye
needs:
- job: build
image: debian:${RELEASE}
@@ -235,6 +240,9 @@ mariadb Sid upgrade:
- ${WORKING_DIR}/debug
script:
- *test-prepare-container
+ # Install everything MariaDB 10.5 currently in Debian Bullseye
+ - apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadb*'
+ - *test-verify-initial
- *test-install
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- *test-verify-final
@@ -244,11 +252,40 @@ mariadb Sid upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-mariadb-10.5 Bullseye to mariadb upgrade:
- stage: upgrade from Bullseye
+mariadb-10.3 with Buster backports upgrade:
+ stage: upgrade extras
+ needs:
+ - job: build buster-backports
+ image: debian:buster
+ artifacts:
+ when: always
+ name: "$CI_BUILD_NAME"
+ paths:
+ - ${WORKING_DIR}/debug
+ script:
+ - *test-prepare-container
+ # Install everything MariaDB 10.3 currently in Debian Buster
+ - apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadb*'
+ # Verify installation of MariaDB from Buster
+ - *test-verify-initial
+ # Buster backports is needed for liburing1 (>= 0.7) and galera-4 (>= 26.4)
+ - *test-enable-buster-backports-repos
+ - *test-install
+ # mariadb-10.3 in Buster ships a /etc/init.d/mysql so it should continue to work
+ - service mysql status
+ - service mariadb status
+ - *test-verify-final
+ variables:
+ GIT_STRATEGY: none
+ except:
+ variables:
+ - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
+
+mariadb-10.3 Buster upgrade:
+ stage: upgrade from Buster
needs:
- job: build
- image: debian:bullseye
+ image: debian:buster
artifacts:
when: always
name: "$CI_BUILD_NAME"
@@ -256,12 +293,14 @@ mariadb-10.5 Bullseye to mariadb upgrade:
- ${WORKING_DIR}/debug
script:
- *test-prepare-container
- # Install everything MariaDB currently in Debian Bullseye
+ # Install everything MariaDB 10.3 currently in Debian Buster
- apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadb*'
- # Verify installation of MariaDB from Bullseye
+ # Verify installation of MariaDB from Buster
- *test-verify-initial
- - *test-enable-sid-repos
+ - *test-enable-bullseye-repos
- *test-install
+ # mariadb-10.3 in Buster ships a /etc/init.d/mysql so it should continue to work
+ - service mysql status
- service mariadb status
- *test-verify-final
variables:
@@ -374,41 +413,8 @@ build mariadbclient consumer Python-MySQLdb:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-libmysql* to libmariadb* upgrade:
- stage: upgrade in Sid
- needs:
- - job: build
- image: debian:${RELEASE}
- artifacts:
- when: always
- name: "$CI_BUILD_NAME"
- paths:
- - ${WORKING_DIR}/debug
- script:
- - *test-prepare-container
- # Install all libmysql* available in Debian unstable
- - apt-get install -y pkg-config libmysqlclient-dev
- - pkg-config --list-all
- - pkg-config --cflags mysqlclient # mysqlclient.pc from original package
- - apt-get install -y ./libmariadb3_*.deb ./mariadb-common_*.deb
- - pkg-config --list-all
- - apt-get install -y ./libmariadb-dev_*.deb
- - pkg-config --list-all
- - apt-get install -y ./libmariadb-dev-compat_*.deb
- - pkg-config --cflags mysqlclient # mysqlclient.pc from compat package
- - pkg-config --list-all
- - apt-get install -y ./libmariadbd19_*.deb
- - pkg-config --list-all
- - apt-get install -y ./libmariadbd-dev_*.deb
- - pkg-config --list-all
- - apt-get install -y default-libmysqlclient-dev default-libmysqld-dev
- - *test-verify-libs
- except:
- variables:
- - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-
-default-libmysqlclient-dev Sid upgrade:
- stage: upgrade in Sid
+default-libmysqlclient-dev Bullseye upgrade:
+ stage: upgrade in Bullseye
needs:
- job: build
image: debian:${RELEASE}
@@ -427,11 +433,11 @@ default-libmysqlclient-dev Sid upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-default-libmysqlclient-dev Bullseye upgrade:
- stage: upgrade from Bullseye
+default-libmysqlclient-dev Buster upgrade:
+ stage: upgrade from Buster
needs:
- job: build
- image: debian:bullseye
+ image: debian:buster
artifacts:
when: always
name: "$CI_BUILD_NAME"
@@ -441,7 +447,7 @@ default-libmysqlclient-dev Bullseye upgrade:
- *test-prepare-container
- apt-get install -y pkg-config default-libmysqlclient-dev
- pkg-config --list-all
- - *test-enable-sid-repos
+ - *test-enable-bullseye-repos
- *test-install-all-libs
- *test-verify-libs
except:
@@ -450,50 +456,14 @@ default-libmysqlclient-dev Bullseye 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 upgrade:
- stage: upgrade in Sid
- needs:
- - job: build
- image: debian:sid
- artifacts:
- when: always
- name: "$CI_BUILD_NAME"
- paths:
- - ${WORKING_DIR}/debug
- script:
- - *test-prepare-container
- # The postinst fails often if 'ps' is missing from system, so install procps
- - apt-get install -y procps mysql-server 'libmysqlc*'
- - *test-verify-initial
- - *test-install
- # The Debian version of MariaDB 10.6 still maintains compatibility and there
- # running 'service mysql status' in Salsa-CI job 'mysql-8.0 Sid to
- # mariadb-10.6 upgrade' still works.
- #
- # However, due to debian/control changes, the upstream MariaDB 10.6 when
- # installed on a system with a previous installation of MySQL 8.0 will first
- # fully remove MySQL, including the /etc/init.d/mysql file, so previous
- # techniques in mariadb-server-10.6.postinst to maintain backwards
- # compatibility with 'service mysql status' after installing MariaDB on top
- # MySQL no longer works, and thus the step to test it now intentionally has
- # a fallback to use the service name 'mariadb' instead, and the fallback is
- # always used.
- - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server
- - service mysql status || service mariadb status
- - *test-verify-final
- variables:
- GIT_STRATEGY: none
- except:
- variables:
- - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-
-# 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 Jammy to mariadb upgrade:
+#
+# Testing on Focal binaries on Buster works. Using Jammy binaries on Bullseye
+# does not work as libc in Jammy is too new.
+mysql-8.0 from Ubuntu 22.04 upgrade:
stage: upgrade extras
needs:
- - job: build bullseye-backports
- image: debian:bullseye
+ - job: build
+ image: debian:${RELEASE}
artifacts:
when: always
name: "$CI_BUILD_NAME"
@@ -505,13 +475,11 @@ mysql-8.0 Jammy to mariadb upgrade:
- apt-get install --no-install-recommends --yes gpg gpg-agent dirmngr ca-certificates # Bare minimal (<4MB) for apt-key to work
- apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 871920D1991BC93C 3B4FE6ACC0B21F32
- echo "deb http://archive.ubuntu.com/ubuntu/ focal main restricted" > /etc/apt/sources.list.d/ubuntu.list
- - apt-get update
+ - apt-get update -qq
# First install often fail due to bug in mysql-8.0
- apt-get install -y mysql-server 'libmysqlc*' || true
- sleep 10 && apt-get install -f
- *test-verify-initial
- # Enable backports to make galera-4 available
- - echo "deb http://deb.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list && apt-get update
- *test-install
- service mysql status
- sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server
@@ -650,6 +618,43 @@ mariadb.org-10.8 to mariadb upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
+# 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-community-cluster-8.0 from MySQL.com upgrade:
+ stage: upgrade extras
+ needs:
+ - job: build
+ image: debian:${RELEASE}
+ artifacts:
+ when: always
+ name: "$CI_BUILD_NAME"
+ paths:
+ - ${WORKING_DIR}/debug
+ script:
+ - *test-prepare-container
+ - apt-get install --no-install-recommends --yes ca-certificates curl systemctl
+ - curl -sS "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x859be8d7c586f538430b19c2467b942d3a79bd29" -o /etc/apt/trusted.gpg.d/mysql.asc
+ - echo "deb https://repo.mysql.com/apt/debian/ bullseye mysql-cluster-8.0" > /etc/apt/sources.list.d/mysql.list
+ - apt-get update -qq
+ - apt-get install -y mysql-cluster-community-server
+ - sed 's/ExecStartPre=+/ExecStartPre=/' -i /lib/systemd/system/mysql.service # Hack to make file compatible with systemctl shim
+ - systemctl start mysql
+ - dpkg -l | grep -iE 'maria|mysql|galera'
+ - systemctl status mysql; mysql -e 'SELECT VERSION()'
+ - systemctl stop mysql # Stop manually as maintainer scripts don't handle this with systemctl shim
+ - *test-install
+ # Ignore systemctl shim result as MariaDB systemd file is incompatible with it and yields:
+ # ERROR:systemctl:the ExecStartPre control process exited with error code
+ - systemctl status mysql || true
+ - mysql -e 'SELECT VERSION()' || true
+ - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server
+ - *test-verify-final
+ variables:
+ GIT_STRATEGY: none
+ except:
+ variables:
+ - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
+
mariadb.org-10.7 to mariadb upgrade:
stage: upgrade extras
needs:
@@ -694,10 +699,10 @@ mariadb.org-10.6 to mariadb upgrade:
- ${WORKING_DIR}/debug
script:
- *test-prepare-container
- - apt install -y curl
+ - apt-get -qq install --no-install-recommends --yes ca-certificates curl
- curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc
- echo "deb https://deb.mariadb.org/10.6/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list
- - apt-get update
+ - apt-get update -qq
- apt-get install -y mariadb-server-10.6
- *test-verify-initial
# Install MariaDB built in this commit
@@ -726,16 +731,13 @@ mariadb.org-10.5 to mariadb upgrade:
- ${WORKING_DIR}/debug
script:
- *test-prepare-container
- - apt install -y curl
+ - apt-get -qq install --no-install-recommends --yes ca-certificates curl
- curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc
- echo "deb https://archive.mariadb.org/mariadb-10.5/repo/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list
- - apt-get update
+ - apt-get update -qq
- apt-get install -y mariadb-server-10.5
- *test-verify-initial
- # Install MariaDB built in this commit
- # Verify installation of MariaDB built in this commit
- - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- - mariadb --version # Client version
+ - *test-install
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- *test-verify-final
variables:
@@ -744,11 +746,11 @@ mariadb.org-10.5 to mariadb upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-mariadb.org-10.4 to mariadb upgrade:
+mariadb.org-10.4 to mariadb with Buster backports upgrade:
stage: upgrade extras
needs:
- - job: build
- image: debian:${RELEASE}
+ - job: build buster-backports
+ image: debian:buster
artifacts:
when: always
name: "$CI_BUILD_NAME"
@@ -756,16 +758,17 @@ mariadb.org-10.4 to mariadb upgrade:
- ${WORKING_DIR}/debug
script:
- *test-prepare-container
- - apt install -y curl systemctl # systemctl shim needed on platforms that don't have systemd
+ - apt-get -qq install --no-install-recommends --yes ca-certificates curl
- curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc
- - echo "deb https://archive.mariadb.org/mariadb-10.4/repo/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list
- - apt-get update
- - *test-install-readline-in-sid-for-backwards-compat
+ - echo "deb https://archive.mariadb.org/mariadb-10.4/repo/debian buster main" > /etc/apt/sources.list.d/mariadb.list
+ - apt-get update -qq
- apt-get install -y mariadb-server-10.4
# MariaDB.org version of 10.4 and early 10.5 do not install an init file, so
# it must be installed here manually
- cp /usr/share/mysql/mysql.init /etc/init.d/mysql; chmod +x /etc/init.d/mysql; service mysql start; sleep 5
- *test-verify-initial
+ # Buster backports is needed for liburing1 (>= 0.7) and galera-4 (>= 26.4)
+ - *test-enable-buster-backports-repos
- *test-install
- sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server
- service mysql status
@@ -777,11 +780,11 @@ mariadb.org-10.4 to mariadb upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-mariadb.org-10.3 to mariadb upgrade:
+mariadb.org-10.3 to mariadb with Buster backports upgrade:
stage: upgrade extras
needs:
- - job: build
- image: debian:${RELEASE}
+ - job: build bullseye-backports
+ image: debian:bullseye
artifacts:
when: always
name: "$CI_BUILD_NAME"
@@ -789,13 +792,14 @@ mariadb.org-10.3 to mariadb upgrade:
- ${WORKING_DIR}/debug
script:
- *test-prepare-container
- - apt install -y curl
+ - apt-get -qq install --no-install-recommends --yes ca-certificates curl
- curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc
- - echo "deb https://archive.mariadb.org/mariadb-10.3/repo/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list
- - apt-get update
- - *test-install-readline-in-sid-for-backwards-compat
+ - echo "deb https://archive.mariadb.org/mariadb-10.3/repo/debian buster main" > /etc/apt/sources.list.d/mariadb.list
+ - apt-get update -qq
- apt-get install -y mariadb-server-10.3
- *test-verify-initial
+ # Buster backports is needed for liburing1 (>= 0.7) and galera-4 (>= 26.4)
+ - *test-enable-buster-backports-repos
- *test-install
- service mysql status
# Give the mariadb-upgrade plenty of time to complete, otherwise next commands
@@ -808,7 +812,10 @@ mariadb.org-10.3 to mariadb upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-mariadb.org-10.2 to mariadb upgrade:
+# archive.mariadb.org has for 10.2 only Stretch, so we can't test upgrades to
+# 10.6 with only Buster and Bullseye builds
+
+mysql.com-5.7 upgrade:
stage: upgrade extras
needs:
- job: build
@@ -820,26 +827,25 @@ mariadb.org-10.2 to mariadb upgrade:
- ${WORKING_DIR}/debug
script:
- *test-prepare-container
- - apt install -y curl
- - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc
- - echo "deb https://archive.mariadb.org/mariadb-10.2/repo/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list
- - apt-get update
- - *test-install-readline-in-sid-for-backwards-compat
- - apt-get install -y mariadb-server-10.2
- # Verify initial state before upgrade
- - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- - service mysql status
- # prepending with --defaults-file=/etc/mysql/debian.cnf is needed in upstream 5.5–10.3
- |
- mysql --defaults-file=/etc/mysql/debian.cnf --skip-column-names -e "SELECT @@version, @@version_comment"
- mysql --defaults-file=/etc/mysql/debian.cnf --table -e "SHOW DATABASES;"
- mysql --defaults-file=/etc/mysql/debian.cnf --table -e "SELECT * FROM mysql.user; SHOW CREATE USER root@localhost;"
- mysql --defaults-file=/etc/mysql/debian.cnf --table -e "SELECT * FROM mysql.plugin; SHOW PLUGINS;"
+ apt-get install --no-install-recommends --yes gpg gpg-agent dirmngr ca-certificates # Bare minimal (<4MB) for apt-key to work
+ apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 467B942D3A79BD29
+ echo "deb https://repo.mysql.com/apt/debian/ bullseye mysql-5.7" > /etc/apt/sources.list.d/mysql.list
+ apt-get update -qq
+ apt-get install -y 'mysql*' 'libmysqlc*'
+ - *test-verify-initial
- *test-install
- - service mysql status
- # Give the mariadb-upgrade plenty of time to complete, otherwise next commands
- # fail on non-existing mariadb.sys user
- - sleep 15
+ # Due to some (currently unknown) changes in MySQL 5.7 packaging or apt
+ # behaviour changes, a system with a previous installation of MySQL will
+ # on upgrades to MariaDB first fully remove MySQL, including the
+ # /etc/init.d/mysql file, so previous techniques in
+ # mariadb-server-10.6.postinst to maintain backwards compatibility with
+ # 'service mysql status' after installing MariaDB on top MySQL no longer
+ # works. Thus the step to test it now intentionally has a fallback to use
+ # the service name 'mariadb' instead, and the fallback is always used.
+ - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server
+ - service mariadb status # There is no init.d/mysql in MariaDB 10.5+
+ - sleep 15 # Give the mysql_upgrade a bit of extra time to complete with MySQL 5.7 before querying the server
- *test-verify-final
variables:
GIT_STRATEGY: none
@@ -847,11 +853,11 @@ mariadb.org-10.2 to mariadb upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
-mysql.com-5.7 to mariadb upgrade:
+percona-xtradb-5.7 upgrade:
stage: upgrade extras
needs:
- - job: build bullseye-backports
- image: debian:bullseye
+ - job: build
+ image: debian:${RELEASE}
artifacts:
when: always
name: "$CI_BUILD_NAME"
@@ -861,15 +867,14 @@ mysql.com-5.7 to mariadb upgrade:
- *test-prepare-container
- |
apt-get install --no-install-recommends --yes gpg gpg-agent dirmngr ca-certificates # Bare minimal (<4MB) for apt-key to work
- apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 467B942D3A79BD29
- echo "deb https://repo.mysql.com/apt/debian/ bullseye mysql-5.7" > /etc/apt/sources.list.d/mysql.list
- apt-get update
- apt-get install -y 'mysql*' 'libmysqlc*'
+ apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 9334A25F8507EFA5
+ echo "deb https://repo.percona.com/apt/ ${RELEASE} main" > /etc/apt/sources.list.d/mysql.list
+ apt-get update -qq
+ apt-get install -y percona-xtradb-cluster-full-57 percona-xtrabackup-24 percona-toolkit pmm2-client
+ - service mysql status
- *test-verify-initial
- # Enable backports to make galera-4 available
- - echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list.d/backports.list && apt-get update
- *test-install
- - service mariadb status # There is no init.d/mysql in MariaDB 10.5+
+ - service mysql status
- sleep 15 # Give the mysql_upgrade a bit of extra time to complete with MySQL 5.7 before querying the server
- *test-verify-final
variables:
diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc
index da77c651c88..1827601dae0 100644
--- a/extra/mariabackup/backup_copy.cc
+++ b/extra/mariabackup/backup_copy.cc
@@ -79,9 +79,8 @@ bool binlog_locked;
static void rocksdb_create_checkpoint();
static bool has_rocksdb_plugin();
-static void copy_or_move_dir(const char *from, const char *to, bool copy, bool allow_hardlinks);
-static void rocksdb_backup_checkpoint();
-static void rocksdb_copy_back();
+static void rocksdb_backup_checkpoint(ds_ctxt *ds_data);
+static void rocksdb_copy_back(ds_ctxt *ds_data);
static bool is_abs_path(const char *path)
{
@@ -136,7 +135,9 @@ struct datadir_thread_ctxt_t {
bool ret;
};
-static bool backup_files_from_datadir(const char *dir_path);
+static bool backup_files_from_datadir(ds_ctxt_t *ds_data,
+ const char *dir_path,
+ const char *prefix);
/************************************************************************
Retirn true if character if file separator */
@@ -807,7 +808,7 @@ if passes the rules for partial backup.
@return true if file backed up or skipped successfully. */
static
bool
-datafile_copy_backup(const char *filepath, uint thread_n)
+datafile_copy_backup(ds_ctxt *ds_data, const char *filepath, uint thread_n)
{
const char *ext_list[] = {"frm", "isl", "MYD", "MYI", "MAD", "MAI",
"MRG", "TRG", "TRN", "ARM", "ARZ", "CSM", "CSV", "opt", "par",
@@ -828,7 +829,7 @@ datafile_copy_backup(const char *filepath, uint thread_n)
}
if (filename_matches(filepath, ext_list)) {
- return copy_file(ds_data, filepath, filepath, thread_n);
+ return ds_data->copy_file(filepath, filepath, thread_n);
}
return(true);
@@ -869,7 +870,8 @@ datafile_rsync_backup(const char *filepath, bool save_to_list, FILE *f)
return(true);
}
-bool backup_file_print_buf(const char *filename, const char *buf, int buf_len)
+bool ds_ctxt_t::backup_file_print_buf(const char *filename,
+ const char *buf, int buf_len)
{
ds_file_t *dstfile = NULL;
MY_STAT stat; /* unused for now */
@@ -880,7 +882,7 @@ bool backup_file_print_buf(const char *filename, const char *buf, int buf_len)
stat.st_size = buf_len;
stat.st_mtime = my_time(0);
- dstfile = ds_open(ds_data, filename, &stat);
+ dstfile = ds_open(this, filename, &stat);
if (dstfile == NULL) {
msg("error: Can't open the destination stream for %s",
filename);
@@ -919,9 +921,9 @@ error_close:
return true;
};
-static
bool
-backup_file_vprintf(const char *filename, const char *fmt, va_list ap)
+ds_ctxt_t::backup_file_vprintf(const char *filename,
+ const char *fmt, va_list ap)
{
char *buf = 0;
int buf_len;
@@ -932,7 +934,7 @@ backup_file_vprintf(const char *filename, const char *fmt, va_list ap)
}
bool
-backup_file_printf(const char *filename, const char *fmt, ...)
+ds_ctxt_t::backup_file_printf(const char *filename, const char *fmt, ...)
{
bool result;
va_list ap;
@@ -1000,16 +1002,15 @@ run_data_threads(datadir_iter_t *it, void (*func)(datadir_thread_ctxt_t *ctxt),
Copy file for backup/restore.
@return true in case of success. */
bool
-copy_file(ds_ctxt_t *datasink,
- const char *src_file_path,
- const char *dst_file_path,
- uint thread_n)
+ds_ctxt_t::copy_file(const char *src_file_path,
+ const char *dst_file_path,
+ uint thread_n)
{
char dst_name[FN_REFLEN];
ds_file_t *dstfile = NULL;
datafile_cur_t cursor;
xb_fil_cur_result_t res;
- DBUG_ASSERT(datasink->datasink->remove);
+ DBUG_ASSERT(datasink->remove);
const char *dst_path =
(xtrabackup_copy_back || xtrabackup_move_back)?
dst_file_path : trim_dotslash(dst_file_path);
@@ -1020,7 +1021,7 @@ copy_file(ds_ctxt_t *datasink,
strncpy(dst_name, cursor.rel_path, sizeof(dst_name));
- dstfile = ds_open(datasink, dst_path, &cursor.statinfo);
+ dstfile = ds_open(this, dst_path, &cursor.statinfo);
if (dstfile == NULL) {
msg(thread_n,"error: "
"cannot open the destination stream for %s", dst_name);
@@ -1053,7 +1054,7 @@ copy_file(ds_ctxt_t *datasink,
error:
datafile_close(&cursor);
if (dstfile != NULL) {
- datasink->datasink->remove(dstfile->path);
+ datasink->remove(dstfile->path);
ds_close(dstfile);
}
@@ -1067,12 +1068,10 @@ error_close:
Try to move file by renaming it. If source and destination are on
different devices fall back to copy and unlink.
@return true in case of success. */
-static
bool
-move_file(ds_ctxt_t *datasink,
- const char *src_file_path,
- const char *dst_file_path,
- const char *dst_dir, uint thread_n)
+ds_ctxt_t::move_file(const char *src_file_path,
+ const char *dst_file_path,
+ const char *dst_dir, uint thread_n)
{
char errbuf[MYSYS_STRERROR_SIZE];
char dst_file_path_abs[FN_REFLEN];
@@ -1099,7 +1098,7 @@ move_file(ds_ctxt_t *datasink,
if (my_rename(src_file_path, dst_file_path_abs, MYF(0)) != 0) {
if (my_errno == EXDEV) {
/* Fallback to copy/unlink */
- if(!copy_file(datasink, src_file_path,
+ if(!copy_file(src_file_path,
dst_file_path, thread_n))
return false;
msg(thread_n,"Removing %s", src_file_path);
@@ -1178,13 +1177,13 @@ Copy or move file depending on current mode.
@return true in case of success. */
static
bool
-copy_or_move_file(const char *src_file_path,
+copy_or_move_file(ds_ctxt *datasink0, const char *src_file_path,
const char *dst_file_path,
const char *dst_dir,
uint thread_n,
bool copy = xtrabackup_copy_back)
{
- ds_ctxt_t *datasink = ds_data; /* copy to datadir by default */
+ ds_ctxt_t *datasink = datasink0; /* copy to datadir by default */
char filedir[FN_REFLEN];
size_t filedir_len;
bool ret;
@@ -1232,13 +1231,13 @@ copy_or_move_file(const char *src_file_path,
}
ret = (copy ?
- copy_file(datasink, src_file_path, dst_file_path, thread_n) :
- move_file(datasink, src_file_path, dst_file_path,
+ datasink->copy_file(src_file_path, dst_file_path, thread_n) :
+ datasink->move_file(src_file_path, dst_file_path,
dst_dir, thread_n));
cleanup:
- if (datasink != ds_data) {
+ if (datasink != datasink0) {
ds_destroy(datasink);
}
@@ -1250,7 +1249,7 @@ cleanup:
static
bool
-backup_files(const char *from, bool prep_mode)
+backup_files(ds_ctxt *ds_data, const char *from, bool prep_mode)
{
char rsync_tmpfile_name[FN_REFLEN];
FILE *rsync_tmpfile = NULL;
@@ -1288,7 +1287,7 @@ backup_files(const char *from, bool prep_mode)
ret = datafile_rsync_backup(node.filepath,
!prep_mode, rsync_tmpfile);
} else {
- ret = datafile_copy_backup(node.filepath, 1);
+ ret = datafile_copy_backup(ds_data, node.filepath, 1);
}
if (!ret) {
msg("Failed to copy file %s", node.filepath);
@@ -1299,7 +1298,7 @@ backup_files(const char *from, bool prep_mode)
char path[FN_REFLEN];
snprintf(path, sizeof(path),
"%s/db.opt", node.filepath);
- if (!(ret = backup_file_printf(
+ if (!(ret = ds_data->backup_file_printf(
trim_dotslash(path), "%s", ""))) {
msg("Failed to create file %s", path);
goto out;
@@ -1388,7 +1387,6 @@ out:
return(ret);
}
-void backup_fix_ddl(CorruptedPages &);
lsn_t get_current_lsn(MYSQL *connection)
{
@@ -1413,7 +1411,8 @@ lsn_t get_current_lsn(MYSQL *connection)
lsn_t server_lsn_after_lock;
extern void backup_wait_for_lsn(lsn_t lsn);
/** Start --backup */
-bool backup_start(CorruptedPages &corrupted_pages)
+bool backup_start(ds_ctxt *ds_data, ds_ctxt *ds_meta,
+ CorruptedPages &corrupted_pages)
{
if (!opt_no_lock) {
if (opt_safe_slave_backup) {
@@ -1422,7 +1421,7 @@ bool backup_start(CorruptedPages &corrupted_pages)
}
}
- if (!backup_files(fil_path_to_mysql_datadir, true)) {
+ if (!backup_files(ds_data, fil_path_to_mysql_datadir, true)) {
return(false);
}
@@ -1434,11 +1433,15 @@ bool backup_start(CorruptedPages &corrupted_pages)
server_lsn_after_lock = get_current_lsn(mysql_connection);
}
- if (!backup_files(fil_path_to_mysql_datadir, false)) {
+ if (!backup_files(ds_data, fil_path_to_mysql_datadir, false)) {
return(false);
}
- if (!backup_files_from_datadir(fil_path_to_mysql_datadir)) {
+ if (!backup_files_from_datadir(ds_data, fil_path_to_mysql_datadir,
+ "aws-kms-key") ||
+ !backup_files_from_datadir(ds_data,
+ aria_log_dir_path,
+ "aria_log")) {
return false;
}
@@ -1455,7 +1458,7 @@ bool backup_start(CorruptedPages &corrupted_pages)
my_sleep(milliseconds*1000UL);
});
- backup_fix_ddl(corrupted_pages);
+ corrupted_pages.backup_fix_ddl(ds_data, ds_meta);
// There is no need to stop slave thread before coping non-Innodb data when
// --no-lock option is used because --no-lock option requires that no DDL or
@@ -1471,7 +1474,7 @@ bool backup_start(CorruptedPages &corrupted_pages)
if (opt_slave_info) {
lock_binlog_maybe(mysql_connection);
- if (!write_slave_info(mysql_connection)) {
+ if (!write_slave_info(ds_data, mysql_connection)) {
return(false);
}
}
@@ -1483,7 +1486,7 @@ bool backup_start(CorruptedPages &corrupted_pages)
avoid that is to have a single process, i.e. merge innobackupex and
xtrabackup. */
if (opt_galera_info) {
- if (!write_galera_info(mysql_connection)) {
+ if (!write_galera_info(ds_data, mysql_connection)) {
return(false);
}
}
@@ -1491,7 +1494,7 @@ bool backup_start(CorruptedPages &corrupted_pages)
if (opt_binlog_info == BINLOG_INFO_ON) {
lock_binlog_maybe(mysql_connection);
- write_binlog_info(mysql_connection);
+ write_binlog_info(ds_data, mysql_connection);
}
if (!opt_no_lock) {
@@ -1528,20 +1531,20 @@ void backup_release()
static const char *default_buffer_pool_file = "ib_buffer_pool";
/** Finish after backup_start() and backup_release() */
-bool backup_finish()
+bool backup_finish(ds_ctxt *ds_data)
{
/* Copy buffer pool dump or LRU dump */
if (!opt_rsync && opt_galera_info) {
if (buffer_pool_filename && file_exists(buffer_pool_filename)) {
- copy_file(ds_data, buffer_pool_filename, default_buffer_pool_file, 0);
+ ds_data->copy_file(buffer_pool_filename, default_buffer_pool_file, 0);
}
if (file_exists("ib_lru_dump")) {
- copy_file(ds_data, "ib_lru_dump", "ib_lru_dump", 0);
+ ds_data->copy_file("ib_lru_dump", "ib_lru_dump", 0);
}
}
if (has_rocksdb_plugin()) {
- rocksdb_backup_checkpoint();
+ rocksdb_backup_checkpoint(ds_data);
}
msg("Backup created in directory '%s'", xtrabackup_target_dir);
@@ -1553,11 +1556,11 @@ bool backup_finish()
mysql_slave_position);
}
- if (!write_backup_config_file()) {
+ if (!write_backup_config_file(ds_data)) {
return(false);
}
- if (!write_xtrabackup_info(mysql_connection, MB_INFO,
+ if (!write_xtrabackup_info(ds_data, mysql_connection, MB_INFO,
opt_history != 0, true)) {
return(false);
}
@@ -1628,6 +1631,7 @@ ibx_copy_incremental_over_full()
bool ret = true;
char path[FN_REFLEN];
int i;
+ ds_ctxt *ds_data= NULL;
DBUG_ASSERT(!opt_galera_info);
datadir_node_init(&node);
@@ -1655,15 +1659,20 @@ ibx_copy_incremental_over_full()
unlink(node.filepath_rel);
}
- if (!(ret = copy_file(ds_data, node.filepath,
- node.filepath_rel, 1))) {
+ if (!(ret = ds_data->copy_file(node.filepath,
+ node.filepath_rel, 1))) {
msg("Failed to copy file %s",
node.filepath);
goto cleanup;
}
}
- if (!(ret = backup_files_from_datadir(xtrabackup_incremental_dir)))
+ if (!(ret = backup_files_from_datadir(ds_data,
+ xtrabackup_incremental_dir,
+ "aws-kms-key")) ||
+ !(ret = backup_files_from_datadir(ds_data,
+ xtrabackup_incremental_dir,
+ "aria_log")))
goto cleanup;
/* copy supplementary files */
@@ -1678,7 +1687,7 @@ ibx_copy_incremental_over_full()
if (file_exists(sup_files[i])) {
unlink(sup_files[i]);
}
- copy_file(ds_data, path, sup_files[i], 0);
+ ds_data->copy_file(path, sup_files[i], 0);
}
}
@@ -1692,7 +1701,7 @@ ibx_copy_incremental_over_full()
if (my_mkdir(ROCKSDB_BACKUP_DIR, 0777, MYF(0))) {
die("my_mkdir failed for " ROCKSDB_BACKUP_DIR);
}
- copy_or_move_dir(path, ROCKSDB_BACKUP_DIR, true, true);
+ ds_data->copy_or_move_dir(path, ROCKSDB_BACKUP_DIR, true, true);
}
ibx_incremental_drop_databases(xtrabackup_target_dir,
xtrabackup_incremental_dir);
@@ -1763,6 +1772,53 @@ apply_log_finish()
return(true);
}
+class Copy_back_dst_dir
+{
+ std::string buf;
+
+public:
+ const char *make(const char *path)
+ {
+ if (!path || !path[0])
+ return mysql_data_home;
+ if (is_absolute_path(path))
+ return path;
+ return buf.assign(mysql_data_home).append(path).c_str();
+ }
+};
+
+
+static inline bool
+is_aria_log_dir_file(const datadir_node_t &node)
+{
+ return starts_with(node.filepath_rel, "aria_log");
+}
+
+
+bool
+copy_back_aria_logs(const char *dstdir)
+{
+ std::unique_ptr<ds_ctxt_t, void (&)(ds_ctxt_t*)>
+ ds_ctxt_aria_log_dir_path(ds_create(dstdir, DS_TYPE_LOCAL), ds_destroy);
+
+ datadir_node_t node;
+ datadir_node_init(&node);
+ datadir_iter_t *it = datadir_iter_new(".", false);
+
+ while (datadir_iter_next(it, &node))
+ {
+ if (!is_aria_log_dir_file(node))
+ continue;
+ if (!copy_or_move_file(ds_ctxt_aria_log_dir_path.get(),
+ node.filepath, node.filepath_rel,
+ dstdir, 1))
+ return false;
+ }
+ datadir_node_free(&node);
+ datadir_iter_free(it);
+ return true;
+}
+
bool
copy_back()
@@ -1770,7 +1826,7 @@ copy_back()
bool ret = false;
datadir_iter_t *it = NULL;
datadir_node_t node;
- char *dst_dir;
+ const char *dst_dir;
memset(&node, 0, sizeof(node));
@@ -1810,6 +1866,13 @@ copy_back()
return(false);
}
+ Copy_back_dst_dir aria_log_dir_path_dst;
+ const char *aria_log_dir_path_abs= aria_log_dir_path_dst.make(aria_log_dir_path);
+ if (aria_log_dir_path && *aria_log_dir_path
+ && !directory_exists(aria_log_dir_path_abs, true)) {
+ return false;
+ }
+
/* cd to backup directory */
if (my_setwd(xtrabackup_target_dir, MYF(MY_WME)))
{
@@ -1817,6 +1880,9 @@ copy_back()
return(false);
}
+ if (!copy_back_aria_logs(aria_log_dir_path_abs))
+ return false;
+
/* parse data file path */
if (!innobase_data_file_path) {
@@ -1834,11 +1900,11 @@ copy_back()
/* copy undo tablespaces */
+ Copy_back_dst_dir dst_dir_buf;
- dst_dir = (srv_undo_dir && *srv_undo_dir)
- ? srv_undo_dir : mysql_data_home;
+ dst_dir = dst_dir_buf.make(srv_undo_dir);
- ds_data = ds_create(dst_dir, DS_TYPE_LOCAL);
+ ds_ctxt *ds_tmp = ds_create(dst_dir, DS_TYPE_LOCAL);
for (uint i = 1; i <= TRX_SYS_MAX_UNDO_SPACES; i++) {
char filename[20];
@@ -1846,51 +1912,49 @@ copy_back()
if (!file_exists(filename)) {
break;
}
- if (!(ret = copy_or_move_file(filename, filename,
+ if (!(ret = copy_or_move_file(ds_tmp, filename, filename,
dst_dir, 1))) {
goto cleanup;
}
}
- ds_destroy(ds_data);
- ds_data = NULL;
+ ds_destroy(ds_tmp);
+ ds_tmp = NULL;
/* copy redo logs */
- dst_dir = (srv_log_group_home_dir && *srv_log_group_home_dir)
- ? srv_log_group_home_dir : mysql_data_home;
+ dst_dir = dst_dir_buf.make(srv_log_group_home_dir);
/* --backup generates a single ib_logfile0, which we must copy. */
- ds_data = ds_create(dst_dir, DS_TYPE_LOCAL);
- if (!(ret = copy_or_move_file(LOG_FILE_NAME, LOG_FILE_NAME,
+ ds_tmp = ds_create(dst_dir, DS_TYPE_LOCAL);
+ if (!(ret = copy_or_move_file(ds_tmp, LOG_FILE_NAME, LOG_FILE_NAME,
dst_dir, 1))) {
goto cleanup;
}
- ds_destroy(ds_data);
+ ds_destroy(ds_tmp);
/* copy innodb system tablespace(s) */
- dst_dir = (innobase_data_home_dir && *innobase_data_home_dir)
- ? innobase_data_home_dir : mysql_data_home;
+ dst_dir = dst_dir_buf.make(innobase_data_home_dir);
- ds_data = ds_create(dst_dir, DS_TYPE_LOCAL);
+ ds_tmp = ds_create(dst_dir, DS_TYPE_LOCAL);
for (Tablespace::const_iterator iter(srv_sys_space.begin()),
end(srv_sys_space.end());
iter != end;
++iter) {
const char *filepath = iter->filepath();
- if (!(ret = copy_or_move_file(base_name(filepath), filepath,
- dst_dir, 1))) {
+ if (!(ret = copy_or_move_file(ds_tmp, base_name(filepath),
+ filepath, dst_dir, 1))) {
goto cleanup;
}
}
- ds_destroy(ds_data);
+ ds_destroy(ds_tmp);
/* copy the rest of tablespaces */
- ds_data = ds_create(mysql_data_home, DS_TYPE_LOCAL);
+ ds_tmp = ds_create(mysql_data_home, DS_TYPE_LOCAL);
it = datadir_iter_new(".", false);
@@ -1909,6 +1973,10 @@ copy_back()
char c_tmp;
int i_tmp;
+ /* Skip aria log files */
+ if (is_aria_log_dir_file(node))
+ continue;
+
if (strstr(node.filepath,"/" ROCKSDB_BACKUP_DIR "/")
#ifdef _WIN32
|| strstr(node.filepath,"\\" ROCKSDB_BACKUP_DIR "\\")
@@ -1974,7 +2042,7 @@ copy_back()
}
}
- if (!(ret = copy_or_move_file(node.filepath, node.filepath_rel,
+ if (!(ret = copy_or_move_file(ds_tmp, node.filepath, node.filepath_rel,
mysql_data_home, 1))) {
goto cleanup;
}
@@ -1986,12 +2054,12 @@ copy_back()
if (file_exists(default_buffer_pool_file) &&
innobase_buffer_pool_filename) {
- copy_or_move_file(default_buffer_pool_file,
+ copy_or_move_file(ds_tmp, default_buffer_pool_file,
innobase_buffer_pool_filename,
mysql_data_home, 0);
}
- rocksdb_copy_back();
+ rocksdb_copy_back(ds_tmp);
cleanup:
if (it != NULL) {
@@ -2000,11 +2068,11 @@ cleanup:
datadir_node_free(&node);
- if (ds_data != NULL) {
- ds_destroy(ds_data);
+ if (ds_tmp != NULL) {
+ ds_destroy(ds_tmp);
}
- ds_data = NULL;
+ ds_tmp = NULL;
return(ret);
}
@@ -2104,7 +2172,7 @@ decrypt_decompress()
}
/* copy the rest of tablespaces */
- ds_data = ds_create(".", DS_TYPE_LOCAL);
+ ds_ctxt *ds_tmp = ds_create(".", DS_TYPE_LOCAL);
it = datadir_iter_new(".", false);
@@ -2117,11 +2185,11 @@ decrypt_decompress()
datadir_iter_free(it);
}
- if (ds_data != NULL) {
- ds_destroy(ds_data);
+ if (ds_tmp != NULL) {
+ ds_destroy(ds_tmp);
}
- ds_data = NULL;
+ ds_tmp = NULL;
return(ret);
}
@@ -2131,7 +2199,9 @@ decrypt_decompress()
Do not copy the Innodb files (ibdata1, redo log files),
as this is done in a separate step.
*/
-static bool backup_files_from_datadir(const char *dir_path)
+static bool backup_files_from_datadir(ds_ctxt_t *ds_data,
+ const char *dir_path,
+ const char *prefix)
{
os_file_dir_t dir = os_file_opendir(dir_path);
if (dir == IF_WIN(INVALID_HANDLE_VALUE, nullptr)) return false;
@@ -2154,8 +2224,7 @@ static bool backup_files_from_datadir(const char *dir_path)
if (!pname)
pname = info.name;
- if (!starts_with(pname, "aws-kms-key") &&
- !starts_with(pname, "aria_log"))
+ if (!starts_with(pname, prefix))
/* For ES exchange the above line with the following code:
(!xtrabackup_prepare || !xtrabackup_incremental_dir ||
!starts_with(pname, "aria_log")))
@@ -2168,7 +2237,7 @@ static bool backup_files_from_datadir(const char *dir_path)
std::string full_path(dir_path);
full_path.append(1, '/').append(info.name);
- if (!(ret = copy_file(ds_data, full_path.c_str() , info.name, 1)))
+ if (!(ret = ds_data->copy_file(full_path.c_str() , info.name, 1)))
break;
}
os_file_closedir(dir);
@@ -2218,13 +2287,14 @@ static char *trim_trailing_dir_sep(char *path)
Create a file hardlink.
@return true on success, false on error.
*/
-static bool make_hardlink(const char *from_path, const char *to_path)
+bool
+ds_ctxt_t::make_hardlink(const char *from_path, const char *to_path)
{
DBUG_EXECUTE_IF("no_hardlinks", return false;);
char to_path_full[FN_REFLEN];
if (!is_abs_path(to_path))
{
- fn_format(to_path_full, to_path, ds_data->root, "", MYF(MY_RELATIVE_PATH));
+ fn_format(to_path_full, to_path, root, "", MYF(MY_RELATIVE_PATH));
}
else
{
@@ -2245,7 +2315,9 @@ static bool make_hardlink(const char *from_path, const char *to_path)
Has optimization that allows to use hardlinks when possible
(source and destination are directories on the same device)
*/
-static void copy_or_move_dir(const char *from, const char *to, bool do_copy, bool allow_hardlinks)
+void
+ds_ctxt_t::copy_or_move_dir(const char *from, const char *to,
+ bool do_copy, bool allow_hardlinks)
{
datadir_node_t node;
datadir_node_init(&node);
@@ -2273,8 +2345,8 @@ static void copy_or_move_dir(const char *from, const char *to, bool do_copy, boo
if (!rc)
{
rc = (do_copy ?
- copy_file(ds_data, from_path, to_path, 1) :
- move_file(ds_data, from_path, node.filepath_rel,
+ copy_file(from_path, to_path, 1) :
+ move_file(from_path, node.filepath_rel,
to, 1));
}
if (!rc)
@@ -2371,7 +2443,7 @@ static void rocksdb_create_checkpoint()
remove temp.checkpoint directory (in server's datadir)
and release user level lock acquired inside rocksdb_create_checkpoint().
*/
-static void rocksdb_backup_checkpoint()
+static void rocksdb_backup_checkpoint(ds_ctxt *ds_data)
{
msg("Backing up rocksdb files.");
char rocksdb_backup_dir[FN_REFLEN];
@@ -2383,7 +2455,7 @@ static void rocksdb_backup_checkpoint()
die("Can't create rocksdb backup directory %s", rocksdb_backup_dir);
}
}
- copy_or_move_dir(rocksdb_checkpoint_dir, ROCKSDB_BACKUP_DIR, true, backup_to_directory);
+ ds_data->copy_or_move_dir(rocksdb_checkpoint_dir, ROCKSDB_BACKUP_DIR, true, backup_to_directory);
rocksdb_remove_checkpoint_directory();
rocksdb_unlock_checkpoint();
}
@@ -2391,7 +2463,7 @@ static void rocksdb_backup_checkpoint()
/*
Copies #rocksdb directory to the $rockdb_data_dir, on copy-back
*/
-static void rocksdb_copy_back() {
+static void rocksdb_copy_back(ds_ctxt *ds_data) {
if (access(ROCKSDB_BACKUP_DIR, 0))
return;
char rocksdb_home_dir[FN_REFLEN];
@@ -2403,5 +2475,5 @@ static void rocksdb_copy_back() {
xb_rocksdb_datadir?trim_dotslash(xb_rocksdb_datadir): ROCKSDB_BACKUP_DIR);
}
mkdirp(rocksdb_home_dir, 0777, MYF(0));
- copy_or_move_dir(ROCKSDB_BACKUP_DIR, rocksdb_home_dir, xtrabackup_copy_back, xtrabackup_copy_back);
+ ds_data->copy_or_move_dir(ROCKSDB_BACKUP_DIR, rocksdb_home_dir, xtrabackup_copy_back, xtrabackup_copy_back);
}
diff --git a/extra/mariabackup/backup_copy.h b/extra/mariabackup/backup_copy.h
index 3e1efa98177..973863625c6 100644
--- a/extra/mariabackup/backup_copy.h
+++ b/extra/mariabackup/backup_copy.h
@@ -22,30 +22,18 @@
extern bool binlog_locked;
-bool
-backup_file_printf(const char *filename, const char *fmt, ...)
- ATTRIBUTE_FORMAT(printf, 2, 0);
-
/************************************************************************
Return true if first and second arguments are the same path. */
bool
equal_paths(const char *first, const char *second);
-/************************************************************************
-Copy file for backup/restore.
-@return true in case of success. */
-bool
-copy_file(ds_ctxt_t *datasink,
- const char *src_file_path,
- const char *dst_file_path,
- uint thread_n);
-
/** Start --backup */
-bool backup_start(CorruptedPages &corrupted_pages);
+bool backup_start(ds_ctxt *ds_data, ds_ctxt *ds_meta,
+ CorruptedPages &corrupted_pages);
/** Release resources after backup_start() */
void backup_release();
/** Finish after backup_start() and backup_release() */
-bool backup_finish();
+bool backup_finish(ds_ctxt *ds_data);
bool
apply_log_finish();
bool
@@ -59,6 +47,5 @@ directory_exists(const char *dir, bool create);
lsn_t
get_current_lsn(MYSQL *connection);
-bool backup_file_print_buf(const char *filename, const char *buf, int buf_len);
#endif
diff --git a/extra/mariabackup/backup_mysql.cc b/extra/mariabackup/backup_mysql.cc
index b660e3112cd..a3b65df998d 100644
--- a/extra/mariabackup/backup_mysql.cc
+++ b/extra/mariabackup/backup_mysql.cc
@@ -327,6 +327,7 @@ bool get_mysql_vars(MYSQL *connection)
char *innodb_undo_directory_var= NULL;
char *innodb_page_size_var= NULL;
char *innodb_undo_tablespaces_var= NULL;
+ char *aria_log_dir_path_var= NULL;
char *page_zip_level_var= NULL;
char *ignore_db_dirs= NULL;
char *endptr;
@@ -355,6 +356,7 @@ bool get_mysql_vars(MYSQL *connection)
{"innodb_undo_tablespaces", &innodb_undo_tablespaces_var},
{"innodb_compression_level", &page_zip_level_var},
{"ignore_db_dirs", &ignore_db_dirs},
+ {"aria_log_dir_path", &aria_log_dir_path_var},
{NULL, NULL}};
read_mysql_variables(connection, "SHOW VARIABLES", mysql_vars, true);
@@ -482,6 +484,12 @@ bool get_mysql_vars(MYSQL *connection)
ut_ad(*endptr == 0);
}
+ if (aria_log_dir_path_var)
+ {
+ aria_log_dir_path= my_strdup(PSI_NOT_INSTRUMENTED,
+ aria_log_dir_path_var, MYF(MY_FAE));
+ }
+
if (page_zip_level_var != NULL)
{
page_zip_level= static_cast<uint>(strtoul(page_zip_level_var, &endptr,
@@ -1322,7 +1330,7 @@ variable.
@returns true on success
*/
bool
-write_slave_info(MYSQL *connection)
+write_slave_info(ds_ctxt *datasink, MYSQL *connection)
{
String sql, comment;
@@ -1339,7 +1347,8 @@ write_slave_info(MYSQL *connection)
}
mysql_slave_position= strdup(comment.c_ptr());
- return backup_file_print_buf(MB_SLAVE_INFO, sql.ptr(), sql.length());
+ return datasink->backup_file_print_buf(MB_SLAVE_INFO,
+ sql.ptr(), sql.length());
}
@@ -1347,7 +1356,7 @@ write_slave_info(MYSQL *connection)
Retrieves MySQL Galera and
saves it in a file. It also prints it to stdout. */
bool
-write_galera_info(MYSQL *connection)
+write_galera_info(ds_ctxt *datasink, MYSQL *connection)
{
char *state_uuid = NULL, *state_uuid55 = NULL;
char *last_committed = NULL, *last_committed55 = NULL;
@@ -1379,12 +1388,12 @@ write_galera_info(MYSQL *connection)
goto cleanup;
}
- result = backup_file_printf(MB_GALERA_INFO,
+ result = datasink->backup_file_printf(MB_GALERA_INFO,
"%s:%s\n", state_uuid ? state_uuid : state_uuid55,
last_committed ? last_committed : last_committed55);
if (result)
{
- write_current_binlog_file(connection);
+ write_current_binlog_file(datasink, connection);
}
cleanup:
@@ -1398,7 +1407,7 @@ cleanup:
Flush and copy the current binary log file into the backup,
if GTID is enabled */
bool
-write_current_binlog_file(MYSQL *connection)
+write_current_binlog_file(ds_ctxt *datasink, MYSQL *connection)
{
char *executed_gtid_set = NULL;
char *gtid_binlog_state = NULL;
@@ -1468,7 +1477,7 @@ write_current_binlog_file(MYSQL *connection)
snprintf(filepath, sizeof(filepath), "%s%c%s",
log_bin_dir, FN_LIBCHAR, log_bin_file);
- result = copy_file(ds_data, filepath, log_bin_file, 0);
+ result = datasink->copy_file(filepath, log_bin_file, 0);
}
cleanup:
@@ -1484,7 +1493,7 @@ cleanup:
Retrieves MySQL binlog position and
saves it in a file. It also prints it to stdout. */
bool
-write_binlog_info(MYSQL *connection)
+write_binlog_info(ds_ctxt *datasink, MYSQL *connection)
{
char *filename = NULL;
char *position = NULL;
@@ -1529,14 +1538,14 @@ write_binlog_info(MYSQL *connection)
"filename '%s', position '%s', "
"GTID of the last change '%s'",
filename, position, gtid) != -1);
- result = backup_file_printf(MB_BINLOG_INFO,
+ result = datasink->backup_file_printf(MB_BINLOG_INFO,
"%s\t%s\t%s\n", filename, position,
gtid);
} else {
ut_a(asprintf(&mysql_binlog_position,
"filename '%s', position '%s'",
filename, position) != -1);
- result = backup_file_printf(MB_BINLOG_INFO,
+ result = datasink->backup_file_printf(MB_BINLOG_INFO,
"%s\t%s\n", filename, position);
}
@@ -1576,8 +1585,9 @@ mysql.mariabackup_history and writes a new history record to the
table containing all the history info particular to the just completed
backup. */
bool
-write_xtrabackup_info(MYSQL *connection, const char * filename, bool history,
- bool stream)
+write_xtrabackup_info(ds_ctxt *datasink,
+ MYSQL *connection, const char * filename, bool history,
+ bool stream)
{
bool result = true;
@@ -1653,7 +1663,7 @@ write_xtrabackup_info(MYSQL *connection, const char * filename, bool history,
}
if (stream) {
- backup_file_printf(filename, "%s", buf);
+ datasink->backup_file_printf(filename, "%s", buf);
} else {
fp = fopen(filename, "w");
if (!fp) {
@@ -1772,9 +1782,9 @@ static std::string make_local_paths(const char *data_file_path)
return buf.str();
}
-bool write_backup_config_file()
+bool write_backup_config_file(ds_ctxt *datasink)
{
- int rc= backup_file_printf("backup-my.cnf",
+ int rc= datasink->backup_file_printf("backup-my.cnf",
"# This options file was generated by innobackupex.\n\n"
"# The server\n"
"[mysqld]\n"
diff --git a/extra/mariabackup/backup_mysql.h b/extra/mariabackup/backup_mysql.h
index eb4ed42c048..4b08da0b939 100644
--- a/extra/mariabackup/backup_mysql.h
+++ b/extra/mariabackup/backup_mysql.h
@@ -58,17 +58,18 @@ void
unlock_all(MYSQL *connection);
bool
-write_current_binlog_file(MYSQL *connection);
+write_current_binlog_file(ds_ctxt *datasink, MYSQL *connection);
bool
-write_binlog_info(MYSQL *connection);
+write_binlog_info(ds_ctxt *datasink, MYSQL *connection);
bool
-write_xtrabackup_info(MYSQL *connection, const char * filename, bool history,
- bool stream);
+write_xtrabackup_info(ds_ctxt *datasink,
+ MYSQL *connection, const char * filename, bool history,
+ bool stream);
bool
-write_backup_config_file();
+write_backup_config_file(ds_ctxt *datasink);
bool
lock_binlog_maybe(MYSQL *connection);
@@ -80,10 +81,10 @@ bool
wait_for_safe_slave(MYSQL *connection);
bool
-write_galera_info(MYSQL *connection);
+write_galera_info(ds_ctxt *datasink, MYSQL *connection);
bool
-write_slave_info(MYSQL *connection);
+write_slave_info(ds_ctxt *datasink, MYSQL *connection);
#endif
diff --git a/extra/mariabackup/datasink.h b/extra/mariabackup/datasink.h
index 4bede4ec9e7..57468e0c9c7 100644
--- a/extra/mariabackup/datasink.h
+++ b/extra/mariabackup/datasink.h
@@ -37,6 +37,35 @@ typedef struct ds_ctxt {
char *root;
void *ptr;
struct ds_ctxt *pipe_ctxt;
+ /*
+ Copy file for backup/restore.
+ @return true in case of success.
+ */
+ bool copy_file(const char *src_file_path,
+ const char *dst_file_path,
+ uint thread_n);
+
+ bool move_file(const char *src_file_path,
+ const char *dst_file_path,
+ const char *dst_dir,
+ uint thread_n);
+
+ bool make_hardlink(const char *from_path, const char *to_path);
+
+ void copy_or_move_dir(const char *from, const char *to,
+ bool do_copy, bool allow_hardlinks);
+
+ bool backup_file_vprintf(const char *filename,
+ const char *fmt, va_list ap);
+
+ bool backup_file_print_buf(const char *filename,
+ const char *buf,
+ int buf_len);
+
+ bool backup_file_printf(const char *filename,
+ const char *fmt, ...)
+ ATTRIBUTE_FORMAT(printf, 2, 0);
+
} ds_ctxt_t;
typedef struct {
diff --git a/extra/mariabackup/write_filt.cc b/extra/mariabackup/write_filt.cc
index 086d4078e31..052cea26ef6 100644
--- a/extra/mariabackup/write_filt.cc
+++ b/extra/mariabackup/write_filt.cc
@@ -31,7 +31,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
/************************************************************************
Write-through page write filter. */
-static my_bool wf_wt_init(xb_write_filt_ctxt_t *ctxt, char *dst_name,
+static my_bool wf_wt_init(ds_ctxt *ds_meta,
+ xb_write_filt_ctxt_t *ctxt, char *dst_name,
xb_fil_cur_t *cursor, CorruptedPages *corrupted_pages);
static my_bool wf_wt_process(xb_write_filt_ctxt_t *ctxt, ds_file_t *dstfile);
@@ -44,7 +45,8 @@ xb_write_filt_t wf_write_through = {
/************************************************************************
Incremental page write filter. */
-static my_bool wf_incremental_init(xb_write_filt_ctxt_t *ctxt, char *dst_name,
+static my_bool wf_incremental_init(ds_ctxt *ds_meta,
+ xb_write_filt_ctxt_t *ctxt, char *dst_name,
xb_fil_cur_t *cursor, CorruptedPages *corrupted_pages);
static my_bool wf_incremental_process(xb_write_filt_ctxt_t *ctxt,
ds_file_t *dstfile);
@@ -64,7 +66,8 @@ Initialize incremental page write filter.
@return TRUE on success, FALSE on error. */
static my_bool
-wf_incremental_init(xb_write_filt_ctxt_t *ctxt, char *dst_name,
+wf_incremental_init(ds_ctxt *ds_meta,
+ xb_write_filt_ctxt_t *ctxt, char *dst_name,
xb_fil_cur_t *cursor, CorruptedPages *corrupted_pages)
{
char meta_name[FN_REFLEN];
@@ -88,7 +91,7 @@ wf_incremental_init(xb_write_filt_ctxt_t *ctxt, char *dst_name,
XB_DELTA_INFO_SUFFIX);
const xb_delta_info_t info(cursor->page_size, cursor->zip_size,
cursor->space_id);
- if (!xb_write_delta_metadata(meta_name, &info)) {
+ if (!xb_write_delta_metadata(ds_meta, meta_name, &info)) {
msg(cursor->thread_n,"Error: "
"failed to write meta info for %s",
cursor->rel_path);
@@ -207,7 +210,8 @@ Initialize the write-through page write filter.
@return TRUE on success, FALSE on error. */
static my_bool
-wf_wt_init(xb_write_filt_ctxt_t *ctxt, char *dst_name __attribute__((unused)),
+wf_wt_init(ds_ctxt *ds_meta __attribute__((unused)),
+ xb_write_filt_ctxt_t *ctxt, char *dst_name __attribute__((unused)),
xb_fil_cur_t *cursor, CorruptedPages *)
{
ctxt->cursor = cursor;
diff --git a/extra/mariabackup/write_filt.h b/extra/mariabackup/write_filt.h
index 6c3ef24291f..a0ce0778a7f 100644
--- a/extra/mariabackup/write_filt.h
+++ b/extra/mariabackup/write_filt.h
@@ -45,7 +45,8 @@ typedef struct {
typedef struct {
- my_bool (*init)(xb_write_filt_ctxt_t *ctxt, char *dst_name,
+ my_bool (*init)(ds_ctxt *ds_meta,
+ xb_write_filt_ctxt_t *ctxt, char *dst_name,
xb_fil_cur_t *cursor, CorruptedPages *corrupted_pages);
my_bool (*process)(xb_write_filt_ctxt_t *ctxt, ds_file_t *dstfile);
my_bool (*finalize)(xb_write_filt_ctxt_t *, ds_file_t *dstfile);
diff --git a/extra/mariabackup/xbcloud.cc b/extra/mariabackup/xbcloud.cc
index cee76e5f3d7..588a15eb791 100644
--- a/extra/mariabackup/xbcloud.cc
+++ b/extra/mariabackup/xbcloud.cc
@@ -2534,7 +2534,7 @@ swift_keystone_auth_v3(const char *auth_url, swift_auth_info *info)
} else if (opt_swift_project != NULL) {
snprintf(scope, sizeof(scope),
",\"scope\":{\"project\":{\"name\":\"%s\"%s}}",
- opt_swift_project_id, domain);
+ opt_swift_project, domain);
}
snprintf(payload, sizeof(payload), "{\"auth\":{\"identity\":"
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index 1811415cd2a..9b1d335aaef 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -117,6 +117,12 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
#define MB_CORRUPTED_PAGES_FILE "innodb_corrupted_pages"
+// disable server's systemd notification code
+extern "C" {
+int sd_notify() { return 0; }
+int sd_notifyf() { return 0; }
+}
+
int sys_var_init();
/* === xtrabackup specific options === */
@@ -255,6 +261,7 @@ static char* innobase_ignored_opt;
char* innobase_data_home_dir;
char* innobase_data_file_path;
+char *aria_log_dir_path;
my_bool xtrabackup_incremental_force_scan = FALSE;
@@ -272,10 +279,66 @@ char *xb_plugin_dir;
char *xb_plugin_load;
my_bool xb_close_files;
-/* Datasinks */
-ds_ctxt_t *ds_data = NULL;
-ds_ctxt_t *ds_meta = NULL;
-ds_ctxt_t *ds_redo = NULL;
+
+class Datasink_free_list
+{
+protected:
+ /*
+ Simple datasink creation tracking...
+ add datasinks in the reverse order you want them destroyed.
+ */
+#define XTRABACKUP_MAX_DATASINKS 10
+ ds_ctxt_t *m_datasinks_to_destroy[XTRABACKUP_MAX_DATASINKS];
+ uint m_actual_datasinks_to_destroy;
+public:
+ Datasink_free_list()
+ :m_actual_datasinks_to_destroy(0)
+ { }
+
+ void add_datasink_to_destroy(ds_ctxt_t *ds)
+ {
+ xb_ad(m_actual_datasinks_to_destroy < XTRABACKUP_MAX_DATASINKS);
+ m_datasinks_to_destroy[m_actual_datasinks_to_destroy] = ds;
+ m_actual_datasinks_to_destroy++;
+ }
+
+ /*
+ Destroy datasinks.
+ Destruction is done in the specific order to not violate their order in the
+ pipeline so that each datasink is able to flush data down the pipeline.
+ */
+ void destroy()
+ {
+ for (uint i= m_actual_datasinks_to_destroy; i > 0; i--)
+ {
+ ds_destroy(m_datasinks_to_destroy[i - 1]);
+ m_datasinks_to_destroy[i - 1] = NULL;
+ }
+ }
+};
+
+
+class Backup_datasinks: public Datasink_free_list
+{
+public:
+ ds_ctxt_t *m_data;
+ ds_ctxt_t *m_meta;
+ ds_ctxt_t *m_redo;
+
+ Backup_datasinks()
+ :m_data(NULL),
+ m_meta(NULL),
+ m_redo(NULL)
+ { }
+ void init();
+ void destroy()
+ {
+ Datasink_free_list::destroy();
+ *this= Backup_datasinks();
+ }
+ bool backup_low();
+};
+
static bool innobackupex_mode = false;
@@ -470,7 +533,8 @@ void CorruptedPages::rename_space(uint32_t space_id,
ut_a(!pthread_mutex_unlock(&m_mutex));
}
-bool CorruptedPages::print_to_file(const char *filename) const
+bool CorruptedPages::print_to_file(ds_ctxt *ds_data,
+ const char *filename) const
{
std::ostringstream out;
ut_a(!pthread_mutex_lock(&m_mutex));
@@ -498,8 +562,8 @@ bool CorruptedPages::print_to_file(const char *filename) const
out << "\n";
}
ut_a(!pthread_mutex_unlock(&m_mutex));
- if (xtrabackup_backup)
- return backup_file_print_buf(filename, out.str().c_str(),
+ if (ds_data)
+ return ds_data->backup_file_print_buf(filename, out.str().c_str(),
static_cast<int>(out.str().size()));
std::ofstream outfile;
outfile.open(filename);
@@ -621,19 +685,6 @@ void CorruptedPages::zero_out_free_pages()
aligned_free(zero_page);
}
-/* Simple datasink creation tracking...add datasinks in the reverse order you
-want them destroyed. */
-#define XTRABACKUP_MAX_DATASINKS 10
-static ds_ctxt_t *datasinks[XTRABACKUP_MAX_DATASINKS];
-static uint actual_datasinks = 0;
-static inline
-void
-xtrabackup_add_datasink(ds_ctxt_t *ds)
-{
- xb_ad(actual_datasinks < XTRABACKUP_MAX_DATASINKS);
- datasinks[actual_datasinks] = ds; actual_datasinks++;
-}
-
typedef void (*process_single_tablespace_func_t)(const char *dirname,
const char *filname,
bool is_remote,
@@ -974,6 +1025,7 @@ typedef struct {
uint *count;
pthread_mutex_t* count_mutex;
CorruptedPages *corrupted_pages;
+ Backup_datasinks *datasinks;
} data_thread_ctxt_t;
/* ======== for option and variables ======== */
@@ -1081,7 +1133,8 @@ enum options_xtrabackup
OPT_XTRA_CHECK_PRIVILEGES,
OPT_XTRA_MYSQLD_ARGS,
OPT_XB_IGNORE_INNODB_PAGE_CORRUPTION,
- OPT_INNODB_FORCE_RECOVERY
+ OPT_INNODB_FORCE_RECOVERY,
+ OPT_ARIA_LOG_DIR_PATH
};
struct my_option xb_client_options[]= {
@@ -1109,7 +1162,8 @@ struct my_option xb_client_options[]= {
(G_PTR *) &xtrabackup_print_param, (G_PTR *) &xtrabackup_print_param, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"use-memory", OPT_XTRA_USE_MEMORY,
- "The value is used instead of buffer_pool_size",
+ "The value is used in place of innodb_buffer_pool_size. "
+ "This option is only relevant when the --prepare option is specified.",
(G_PTR *) &xtrabackup_use_memory, (G_PTR *) &xtrabackup_use_memory, 0,
GET_LL, REQUIRED_ARG, 100 * 1024 * 1024L, 1024 * 1024L, LONGLONG_MAX, 0,
1024 * 1024L, 0},
@@ -1683,6 +1737,11 @@ struct my_option xb_server_options[] =
&xb_plugin_dir, &xb_plugin_dir,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
+ {"aria_log_dir_path", OPT_ARIA_LOG_DIR_PATH,
+ "Path to individual files and their sizes.",
+ &aria_log_dir_path, &aria_log_dir_path,
+ 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().",
(G_PTR*) &xb_open_files_limit, (G_PTR*) &xb_open_files_limit, 0, GET_ULONG,
@@ -1856,6 +1915,12 @@ static void print_version(void)
my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
}
+static void concatenate_default_groups(std::vector<const char*> &backup_load_groups, const char **default_groups)
+{
+ for ( ; *default_groups ; default_groups++)
+ backup_load_groups.push_back(*default_groups);
+}
+
static void usage(void)
{
puts("Open source backup tool for InnoDB and XtraDB\n\
@@ -1876,7 +1941,11 @@ GNU General Public License for more details.\n\
You can download full text of the license on http://www.gnu.org/licenses/gpl-2.0.txt\n");
printf("Usage: %s [--defaults-file=#] [--backup | --prepare | --copy-back | --move-back] [OPTIONS]\n",my_progname);
- print_defaults("my", load_default_groups);
+ std::vector<const char*> backup_load_default_groups;
+ concatenate_default_groups(backup_load_default_groups, backup_default_groups);
+ concatenate_default_groups(backup_load_default_groups, load_default_groups);
+ backup_load_default_groups.push_back(nullptr);
+ print_defaults("my", &backup_load_default_groups[0]);
my_print_help(xb_client_options);
my_print_help(xb_server_options);
my_print_variables(xb_server_options);
@@ -1968,6 +2037,10 @@ xb_get_one_option(const struct my_option *opt,
}
break;
+ case OPT_ARIA_LOG_DIR_PATH:
+ ADD_PRINT_PARAM_OPT(aria_log_dir_path);
+ break;
+
case OPT_XTRA_TARGET_DIR:
strmake(xtrabackup_real_target_dir,argument, sizeof(xtrabackup_real_target_dir)-1);
xtrabackup_target_dir= xtrabackup_real_target_dir;
@@ -2289,7 +2362,11 @@ static bool innodb_init()
ut_ad(recv_no_log_write);
buf_flush_sync();
recv_sys.debug_free();
- DBUG_ASSERT(!buf_pool.any_io_pending());
+ ut_ad(!os_aio_pending_reads());
+ ut_ad(!os_aio_pending_writes());
+ ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex));
+ ut_ad(!buf_pool.get_oldest_modification(0));
+ ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex));
log_sys.close_file();
if (xtrabackup_incremental)
@@ -2556,7 +2633,8 @@ xb_read_delta_metadata(const char *filepath, xb_delta_info_t *info)
Write meta info for an incremental delta.
@return TRUE on success, FALSE on failure. */
my_bool
-xb_write_delta_metadata(const char *filename, const xb_delta_info_t *info)
+xb_write_delta_metadata(ds_ctxt *ds_meta,
+ const char *filename, const xb_delta_info_t *info)
{
ds_file_t *f;
char buf[64];
@@ -2887,7 +2965,9 @@ xb_get_copy_action(const char *dflt)
for full backup, pages filter for incremental backup, etc.
@return FALSE on success and TRUE on error */
-static my_bool xtrabackup_copy_datafile(fil_node_t *node, uint thread_n,
+static my_bool xtrabackup_copy_datafile(ds_ctxt *ds_data,
+ ds_ctxt *ds_meta,
+ fil_node_t *node, uint thread_n,
const char *dest_name,
const xb_write_filt_t &write_filter,
CorruptedPages &corrupted_pages)
@@ -2945,7 +3025,7 @@ static my_bool xtrabackup_copy_datafile(fil_node_t *node, uint thread_n,
ut_a(write_filter.process != NULL);
if (write_filter.init != NULL &&
- !write_filter.init(&write_filt_ctxt, dst_name, &cursor,
+ !write_filter.init(ds_meta, &write_filt_ctxt, dst_name, &cursor,
opt_log_innodb_page_corruption ? &corrupted_pages : NULL)) {
msg (thread_n, "mariabackup: error: failed to initialize page write filter.");
goto error;
@@ -3282,7 +3362,8 @@ static void data_copy_thread_func(data_thread_ctxt_t *ctxt) /* thread context */
node->space->name(),
backup_wait_for_lsn(get_current_lsn(mysql_connection)););
/* copy the datafile */
- if (xtrabackup_copy_datafile(node, num, NULL,
+ if (xtrabackup_copy_datafile(ctxt->datasinks->m_data,
+ ctxt->datasinks->m_meta, node, num, NULL,
xtrabackup_incremental ? wf_incremental : wf_write_through,
*ctxt->corrupted_pages))
die("failed to copy datafile.");
@@ -3305,22 +3386,21 @@ Otherwise (i.e. when streaming in the 'tar' format) we need 2 separate datasinks
for the data stream (and don't allow parallel data copying) and for metainfo
files (including ib_logfile0). The second datasink writes to temporary
files first, and then streams them in a serialized way when closed. */
-static void
-xtrabackup_init_datasinks(void)
+void Backup_datasinks::init()
{
/* Start building out the pipelines from the terminus back */
if (xtrabackup_stream) {
/* All streaming goes to stdout */
- ds_data = ds_meta = ds_redo = ds_create(xtrabackup_target_dir,
- DS_TYPE_STDOUT);
+ m_data = m_meta = m_redo = ds_create(xtrabackup_target_dir,
+ DS_TYPE_STDOUT);
} else {
/* Local filesystem */
- ds_data = ds_meta = ds_redo = ds_create(xtrabackup_target_dir,
- DS_TYPE_LOCAL);
+ m_data = m_meta = m_redo = ds_create(xtrabackup_target_dir,
+ DS_TYPE_LOCAL);
}
/* Track it for destruction */
- xtrabackup_add_datasink(ds_data);
+ add_datasink_to_destroy(m_data);
/* Stream formatting */
if (xtrabackup_stream) {
@@ -3329,66 +3409,50 @@ xtrabackup_init_datasinks(void)
ut_a(xtrabackup_stream_fmt == XB_STREAM_FMT_XBSTREAM);
ds = ds_create(xtrabackup_target_dir, DS_TYPE_XBSTREAM);
- xtrabackup_add_datasink(ds);
+ add_datasink_to_destroy(ds);
- ds_set_pipe(ds, ds_data);
- ds_data = ds;
+ ds_set_pipe(ds, m_data);
+ m_data = ds;
- ds_redo = ds_meta = ds_data;
+ m_redo = m_meta = m_data;
}
- /* Compression for ds_data and ds_redo */
+ /* Compression for m_data and m_redo */
if (xtrabackup_compress) {
ds_ctxt_t *ds;
/* Use a 1 MB buffer for compressed output stream */
ds = ds_create(xtrabackup_target_dir, DS_TYPE_BUFFER);
ds_buffer_set_size(ds, 1024 * 1024);
- xtrabackup_add_datasink(ds);
- ds_set_pipe(ds, ds_data);
- if (ds_data != ds_redo) {
- ds_data = ds;
+ add_datasink_to_destroy(ds);
+ ds_set_pipe(ds, m_data);
+ if (m_data != m_redo) {
+ m_data = ds;
ds = ds_create(xtrabackup_target_dir, DS_TYPE_BUFFER);
ds_buffer_set_size(ds, 1024 * 1024);
- xtrabackup_add_datasink(ds);
- ds_set_pipe(ds, ds_redo);
- ds_redo = ds;
+ add_datasink_to_destroy(ds);
+ ds_set_pipe(ds, m_redo);
+ m_redo = ds;
} else {
- ds_redo = ds_data = ds;
+ m_redo = m_data = ds;
}
ds = ds_create(xtrabackup_target_dir, DS_TYPE_COMPRESS);
- xtrabackup_add_datasink(ds);
- ds_set_pipe(ds, ds_data);
- if (ds_data != ds_redo) {
- ds_data = ds;
+ add_datasink_to_destroy(ds);
+ ds_set_pipe(ds, m_data);
+ if (m_data != m_redo) {
+ m_data = ds;
ds = ds_create(xtrabackup_target_dir, DS_TYPE_COMPRESS);
- xtrabackup_add_datasink(ds);
- ds_set_pipe(ds, ds_redo);
- ds_redo = ds;
+ add_datasink_to_destroy(ds);
+ ds_set_pipe(ds, m_redo);
+ m_redo = ds;
} else {
- ds_redo = ds_data = ds;
+ m_redo = m_data = ds;
}
}
}
-/************************************************************************
-Destroy datasinks.
-
-Destruction is done in the specific order to not violate their order in the
-pipeline so that each datasink is able to flush data down the pipeline. */
-static void xtrabackup_destroy_datasinks(void)
-{
- for (uint i = actual_datasinks; i > 0; i--) {
- ds_destroy(datasinks[i-1]);
- datasinks[i-1] = NULL;
- }
- ds_data = NULL;
- ds_meta = NULL;
- ds_redo = NULL;
-}
-
#define SRV_MAX_N_PENDING_SYNC_IOS 100
/** Initialize the tablespace cache subsystem. */
@@ -3502,21 +3566,20 @@ static void xb_load_single_table_tablespace(const char *dirname,
bool is_empty_file = file->exists() && file->is_empty_file();
if (err == DB_SUCCESS && file->space_id() != SRV_TMP_SPACE_ID) {
+ mysql_mutex_lock(&fil_system.mutex);
space = fil_space_t::create(
file->space_id(), file->flags(),
FIL_TYPE_TABLESPACE, nullptr/* TODO: crypt_data */,
FIL_ENCRYPTION_DEFAULT,
file->handle() != OS_FILE_CLOSED);
-
- ut_a(space != NULL);
+ ut_ad(space);
fil_node_t* node= space->add(
file->filepath(),
skip_node_page0 ? file->detach() : pfs_os_file_t(),
0, false, false);
node->deferred= defer;
- mysql_mutex_lock(&fil_system.mutex);
if (!space->read_page0())
- err= DB_CANNOT_OPEN_FILE;
+ err = DB_CANNOT_OPEN_FILE;
mysql_mutex_unlock(&fil_system.mutex);
if (srv_operation == SRV_OPERATION_RESTORE_DELTA
@@ -4419,7 +4482,7 @@ static void stop_backup_threads()
/** Implement the core of --backup
@return whether the operation succeeded */
-static bool xtrabackup_backup_low()
+bool Backup_datasinks::backup_low()
{
mysql_mutex_lock(&recv_sys.mutex);
ut_ad(!metadata_to_lsn);
@@ -4485,7 +4548,7 @@ static bool xtrabackup_backup_low()
}
metadata_last_lsn = recv_sys.lsn;
- if (!xtrabackup_stream_metadata(ds_meta)) {
+ if (!xtrabackup_stream_metadata(m_meta)) {
msg("Error: failed to stream metadata.");
return false;
}
@@ -4501,7 +4564,8 @@ static bool xtrabackup_backup_low()
}
sprintf(filename, "%s/%s", xtrabackup_extra_lsndir,
MB_INFO);
- if (!write_xtrabackup_info(mysql_connection, filename, false, false)) {
+ if (!write_xtrabackup_info(m_data,
+ mysql_connection, filename, false, false)) {
msg("Error: failed to write info "
"to '%s'.", filename);
return false;
@@ -4521,6 +4585,7 @@ static bool xtrabackup_backup_func()
pthread_mutex_t count_mutex;
CorruptedPages corrupted_pages;
data_thread_ctxt_t *data_threads;
+ Backup_datasinks backup_datasinks;
pthread_cond_init(&scanned_lsn_cond, NULL);
#ifdef USE_POSIX_FADVISE
@@ -4646,7 +4711,7 @@ fail:
goto fail;
}
- xtrabackup_init_datasinks();
+ backup_datasinks.init();
if (!select_history()) {
goto fail;
@@ -4654,7 +4719,7 @@ fail:
/* open the log file */
memset(&stat_info, 0, sizeof(MY_STAT));
- dst_log_file = ds_open(ds_redo, LOG_FILE_NAME, &stat_info);
+ dst_log_file = ds_open(backup_datasinks.m_redo, LOG_FILE_NAME, &stat_info);
if (dst_log_file == NULL) {
msg("Error: failed to open the target stream for '%s'.",
LOG_FILE_NAME);
@@ -4741,6 +4806,7 @@ fail:
data_threads[i].count = &count;
data_threads[i].count_mutex = &count_mutex;
data_threads[i].corrupted_pages = &corrupted_pages;
+ data_threads[i].datasinks= &backup_datasinks;
std::thread(data_copy_thread_func, data_threads + i).detach();
}
@@ -4758,10 +4824,13 @@ fail:
pthread_mutex_destroy(&count_mutex);
free(data_threads);
- bool ok = backup_start(corrupted_pages);
+ DBUG_ASSERT(backup_datasinks.m_data);
+ DBUG_ASSERT(backup_datasinks.m_meta);
+ bool ok = backup_start(backup_datasinks.m_data,
+ backup_datasinks.m_meta, corrupted_pages);
if (ok) {
- ok = xtrabackup_backup_low();
+ ok = backup_datasinks.backup_low();
backup_release();
@@ -4769,12 +4838,13 @@ fail:
pthread_join(dbug_alter_thread, nullptr););
if (ok) {
- backup_finish();
+ backup_finish(backup_datasinks.m_data);
}
}
if (opt_log_innodb_page_corruption)
- ok = corrupted_pages.print_to_file(MB_CORRUPTED_PAGES_FILE);
+ ok = corrupted_pages.print_to_file(backup_datasinks.m_data,
+ MB_CORRUPTED_PAGES_FILE);
if (!ok) {
goto fail;
@@ -4783,7 +4853,7 @@ fail:
if (changed_page_bitmap) {
xb_page_bitmap_deinit(changed_page_bitmap);
}
- xtrabackup_destroy_datasinks();
+ backup_datasinks.destroy();
msg("Redo log (from LSN " LSN_PF " to " LSN_PF ") was copied.",
log_sys.next_checkpoint_lsn, recv_sys.lsn);
@@ -4831,7 +4901,7 @@ FTWRL. This ensures consistent backup in presence of DDL.
It is the responsibility of the prepare phase to deal with .new, .ren, and .del
files.
*/
-void backup_fix_ddl(CorruptedPages &corrupted_pages)
+void CorruptedPages::backup_fix_ddl(ds_ctxt *ds_data, ds_ctxt *ds_meta)
{
std::set<std::string> dropped_tables;
std::map<std::string, std::string> renamed_tables;
@@ -4853,7 +4923,7 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages)
if (ddl_tracker.drops.find(id) != ddl_tracker.drops.end()) {
dropped_tables.insert(name);
- corrupted_pages.drop_space(id);
+ drop_space(id);
continue;
}
@@ -4866,7 +4936,7 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages)
if (new_name != name) {
renamed_tables[name] = new_name;
if (opt_log_innodb_page_corruption)
- corrupted_pages.rename_space(id, new_name);
+ rename_space(id, new_name);
}
}
@@ -4889,7 +4959,7 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages)
dropped_tables.erase(name);
new_tables[id] = name;
if (opt_log_innodb_page_corruption)
- corrupted_pages.drop_space(id);
+ drop_space(id);
}
}
@@ -4898,7 +4968,8 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages)
iter != renamed_tables.end(); ++iter) {
const std::string old_name = iter->first;
std::string new_name = iter->second;
- backup_file_printf((old_name + ".ren").c_str(), "%s", new_name.c_str());
+ DBUG_ASSERT(ds_data);
+ ds_data->backup_file_printf((old_name + ".ren").c_str(), "%s", new_name.c_str());
}
// Mark tablespaces for drop
@@ -4906,7 +4977,7 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages)
iter != dropped_tables.end();
iter++) {
const std::string name(*iter);
- backup_file_printf((name + ".del").c_str(), "%s", "");
+ ds_data->backup_file_printf((name + ".del").c_str(), "%s", "");
}
// Load and copy new tables.
@@ -4981,8 +5052,9 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages)
node->name, strlen(node->name));
dest_name.append(".new");
- xtrabackup_copy_datafile(node, 0, dest_name.c_str(), wf_write_through,
- corrupted_pages);
+ xtrabackup_copy_datafile(ds_data, ds_meta,
+ node, 0, dest_name.c_str(),
+ wf_write_through, *this);
}
}
@@ -5225,9 +5297,12 @@ exit:
ut_ad(fil_space_t::zip_size(flags) == info.zip_size);
ut_ad(fil_space_t::physical_size(flags) == info.page_size);
- if (fil_space_t::create(info.space_id, flags,
- FIL_TYPE_TABLESPACE, 0, FIL_ENCRYPTION_DEFAULT,
- true)) {
+ mysql_mutex_lock(&fil_system.mutex);
+ fil_space_t* space = fil_space_t::create(info.space_id, flags,
+ FIL_TYPE_TABLESPACE, 0,
+ FIL_ENCRYPTION_DEFAULT, true);
+ mysql_mutex_unlock(&fil_system.mutex);
+ if (space) {
*success = xb_space_create_file(real_name, info.space_id,
flags, &file);
} else {
@@ -6038,7 +6113,7 @@ error:
}
}
else
- corrupted_pages.print_to_file(MB_CORRUPTED_PAGES_FILE);
+ corrupted_pages.print_to_file(NULL, MB_CORRUPTED_PAGES_FILE);
if (ok) {
msg("Last binlog file %s, position %lld",
@@ -6672,6 +6747,7 @@ int main(int argc, char **argv)
*/
if (strcmp(argv[1], "--mysqld") == 0)
{
+ srv_operation= SRV_OPERATION_EXPORT_RESTORED;
extern int mysqld_main(int argc, char **argv);
argc--;
argv++;
diff --git a/extra/mariabackup/xtrabackup.h b/extra/mariabackup/xtrabackup.h
index d2a5e31645b..53784a3fb56 100644
--- a/extra/mariabackup/xtrabackup.h
+++ b/extra/mariabackup/xtrabackup.h
@@ -49,11 +49,13 @@ public:
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;
+ bool print_to_file(ds_ctxt *ds_data, const char *file_name) const;
void read_from_file(const char *file_name);
bool empty() const;
void zero_out_free_pages();
+ void backup_fix_ddl(ds_ctxt *ds_data, ds_ctxt *ds_meta);
+
private:
void add_page_no_lock(const char *space_name, page_id_t page_id,
bool convert_space_name);
@@ -66,6 +68,7 @@ private:
container_t m_spaces;
};
+
/* value of the --incremental option */
extern lsn_t incremental_lsn;
@@ -74,13 +77,12 @@ extern char *xtrabackup_incremental_dir;
extern char *xtrabackup_incremental_basedir;
extern char *innobase_data_home_dir;
extern char *innobase_buffer_pool_filename;
+extern char *aria_log_dir_path;
extern char *xb_plugin_dir;
extern char *xb_rocksdb_datadir;
extern my_bool xb_backup_rocksdb;
extern uint opt_protocol;
-extern ds_ctxt_t *ds_meta;
-extern ds_ctxt_t *ds_data;
extern xb_page_bitmap *changed_page_bitmap;
@@ -177,7 +179,8 @@ extern ulong opt_binlog_info;
extern ulong xtrabackup_innodb_force_recovery;
void xtrabackup_io_throttling(void);
-my_bool xb_write_delta_metadata(const char *filename,
+my_bool xb_write_delta_metadata(ds_ctxt *ds_meta,
+ const char *filename,
const xb_delta_info_t *info);
/************************************************************************
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 708107ff120..6812445c6d5 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -79,7 +79,6 @@ extern "C" {
typedef const struct my_charset_handler_st MY_CHARSET_HANDLER;
typedef const struct my_collation_handler_st MY_COLLATION_HANDLER;
-typedef const struct unicase_info_st MY_UNICASE_INFO;
typedef const struct casefold_info_st MY_CASEFOLD_INFO;
typedef const struct uni_ctype_st MY_UNI_CTYPE;
typedef const struct my_uni_idx_st MY_UNI_IDX;
@@ -97,29 +96,10 @@ struct casefold_info_st
{
my_wc_t maxchar;
const MY_CASEFOLD_CHARACTER * const *page;
+ const uint16 * const *simple_weight; /* For general_ci-alike collations */
};
-typedef struct unicase_info_char_st
-{
- uint32 toupper;
- uint32 tolower;
- uint32 sort;
-} MY_UNICASE_CHARACTER;
-
-
-struct unicase_info_st
-{
- my_wc_t maxchar;
- MY_UNICASE_CHARACTER **page;
-};
-
-
-extern MY_UNICASE_INFO my_unicase_default;
-extern MY_UNICASE_INFO my_unicase_turkish;
-extern MY_UNICASE_INFO my_unicase_mysql500;
-extern MY_UNICASE_INFO my_unicase_unicode520;
-
#define MY_UCA_MAX_CONTRACTION 6
/*
The DUCET tables in ctype-uca.c are dumped with a limit of 8 weights
@@ -391,6 +371,28 @@ typedef enum enum_collation_name_mode
#define MY_STRXFRM_REVERSE_LEVEL6 0x00200000 /* if reverse order for level6 */
#define MY_STRXFRM_REVERSE_SHIFT 16
+/* Flags to strnncollsp_nchars */
+/*
+ MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES -
+ defines if inside strnncollsp_nchars()
+ short strings should be virtually extended to "nchars"
+ characters by emulating trimmed trailing spaces.
+
+ This flag is needed when comparing packed strings of the CHAR
+ data type, when trailing spaces are trimmed on storage (like in InnoDB),
+ however the actual values (after unpacking) will have those trailing
+ spaces.
+
+ If this flag is passed, strnncollsp_nchars() performs both
+ truncating longer strings and extending shorter strings
+ to exactly "nchars".
+
+ If this flag is not passed, strnncollsp_nchars() only truncates longer
+ strings to "nchars", but does not extend shorter strings to "nchars".
+*/
+#define MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES 1
+
+
/*
Collation IDs for MariaDB that should not conflict with MySQL.
We reserve 256..511, because MySQL will most likely use this range
@@ -526,7 +528,8 @@ struct my_collation_handler_st
int (*strnncollsp_nchars)(CHARSET_INFO *,
const uchar *str1, size_t len1,
const uchar *str2, size_t len2,
- size_t nchars);
+ size_t nchars,
+ uint flags);
size_t (*strnxfrm)(CHARSET_INFO *,
uchar *dst, size_t dstlen, uint nweights,
const uchar *src, size_t srclen, uint flags);
@@ -772,7 +775,6 @@ struct charset_info_st
const uint16 *tab_to_uni;
MY_UNI_IDX *tab_from_uni;
MY_CASEFOLD_INFO *casefold;
- MY_UNICASE_INFO *caseinfo;
const uchar *state_map;
const uchar *ident_map;
uint strxfrm_multiply;
@@ -1668,7 +1670,7 @@ int my_wildcmp_unicode(CHARSET_INFO *cs,
const char *str, const char *str_end,
const char *wildstr, const char *wildend,
int escape, int w_one, int w_many,
- MY_UNICASE_INFO *weights);
+ MY_CASEFOLD_INFO *weights);
extern my_bool my_parse_charset_xml(MY_CHARSET_LOADER *loader,
const char *buf, size_t buflen);
diff --git a/include/m_string.h b/include/m_string.h
index 9e35be404ec..046dc39d13a 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -199,9 +199,22 @@ extern ulonglong strtoull(const char *str, char **ptr, int base);
#include <mysql/plugin.h>
-#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1))
-#define USTRING_WITH_LEN(X) ((uchar*) X), ((size_t) (sizeof(X) - 1))
-#define C_STRING_WITH_LEN(X) ((char *) (X)), ((size_t) (sizeof(X) - 1))
+#ifdef __cplusplus
+#include <type_traits>
+template<typename T> inline const char *_swl_check(T s)
+{
+ static_assert(std::is_same<T, const char (&)[sizeof(T)]>::value
+ || std::is_same<T, const char [sizeof(T)]>::value,
+ "Wrong argument for STRING_WITH_LEN()");
+ return s;
+}
+#define STRING_WITH_LEN(X) _swl_check<decltype(X)>(X), ((size_t) (sizeof(X) - 1))
+#else
+#define STRING_WITH_LEN(X) (X ""), ((size_t) (sizeof(X) - 1))
+#endif
+
+#define USTRING_WITH_LEN(X) (uchar*) STRING_WITH_LEN(X)
+#define C_STRING_WITH_LEN(X) (char *) STRING_WITH_LEN(X)
#define LEX_STRING_WITH_LEN(X) (X).str, (X).length
typedef struct st_mysql_const_lex_string LEX_CSTRING;
diff --git a/include/my_alloca.h b/include/my_alloca.h
index 761c2adb890..85fa64e9558 100644
--- a/include/my_alloca.h
+++ b/include/my_alloca.h
@@ -32,7 +32,10 @@
#endif
#endif
-#if defined(HAVE_ALLOCA)
+#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43)
+#pragma alloca
+#endif /* _AIX */
+
/*
If the GCC/LLVM compiler from the MinGW is used,
alloca may not be defined when using the MSVC CRT:
@@ -40,6 +43,5 @@
#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && !defined(alloca)
#define alloca __builtin_alloca
#endif /* GNUC */
-#endif
#endif /* MY_ALLOCA_INCLUDED */
diff --git a/include/my_base.h b/include/my_base.h
index 22f1ea0a5df..05b3b56359e 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -104,7 +104,8 @@ enum ha_key_alg {
HA_KEY_ALG_RTREE= 2, /* R-tree, for spatial searches */
HA_KEY_ALG_HASH= 3, /* HASH keys (HEAP tables) */
HA_KEY_ALG_FULLTEXT= 4, /* FULLTEXT (MyISAM tables) */
- HA_KEY_ALG_LONG_HASH= 5 /* long BLOB keys */
+ HA_KEY_ALG_LONG_HASH= 5, /* long BLOB keys */
+ HA_KEY_ALG_UNIQUE_HASH= 6 /* Internal UNIQUE hash (Aria) */
};
/* Storage media types */
@@ -276,11 +277,17 @@ enum ha_base_keytype {
#define HA_SPATIAL 1024U /* For spatial search */
#define HA_NULL_ARE_EQUAL 2048U /* NULL in key are cmp as equal */
#define HA_GENERATED_KEY 8192U /* Automatically generated key */
+/*
+ Part of unique hash key. Used only for temporary (work) tables so is not
+ written to .frm files.
+*/
+#define HA_UNIQUE_HASH 262144U
/* The combination of the above can be used for key type comparison. */
#define HA_KEYFLAG_MASK (HA_NOSAME | HA_AUTO_KEY | \
HA_FULLTEXT | HA_UNIQUE_CHECK | \
- HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY)
+ HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY | \
+ HA_UNIQUE_HASH)
/*
Key contains partial segments.
diff --git a/include/my_rdtsc.h b/include/my_rdtsc.h
index b2d30fa3151..8b9b0046bc0 100644
--- a/include/my_rdtsc.h
+++ b/include/my_rdtsc.h
@@ -72,6 +72,26 @@ struct my_timer_info
typedef struct my_timer_info MY_TIMER_INFO;
+#define MY_TIMER_ROUTINE_RDTSC 5
+#define MY_TIMER_ROUTINE_ASM_IA64 6
+#define MY_TIMER_ROUTINE_PPC_GET_TIMEBASE 7
+#define MY_TIMER_ROUTINE_GETHRTIME 9
+#define MY_TIMER_ROUTINE_READ_REAL_TIME 10
+#define MY_TIMER_ROUTINE_CLOCK_GETTIME 11
+#define MY_TIMER_ROUTINE_GETTIMEOFDAY 13
+#define MY_TIMER_ROUTINE_QUERYPERFORMANCECOUNTER 14
+#define MY_TIMER_ROUTINE_GETTICKCOUNT 15
+#define MY_TIMER_ROUTINE_TIME 16
+#define MY_TIMER_ROUTINE_TIMES 17
+#define MY_TIMER_ROUTINE_FTIME 18
+#define MY_TIMER_ROUTINE_ASM_GCC_SPARC64 23
+#define MY_TIMER_ROUTINE_ASM_GCC_SPARC32 24
+#define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME 25
+#define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26
+#define MY_TIMER_ROUTINE_ASM_S390 28
+#define MY_TIMER_ROUTINE_AARCH64 29
+#define MY_TIMER_ROUTINE_RISCV 30
+
C_MODE_START
/**
@@ -133,28 +153,36 @@ C_MODE_START
static inline ulonglong my_timer_cycles(void)
{
# if __has_builtin(__builtin_readcyclecounter) && !defined (__aarch64__)
+ #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_AARCH64
return __builtin_readcyclecounter();
# elif defined _M_IX86 || defined _M_X64 || defined __i386__ || defined __x86_64__
+ #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_RDTSC
return __rdtsc();
#elif defined _M_ARM64
+ #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_AARCH64
return _ReadStatusReg(ARM64_CNTVCT);
# elif defined(__INTEL_COMPILER) && defined(__ia64__) && defined(HAVE_IA64INTRIN_H)
+ #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_ASM_IA64
return (ulonglong) __getReg(_IA64_REG_AR_ITC); /* (3116) */
#elif defined(__GNUC__) && defined(__ia64__)
+ #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_ASM_IA64
{
ulonglong result;
__asm __volatile__ ("mov %0=ar.itc" : "=r" (result));
return result;
}
#elif defined __GNUC__ && defined __powerpc__
+ #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_PPC_GET_TIMEBASE
return __builtin_ppc_get_timebase();
#elif defined(__GNUC__) && defined(__sparcv9) && defined(_LP64)
+ #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_ASM_GCC_SPARC64
{
ulonglong result;
__asm __volatile__ ("rd %%tick,%0" : "=r" (result));
return result;
}
#elif defined(__GNUC__) && defined(__sparc__) && !defined(_LP64)
+ #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_ASM_GCC_SPARC32
{
union {
ulonglong wholeresult;
@@ -167,6 +195,7 @@ static inline ulonglong my_timer_cycles(void)
return result.wholeresult;
}
#elif defined(__GNUC__) && defined(__s390__)
+ #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_ASM_S390
/* covers both s390 and s390x */
{
ulonglong result;
@@ -174,12 +203,14 @@ static inline ulonglong my_timer_cycles(void)
return result;
}
#elif defined(__GNUC__) && defined (__aarch64__)
+ #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_AARCH64
{
ulonglong result;
__asm __volatile("mrs %0, CNTVCT_EL0" : "=&r" (result));
return result;
}
#elif defined(__riscv)
+ #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_RISCV
/* Use RDCYCLE (and RDCYCLEH on riscv32) */
{
# if __riscv_xlen == 32
@@ -202,9 +233,11 @@ static inline ulonglong my_timer_cycles(void)
}
# endif
#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
+ #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_GETHRTIME
/* gethrtime may appear as either cycle or nanosecond counter */
return (ulonglong) gethrtime();
#else
+ #define MY_TIMER_ROUTINE_CYCLES 0
return 0;
#endif
}
@@ -241,25 +274,5 @@ void my_timer_init(MY_TIMER_INFO *mti);
C_MODE_END
-#define MY_TIMER_ROUTINE_RDTSC 5
-#define MY_TIMER_ROUTINE_ASM_IA64 6
-#define MY_TIMER_ROUTINE_PPC_GET_TIMEBASE 7
-#define MY_TIMER_ROUTINE_GETHRTIME 9
-#define MY_TIMER_ROUTINE_READ_REAL_TIME 10
-#define MY_TIMER_ROUTINE_CLOCK_GETTIME 11
-#define MY_TIMER_ROUTINE_GETTIMEOFDAY 13
-#define MY_TIMER_ROUTINE_QUERYPERFORMANCECOUNTER 14
-#define MY_TIMER_ROUTINE_GETTICKCOUNT 15
-#define MY_TIMER_ROUTINE_TIME 16
-#define MY_TIMER_ROUTINE_TIMES 17
-#define MY_TIMER_ROUTINE_FTIME 18
-#define MY_TIMER_ROUTINE_ASM_GCC_SPARC64 23
-#define MY_TIMER_ROUTINE_ASM_GCC_SPARC32 24
-#define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME 25
-#define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26
-#define MY_TIMER_ROUTINE_ASM_S390 28
-#define MY_TIMER_ROUTINE_AARCH64 29
-#define MY_TIMER_ROUTINE_RISCV 30
-
#endif
diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h
index 9b172cfe9b0..fd3b29cc5c9 100644
--- a/include/mysql/psi/mysql_file.h
+++ b/include/mysql/psi/mysql_file.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_idle.h b/include/mysql/psi/mysql_idle.h
index 1c9927f95b2..dc7f5180285 100644
--- a/include/mysql/psi/mysql_idle.h
+++ b/include/mysql/psi/mysql_idle.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/include/mysql/psi/mysql_mdl.h b/include/mysql/psi/mysql_mdl.h
index 483f28f396b..8721a191cd8 100644
--- a/include/mysql/psi/mysql_mdl.h
+++ b/include/mysql/psi/mysql_mdl.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_memory.h b/include/mysql/psi/mysql_memory.h
index 06027a655f7..7f54b00d6fe 100644
--- a/include/mysql/psi/mysql_memory.h
+++ b/include/mysql/psi/mysql_memory.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_ps.h b/include/mysql/psi/mysql_ps.h
index 670555fc55f..89f34ef63f7 100644
--- a/include/mysql/psi/mysql_ps.h
+++ b/include/mysql/psi/mysql_ps.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_socket.h b/include/mysql/psi/mysql_socket.h
index c78154b73db..95cb02a5f6c 100644
--- a/include/mysql/psi/mysql_socket.h
+++ b/include/mysql/psi/mysql_socket.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/include/mysql/psi/mysql_sp.h b/include/mysql/psi/mysql_sp.h
index 1fec59cec91..c25247459ae 100644
--- a/include/mysql/psi/mysql_sp.h
+++ b/include/mysql/psi/mysql_sp.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_stage.h b/include/mysql/psi/mysql_stage.h
index cb579ea4e8c..b6bc5ce3706 100644
--- a/include/mysql/psi/mysql_stage.h
+++ b/include/mysql/psi/mysql_stage.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_statement.h b/include/mysql/psi/mysql_statement.h
index 78a4de73869..544bba67885 100644
--- a/include/mysql/psi/mysql_statement.h
+++ b/include/mysql/psi/mysql_statement.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/include/mysql/psi/mysql_table.h b/include/mysql/psi/mysql_table.h
index 03b6e998562..317627a63ff 100644
--- a/include/mysql/psi/mysql_table.h
+++ b/include/mysql/psi/mysql_table.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/include/mysql/psi/mysql_thread.h b/include/mysql/psi/mysql_thread.h
index 697c23ae423..11cf3548e8c 100644
--- a/include/mysql/psi/mysql_thread.h
+++ b/include/mysql/psi/mysql_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
Copyright (c) 2020, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/include/mysql/psi/mysql_transaction.h b/include/mysql/psi/mysql_transaction.h
index 02f08bfab44..a4444804f5c 100644
--- a/include/mysql/psi/mysql_transaction.h
+++ b/include/mysql/psi/mysql_transaction.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/psi.h b/include/mysql/psi/psi.h
index 9b02961749d..702d31fa01e 100644
--- a/include/mysql/psi/psi.h
+++ b/include/mysql/psi/psi.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/psi_abi_v0.h b/include/mysql/psi/psi_abi_v0.h
index df47ae78eb4..c75a51f7fbf 100644
--- a/include/mysql/psi/psi_abi_v0.h
+++ b/include/mysql/psi/psi_abi_v0.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/psi_abi_v1.h b/include/mysql/psi/psi_abi_v1.h
index 61018bdf030..e195ea5ba8d 100644
--- a/include/mysql/psi/psi_abi_v1.h
+++ b/include/mysql/psi/psi_abi_v1.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/psi_abi_v2.h b/include/mysql/psi/psi_abi_v2.h
index 31c9e8fc42f..fdbd36f2259 100644
--- a/include/mysql/psi/psi_abi_v2.h
+++ b/include/mysql/psi/psi_abi_v2.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/psi_base.h b/include/mysql/psi/psi_base.h
index c04f817b2c1..6cf531950f0 100644
--- a/include/mysql/psi/psi_base.h
+++ b/include/mysql/psi/psi_base.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/psi_memory.h b/include/mysql/psi/psi_memory.h
index 21a86a36368..f06ec525e08 100644
--- a/include/mysql/psi/psi_memory.h
+++ b/include/mysql/psi/psi_memory.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/service_encryption.h b/include/mysql/service_encryption.h
index 280b9c69e35..4963940758c 100644
--- a/include/mysql/service_encryption.h
+++ b/include/mysql/service_encryption.h
@@ -30,8 +30,6 @@
#ifndef __cplusplus
#define inline __inline
#endif
-#else
-#include <stdlib.h>
#endif
#endif
diff --git a/include/ssl_compat.h b/include/ssl_compat.h
index 664f3aac87c..3678e5fa084 100644
--- a/include/ssl_compat.h
+++ b/include/ssl_compat.h
@@ -19,7 +19,8 @@
/* OpenSSL version specific definitions */
#if defined(OPENSSL_VERSION_NUMBER)
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && \
+ !(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x30500000L)
#define HAVE_OPENSSL11 1
#define SSL_LIBRARY OpenSSL_version(OPENSSL_VERSION)
#define ERR_remove_state(X) ERR_clear_error()
diff --git a/libmariadb b/libmariadb
-Subproject 12bd1d5511fc2ff766ff6256c71b79a95739533
+Subproject c2b322d2ca27ef66385d9938b98541c7cf14ac7
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 14515cdcf4d..bbbe10121ba 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -575,6 +575,8 @@ int init_embedded_server(int argc, char **argv, char **groups)
if (ho_error != 0)
return 1;
+ my_timer_init(&sys_timer_info);
+
if (init_common_variables())
{
mysql_server_end();
diff --git a/libmysqld/libmysql.c b/libmysqld/libmysql.c
index 6c7e0b3b812..7f55b0c2726 100644
--- a/libmysqld/libmysql.c
+++ b/libmysqld/libmysql.c
@@ -2953,7 +2953,8 @@ my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *my_bind)
break;
default:
strmov(stmt->sqlstate, unknown_sqlstate);
- sprintf(stmt->last_error,
+ snprintf(stmt->last_error,
+ sizeof(stmt->last_error),
ER(stmt->last_errno= CR_UNSUPPORTED_PARAM_TYPE),
param->buffer_type, count);
DBUG_RETURN(1);
@@ -3040,7 +3041,9 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
{
/* Long data handling should be used only for string/binary types */
strmov(stmt->sqlstate, unknown_sqlstate);
- sprintf(stmt->last_error, ER(stmt->last_errno= CR_INVALID_BUFFER_USE),
+ snprintf(stmt->last_error,
+ sizeof(stmt->last_error),
+ ER(stmt->last_errno= CR_INVALID_BUFFER_USE),
param->param_number);
DBUG_RETURN(1);
}
@@ -4171,7 +4174,8 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *my_bind)
if (setup_one_fetch_function(param, field))
{
strmov(stmt->sqlstate, unknown_sqlstate);
- sprintf(stmt->last_error,
+ snprintf(stmt->last_error,
+ sizeof(stmt->last_error),
ER(stmt->last_errno= CR_UNSUPPORTED_PARAM_TYPE),
field->type, param_count);
DBUG_RETURN(1);
diff --git a/man/mariadb-upgrade.1 b/man/mariadb-upgrade.1
index c4041f281a5..198efcac747 100644
--- a/man/mariadb-upgrade.1
+++ b/man/mariadb-upgrade.1
@@ -656,7 +656,8 @@ The MariaDB user name to use when connecting to the server and not using the cur
Display more output about the process\&. Using it twice will print connection
arguments; using it 3 times will print out all CHECK, RENAME and ALTER TABLE
commands used during the check phase; using it 4 times (added in MariaDB 10.0.14)
-will also write out all mysqlcheck commands used\&.
+will also write out all mariadb-check commands used; using it 5 times will print all
+the mariadb commands used and their results while running mysql_fix_privilege_tables script\&.
.RE
.sp
.RS 4
diff --git a/mysql-test/include/analyze-format.inc b/mysql-test/include/analyze-format.inc
index e65450ff001..7628156b205 100644
--- a/mysql-test/include/analyze-format.inc
+++ b/mysql-test/include/analyze-format.inc
@@ -1,3 +1,3 @@
# The time on ANALYSE FORMAT=JSON is rather variable
---replace_regex /("(r_total_time_ms|r_table_time_ms|r_other_time_ms|r_buffer_size|r_filling_time_ms|r_query_time_in_progress_ms|r_unpack_time_ms|cost)": )[^, \n]*/\1"REPLACED"/
+--replace_regex /("(r_[a-z_]*_time(_in_progress)?_ms|r_buffer_size|cost)": )[^, \n]*/\1"REPLACED"/
diff --git a/mysql-test/include/ctype_casefolding.inc b/mysql-test/include/ctype_casefolding.inc
index 74b2ab7650a..fc77b396f68 100644
--- a/mysql-test/include/ctype_casefolding.inc
+++ b/mysql-test/include/ctype_casefolding.inc
@@ -21,6 +21,12 @@ INSERT INTO case_folding (code) VALUES
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
+
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
DROP TABLE case_folding;
diff --git a/mysql-test/include/ctype_casefolding_supplementary.inc b/mysql-test/include/ctype_casefolding_supplementary.inc
new file mode 100644
index 00000000000..7646ab5682e
--- /dev/null
+++ b/mysql-test/include/ctype_casefolding_supplementary.inc
@@ -0,0 +1,16 @@
+CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c, SPACE(64) AS comment LIMIT 0;
+SHOW CREATE TABLE case_folding;
+
+INSERT INTO case_folding (code, comment) VALUES (0x10595, 'VITHKUQI CAPITAL LETTER ZE (Unicode-14.0)');
+INSERT INTO case_folding (code, comment) VALUES (0x105BC, 'VITHKUQI SMALL LETTER ZE (Unicode-14.0)');
+INSERT INTO case_folding (code, comment) VALUES (0x1E921, 'ADLAM CAPITAL LETTER SHA (Unicode-9.0)');
+INSERT INTO case_folding (code, comment) VALUES (0x1E943, 'ADLAM SMALL LETTER SHA (Unicode-9.0)');
+
+UPDATE case_folding SET c=CHAR(code USING utf32);
+SELECT
+ HEX(CONVERT(c USING utf32)) AS ch,
+ HEX(CONVERT(LOWER(c) USING utf32)) AS cl,
+ HEX(CONVERT(UPPER(c) USING utf32)) AS cu,
+ comment
+FROM case_folding ORDER BY BINARY(c);
+DROP TABLE case_folding;
diff --git a/mysql-test/include/ctype_nopad_prefix_unique.inc b/mysql-test/include/ctype_nopad_prefix_unique.inc
new file mode 100644
index 00000000000..b25128e9fef
--- /dev/null
+++ b/mysql-test/include/ctype_nopad_prefix_unique.inc
@@ -0,0 +1,85 @@
+--echo #
+--echo # MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations
+--echo #
+
+# TEXT
+
+if (`SELECT UPPER(@@storage_engine) != 'MEMORY'`)
+{
+EXECUTE IMMEDIATE REPLACE(
+ 'CREATE TABLE t1 ( '
+ ' a TEXT COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+ '<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('ss ');
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+
+
+EXECUTE IMMEDIATE REPLACE(
+ 'CREATE TABLE t1 ( '
+ ' a TEXT COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+ '<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('ss ');
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+}
+
+
+# VARCHAR
+
+EXECUTE IMMEDIATE REPLACE(
+ 'CREATE TABLE t1 ( '
+ ' a VARCHAR(2000) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+ '<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('ss ');
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+
+
+EXECUTE IMMEDIATE REPLACE(
+ 'CREATE TABLE t1 ( '
+ ' a VARCHAR(2000) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+ '<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('ss ');
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+
+# CHAR
+
+# MyISAM is buggy on CHAR+BTREE+UNIQUE+PREFIX (see MDEV-30048), disable for now
+# Other engines work fine
+
+if (`SELECT UPPER(@@storage_engine) != 'MYISAM'`)
+{
+EXECUTE IMMEDIATE REPLACE(
+ 'CREATE TABLE t1 ( '
+ ' a CHAR(20) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+ '<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+}
+
+EXECUTE IMMEDIATE REPLACE(
+ 'CREATE TABLE t1 ( '
+ ' a CHAR(20) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+ '<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
diff --git a/mysql-test/include/expect_crash.inc b/mysql-test/include/expect_crash.inc
index af8b0908104..b4bd9828a08 100644
--- a/mysql-test/include/expect_crash.inc
+++ b/mysql-test/include/expect_crash.inc
@@ -1,5 +1,5 @@
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
# There should be a debug crash after using this .inc file
--exec echo "wait" > $_expect_file_name
diff --git a/mysql-test/include/explain_non_select.inc b/mysql-test/include/explain_non_select.inc
index 8e60f582f9e..6caa093aab2 100644
--- a/mysql-test/include/explain_non_select.inc
+++ b/mysql-test/include/explain_non_select.inc
@@ -792,6 +792,22 @@ INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
DROP TABLE t1;
+--echo #75
+
+CREATE TABLE t1 (id INT PRIMARY KEY, i INT);
+--let $query = INSERT INTO t1 VALUES (3,10), (7,11), (3,11) ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);
+--source include/explain_utils.inc
+DROP TABLE t1;
+
+--echo #76
+
+CREATE TABLE t1 (id INT PRIMARY KEY, i INT);
+CREATE TABLE t2 (a INT, b INT);
+INSERT INTO t2 VALUES (1,10), (3,10), (7,11), (3,11);
+--let $query = INSERT INTO t1 SELECT * FROM t2 ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);
+--source include/explain_utils.inc
+DROP TABLE t1,t2;
+
--echo #
--echo # Bug #12949629: CLIENT LOSES CONNECTION AFTER EXECUTING A PROCEDURE WITH
--echo # EXPLAIN UPDATE/DEL/INS
diff --git a/mysql-test/include/kill_galera.inc b/mysql-test/include/kill_galera.inc
index d7f665df6c7..aba672d8a89 100644
--- a/mysql-test/include/kill_galera.inc
+++ b/mysql-test/include/kill_galera.inc
@@ -1,8 +1,8 @@
--echo Killing server ...
# Write file to make mysql-test-run.pl expect the crash, but don't start it
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name
# Kill the connected server
diff --git a/mysql-test/include/kill_mysqld.inc b/mysql-test/include/kill_mysqld.inc
index 86ee048a0f1..01ee7f82bdc 100644
--- a/mysql-test/include/kill_mysqld.inc
+++ b/mysql-test/include/kill_mysqld.inc
@@ -1,5 +1,5 @@
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--echo # Kill the server
--exec echo "wait" > $_expect_file_name
diff --git a/mysql-test/include/shutdown_mysqld.inc b/mysql-test/include/shutdown_mysqld.inc
index db0cfb82c68..fc2972560c3 100644
--- a/mysql-test/include/shutdown_mysqld.inc
+++ b/mysql-test/include/shutdown_mysqld.inc
@@ -22,8 +22,8 @@ if ($rpl_inited)
}
# Write file to make mysql-test-run.pl expect the "crash", but don't start it
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name
# Avoid warnings from connection threads that does not have time to exit
diff --git a/mysql-test/include/sql_mode_pad_char_to_full_length.inc b/mysql-test/include/sql_mode_pad_char_to_full_length.inc
new file mode 100644
index 00000000000..df03c4dbc28
--- /dev/null
+++ b/mysql-test/include/sql_mode_pad_char_to_full_length.inc
@@ -0,0 +1,31 @@
+--echo #
+--echo # MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
+--echo #
+
+CREATE TABLE t1 (a INT,b CHAR(20));
+SHOW CREATE TABLE t1;
+CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
+INSERT INTO t1 VALUES (0,0);
+SET sql_mode='pad_char_to_full_length';
+DELETE FROM t1;
+DROP TABLE t1;
+
+
+SET sql_mode='';
+CREATE TABLE t1 (a INT,b CHAR(20));
+SHOW CREATE TABLE t1;
+CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
+SET sql_mode='pad_char_to_full_length';
+INSERT INTO t1 VALUES (0,0);
+DELETE FROM t1;
+DROP TABLE t1;
+
+
+SET sql_mode='';
+CREATE OR REPLACE TABLE t1 (a CHAR(20),b CHAR(20));
+SHOW CREATE TABLE t1;
+CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
+INSERT INTO t1 VALUES (0,0);
+SET sql_mode='pad_char_to_full_length';
+DELETE FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/lib/My/CoreDump.pm b/mysql-test/lib/My/CoreDump.pm
index 05b6edf1385..be6d21146d1 100644
--- a/mysql-test/lib/My/CoreDump.pm
+++ b/mysql-test/lib/My/CoreDump.pm
@@ -310,16 +310,8 @@ sub cdb_check {
`cdb -? 2>&1`;
if ($? >> 8)
{
- print "Cannot find cdb. Please Install Debugging tools for Windows\n";
- print "from http://www.microsoft.com/whdc/devtools/debugging/";
- if($ENV{'ProgramW6432'})
- {
- print "install64bit.mspx (native x64 version)\n";
- }
- else
- {
- print "installx86.mspx\n";
- }
+ print "Cannot find the cdb debugger. Please install Debugging tools for Windows\n";
+ print "and set PATH environment variable to include location of cdb.exe";
}
}
@@ -328,25 +320,6 @@ sub _cdb {
my ($core_name, $format)= @_;
print "\nTrying 'cdb' to get a backtrace\n";
return unless -f $core_name;
-
- # Try to set environment for debugging tools for Windows
- if ($ENV{'PATH'} !~ /Debugging Tools/)
- {
- if ($ENV{'ProgramW6432'})
- {
- # On x64 computer
- $ENV{'PATH'}.= ";".$ENV{'ProgramW6432'}."\\Debugging Tools For Windows (x64)";
- }
- else
- {
- # On x86 computer. Newest versions of Debugging tools are installed in the
- # directory with (x86) suffix, older versions did not have this suffix.
- $ENV{'PATH'}.= ";".$ENV{'ProgramFiles'}."\\Debugging Tools For Windows (x86)";
- $ENV{'PATH'}.= ";".$ENV{'ProgramFiles'}."\\Debugging Tools For Windows";
- }
- }
-
-
# Read module list, find out the name of executable and
# build symbol path (required by cdb if executable was built on
# different machine)
@@ -384,7 +357,7 @@ sub _cdb {
if (!$ENV{'_NT_SYMBOL_PATH'})
{
my $windir= $ENV{'windir'};
- my $symbol_cache= substr($windir ,0, index($windir,'\\'))."\\cdb_symbols";
+ my $symbol_cache= substr($windir ,0, index($windir,'\\'))."\\symbols";
print "OS debug symbols will be downloaded and stored in $symbol_cache.\n";
print "You can control the location of symbol cache with _NT_SYMBOL_PATH\n";
diff --git a/mysql-test/main/alter_table.result b/mysql-test/main/alter_table.result
index 879bc0edfec..1508bb9d34a 100644
--- a/mysql-test/main/alter_table.result
+++ b/mysql-test/main/alter_table.result
@@ -268,28 +268,6 @@ ERROR 42000: Incorrect table name ''
rename table t1 to ``;
ERROR 42000: Incorrect table name ''
drop table t1;
-drop table if exists t1, t2;
-Warnings:
-Note 1051 Unknown table 'test.t1,test.t2'
-create table t1 ( a varchar(10) not null primary key ) engine=myisam;
-create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1);
-flush tables;
-alter table t1 modify a varchar(10);
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` varchar(10) NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci UNION=(`t1`)
-flush tables;
-alter table t1 modify a varchar(10) not null;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` varchar(10) NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci UNION=(`t1`)
-drop table if exists t1, t2;
create table t1 (a int, b int, c int, d int, e int, f int, g int, h int,i int, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
insert ignore into t1 (a) values(1);
Warnings:
diff --git a/mysql-test/main/alter_table.test b/mysql-test/main/alter_table.test
index 8ddf60f26d8..ebf10008f48 100644
--- a/mysql-test/main/alter_table.test
+++ b/mysql-test/main/alter_table.test
@@ -244,20 +244,6 @@ alter table t1 rename to ``;
rename table t1 to ``;
drop table t1;
-#
-# BUG#6236 - ALTER TABLE MODIFY should set implicit NOT NULL on PK columns
-#
-drop table if exists t1, t2;
-create table t1 ( a varchar(10) not null primary key ) engine=myisam;
-create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1);
-flush tables;
-alter table t1 modify a varchar(10);
-show create table t2;
-flush tables;
-alter table t1 modify a varchar(10) not null;
-show create table t2;
-drop table if exists t1, t2;
-
# The following is also part of bug #6236 (CREATE TABLE didn't properly count
# not null columns for primary keys)
diff --git a/mysql-test/main/analyze_format_json.result b/mysql-test/main/analyze_format_json.result
index 02635a8f3dd..0e1ea88404b 100644
--- a/mysql-test/main/analyze_format_json.result
+++ b/mysql-test/main/analyze_format_json.result
@@ -201,8 +201,11 @@ ANALYZE
"buffer_type": "flat",
"buffer_size": "1Kb",
"join_type": "BNL",
+ "r_loops": 20,
"r_filtered": 100,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 60
}
}
]
@@ -257,8 +260,11 @@ ANALYZE
"buffer_size": "1Kb",
"join_type": "BNL",
"attached_condition": "tbl1.c > tbl2.c",
+ "r_loops": 20,
"r_filtered": 15.83333333,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 60
}
}
]
@@ -836,8 +842,11 @@ ANALYZE
"buffer_size": "65",
"join_type": "BNL",
"attached_condition": "<in_optimizer>(t2.b,t2.b in (subquery#2))",
+ "r_loops": 2,
"r_filtered": null,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 0
}
}
],
@@ -950,8 +959,11 @@ ANALYZE
"buffer_type": "flat",
"buffer_size": "1",
"join_type": "BNL",
+ "r_loops": 2,
"r_filtered": null,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 0
}
}
],
@@ -994,8 +1006,11 @@ ANALYZE
"buffer_size": "65",
"join_type": "BNL",
"attached_condition": "t2.f2 = t3.f3",
+ "r_loops": 0,
"r_filtered": null,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": null
}
}
]
@@ -1089,3 +1104,155 @@ ANALYZE
}
}
drop table t0,t1,t2;
+#
+# MDEV-30806: ANALYZE FORMAT=JSON: better support for BNL and BNL-H joins
+#
+create table t10 (
+a int,
+b int
+);
+insert into t10 select seq, seq/3 from seq_0_to_999;
+create table t11 (
+a int,
+b int
+);
+insert into t11 select seq, seq/5 from seq_0_to_999;
+analyze table t10,t11 persistent for all;
+Table Op Msg_type Msg_text
+test.t10 analyze status Engine-independent statistics collected
+test.t10 analyze status OK
+test.t11 analyze status Engine-independent statistics collected
+test.t11 analyze status OK
+analyze format=json
+select * from t10, t11
+where
+t10.a < 700 and
+t11.a < 100
+and t10.b=t11.b;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t11",
+ "access_type": "ALL",
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 1000,
+ "r_rows": 1000,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 10,
+ "r_filtered": 10,
+ "attached_condition": "t11.a < 100"
+ }
+ },
+ {
+ "block-nl-join": {
+ "table": {
+ "table_name": "t10",
+ "access_type": "ALL",
+ "loops": 100,
+ "r_loops": 1,
+ "rows": 1000,
+ "r_rows": 1000,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 70,
+ "r_filtered": 70,
+ "attached_condition": "t10.a < 700"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "1Kb",
+ "join_type": "BNL",
+ "attached_condition": "t10.b = t11.b",
+ "r_loops": 100,
+ "r_filtered": 0.424285714,
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 700
+ }
+ }
+ ]
+ }
+}
+set @tmp=@@join_cache_level, join_cache_level=6;
+analyze format=json
+select * from t10, t11
+where
+t10.a < 700 and
+t11.a < 100
+and t10.b=t11.b;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t11",
+ "access_type": "ALL",
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 1000,
+ "r_rows": 1000,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 10,
+ "r_filtered": 10,
+ "attached_condition": "t11.a < 100 and t11.b is not null"
+ }
+ },
+ {
+ "block-nl-join": {
+ "table": {
+ "table_name": "t10",
+ "access_type": "hash_ALL",
+ "key": "#hash#$hj",
+ "key_length": "5",
+ "used_key_parts": ["b"],
+ "ref": ["test.t11.b"],
+ "loops": 100,
+ "r_loops": 1,
+ "rows": 1000,
+ "r_rows": 1000,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 0.209580004,
+ "r_filtered": 70,
+ "attached_condition": "t10.a < 700"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "3Kb",
+ "join_type": "BNLH",
+ "attached_condition": "t10.b = t11.b",
+ "r_loops": 100,
+ "r_filtered": 100,
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 2.97
+ }
+ }
+ ]
+ }
+}
+set join_cache_level=@tmp;
+drop table t10, t11;
diff --git a/mysql-test/main/analyze_format_json.test b/mysql-test/main/analyze_format_json.test
index 84625f125fb..001616304cf 100644
--- a/mysql-test/main/analyze_format_json.test
+++ b/mysql-test/main/analyze_format_json.test
@@ -228,3 +228,45 @@ create table t2 as select * from t1;
--source include/analyze-format.inc
analyze format=json select a, (select t2.b from t2 where t2.a<t1.a order by t2.c limit 1) from t1 where t1.a<0;
drop table t0,t1,t2;
+
+
+--echo #
+--echo # MDEV-30806: ANALYZE FORMAT=JSON: better support for BNL and BNL-H joins
+--echo #
+--source include/have_sequence.inc
+create table t10 (
+ a int,
+ b int
+);
+insert into t10 select seq, seq/3 from seq_0_to_999;
+
+create table t11 (
+ a int,
+ b int
+);
+insert into t11 select seq, seq/5 from seq_0_to_999;
+
+analyze table t10,t11 persistent for all;
+
+--source include/analyze-format.inc
+analyze format=json
+select * from t10, t11
+where
+ t10.a < 700 and
+ t11.a < 100
+ and t10.b=t11.b;
+
+set @tmp=@@join_cache_level, join_cache_level=6;
+
+--source include/analyze-format.inc
+analyze format=json
+select * from t10, t11
+where
+ t10.a < 700 and
+ t11.a < 100
+ and t10.b=t11.b;
+
+set join_cache_level=@tmp;
+drop table t10, t11;
+
+
diff --git a/mysql-test/main/analyze_format_json_emb.result b/mysql-test/main/analyze_format_json_emb.result
new file mode 100644
index 00000000000..d61e205f031
--- /dev/null
+++ b/mysql-test/main/analyze_format_json_emb.result
@@ -0,0 +1,11 @@
+#
+# MDEV-31121: ANALYZE statement produces 0 for all timings in embedded serve
+#
+create table t1 (a int);
+insert into t1 values (0),(0);
+set @js='$out';
+set @out=(select json_extract(@js,'$**.query_block.r_total_time_ms'));
+select cast(json_extract(@out,'$[0]') as DOUBLE) > 0;
+cast(json_extract(@out,'$[0]') as DOUBLE) > 0
+1
+drop table t1;
diff --git a/mysql-test/main/analyze_format_json_emb.test b/mysql-test/main/analyze_format_json_emb.test
new file mode 100644
index 00000000000..dcf6f24dd8e
--- /dev/null
+++ b/mysql-test/main/analyze_format_json_emb.test
@@ -0,0 +1,18 @@
+--source include/is_embedded.inc
+--source include/big_test.inc
+
+--echo #
+--echo # MDEV-31121: ANALYZE statement produces 0 for all timings in embedded serve
+--echo #
+create table t1 (a int);
+insert into t1 values (0),(0);
+let $out=`
+analyze format=json select sleep(1+a) from t1
+`;
+
+evalp set @js='$out';
+set @out=(select json_extract(@js,'$**.query_block.r_total_time_ms'));
+select cast(json_extract(@out,'$[0]') as DOUBLE) > 0;
+
+drop table t1;
+
diff --git a/mysql-test/main/analyze_format_json_timings.result b/mysql-test/main/analyze_format_json_timings.result
new file mode 100644
index 00000000000..4686359186e
--- /dev/null
+++ b/mysql-test/main/analyze_format_json_timings.result
@@ -0,0 +1,199 @@
+#
+# MDEV-30830: ANALYZE FORMAT=JSON: r_unpack_time_ms is empty for the hashed joins
+#
+#
+# First, check a regular BNL-join
+#
+create table t1 (
+a int,
+b int
+);
+insert into t1 select seq, seq/3 from seq_0_to_99;
+create table t2 (
+a int,
+b int
+);
+insert into t2 select seq, seq/5 from seq_0_to_99;
+set @js='$out';
+set @out=(select json_extract(@js,'$**.block-nl-join.r_unpack_time_ms'));
+select cast(json_extract(@out,'$[0]') as DOUBLE) > 0;
+cast(json_extract(@out,'$[0]') as DOUBLE) > 0
+1
+drop table t1,t2;
+#
+# Now, check the hashed, BNL-H join
+#
+create table t1 (
+a int,
+b int
+);
+insert into t1 select seq, seq/3 from seq_0_to_499;
+create table t2 (
+a int,
+b int
+);
+insert into t2 select seq, seq/5 from seq_0_to_499;
+set @tmp=@@join_cache_level, join_cache_level=6;
+select '$out' as X;
+X
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 500,
+ "r_rows": 500,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "attached_condition": "t1.a < 700 and t1.b is not null"
+ }
+ },
+ {
+ "block-nl-join": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "hash_ALL",
+ "key": "#hash#$hj",
+ "key_length": "5",
+ "used_key_parts": ["b"],
+ "ref": ["test.t1.b"],
+ "loops": 500,
+ "r_loops": 1,
+ "rows": 500,
+ "r_rows": 500,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 10,
+ "r_filtered": 20,
+ "attached_condition": "t2.a < 100"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "18Kb",
+ "join_type": "BNLH",
+ "attached_condition": "t2.b = t1.b",
+ "r_loops": 500,
+ "r_filtered": 100,
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 0.594
+ }
+ }
+ ]
+ }
+}
+set @out=(select json_extract(@js,'$**.block-nl-join.r_unpack_time_ms'));
+select cast(json_extract(@out,'$[0]') as DOUBLE) > 0;
+cast(json_extract(@out,'$[0]') as DOUBLE) > 0
+1
+set join_cache_level=@tmp;
+drop table t1, t2;
+#
+# MDEV-30972: ANALYZE FORMAT=JSON: some time is unaccounted-for in BNL-H join
+#
+create table t1 (
+a int,
+col1 varchar(100),
+col2 varchar(100),
+col3 varchar(100)
+);
+insert into t1 select
+seq/100,
+concat('col1-', seq),
+concat('col1-', seq),
+concat('col1-', seq)
+from seq_1_to_1000;
+create table t2 (
+a int,
+col1 varchar(100),
+col2 varchar(100),
+col3 varchar(100)
+);
+insert into t2 select
+seq/100,
+concat('col1-', seq),
+concat('col1-', seq),
+concat('col1-', seq)
+from seq_1_to_2000;
+set @tmp=@@join_cache_level, join_cache_level=6;
+select '$out' as X;
+X
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 1000,
+ "r_rows": 1000,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "attached_condition": "t1.a is not null"
+ }
+ },
+ {
+ "block-nl-join": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "hash_ALL",
+ "key": "#hash#$hj",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.t1.a"],
+ "loops": 1000,
+ "r_loops": 1,
+ "rows": 2000,
+ "r_rows": 2000,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 10,
+ "r_filtered": 100
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNLH",
+ "attached_condition": "t2.a = t1.a and concat(t1.col1,t1.col2,t1.col3) = concat(t2.col1,t2.col2,t2.col3)",
+ "r_loops": 1000,
+ "r_filtered": 1.025630506,
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 97.501
+ }
+ }
+ ]
+ }
+}
+set @out=(select json_extract(@js,'$**.block-nl-join.r_other_time_ms'));
+select cast(json_extract(@out,'$[0]') as DOUBLE) > 0;
+cast(json_extract(@out,'$[0]') as DOUBLE) > 0
+1
+set join_cache_level=@tmp;
+drop table t1, t2;
diff --git a/mysql-test/main/analyze_format_json_timings.test b/mysql-test/main/analyze_format_json_timings.test
new file mode 100644
index 00000000000..fe02c318388
--- /dev/null
+++ b/mysql-test/main/analyze_format_json_timings.test
@@ -0,0 +1,127 @@
+#
+# Tests to check that r_something_time_ms is non-zero in
+# ANALYZE FORMAT=JSON <statement>
+#
+--source include/default_optimizer_switch.inc
+--source include/have_sequence.inc
+
+# The tests here are large so that we get non-zero timings
+--source include/big_test.inc
+
+--echo #
+--echo # MDEV-30830: ANALYZE FORMAT=JSON: r_unpack_time_ms is empty for the hashed joins
+--echo #
+
+--echo #
+--echo # First, check a regular BNL-join
+--echo #
+create table t1 (
+ a int,
+ b int
+);
+insert into t1 select seq, seq/3 from seq_0_to_99;
+
+create table t2 (
+ a int,
+ b int
+);
+insert into t2 select seq, seq/5 from seq_0_to_99;
+
+let $out=`
+analyze format=json
+select * from t1, t2
+where
+ t1.a < 700 and
+ t2.a < 100
+ and t1.b=t2.b
+`;
+
+evalp set @js='$out';
+set @out=(select json_extract(@js,'$**.block-nl-join.r_unpack_time_ms'));
+select cast(json_extract(@out,'$[0]') as DOUBLE) > 0;
+drop table t1,t2;
+
+--echo #
+--echo # Now, check the hashed, BNL-H join
+--echo #
+create table t1 (
+ a int,
+ b int
+);
+insert into t1 select seq, seq/3 from seq_0_to_499;
+
+create table t2 (
+ a int,
+ b int
+);
+insert into t2 select seq, seq/5 from seq_0_to_499;
+set @tmp=@@join_cache_level, join_cache_level=6;
+
+let $out=`
+analyze format=json
+select * from t1, t2
+where
+ t1.a < 700 and
+ t2.a < 100
+ and t1.b=t2.b
+`;
+
+--source include/analyze-format.inc
+evalp select '$out' as X;
+
+set @out=(select json_extract(@js,'$**.block-nl-join.r_unpack_time_ms'));
+select cast(json_extract(@out,'$[0]') as DOUBLE) > 0;
+
+set join_cache_level=@tmp;
+drop table t1, t2;
+
+--echo #
+--echo # MDEV-30972: ANALYZE FORMAT=JSON: some time is unaccounted-for in BNL-H join
+--echo #
+
+create table t1 (
+ a int,
+ col1 varchar(100),
+ col2 varchar(100),
+ col3 varchar(100)
+);
+
+insert into t1 select
+ seq/100,
+ concat('col1-', seq),
+ concat('col1-', seq),
+ concat('col1-', seq)
+from seq_1_to_1000;
+
+create table t2 (
+ a int,
+ col1 varchar(100),
+ col2 varchar(100),
+ col3 varchar(100)
+);
+
+insert into t2 select
+ seq/100,
+ concat('col1-', seq),
+ concat('col1-', seq),
+ concat('col1-', seq)
+from seq_1_to_2000;
+
+set @tmp=@@join_cache_level, join_cache_level=6;
+
+let $out=`
+analyze format=json
+select * from t1, t2
+where
+ t1.a=t2.a
+ and concat(t1.col1, t1.col2, t1.col3)= concat(t2.col1, t2.col2, t2.col3)
+`;
+--source include/analyze-format.inc
+evalp select '$out' as X;
+
+set @out=(select json_extract(@js,'$**.block-nl-join.r_other_time_ms'));
+select cast(json_extract(@out,'$[0]') as DOUBLE) > 0;
+
+set join_cache_level=@tmp;
+drop table t1, t2;
+
diff --git a/mysql-test/main/analyze_stmt_orderby.result b/mysql-test/main/analyze_stmt_orderby.result
index c3a3f2c562e..7008ad8dea3 100644
--- a/mysql-test/main/analyze_stmt_orderby.result
+++ b/mysql-test/main/analyze_stmt_orderby.result
@@ -522,8 +522,11 @@ ANALYZE
"buffer_size": "65",
"join_type": "BNL",
"attached_condition": "t3.a = t0.a",
+ "r_loops": 10,
"r_filtered": 10,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 10
}
}
]
@@ -612,8 +615,11 @@ ANALYZE
"buffer_size": "119",
"join_type": "BNL",
"attached_condition": "t5.a = t6.a",
+ "r_loops": 4,
"r_filtered": 21.42857143,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 7
}
}
]
diff --git a/mysql-test/main/bootstrap.result b/mysql-test/main/bootstrap.result
index fd9b4726cb6..cfff13136d6 100644
--- a/mysql-test/main/bootstrap.result
+++ b/mysql-test/main/bootstrap.result
@@ -1,15 +1,28 @@
-drop table if exists t1;
+#
+# test mysqld in bootstrap mode
+#
+#
+# Check that --bootstrap reads from stdin
+#
# Kill the server
# restart
drop table t1;
+#
+# Check that --bootstrap of file with SQL error returns error
+#
# Kill the server
# restart
drop table t1;
ERROR 42S02: Unknown table 'test.t1'
+#
+# Bootstrap with a large thd->net.max_packet
+#
# Kill the server
# restart
drop table t1;
-End of 5.1 tests
+#
+# End of 5.1 tests
+#
#
# Bug #11766306: 59393: HAVE_INNODB=YES WHEN MYSQLD
# STARTED WITH --SKIP-INNODB
@@ -18,9 +31,23 @@ SELECT 'bug' as '' FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'
and SUPPORT='YES';
# Kill the server
+#
+# MDEV-13063 Server crashes in intern_plugin_lock or assertion `plugin_ptr->ref_count == 1' fails in plugin_init
+#
+#
+# MDEV-19349 mysql_install_db: segfault at tmp_file_prefix check
+#
# restart
-End of 5.5 tests
+#
+# End of 5.5 tests
+#
+#
+# Check that --bootstrap can install and uninstall plugins
+#
# Kill the server
+#
+# Check that installed plugins are *not* automatically loaded in --bootstrap
+#
# restart
flush tables;
show create table t1;
@@ -35,6 +62,18 @@ EXAMPLE ha_example.so
truncate table mysql.plugin;
# Kill the server
#
+# MDEV-9969 mysql_install_db error processing ignore_db_dirs.
+#
+#
+# MDEV-13397 MariaDB upgrade fail when using default_time_zone
+#
+#
+# MDEV-30818 invalid ssl prevents bootstrap
+#
+#
+# End of 10.3 tests
+#
+#
# MDEV-28782 mariadb-tzinfo-to-sql to work in bootstrap mode
#
#
diff --git a/mysql-test/main/bootstrap.test b/mysql-test/main/bootstrap.test
index f7bddf23408..d7cc8e36d56 100644
--- a/mysql-test/main/bootstrap.test
+++ b/mysql-test/main/bootstrap.test
@@ -1,17 +1,20 @@
+--echo #
+--echo # test mysqld in bootstrap mode
+--echo #
--source include/not_embedded.inc
-#
-# test mysqld in bootstrap mode
-#
---disable_warnings
-drop table if exists t1;
---enable_warnings
+--source include/have_example_plugin.inc
+
+--let test_bootstrap=$MYSQLTEST_VARDIR/tmp/test_bootstrap.sql
+--write_file $test_bootstrap
+use test;
+EOF
# Add the datadir to the bootstrap command
let $MYSQLD_DATADIR= `select @@datadir`;
let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR --tmpdir=$MYSQL_TMP_DIR --default-storage-engine=MyISAM --loose-skip-innodb --plugin-maturity=unknown;
-#
-# Check that --bootstrap reads from stdin
-#
+--echo #
+--echo # Check that --bootstrap reads from stdin
+--echo #
--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql
use test;
CREATE TABLE t1(a int);
@@ -21,9 +24,9 @@ EOF
--source include/start_mysqld.inc
drop table t1;
remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql;
-#
-# Check that --bootstrap of file with SQL error returns error
-#
+--echo #
+--echo # Check that --bootstrap of file with SQL error returns error
+--echo #
--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql
use test;
CREATE TABLE t1;
@@ -37,9 +40,9 @@ EOF
drop table t1;
remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql;
-#
-# Bootstrap with a large thd->net.max_packet
-#
+--echo #
+--echo # Bootstrap with a large thd->net.max_packet
+--echo #
--disable_query_log
create table t1 select 2 as a, concat(repeat('MySQL', @@max_allowed_packet/10), ';') as b;
eval select * into outfile '$MYSQLTEST_VARDIR/tmp/long_query.sql' from t1;
@@ -51,7 +54,9 @@ remove_file $MYSQLTEST_VARDIR/tmp/long_query.sql;
--source include/start_mysqld.inc
drop table t1;
---echo End of 5.1 tests
+--echo #
+--echo # End of 5.1 tests
+--echo #
--echo #
--echo # Bug #11766306: 59393: HAVE_INNODB=YES WHEN MYSQLD
@@ -63,29 +68,25 @@ SELECT 'bug' as '' FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'
and SUPPORT='YES';
--source include/kill_mysqld.inc
-#
-# MDEV-13063 Server crashes in intern_plugin_lock or assertion `plugin_ptr->ref_count == 1' fails in plugin_init
-#
+--echo #
+--echo # MDEV-13063 Server crashes in intern_plugin_lock or assertion `plugin_ptr->ref_count == 1' fails in plugin_init
+--echo #
--error 1
--exec $MYSQLD_BOOTSTRAP_CMD --myisam_recover_options=NONE
-#
-# MDEV-19349 mysql_install_db: segfault at tmp_file_prefix check
-#
---write_file $MYSQLTEST_VARDIR/tmp/1
-use test;
-EOF
---exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/1 >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
---remove_file $MYSQLTEST_VARDIR/tmp/1
+--echo #
+--echo # MDEV-19349 mysql_install_db: segfault at tmp_file_prefix check
+--echo #
+--exec $MYSQLD_BOOTSTRAP_CMD < $test_bootstrap >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
--source include/start_mysqld.inc
---echo End of 5.5 tests
+--echo #
+--echo # End of 5.5 tests
+--echo #
---source include/not_windows_embedded.inc
---source include/have_example_plugin.inc
-#
-# Check that --bootstrap can install and uninstall plugins
-#
+--echo #
+--echo # Check that --bootstrap can install and uninstall plugins
+--echo #
let $PLUGIN_DIR=`select @@plugin_dir`;
--source include/kill_mysqld.inc
--write_file $MYSQLTEST_VARDIR/tmp/install_plugin.sql
@@ -95,9 +96,9 @@ EOF
--exec $MYSQLD_BOOTSTRAP_CMD --plugin-dir=$PLUGIN_DIR < $MYSQLTEST_VARDIR/tmp/install_plugin.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
--remove_file $MYSQLTEST_VARDIR/tmp/install_plugin.sql
-#
-# Check that installed plugins are *not* automatically loaded in --bootstrap
-#
+--echo #
+--echo # Check that installed plugins are *not* automatically loaded in --bootstrap
+--echo #
--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_plugins.sql
SET SQL_MODE="";
use test;
@@ -113,25 +114,25 @@ drop table t1;
select * from mysql.plugin;
truncate table mysql.plugin;
-
-#
-# MDEV-9969 mysql_install_db error processing ignore_db_dirs.
-#
---write_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql
-use test;
-EOF
--source include/kill_mysqld.inc
---exec $MYSQLD_BOOTSTRAP_CMD --ignore-db-dirs='some_dir' --ignore-db-dirs='some_dir' < $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
---remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql
+--echo #
+--echo # MDEV-9969 mysql_install_db error processing ignore_db_dirs.
+--echo #
+--exec $MYSQLD_BOOTSTRAP_CMD --ignore-db-dirs='some_dir' --ignore-db-dirs='some_dir' < $test_bootstrap >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
-#
-# MDEV-13397 MariaDB upgrade fail when using default_time_zone
-#
---write_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql
-use test;
-EOF
---exec $MYSQLD_BOOTSTRAP_CMD --default-time-zone=Europe/Moscow < $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
---remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql
+--echo #
+--echo # MDEV-13397 MariaDB upgrade fail when using default_time_zone
+--echo #
+--exec $MYSQLD_BOOTSTRAP_CMD --default-time-zone=Europe/Moscow < $test_bootstrap >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
+
+--echo #
+--echo # MDEV-30818 invalid ssl prevents bootstrap
+--echo #
+--exec $MYSQLD_BOOTSTRAP_CMD --ssl-ca=/dev/nonexistent < $test_bootstrap >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
+
+--echo #
+--echo # End of 10.3 tests
+--echo #
--echo #
--echo # MDEV-28782 mariadb-tzinfo-to-sql to work in bootstrap mode
@@ -160,3 +161,4 @@ EOF
# restore
--source include/start_mysqld.inc
+--remove_file $test_bootstrap
diff --git a/mysql-test/main/cli_options_force_protocol_not_win.result b/mysql-test/main/cli_options_force_protocol_not_win.result
index 20b12eb2cc0..46ee29dc509 100644
--- a/mysql-test/main/cli_options_force_protocol_not_win.result
+++ b/mysql-test/main/cli_options_force_protocol_not_win.result
@@ -4,21 +4,19 @@
#
# The following group of tests should produce no warnings
#
-# exec MYSQL --host=localhost -e "status" 2>&1 | grep "Connection:\|WARNING:"
+# exec MYSQL --host=localhost -e "status" 2>&1 | grep "Connection:"
Connection: Localhost via UNIX socket
-# exec MYSQL --port=MASTER_MYPORT --protocol=tcp -e "status" 2>&1 | grep "Connection:\|WARNING:"
+# exec MYSQL --port=MASTER_MYPORT --protocol=tcp -e "status" 2>&1 | grep "Connection:"
Connection: localhost via TCP/IP
-# exec MYSQL --host=localhost --port=MASTER_MYPORT --protocol=socket -e "status" 2>&1 | grep "Connection:\|WARNING:"
+# exec MYSQL --host=localhost --port=MASTER_MYPORT --protocol=socket -e "status" 2>&1 | grep "Connection:"
Connection: Localhost via UNIX socket
-# exec MYSQL --host=127.0.0.1 --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:"
+# exec MYSQL --host=127.0.0.1 --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:"
Connection: 127.0.0.1 via TCP/IP
-# exec MYSQL --host=localhost --socket=MASTER_MYSOCK --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:"
+# exec MYSQL --host=localhost --socket=MASTER_MYSOCK --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:"
+Connection: localhost via TCP/IP
+# exec MYSQL --host=localhost --port=MASTER_MYPORT --socket=MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:"
Connection: Localhost via UNIX socket
-# exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:\|WARNING:"
+# exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:"
Connection: Localhost via UNIX socket
-#
-# The remaining tests should produce warnings
-#
-# exec MYSQL --host=localhost --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:"
-WARNING: Forcing protocol to TCP due to option specification. Please explicitly state intended protocol.
+# exec MYSQL --host=localhost --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:"
Connection: localhost via TCP/IP
diff --git a/mysql-test/main/cli_options_force_protocol_not_win.test b/mysql-test/main/cli_options_force_protocol_not_win.test
index a3c495f26ee..a92f6b93c4d 100644
--- a/mysql-test/main/cli_options_force_protocol_not_win.test
+++ b/mysql-test/main/cli_options_force_protocol_not_win.test
@@ -10,28 +10,26 @@
--echo # The following group of tests should produce no warnings
--echo #
---echo # exec MYSQL --host=localhost -e "status" 2>&1 | grep "Connection:\|WARNING:"
---exec $MYSQL --host=localhost -e "status" 2>&1 | grep "Connection:\|WARNING:"
+--echo # exec MYSQL --host=localhost -e "status" 2>&1 | grep "Connection:"
+--exec $MYSQL --host=localhost -e "status" 2>&1 | grep "Connection:"
---echo # exec MYSQL --port=MASTER_MYPORT --protocol=tcp -e "status" 2>&1 | grep "Connection:\|WARNING:"
---exec $MYSQL --port=$MASTER_MYPORT --protocol=tcp -e "status" 2>&1 | grep "Connection:\|WARNING:"
+--echo # exec MYSQL --port=MASTER_MYPORT --protocol=tcp -e "status" 2>&1 | grep "Connection:"
+--exec $MYSQL --port=$MASTER_MYPORT --protocol=tcp -e "status" 2>&1 | grep "Connection:"
---echo # exec MYSQL --host=localhost --port=MASTER_MYPORT --protocol=socket -e "status" 2>&1 | grep "Connection:\|WARNING:"
---exec $MYSQL --host=localhost --port=$MASTER_MYPORT --protocol=socket -e "status" 2>&1 | grep "Connection:\|WARNING:"
+--echo # exec MYSQL --host=localhost --port=MASTER_MYPORT --protocol=socket -e "status" 2>&1 | grep "Connection:"
+--exec $MYSQL --host=localhost --port=$MASTER_MYPORT --protocol=socket -e "status" 2>&1 | grep "Connection:"
---echo # exec MYSQL --host=127.0.0.1 --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:"
---exec $MYSQL --host=127.0.0.1 --port=$MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:"
+--echo # exec MYSQL --host=127.0.0.1 --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:"
+--exec $MYSQL --host=127.0.0.1 --port=$MASTER_MYPORT -e "status" 2>&1 | grep "Connection:"
---echo # exec MYSQL --host=localhost --socket=MASTER_MYSOCK --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:"
---exec $MYSQL --host=localhost --socket=$MASTER_MYSOCK --port=$MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:"
+--echo # exec MYSQL --host=localhost --socket=MASTER_MYSOCK --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:"
+--exec $MYSQL --host=localhost --socket=$MASTER_MYSOCK --port=$MASTER_MYPORT -e "status" 2>&1 | grep "Connection:"
---echo # exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:\|WARNING:"
---exec $MYSQL --host=localhost --socket=$MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:\|WARNING:"
+--echo # exec MYSQL --host=localhost --port=MASTER_MYPORT --socket=MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:"
+--exec $MYSQL --host=localhost --port=MASTER_MYPORT --socket=$MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:"
+--echo # exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:"
+--exec $MYSQL --host=localhost --socket=$MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:"
---echo #
---echo # The remaining tests should produce warnings
---echo #
-
---echo # exec MYSQL --host=localhost --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:"
---exec $MYSQL --host=localhost --port=$MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:"
+--echo # exec MYSQL --host=localhost --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:"
+--exec $MYSQL --host=localhost --port=$MASTER_MYPORT -e "status" 2>&1 | grep "Connection:"
diff --git a/mysql-test/main/cli_options_force_protocol_win.result b/mysql-test/main/cli_options_force_protocol_win.result
index 4fffc2a4837..eedfde4f1de 100644
--- a/mysql-test/main/cli_options_force_protocol_win.result
+++ b/mysql-test/main/cli_options_force_protocol_win.result
@@ -1,24 +1,17 @@
#
# MDEV-14974: --port ignored for --host=localhost
#
-#
-# The following group of tests should produce no warnings
-#
-# exec MYSQL --host=localhost -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
+# exec MYSQL --host=localhost -e "status" 2>&1 | findstr /c:"Connection:"
Connection: localhost via TCP/IP
-# exec MYSQL --host=localhost --port=MASTER_MYPORT -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
+# exec MYSQL --host=localhost --port=MASTER_MYPORT -e "status" 2>&1 | findstr /c:"Connection:"
Connection: localhost via TCP/IP
-# exec MYSQL --host=localhost --port=MASTER_MYPORT --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
+# exec MYSQL --host=localhost --port=MASTER_MYPORT --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:"
Connection: localhost via TCP/IP
-# exec MYSQL --host=localhost --protocol=pipe -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
-Connection: localhost via named pipe
-# exec MYSQL --host=localhost -W -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
-Connection: localhost via named pipe
-# exec MYSQL --host=localhost -W --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
+# exec MYSQL --host=localhost --protocol=pipe -e "status" 2>&1 | findstr /c:"Connection:"
Connection: localhost via named pipe
-#
-# The remaining tests should produce warnings
-#
-# exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
-WARNING: Forcing protocol to PIPE due to option specification. Please explicitly state intended protocol.
+# exec MYSQL --host=localhost -W -e "status" 2>&1 | findstr /c:"Connection:"
Connection: localhost via named pipe
+# exec MYSQL --host=localhost -W --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:"
+Connection: localhost via TCP/IP
+# exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:"
+Connection: localhost via TCP/IP
diff --git a/mysql-test/main/cli_options_force_protocol_win.test b/mysql-test/main/cli_options_force_protocol_win.test
index 54fbb78e5dc..63024f3b620 100644
--- a/mysql-test/main/cli_options_force_protocol_win.test
+++ b/mysql-test/main/cli_options_force_protocol_win.test
@@ -5,33 +5,23 @@
--source include/not_embedded.inc
--source include/windows.inc
+--echo # exec MYSQL --host=localhost -e "status" 2>&1 | findstr /c:"Connection:"
+--exec $MYSQL --host=localhost -e "status" 2>&1 | findstr /c:"Connection:"
---echo #
---echo # The following group of tests should produce no warnings
---echo #
-
---echo # exec MYSQL --host=localhost -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
---exec $MYSQL --host=localhost -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
-
---echo # exec MYSQL --host=localhost --port=MASTER_MYPORT -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
---exec $MYSQL --host=localhost --port=$MASTER_MYPORT -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
+--echo # exec MYSQL --host=localhost --port=MASTER_MYPORT -e "status" 2>&1 | findstr /c:"Connection:"
+--exec $MYSQL --host=localhost --port=$MASTER_MYPORT -e "status" 2>&1 | findstr /c:"Connection:"
---echo # exec MYSQL --host=localhost --port=MASTER_MYPORT --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
---exec $MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
+--echo # exec MYSQL --host=localhost --port=MASTER_MYPORT --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:"
+--exec $MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:"
---echo # exec MYSQL --host=localhost --protocol=pipe -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
---exec $MYSQL --host=localhost --protocol=pipe -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
+--echo # exec MYSQL --host=localhost --protocol=pipe -e "status" 2>&1 | findstr /c:"Connection:"
+--exec $MYSQL --host=localhost --protocol=pipe -e "status" 2>&1 | findstr /c:"Connection:"
---echo # exec MYSQL --host=localhost -W -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
---exec $MYSQL --host=localhost -W -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
+--echo # exec MYSQL --host=localhost -W -e "status" 2>&1 | findstr /c:"Connection:"
+--exec $MYSQL --host=localhost -W -e "status" 2>&1 | findstr /c:"Connection:"
---echo # exec MYSQL --host=localhost -W --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
---exec $MYSQL --host=localhost -W --socket=$MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
-
-
---echo #
---echo # The remaining tests should produce warnings
---echo #
+--echo # exec MYSQL --host=localhost -W --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:"
+--exec $MYSQL --host=localhost -W --socket=$MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:"
---echo # exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
---exec $MYSQL --host=localhost --socket=$MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:"
+--echo # exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:"
+--exec $MYSQL --host=localhost --socket=$MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:"
diff --git a/mysql-test/main/ctype_ldml.result b/mysql-test/main/ctype_ldml.result
index a23e835d1fa..31508fcd1b1 100644
--- a/mysql-test/main/ctype_ldml.result
+++ b/mysql-test/main/ctype_ldml.result
@@ -3074,6 +3074,11 @@ INSERT INTO case_folding (code) VALUES
(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
@@ -3091,6 +3096,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
69 69 49 i
130 69 C4B0 İ
131 C4B1 49 ı
+2C2F E2B0AF E2B0AF Ⱟ
+2C5F E2B19F E2B19F ⱟ
+A7C0 EA9F80 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F81 ꟁ
DROP TABLE case_folding;
#
# End of 10.3 tests
@@ -3267,6 +3276,11 @@ INSERT INTO case_folding (code) VALUES
(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
@@ -3284,6 +3298,39 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
69 69 49 i
130 69 C4B0 İ
131 C4B1 49 ı
+2C2F E2B19F E2B0AF Ⱟ
+2C5F E2B19F E2B0AF ⱟ
+A7C0 EA9F81 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F80 ꟁ
+DROP TABLE case_folding;
+#
+# MDEV-30577 Case folding for uca1400 collations is not up to date
+#
+SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_test01_as_ci;
+CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c, SPACE(64) AS comment LIMIT 0;
+SHOW CREATE TABLE case_folding;
+Table Create Table
+case_folding CREATE TABLE `case_folding` (
+ `code` int(1) NOT NULL,
+ `c` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_test01_as_ci DEFAULT NULL,
+ `comment` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_test01_as_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO case_folding (code, comment) VALUES (0x10595, 'VITHKUQI CAPITAL LETTER ZE (Unicode-14.0)');
+INSERT INTO case_folding (code, comment) VALUES (0x105BC, 'VITHKUQI SMALL LETTER ZE (Unicode-14.0)');
+INSERT INTO case_folding (code, comment) VALUES (0x1E921, 'ADLAM CAPITAL LETTER SHA (Unicode-9.0)');
+INSERT INTO case_folding (code, comment) VALUES (0x1E943, 'ADLAM SMALL LETTER SHA (Unicode-9.0)');
+UPDATE case_folding SET c=CHAR(code USING utf32);
+SELECT
+HEX(CONVERT(c USING utf32)) AS ch,
+HEX(CONVERT(LOWER(c) USING utf32)) AS cl,
+HEX(CONVERT(UPPER(c) USING utf32)) AS cu,
+comment
+FROM case_folding ORDER BY BINARY(c);
+ch cl cu comment
+00010595 000105BC 00010595 VITHKUQI CAPITAL LETTER ZE (Unicode-14.0)
+000105BC 000105BC 00010595 VITHKUQI SMALL LETTER ZE (Unicode-14.0)
+0001E921 0001E943 0001E921 ADLAM CAPITAL LETTER SHA (Unicode-9.0)
+0001E943 0001E943 0001E921 ADLAM SMALL LETTER SHA (Unicode-9.0)
DROP TABLE case_folding;
#
# End of 10.10 tests
diff --git a/mysql-test/main/ctype_ldml.test b/mysql-test/main/ctype_ldml.test
index 6336a1d0f5f..9189630e5a3 100644
--- a/mysql-test/main/ctype_ldml.test
+++ b/mysql-test/main/ctype_ldml.test
@@ -705,5 +705,12 @@ SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_test01_as_ci;
--source include/ctype_casefolding.inc
--echo #
+--echo # MDEV-30577 Case folding for uca1400 collations is not up to date
+--echo #
+
+SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_test01_as_ci;
+--source include/ctype_casefolding_supplementary.inc
+
+--echo #
--echo # End of 10.10 tests
--echo #
diff --git a/mysql-test/main/ctype_uca_partitions.result b/mysql-test/main/ctype_uca_partitions.result
index 677b68e2387..486e848e191 100644
--- a/mysql-test/main/ctype_uca_partitions.result
+++ b/mysql-test/main/ctype_uca_partitions.result
@@ -84,3 +84,43 @@ O
P
Y
DROP TABLE t1;
+#
+# Start of 10.4 tests
+#
+#
+# MDEV-30072 Wrong ORDER BY for a partitioned prefix key + NOPAD
+#
+SET NAMES utf8mb4;
+CREATE TABLE t1
+(
+id INT,
+data VARCHAR(20),
+KEY data_id (data,id)
+) COLLATE utf8mb3_unicode_nopad_ci ENGINE=MyISAM
+PARTITION BY RANGE COLUMNS (id)
+(
+PARTITION p10 VALUES LESS THAN (20),
+PARTITION p20 VALUES LESS THAN MAXVALUE
+);
+INSERT INTO t1 VALUES (30, 'ss '), (10, 'ß ');
+SELECT id FROM t1 WHERE data='ss ' ORDER BY id;
+id
+10
+30
+SELECT id FROM t1 WHERE data='ss ' ORDER BY id DESC;
+id
+30
+10
+ALTER TABLE t1 DROP KEY data_id, ADD KEY data_id2(data(10),id);
+SELECT id FROM t1 WHERE data='ss ' ORDER BY id;
+id
+10
+30
+SELECT id FROM t1 WHERE data='ss ' ORDER BY id DESC;
+id
+30
+10
+DROP TABLE t1;
+#
+# End of 10.4 tests
+#
diff --git a/mysql-test/main/ctype_uca_partitions.test b/mysql-test/main/ctype_uca_partitions.test
index 5734bb52008..81f1a091574 100644
--- a/mysql-test/main/ctype_uca_partitions.test
+++ b/mysql-test/main/ctype_uca_partitions.test
@@ -36,3 +36,35 @@ SELECT * FROM t1 PARTITION (p0) ORDER BY c1;
SELECT * FROM t1 PARTITION (p1) ORDER BY c1;
SELECT * FROM t1 PARTITION (p2) ORDER BY c1;
DROP TABLE t1;
+
+--echo #
+--echo # Start of 10.4 tests
+--echo #
+
+--echo #
+--echo # MDEV-30072 Wrong ORDER BY for a partitioned prefix key + NOPAD
+--echo #
+
+SET NAMES utf8mb4;
+CREATE TABLE t1
+(
+ id INT,
+ data VARCHAR(20),
+ KEY data_id (data,id)
+) COLLATE utf8mb3_unicode_nopad_ci ENGINE=MyISAM
+PARTITION BY RANGE COLUMNS (id)
+(
+ PARTITION p10 VALUES LESS THAN (20),
+ PARTITION p20 VALUES LESS THAN MAXVALUE
+);
+INSERT INTO t1 VALUES (30, 'ss '), (10, 'ß ');
+SELECT id FROM t1 WHERE data='ss ' ORDER BY id;
+SELECT id FROM t1 WHERE data='ss ' ORDER BY id DESC;
+ALTER TABLE t1 DROP KEY data_id, ADD KEY data_id2(data(10),id);
+SELECT id FROM t1 WHERE data='ss ' ORDER BY id;
+SELECT id FROM t1 WHERE data='ss ' ORDER BY id DESC;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.4 tests
+--echo #
diff --git a/mysql-test/main/ctype_ucs.result b/mysql-test/main/ctype_ucs.result
index 987f1b704fd..f4ca4089e55 100644
--- a/mysql-test/main/ctype_ucs.result
+++ b/mysql-test/main/ctype_ucs.result
@@ -6439,6 +6439,23 @@ IS_IPV4('10.0.0.1')
1
SET NAMES utf8;
#
+# MDEV-30746 Regression in ucs2_general_mysql500_ci
+#
+SET NAMES utf8mb3;
+CREATE TABLE t1 (a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_general_mysql500_ci);
+INSERT INTO t1 VALUES ('s'),('z'),(_latin1 0xDF);
+SELECT GROUP_CONCAT(a) FROM t1 GROUP BY a ORDER BY a;
+GROUP_CONCAT(a)
+s
+z
+SELECT a, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a;
+a HEX(a) HEX(WEIGHT_STRING(a))
+s 0073 0053
+z 007A 005A
+ß 00DF 00DF
+DROP TABLE t1;
+#
# End of 10.4 tests
#
#
diff --git a/mysql-test/main/ctype_ucs.test b/mysql-test/main/ctype_ucs.test
index 20e2ea3908d..b77636507dd 100644
--- a/mysql-test/main/ctype_ucs.test
+++ b/mysql-test/main/ctype_ucs.test
@@ -1141,6 +1141,18 @@ SELECT IS_IPV4('10.0.0.1');
SET NAMES utf8;
--echo #
+--echo # MDEV-30746 Regression in ucs2_general_mysql500_ci
+--echo #
+
+SET NAMES utf8mb3;
+CREATE TABLE t1 (a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_general_mysql500_ci);
+INSERT INTO t1 VALUES ('s'),('z'),(_latin1 0xDF);
+SELECT GROUP_CONCAT(a) FROM t1 GROUP BY a ORDER BY a;
+SELECT a, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+
+--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/ctype_ucs2_general_mysql500_ci_ws.result b/mysql-test/main/ctype_ucs2_general_mysql500_ci_ws.result
index 3679169122e..40ba714560f 100644
--- a/mysql-test/main/ctype_ucs2_general_mysql500_ci_ws.result
+++ b/mysql-test/main/ctype_ucs2_general_mysql500_ci_ws.result
@@ -24,7 +24,7 @@ SUM(codepoint_hex4=HEX(WEIGHT_STRING(c))) AS count_bmp_weight_is_codepoint,
SUM(codepoint_hex4<>HEX(WEIGHT_STRING(c))) AS count_bmp_weight_is_not_codepoint
FROM v_bmp;
count_bmp_weight_is_codepoint count_bmp_weight_is_not_codepoint
-64428 1108
+64429 1107
SELECT codepoint_hex4,HEX(WEIGHT_STRING(c))
FROM v_bmp
WHERE codepoint_hex4<>HEX(WEIGHT_STRING(c));
@@ -82,7 +82,6 @@ codepoint_hex4 HEX(WEIGHT_STRING(c))
00DB 0055
00DC 0055
00DD 0059
-00DF 0053
00E0 0041
00E1 0041
00E2 0041
diff --git a/mysql-test/main/ctype_upgrade.result b/mysql-test/main/ctype_upgrade.result
index 30684df4023..500b013a5a1 100644
--- a/mysql-test/main/ctype_upgrade.result
+++ b/mysql-test/main/ctype_upgrade.result
@@ -603,3 +603,56 @@ DROP TABLE maria050313_utf8_croatian_ci;
DROP TABLE maria050533_xxx_croatian_ci;
DROP TABLE maria100004_xxx_croatian_ci;
DROP TABLE mysql050614_xxx_croatian_ci;
+#
+# Start of 10.4 tests
+#
+#
+# MDEV-30746 Regression in ucs2_general_mysql500_ci
+#
+SET NAMES utf8mb3;
+SHOW CREATE TABLE t1;
+ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.t1` FORCE" or dump/reload to fix it!
+SELECT * FROM t1;
+ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.t1` FORCE" or dump/reload to fix it!
+SELECT * FROM t1 IGNORE KEY(a);
+ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.t1` FORCE" or dump/reload to fix it!
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check error Upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
+REPAIR TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+SELECT a, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a;
+a HEX(a) HEX(WEIGHT_STRING(a))
+s 0073 0053
+z 007A 005A
+ß 00DF 00DF
+SELECT a, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 FORCE KEY(a) ORDER BY a;
+a HEX(a) HEX(WEIGHT_STRING(a))
+s 0073 0053
+z 007A 005A
+ß 00DF 00DF
+SELECT a, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 IGNORE KEY(a) ORDER BY a;
+a HEX(a) HEX(WEIGHT_STRING(a))
+s 0073 0053
+z 007A 005A
+ß 00DF 00DF
+SELECT GROUP_CONCAT(a) FROM t1 GROUP BY a ORDER BY a;
+GROUP_CONCAT(a)
+s
+z
+SELECT GROUP_CONCAT(a) FROM t1 IGNORE KEY(a) GROUP BY a ORDER BY a;
+GROUP_CONCAT(a)
+s
+z
+SELECT GROUP_CONCAT(a) FROM t1 FORCE KEY(a) GROUP BY a ORDER BY a;
+GROUP_CONCAT(a)
+s
+z
+DROP TABLE t1;
+#
+# End of 10.4 tests
+#
diff --git a/mysql-test/main/ctype_upgrade.test b/mysql-test/main/ctype_upgrade.test
index f2fdc36554e..f28d23eeae9 100644
--- a/mysql-test/main/ctype_upgrade.test
+++ b/mysql-test/main/ctype_upgrade.test
@@ -203,3 +203,38 @@ DROP TABLE maria050313_utf8_croatian_ci;
DROP TABLE maria050533_xxx_croatian_ci;
DROP TABLE maria100004_xxx_croatian_ci;
DROP TABLE mysql050614_xxx_croatian_ci;
+
+
+--echo #
+--echo # Start of 10.4 tests
+--echo #
+
+--echo #
+--echo # MDEV-30746 Regression in ucs2_general_mysql500_ci
+--echo #
+
+SET NAMES utf8mb3;
+
+copy_file std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.frm $MYSQLD_DATADIR/test/t1.frm;
+copy_file std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYD $MYSQLD_DATADIR/test/t1.MYD;
+copy_file std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYI $MYSQLD_DATADIR/test/t1.MYI;
+
+--error ER_TABLE_NEEDS_REBUILD
+SHOW CREATE TABLE t1;
+--error ER_TABLE_NEEDS_REBUILD
+SELECT * FROM t1;
+--error ER_TABLE_NEEDS_REBUILD
+SELECT * FROM t1 IGNORE KEY(a);
+CHECK TABLE t1;
+REPAIR TABLE t1;
+SELECT a, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a;
+SELECT a, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 FORCE KEY(a) ORDER BY a;
+SELECT a, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 IGNORE KEY(a) ORDER BY a;
+SELECT GROUP_CONCAT(a) FROM t1 GROUP BY a ORDER BY a;
+SELECT GROUP_CONCAT(a) FROM t1 IGNORE KEY(a) GROUP BY a ORDER BY a;
+SELECT GROUP_CONCAT(a) FROM t1 FORCE KEY(a) GROUP BY a ORDER BY a;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.4 tests
+--echo #
diff --git a/mysql-test/main/ctype_utf8_uca.result b/mysql-test/main/ctype_utf8_uca.result
index ecd2daa5272..97bdadbb97b 100644
--- a/mysql-test/main/ctype_utf8_uca.result
+++ b/mysql-test/main/ctype_utf8_uca.result
@@ -618,6 +618,11 @@ INSERT INTO case_folding (code) VALUES
(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
@@ -635,6 +640,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
69 69 49 i
130 69 C4B0 İ
131 C4B1 49 ı
+2C2F E2B0AF E2B0AF Ⱟ
+2C5F E2B19F E2B19F ⱟ
+A7C0 EA9F80 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F81 ꟁ
DROP TABLE case_folding;
SET NAMES utf8mb3 COLLATE utf8mb3_turkish_ci /*Unicode-4.0 folding, with Turkish mapping for I */;
CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0;
@@ -661,6 +670,11 @@ INSERT INTO case_folding (code) VALUES
(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
@@ -678,6 +692,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
69 69 C4B0 i
130 69 C4B0 İ
131 C4B1 49 ı
+2C2F E2B0AF E2B0AF Ⱟ
+2C5F E2B19F E2B19F ⱟ
+A7C0 EA9F80 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F81 ꟁ
DROP TABLE case_folding;
SET NAMES utf8mb3 COLLATE utf8mb3_unicode_520_ci;
CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0;
@@ -704,6 +722,11 @@ INSERT INTO case_folding (code) VALUES
(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
@@ -721,6 +744,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
69 69 49 i
130 69 C4B0 İ
131 C4B1 49 ı
+2C2F E2B0AF E2B0AF Ⱟ
+2C5F E2B19F E2B19F ⱟ
+A7C0 EA9F80 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F81 ꟁ
DROP TABLE case_folding;
SET NAMES utf8mb3 COLLATE utf8mb3_unicode_520_nopad_ci;
CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0;
@@ -747,6 +774,11 @@ INSERT INTO case_folding (code) VALUES
(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
@@ -764,6 +796,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
69 69 49 i
130 69 C4B0 İ
131 C4B1 49 ı
+2C2F E2B0AF E2B0AF Ⱟ
+2C5F E2B19F E2B19F ⱟ
+A7C0 EA9F80 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F81 ꟁ
DROP TABLE case_folding;
SET NAMES utf8mb3 COLLATE utf8mb3_myanmar_ci;
CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0;
@@ -790,6 +826,11 @@ INSERT INTO case_folding (code) VALUES
(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
@@ -807,6 +848,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
69 69 49 i
130 69 C4B0 İ
131 C4B1 49 ı
+2C2F E2B0AF E2B0AF Ⱟ
+2C5F E2B19F E2B19F ⱟ
+A7C0 EA9F80 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F81 ꟁ
DROP TABLE case_folding;
SET NAMES utf8mb3 COLLATE utf8mb3_thai_520_w2;
CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0;
@@ -833,6 +878,11 @@ INSERT INTO case_folding (code) VALUES
(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
@@ -850,11 +900,163 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
69 69 49 i
130 69 C4B0 İ
131 C4B1 49 ı
+2C2F E2B0AF E2B0AF Ⱟ
+2C5F E2B19F E2B19F ⱟ
+A7C0 EA9F80 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F81 ꟁ
DROP TABLE case_folding;
#
# End of 10.3 tests
#
#
+# Start of 10.4 tests
+#
+SET DEFAULT_STORAGE_ENGINE=MyISAM;
+SET NAMES utf8mb3 COLLATE utf8mb3_unicode_nopad_ci;
+#
+# MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations
+#
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a TEXT COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a TEXT COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3)) USING HASH
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a VARCHAR(2000) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a VARCHAR(2000) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3)) USING HASH
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a CHAR(20) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3)) USING HASH
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+SET DEFAULT_STORAGE_ENGINE=HEAP;
+#
+# MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations
+#
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a VARCHAR(2000) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3))
+) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a VARCHAR(2000) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3)) USING HASH
+) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a CHAR(20) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3))
+) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a CHAR(20) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3)) USING HASH
+) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+SET DEFAULT_STORAGE_ENGINE=DEFAULT;
+#
+# End of 10.4 tests
+#
+#
# Start of 10.10 tests
#
#
@@ -1657,6 +1859,11 @@ INSERT INTO case_folding (code) VALUES
(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
@@ -1674,6 +1881,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
69 69 49 i
130 69 C4B0 İ
131 C4B1 49 ı
+2C2F E2B19F E2B0AF Ⱟ
+2C5F E2B19F E2B0AF ⱟ
+A7C0 EA9F81 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F80 ꟁ
DROP TABLE case_folding;
#
# End of 10.10 tests
diff --git a/mysql-test/main/ctype_utf8_uca.test b/mysql-test/main/ctype_utf8_uca.test
index 5abf9192511..6f89d646260 100644
--- a/mysql-test/main/ctype_utf8_uca.test
+++ b/mysql-test/main/ctype_utf8_uca.test
@@ -54,6 +54,24 @@ SET NAMES utf8mb3 COLLATE utf8mb3_thai_520_w2;
--echo # End of 10.3 tests
--echo #
+
+--echo #
+--echo # Start of 10.4 tests
+--echo #
+
+SET DEFAULT_STORAGE_ENGINE=MyISAM;
+SET NAMES utf8mb3 COLLATE utf8mb3_unicode_nopad_ci;
+--source include/ctype_nopad_prefix_unique.inc
+
+SET DEFAULT_STORAGE_ENGINE=HEAP;
+--source include/ctype_nopad_prefix_unique.inc
+
+SET DEFAULT_STORAGE_ENGINE=DEFAULT;
+
+--echo #
+--echo # End of 10.4 tests
+--echo #
+
--echo #
--echo # Start of 10.10 tests
--echo #
diff --git a/mysql-test/main/ctype_utf8mb4_uca.result b/mysql-test/main/ctype_utf8mb4_uca.result
index 42de45c98a3..3cd25891119 100644
--- a/mysql-test/main/ctype_utf8mb4_uca.result
+++ b/mysql-test/main/ctype_utf8mb4_uca.result
@@ -6636,6 +6636,11 @@ INSERT INTO case_folding (code) VALUES
(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
@@ -6653,6 +6658,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
69 69 49 i
130 69 C4B0 İ
131 C4B1 49 ı
+2C2F E2B0AF E2B0AF Ⱟ
+2C5F E2B19F E2B19F ⱟ
+A7C0 EA9F80 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F81 ꟁ
DROP TABLE case_folding;
SET NAMES utf8mb4 COLLATE utf8mb4_turkish_ci /*Unicode-4.0 folding with Turkish mapping for I */;
CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0;
@@ -6679,6 +6688,11 @@ INSERT INTO case_folding (code) VALUES
(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
@@ -6696,6 +6710,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
69 69 C4B0 i
130 69 C4B0 İ
131 C4B1 49 ı
+2C2F E2B0AF E2B0AF Ⱟ
+2C5F E2B19F E2B19F ⱟ
+A7C0 EA9F80 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F81 ꟁ
DROP TABLE case_folding;
SET NAMES utf8mb4 COLLATE utf8mb4_unicode_520_ci;
CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0;
@@ -6722,6 +6740,11 @@ INSERT INTO case_folding (code) VALUES
(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
@@ -6739,6 +6762,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
69 69 49 i
130 69 C4B0 İ
131 C4B1 49 ı
+2C2F E2B0AF E2B0AF Ⱟ
+2C5F E2B19F E2B19F ⱟ
+A7C0 EA9F80 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F81 ꟁ
DROP TABLE case_folding;
SET NAMES utf8mb4 COLLATE utf8mb4_unicode_520_nopad_ci;
CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0;
@@ -6765,6 +6792,11 @@ INSERT INTO case_folding (code) VALUES
(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
@@ -6782,6 +6814,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
69 69 49 i
130 69 C4B0 İ
131 C4B1 49 ı
+2C2F E2B0AF E2B0AF Ⱟ
+2C5F E2B19F E2B19F ⱟ
+A7C0 EA9F80 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F81 ꟁ
DROP TABLE case_folding;
SET NAMES utf8mb4 COLLATE utf8mb4_myanmar_ci;
CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0;
@@ -6808,6 +6844,11 @@ INSERT INTO case_folding (code) VALUES
(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
@@ -6825,6 +6866,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
69 69 49 i
130 69 C4B0 İ
131 C4B1 49 ı
+2C2F E2B0AF E2B0AF Ⱟ
+2C5F E2B19F E2B19F ⱟ
+A7C0 EA9F80 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F81 ꟁ
DROP TABLE case_folding;
SET NAMES utf8mb4 COLLATE utf8mb4_thai_520_w2;
CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0;
@@ -6851,6 +6896,11 @@ INSERT INTO case_folding (code) VALUES
(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
@@ -6868,6 +6918,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
69 69 49 i
130 69 C4B0 İ
131 C4B1 49 ı
+2C2F E2B0AF E2B0AF Ⱟ
+2C5F E2B19F E2B19F ⱟ
+A7C0 EA9F80 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F81 ꟁ
DROP TABLE case_folding;
#
# End of 10.3 tests
@@ -11499,6 +11553,11 @@ INSERT INTO case_folding (code) VALUES
(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
(0x0131) /* LATIN SMALL LETTER DOTLESS I */
;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
UPDATE case_folding SET c=CHAR(code USING ucs2);
SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
@@ -11516,6 +11575,112 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
69 69 49 i
130 69 C4B0 İ
131 C4B1 49 ı
+2C2F E2B19F E2B0AF Ⱟ
+2C5F E2B19F E2B0AF ⱟ
+A7C0 EA9F81 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F80 ꟁ
+DROP TABLE case_folding;
+CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c, SPACE(64) AS comment LIMIT 0;
+SHOW CREATE TABLE case_folding;
+Table Create Table
+case_folding CREATE TABLE `case_folding` (
+ `code` int(1) NOT NULL,
+ `c` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
+ `comment` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO case_folding (code, comment) VALUES (0x10595, 'VITHKUQI CAPITAL LETTER ZE (Unicode-14.0)');
+INSERT INTO case_folding (code, comment) VALUES (0x105BC, 'VITHKUQI SMALL LETTER ZE (Unicode-14.0)');
+INSERT INTO case_folding (code, comment) VALUES (0x1E921, 'ADLAM CAPITAL LETTER SHA (Unicode-9.0)');
+INSERT INTO case_folding (code, comment) VALUES (0x1E943, 'ADLAM SMALL LETTER SHA (Unicode-9.0)');
+UPDATE case_folding SET c=CHAR(code USING utf32);
+SELECT
+HEX(CONVERT(c USING utf32)) AS ch,
+HEX(CONVERT(LOWER(c) USING utf32)) AS cl,
+HEX(CONVERT(UPPER(c) USING utf32)) AS cu,
+comment
+FROM case_folding ORDER BY BINARY(c);
+ch cl cu comment
+00010595 000105BC 00010595 VITHKUQI CAPITAL LETTER ZE (Unicode-14.0)
+000105BC 000105BC 00010595 VITHKUQI SMALL LETTER ZE (Unicode-14.0)
+0001E921 0001E943 0001E921 ADLAM CAPITAL LETTER SHA (Unicode-9.0)
+0001E943 0001E943 0001E921 ADLAM SMALL LETTER SHA (Unicode-9.0)
+DROP TABLE case_folding;
+SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_turkish_ai_ci;
+CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0;
+SHOW CREATE TABLE case_folding;
+Table Create Table
+case_folding CREATE TABLE `case_folding` (
+ `code` int(1) NOT NULL,
+ `c` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_turkish_ai_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO case_folding (code) VALUES
+(0x23A),
+(0x23E),
+(0x23F),
+(0x240),
+(0x250),
+(0x251),
+(0x252),
+(0x26B),
+(0x271),
+(0x27D);
+INSERT INTO case_folding (code) VALUES
+(0x0049) /* LATIN CAPITAL LETTER I */,
+(0x0069) /* LATIN SMALL LETTER I */,
+(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */,
+(0x0131) /* LATIN SMALL LETTER DOTLESS I */
+;
+INSERT INTO case_folding (code) VALUES
+(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */,
+(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */,
+(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */;
+UPDATE case_folding SET c=CHAR(code USING ucs2);
+SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding;
+HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c
+23A E2B1A5 C8BA Ⱥ
+23E E2B1A6 C8BE Ⱦ
+23F C8BF E2B1BE ȿ
+240 C980 E2B1BF ɀ
+250 C990 E2B1AF ɐ
+251 C991 E2B1AD ɑ
+252 C992 E2B1B0 ɒ
+26B C9AB E2B1A2 ɫ
+271 C9B1 E2B1AE ɱ
+27D C9BD E2B1A4 ɽ
+49 C4B1 49 I
+69 69 C4B0 i
+130 69 C4B0 İ
+131 C4B1 49 ı
+2C2F E2B19F E2B0AF Ⱟ
+2C5F E2B19F E2B0AF ⱟ
+A7C0 EA9F81 EA9F80 Ꟁ
+A7C1 EA9F81 EA9F80 ꟁ
+DROP TABLE case_folding;
+CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c, SPACE(64) AS comment LIMIT 0;
+SHOW CREATE TABLE case_folding;
+Table Create Table
+case_folding CREATE TABLE `case_folding` (
+ `code` int(1) NOT NULL,
+ `c` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_turkish_ai_ci DEFAULT NULL,
+ `comment` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_turkish_ai_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO case_folding (code, comment) VALUES (0x10595, 'VITHKUQI CAPITAL LETTER ZE (Unicode-14.0)');
+INSERT INTO case_folding (code, comment) VALUES (0x105BC, 'VITHKUQI SMALL LETTER ZE (Unicode-14.0)');
+INSERT INTO case_folding (code, comment) VALUES (0x1E921, 'ADLAM CAPITAL LETTER SHA (Unicode-9.0)');
+INSERT INTO case_folding (code, comment) VALUES (0x1E943, 'ADLAM SMALL LETTER SHA (Unicode-9.0)');
+UPDATE case_folding SET c=CHAR(code USING utf32);
+SELECT
+HEX(CONVERT(c USING utf32)) AS ch,
+HEX(CONVERT(LOWER(c) USING utf32)) AS cl,
+HEX(CONVERT(UPPER(c) USING utf32)) AS cu,
+comment
+FROM case_folding ORDER BY BINARY(c);
+ch cl cu comment
+00010595 000105BC 00010595 VITHKUQI CAPITAL LETTER ZE (Unicode-14.0)
+000105BC 000105BC 00010595 VITHKUQI SMALL LETTER ZE (Unicode-14.0)
+0001E921 0001E943 0001E921 ADLAM CAPITAL LETTER SHA (Unicode-9.0)
+0001E943 0001E943 0001E921 ADLAM SMALL LETTER SHA (Unicode-9.0)
DROP TABLE case_folding;
#
# End of 10.10 tests
diff --git a/mysql-test/main/ctype_utf8mb4_uca.test b/mysql-test/main/ctype_utf8mb4_uca.test
index 3f428447cc9..1b709ebba69 100644
--- a/mysql-test/main/ctype_utf8mb4_uca.test
+++ b/mysql-test/main/ctype_utf8mb4_uca.test
@@ -435,6 +435,11 @@ DROP PROCEDURE test_styles;
SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_ai_ci;
--source include/ctype_casefolding.inc
+--source include/ctype_casefolding_supplementary.inc
+
+SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_turkish_ai_ci;
+--source include/ctype_casefolding.inc
+--source include/ctype_casefolding_supplementary.inc
--echo #
--echo # End of 10.10 tests
diff --git a/mysql-test/main/ctype_utf8mb4_uca1400_ai_ci_casefold.result b/mysql-test/main/ctype_utf8mb4_uca1400_ai_ci_casefold.result
new file mode 100644
index 00000000000..85e87f217cc
--- /dev/null
+++ b/mysql-test/main/ctype_utf8mb4_uca1400_ai_ci_casefold.result
@@ -0,0 +1,2927 @@
+#
+# Start of 10.10 tests
+#
+#
+# MDEV-30577 Case folding for uca1400 collations is not up to date
+#
+SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_ai_ci;
+EXECUTE IMMEDIATE SFORMAT('
+CREATE VIEW v_bmp AS
+SELECT
+ seq AS codepoint,
+ LPAD(HEX(seq),4,''0'') AS codepoint_hex4,
+ CONVERT(CHAR(seq USING utf32) USING {}) COLLATE {} AS c
+FROM
+ seq_0_to_65535', @@character_set_connection, @@collation_connection);
+SELECT COLLATION(c) FROM v_bmp LIMIT 1;
+COLLATION(c)
+utf8mb4_uca1400_ai_ci
+SELECT
+codepoint_hex4,
+HEX(CAST(LOWER(c) AS CHAR CHARACTER SET ucs2)),
+HEX(CAST(UPPER(c) AS CHAR CHARACTER SET ucs2))
+FROM v_bmp
+WHERE BINARY(c)<>BINARY(LOWER(c)) OR BINARY(c)<>BINARY(UPPER(c));
+codepoint_hex4 HEX(CAST(LOWER(c) AS CHAR CHARACTER SET ucs2)) HEX(CAST(UPPER(c) AS CHAR CHARACTER SET ucs2))
+0041 0061 0041
+0042 0062 0042
+0043 0063 0043
+0044 0064 0044
+0045 0065 0045
+0046 0066 0046
+0047 0067 0047
+0048 0068 0048
+0049 0069 0049
+004A 006A 004A
+004B 006B 004B
+004C 006C 004C
+004D 006D 004D
+004E 006E 004E
+004F 006F 004F
+0050 0070 0050
+0051 0071 0051
+0052 0072 0052
+0053 0073 0053
+0054 0074 0054
+0055 0075 0055
+0056 0076 0056
+0057 0077 0057
+0058 0078 0058
+0059 0079 0059
+005A 007A 005A
+0061 0061 0041
+0062 0062 0042
+0063 0063 0043
+0064 0064 0044
+0065 0065 0045
+0066 0066 0046
+0067 0067 0047
+0068 0068 0048
+0069 0069 0049
+006A 006A 004A
+006B 006B 004B
+006C 006C 004C
+006D 006D 004D
+006E 006E 004E
+006F 006F 004F
+0070 0070 0050
+0071 0071 0051
+0072 0072 0052
+0073 0073 0053
+0074 0074 0054
+0075 0075 0055
+0076 0076 0056
+0077 0077 0057
+0078 0078 0058
+0079 0079 0059
+007A 007A 005A
+00B5 00B5 039C
+00C0 00E0 00C0
+00C1 00E1 00C1
+00C2 00E2 00C2
+00C3 00E3 00C3
+00C4 00E4 00C4
+00C5 00E5 00C5
+00C6 00E6 00C6
+00C7 00E7 00C7
+00C8 00E8 00C8
+00C9 00E9 00C9
+00CA 00EA 00CA
+00CB 00EB 00CB
+00CC 00EC 00CC
+00CD 00ED 00CD
+00CE 00EE 00CE
+00CF 00EF 00CF
+00D0 00F0 00D0
+00D1 00F1 00D1
+00D2 00F2 00D2
+00D3 00F3 00D3
+00D4 00F4 00D4
+00D5 00F5 00D5
+00D6 00F6 00D6
+00D8 00F8 00D8
+00D9 00F9 00D9
+00DA 00FA 00DA
+00DB 00FB 00DB
+00DC 00FC 00DC
+00DD 00FD 00DD
+00DE 00FE 00DE
+00E0 00E0 00C0
+00E1 00E1 00C1
+00E2 00E2 00C2
+00E3 00E3 00C3
+00E4 00E4 00C4
+00E5 00E5 00C5
+00E6 00E6 00C6
+00E7 00E7 00C7
+00E8 00E8 00C8
+00E9 00E9 00C9
+00EA 00EA 00CA
+00EB 00EB 00CB
+00EC 00EC 00CC
+00ED 00ED 00CD
+00EE 00EE 00CE
+00EF 00EF 00CF
+00F0 00F0 00D0
+00F1 00F1 00D1
+00F2 00F2 00D2
+00F3 00F3 00D3
+00F4 00F4 00D4
+00F5 00F5 00D5
+00F6 00F6 00D6
+00F8 00F8 00D8
+00F9 00F9 00D9
+00FA 00FA 00DA
+00FB 00FB 00DB
+00FC 00FC 00DC
+00FD 00FD 00DD
+00FE 00FE 00DE
+00FF 00FF 0178
+0100 0101 0100
+0101 0101 0100
+0102 0103 0102
+0103 0103 0102
+0104 0105 0104
+0105 0105 0104
+0106 0107 0106
+0107 0107 0106
+0108 0109 0108
+0109 0109 0108
+010A 010B 010A
+010B 010B 010A
+010C 010D 010C
+010D 010D 010C
+010E 010F 010E
+010F 010F 010E
+0110 0111 0110
+0111 0111 0110
+0112 0113 0112
+0113 0113 0112
+0114 0115 0114
+0115 0115 0114
+0116 0117 0116
+0117 0117 0116
+0118 0119 0118
+0119 0119 0118
+011A 011B 011A
+011B 011B 011A
+011C 011D 011C
+011D 011D 011C
+011E 011F 011E
+011F 011F 011E
+0120 0121 0120
+0121 0121 0120
+0122 0123 0122
+0123 0123 0122
+0124 0125 0124
+0125 0125 0124
+0126 0127 0126
+0127 0127 0126
+0128 0129 0128
+0129 0129 0128
+012A 012B 012A
+012B 012B 012A
+012C 012D 012C
+012D 012D 012C
+012E 012F 012E
+012F 012F 012E
+0130 0069 0130
+0131 0131 0049
+0132 0133 0132
+0133 0133 0132
+0134 0135 0134
+0135 0135 0134
+0136 0137 0136
+0137 0137 0136
+0139 013A 0139
+013A 013A 0139
+013B 013C 013B
+013C 013C 013B
+013D 013E 013D
+013E 013E 013D
+013F 0140 013F
+0140 0140 013F
+0141 0142 0141
+0142 0142 0141
+0143 0144 0143
+0144 0144 0143
+0145 0146 0145
+0146 0146 0145
+0147 0148 0147
+0148 0148 0147
+014A 014B 014A
+014B 014B 014A
+014C 014D 014C
+014D 014D 014C
+014E 014F 014E
+014F 014F 014E
+0150 0151 0150
+0151 0151 0150
+0152 0153 0152
+0153 0153 0152
+0154 0155 0154
+0155 0155 0154
+0156 0157 0156
+0157 0157 0156
+0158 0159 0158
+0159 0159 0158
+015A 015B 015A
+015B 015B 015A
+015C 015D 015C
+015D 015D 015C
+015E 015F 015E
+015F 015F 015E
+0160 0161 0160
+0161 0161 0160
+0162 0163 0162
+0163 0163 0162
+0164 0165 0164
+0165 0165 0164
+0166 0167 0166
+0167 0167 0166
+0168 0169 0168
+0169 0169 0168
+016A 016B 016A
+016B 016B 016A
+016C 016D 016C
+016D 016D 016C
+016E 016F 016E
+016F 016F 016E
+0170 0171 0170
+0171 0171 0170
+0172 0173 0172
+0173 0173 0172
+0174 0175 0174
+0175 0175 0174
+0176 0177 0176
+0177 0177 0176
+0178 00FF 0178
+0179 017A 0179
+017A 017A 0179
+017B 017C 017B
+017C 017C 017B
+017D 017E 017D
+017E 017E 017D
+017F 017F 0053
+0180 0180 0243
+0181 0253 0181
+0182 0183 0182
+0183 0183 0182
+0184 0185 0184
+0185 0185 0184
+0186 0254 0186
+0187 0188 0187
+0188 0188 0187
+0189 0256 0189
+018A 0257 018A
+018B 018C 018B
+018C 018C 018B
+018E 01DD 018E
+018F 0259 018F
+0190 025B 0190
+0191 0192 0191
+0192 0192 0191
+0193 0260 0193
+0194 0263 0194
+0195 0195 01F6
+0196 0269 0196
+0197 0268 0197
+0198 0199 0198
+0199 0199 0198
+019A 019A 023D
+019C 026F 019C
+019D 0272 019D
+019E 019E 0220
+019F 0275 019F
+01A0 01A1 01A0
+01A1 01A1 01A0
+01A2 01A3 01A2
+01A3 01A3 01A2
+01A4 01A5 01A4
+01A5 01A5 01A4
+01A6 0280 01A6
+01A7 01A8 01A7
+01A8 01A8 01A7
+01A9 0283 01A9
+01AC 01AD 01AC
+01AD 01AD 01AC
+01AE 0288 01AE
+01AF 01B0 01AF
+01B0 01B0 01AF
+01B1 028A 01B1
+01B2 028B 01B2
+01B3 01B4 01B3
+01B4 01B4 01B3
+01B5 01B6 01B5
+01B6 01B6 01B5
+01B7 0292 01B7
+01B8 01B9 01B8
+01B9 01B9 01B8
+01BC 01BD 01BC
+01BD 01BD 01BC
+01BF 01BF 01F7
+01C4 01C6 01C4
+01C5 01C6 01C4
+01C6 01C6 01C4
+01C7 01C9 01C7
+01C8 01C9 01C7
+01C9 01C9 01C7
+01CA 01CC 01CA
+01CB 01CC 01CA
+01CC 01CC 01CA
+01CD 01CE 01CD
+01CE 01CE 01CD
+01CF 01D0 01CF
+01D0 01D0 01CF
+01D1 01D2 01D1
+01D2 01D2 01D1
+01D3 01D4 01D3
+01D4 01D4 01D3
+01D5 01D6 01D5
+01D6 01D6 01D5
+01D7 01D8 01D7
+01D8 01D8 01D7
+01D9 01DA 01D9
+01DA 01DA 01D9
+01DB 01DC 01DB
+01DC 01DC 01DB
+01DD 01DD 018E
+01DE 01DF 01DE
+01DF 01DF 01DE
+01E0 01E1 01E0
+01E1 01E1 01E0
+01E2 01E3 01E2
+01E3 01E3 01E2
+01E4 01E5 01E4
+01E5 01E5 01E4
+01E6 01E7 01E6
+01E7 01E7 01E6
+01E8 01E9 01E8
+01E9 01E9 01E8
+01EA 01EB 01EA
+01EB 01EB 01EA
+01EC 01ED 01EC
+01ED 01ED 01EC
+01EE 01EF 01EE
+01EF 01EF 01EE
+01F1 01F3 01F1
+01F2 01F3 01F1
+01F3 01F3 01F1
+01F4 01F5 01F4
+01F5 01F5 01F4
+01F6 0195 01F6
+01F7 01BF 01F7
+01F8 01F9 01F8
+01F9 01F9 01F8
+01FA 01FB 01FA
+01FB 01FB 01FA
+01FC 01FD 01FC
+01FD 01FD 01FC
+01FE 01FF 01FE
+01FF 01FF 01FE
+0200 0201 0200
+0201 0201 0200
+0202 0203 0202
+0203 0203 0202
+0204 0205 0204
+0205 0205 0204
+0206 0207 0206
+0207 0207 0206
+0208 0209 0208
+0209 0209 0208
+020A 020B 020A
+020B 020B 020A
+020C 020D 020C
+020D 020D 020C
+020E 020F 020E
+020F 020F 020E
+0210 0211 0210
+0211 0211 0210
+0212 0213 0212
+0213 0213 0212
+0214 0215 0214
+0215 0215 0214
+0216 0217 0216
+0217 0217 0216
+0218 0219 0218
+0219 0219 0218
+021A 021B 021A
+021B 021B 021A
+021C 021D 021C
+021D 021D 021C
+021E 021F 021E
+021F 021F 021E
+0220 019E 0220
+0222 0223 0222
+0223 0223 0222
+0224 0225 0224
+0225 0225 0224
+0226 0227 0226
+0227 0227 0226
+0228 0229 0228
+0229 0229 0228
+022A 022B 022A
+022B 022B 022A
+022C 022D 022C
+022D 022D 022C
+022E 022F 022E
+022F 022F 022E
+0230 0231 0230
+0231 0231 0230
+0232 0233 0232
+0233 0233 0232
+023A 2C65 023A
+023B 023C 023B
+023C 023C 023B
+023D 019A 023D
+023E 2C66 023E
+023F 023F 2C7E
+0240 0240 2C7F
+0241 0242 0241
+0242 0242 0241
+0243 0180 0243
+0244 0289 0244
+0245 028C 0245
+0246 0247 0246
+0247 0247 0246
+0248 0249 0248
+0249 0249 0248
+024A 024B 024A
+024B 024B 024A
+024C 024D 024C
+024D 024D 024C
+024E 024F 024E
+024F 024F 024E
+0250 0250 2C6F
+0251 0251 2C6D
+0252 0252 2C70
+0253 0253 0181
+0254 0254 0186
+0256 0256 0189
+0257 0257 018A
+0259 0259 018F
+025B 025B 0190
+025C 025C A7AB
+0260 0260 0193
+0261 0261 A7AC
+0263 0263 0194
+0265 0265 A78D
+0266 0266 A7AA
+0268 0268 0197
+0269 0269 0196
+026A 026A A7AE
+026B 026B 2C62
+026C 026C A7AD
+026F 026F 019C
+0271 0271 2C6E
+0272 0272 019D
+0275 0275 019F
+027D 027D 2C64
+0280 0280 01A6
+0282 0282 A7C5
+0283 0283 01A9
+0287 0287 A7B1
+0288 0288 01AE
+0289 0289 0244
+028A 028A 01B1
+028B 028B 01B2
+028C 028C 0245
+0292 0292 01B7
+029D 029D A7B2
+029E 029E A7B0
+0345 0345 0399
+0370 0371 0370
+0371 0371 0370
+0372 0373 0372
+0373 0373 0372
+0376 0377 0376
+0377 0377 0376
+037B 037B 03FD
+037C 037C 03FE
+037D 037D 03FF
+037F 03F3 037F
+0386 03AC 0386
+0388 03AD 0388
+0389 03AE 0389
+038A 03AF 038A
+038C 03CC 038C
+038E 03CD 038E
+038F 03CE 038F
+0391 03B1 0391
+0392 03B2 0392
+0393 03B3 0393
+0394 03B4 0394
+0395 03B5 0395
+0396 03B6 0396
+0397 03B7 0397
+0398 03B8 0398
+0399 03B9 0399
+039A 03BA 039A
+039B 03BB 039B
+039C 03BC 039C
+039D 03BD 039D
+039E 03BE 039E
+039F 03BF 039F
+03A0 03C0 03A0
+03A1 03C1 03A1
+03A3 03C3 03A3
+03A4 03C4 03A4
+03A5 03C5 03A5
+03A6 03C6 03A6
+03A7 03C7 03A7
+03A8 03C8 03A8
+03A9 03C9 03A9
+03AA 03CA 03AA
+03AB 03CB 03AB
+03AC 03AC 0386
+03AD 03AD 0388
+03AE 03AE 0389
+03AF 03AF 038A
+03B1 03B1 0391
+03B2 03B2 0392
+03B3 03B3 0393
+03B4 03B4 0394
+03B5 03B5 0395
+03B6 03B6 0396
+03B7 03B7 0397
+03B8 03B8 0398
+03B9 03B9 0399
+03BA 03BA 039A
+03BB 03BB 039B
+03BC 03BC 039C
+03BD 03BD 039D
+03BE 03BE 039E
+03BF 03BF 039F
+03C0 03C0 03A0
+03C1 03C1 03A1
+03C2 03C2 03A3
+03C3 03C3 03A3
+03C4 03C4 03A4
+03C5 03C5 03A5
+03C6 03C6 03A6
+03C7 03C7 03A7
+03C8 03C8 03A8
+03C9 03C9 03A9
+03CA 03CA 03AA
+03CB 03CB 03AB
+03CC 03CC 038C
+03CD 03CD 038E
+03CE 03CE 038F
+03CF 03D7 03CF
+03D0 03D0 0392
+03D1 03D1 0398
+03D5 03D5 03A6
+03D6 03D6 03A0
+03D7 03D7 03CF
+03D8 03D9 03D8
+03D9 03D9 03D8
+03DA 03DB 03DA
+03DB 03DB 03DA
+03DC 03DD 03DC
+03DD 03DD 03DC
+03DE 03DF 03DE
+03DF 03DF 03DE
+03E0 03E1 03E0
+03E1 03E1 03E0
+03E2 03E3 03E2
+03E3 03E3 03E2
+03E4 03E5 03E4
+03E5 03E5 03E4
+03E6 03E7 03E6
+03E7 03E7 03E6
+03E8 03E9 03E8
+03E9 03E9 03E8
+03EA 03EB 03EA
+03EB 03EB 03EA
+03EC 03ED 03EC
+03ED 03ED 03EC
+03EE 03EF 03EE
+03EF 03EF 03EE
+03F0 03F0 039A
+03F1 03F1 03A1
+03F2 03F2 03F9
+03F3 03F3 037F
+03F4 03B8 03F4
+03F5 03F5 0395
+03F7 03F8 03F7
+03F8 03F8 03F7
+03F9 03F2 03F9
+03FA 03FB 03FA
+03FB 03FB 03FA
+03FD 037B 03FD
+03FE 037C 03FE
+03FF 037D 03FF
+0400 0450 0400
+0401 0451 0401
+0402 0452 0402
+0403 0453 0403
+0404 0454 0404
+0405 0455 0405
+0406 0456 0406
+0407 0457 0407
+0408 0458 0408
+0409 0459 0409
+040A 045A 040A
+040B 045B 040B
+040C 045C 040C
+040D 045D 040D
+040E 045E 040E
+040F 045F 040F
+0410 0430 0410
+0411 0431 0411
+0412 0432 0412
+0413 0433 0413
+0414 0434 0414
+0415 0435 0415
+0416 0436 0416
+0417 0437 0417
+0418 0438 0418
+0419 0439 0419
+041A 043A 041A
+041B 043B 041B
+041C 043C 041C
+041D 043D 041D
+041E 043E 041E
+041F 043F 041F
+0420 0440 0420
+0421 0441 0421
+0422 0442 0422
+0423 0443 0423
+0424 0444 0424
+0425 0445 0425
+0426 0446 0426
+0427 0447 0427
+0428 0448 0428
+0429 0449 0429
+042A 044A 042A
+042B 044B 042B
+042C 044C 042C
+042D 044D 042D
+042E 044E 042E
+042F 044F 042F
+0430 0430 0410
+0431 0431 0411
+0432 0432 0412
+0433 0433 0413
+0434 0434 0414
+0435 0435 0415
+0436 0436 0416
+0437 0437 0417
+0438 0438 0418
+0439 0439 0419
+043A 043A 041A
+043B 043B 041B
+043C 043C 041C
+043D 043D 041D
+043E 043E 041E
+043F 043F 041F
+0440 0440 0420
+0441 0441 0421
+0442 0442 0422
+0443 0443 0423
+0444 0444 0424
+0445 0445 0425
+0446 0446 0426
+0447 0447 0427
+0448 0448 0428
+0449 0449 0429
+044A 044A 042A
+044B 044B 042B
+044C 044C 042C
+044D 044D 042D
+044E 044E 042E
+044F 044F 042F
+0450 0450 0400
+0451 0451 0401
+0452 0452 0402
+0453 0453 0403
+0454 0454 0404
+0455 0455 0405
+0456 0456 0406
+0457 0457 0407
+0458 0458 0408
+0459 0459 0409
+045A 045A 040A
+045B 045B 040B
+045C 045C 040C
+045D 045D 040D
+045E 045E 040E
+045F 045F 040F
+0460 0461 0460
+0461 0461 0460
+0462 0463 0462
+0463 0463 0462
+0464 0465 0464
+0465 0465 0464
+0466 0467 0466
+0467 0467 0466
+0468 0469 0468
+0469 0469 0468
+046A 046B 046A
+046B 046B 046A
+046C 046D 046C
+046D 046D 046C
+046E 046F 046E
+046F 046F 046E
+0470 0471 0470
+0471 0471 0470
+0472 0473 0472
+0473 0473 0472
+0474 0475 0474
+0475 0475 0474
+0476 0477 0476
+0477 0477 0476
+0478 0479 0478
+0479 0479 0478
+047A 047B 047A
+047B 047B 047A
+047C 047D 047C
+047D 047D 047C
+047E 047F 047E
+047F 047F 047E
+0480 0481 0480
+0481 0481 0480
+048A 048B 048A
+048B 048B 048A
+048C 048D 048C
+048D 048D 048C
+048E 048F 048E
+048F 048F 048E
+0490 0491 0490
+0491 0491 0490
+0492 0493 0492
+0493 0493 0492
+0494 0495 0494
+0495 0495 0494
+0496 0497 0496
+0497 0497 0496
+0498 0499 0498
+0499 0499 0498
+049A 049B 049A
+049B 049B 049A
+049C 049D 049C
+049D 049D 049C
+049E 049F 049E
+049F 049F 049E
+04A0 04A1 04A0
+04A1 04A1 04A0
+04A2 04A3 04A2
+04A3 04A3 04A2
+04A4 04A5 04A4
+04A5 04A5 04A4
+04A6 04A7 04A6
+04A7 04A7 04A6
+04A8 04A9 04A8
+04A9 04A9 04A8
+04AA 04AB 04AA
+04AB 04AB 04AA
+04AC 04AD 04AC
+04AD 04AD 04AC
+04AE 04AF 04AE
+04AF 04AF 04AE
+04B0 04B1 04B0
+04B1 04B1 04B0
+04B2 04B3 04B2
+04B3 04B3 04B2
+04B4 04B5 04B4
+04B5 04B5 04B4
+04B6 04B7 04B6
+04B7 04B7 04B6
+04B8 04B9 04B8
+04B9 04B9 04B8
+04BA 04BB 04BA
+04BB 04BB 04BA
+04BC 04BD 04BC
+04BD 04BD 04BC
+04BE 04BF 04BE
+04BF 04BF 04BE
+04C0 04CF 04C0
+04C1 04C2 04C1
+04C2 04C2 04C1
+04C3 04C4 04C3
+04C4 04C4 04C3
+04C5 04C6 04C5
+04C6 04C6 04C5
+04C7 04C8 04C7
+04C8 04C8 04C7
+04C9 04CA 04C9
+04CA 04CA 04C9
+04CB 04CC 04CB
+04CC 04CC 04CB
+04CD 04CE 04CD
+04CE 04CE 04CD
+04CF 04CF 04C0
+04D0 04D1 04D0
+04D1 04D1 04D0
+04D2 04D3 04D2
+04D3 04D3 04D2
+04D4 04D5 04D4
+04D5 04D5 04D4
+04D6 04D7 04D6
+04D7 04D7 04D6
+04D8 04D9 04D8
+04D9 04D9 04D8
+04DA 04DB 04DA
+04DB 04DB 04DA
+04DC 04DD 04DC
+04DD 04DD 04DC
+04DE 04DF 04DE
+04DF 04DF 04DE
+04E0 04E1 04E0
+04E1 04E1 04E0
+04E2 04E3 04E2
+04E3 04E3 04E2
+04E4 04E5 04E4
+04E5 04E5 04E4
+04E6 04E7 04E6
+04E7 04E7 04E6
+04E8 04E9 04E8
+04E9 04E9 04E8
+04EA 04EB 04EA
+04EB 04EB 04EA
+04EC 04ED 04EC
+04ED 04ED 04EC
+04EE 04EF 04EE
+04EF 04EF 04EE
+04F0 04F1 04F0
+04F1 04F1 04F0
+04F2 04F3 04F2
+04F3 04F3 04F2
+04F4 04F5 04F4
+04F5 04F5 04F4
+04F6 04F7 04F6
+04F7 04F7 04F6
+04F8 04F9 04F8
+04F9 04F9 04F8
+04FA 04FB 04FA
+04FB 04FB 04FA
+04FC 04FD 04FC
+04FD 04FD 04FC
+04FE 04FF 04FE
+04FF 04FF 04FE
+0500 0501 0500
+0501 0501 0500
+0502 0503 0502
+0503 0503 0502
+0504 0505 0504
+0505 0505 0504
+0506 0507 0506
+0507 0507 0506
+0508 0509 0508
+0509 0509 0508
+050A 050B 050A
+050B 050B 050A
+050C 050D 050C
+050D 050D 050C
+050E 050F 050E
+050F 050F 050E
+0510 0511 0510
+0511 0511 0510
+0512 0513 0512
+0513 0513 0512
+0514 0515 0514
+0515 0515 0514
+0516 0517 0516
+0517 0517 0516
+0518 0519 0518
+0519 0519 0518
+051A 051B 051A
+051B 051B 051A
+051C 051D 051C
+051D 051D 051C
+051E 051F 051E
+051F 051F 051E
+0520 0521 0520
+0521 0521 0520
+0522 0523 0522
+0523 0523 0522
+0524 0525 0524
+0525 0525 0524
+0526 0527 0526
+0527 0527 0526
+0528 0529 0528
+0529 0529 0528
+052A 052B 052A
+052B 052B 052A
+052C 052D 052C
+052D 052D 052C
+052E 052F 052E
+052F 052F 052E
+0531 0561 0531
+0532 0562 0532
+0533 0563 0533
+0534 0564 0534
+0535 0565 0535
+0536 0566 0536
+0537 0567 0537
+0538 0568 0538
+0539 0569 0539
+053A 056A 053A
+053B 056B 053B
+053C 056C 053C
+053D 056D 053D
+053E 056E 053E
+053F 056F 053F
+0540 0570 0540
+0541 0571 0541
+0542 0572 0542
+0543 0573 0543
+0544 0574 0544
+0545 0575 0545
+0546 0576 0546
+0547 0577 0547
+0548 0578 0548
+0549 0579 0549
+054A 057A 054A
+054B 057B 054B
+054C 057C 054C
+054D 057D 054D
+054E 057E 054E
+054F 057F 054F
+0550 0580 0550
+0551 0581 0551
+0552 0582 0552
+0553 0583 0553
+0554 0584 0554
+0555 0585 0555
+0556 0586 0556
+0561 0561 0531
+0562 0562 0532
+0563 0563 0533
+0564 0564 0534
+0565 0565 0535
+0566 0566 0536
+0567 0567 0537
+0568 0568 0538
+0569 0569 0539
+056A 056A 053A
+056B 056B 053B
+056C 056C 053C
+056D 056D 053D
+056E 056E 053E
+056F 056F 053F
+0570 0570 0540
+0571 0571 0541
+0572 0572 0542
+0573 0573 0543
+0574 0574 0544
+0575 0575 0545
+0576 0576 0546
+0577 0577 0547
+0578 0578 0548
+0579 0579 0549
+057A 057A 054A
+057B 057B 054B
+057C 057C 054C
+057D 057D 054D
+057E 057E 054E
+057F 057F 054F
+0580 0580 0550
+0581 0581 0551
+0582 0582 0552
+0583 0583 0553
+0584 0584 0554
+0585 0585 0555
+0586 0586 0556
+10A0 2D00 10A0
+10A1 2D01 10A1
+10A2 2D02 10A2
+10A3 2D03 10A3
+10A4 2D04 10A4
+10A5 2D05 10A5
+10A6 2D06 10A6
+10A7 2D07 10A7
+10A8 2D08 10A8
+10A9 2D09 10A9
+10AA 2D0A 10AA
+10AB 2D0B 10AB
+10AC 2D0C 10AC
+10AD 2D0D 10AD
+10AE 2D0E 10AE
+10AF 2D0F 10AF
+10B0 2D10 10B0
+10B1 2D11 10B1
+10B2 2D12 10B2
+10B3 2D13 10B3
+10B4 2D14 10B4
+10B5 2D15 10B5
+10B6 2D16 10B6
+10B7 2D17 10B7
+10B8 2D18 10B8
+10B9 2D19 10B9
+10BA 2D1A 10BA
+10BB 2D1B 10BB
+10BC 2D1C 10BC
+10BD 2D1D 10BD
+10BE 2D1E 10BE
+10BF 2D1F 10BF
+10C0 2D20 10C0
+10C1 2D21 10C1
+10C2 2D22 10C2
+10C3 2D23 10C3
+10C4 2D24 10C4
+10C5 2D25 10C5
+10C7 2D27 10C7
+10CD 2D2D 10CD
+10D0 10D0 1C90
+10D1 10D1 1C91
+10D2 10D2 1C92
+10D3 10D3 1C93
+10D4 10D4 1C94
+10D5 10D5 1C95
+10D6 10D6 1C96
+10D7 10D7 1C97
+10D8 10D8 1C98
+10D9 10D9 1C99
+10DA 10DA 1C9A
+10DB 10DB 1C9B
+10DC 10DC 1C9C
+10DD 10DD 1C9D
+10DE 10DE 1C9E
+10DF 10DF 1C9F
+10E0 10E0 1CA0
+10E1 10E1 1CA1
+10E2 10E2 1CA2
+10E3 10E3 1CA3
+10E4 10E4 1CA4
+10E5 10E5 1CA5
+10E6 10E6 1CA6
+10E7 10E7 1CA7
+10E8 10E8 1CA8
+10E9 10E9 1CA9
+10EA 10EA 1CAA
+10EB 10EB 1CAB
+10EC 10EC 1CAC
+10ED 10ED 1CAD
+10EE 10EE 1CAE
+10EF 10EF 1CAF
+10F0 10F0 1CB0
+10F1 10F1 1CB1
+10F2 10F2 1CB2
+10F3 10F3 1CB3
+10F4 10F4 1CB4
+10F5 10F5 1CB5
+10F6 10F6 1CB6
+10F7 10F7 1CB7
+10F8 10F8 1CB8
+10F9 10F9 1CB9
+10FA 10FA 1CBA
+10FD 10FD 1CBD
+10FE 10FE 1CBE
+10FF 10FF 1CBF
+13A0 AB70 13A0
+13A1 AB71 13A1
+13A2 AB72 13A2
+13A3 AB73 13A3
+13A4 AB74 13A4
+13A5 AB75 13A5
+13A6 AB76 13A6
+13A7 AB77 13A7
+13A8 AB78 13A8
+13A9 AB79 13A9
+13AA AB7A 13AA
+13AB AB7B 13AB
+13AC AB7C 13AC
+13AD AB7D 13AD
+13AE AB7E 13AE
+13AF AB7F 13AF
+13B0 AB80 13B0
+13B1 AB81 13B1
+13B2 AB82 13B2
+13B3 AB83 13B3
+13B4 AB84 13B4
+13B5 AB85 13B5
+13B6 AB86 13B6
+13B7 AB87 13B7
+13B8 AB88 13B8
+13B9 AB89 13B9
+13BA AB8A 13BA
+13BB AB8B 13BB
+13BC AB8C 13BC
+13BD AB8D 13BD
+13BE AB8E 13BE
+13BF AB8F 13BF
+13C0 AB90 13C0
+13C1 AB91 13C1
+13C2 AB92 13C2
+13C3 AB93 13C3
+13C4 AB94 13C4
+13C5 AB95 13C5
+13C6 AB96 13C6
+13C7 AB97 13C7
+13C8 AB98 13C8
+13C9 AB99 13C9
+13CA AB9A 13CA
+13CB AB9B 13CB
+13CC AB9C 13CC
+13CD AB9D 13CD
+13CE AB9E 13CE
+13CF AB9F 13CF
+13D0 ABA0 13D0
+13D1 ABA1 13D1
+13D2 ABA2 13D2
+13D3 ABA3 13D3
+13D4 ABA4 13D4
+13D5 ABA5 13D5
+13D6 ABA6 13D6
+13D7 ABA7 13D7
+13D8 ABA8 13D8
+13D9 ABA9 13D9
+13DA ABAA 13DA
+13DB ABAB 13DB
+13DC ABAC 13DC
+13DD ABAD 13DD
+13DE ABAE 13DE
+13DF ABAF 13DF
+13E0 ABB0 13E0
+13E1 ABB1 13E1
+13E2 ABB2 13E2
+13E3 ABB3 13E3
+13E4 ABB4 13E4
+13E5 ABB5 13E5
+13E6 ABB6 13E6
+13E7 ABB7 13E7
+13E8 ABB8 13E8
+13E9 ABB9 13E9
+13EA ABBA 13EA
+13EB ABBB 13EB
+13EC ABBC 13EC
+13ED ABBD 13ED
+13EE ABBE 13EE
+13EF ABBF 13EF
+13F0 13F8 13F0
+13F1 13F9 13F1
+13F2 13FA 13F2
+13F3 13FB 13F3
+13F4 13FC 13F4
+13F5 13FD 13F5
+13F8 13F8 13F0
+13F9 13F9 13F1
+13FA 13FA 13F2
+13FB 13FB 13F3
+13FC 13FC 13F4
+13FD 13FD 13F5
+1C80 1C80 0412
+1C81 1C81 0414
+1C82 1C82 041E
+1C83 1C83 0421
+1C84 1C84 0422
+1C85 1C85 0422
+1C86 1C86 042A
+1C87 1C87 0462
+1C88 1C88 A64A
+1C90 10D0 1C90
+1C91 10D1 1C91
+1C92 10D2 1C92
+1C93 10D3 1C93
+1C94 10D4 1C94
+1C95 10D5 1C95
+1C96 10D6 1C96
+1C97 10D7 1C97
+1C98 10D8 1C98
+1C99 10D9 1C99
+1C9A 10DA 1C9A
+1C9B 10DB 1C9B
+1C9C 10DC 1C9C
+1C9D 10DD 1C9D
+1C9E 10DE 1C9E
+1C9F 10DF 1C9F
+1CA0 10E0 1CA0
+1CA1 10E1 1CA1
+1CA2 10E2 1CA2
+1CA3 10E3 1CA3
+1CA4 10E4 1CA4
+1CA5 10E5 1CA5
+1CA6 10E6 1CA6
+1CA7 10E7 1CA7
+1CA8 10E8 1CA8
+1CA9 10E9 1CA9
+1CAA 10EA 1CAA
+1CAB 10EB 1CAB
+1CAC 10EC 1CAC
+1CAD 10ED 1CAD
+1CAE 10EE 1CAE
+1CAF 10EF 1CAF
+1CB0 10F0 1CB0
+1CB1 10F1 1CB1
+1CB2 10F2 1CB2
+1CB3 10F3 1CB3
+1CB4 10F4 1CB4
+1CB5 10F5 1CB5
+1CB6 10F6 1CB6
+1CB7 10F7 1CB7
+1CB8 10F8 1CB8
+1CB9 10F9 1CB9
+1CBA 10FA 1CBA
+1CBD 10FD 1CBD
+1CBE 10FE 1CBE
+1CBF 10FF 1CBF
+1D79 1D79 A77D
+1D7D 1D7D 2C63
+1D8E 1D8E A7C6
+1E00 1E01 1E00
+1E01 1E01 1E00
+1E02 1E03 1E02
+1E03 1E03 1E02
+1E04 1E05 1E04
+1E05 1E05 1E04
+1E06 1E07 1E06
+1E07 1E07 1E06
+1E08 1E09 1E08
+1E09 1E09 1E08
+1E0A 1E0B 1E0A
+1E0B 1E0B 1E0A
+1E0C 1E0D 1E0C
+1E0D 1E0D 1E0C
+1E0E 1E0F 1E0E
+1E0F 1E0F 1E0E
+1E10 1E11 1E10
+1E11 1E11 1E10
+1E12 1E13 1E12
+1E13 1E13 1E12
+1E14 1E15 1E14
+1E15 1E15 1E14
+1E16 1E17 1E16
+1E17 1E17 1E16
+1E18 1E19 1E18
+1E19 1E19 1E18
+1E1A 1E1B 1E1A
+1E1B 1E1B 1E1A
+1E1C 1E1D 1E1C
+1E1D 1E1D 1E1C
+1E1E 1E1F 1E1E
+1E1F 1E1F 1E1E
+1E20 1E21 1E20
+1E21 1E21 1E20
+1E22 1E23 1E22
+1E23 1E23 1E22
+1E24 1E25 1E24
+1E25 1E25 1E24
+1E26 1E27 1E26
+1E27 1E27 1E26
+1E28 1E29 1E28
+1E29 1E29 1E28
+1E2A 1E2B 1E2A
+1E2B 1E2B 1E2A
+1E2C 1E2D 1E2C
+1E2D 1E2D 1E2C
+1E2E 1E2F 1E2E
+1E2F 1E2F 1E2E
+1E30 1E31 1E30
+1E31 1E31 1E30
+1E32 1E33 1E32
+1E33 1E33 1E32
+1E34 1E35 1E34
+1E35 1E35 1E34
+1E36 1E37 1E36
+1E37 1E37 1E36
+1E38 1E39 1E38
+1E39 1E39 1E38
+1E3A 1E3B 1E3A
+1E3B 1E3B 1E3A
+1E3C 1E3D 1E3C
+1E3D 1E3D 1E3C
+1E3E 1E3F 1E3E
+1E3F 1E3F 1E3E
+1E40 1E41 1E40
+1E41 1E41 1E40
+1E42 1E43 1E42
+1E43 1E43 1E42
+1E44 1E45 1E44
+1E45 1E45 1E44
+1E46 1E47 1E46
+1E47 1E47 1E46
+1E48 1E49 1E48
+1E49 1E49 1E48
+1E4A 1E4B 1E4A
+1E4B 1E4B 1E4A
+1E4C 1E4D 1E4C
+1E4D 1E4D 1E4C
+1E4E 1E4F 1E4E
+1E4F 1E4F 1E4E
+1E50 1E51 1E50
+1E51 1E51 1E50
+1E52 1E53 1E52
+1E53 1E53 1E52
+1E54 1E55 1E54
+1E55 1E55 1E54
+1E56 1E57 1E56
+1E57 1E57 1E56
+1E58 1E59 1E58
+1E59 1E59 1E58
+1E5A 1E5B 1E5A
+1E5B 1E5B 1E5A
+1E5C 1E5D 1E5C
+1E5D 1E5D 1E5C
+1E5E 1E5F 1E5E
+1E5F 1E5F 1E5E
+1E60 1E61 1E60
+1E61 1E61 1E60
+1E62 1E63 1E62
+1E63 1E63 1E62
+1E64 1E65 1E64
+1E65 1E65 1E64
+1E66 1E67 1E66
+1E67 1E67 1E66
+1E68 1E69 1E68
+1E69 1E69 1E68
+1E6A 1E6B 1E6A
+1E6B 1E6B 1E6A
+1E6C 1E6D 1E6C
+1E6D 1E6D 1E6C
+1E6E 1E6F 1E6E
+1E6F 1E6F 1E6E
+1E70 1E71 1E70
+1E71 1E71 1E70
+1E72 1E73 1E72
+1E73 1E73 1E72
+1E74 1E75 1E74
+1E75 1E75 1E74
+1E76 1E77 1E76
+1E77 1E77 1E76
+1E78 1E79 1E78
+1E79 1E79 1E78
+1E7A 1E7B 1E7A
+1E7B 1E7B 1E7A
+1E7C 1E7D 1E7C
+1E7D 1E7D 1E7C
+1E7E 1E7F 1E7E
+1E7F 1E7F 1E7E
+1E80 1E81 1E80
+1E81 1E81 1E80
+1E82 1E83 1E82
+1E83 1E83 1E82
+1E84 1E85 1E84
+1E85 1E85 1E84
+1E86 1E87 1E86
+1E87 1E87 1E86
+1E88 1E89 1E88
+1E89 1E89 1E88
+1E8A 1E8B 1E8A
+1E8B 1E8B 1E8A
+1E8C 1E8D 1E8C
+1E8D 1E8D 1E8C
+1E8E 1E8F 1E8E
+1E8F 1E8F 1E8E
+1E90 1E91 1E90
+1E91 1E91 1E90
+1E92 1E93 1E92
+1E93 1E93 1E92
+1E94 1E95 1E94
+1E95 1E95 1E94
+1E9B 1E9B 1E60
+1E9E 00DF 1E9E
+1EA0 1EA1 1EA0
+1EA1 1EA1 1EA0
+1EA2 1EA3 1EA2
+1EA3 1EA3 1EA2
+1EA4 1EA5 1EA4
+1EA5 1EA5 1EA4
+1EA6 1EA7 1EA6
+1EA7 1EA7 1EA6
+1EA8 1EA9 1EA8
+1EA9 1EA9 1EA8
+1EAA 1EAB 1EAA
+1EAB 1EAB 1EAA
+1EAC 1EAD 1EAC
+1EAD 1EAD 1EAC
+1EAE 1EAF 1EAE
+1EAF 1EAF 1EAE
+1EB0 1EB1 1EB0
+1EB1 1EB1 1EB0
+1EB2 1EB3 1EB2
+1EB3 1EB3 1EB2
+1EB4 1EB5 1EB4
+1EB5 1EB5 1EB4
+1EB6 1EB7 1EB6
+1EB7 1EB7 1EB6
+1EB8 1EB9 1EB8
+1EB9 1EB9 1EB8
+1EBA 1EBB 1EBA
+1EBB 1EBB 1EBA
+1EBC 1EBD 1EBC
+1EBD 1EBD 1EBC
+1EBE 1EBF 1EBE
+1EBF 1EBF 1EBE
+1EC0 1EC1 1EC0
+1EC1 1EC1 1EC0
+1EC2 1EC3 1EC2
+1EC3 1EC3 1EC2
+1EC4 1EC5 1EC4
+1EC5 1EC5 1EC4
+1EC6 1EC7 1EC6
+1EC7 1EC7 1EC6
+1EC8 1EC9 1EC8
+1EC9 1EC9 1EC8
+1ECA 1ECB 1ECA
+1ECB 1ECB 1ECA
+1ECC 1ECD 1ECC
+1ECD 1ECD 1ECC
+1ECE 1ECF 1ECE
+1ECF 1ECF 1ECE
+1ED0 1ED1 1ED0
+1ED1 1ED1 1ED0
+1ED2 1ED3 1ED2
+1ED3 1ED3 1ED2
+1ED4 1ED5 1ED4
+1ED5 1ED5 1ED4
+1ED6 1ED7 1ED6
+1ED7 1ED7 1ED6
+1ED8 1ED9 1ED8
+1ED9 1ED9 1ED8
+1EDA 1EDB 1EDA
+1EDB 1EDB 1EDA
+1EDC 1EDD 1EDC
+1EDD 1EDD 1EDC
+1EDE 1EDF 1EDE
+1EDF 1EDF 1EDE
+1EE0 1EE1 1EE0
+1EE1 1EE1 1EE0
+1EE2 1EE3 1EE2
+1EE3 1EE3 1EE2
+1EE4 1EE5 1EE4
+1EE5 1EE5 1EE4
+1EE6 1EE7 1EE6
+1EE7 1EE7 1EE6
+1EE8 1EE9 1EE8
+1EE9 1EE9 1EE8
+1EEA 1EEB 1EEA
+1EEB 1EEB 1EEA
+1EEC 1EED 1EEC
+1EED 1EED 1EEC
+1EEE 1EEF 1EEE
+1EEF 1EEF 1EEE
+1EF0 1EF1 1EF0
+1EF1 1EF1 1EF0
+1EF2 1EF3 1EF2
+1EF3 1EF3 1EF2
+1EF4 1EF5 1EF4
+1EF5 1EF5 1EF4
+1EF6 1EF7 1EF6
+1EF7 1EF7 1EF6
+1EF8 1EF9 1EF8
+1EF9 1EF9 1EF8
+1EFA 1EFB 1EFA
+1EFB 1EFB 1EFA
+1EFC 1EFD 1EFC
+1EFD 1EFD 1EFC
+1EFE 1EFF 1EFE
+1EFF 1EFF 1EFE
+1F00 1F00 1F08
+1F01 1F01 1F09
+1F02 1F02 1F0A
+1F03 1F03 1F0B
+1F04 1F04 1F0C
+1F05 1F05 1F0D
+1F06 1F06 1F0E
+1F07 1F07 1F0F
+1F08 1F00 1F08
+1F09 1F01 1F09
+1F0A 1F02 1F0A
+1F0B 1F03 1F0B
+1F0C 1F04 1F0C
+1F0D 1F05 1F0D
+1F0E 1F06 1F0E
+1F0F 1F07 1F0F
+1F10 1F10 1F18
+1F11 1F11 1F19
+1F12 1F12 1F1A
+1F13 1F13 1F1B
+1F14 1F14 1F1C
+1F15 1F15 1F1D
+1F18 1F10 1F18
+1F19 1F11 1F19
+1F1A 1F12 1F1A
+1F1B 1F13 1F1B
+1F1C 1F14 1F1C
+1F1D 1F15 1F1D
+1F20 1F20 1F28
+1F21 1F21 1F29
+1F22 1F22 1F2A
+1F23 1F23 1F2B
+1F24 1F24 1F2C
+1F25 1F25 1F2D
+1F26 1F26 1F2E
+1F27 1F27 1F2F
+1F28 1F20 1F28
+1F29 1F21 1F29
+1F2A 1F22 1F2A
+1F2B 1F23 1F2B
+1F2C 1F24 1F2C
+1F2D 1F25 1F2D
+1F2E 1F26 1F2E
+1F2F 1F27 1F2F
+1F30 1F30 1F38
+1F31 1F31 1F39
+1F32 1F32 1F3A
+1F33 1F33 1F3B
+1F34 1F34 1F3C
+1F35 1F35 1F3D
+1F36 1F36 1F3E
+1F37 1F37 1F3F
+1F38 1F30 1F38
+1F39 1F31 1F39
+1F3A 1F32 1F3A
+1F3B 1F33 1F3B
+1F3C 1F34 1F3C
+1F3D 1F35 1F3D
+1F3E 1F36 1F3E
+1F3F 1F37 1F3F
+1F40 1F40 1F48
+1F41 1F41 1F49
+1F42 1F42 1F4A
+1F43 1F43 1F4B
+1F44 1F44 1F4C
+1F45 1F45 1F4D
+1F48 1F40 1F48
+1F49 1F41 1F49
+1F4A 1F42 1F4A
+1F4B 1F43 1F4B
+1F4C 1F44 1F4C
+1F4D 1F45 1F4D
+1F51 1F51 1F59
+1F53 1F53 1F5B
+1F55 1F55 1F5D
+1F57 1F57 1F5F
+1F59 1F51 1F59
+1F5B 1F53 1F5B
+1F5D 1F55 1F5D
+1F5F 1F57 1F5F
+1F60 1F60 1F68
+1F61 1F61 1F69
+1F62 1F62 1F6A
+1F63 1F63 1F6B
+1F64 1F64 1F6C
+1F65 1F65 1F6D
+1F66 1F66 1F6E
+1F67 1F67 1F6F
+1F68 1F60 1F68
+1F69 1F61 1F69
+1F6A 1F62 1F6A
+1F6B 1F63 1F6B
+1F6C 1F64 1F6C
+1F6D 1F65 1F6D
+1F6E 1F66 1F6E
+1F6F 1F67 1F6F
+1F70 1F70 1FBA
+1F71 1F71 1FBB
+1F72 1F72 1FC8
+1F73 1F73 1FC9
+1F74 1F74 1FCA
+1F75 1F75 1FCB
+1F76 1F76 1FDA
+1F77 1F77 1FDB
+1F78 1F78 1FF8
+1F79 1F79 1FF9
+1F7A 1F7A 1FEA
+1F7B 1F7B 1FEB
+1F7C 1F7C 1FFA
+1F7D 1F7D 1FFB
+1F80 1F80 1F88
+1F81 1F81 1F89
+1F82 1F82 1F8A
+1F83 1F83 1F8B
+1F84 1F84 1F8C
+1F85 1F85 1F8D
+1F86 1F86 1F8E
+1F87 1F87 1F8F
+1F88 1F80 1F88
+1F89 1F81 1F89
+1F8A 1F82 1F8A
+1F8B 1F83 1F8B
+1F8C 1F84 1F8C
+1F8D 1F85 1F8D
+1F8E 1F86 1F8E
+1F8F 1F87 1F8F
+1F90 1F90 1F98
+1F91 1F91 1F99
+1F92 1F92 1F9A
+1F93 1F93 1F9B
+1F94 1F94 1F9C
+1F95 1F95 1F9D
+1F96 1F96 1F9E
+1F97 1F97 1F9F
+1F98 1F90 1F98
+1F99 1F91 1F99
+1F9A 1F92 1F9A
+1F9B 1F93 1F9B
+1F9C 1F94 1F9C
+1F9D 1F95 1F9D
+1F9E 1F96 1F9E
+1F9F 1F97 1F9F
+1FA0 1FA0 1FA8
+1FA1 1FA1 1FA9
+1FA2 1FA2 1FAA
+1FA3 1FA3 1FAB
+1FA4 1FA4 1FAC
+1FA5 1FA5 1FAD
+1FA6 1FA6 1FAE
+1FA7 1FA7 1FAF
+1FA8 1FA0 1FA8
+1FA9 1FA1 1FA9
+1FAA 1FA2 1FAA
+1FAB 1FA3 1FAB
+1FAC 1FA4 1FAC
+1FAD 1FA5 1FAD
+1FAE 1FA6 1FAE
+1FAF 1FA7 1FAF
+1FB0 1FB0 1FB8
+1FB1 1FB1 1FB9
+1FB3 1FB3 1FBC
+1FB8 1FB0 1FB8
+1FB9 1FB1 1FB9
+1FBA 1F70 1FBA
+1FBB 1F71 1FBB
+1FBC 1FB3 1FBC
+1FBE 1FBE 0399
+1FC3 1FC3 1FCC
+1FC8 1F72 1FC8
+1FC9 1F73 1FC9
+1FCA 1F74 1FCA
+1FCB 1F75 1FCB
+1FCC 1FC3 1FCC
+1FD0 1FD0 1FD8
+1FD1 1FD1 1FD9
+1FD8 1FD0 1FD8
+1FD9 1FD1 1FD9
+1FDA 1F76 1FDA
+1FDB 1F77 1FDB
+1FE0 1FE0 1FE8
+1FE1 1FE1 1FE9
+1FE5 1FE5 1FEC
+1FE8 1FE0 1FE8
+1FE9 1FE1 1FE9
+1FEA 1F7A 1FEA
+1FEB 1F7B 1FEB
+1FEC 1FE5 1FEC
+1FF3 1FF3 1FFC
+1FF8 1F78 1FF8
+1FF9 1F79 1FF9
+1FFA 1F7C 1FFA
+1FFB 1F7D 1FFB
+1FFC 1FF3 1FFC
+2126 03C9 2126
+212A 006B 212A
+212B 00E5 212B
+2132 214E 2132
+214E 214E 2132
+2160 2170 2160
+2161 2171 2161
+2162 2172 2162
+2163 2173 2163
+2164 2174 2164
+2165 2175 2165
+2166 2176 2166
+2167 2177 2167
+2168 2178 2168
+2169 2179 2169
+216A 217A 216A
+216B 217B 216B
+216C 217C 216C
+216D 217D 216D
+216E 217E 216E
+216F 217F 216F
+2170 2170 2160
+2171 2171 2161
+2172 2172 2162
+2173 2173 2163
+2174 2174 2164
+2175 2175 2165
+2176 2176 2166
+2177 2177 2167
+2178 2178 2168
+2179 2179 2169
+217A 217A 216A
+217B 217B 216B
+217C 217C 216C
+217D 217D 216D
+217E 217E 216E
+217F 217F 216F
+2183 2184 2183
+2184 2184 2183
+24B6 24D0 24B6
+24B7 24D1 24B7
+24B8 24D2 24B8
+24B9 24D3 24B9
+24BA 24D4 24BA
+24BB 24D5 24BB
+24BC 24D6 24BC
+24BD 24D7 24BD
+24BE 24D8 24BE
+24BF 24D9 24BF
+24C0 24DA 24C0
+24C1 24DB 24C1
+24C2 24DC 24C2
+24C3 24DD 24C3
+24C4 24DE 24C4
+24C5 24DF 24C5
+24C6 24E0 24C6
+24C7 24E1 24C7
+24C8 24E2 24C8
+24C9 24E3 24C9
+24CA 24E4 24CA
+24CB 24E5 24CB
+24CC 24E6 24CC
+24CD 24E7 24CD
+24CE 24E8 24CE
+24CF 24E9 24CF
+24D0 24D0 24B6
+24D1 24D1 24B7
+24D2 24D2 24B8
+24D3 24D3 24B9
+24D4 24D4 24BA
+24D5 24D5 24BB
+24D6 24D6 24BC
+24D7 24D7 24BD
+24D8 24D8 24BE
+24D9 24D9 24BF
+24DA 24DA 24C0
+24DB 24DB 24C1
+24DC 24DC 24C2
+24DD 24DD 24C3
+24DE 24DE 24C4
+24DF 24DF 24C5
+24E0 24E0 24C6
+24E1 24E1 24C7
+24E2 24E2 24C8
+24E3 24E3 24C9
+24E4 24E4 24CA
+24E5 24E5 24CB
+24E6 24E6 24CC
+24E7 24E7 24CD
+24E8 24E8 24CE
+24E9 24E9 24CF
+2C00 2C30 2C00
+2C01 2C31 2C01
+2C02 2C32 2C02
+2C03 2C33 2C03
+2C04 2C34 2C04
+2C05 2C35 2C05
+2C06 2C36 2C06
+2C07 2C37 2C07
+2C08 2C38 2C08
+2C09 2C39 2C09
+2C0A 2C3A 2C0A
+2C0B 2C3B 2C0B
+2C0C 2C3C 2C0C
+2C0D 2C3D 2C0D
+2C0E 2C3E 2C0E
+2C0F 2C3F 2C0F
+2C10 2C40 2C10
+2C11 2C41 2C11
+2C12 2C42 2C12
+2C13 2C43 2C13
+2C14 2C44 2C14
+2C15 2C45 2C15
+2C16 2C46 2C16
+2C17 2C47 2C17
+2C18 2C48 2C18
+2C19 2C49 2C19
+2C1A 2C4A 2C1A
+2C1B 2C4B 2C1B
+2C1C 2C4C 2C1C
+2C1D 2C4D 2C1D
+2C1E 2C4E 2C1E
+2C1F 2C4F 2C1F
+2C20 2C50 2C20
+2C21 2C51 2C21
+2C22 2C52 2C22
+2C23 2C53 2C23
+2C24 2C54 2C24
+2C25 2C55 2C25
+2C26 2C56 2C26
+2C27 2C57 2C27
+2C28 2C58 2C28
+2C29 2C59 2C29
+2C2A 2C5A 2C2A
+2C2B 2C5B 2C2B
+2C2C 2C5C 2C2C
+2C2D 2C5D 2C2D
+2C2E 2C5E 2C2E
+2C2F 2C5F 2C2F
+2C30 2C30 2C00
+2C31 2C31 2C01
+2C32 2C32 2C02
+2C33 2C33 2C03
+2C34 2C34 2C04
+2C35 2C35 2C05
+2C36 2C36 2C06
+2C37 2C37 2C07
+2C38 2C38 2C08
+2C39 2C39 2C09
+2C3A 2C3A 2C0A
+2C3B 2C3B 2C0B
+2C3C 2C3C 2C0C
+2C3D 2C3D 2C0D
+2C3E 2C3E 2C0E
+2C3F 2C3F 2C0F
+2C40 2C40 2C10
+2C41 2C41 2C11
+2C42 2C42 2C12
+2C43 2C43 2C13
+2C44 2C44 2C14
+2C45 2C45 2C15
+2C46 2C46 2C16
+2C47 2C47 2C17
+2C48 2C48 2C18
+2C49 2C49 2C19
+2C4A 2C4A 2C1A
+2C4B 2C4B 2C1B
+2C4C 2C4C 2C1C
+2C4D 2C4D 2C1D
+2C4E 2C4E 2C1E
+2C4F 2C4F 2C1F
+2C50 2C50 2C20
+2C51 2C51 2C21
+2C52 2C52 2C22
+2C53 2C53 2C23
+2C54 2C54 2C24
+2C55 2C55 2C25
+2C56 2C56 2C26
+2C57 2C57 2C27
+2C58 2C58 2C28
+2C59 2C59 2C29
+2C5A 2C5A 2C2A
+2C5B 2C5B 2C2B
+2C5C 2C5C 2C2C
+2C5D 2C5D 2C2D
+2C5E 2C5E 2C2E
+2C5F 2C5F 2C2F
+2C60 2C61 2C60
+2C61 2C61 2C60
+2C62 026B 2C62
+2C63 1D7D 2C63
+2C64 027D 2C64
+2C65 2C65 023A
+2C66 2C66 023E
+2C67 2C68 2C67
+2C68 2C68 2C67
+2C69 2C6A 2C69
+2C6A 2C6A 2C69
+2C6B 2C6C 2C6B
+2C6C 2C6C 2C6B
+2C6D 0251 2C6D
+2C6E 0271 2C6E
+2C6F 0250 2C6F
+2C70 0252 2C70
+2C72 2C73 2C72
+2C73 2C73 2C72
+2C75 2C76 2C75
+2C76 2C76 2C75
+2C7E 023F 2C7E
+2C7F 0240 2C7F
+2C80 2C81 2C80
+2C81 2C81 2C80
+2C82 2C83 2C82
+2C83 2C83 2C82
+2C84 2C85 2C84
+2C85 2C85 2C84
+2C86 2C87 2C86
+2C87 2C87 2C86
+2C88 2C89 2C88
+2C89 2C89 2C88
+2C8A 2C8B 2C8A
+2C8B 2C8B 2C8A
+2C8C 2C8D 2C8C
+2C8D 2C8D 2C8C
+2C8E 2C8F 2C8E
+2C8F 2C8F 2C8E
+2C90 2C91 2C90
+2C91 2C91 2C90
+2C92 2C93 2C92
+2C93 2C93 2C92
+2C94 2C95 2C94
+2C95 2C95 2C94
+2C96 2C97 2C96
+2C97 2C97 2C96
+2C98 2C99 2C98
+2C99 2C99 2C98
+2C9A 2C9B 2C9A
+2C9B 2C9B 2C9A
+2C9C 2C9D 2C9C
+2C9D 2C9D 2C9C
+2C9E 2C9F 2C9E
+2C9F 2C9F 2C9E
+2CA0 2CA1 2CA0
+2CA1 2CA1 2CA0
+2CA2 2CA3 2CA2
+2CA3 2CA3 2CA2
+2CA4 2CA5 2CA4
+2CA5 2CA5 2CA4
+2CA6 2CA7 2CA6
+2CA7 2CA7 2CA6
+2CA8 2CA9 2CA8
+2CA9 2CA9 2CA8
+2CAA 2CAB 2CAA
+2CAB 2CAB 2CAA
+2CAC 2CAD 2CAC
+2CAD 2CAD 2CAC
+2CAE 2CAF 2CAE
+2CAF 2CAF 2CAE
+2CB0 2CB1 2CB0
+2CB1 2CB1 2CB0
+2CB2 2CB3 2CB2
+2CB3 2CB3 2CB2
+2CB4 2CB5 2CB4
+2CB5 2CB5 2CB4
+2CB6 2CB7 2CB6
+2CB7 2CB7 2CB6
+2CB8 2CB9 2CB8
+2CB9 2CB9 2CB8
+2CBA 2CBB 2CBA
+2CBB 2CBB 2CBA
+2CBC 2CBD 2CBC
+2CBD 2CBD 2CBC
+2CBE 2CBF 2CBE
+2CBF 2CBF 2CBE
+2CC0 2CC1 2CC0
+2CC1 2CC1 2CC0
+2CC2 2CC3 2CC2
+2CC3 2CC3 2CC2
+2CC4 2CC5 2CC4
+2CC5 2CC5 2CC4
+2CC6 2CC7 2CC6
+2CC7 2CC7 2CC6
+2CC8 2CC9 2CC8
+2CC9 2CC9 2CC8
+2CCA 2CCB 2CCA
+2CCB 2CCB 2CCA
+2CCC 2CCD 2CCC
+2CCD 2CCD 2CCC
+2CCE 2CCF 2CCE
+2CCF 2CCF 2CCE
+2CD0 2CD1 2CD0
+2CD1 2CD1 2CD0
+2CD2 2CD3 2CD2
+2CD3 2CD3 2CD2
+2CD4 2CD5 2CD4
+2CD5 2CD5 2CD4
+2CD6 2CD7 2CD6
+2CD7 2CD7 2CD6
+2CD8 2CD9 2CD8
+2CD9 2CD9 2CD8
+2CDA 2CDB 2CDA
+2CDB 2CDB 2CDA
+2CDC 2CDD 2CDC
+2CDD 2CDD 2CDC
+2CDE 2CDF 2CDE
+2CDF 2CDF 2CDE
+2CE0 2CE1 2CE0
+2CE1 2CE1 2CE0
+2CE2 2CE3 2CE2
+2CE3 2CE3 2CE2
+2CEB 2CEC 2CEB
+2CEC 2CEC 2CEB
+2CED 2CEE 2CED
+2CEE 2CEE 2CED
+2CF2 2CF3 2CF2
+2CF3 2CF3 2CF2
+2D00 2D00 10A0
+2D01 2D01 10A1
+2D02 2D02 10A2
+2D03 2D03 10A3
+2D04 2D04 10A4
+2D05 2D05 10A5
+2D06 2D06 10A6
+2D07 2D07 10A7
+2D08 2D08 10A8
+2D09 2D09 10A9
+2D0A 2D0A 10AA
+2D0B 2D0B 10AB
+2D0C 2D0C 10AC
+2D0D 2D0D 10AD
+2D0E 2D0E 10AE
+2D0F 2D0F 10AF
+2D10 2D10 10B0
+2D11 2D11 10B1
+2D12 2D12 10B2
+2D13 2D13 10B3
+2D14 2D14 10B4
+2D15 2D15 10B5
+2D16 2D16 10B6
+2D17 2D17 10B7
+2D18 2D18 10B8
+2D19 2D19 10B9
+2D1A 2D1A 10BA
+2D1B 2D1B 10BB
+2D1C 2D1C 10BC
+2D1D 2D1D 10BD
+2D1E 2D1E 10BE
+2D1F 2D1F 10BF
+2D20 2D20 10C0
+2D21 2D21 10C1
+2D22 2D22 10C2
+2D23 2D23 10C3
+2D24 2D24 10C4
+2D25 2D25 10C5
+2D27 2D27 10C7
+2D2D 2D2D 10CD
+A640 A641 A640
+A641 A641 A640
+A642 A643 A642
+A643 A643 A642
+A644 A645 A644
+A645 A645 A644
+A646 A647 A646
+A647 A647 A646
+A648 A649 A648
+A649 A649 A648
+A64A A64B A64A
+A64B A64B A64A
+A64C A64D A64C
+A64D A64D A64C
+A64E A64F A64E
+A64F A64F A64E
+A650 A651 A650
+A651 A651 A650
+A652 A653 A652
+A653 A653 A652
+A654 A655 A654
+A655 A655 A654
+A656 A657 A656
+A657 A657 A656
+A658 A659 A658
+A659 A659 A658
+A65A A65B A65A
+A65B A65B A65A
+A65C A65D A65C
+A65D A65D A65C
+A65E A65F A65E
+A65F A65F A65E
+A660 A661 A660
+A661 A661 A660
+A662 A663 A662
+A663 A663 A662
+A664 A665 A664
+A665 A665 A664
+A666 A667 A666
+A667 A667 A666
+A668 A669 A668
+A669 A669 A668
+A66A A66B A66A
+A66B A66B A66A
+A66C A66D A66C
+A66D A66D A66C
+A680 A681 A680
+A681 A681 A680
+A682 A683 A682
+A683 A683 A682
+A684 A685 A684
+A685 A685 A684
+A686 A687 A686
+A687 A687 A686
+A688 A689 A688
+A689 A689 A688
+A68A A68B A68A
+A68B A68B A68A
+A68C A68D A68C
+A68D A68D A68C
+A68E A68F A68E
+A68F A68F A68E
+A690 A691 A690
+A691 A691 A690
+A692 A693 A692
+A693 A693 A692
+A694 A695 A694
+A695 A695 A694
+A696 A697 A696
+A697 A697 A696
+A698 A699 A698
+A699 A699 A698
+A69A A69B A69A
+A69B A69B A69A
+A722 A723 A722
+A723 A723 A722
+A724 A725 A724
+A725 A725 A724
+A726 A727 A726
+A727 A727 A726
+A728 A729 A728
+A729 A729 A728
+A72A A72B A72A
+A72B A72B A72A
+A72C A72D A72C
+A72D A72D A72C
+A72E A72F A72E
+A72F A72F A72E
+A732 A733 A732
+A733 A733 A732
+A734 A735 A734
+A735 A735 A734
+A736 A737 A736
+A737 A737 A736
+A738 A739 A738
+A739 A739 A738
+A73A A73B A73A
+A73B A73B A73A
+A73C A73D A73C
+A73D A73D A73C
+A73E A73F A73E
+A73F A73F A73E
+A740 A741 A740
+A741 A741 A740
+A742 A743 A742
+A743 A743 A742
+A744 A745 A744
+A745 A745 A744
+A746 A747 A746
+A747 A747 A746
+A748 A749 A748
+A749 A749 A748
+A74A A74B A74A
+A74B A74B A74A
+A74C A74D A74C
+A74D A74D A74C
+A74E A74F A74E
+A74F A74F A74E
+A750 A751 A750
+A751 A751 A750
+A752 A753 A752
+A753 A753 A752
+A754 A755 A754
+A755 A755 A754
+A756 A757 A756
+A757 A757 A756
+A758 A759 A758
+A759 A759 A758
+A75A A75B A75A
+A75B A75B A75A
+A75C A75D A75C
+A75D A75D A75C
+A75E A75F A75E
+A75F A75F A75E
+A760 A761 A760
+A761 A761 A760
+A762 A763 A762
+A763 A763 A762
+A764 A765 A764
+A765 A765 A764
+A766 A767 A766
+A767 A767 A766
+A768 A769 A768
+A769 A769 A768
+A76A A76B A76A
+A76B A76B A76A
+A76C A76D A76C
+A76D A76D A76C
+A76E A76F A76E
+A76F A76F A76E
+A779 A77A A779
+A77A A77A A779
+A77B A77C A77B
+A77C A77C A77B
+A77D 1D79 A77D
+A77E A77F A77E
+A77F A77F A77E
+A780 A781 A780
+A781 A781 A780
+A782 A783 A782
+A783 A783 A782
+A784 A785 A784
+A785 A785 A784
+A786 A787 A786
+A787 A787 A786
+A78B A78C A78B
+A78C A78C A78B
+A78D 0265 A78D
+A790 A791 A790
+A791 A791 A790
+A792 A793 A792
+A793 A793 A792
+A794 A794 A7C4
+A796 A797 A796
+A797 A797 A796
+A798 A799 A798
+A799 A799 A798
+A79A A79B A79A
+A79B A79B A79A
+A79C A79D A79C
+A79D A79D A79C
+A79E A79F A79E
+A79F A79F A79E
+A7A0 A7A1 A7A0
+A7A1 A7A1 A7A0
+A7A2 A7A3 A7A2
+A7A3 A7A3 A7A2
+A7A4 A7A5 A7A4
+A7A5 A7A5 A7A4
+A7A6 A7A7 A7A6
+A7A7 A7A7 A7A6
+A7A8 A7A9 A7A8
+A7A9 A7A9 A7A8
+A7AA 0266 A7AA
+A7AB 025C A7AB
+A7AC 0261 A7AC
+A7AD 026C A7AD
+A7AE 026A A7AE
+A7B0 029E A7B0
+A7B1 0287 A7B1
+A7B2 029D A7B2
+A7B3 AB53 A7B3
+A7B4 A7B5 A7B4
+A7B5 A7B5 A7B4
+A7B6 A7B7 A7B6
+A7B7 A7B7 A7B6
+A7B8 A7B9 A7B8
+A7B9 A7B9 A7B8
+A7BA A7BB A7BA
+A7BB A7BB A7BA
+A7BC A7BD A7BC
+A7BD A7BD A7BC
+A7BE A7BF A7BE
+A7BF A7BF A7BE
+A7C0 A7C1 A7C0
+A7C1 A7C1 A7C0
+A7C2 A7C3 A7C2
+A7C3 A7C3 A7C2
+A7C4 A794 A7C4
+A7C5 0282 A7C5
+A7C6 1D8E A7C6
+A7C7 A7C8 A7C7
+A7C8 A7C8 A7C7
+A7C9 A7CA A7C9
+A7CA A7CA A7C9
+A7D0 A7D1 A7D0
+A7D1 A7D1 A7D0
+A7D6 A7D7 A7D6
+A7D7 A7D7 A7D6
+A7D8 A7D9 A7D8
+A7D9 A7D9 A7D8
+A7F5 A7F6 A7F5
+A7F6 A7F6 A7F5
+AB53 AB53 A7B3
+AB70 AB70 13A0
+AB71 AB71 13A1
+AB72 AB72 13A2
+AB73 AB73 13A3
+AB74 AB74 13A4
+AB75 AB75 13A5
+AB76 AB76 13A6
+AB77 AB77 13A7
+AB78 AB78 13A8
+AB79 AB79 13A9
+AB7A AB7A 13AA
+AB7B AB7B 13AB
+AB7C AB7C 13AC
+AB7D AB7D 13AD
+AB7E AB7E 13AE
+AB7F AB7F 13AF
+AB80 AB80 13B0
+AB81 AB81 13B1
+AB82 AB82 13B2
+AB83 AB83 13B3
+AB84 AB84 13B4
+AB85 AB85 13B5
+AB86 AB86 13B6
+AB87 AB87 13B7
+AB88 AB88 13B8
+AB89 AB89 13B9
+AB8A AB8A 13BA
+AB8B AB8B 13BB
+AB8C AB8C 13BC
+AB8D AB8D 13BD
+AB8E AB8E 13BE
+AB8F AB8F 13BF
+AB90 AB90 13C0
+AB91 AB91 13C1
+AB92 AB92 13C2
+AB93 AB93 13C3
+AB94 AB94 13C4
+AB95 AB95 13C5
+AB96 AB96 13C6
+AB97 AB97 13C7
+AB98 AB98 13C8
+AB99 AB99 13C9
+AB9A AB9A 13CA
+AB9B AB9B 13CB
+AB9C AB9C 13CC
+AB9D AB9D 13CD
+AB9E AB9E 13CE
+AB9F AB9F 13CF
+ABA0 ABA0 13D0
+ABA1 ABA1 13D1
+ABA2 ABA2 13D2
+ABA3 ABA3 13D3
+ABA4 ABA4 13D4
+ABA5 ABA5 13D5
+ABA6 ABA6 13D6
+ABA7 ABA7 13D7
+ABA8 ABA8 13D8
+ABA9 ABA9 13D9
+ABAA ABAA 13DA
+ABAB ABAB 13DB
+ABAC ABAC 13DC
+ABAD ABAD 13DD
+ABAE ABAE 13DE
+ABAF ABAF 13DF
+ABB0 ABB0 13E0
+ABB1 ABB1 13E1
+ABB2 ABB2 13E2
+ABB3 ABB3 13E3
+ABB4 ABB4 13E4
+ABB5 ABB5 13E5
+ABB6 ABB6 13E6
+ABB7 ABB7 13E7
+ABB8 ABB8 13E8
+ABB9 ABB9 13E9
+ABBA ABBA 13EA
+ABBB ABBB 13EB
+ABBC ABBC 13EC
+ABBD ABBD 13ED
+ABBE ABBE 13EE
+ABBF ABBF 13EF
+FF21 FF41 FF21
+FF22 FF42 FF22
+FF23 FF43 FF23
+FF24 FF44 FF24
+FF25 FF45 FF25
+FF26 FF46 FF26
+FF27 FF47 FF27
+FF28 FF48 FF28
+FF29 FF49 FF29
+FF2A FF4A FF2A
+FF2B FF4B FF2B
+FF2C FF4C FF2C
+FF2D FF4D FF2D
+FF2E FF4E FF2E
+FF2F FF4F FF2F
+FF30 FF50 FF30
+FF31 FF51 FF31
+FF32 FF52 FF32
+FF33 FF53 FF33
+FF34 FF54 FF34
+FF35 FF55 FF35
+FF36 FF56 FF36
+FF37 FF57 FF37
+FF38 FF58 FF38
+FF39 FF59 FF39
+FF3A FF5A FF3A
+FF41 FF41 FF21
+FF42 FF42 FF22
+FF43 FF43 FF23
+FF44 FF44 FF24
+FF45 FF45 FF25
+FF46 FF46 FF26
+FF47 FF47 FF27
+FF48 FF48 FF28
+FF49 FF49 FF29
+FF4A FF4A FF2A
+FF4B FF4B FF2B
+FF4C FF4C FF2C
+FF4D FF4D FF2D
+FF4E FF4E FF2E
+FF4F FF4F FF2F
+FF50 FF50 FF30
+FF51 FF51 FF31
+FF52 FF52 FF32
+FF53 FF53 FF33
+FF54 FF54 FF34
+FF55 FF55 FF35
+FF56 FF56 FF36
+FF57 FF57 FF37
+FF58 FF58 FF38
+FF59 FF59 FF39
+FF5A FF5A FF3A
+DROP VIEW v_bmp;
+EXECUTE IMMEDIATE SFORMAT('
+CREATE VIEW v_supplementary AS
+SELECT
+ seq AS codepoint,
+ LPAD(HEX(seq),8,''0'') AS codepoint_hex8,
+ CONVERT(CHAR(seq USING utf32) USING {}) COLLATE {} AS c
+FROM
+ seq_65536_to_1114111', @@character_set_connection, @@collation_connection);
+SELECT COLLATION(c) FROM v_supplementary LIMIT 1;
+COLLATION(c)
+utf8mb4_uca1400_ai_ci
+SELECT
+codepoint_hex8,
+HEX(CAST(LOWER(c) AS CHAR CHARACTER SET utf32)),
+HEX(CAST(UPPER(c) AS CHAR CHARACTER SET utf32))
+FROM v_supplementary
+WHERE BINARY(c)<>BINARY(LOWER(c)) OR BINARY(c)<>BINARY(UPPER(c));
+codepoint_hex8 HEX(CAST(LOWER(c) AS CHAR CHARACTER SET utf32)) HEX(CAST(UPPER(c) AS CHAR CHARACTER SET utf32))
+00010400 00010428 00010400
+00010401 00010429 00010401
+00010402 0001042A 00010402
+00010403 0001042B 00010403
+00010404 0001042C 00010404
+00010405 0001042D 00010405
+00010406 0001042E 00010406
+00010407 0001042F 00010407
+00010408 00010430 00010408
+00010409 00010431 00010409
+0001040A 00010432 0001040A
+0001040B 00010433 0001040B
+0001040C 00010434 0001040C
+0001040D 00010435 0001040D
+0001040E 00010436 0001040E
+0001040F 00010437 0001040F
+00010410 00010438 00010410
+00010411 00010439 00010411
+00010412 0001043A 00010412
+00010413 0001043B 00010413
+00010414 0001043C 00010414
+00010415 0001043D 00010415
+00010416 0001043E 00010416
+00010417 0001043F 00010417
+00010418 00010440 00010418
+00010419 00010441 00010419
+0001041A 00010442 0001041A
+0001041B 00010443 0001041B
+0001041C 00010444 0001041C
+0001041D 00010445 0001041D
+0001041E 00010446 0001041E
+0001041F 00010447 0001041F
+00010420 00010448 00010420
+00010421 00010449 00010421
+00010422 0001044A 00010422
+00010423 0001044B 00010423
+00010424 0001044C 00010424
+00010425 0001044D 00010425
+00010426 0001044E 00010426
+00010427 0001044F 00010427
+00010428 00010428 00010400
+00010429 00010429 00010401
+0001042A 0001042A 00010402
+0001042B 0001042B 00010403
+0001042C 0001042C 00010404
+0001042D 0001042D 00010405
+0001042E 0001042E 00010406
+0001042F 0001042F 00010407
+00010430 00010430 00010408
+00010431 00010431 00010409
+00010432 00010432 0001040A
+00010433 00010433 0001040B
+00010434 00010434 0001040C
+00010435 00010435 0001040D
+00010436 00010436 0001040E
+00010437 00010437 0001040F
+00010438 00010438 00010410
+00010439 00010439 00010411
+0001043A 0001043A 00010412
+0001043B 0001043B 00010413
+0001043C 0001043C 00010414
+0001043D 0001043D 00010415
+0001043E 0001043E 00010416
+0001043F 0001043F 00010417
+00010440 00010440 00010418
+00010441 00010441 00010419
+00010442 00010442 0001041A
+00010443 00010443 0001041B
+00010444 00010444 0001041C
+00010445 00010445 0001041D
+00010446 00010446 0001041E
+00010447 00010447 0001041F
+00010448 00010448 00010420
+00010449 00010449 00010421
+0001044A 0001044A 00010422
+0001044B 0001044B 00010423
+0001044C 0001044C 00010424
+0001044D 0001044D 00010425
+0001044E 0001044E 00010426
+0001044F 0001044F 00010427
+000104B0 000104D8 000104B0
+000104B1 000104D9 000104B1
+000104B2 000104DA 000104B2
+000104B3 000104DB 000104B3
+000104B4 000104DC 000104B4
+000104B5 000104DD 000104B5
+000104B6 000104DE 000104B6
+000104B7 000104DF 000104B7
+000104B8 000104E0 000104B8
+000104B9 000104E1 000104B9
+000104BA 000104E2 000104BA
+000104BB 000104E3 000104BB
+000104BC 000104E4 000104BC
+000104BD 000104E5 000104BD
+000104BE 000104E6 000104BE
+000104BF 000104E7 000104BF
+000104C0 000104E8 000104C0
+000104C1 000104E9 000104C1
+000104C2 000104EA 000104C2
+000104C3 000104EB 000104C3
+000104C4 000104EC 000104C4
+000104C5 000104ED 000104C5
+000104C6 000104EE 000104C6
+000104C7 000104EF 000104C7
+000104C8 000104F0 000104C8
+000104C9 000104F1 000104C9
+000104CA 000104F2 000104CA
+000104CB 000104F3 000104CB
+000104CC 000104F4 000104CC
+000104CD 000104F5 000104CD
+000104CE 000104F6 000104CE
+000104CF 000104F7 000104CF
+000104D0 000104F8 000104D0
+000104D1 000104F9 000104D1
+000104D2 000104FA 000104D2
+000104D3 000104FB 000104D3
+000104D8 000104D8 000104B0
+000104D9 000104D9 000104B1
+000104DA 000104DA 000104B2
+000104DB 000104DB 000104B3
+000104DC 000104DC 000104B4
+000104DD 000104DD 000104B5
+000104DE 000104DE 000104B6
+000104DF 000104DF 000104B7
+000104E0 000104E0 000104B8
+000104E1 000104E1 000104B9
+000104E2 000104E2 000104BA
+000104E3 000104E3 000104BB
+000104E4 000104E4 000104BC
+000104E5 000104E5 000104BD
+000104E6 000104E6 000104BE
+000104E7 000104E7 000104BF
+000104E8 000104E8 000104C0
+000104E9 000104E9 000104C1
+000104EA 000104EA 000104C2
+000104EB 000104EB 000104C3
+000104EC 000104EC 000104C4
+000104ED 000104ED 000104C5
+000104EE 000104EE 000104C6
+000104EF 000104EF 000104C7
+000104F0 000104F0 000104C8
+000104F1 000104F1 000104C9
+000104F2 000104F2 000104CA
+000104F3 000104F3 000104CB
+000104F4 000104F4 000104CC
+000104F5 000104F5 000104CD
+000104F6 000104F6 000104CE
+000104F7 000104F7 000104CF
+000104F8 000104F8 000104D0
+000104F9 000104F9 000104D1
+000104FA 000104FA 000104D2
+000104FB 000104FB 000104D3
+00010570 00010597 00010570
+00010571 00010598 00010571
+00010572 00010599 00010572
+00010573 0001059A 00010573
+00010574 0001059B 00010574
+00010575 0001059C 00010575
+00010576 0001059D 00010576
+00010577 0001059E 00010577
+00010578 0001059F 00010578
+00010579 000105A0 00010579
+0001057A 000105A1 0001057A
+0001057C 000105A3 0001057C
+0001057D 000105A4 0001057D
+0001057E 000105A5 0001057E
+0001057F 000105A6 0001057F
+00010580 000105A7 00010580
+00010581 000105A8 00010581
+00010582 000105A9 00010582
+00010583 000105AA 00010583
+00010584 000105AB 00010584
+00010585 000105AC 00010585
+00010586 000105AD 00010586
+00010587 000105AE 00010587
+00010588 000105AF 00010588
+00010589 000105B0 00010589
+0001058A 000105B1 0001058A
+0001058C 000105B3 0001058C
+0001058D 000105B4 0001058D
+0001058E 000105B5 0001058E
+0001058F 000105B6 0001058F
+00010590 000105B7 00010590
+00010591 000105B8 00010591
+00010592 000105B9 00010592
+00010594 000105BB 00010594
+00010595 000105BC 00010595
+00010597 00010597 00010570
+00010598 00010598 00010571
+00010599 00010599 00010572
+0001059A 0001059A 00010573
+0001059B 0001059B 00010574
+0001059C 0001059C 00010575
+0001059D 0001059D 00010576
+0001059E 0001059E 00010577
+0001059F 0001059F 00010578
+000105A0 000105A0 00010579
+000105A1 000105A1 0001057A
+000105A3 000105A3 0001057C
+000105A4 000105A4 0001057D
+000105A5 000105A5 0001057E
+000105A6 000105A6 0001057F
+000105A7 000105A7 00010580
+000105A8 000105A8 00010581
+000105A9 000105A9 00010582
+000105AA 000105AA 00010583
+000105AB 000105AB 00010584
+000105AC 000105AC 00010585
+000105AD 000105AD 00010586
+000105AE 000105AE 00010587
+000105AF 000105AF 00010588
+000105B0 000105B0 00010589
+000105B1 000105B1 0001058A
+000105B3 000105B3 0001058C
+000105B4 000105B4 0001058D
+000105B5 000105B5 0001058E
+000105B6 000105B6 0001058F
+000105B7 000105B7 00010590
+000105B8 000105B8 00010591
+000105B9 000105B9 00010592
+000105BB 000105BB 00010594
+000105BC 000105BC 00010595
+00010C80 00010CC0 00010C80
+00010C81 00010CC1 00010C81
+00010C82 00010CC2 00010C82
+00010C83 00010CC3 00010C83
+00010C84 00010CC4 00010C84
+00010C85 00010CC5 00010C85
+00010C86 00010CC6 00010C86
+00010C87 00010CC7 00010C87
+00010C88 00010CC8 00010C88
+00010C89 00010CC9 00010C89
+00010C8A 00010CCA 00010C8A
+00010C8B 00010CCB 00010C8B
+00010C8C 00010CCC 00010C8C
+00010C8D 00010CCD 00010C8D
+00010C8E 00010CCE 00010C8E
+00010C8F 00010CCF 00010C8F
+00010C90 00010CD0 00010C90
+00010C91 00010CD1 00010C91
+00010C92 00010CD2 00010C92
+00010C93 00010CD3 00010C93
+00010C94 00010CD4 00010C94
+00010C95 00010CD5 00010C95
+00010C96 00010CD6 00010C96
+00010C97 00010CD7 00010C97
+00010C98 00010CD8 00010C98
+00010C99 00010CD9 00010C99
+00010C9A 00010CDA 00010C9A
+00010C9B 00010CDB 00010C9B
+00010C9C 00010CDC 00010C9C
+00010C9D 00010CDD 00010C9D
+00010C9E 00010CDE 00010C9E
+00010C9F 00010CDF 00010C9F
+00010CA0 00010CE0 00010CA0
+00010CA1 00010CE1 00010CA1
+00010CA2 00010CE2 00010CA2
+00010CA3 00010CE3 00010CA3
+00010CA4 00010CE4 00010CA4
+00010CA5 00010CE5 00010CA5
+00010CA6 00010CE6 00010CA6
+00010CA7 00010CE7 00010CA7
+00010CA8 00010CE8 00010CA8
+00010CA9 00010CE9 00010CA9
+00010CAA 00010CEA 00010CAA
+00010CAB 00010CEB 00010CAB
+00010CAC 00010CEC 00010CAC
+00010CAD 00010CED 00010CAD
+00010CAE 00010CEE 00010CAE
+00010CAF 00010CEF 00010CAF
+00010CB0 00010CF0 00010CB0
+00010CB1 00010CF1 00010CB1
+00010CB2 00010CF2 00010CB2
+00010CC0 00010CC0 00010C80
+00010CC1 00010CC1 00010C81
+00010CC2 00010CC2 00010C82
+00010CC3 00010CC3 00010C83
+00010CC4 00010CC4 00010C84
+00010CC5 00010CC5 00010C85
+00010CC6 00010CC6 00010C86
+00010CC7 00010CC7 00010C87
+00010CC8 00010CC8 00010C88
+00010CC9 00010CC9 00010C89
+00010CCA 00010CCA 00010C8A
+00010CCB 00010CCB 00010C8B
+00010CCC 00010CCC 00010C8C
+00010CCD 00010CCD 00010C8D
+00010CCE 00010CCE 00010C8E
+00010CCF 00010CCF 00010C8F
+00010CD0 00010CD0 00010C90
+00010CD1 00010CD1 00010C91
+00010CD2 00010CD2 00010C92
+00010CD3 00010CD3 00010C93
+00010CD4 00010CD4 00010C94
+00010CD5 00010CD5 00010C95
+00010CD6 00010CD6 00010C96
+00010CD7 00010CD7 00010C97
+00010CD8 00010CD8 00010C98
+00010CD9 00010CD9 00010C99
+00010CDA 00010CDA 00010C9A
+00010CDB 00010CDB 00010C9B
+00010CDC 00010CDC 00010C9C
+00010CDD 00010CDD 00010C9D
+00010CDE 00010CDE 00010C9E
+00010CDF 00010CDF 00010C9F
+00010CE0 00010CE0 00010CA0
+00010CE1 00010CE1 00010CA1
+00010CE2 00010CE2 00010CA2
+00010CE3 00010CE3 00010CA3
+00010CE4 00010CE4 00010CA4
+00010CE5 00010CE5 00010CA5
+00010CE6 00010CE6 00010CA6
+00010CE7 00010CE7 00010CA7
+00010CE8 00010CE8 00010CA8
+00010CE9 00010CE9 00010CA9
+00010CEA 00010CEA 00010CAA
+00010CEB 00010CEB 00010CAB
+00010CEC 00010CEC 00010CAC
+00010CED 00010CED 00010CAD
+00010CEE 00010CEE 00010CAE
+00010CEF 00010CEF 00010CAF
+00010CF0 00010CF0 00010CB0
+00010CF1 00010CF1 00010CB1
+00010CF2 00010CF2 00010CB2
+000118A0 000118C0 000118A0
+000118A1 000118C1 000118A1
+000118A2 000118C2 000118A2
+000118A3 000118C3 000118A3
+000118A4 000118C4 000118A4
+000118A5 000118C5 000118A5
+000118A6 000118C6 000118A6
+000118A7 000118C7 000118A7
+000118A8 000118C8 000118A8
+000118A9 000118C9 000118A9
+000118AA 000118CA 000118AA
+000118AB 000118CB 000118AB
+000118AC 000118CC 000118AC
+000118AD 000118CD 000118AD
+000118AE 000118CE 000118AE
+000118AF 000118CF 000118AF
+000118B0 000118D0 000118B0
+000118B1 000118D1 000118B1
+000118B2 000118D2 000118B2
+000118B3 000118D3 000118B3
+000118B4 000118D4 000118B4
+000118B5 000118D5 000118B5
+000118B6 000118D6 000118B6
+000118B7 000118D7 000118B7
+000118B8 000118D8 000118B8
+000118B9 000118D9 000118B9
+000118BA 000118DA 000118BA
+000118BB 000118DB 000118BB
+000118BC 000118DC 000118BC
+000118BD 000118DD 000118BD
+000118BE 000118DE 000118BE
+000118BF 000118DF 000118BF
+000118C0 000118C0 000118A0
+000118C1 000118C1 000118A1
+000118C2 000118C2 000118A2
+000118C3 000118C3 000118A3
+000118C4 000118C4 000118A4
+000118C5 000118C5 000118A5
+000118C6 000118C6 000118A6
+000118C7 000118C7 000118A7
+000118C8 000118C8 000118A8
+000118C9 000118C9 000118A9
+000118CA 000118CA 000118AA
+000118CB 000118CB 000118AB
+000118CC 000118CC 000118AC
+000118CD 000118CD 000118AD
+000118CE 000118CE 000118AE
+000118CF 000118CF 000118AF
+000118D0 000118D0 000118B0
+000118D1 000118D1 000118B1
+000118D2 000118D2 000118B2
+000118D3 000118D3 000118B3
+000118D4 000118D4 000118B4
+000118D5 000118D5 000118B5
+000118D6 000118D6 000118B6
+000118D7 000118D7 000118B7
+000118D8 000118D8 000118B8
+000118D9 000118D9 000118B9
+000118DA 000118DA 000118BA
+000118DB 000118DB 000118BB
+000118DC 000118DC 000118BC
+000118DD 000118DD 000118BD
+000118DE 000118DE 000118BE
+000118DF 000118DF 000118BF
+00016E40 00016E60 00016E40
+00016E41 00016E61 00016E41
+00016E42 00016E62 00016E42
+00016E43 00016E63 00016E43
+00016E44 00016E64 00016E44
+00016E45 00016E65 00016E45
+00016E46 00016E66 00016E46
+00016E47 00016E67 00016E47
+00016E48 00016E68 00016E48
+00016E49 00016E69 00016E49
+00016E4A 00016E6A 00016E4A
+00016E4B 00016E6B 00016E4B
+00016E4C 00016E6C 00016E4C
+00016E4D 00016E6D 00016E4D
+00016E4E 00016E6E 00016E4E
+00016E4F 00016E6F 00016E4F
+00016E50 00016E70 00016E50
+00016E51 00016E71 00016E51
+00016E52 00016E72 00016E52
+00016E53 00016E73 00016E53
+00016E54 00016E74 00016E54
+00016E55 00016E75 00016E55
+00016E56 00016E76 00016E56
+00016E57 00016E77 00016E57
+00016E58 00016E78 00016E58
+00016E59 00016E79 00016E59
+00016E5A 00016E7A 00016E5A
+00016E5B 00016E7B 00016E5B
+00016E5C 00016E7C 00016E5C
+00016E5D 00016E7D 00016E5D
+00016E5E 00016E7E 00016E5E
+00016E5F 00016E7F 00016E5F
+00016E60 00016E60 00016E40
+00016E61 00016E61 00016E41
+00016E62 00016E62 00016E42
+00016E63 00016E63 00016E43
+00016E64 00016E64 00016E44
+00016E65 00016E65 00016E45
+00016E66 00016E66 00016E46
+00016E67 00016E67 00016E47
+00016E68 00016E68 00016E48
+00016E69 00016E69 00016E49
+00016E6A 00016E6A 00016E4A
+00016E6B 00016E6B 00016E4B
+00016E6C 00016E6C 00016E4C
+00016E6D 00016E6D 00016E4D
+00016E6E 00016E6E 00016E4E
+00016E6F 00016E6F 00016E4F
+00016E70 00016E70 00016E50
+00016E71 00016E71 00016E51
+00016E72 00016E72 00016E52
+00016E73 00016E73 00016E53
+00016E74 00016E74 00016E54
+00016E75 00016E75 00016E55
+00016E76 00016E76 00016E56
+00016E77 00016E77 00016E57
+00016E78 00016E78 00016E58
+00016E79 00016E79 00016E59
+00016E7A 00016E7A 00016E5A
+00016E7B 00016E7B 00016E5B
+00016E7C 00016E7C 00016E5C
+00016E7D 00016E7D 00016E5D
+00016E7E 00016E7E 00016E5E
+00016E7F 00016E7F 00016E5F
+0001E900 0001E922 0001E900
+0001E901 0001E923 0001E901
+0001E902 0001E924 0001E902
+0001E903 0001E925 0001E903
+0001E904 0001E926 0001E904
+0001E905 0001E927 0001E905
+0001E906 0001E928 0001E906
+0001E907 0001E929 0001E907
+0001E908 0001E92A 0001E908
+0001E909 0001E92B 0001E909
+0001E90A 0001E92C 0001E90A
+0001E90B 0001E92D 0001E90B
+0001E90C 0001E92E 0001E90C
+0001E90D 0001E92F 0001E90D
+0001E90E 0001E930 0001E90E
+0001E90F 0001E931 0001E90F
+0001E910 0001E932 0001E910
+0001E911 0001E933 0001E911
+0001E912 0001E934 0001E912
+0001E913 0001E935 0001E913
+0001E914 0001E936 0001E914
+0001E915 0001E937 0001E915
+0001E916 0001E938 0001E916
+0001E917 0001E939 0001E917
+0001E918 0001E93A 0001E918
+0001E919 0001E93B 0001E919
+0001E91A 0001E93C 0001E91A
+0001E91B 0001E93D 0001E91B
+0001E91C 0001E93E 0001E91C
+0001E91D 0001E93F 0001E91D
+0001E91E 0001E940 0001E91E
+0001E91F 0001E941 0001E91F
+0001E920 0001E942 0001E920
+0001E921 0001E943 0001E921
+0001E922 0001E922 0001E900
+0001E923 0001E923 0001E901
+0001E924 0001E924 0001E902
+0001E925 0001E925 0001E903
+0001E926 0001E926 0001E904
+0001E927 0001E927 0001E905
+0001E928 0001E928 0001E906
+0001E929 0001E929 0001E907
+0001E92A 0001E92A 0001E908
+0001E92B 0001E92B 0001E909
+0001E92C 0001E92C 0001E90A
+0001E92D 0001E92D 0001E90B
+0001E92E 0001E92E 0001E90C
+0001E92F 0001E92F 0001E90D
+0001E930 0001E930 0001E90E
+0001E931 0001E931 0001E90F
+0001E932 0001E932 0001E910
+0001E933 0001E933 0001E911
+0001E934 0001E934 0001E912
+0001E935 0001E935 0001E913
+0001E936 0001E936 0001E914
+0001E937 0001E937 0001E915
+0001E938 0001E938 0001E916
+0001E939 0001E939 0001E917
+0001E93A 0001E93A 0001E918
+0001E93B 0001E93B 0001E919
+0001E93C 0001E93C 0001E91A
+0001E93D 0001E93D 0001E91B
+0001E93E 0001E93E 0001E91C
+0001E93F 0001E93F 0001E91D
+0001E940 0001E940 0001E91E
+0001E941 0001E941 0001E91F
+0001E942 0001E942 0001E920
+0001E943 0001E943 0001E921
+DROP VIEW v_supplementary;
+#
+# End of 10.10 tests
+#
diff --git a/mysql-test/main/ctype_utf8mb4_uca1400_ai_ci_casefold.test b/mysql-test/main/ctype_utf8mb4_uca1400_ai_ci_casefold.test
new file mode 100644
index 00000000000..288f86155e2
--- /dev/null
+++ b/mysql-test/main/ctype_utf8mb4_uca1400_ai_ci_casefold.test
@@ -0,0 +1,15 @@
+--echo #
+--echo # Start of 10.10 tests
+--echo #
+
+--echo #
+--echo # MDEV-30577 Case folding for uca1400 collations is not up to date
+--echo #
+
+SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_ai_ci;
+--source include/ctype_unicode_casefold_bmp.inc
+--source include/ctype_unicode_casefold_supplementary.inc
+
+--echo #
+--echo # End of 10.10 tests
+--echo #
diff --git a/mysql-test/main/derived.result b/mysql-test/main/derived.result
index 7203c9bf67a..0c23f558757 100644
--- a/mysql-test/main/derived.result
+++ b/mysql-test/main/derived.result
@@ -1357,6 +1357,29 @@ a b
DROP VIEW v1;
DROP TABLE t1;
#
+# MDEV-28616: derived table over union with order by clause that
+# contains subquery with unresolvable column reference
+#
+SELECT 1 FROM (
+SELECT 1 UNION SELECT 2 ORDER BY (SELECT 1 FROM DUAL WHERE xxx = 0)
+) dt;
+ERROR 42S22: Unknown column 'xxx' in 'where clause'
+create table t1 (a int, b int);
+insert into t1 values (3,8), (7,2), (1,4), (5,9);
+create table t2 (a int, b int);
+insert into t2 values (9,1), (7,3), (2,6);
+create table t3 (c int, d int);
+insert into t3 values (7,8), (1,2), (3,8);
+select * from
+(
+select a,b from t1 where t1.a > 3
+union
+select a,b from t2 where t2.b < 6
+order by (a - b / (select a + max(c) from t3 where d = x))
+) dt;
+ERROR 42S22: Unknown column 'x' in 'where clause'
+drop table t1,t2,t3;
+#
# End of 10.3 tests
#
#
@@ -1476,6 +1499,34 @@ a
2
drop table t1;
#
+# MDEV-31022: SIGSEGV in maria_create from create_internal_tmp_table
+# keydef incorrectly allocated on the stack in create_internal_tmp_table()
+#
+CREATE TABLE t1 (c CHAR(1) NULL) ENGINE=MyISAM;
+INSERT INTO t1 (c) VALUES (1);
+SET statement
+optimizer_where_cost=1,
+big_tables=1,
+in_predicate_conversion_threshold=2
+FOR
+SELECT * FROM t1 WHERE c IN ('','');
+c
+Warnings:
+Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
+Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
+SET statement
+optimizer_where_cost=1,
+big_tables=1,
+in_predicate_conversion_threshold=2,
+sql_mode=''
+FOR
+SELECT * FROM t1 WHERE c IN ('','');
+c
+Warnings:
+Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
+Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
+DROP TABLE t1;
+#
# End of 11.0 tests
#
#
@@ -1668,7 +1719,8 @@ t1.a = ( select * from (select a from t1) dt where dt.a > 7);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where
-2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where
+2 SUBQUERY <derived3> ALL NULL NULL NULL NULL 2 Using where
+3 DERIVED t1 ALL NULL NULL NULL NULL 2 Using where
update t1,t3 set t1.a = 1
where t1.a=t3.a and
t1.a = ( select * from (select a from t1) dt where dt.a > 7);
@@ -1705,7 +1757,8 @@ t1.a = ( select * from (select a from t2) dt where dt.a > 7);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
-2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 Using where
+2 SUBQUERY <derived3> ALL NULL NULL NULL NULL 4 Using where
+3 DERIVED t2 ALL NULL NULL NULL NULL 4 Using where
update t1,t3 set t1.a = 1
where t1.a=t3.a and
t1.a = ( select * from (select a from t2) dt where dt.a > 7);
@@ -1745,7 +1798,8 @@ t1.a = ( select * from (select a from t1) dt where dt.a > 7);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
1 PRIMARY t3 ALL NULL NULL NULL NULL 5 Using where
-2 SUBQUERY t1 ALL NULL NULL NULL NULL 4 Using where
+2 SUBQUERY <derived3> ALL NULL NULL NULL NULL 4 Using where
+3 DERIVED t1 ALL NULL NULL NULL NULL 4 Using where
delete from t1 using t1,t3
where t1.a=t3.a and
t1.a = ( select * from (select a from t1) dt where dt.a > 7);
@@ -1781,7 +1835,8 @@ t1.a = ( select * from (select a from t2) dt where dt.a > 7);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
1 PRIMARY t3 ALL NULL NULL NULL NULL 5 Using where
-2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 Using where
+2 SUBQUERY <derived3> ALL NULL NULL NULL NULL 4 Using where
+3 DERIVED t2 ALL NULL NULL NULL NULL 4 Using where
delete from t1 using t1,t3
where t1.a=t3.a and
t1.a = ( select * from (select a from t2) dt where dt.a > 7);
diff --git a/mysql-test/main/derived.test b/mysql-test/main/derived.test
index dceae7a8c8f..772d7be2ace 100644
--- a/mysql-test/main/derived.test
+++ b/mysql-test/main/derived.test
@@ -1153,6 +1153,36 @@ DROP VIEW v1;
DROP TABLE t1;
--echo #
+--echo # MDEV-28616: derived table over union with order by clause that
+--echo # contains subquery with unresolvable column reference
+--echo #
+
+--error ER_BAD_FIELD_ERROR
+SELECT 1 FROM (
+ SELECT 1 UNION SELECT 2 ORDER BY (SELECT 1 FROM DUAL WHERE xxx = 0)
+) dt;
+
+create table t1 (a int, b int);
+insert into t1 values (3,8), (7,2), (1,4), (5,9);
+
+create table t2 (a int, b int);
+insert into t2 values (9,1), (7,3), (2,6);
+
+create table t3 (c int, d int);
+insert into t3 values (7,8), (1,2), (3,8);
+
+--error ER_BAD_FIELD_ERROR
+select * from
+(
+ select a,b from t1 where t1.a > 3
+ union
+ select a,b from t2 where t2.b < 6
+ order by (a - b / (select a + max(c) from t3 where d = x))
+) dt;
+
+drop table t1,t2,t3;
+
+--echo #
--echo # End of 10.3 tests
--echo #
@@ -1244,6 +1274,30 @@ SELECT a FROM t1 WHERE a IN ( 1, 1, 2, 194 );
drop table t1;
--echo #
+--echo # MDEV-31022: SIGSEGV in maria_create from create_internal_tmp_table
+--echo # keydef incorrectly allocated on the stack in create_internal_tmp_table()
+--echo #
+
+CREATE TABLE t1 (c CHAR(1) NULL) ENGINE=MyISAM;
+INSERT INTO t1 (c) VALUES (1);
+SET statement
+ optimizer_where_cost=1,
+ big_tables=1,
+ in_predicate_conversion_threshold=2
+FOR
+SELECT * FROM t1 WHERE c IN ('','');
+
+SET statement
+ optimizer_where_cost=1,
+ big_tables=1,
+ in_predicate_conversion_threshold=2,
+ sql_mode=''
+FOR
+SELECT * FROM t1 WHERE c IN ('','');
+
+DROP TABLE t1;
+
+--echo #
--echo # End of 11.0 tests
--echo #
diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result
index 544c8ace7b7..76f899edc96 100644
--- a/mysql-test/main/derived_cond_pushdown.result
+++ b/mysql-test/main/derived_cond_pushdown.result
@@ -22609,6 +22609,103 @@ id select_type table type possible_keys key key_len ref rows Extra
3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using temporary
drop view v1;
drop table t1;
+#
+# MDEV-31102: execution of PS for query where pushdown of condition
+# into view defined as union is applied
+#
+create table t1 (
+n int,
+lv varchar(31) charset latin1,
+mv varchar(31) charset utf8mb3
+) engine=myisam;
+insert into t1 values (1,'aa','xxx'), ('2','bb','yyy'), (3,'cc','zzz');
+create view v1 as
+select case when n=1 then lv when n=2 then mv else NULL end as r from t1
+union
+select 'a';
+select * from v1 where r < 'x';
+r
+aa
+a
+explain extended select * from v1 where r < 'x';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 100.00 Using where
+2 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+3 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select `v1`.`r` AS `r` from `test`.`v1` where `v1`.`r` < 'x'
+explain format=json select * from v1 where r < 'x';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.012461052,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "<derived2>",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 3,
+ "cost": 0.012461052,
+ "filtered": 100,
+ "attached_condition": "v1.r < 'x'",
+ "materialized": {
+ "query_block": {
+ "union_result": {
+ "table_name": "<union2,3>",
+ "access_type": "ALL",
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 2,
+ "cost": 0.010504815,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 3,
+ "cost": 0.010504815,
+ "filtered": 100,
+ "attached_condition": "case when t1.n = 1 then convert(t1.lv using utf8mb3) when t1.n = 2 then t1.mv else NULL end < 'x'"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 3,
+ "operation": "UNION",
+ "table": {
+ "message": "No tables used"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+}
+prepare stmt from "select * from v1 where r < 'x'";
+execute stmt;
+r
+aa
+a
+execute stmt;
+r
+aa
+a
+deallocate prepare stmt;
+drop view v1;
+drop table t1;
# End of 10.4 tests
#
# MDEV-28958: condition pushable into view after simplification
diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test
index d77e0210eae..5bd1489db78 100644
--- a/mysql-test/main/derived_cond_pushdown.test
+++ b/mysql-test/main/derived_cond_pushdown.test
@@ -4143,6 +4143,36 @@ explain select * from v1;
drop view v1;
drop table t1;
+--echo #
+--echo # MDEV-31102: execution of PS for query where pushdown of condition
+--echo # into view defined as union is applied
+--echo #
+
+create table t1 (
+ n int,
+ lv varchar(31) charset latin1,
+ mv varchar(31) charset utf8mb3
+) engine=myisam;
+insert into t1 values (1,'aa','xxx'), ('2','bb','yyy'), (3,'cc','zzz');
+create view v1 as
+select case when n=1 then lv when n=2 then mv else NULL end as r from t1
+union
+select 'a';
+
+let $q=
+select * from v1 where r < 'x';
+
+eval $q;
+eval explain extended $q;
+eval explain format=json $q;
+eval prepare stmt from "$q";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+drop view v1;
+drop table t1;
+
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/derived_split_innodb.result b/mysql-test/main/derived_split_innodb.result
index 9ea3d0f1396..f6d7cb02246 100644
--- a/mysql-test/main/derived_split_innodb.result
+++ b/mysql-test/main/derived_split_innodb.result
@@ -287,4 +287,589 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DERIVED t4 ALL NULL NULL NULL NULL 40 Using filesort
drop table t3, t4;
# End of 10.3 tests
+#
+# MDEV-26301: Split optimization refills temporary table too many times
+#
+create table t1(a int, b int);
+insert into t1 select seq,seq from seq_1_to_5;
+create table t2(a int, b int, key(a));
+insert into t2
+select A.seq,B.seq from seq_1_to_25 A, seq_1_to_2 B;
+create table t3(a int, b int, key(a));
+insert into t3
+select A.seq,B.seq from seq_1_to_5 A, seq_1_to_3 B;
+analyze table t1,t2,t3 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze status Table is already up to date
+test.t3 analyze status Engine-independent statistics collected
+test.t3 analyze status Table is already up to date
+explain
+select * from
+(t1 left join t2 on t2.a=t1.b) left join t3 on t3.a=t1.b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 5
+1 SIMPLE t2 ref a a 5 test.t1.b 2 Using where
+1 SIMPLE t3 ref a a 5 test.t1.b 3 Using where
+create table t10 (
+grp_id int,
+col1 int,
+key(grp_id)
+);
+insert into t10
+select
+A.seq,
+B.seq
+from
+seq_1_to_100 A,
+seq_1_to_100 B;
+create table t11 (
+col1 int,
+col2 int
+);
+insert into t11
+select A.seq, A.seq from seq_1_to_10 A;
+analyze table t10,t11 persistent for all;
+Table Op Msg_type Msg_text
+test.t10 analyze status Engine-independent statistics collected
+test.t10 analyze status Table is already up to date
+test.t11 analyze status Engine-independent statistics collected
+test.t11 analyze status OK
+explain select * from
+(
+(t1 left join t2 on t2.a=t1.b)
+left join t3 on t3.a=t1.b
+) left join (select grp_id, count(*)
+from t10 left join t11 on t11.col1=t10.col1
+group by grp_id) T on T.grp_id=t1.b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5
+1 PRIMARY t2 ref a a 5 test.t1.b 2 Using where
+1 PRIMARY t3 ref a a 5 test.t1.b 3 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.b 10 Using where
+2 LATERAL DERIVED t10 ref grp_id grp_id 5 test.t1.b 100
+2 LATERAL DERIVED t11 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
+# The important part in the below output is:
+# "lateral": 1,
+# "query_block": {
+# "select_id": 2,
+# "r_loops": 5, <-- must be 5, not 30.
+analyze format=json select * from
+(
+(t1 left join t2 on t2.a=t1.b)
+left join t3 on t3.a=t1.b
+) left join (select grp_id, count(*)
+from t10 left join t11 on t11.col1=t10.col1
+group by grp_id) T on T.grp_id=t1.b;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "const_condition": "1",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 5,
+ "r_rows": 5,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ref",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.t1.b"],
+ "loops": 5,
+ "r_loops": 5,
+ "rows": 2,
+ "r_rows": 2,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "attached_condition": "trigcond(trigcond(t1.b is not null))"
+ }
+ },
+ {
+ "table": {
+ "table_name": "t3",
+ "access_type": "ref",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.t1.b"],
+ "loops": 10,
+ "r_loops": 10,
+ "rows": 3,
+ "r_rows": 3,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "attached_condition": "trigcond(trigcond(t1.b is not null))"
+ }
+ },
+ {
+ "table": {
+ "table_name": "<derived2>",
+ "access_type": "ref",
+ "possible_keys": ["key0"],
+ "key": "key0",
+ "key_length": "5",
+ "used_key_parts": ["grp_id"],
+ "ref": ["test.t1.b"],
+ "loops": 30,
+ "r_loops": 30,
+ "rows": 10,
+ "r_rows": 1,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100,
+ "attached_condition": "trigcond(trigcond(t1.b is not null))",
+ "materialized": {
+ "lateral": 1,
+ "query_block": {
+ "select_id": 2,
+ "cost": "REPLACED",
+ "r_loops": 5,
+ "r_total_time_ms": "REPLACED",
+ "outer_ref_condition": "t1.b is not null",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t10",
+ "access_type": "ref",
+ "possible_keys": ["grp_id"],
+ "key": "grp_id",
+ "key_length": "5",
+ "used_key_parts": ["grp_id"],
+ "ref": ["test.t1.b"],
+ "loops": 1,
+ "r_loops": 5,
+ "rows": 100,
+ "r_rows": 100,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ }
+ },
+ {
+ "block-nl-join": {
+ "table": {
+ "table_name": "t11",
+ "access_type": "ALL",
+ "loops": 100,
+ "r_loops": 5,
+ "rows": 10,
+ "r_rows": 10,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ },
+ "buffer_type": "flat",
+ "buffer_size": "1Kb",
+ "join_type": "BNL",
+ "attached_condition": "trigcond(t11.col1 = t10.col1)",
+ "r_loops": 500,
+ "r_filtered": 10,
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 10
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ ]
+ }
+}
+create table t21 (pk int primary key);
+insert into t21 values (1),(2),(3);
+create table t22 (pk int primary key);
+insert into t22 values (1),(2),(3);
+explain
+select * from
+t21, t22,
+(
+(t1 left join t2 on t2.a=t1.b)
+left join t3 on t3.a=t1.b
+) left join (select grp_id, count(*)
+from t10 left join t11 on t11.col1=t10.col1
+group by grp_id) T on T.grp_id=t1.b
+where
+t21.pk=1 and t22.pk=2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t21 const PRIMARY PRIMARY 4 const 1 Using index
+1 PRIMARY t22 const PRIMARY PRIMARY 4 const 1 Using index
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5
+1 PRIMARY t2 ref a a 5 test.t1.b 2 Using where
+1 PRIMARY t3 ref a a 5 test.t1.b 3 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.b 10 Using where
+2 LATERAL DERIVED t10 ref grp_id grp_id 5 test.t1.b 100
+2 LATERAL DERIVED t11 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
+explain
+select * from
+t21,
+(
+(t1 left join t2 on t2.a=t1.b)
+left join t3 on t3.a=t1.b
+) left join (select grp_id, count(*)
+from
+t22 join t10 left join t11 on t11.col1=t10.col1
+where
+t22.pk=1
+group by grp_id) T on T.grp_id=t1.b
+where
+t21.pk=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t21 const PRIMARY PRIMARY 4 const 1 Using index
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5
+1 PRIMARY t2 ref a a 5 test.t1.b 2 Using where
+1 PRIMARY t3 ref a a 5 test.t1.b 3 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.b 10 Using where
+2 LATERAL DERIVED t22 const PRIMARY PRIMARY 4 const 1 Using index
+2 LATERAL DERIVED t10 ref grp_id grp_id 5 test.t1.b 100
+2 LATERAL DERIVED t11 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
+create table t5 (
+pk int primary key
+);
+insert into t5 select seq from seq_1_to_1000;
+explain
+select * from
+t21,
+(
+(((t1 join t5 on t5.pk=t1.b)) left join t2 on t2.a=t1.b)
+left join t3 on t3.a=t1.b
+) left join (select grp_id, count(*)
+from
+t22 join t10 left join t11 on t11.col1=t10.col1
+where
+t22.pk=1
+group by grp_id) T on T.grp_id=t1.b
+where
+t21.pk=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t21 const PRIMARY PRIMARY 4 const 1 Using index
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where
+1 PRIMARY t5 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 Using index
+1 PRIMARY t2 ref a a 5 test.t1.b 2
+1 PRIMARY t3 ref a a 5 test.t1.b 3
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.b 10 Using where
+2 LATERAL DERIVED t22 const PRIMARY PRIMARY 4 const 1 Using index
+2 LATERAL DERIVED t10 ref grp_id grp_id 5 test.t5.pk 100 Using index condition
+2 LATERAL DERIVED t11 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
+drop table t1,t2,t3,t5, t10, t11, t21, t22;
+create table t1(a int, b int);
+insert into t1 select seq,seq from seq_1_to_5;
+create table t2(a int, b int, key(a));
+insert into t2
+select A.seq,B.seq from seq_1_to_25 A, seq_1_to_2 B;
+create table t3(a int, b int, key(a));
+insert into t3
+select A.seq,B.seq from seq_1_to_5 A, seq_1_to_3 B;
+analyze table t1,t2,t3 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze status Table is already up to date
+test.t3 analyze status Engine-independent statistics collected
+test.t3 analyze status Table is already up to date
+create table t10 (
+grp_id int,
+col1 int,
+key(grp_id)
+);
+insert into t10
+select
+A.seq,
+B.seq
+from
+seq_1_to_100 A,
+seq_1_to_100 B;
+create table t11 (
+col1 int,
+col2 int
+);
+insert into t11
+select A.seq, A.seq from seq_1_to_10 A;
+analyze table t10,t11 persistent for all;
+Table Op Msg_type Msg_text
+test.t10 analyze status Engine-independent statistics collected
+test.t10 analyze status Table is already up to date
+test.t11 analyze status Engine-independent statistics collected
+test.t11 analyze status OK
+explain select *
+from
+(
+(t1 left join t2 on t2.a=t1.b)
+left join
+t3
+on t3.a=t1.b
+)
+left join
+(
+select grp_id, count(*)
+from t10 left join t11 on t11.col1=t10.col1
+group by grp_id
+)dt
+on dt.grp_id=t1.b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5
+1 PRIMARY t2 ref a a 5 test.t1.b 2 Using where
+1 PRIMARY t3 ref a a 5 test.t1.b 3 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.b 10 Using where
+2 LATERAL DERIVED t10 ref grp_id grp_id 5 test.t1.b 100
+2 LATERAL DERIVED t11 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
+select *
+from
+(
+(t1 left join t2 on t2.a=t1.b)
+left join
+t3
+on t3.a=t1.b
+)
+left join
+(
+select grp_id, count(*)
+from t10 left join t11 on t11.col1=t10.col1
+group by grp_id
+)dt
+on dt.grp_id=t1.b;
+a b a b a b grp_id count(*)
+1 1 1 1 1 1 1 100
+1 1 1 1 1 2 1 100
+1 1 1 1 1 3 1 100
+1 1 1 2 1 1 1 100
+1 1 1 2 1 2 1 100
+1 1 1 2 1 3 1 100
+2 2 2 1 2 1 2 100
+2 2 2 1 2 2 2 100
+2 2 2 1 2 3 2 100
+2 2 2 2 2 1 2 100
+2 2 2 2 2 2 2 100
+2 2 2 2 2 3 2 100
+3 3 3 1 3 1 3 100
+3 3 3 1 3 2 3 100
+3 3 3 1 3 3 3 100
+3 3 3 2 3 1 3 100
+3 3 3 2 3 2 3 100
+3 3 3 2 3 3 3 100
+4 4 4 1 4 1 4 100
+4 4 4 1 4 2 4 100
+4 4 4 1 4 3 4 100
+4 4 4 2 4 1 4 100
+4 4 4 2 4 2 4 100
+4 4 4 2 4 3 4 100
+5 5 5 1 5 1 5 100
+5 5 5 1 5 2 5 100
+5 5 5 1 5 3 5 100
+5 5 5 2 5 1 5 100
+5 5 5 2 5 2 5 100
+5 5 5 2 5 3 5 100
+set join_cache_level=4;
+set optimizer_trace=1;
+set @tmp=@@optimizer_switch, optimizer_switch='hash_join_cardinality=off';
+insert into t11
+select A.seq, A.seq from seq_11_to_100 A;
+analyze table t11 persistent for all;
+Table Op Msg_type Msg_text
+test.t11 analyze status Engine-independent statistics collected
+test.t11 analyze status OK
+explain select *
+from
+(
+(t1 left join t2 on t2.a=t1.b)
+left join
+t3
+on t3.a=t1.b
+)
+left join
+(
+select grp_id, count(*)
+from t10 left join t11 on t11.col1=t10.col1
+group by grp_id
+)dt
+on dt.grp_id=t1.b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5
+1 PRIMARY t2 ref a a 5 test.t1.b 2 Using where
+1 PRIMARY t3 ref a a 5 test.t1.b 3 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.b 10 Using where
+2 LATERAL DERIVED t10 ref grp_id grp_id 5 test.t1.b 100
+2 LATERAL DERIVED t11 hash_ALL NULL #hash#$hj 5 test.t10.col1 100 Using where; Using join buffer (flat, BNLH join)
+select *
+from
+(
+(t1 left join t2 on t2.a=t1.b)
+left join
+t3
+on t3.a=t1.b
+)
+left join
+(
+select grp_id, count(*)
+from t10 left join t11 on t11.col1=t10.col1
+group by grp_id
+)dt
+on dt.grp_id=t1.b;
+a b a b a b grp_id count(*)
+1 1 1 1 1 1 1 100
+1 1 1 1 1 2 1 100
+1 1 1 1 1 3 1 100
+1 1 1 2 1 1 1 100
+1 1 1 2 1 2 1 100
+1 1 1 2 1 3 1 100
+2 2 2 1 2 1 2 100
+2 2 2 1 2 2 2 100
+2 2 2 1 2 3 2 100
+2 2 2 2 2 1 2 100
+2 2 2 2 2 2 2 100
+2 2 2 2 2 3 2 100
+3 3 3 1 3 1 3 100
+3 3 3 1 3 2 3 100
+3 3 3 1 3 3 3 100
+3 3 3 2 3 1 3 100
+3 3 3 2 3 2 3 100
+3 3 3 2 3 3 3 100
+4 4 4 1 4 1 4 100
+4 4 4 1 4 2 4 100
+4 4 4 1 4 3 4 100
+4 4 4 2 4 1 4 100
+4 4 4 2 4 2 4 100
+4 4 4 2 4 3 4 100
+5 5 5 1 5 1 5 100
+5 5 5 1 5 2 5 100
+5 5 5 1 5 3 5 100
+5 5 5 2 5 1 5 100
+5 5 5 2 5 2 5 100
+5 5 5 2 5 3 5 100
+set optimizer_switch=@tmp;
+set join_cache_level=default;
+delete from t11;
+insert into t11 select A.seq, A.seq from seq_1_to_10 A;
+analyze table t11 persistent for all;
+Table Op Msg_type Msg_text
+test.t11 analyze status Engine-independent statistics collected
+test.t11 analyze status OK
+drop index a on t2;
+drop index a on t3;
+explain select *
+from
+(
+(t1 left join t2 on t2.a=t1.b)
+left join
+t3
+on t3.a=t1.b
+)
+left join
+(
+select grp_id, count(*)
+from t10 left join t11 on t11.col1=t10.col1
+group by grp_id
+)dt
+on dt.grp_id=t1.b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5
+1 PRIMARY t2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 15 Using where; Using join buffer (incremental, BNL join)
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.b 1000 Using where
+2 DERIVED t10 ALL grp_id NULL NULL NULL 10000 Using temporary; Using filesort
+2 DERIVED t11 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
+select *
+from
+(
+(t1 left join t2 on t2.a=t1.b)
+left join
+t3
+on t3.a=t1.b
+)
+left join
+(
+select grp_id, count(*)
+from t10 left join t11 on t11.col1=t10.col1
+group by grp_id
+)dt
+on dt.grp_id=t1.b;
+a b a b a b grp_id count(*)
+1 1 1 1 1 1 1 100
+1 1 1 2 1 1 1 100
+1 1 1 1 1 2 1 100
+1 1 1 2 1 2 1 100
+1 1 1 1 1 3 1 100
+1 1 1 2 1 3 1 100
+2 2 2 1 2 1 2 100
+2 2 2 2 2 1 2 100
+2 2 2 1 2 2 2 100
+2 2 2 2 2 2 2 100
+2 2 2 1 2 3 2 100
+2 2 2 2 2 3 2 100
+3 3 3 1 3 1 3 100
+3 3 3 2 3 1 3 100
+3 3 3 1 3 2 3 100
+3 3 3 2 3 2 3 100
+3 3 3 1 3 3 3 100
+3 3 3 2 3 3 3 100
+4 4 4 1 4 1 4 100
+4 4 4 2 4 1 4 100
+4 4 4 1 4 2 4 100
+4 4 4 2 4 2 4 100
+4 4 4 1 4 3 4 100
+4 4 4 2 4 3 4 100
+5 5 5 1 5 1 5 100
+5 5 5 2 5 1 5 100
+5 5 5 1 5 2 5 100
+5 5 5 2 5 2 5 100
+5 5 5 1 5 3 5 100
+5 5 5 2 5 3 5 100
+drop table t1,t2,t3;
+drop table t10, t11;
+#
+# MDEV-31194: Server crash or assertion failure with join_cache_level=4
+# (a followup to the above bug, MDEV-26301)
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (3),(4);
+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=Aria;
+INSERT INTO t2 VALUES (1),(2);
+set @tmp1= @@optimizer_switch, @tmp2= @@join_cache_level;
+set
+optimizer_switch= 'derived_with_keys=off',
+join_cache_level= 4;
+SELECT t1.* FROM t1 JOIN (SELECT id, COUNT(*) FROM t2 GROUP BY id) sq ON sq.id= t1.a;
+a
+set optimizer_switch= @tmp1, join_cache_level= @tmp2;
+DROP TABLE t1, t2;
+# End of 10.4 tests
SET GLOBAL innodb_stats_persistent=@save_innodb_stats_persistent;
diff --git a/mysql-test/main/derived_split_innodb.test b/mysql-test/main/derived_split_innodb.test
index 86a2b6d73b0..e7c5cc8f274 100644
--- a/mysql-test/main/derived_split_innodb.test
+++ b/mysql-test/main/derived_split_innodb.test
@@ -233,4 +233,251 @@ drop table t3, t4;
--echo # End of 10.3 tests
+
+--echo #
+--echo # MDEV-26301: Split optimization refills temporary table too many times
+--echo #
+
+# 5 values
+create table t1(a int, b int);
+insert into t1 select seq,seq from seq_1_to_5;
+
+# 5 value groups of size 2 each
+create table t2(a int, b int, key(a));
+insert into t2
+select A.seq,B.seq from seq_1_to_25 A, seq_1_to_2 B;
+
+# 5 value groups of size 3 each
+create table t3(a int, b int, key(a));
+insert into t3
+select A.seq,B.seq from seq_1_to_5 A, seq_1_to_3 B;
+
+analyze table t1,t2,t3 persistent for all;
+
+explain
+select * from
+ (t1 left join t2 on t2.a=t1.b) left join t3 on t3.a=t1.b;
+
+# Now, create tables for Groups.
+
+create table t10 (
+ grp_id int,
+ col1 int,
+ key(grp_id)
+);
+
+# 100 groups of 100 values each
+insert into t10
+select
+ A.seq,
+ B.seq
+from
+ seq_1_to_100 A,
+ seq_1_to_100 B;
+
+# and X10 multiplier
+
+create table t11 (
+ col1 int,
+ col2 int
+);
+insert into t11
+select A.seq, A.seq from seq_1_to_10 A;
+
+analyze table t10,t11 persistent for all;
+
+let $q1=
+select * from
+ (
+ (t1 left join t2 on t2.a=t1.b)
+ left join t3 on t3.a=t1.b
+ ) left join (select grp_id, count(*)
+ from t10 left join t11 on t11.col1=t10.col1
+ group by grp_id) T on T.grp_id=t1.b;
+
+eval
+explain $q1;
+
+--echo # The important part in the below output is:
+--echo # "lateral": 1,
+--echo # "query_block": {
+--echo # "select_id": 2,
+--echo # "r_loops": 5, <-- must be 5, not 30.
+--source include/analyze-format.inc
+
+eval
+analyze format=json $q1;
+
+create table t21 (pk int primary key);
+insert into t21 values (1),(2),(3);
+
+create table t22 (pk int primary key);
+insert into t22 values (1),(2),(3);
+
+# Same as above but throw in a couple of const tables.
+explain
+select * from
+ t21, t22,
+ (
+ (t1 left join t2 on t2.a=t1.b)
+ left join t3 on t3.a=t1.b
+ ) left join (select grp_id, count(*)
+ from t10 left join t11 on t11.col1=t10.col1
+ group by grp_id) T on T.grp_id=t1.b
+where
+ t21.pk=1 and t22.pk=2;
+
+explain
+select * from
+ t21,
+ (
+ (t1 left join t2 on t2.a=t1.b)
+ left join t3 on t3.a=t1.b
+ ) left join (select grp_id, count(*)
+ from
+ t22 join t10 left join t11 on t11.col1=t10.col1
+ where
+ t22.pk=1
+ group by grp_id) T on T.grp_id=t1.b
+where
+ t21.pk=1;
+
+# And also add a non-const table
+
+create table t5 (
+ pk int primary key
+ );
+insert into t5 select seq from seq_1_to_1000;
+
+explain
+select * from
+ t21,
+ (
+ (((t1 join t5 on t5.pk=t1.b)) left join t2 on t2.a=t1.b)
+ left join t3 on t3.a=t1.b
+ ) left join (select grp_id, count(*)
+ from
+ t22 join t10 left join t11 on t11.col1=t10.col1
+ where
+ t22.pk=1
+ group by grp_id) T on T.grp_id=t1.b
+where
+ t21.pk=1;
+
+drop table t1,t2,t3,t5, t10, t11, t21, t22;
+
+# 5 values
+create table t1(a int, b int);
+insert into t1 select seq,seq from seq_1_to_5;
+
+# 5 value groups of size 2 each
+create table t2(a int, b int, key(a));
+insert into t2
+select A.seq,B.seq from seq_1_to_25 A, seq_1_to_2 B;
+
+# 5 value groups of size 3 each
+create table t3(a int, b int, key(a));
+insert into t3
+select A.seq,B.seq from seq_1_to_5 A, seq_1_to_3 B;
+
+analyze table t1,t2,t3 persistent for all;
+
+create table t10 (
+ grp_id int,
+ col1 int,
+ key(grp_id)
+);
+
+# 100 groups of 100 values each
+insert into t10
+select
+ A.seq,
+ B.seq
+from
+ seq_1_to_100 A,
+ seq_1_to_100 B;
+
+# and X10 multiplier
+
+create table t11 (
+ col1 int,
+ col2 int
+);
+insert into t11
+select A.seq, A.seq from seq_1_to_10 A;
+
+analyze table t10,t11 persistent for all;
+
+let $q=
+select *
+from
+ (
+ (t1 left join t2 on t2.a=t1.b)
+ left join
+ t3
+ on t3.a=t1.b
+ )
+ left join
+ (
+ select grp_id, count(*)
+ from t10 left join t11 on t11.col1=t10.col1
+ group by grp_id
+ )dt
+ on dt.grp_id=t1.b;
+
+eval explain $q;
+eval $q;
+
+set join_cache_level=4;
+set optimizer_trace=1;
+set @tmp=@@optimizer_switch, optimizer_switch='hash_join_cardinality=off';
+# Need table t11 to be larger in 11.0:
+insert into t11
+select A.seq, A.seq from seq_11_to_100 A;
+analyze table t11 persistent for all;
+
+eval explain $q;
+eval $q;
+
+set optimizer_switch=@tmp;
+set join_cache_level=default;
+
+delete from t11;
+insert into t11 select A.seq, A.seq from seq_1_to_10 A;
+analyze table t11 persistent for all;
+
+drop index a on t2;
+drop index a on t3;
+
+eval explain $q;
+eval $q;
+
+drop table t1,t2,t3;
+drop table t10, t11;
+
+
+--echo #
+--echo # MDEV-31194: Server crash or assertion failure with join_cache_level=4
+--echo # (a followup to the above bug, MDEV-26301)
+--echo #
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (3),(4);
+
+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=Aria;
+INSERT INTO t2 VALUES (1),(2);
+
+set @tmp1= @@optimizer_switch, @tmp2= @@join_cache_level;
+set
+ optimizer_switch= 'derived_with_keys=off',
+ join_cache_level= 4;
+
+SELECT t1.* FROM t1 JOIN (SELECT id, COUNT(*) FROM t2 GROUP BY id) sq ON sq.id= t1.a;
+
+set optimizer_switch= @tmp1, join_cache_level= @tmp2;
+
+# Cleanup
+DROP TABLE t1, t2;
+
+--echo # End of 10.4 tests
+
SET GLOBAL innodb_stats_persistent=@save_innodb_stats_persistent;
diff --git a/mysql-test/main/derived_view.result b/mysql-test/main/derived_view.result
index aa7519ae750..75c92b23089 100644
--- a/mysql-test/main/derived_view.result
+++ b/mysql-test/main/derived_view.result
@@ -3828,3 +3828,553 @@ drop procedure sp2;
drop view v, v2;
drop table t1,t2;
# End of 10.2 tests
+#
+# MDEV-30706: view defined as select with implicit grouping and
+# a set function used in a subquery
+#
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
+INSERT INTO t1 VALUES (1,1), (2,2);
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT);
+INSERT INTO t2 VALUES (1,1), (3,3);
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT);
+INSERT INTO t3 VALUES (2,2), (4,4), (7,7);
+CREATE TABLE t4 (a INT PRIMARY KEY, b INT);
+INSERT INTO t4 VALUES (2,2), (5,5), (7,7);
+CREATE VIEW v AS SELECT
+(SELECT SUM(t4.b) FROM t1, t2 WHERE t1.a = t2.b GROUP BY t1.a) AS m
+FROM t3, t4
+WHERE t3.a = t4.b;
+SELECT
+(SELECT SUM(t4.b) FROM t1, t2 WHERE t1.a = t2.b GROUP BY t1.a) AS m
+FROM t3, t4
+WHERE t3.a = t4.b;
+m
+9
+SELECT * FROM v;
+m
+9
+WITH cte AS ( SELECT
+(SELECT SUM(t4.b) FROM t1, t2 WHERE t1.a = t2.b GROUP BY t1.a) AS m
+FROM t3, t4
+WHERE t3.a = t4.b ) SELECT * FROM cte;
+m
+9
+EXPLAIN SELECT
+(SELECT SUM(t4.b) FROM t1, t2 WHERE t1.a = t2.b GROUP BY t1.a) AS m
+FROM t3, t4
+WHERE t3.a = t4.b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where
+1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.b 1 Using index
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 Using index
+EXPLAIN SELECT * FROM v;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3
+2 SUBQUERY t4 ALL NULL NULL NULL NULL 3 Using where
+2 SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 test.t4.b 1 Using index
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+3 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 Using index
+EXPLAIN WITH cte AS ( SELECT
+(SELECT SUM(t4.b) FROM t1, t2 WHERE t1.a = t2.b GROUP BY t1.a) AS m
+FROM t3, t4
+WHERE t3.a = t4.b ) SELECT * FROM cte;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3
+2 DERIVED t4 ALL NULL NULL NULL NULL 3 Using where
+2 DERIVED t3 eq_ref PRIMARY PRIMARY 4 test.t4.b 1 Using index
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
+3 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 Using index
+PREPARE stmt FROM "SELECT
+(SELECT SUM(t4.b) FROM t1, t2 WHERE t1.a = t2.b GROUP BY t1.a) AS m
+FROM t3, t4
+WHERE t3.a = t4.b";
+execute stmt;
+m
+9
+execute stmt;
+m
+9
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM "SELECT * FROM v";
+execute stmt;
+m
+9
+execute stmt;
+m
+9
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM "WITH cte AS ( SELECT
+(SELECT SUM(t4.b) FROM t1, t2 WHERE t1.a = t2.b GROUP BY t1.a) AS m
+FROM t3, t4
+WHERE t3.a = t4.b ) SELECT * FROM cte";
+execute stmt;
+m
+9
+execute stmt;
+m
+9
+DEALLOCATE PREPARE stmt;
+DROP VIEW v;
+DROP TABLE t1,t2,t3,t4;
+#
+# MDEV-29224: view defined as select with implicit grouping and
+# a set function used in a subquery
+#
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (f2 int);
+INSERT INTO t2 VALUES (3);
+CREATE VIEW v AS SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1;
+SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1;
+( SELECT MAX(f1) FROM t2 )
+2
+SELECT * FROM v;
+( SELECT MAX(f1) FROM t2 )
+2
+WITH cte AS ( SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1 ) SELECT * FROM cte;
+( SELECT MAX(f1) FROM t2 )
+2
+EXPLAIN SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2
+2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1
+EXPLAIN SELECT * FROM v;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
+2 SUBQUERY t1 ALL NULL NULL NULL NULL 2
+3 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1
+EXPLAIN WITH cte AS ( SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1 ) SELECT * FROM cte;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
+2 DERIVED t1 ALL NULL NULL NULL NULL 2
+3 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1
+PREPARE stmt FROM "SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1";
+execute stmt;
+( SELECT MAX(f1) FROM t2 )
+2
+execute stmt;
+( SELECT MAX(f1) FROM t2 )
+2
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM "SELECT * FROM v";
+execute stmt;
+( SELECT MAX(f1) FROM t2 )
+2
+execute stmt;
+( SELECT MAX(f1) FROM t2 )
+2
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM "WITH cte AS ( SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1 ) SELECT * FROM cte";
+execute stmt;
+( SELECT MAX(f1) FROM t2 )
+2
+execute stmt;
+( SELECT MAX(f1) FROM t2 )
+2
+DEALLOCATE PREPARE stmt;
+DROP VIEW v;
+DROP TABLE t1,t2;
+#
+# MDEV-28573: view defined as select with implicit grouping and
+# a set function used in a subquery
+#
+CREATE TABLE t1 (a INTEGER, b INTEGER);
+CREATE TABLE t2 (c INTEGER);
+INSERT INTO t1 VALUES (1,11), (2,22), (2,22);
+INSERT INTO t2 VALUES (1), (2);
+CREATE VIEW v1 AS SELECT (SELECT COUNT(b) FROM t2) FROM t1;
+CREATE VIEW v2 AS SELECT (SELECT COUNT(b) FROM t2 WHERE c > 1) FROM t1;
+SELECT (SELECT COUNT(b) FROM t2) FROM t1;
+ERROR 21000: Subquery returns more than 1 row
+SELECT * FROM v1;
+ERROR 21000: Subquery returns more than 1 row
+WITH cte AS ( SELECT (SELECT COUNT(b) FROM t2) FROM t1 ) SELECT * FROM cte;
+ERROR 21000: Subquery returns more than 1 row
+SELECT (SELECT COUNT(b) FROM t2 WHERE c > 1) FROM t1;
+(SELECT COUNT(b) FROM t2 WHERE c > 1)
+3
+SELECT * FROM v2;
+(SELECT COUNT(b) FROM t2 WHERE c > 1)
+3
+WITH cte AS ( SELECT (SELECT COUNT(b) FROM t2 WHERE c > 1) FROM t1 ) SELECT * FROM cte;
+(SELECT COUNT(b) FROM t2 WHERE c > 1)
+3
+EXPLAIN SELECT (SELECT COUNT(b) FROM t2) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2
+EXPLAIN SELECT * FROM v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3
+2 SUBQUERY t1 ALL NULL NULL NULL NULL 3
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2
+EXPLAIN WITH cte AS ( SELECT (SELECT COUNT(b) FROM t2) FROM t1 ) SELECT * FROM cte;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3
+2 DERIVED t1 ALL NULL NULL NULL NULL 3
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2
+PREPARE stmt FROM "SELECT (SELECT COUNT(b) FROM t2) FROM t1";
+execute stmt;
+ERROR 21000: Subquery returns more than 1 row
+execute stmt;
+ERROR 21000: Subquery returns more than 1 row
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM "SELECT * FROM v1";
+execute stmt;
+ERROR 21000: Subquery returns more than 1 row
+execute stmt;
+ERROR 21000: Subquery returns more than 1 row
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM "WITH cte AS ( SELECT (SELECT COUNT(b) FROM t2) FROM t1 ) SELECT * FROM cte";
+execute stmt;
+ERROR 21000: Subquery returns more than 1 row
+execute stmt;
+ERROR 21000: Subquery returns more than 1 row
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM "SELECT (SELECT COUNT(b) FROM t2 WHERE c > 1) FROM t1";
+execute stmt;
+(SELECT COUNT(b) FROM t2 WHERE c > 1)
+3
+execute stmt;
+(SELECT COUNT(b) FROM t2 WHERE c > 1)
+3
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM "SELECT * FROM v2";
+execute stmt;
+(SELECT COUNT(b) FROM t2 WHERE c > 1)
+3
+execute stmt;
+(SELECT COUNT(b) FROM t2 WHERE c > 1)
+3
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM "WITH cte AS ( SELECT (SELECT COUNT(b) FROM t2 WHERE c > 1) FROM t1 ) SELECT * FROM cte";
+execute stmt;
+(SELECT COUNT(b) FROM t2 WHERE c > 1)
+3
+execute stmt;
+(SELECT COUNT(b) FROM t2 WHERE c > 1)
+3
+DEALLOCATE PREPARE stmt;
+DROP VIEW v1,v2;
+DROP TABLE t1,t2;
+#
+# MDEV-28570: VIEW with WHERE containing subquery
+# with set function aggregated in query
+#
+CREATE TABLE t1 (a int, b int);
+CREATE TABLE t2 (c int, d int);
+INSERT INTO t1 VALUES
+(1,10), (2,10), (1,20), (2,20), (3,20), (2,30), (4,40);
+INSERT INTO t2 VALUES
+(2,10), (2,20), (4,10), (5,10), (3,20), (2,40);
+CREATE VIEW v AS SELECT a FROM t1 GROUP BY a
+HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20);
+SELECT a FROM t1 GROUP BY a
+HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20);
+a
+2
+4
+SELECT * FROM v;
+a
+2
+4
+WITH cte AS ( SELECT a FROM t1 GROUP BY a
+HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20) ) SELECT * FROM cte;
+a
+2
+4
+EXPLAIN SELECT a FROM t1 GROUP BY a
+HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 7 Using temporary; Using filesort
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 6
+EXPLAIN SELECT * FROM v;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 7
+2 DERIVED t1 ALL NULL NULL NULL NULL 7 Using temporary; Using filesort
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 6
+EXPLAIN WITH cte AS ( SELECT a FROM t1 GROUP BY a
+HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20) ) SELECT * FROM cte;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 7
+2 DERIVED t1 ALL NULL NULL NULL NULL 7 Using temporary; Using filesort
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 6
+PREPARE stmt FROM "SELECT a FROM t1 GROUP BY a
+HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20)";
+execute stmt;
+a
+2
+4
+execute stmt;
+a
+2
+4
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM "SELECT * FROM v";
+execute stmt;
+a
+2
+4
+execute stmt;
+a
+2
+4
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM "WITH cte AS ( SELECT a FROM t1 GROUP BY a
+HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20) ) SELECT * FROM cte";
+execute stmt;
+a
+2
+4
+execute stmt;
+a
+2
+4
+DEALLOCATE PREPARE stmt;
+DROP VIEW v;
+DROP TABLE t1,t2;
+#
+# MDEV-28571: VIEW with select list containing subquery
+# with set function aggregated in query
+#
+CREATE TABLE t1 (a int, b int);
+CREATE TABLE t2 (m int, n int);
+INSERT INTO t1 VALUES (2,2), (2,2), (3,3), (3,3), (3,3), (4,4);
+INSERT INTO t2 VALUES (1,11), (2,22), (3,32), (4,44), (4,44);
+CREATE VIEW v AS SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c
+FROM t1
+GROUP BY a;
+SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c
+FROM t1
+GROUP BY a;
+c
+2
+3
+1,1
+SELECT * FROM v;
+c
+2
+3
+1,1
+WITH cte AS ( SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c
+FROM t1
+GROUP BY a ) SELECT * FROM cte;
+c
+2
+3
+1,1
+EXPLAIN SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c
+FROM t1
+GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 Using where
+EXPLAIN SELECT * FROM v;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 6
+2 DERIVED t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 Using where
+EXPLAIN WITH cte AS ( SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c
+FROM t1
+GROUP BY a ) SELECT * FROM cte;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 6
+2 DERIVED t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 Using where
+PREPARE stmt FROM "SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c
+FROM t1
+GROUP BY a";
+execute stmt;
+c
+2
+3
+1,1
+execute stmt;
+c
+2
+3
+1,1
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM "SELECT * FROM v";
+execute stmt;
+c
+2
+3
+1,1
+execute stmt;
+c
+2
+3
+1,1
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM "WITH cte AS ( SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c
+FROM t1
+GROUP BY a ) SELECT * FROM cte";
+execute stmt;
+c
+2
+3
+1,1
+execute stmt;
+c
+2
+3
+1,1
+DEALLOCATE PREPARE stmt;
+DROP VIEW v;
+DROP TABLE t1,t2;
+#
+# MDEV-30668: VIEW with WHERE containing nested subquery
+# with set function aggregated in outer subquery
+#
+create table t1 (a int);
+insert into t1 values (3), (7), (1);
+create table t2 (b int);
+insert into t2 values (2), (1), (4), (7);
+create table t3 (a int, b int);
+insert into t3 values (2,10), (7,30), (2,30), (1,10), (7,40);
+create view v as select * from t1
+where t1.a in (select t3.a from t3 group by t3.a
+having t3.a > any (select t2.b from t2
+where t2.b*10 < sum(t3.b)));
+select * from t1
+where t1.a in (select t3.a from t3 group by t3.a
+having t3.a > any (select t2.b from t2
+where t2.b*10 < sum(t3.b)));
+a
+7
+select * from v;
+a
+7
+with cte as ( select * from t1
+where t1.a in (select t3.a from t3 group by t3.a
+having t3.a > any (select t2.b from t2
+where t2.b*10 < sum(t3.b))) ) select * from cte;
+a
+7
+explain select * from t1
+where t1.a in (select t3.a from t3 group by t3.a
+having t3.a > any (select t2.b from t2
+where t2.b*10 < sum(t3.b)));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1.a 1
+2 MATERIALIZED t3 ALL NULL NULL NULL NULL 5 Using temporary
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 4 Using where
+explain select * from v;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
+1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 test.t1.a 1
+3 MATERIALIZED t3 ALL NULL NULL NULL NULL 5 Using temporary
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 4 Using where
+explain with cte as ( select * from t1
+where t1.a in (select t3.a from t3 group by t3.a
+having t3.a > any (select t2.b from t2
+where t2.b*10 < sum(t3.b))) ) select * from cte;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
+1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 test.t1.a 1
+3 MATERIALIZED t3 ALL NULL NULL NULL NULL 5 Using temporary
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 4 Using where
+prepare stmt from "select * from t1
+where t1.a in (select t3.a from t3 group by t3.a
+having t3.a > any (select t2.b from t2
+where t2.b*10 < sum(t3.b)))";
+execute stmt;
+a
+7
+execute stmt;
+a
+7
+deallocate prepare stmt;
+prepare stmt from "select * from v";
+execute stmt;
+a
+7
+execute stmt;
+a
+7
+deallocate prepare stmt;
+prepare stmt from "with cte as ( select * from t1
+where t1.a in (select t3.a from t3 group by t3.a
+having t3.a > any (select t2.b from t2
+where t2.b*10 < sum(t3.b))) ) select * from cte";
+execute stmt;
+a
+7
+execute stmt;
+a
+7
+deallocate prepare stmt;
+drop view v;
+drop table t1,t2,t3;
+# End of 10.4 tests
+#
+# MDEV-31143: view with ORDER BY used in query with rownum() in WHERE
+#
+create table t1 (id int primary key);
+insert into t1 values (3), (7), (1);
+create table t2 (a int);
+insert into t2 values (2), (4);
+create view v as select a from t2 order by a;
+set big_tables= 1;
+Warnings:
+Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
+select t1.id from v, t1 where rownum() = 1 group by t1.id;
+id
+1
+set big_tables=default;
+Warnings:
+Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
+drop view v;
+drop table t1, t2;
+#
+# MDEV-31162: multi-table mergeable view with ORDER BY used
+# in query with rownum() in WHERE
+#
+create table t1 (a INT) engine=MyISAM;
+insert into t1 values (1),(2);
+create table t2 (b INT) engine=MyISAM;
+insert into t2 values (3),(4);
+create view v1 AS select * from t1 join t2 order by b;
+explain select * from v1 where rownum() <= 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+select * from v1 where rownum() <= 2;
+a b
+1 3
+2 3
+prepare stmt from "select * from v1 where rownum() <= 2";
+execute stmt;
+a b
+1 3
+2 3
+execute stmt;
+a b
+1 3
+2 3
+deallocate prepare stmt;
+create view v2 AS select * from t1 join t2 order by b/a;
+explain select * from v2 where rownum() <= 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+select * from v2 where rownum() <= 2;
+a b
+2 3
+1 3
+prepare stmt from "select * from v2 where rownum() <= 2";
+execute stmt;
+a b
+2 3
+1 3
+execute stmt;
+a b
+2 3
+1 3
+deallocate prepare stmt;
+drop view v1,v2;
+drop table t1,t2;
+# End of 10.6 tests
diff --git a/mysql-test/main/derived_view.test b/mysql-test/main/derived_view.test
index 13444676659..379c58cc73c 100644
--- a/mysql-test/main/derived_view.test
+++ b/mysql-test/main/derived_view.test
@@ -2463,3 +2463,362 @@ drop view v, v2;
drop table t1,t2;
--echo # End of 10.2 tests
+
+--echo #
+--echo # MDEV-30706: view defined as select with implicit grouping and
+--echo # a set function used in a subquery
+--echo #
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
+INSERT INTO t1 VALUES (1,1), (2,2);
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT);
+INSERT INTO t2 VALUES (1,1), (3,3);
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT);
+INSERT INTO t3 VALUES (2,2), (4,4), (7,7);
+CREATE TABLE t4 (a INT PRIMARY KEY, b INT);
+INSERT INTO t4 VALUES (2,2), (5,5), (7,7);
+
+let $q=
+SELECT
+ (SELECT SUM(t4.b) FROM t1, t2 WHERE t1.a = t2.b GROUP BY t1.a) AS m
+FROM t3, t4
+ WHERE t3.a = t4.b;
+
+eval CREATE VIEW v AS $q;
+
+eval $q;
+SELECT * FROM v;
+eval WITH cte AS ( $q ) SELECT * FROM cte;
+
+eval EXPLAIN $q;
+EXPLAIN SELECT * FROM v;
+eval EXPLAIN WITH cte AS ( $q ) SELECT * FROM cte;
+
+eval PREPARE stmt FROM "$q";
+execute stmt;
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+eval PREPARE stmt FROM "SELECT * FROM v";
+execute stmt;
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+eval PREPARE stmt FROM "WITH cte AS ( $q ) SELECT * FROM cte";
+execute stmt;
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+DROP VIEW v;
+DROP TABLE t1,t2,t3,t4;
+
+--echo #
+--echo # MDEV-29224: view defined as select with implicit grouping and
+--echo # a set function used in a subquery
+--echo #
+
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (f2 int);
+INSERT INTO t2 VALUES (3);
+
+let $q=
+SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1;
+
+eval CREATE VIEW v AS $q;
+
+eval $q;
+SELECT * FROM v;
+eval WITH cte AS ( $q ) SELECT * FROM cte;
+
+eval EXPLAIN $q;
+EXPLAIN SELECT * FROM v;
+eval EXPLAIN WITH cte AS ( $q ) SELECT * FROM cte;
+
+eval PREPARE stmt FROM "$q";
+execute stmt;
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+eval PREPARE stmt FROM "SELECT * FROM v";
+execute stmt;
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+eval PREPARE stmt FROM "WITH cte AS ( $q ) SELECT * FROM cte";
+execute stmt;
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+DROP VIEW v;
+DROP TABLE t1,t2;
+
+--echo #
+--echo # MDEV-28573: view defined as select with implicit grouping and
+--echo # a set function used in a subquery
+--echo #
+
+CREATE TABLE t1 (a INTEGER, b INTEGER);
+CREATE TABLE t2 (c INTEGER);
+INSERT INTO t1 VALUES (1,11), (2,22), (2,22);
+INSERT INTO t2 VALUES (1), (2);
+
+let $q1=
+SELECT (SELECT COUNT(b) FROM t2) FROM t1;
+let $q2=
+SELECT (SELECT COUNT(b) FROM t2 WHERE c > 1) FROM t1;
+
+eval CREATE VIEW v1 AS $q1;
+eval CREATE VIEW v2 AS $q2;
+
+--error ER_SUBQUERY_NO_1_ROW
+eval $q1;
+--error ER_SUBQUERY_NO_1_ROW
+SELECT * FROM v1;
+--error ER_SUBQUERY_NO_1_ROW
+eval WITH cte AS ( $q1 ) SELECT * FROM cte;
+eval $q2;
+SELECT * FROM v2;
+eval WITH cte AS ( $q2 ) SELECT * FROM cte;
+
+eval EXPLAIN $q1;
+EXPLAIN SELECT * FROM v1;
+eval EXPLAIN WITH cte AS ( $q1 ) SELECT * FROM cte;
+
+eval PREPARE stmt FROM "$q1";
+--error ER_SUBQUERY_NO_1_ROW
+execute stmt;
+--error ER_SUBQUERY_NO_1_ROW
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+eval PREPARE stmt FROM "SELECT * FROM v1";
+--error ER_SUBQUERY_NO_1_ROW
+execute stmt;
+--error ER_SUBQUERY_NO_1_ROW
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+eval PREPARE stmt FROM "WITH cte AS ( $q1 ) SELECT * FROM cte";
+--error ER_SUBQUERY_NO_1_ROW
+execute stmt;
+--error ER_SUBQUERY_NO_1_ROW
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+eval PREPARE stmt FROM "$q2";
+execute stmt;
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+eval PREPARE stmt FROM "SELECT * FROM v2";
+execute stmt;
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+eval PREPARE stmt FROM "WITH cte AS ( $q2 ) SELECT * FROM cte";
+execute stmt;
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+DROP VIEW v1,v2;
+DROP TABLE t1,t2;
+
+--echo #
+--echo # MDEV-28570: VIEW with WHERE containing subquery
+--echo # with set function aggregated in query
+--echo #
+
+CREATE TABLE t1 (a int, b int);
+CREATE TABLE t2 (c int, d int);
+
+INSERT INTO t1 VALUES
+ (1,10), (2,10), (1,20), (2,20), (3,20), (2,30), (4,40);
+INSERT INTO t2 VALUES
+ (2,10), (2,20), (4,10), (5,10), (3,20), (2,40);
+
+let $q=
+SELECT a FROM t1 GROUP BY a
+ HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20);
+
+eval CREATE VIEW v AS $q;
+
+eval $q;
+SELECT * FROM v;
+eval WITH cte AS ( $q ) SELECT * FROM cte;
+
+eval EXPLAIN $q;
+EXPLAIN SELECT * FROM v;
+eval EXPLAIN WITH cte AS ( $q ) SELECT * FROM cte;
+
+eval PREPARE stmt FROM "$q";
+execute stmt;
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+eval PREPARE stmt FROM "SELECT * FROM v";
+execute stmt;
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+eval PREPARE stmt FROM "WITH cte AS ( $q ) SELECT * FROM cte";
+execute stmt;
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+DROP VIEW v;
+DROP TABLE t1,t2;
+
+--echo #
+--echo # MDEV-28571: VIEW with select list containing subquery
+--echo # with set function aggregated in query
+--echo #
+
+CREATE TABLE t1 (a int, b int);
+CREATE TABLE t2 (m int, n int);
+INSERT INTO t1 VALUES (2,2), (2,2), (3,3), (3,3), (3,3), (4,4);
+INSERT INTO t2 VALUES (1,11), (2,22), (3,32), (4,44), (4,44);
+
+let $q=
+SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c
+FROM t1
+GROUP BY a;
+
+eval CREATE VIEW v AS $q;
+
+eval $q;
+SELECT * FROM v;
+eval WITH cte AS ( $q ) SELECT * FROM cte;
+
+eval EXPLAIN $q;
+EXPLAIN SELECT * FROM v;
+eval EXPLAIN WITH cte AS ( $q ) SELECT * FROM cte;
+
+eval PREPARE stmt FROM "$q";
+execute stmt;
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+eval PREPARE stmt FROM "SELECT * FROM v";
+execute stmt;
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+eval PREPARE stmt FROM "WITH cte AS ( $q ) SELECT * FROM cte";
+execute stmt;
+execute stmt;
+DEALLOCATE PREPARE stmt;
+
+DROP VIEW v;
+DROP TABLE t1,t2;
+
+--echo #
+--echo # MDEV-30668: VIEW with WHERE containing nested subquery
+--echo # with set function aggregated in outer subquery
+--echo #
+
+create table t1 (a int);
+insert into t1 values (3), (7), (1);
+
+create table t2 (b int);
+insert into t2 values (2), (1), (4), (7);
+
+create table t3 (a int, b int);
+insert into t3 values (2,10), (7,30), (2,30), (1,10), (7,40);
+
+let $q=
+select * from t1
+ where t1.a in (select t3.a from t3 group by t3.a
+ having t3.a > any (select t2.b from t2
+ where t2.b*10 < sum(t3.b)));
+eval create view v as $q;
+
+eval $q;
+eval select * from v;
+eval with cte as ( $q ) select * from cte;
+
+eval explain $q;
+eval explain select * from v;
+eval explain with cte as ( $q ) select * from cte;
+
+eval prepare stmt from "$q";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+eval prepare stmt from "select * from v";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+eval prepare stmt from "with cte as ( $q ) select * from cte";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+drop view v;
+drop table t1,t2,t3;
+
+--echo # End of 10.4 tests
+
+--echo #
+--echo # MDEV-31143: view with ORDER BY used in query with rownum() in WHERE
+--echo #
+
+create table t1 (id int primary key);
+insert into t1 values (3), (7), (1);
+
+create table t2 (a int);
+insert into t2 values (2), (4);
+
+create view v as select a from t2 order by a;
+
+set big_tables= 1;
+select t1.id from v, t1 where rownum() = 1 group by t1.id;
+
+set big_tables=default;
+
+drop view v;
+drop table t1, t2;
+
+--echo #
+--echo # MDEV-31162: multi-table mergeable view with ORDER BY used
+--echo # in query with rownum() in WHERE
+--echo #
+
+create table t1 (a INT) engine=MyISAM;
+insert into t1 values (1),(2);
+
+create table t2 (b INT) engine=MyISAM;
+insert into t2 values (3),(4);
+
+create view v1 AS select * from t1 join t2 order by b;
+let $q1=
+select * from v1 where rownum() <= 2;
+
+eval explain $q1;
+--sorted_result
+eval $q1;
+
+eval prepare stmt from "$q1";
+--sorted_result
+execute stmt;
+--sorted_result
+execute stmt;
+deallocate prepare stmt;
+
+create view v2 AS select * from t1 join t2 order by b/a;
+let $q2=
+select * from v2 where rownum() <= 2;
+
+eval explain $q2;
+eval $q2;
+eval prepare stmt from "$q2";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+drop view v1,v2;
+drop table t1,t2;
+
+--echo # End of 10.6 tests
diff --git a/mysql-test/main/disabled.def b/mysql-test/main/disabled.def
index 02104f6a680..7d0c59e1c84 100644
--- a/mysql-test/main/disabled.def
+++ b/mysql-test/main/disabled.def
@@ -10,7 +10,6 @@
#
##############################################################################
tablespace : disabled in MariaDB (no TABLESPACE table attribute)
-events_time_zone : Test is not predictable as it depends on precise timing.
read_many_rows_innodb : Bug#11748886 2010-11-15 mattiasj report already exists
mysql_embedded : Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836
#show_explain : Psergey: random timeout in range-checked-for-each record query.
diff --git a/mysql-test/main/distinct.result b/mysql-test/main/distinct.result
index 02a76cf3e09..c779459ebb5 100644
--- a/mysql-test/main/distinct.result
+++ b/mysql-test/main/distinct.result
@@ -1075,6 +1075,57 @@ UNION
drop table t1;
End of 5.5 tests
#
+# MDEV-20057 Distinct SUM on CROSS JOIN and grouped returns wrong result
+#
+create table t1 (c int, d int);
+insert into t1 values (5, 1), (0, 3);
+select distinct sum(distinct 1), sum(t1.d) > 2 from (t1 e join t1) group by t1.c;
+sum(distinct 1) sum(t1.d) > 2
+1 1
+1 0
+select distinct sum(distinct 1), sum(t1.d) > 2, t1.c from (t1 e join t1) group by t1.c;
+sum(distinct 1) sum(t1.d) > 2 c
+1 1 0
+1 0 5
+insert into t1 values (6,6);
+select distinct sum(distinct 1), sum(t1.d) > 5 from (t1 e join t1) group by t1.c;
+sum(distinct 1) sum(t1.d) > 5
+1 1
+1 0
+select distinct sum(distinct 1), sum(t1.d) > 5, t1.c from (t1 e join t1) group by t1.c;
+sum(distinct 1) sum(t1.d) > 5 c
+1 1 0
+1 0 5
+1 1 6
+SET @sort_buffer_size_save= @@sort_buffer_size;
+set @@sort_buffer_size=1024;
+insert into t1 select -seq,-seq from seq_1_to_100;
+select distinct sum(distinct 1), sum(t1.d) > 2, length(group_concat(t1.d)) > 1000 from (t1 e join t1) group by t1.c having t1.c > -2 ;
+sum(distinct 1) sum(t1.d) > 2 length(group_concat(t1.d)) > 1000
+1 0 0
+1 1 0
+select distinct sum(distinct 1), sum(t1.d) > 2, length(group_concat(t1.d)) > 1000,t1.c from (t1 e join t1) group by t1.c having t1.c > -2;
+sum(distinct 1) sum(t1.d) > 2 length(group_concat(t1.d)) > 1000 c
+1 0 0 -1
+1 1 0 0
+1 1 0 5
+1 1 0 6
+drop table t1;
+set @@sort_buffer_size=@sort_buffer_size_save;
+#
+# MDEV-31113 Server crashes in store_length / Type_handler_string_result::make_sort_key
+# with DISTINCT and group function
+#
+CREATE TABLE t (f INT);
+INSERT INTO t VALUES (1),(2);
+SELECT DISTINCT CONVERT(STDDEV(f), CHAR(16)) AS f1, UUID() AS f2 FROM t GROUP BY f2 WITH ROLLUP;
+f1 f2
+0.0000 #
+0.0000 #
+0.5000 #
+DROP TABLE t;
+# End of 10.4 tests
+#
# MDEV-27382: OFFSET is ignored when it is combined with the DISTINCT, IN() and JOIN
#
CREATE TABLE t1 (
diff --git a/mysql-test/main/distinct.test b/mysql-test/main/distinct.test
index 2f10d866560..06d04afca56 100644
--- a/mysql-test/main/distinct.test
+++ b/mysql-test/main/distinct.test
@@ -822,6 +822,41 @@ drop table t1;
--echo End of 5.5 tests
--echo #
+--echo # MDEV-20057 Distinct SUM on CROSS JOIN and grouped returns wrong result
+--echo #
+
+create table t1 (c int, d int);
+insert into t1 values (5, 1), (0, 3);
+select distinct sum(distinct 1), sum(t1.d) > 2 from (t1 e join t1) group by t1.c;
+select distinct sum(distinct 1), sum(t1.d) > 2, t1.c from (t1 e join t1) group by t1.c;
+
+insert into t1 values (6,6);
+select distinct sum(distinct 1), sum(t1.d) > 5 from (t1 e join t1) group by t1.c;
+select distinct sum(distinct 1), sum(t1.d) > 5, t1.c from (t1 e join t1) group by t1.c;
+
+# Force usage of remove_dup_with_compare() algorithm
+SET @sort_buffer_size_save= @@sort_buffer_size;
+set @@sort_buffer_size=1024;
+insert into t1 select -seq,-seq from seq_1_to_100;
+select distinct sum(distinct 1), sum(t1.d) > 2, length(group_concat(t1.d)) > 1000 from (t1 e join t1) group by t1.c having t1.c > -2 ;
+select distinct sum(distinct 1), sum(t1.d) > 2, length(group_concat(t1.d)) > 1000,t1.c from (t1 e join t1) group by t1.c having t1.c > -2;
+drop table t1;
+set @@sort_buffer_size=@sort_buffer_size_save;
+
+--echo #
+--echo # MDEV-31113 Server crashes in store_length / Type_handler_string_result::make_sort_key
+--echo # with DISTINCT and group function
+--echo #
+
+CREATE TABLE t (f INT);
+INSERT INTO t VALUES (1),(2);
+--replace_column 2 #
+SELECT DISTINCT CONVERT(STDDEV(f), CHAR(16)) AS f1, UUID() AS f2 FROM t GROUP BY f2 WITH ROLLUP;
+DROP TABLE t;
+
+--echo # End of 10.4 tests
+
+--echo #
--echo # MDEV-27382: OFFSET is ignored when it is combined with the DISTINCT, IN() and JOIN
--echo #
CREATE TABLE t1 (
diff --git a/mysql-test/main/except.result b/mysql-test/main/except.result
index ec7d085c70f..e08427d9c65 100644
--- a/mysql-test/main/except.result
+++ b/mysql-test/main/except.result
@@ -423,8 +423,11 @@ ANALYZE
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
+ "r_loops": 2,
"r_filtered": 100,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 2
}
}
]
@@ -471,8 +474,11 @@ ANALYZE
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
+ "r_loops": 2,
"r_filtered": 100,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 2
}
}
]
@@ -556,8 +562,11 @@ ANALYZE
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
+ "r_loops": 2,
"r_filtered": 100,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 2
}
}
]
@@ -604,8 +613,11 @@ ANALYZE
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
+ "r_loops": 2,
"r_filtered": 100,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 2
}
}
]
diff --git a/mysql-test/main/except_all.result b/mysql-test/main/except_all.result
index f79f35ee932..ffc9ddb7601 100644
--- a/mysql-test/main/except_all.result
+++ b/mysql-test/main/except_all.result
@@ -556,8 +556,11 @@ ANALYZE
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
+ "r_loops": 3,
"r_filtered": 100,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 3
}
}
]
@@ -604,8 +607,11 @@ ANALYZE
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
+ "r_loops": 2,
"r_filtered": 100,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 3
}
}
]
@@ -688,8 +694,11 @@ ANALYZE
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
+ "r_loops": 3,
"r_filtered": 100,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 3
}
}
]
@@ -736,8 +745,11 @@ ANALYZE
"buffer_type": "flat",
"buffer_size": "119",
"join_type": "BNL",
+ "r_loops": 2,
"r_filtered": 100,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 3
}
}
]
diff --git a/mysql-test/main/explain_innodb.result b/mysql-test/main/explain_innodb.result
index 0bdd5a44985..03052eb3006 100644
--- a/mysql-test/main/explain_innodb.result
+++ b/mysql-test/main/explain_innodb.result
@@ -18,3 +18,21 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DERIVED t1 range NULL id 53 NULL 1 Using index for group-by
SET GLOBAL slow_query_log = @sql_tmp;
drop table t1;
+#
+# MDEV-31181: Server crash in subselect_uniquesubquery_engine::print
+# upon EXPLAIN EXTENDED DELETE
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (pk INT PRIMARY KEY);
+INSERT INTO t2 VALUES (1),(2);
+EXPLAIN EXTENDED DELETE FROM t1 WHERE a IN (SELECT pk FROM t2);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index
+Warnings:
+Note 1003 delete from `test`.`t1` using `test`.`t2` where `test`.`t2`.`pk` = `test`.`t1`.`a`
+drop table t1, t2;
+#
+# End of 10.4 tests
+#
diff --git a/mysql-test/main/explain_innodb.test b/mysql-test/main/explain_innodb.test
index 2c29a6e26da..3dcad4c2d49 100644
--- a/mysql-test/main/explain_innodb.test
+++ b/mysql-test/main/explain_innodb.test
@@ -18,3 +18,22 @@ SELECT * FROM (SELECT id FROM t1 GROUP BY id) dt WHERE 1=0;
SET GLOBAL slow_query_log = @sql_tmp;
drop table t1;
+
+
+--echo #
+--echo # MDEV-31181: Server crash in subselect_uniquesubquery_engine::print
+--echo # upon EXPLAIN EXTENDED DELETE
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (pk INT PRIMARY KEY);
+INSERT INTO t2 VALUES (1),(2);
+
+EXPLAIN EXTENDED DELETE FROM t1 WHERE a IN (SELECT pk FROM t2);
+
+drop table t1, t2;
+
+--echo #
+--echo # End of 10.4 tests
+--echo #
diff --git a/mysql-test/main/explain_json.result b/mysql-test/main/explain_json.result
index df443003a86..969e069da83 100644
--- a/mysql-test/main/explain_json.result
+++ b/mysql-test/main/explain_json.result
@@ -2060,8 +2060,11 @@ ANALYZE
"buffer_size": "400",
"join_type": "BKA",
"mrr_type": "Rowid-ordered scan",
+ "r_loops": 10,
"r_filtered": 100,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 1
}
}
]
diff --git a/mysql-test/main/explain_non_select.result b/mysql-test/main/explain_non_select.result
index 7dea232f260..e998d8745c1 100644
--- a/mysql-test/main/explain_non_select.result
+++ b/mysql-test/main/explain_non_select.result
@@ -157,9 +157,13 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
explain extended update t2 set b=3 where a in (3,4);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 update `test`.`t2` set `test`.`t2`.`b` = 3 where `test`.`t2`.`a` in (3,4)
explain extended delete from t2 where a in (3,4);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`a` in (3,4)
drop table t1,t2;
#
# Check the special case where partition pruning removed all partitions
diff --git a/mysql-test/main/merge-big.result b/mysql-test/main/flush_corruption.result
index bd188d7a856..bd188d7a856 100644
--- a/mysql-test/main/merge-big.result
+++ b/mysql-test/main/flush_corruption.result
diff --git a/mysql-test/main/merge-big.test b/mysql-test/main/flush_corruption.test
index 5873d2eb233..97ef416307f 100644
--- a/mysql-test/main/merge-big.test
+++ b/mysql-test/main/flush_corruption.test
@@ -1,5 +1,5 @@
#
-# Test of MERGE tables with multisession and many waits.
+# Test of MyISAM tables with multisession and many waits.
#
# This test takes rather long time so let us run it only in --big-test mode
--source include/big_test.inc
diff --git a/mysql-test/main/func_group.result b/mysql-test/main/func_group.result
index de64d01ed4c..37420df6f00 100644
--- a/mysql-test/main/func_group.result
+++ b/mysql-test/main/func_group.result
@@ -1443,16 +1443,11 @@ FROM derived1 AS X
WHERE
X.int_nokey < 61
GROUP BY pk
-LIMIT 1)
+LIMIT 1) AS m
FROM D AS X
WHERE X.int_key < 13
GROUP BY int_nokey LIMIT 1;
-(SELECT COUNT( int_nokey )
-FROM derived1 AS X
-WHERE
-X.int_nokey < 61
-GROUP BY pk
-LIMIT 1)
+m
1
DROP TABLE derived1;
DROP TABLE D;
diff --git a/mysql-test/main/func_group.test b/mysql-test/main/func_group.test
index 842ca4388ef..05946908fcf 100644
--- a/mysql-test/main/func_group.test
+++ b/mysql-test/main/func_group.test
@@ -583,8 +583,6 @@ DROP TABLE t1;
#
# Bug #16792 query with subselect, join, and group not returning proper values
#
-#enable after fix MDEV-28573
---disable_view_protocol
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,1),(1,2),(2,3);
@@ -595,7 +593,6 @@ SELECT AVG(2), BIT_AND(2), BIT_OR(2), BIT_XOR(2), COUNT(*), COUNT(12),
COUNT(DISTINCT 12), MIN(2),MAX(2),STD(2), VARIANCE(2),SUM(2),
GROUP_CONCAT(2),GROUP_CONCAT(DISTINCT 2);
DROP TABLE t1;
---enable_view_protocol
# End of 4.1 tests
@@ -627,13 +624,10 @@ drop table t1, t2, t3;
#
# BUG#3190, WL#1639: Standard Deviation STDDEV - 2 different calculations
#
-#enable after fix MDEV-28573
---disable_view_protocol
CREATE TABLE t1 (id int(11),value1 float(10,2));
INSERT INTO t1 VALUES (1,0.00),(1,1.00), (1,2.00), (2,10.00), (2,11.00), (2,12.00), (2,13.00);
select id, stddev_pop(value1), var_pop(value1), stddev_samp(value1), var_samp(value1) from t1 group by id;
DROP TABLE t1;
---enable_view_protocol
#
# BUG#8464 decimal AVG returns incorrect result
@@ -970,22 +964,19 @@ INSERT INTO D VALUES
(83,45,4,repeat(' X', 42)),
(105,53,12,NULL);
-#enable after fix MDEV-27871
---disable_view_protocol
SELECT
(SELECT COUNT( int_nokey )
FROM derived1 AS X
WHERE
X.int_nokey < 61
GROUP BY pk
- LIMIT 1)
+ LIMIT 1) AS m
FROM D AS X
WHERE X.int_key < 13
GROUP BY int_nokey LIMIT 1;
DROP TABLE derived1;
DROP TABLE D;
---enable_view_protocol
#
# Bug #39656: Behaviour different for agg functions with & without where -
diff --git a/mysql-test/main/func_json.result b/mysql-test/main/func_json.result
index bdda00e256d..f202de76359 100644
--- a/mysql-test/main/func_json.result
+++ b/mysql-test/main/func_json.result
@@ -1449,6 +1449,13 @@ JSON_LOOSE(JSON_EXTRACT(a, '$**.analyzing_range_alternatives'))
[{"range_scan_alternatives": [{"index": "a_b", "ranges": ["2 <= a <= 2 AND 4 <= b <= 4", "123"], "rowid_ordered": true, "using_mrr": false, "index_only": true, "rows": 1, "cost": 1.1752, "chosen": true}], "analyzing_roworder_intersect": {"cause": "too few roworder scans"}, "analyzing_index_merge_union": [], "test_one_line_array": ["123"]}]
drop table t200;
#
+# MDEV-24538: JSON_LENGTH does not return error upon wrong number of parameters
+#
+SELECT JSON_LENGTH('{"a":"b"}','$','$', 'foo');
+ERROR 42000: Incorrect parameter count in the call to native function 'json_length'
+SELECT JSON_LENGTH();
+ERROR 42000: Incorrect parameter count in the call to native function 'JSON_LENGTH'
+#
# End of 10.4 tests
#
#
@@ -1667,7 +1674,18 @@ DROP TABLE t;
# End of 10.6 tests
#
#
-# Beginning of 10.9 tests
+# MDEV-31147 json_normalize does not work correctly with MSAN build
+#
+CREATE TABLE t1 (val JSON);
+ALTER TABLE t1 ADD COLUMN normalized_json JSON AS (JSON_NORMALIZE(val));
+INSERT INTO t1 (val) VALUES ('15');
+SELECT * FROM t1;
+val normalized_json
+15 1.5E1
+DROP TABLE t1;
+#
+# End of 10.8 tests
+#
#
# MDEV-27677: Implement JSON_OVERLAPS()
#
diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test
index 7fc2f05a57a..120e5085ddb 100644
--- a/mysql-test/main/func_json.test
+++ b/mysql-test/main/func_json.test
@@ -665,6 +665,7 @@ SELECT 1 + JSON_VALUE('{"nulltest": null}', '$.nulltest');
SELECT NULL;
SELECT JSON_EXTRACT('{"a":null, "b":10, "c":"null"}', '$.a');
+
--echo #
--echo # End of 10.3 tests
--echo #
@@ -918,6 +919,14 @@ select JSON_LOOSE(JSON_EXTRACT(a, '$**.analyzing_range_alternatives')) from t200
drop table t200;
--echo #
+--echo # MDEV-24538: JSON_LENGTH does not return error upon wrong number of parameters
+--echo #
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT JSON_LENGTH('{"a":"b"}','$','$', 'foo');
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT JSON_LENGTH();
+
+--echo #
--echo # End of 10.4 tests
--echo #
@@ -1105,7 +1114,18 @@ DROP TABLE t;
--echo #
--echo #
---echo # Beginning of 10.9 tests
+--echo # MDEV-31147 json_normalize does not work correctly with MSAN build
+--echo #
+CREATE TABLE t1 (val JSON);
+ALTER TABLE t1 ADD COLUMN normalized_json JSON AS (JSON_NORMALIZE(val));
+INSERT INTO t1 (val) VALUES ('15');
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.8 tests
+--echo #
+
--echo #
--echo # MDEV-27677: Implement JSON_OVERLAPS()
--echo #
diff --git a/mysql-test/main/func_str.result b/mysql-test/main/func_str.result
index a477c3c2ec4..149eeebe0bb 100644
--- a/mysql-test/main/func_str.result
+++ b/mysql-test/main/func_str.result
@@ -5241,6 +5241,15 @@ DROP TABLE t1;
# Start of 10.4 tests
#
#
+# MDEV-30351 crash in Item_func_left::val_str
+#
+SELECT WEIGHT_STRING('aa') IN (LEFT(WEIGHT_STRING('aaa'),4),'bbb') as expect_1;
+expect_1
+1
+SELECT UNHEX('0032') in (LEFT(UNHEX('003200'), 2),'dog') as expect_1;
+expect_1
+1
+#
# MDEV-21841 CONV() function truncates the result type to 21 symbol.
#
CREATE TABLE t1(i BIGINT);
diff --git a/mysql-test/main/func_str.test b/mysql-test/main/func_str.test
index 1c8839f24a2..377470ca60e 100644
--- a/mysql-test/main/func_str.test
+++ b/mysql-test/main/func_str.test
@@ -2280,17 +2280,23 @@ CREATE TABLE crash_test_2 (
--echo # Cleanup
DROP TABLE t1;
-
--echo #
--echo # End of 10.3 tests
--echo #
-
--echo #
--echo # Start of 10.4 tests
--echo #
--echo #
+--echo # MDEV-30351 crash in Item_func_left::val_str
+--echo #
+
+SELECT WEIGHT_STRING('aa') IN (LEFT(WEIGHT_STRING('aaa'),4),'bbb') as expect_1;
+
+SELECT UNHEX('0032') in (LEFT(UNHEX('003200'), 2),'dog') as expect_1;
+
+--echo #
--echo # MDEV-21841 CONV() function truncates the result type to 21 symbol.
--echo #
diff --git a/mysql-test/main/grant5.result b/mysql-test/main/grant5.result
index 6f50f530a3e..76a5f5375e9 100644
--- a/mysql-test/main/grant5.result
+++ b/mysql-test/main/grant5.result
@@ -453,4 +453,13 @@ insert mysql.host values (1);
flush privileges;
ERROR HY000: Fatal error: mysql.host table is damaged or in unsupported 3.20 format
drop table mysql.host;
+#
+# MDEV-30826 Invalid data on mysql.host segfaults the server after an upgrade to 10.4
+#
+create table mysql.host (host char(60) binary default '' not null, db char(64) binary default '' not null, select_priv enum('n','y') collate utf8_general_ci default 'n' not null, insert_priv enum('n','y') collate utf8_general_ci default 'n' not null, update_priv enum('n','y') collate utf8_general_ci default 'n' not null, delete_priv enum('n','y') collate utf8_general_ci default 'n' not null, create_priv enum('n','y') collate utf8_general_ci default 'n' not null, drop_priv enum('n','y') collate utf8_general_ci default 'n' not null, grant_priv enum('n','y') collate utf8_general_ci default 'n' not null, references_priv enum('n','y') collate utf8_general_ci default 'n' not null, index_priv enum('n','y') collate utf8_general_ci default 'n' not null, alter_priv enum('n','y') collate utf8_general_ci default 'n' not null, create_tmp_table_priv enum('n','y') collate utf8_general_ci default 'n' not null, lock_tables_priv enum('n','y') collate utf8_general_ci default 'n' not null, create_view_priv enum('n','y') collate utf8_general_ci default 'n' not null, show_view_priv enum('n','y') collate utf8_general_ci default 'n' not null, create_routine_priv enum('n','y') collate utf8_general_ci default 'n' not null, alter_routine_priv enum('n','y') collate utf8_general_ci default 'n' not null, execute_priv enum('n','y') collate utf8_general_ci default 'n' not null, trigger_priv enum('n','y') collate utf8_general_ci default 'n' not null, primary key /*host*/ (host,db)) engine=myisam character set utf8 collate utf8_bin comment='host privileges; merged with database privileges';
+insert mysql.host values('10.5.0.0/255.255.0.0','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','N');
+flush privileges;
+drop table mysql.host;
+#
# End of 10.4 tests
+#
diff --git a/mysql-test/main/grant5.test b/mysql-test/main/grant5.test
index c4a302fca86..49e0ab1abf1 100644
--- a/mysql-test/main/grant5.test
+++ b/mysql-test/main/grant5.test
@@ -408,4 +408,16 @@ insert mysql.host values (1);
flush privileges;
drop table mysql.host;
+--echo #
+--echo # MDEV-30826 Invalid data on mysql.host segfaults the server after an upgrade to 10.4
+--echo #
+
+# from mysql_system_tables.sql in 10.3:
+create table mysql.host (host char(60) binary default '' not null, db char(64) binary default '' not null, select_priv enum('n','y') collate utf8_general_ci default 'n' not null, insert_priv enum('n','y') collate utf8_general_ci default 'n' not null, update_priv enum('n','y') collate utf8_general_ci default 'n' not null, delete_priv enum('n','y') collate utf8_general_ci default 'n' not null, create_priv enum('n','y') collate utf8_general_ci default 'n' not null, drop_priv enum('n','y') collate utf8_general_ci default 'n' not null, grant_priv enum('n','y') collate utf8_general_ci default 'n' not null, references_priv enum('n','y') collate utf8_general_ci default 'n' not null, index_priv enum('n','y') collate utf8_general_ci default 'n' not null, alter_priv enum('n','y') collate utf8_general_ci default 'n' not null, create_tmp_table_priv enum('n','y') collate utf8_general_ci default 'n' not null, lock_tables_priv enum('n','y') collate utf8_general_ci default 'n' not null, create_view_priv enum('n','y') collate utf8_general_ci default 'n' not null, show_view_priv enum('n','y') collate utf8_general_ci default 'n' not null, create_routine_priv enum('n','y') collate utf8_general_ci default 'n' not null, alter_routine_priv enum('n','y') collate utf8_general_ci default 'n' not null, execute_priv enum('n','y') collate utf8_general_ci default 'n' not null, trigger_priv enum('n','y') collate utf8_general_ci default 'n' not null, primary key /*host*/ (host,db)) engine=myisam character set utf8 collate utf8_bin comment='host privileges; merged with database privileges';
+insert mysql.host values('10.5.0.0/255.255.0.0','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','N');
+flush privileges;
+drop table mysql.host;
+
+--echo #
--echo # End of 10.4 tests
+--echo #
diff --git a/mysql-test/main/group_by.result b/mysql-test/main/group_by.result
index ef5e500c314..79102ffaf61 100644
--- a/mysql-test/main/group_by.result
+++ b/mysql-test/main/group_by.result
@@ -1037,8 +1037,9 @@ FROM t1 AS t1_outer GROUP BY t1_outer.b;
21
21
SELECT (SELECT SUM(t1_inner.a) FROM t1 AS t1_inner GROUP BY t1_inner.b LIMIT 1)
+AS m
FROM t1 AS t1_outer;
-(SELECT SUM(t1_inner.a) FROM t1 AS t1_inner GROUP BY t1_inner.b LIMIT 1)
+m
3
3
3
@@ -1278,12 +1279,9 @@ a
select avg (
(select
(select sum(outr.a + innr.a) from t1 as innr limit 1) as tt
-from t1 as outr order by outr.a limit 1))
+from t1 as outr order by outr.a limit 1)) as m
from t1 as most_outer;
-avg (
-(select
-(select sum(outr.a + innr.a) from t1 as innr limit 1) as tt
-from t1 as outr order by outr.a limit 1))
+m
29.0000
select avg (
(select (
diff --git a/mysql-test/main/group_by.test b/mysql-test/main/group_by.test
index 3aa7f1cd0d3..6ca80f55ebf 100644
--- a/mysql-test/main/group_by.test
+++ b/mysql-test/main/group_by.test
@@ -786,11 +786,9 @@ SELECT 1 FROM t1 as t1_outer GROUP BY a
SELECT (SELECT SUM(t1_inner.a) FROM t1 AS t1_inner LIMIT 1)
FROM t1 AS t1_outer GROUP BY t1_outer.b;
-#enable after fix MDEV-27871
---disable_view_protocol
SELECT (SELECT SUM(t1_inner.a) FROM t1 AS t1_inner GROUP BY t1_inner.b LIMIT 1)
+AS m
FROM t1 AS t1_outer;
---enable_view_protocol
--error ER_WRONG_FIELD_WITH_GROUP
SELECT (SELECT SUM(t1_outer.a) FROM t1 AS t1_inner LIMIT 1)
@@ -866,6 +864,7 @@ DROP TABLE t1;
--echo #
--echo # Bug#27219: Aggregate functions in ORDER BY.
--echo #
+
SET @save_sql_mode=@@sql_mode;
SET @@sql_mode='ONLY_FULL_GROUP_BY';
@@ -887,6 +886,8 @@ SELECT 1 FROM t1 ORDER BY SUM(a) + 1;
--error 1140
SELECT 1 FROM t1 ORDER BY SUM(a), b;
+--disable_service_connection
+
--error 1140
SELECT a FROM t1 ORDER BY COUNT(b);
@@ -899,9 +900,6 @@ SELECT t1.a FROM t1 ORDER BY (SELECT SUM(t2.a) FROM t2 ORDER BY t2.a);
--error 1140
SELECT t1.a FROM t1 ORDER BY (SELECT t2.a FROM t2 ORDER BY SUM(t2.b) LIMIT 1);
-#enable after fix MDEV-28570
---disable_view_protocol
-
--error 1140
SELECT t1.a FROM t1
WHERE t1.a = (SELECT t2.a FROM t2 ORDER BY SUM(t2.b) LIMIT 1);
@@ -939,7 +937,7 @@ SELECT 1 FROM t1 GROUP BY t1.a
SELECT 1 FROM t1 GROUP BY t1.a
HAVING (SELECT AVG(t1.b + t2.b) FROM t2 ORDER BY t2.a LIMIT 1);
---enable_view_protocol
+--enable_service_connection
# Both SUMs are aggregated in the subquery, no mixture:
SELECT t1.a FROM t1
@@ -964,18 +962,17 @@ SELECT t1.a, SUM(t1.b) FROM t1
ORDER BY SUM(t2.b + t1.a) LIMIT 1)
GROUP BY t1.a;
-#enable after fix MDEV-28570, MDEV-28571
---disable_view_protocol
-
SELECT t1.a FROM t1 GROUP BY t1.a
HAVING (1, 1) = (SELECT SUM(t1.a), t1.a FROM t2 LIMIT 1);
select avg (
(select
(select sum(outr.a + innr.a) from t1 as innr limit 1) as tt
- from t1 as outr order by outr.a limit 1))
+ from t1 as outr order by outr.a limit 1)) as m
from t1 as most_outer;
+--disable_service_connection
+
--error 1140
select avg (
(select (
@@ -983,7 +980,7 @@ select avg (
from t1 as outr order by count(outr.a) limit 1)) as tt
from t1 as most_outer;
---enable_view_protocol
+--enable_service_connection
select (select sum(outr.a + t1.a) from t1 limit 1) as tt from t1 as outr order by outr.a;
@@ -1388,7 +1385,7 @@ DROP TABLE t1;
--echo # Bug#11765254 (58200): Assertion failed: param.sort_length when grouping
--echo # by functions
--echo #
-#createing view adds one new warning
+#creating view adds one new warning
--disable_view_protocol
set tmp_memory_table_size=0;
diff --git a/mysql-test/main/group_min_max.result b/mysql-test/main/group_min_max.result
index a227246e7ec..cf4bfd62424 100644
--- a/mysql-test/main/group_min_max.result
+++ b/mysql-test/main/group_min_max.result
@@ -4117,6 +4117,18 @@ MIN(pk)
1
DROP TABLE t1, t2;
#
+# MDEV-30605 Wrong result while using index for group-by
+#
+CREATE TABLE t1 (pk INT primary key, a int, key(a)) engine=innodb;
+INSERT INTO t1 VALUES (1,-1),(2,8),(3,5),(4,-1),(5,10), (6,-1);
+SELECT MIN(pk), a FROM t1 WHERE pk <> 1 GROUP BY a;
+MIN(pk) a
+4 -1
+3 5
+2 8
+5 10
+DROP TABLE t1;
+#
# End of 10.5 tests
#
#
diff --git a/mysql-test/main/group_min_max.test b/mysql-test/main/group_min_max.test
index d230cd15749..a1d2988ad4c 100644
--- a/mysql-test/main/group_min_max.test
+++ b/mysql-test/main/group_min_max.test
@@ -1746,6 +1746,17 @@ SELECT MIN(pk) FROM t1, t2;
DROP TABLE t1, t2;
--echo #
+--echo # MDEV-30605 Wrong result while using index for group-by
+--echo #
+
+CREATE TABLE t1 (pk INT primary key, a int, key(a)) engine=innodb;
+INSERT INTO t1 VALUES (1,-1),(2,8),(3,5),(4,-1),(5,10), (6,-1);
+
+SELECT MIN(pk), a FROM t1 WHERE pk <> 1 GROUP BY a;
+
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.5 tests
--echo #
diff --git a/mysql-test/main/insert_innodb.result b/mysql-test/main/insert_innodb.result
index 314412bcfdd..b8f3979d2ba 100644
--- a/mysql-test/main/insert_innodb.result
+++ b/mysql-test/main/insert_innodb.result
@@ -51,7 +51,7 @@ CREATE TEMPORARY TABLE v0 ( v1 TEXT ( 15 ) CHAR SET BINARY NOT NULL NOT NULL UNI
ERROR HY000: Field 'v1' doesn't have a default value
CREATE TEMPORARY TABLE t1 (i TEXT(15) NOT NULL DEFAULT '' UNIQUE CHECK (i)) engine=innodb
REPLACE SELECT NULL AS a;
-ERROR HY000: Field 'DB_ROW_HASH_1' doesn't have a default value
+ERROR 23000: CONSTRAINT `t1.i` failed for `test`.`t1`
#
# End of 10.5 tests
#
diff --git a/mysql-test/main/insert_innodb.test b/mysql-test/main/insert_innodb.test
index b5a9fc72c07..56ddb2eafbf 100644
--- a/mysql-test/main/insert_innodb.test
+++ b/mysql-test/main/insert_innodb.test
@@ -71,7 +71,7 @@ DROP TABLE t2, t1;
--error ER_NO_DEFAULT_FOR_FIELD
CREATE TEMPORARY TABLE v0 ( v1 TEXT ( 15 ) CHAR SET BINARY NOT NULL NOT NULL UNIQUE CHECK ( v1 ) ) REPLACE SELECT NULL AS v3 , 74 AS v2 ;
---error ER_NO_DEFAULT_FOR_FIELD
+--error ER_CONSTRAINT_FAILED
CREATE TEMPORARY TABLE t1 (i TEXT(15) NOT NULL DEFAULT '' UNIQUE CHECK (i)) engine=innodb
REPLACE SELECT NULL AS a;
diff --git a/mysql-test/main/insert_returning.result b/mysql-test/main/insert_returning.result
index 1976c1ca02e..b2ed9c90e51 100644
--- a/mysql-test/main/insert_returning.result
+++ b/mysql-test/main/insert_returning.result
@@ -63,6 +63,8 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN EXTENDED INSERT INTO t1(id1,val1) VALUES(9,'j') RETURNING id1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL
+Warnings:
+Note 1003 insert into `test`.`t1`(id1,val1) values (9,'j')
EXPLAIN FORMAT="json" INSERT INTO t1(id1,val1) VALUES (10,'k') RETURNING id1;
EXPLAIN
{
@@ -151,6 +153,8 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN EXTENDED INSERT INTO t1 VALUES (17,'s'),(18,'t') RETURNING *;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL
+Warnings:
+Note 1003 insert into `test`.`t1` values (17,'s'),(18,'t')
EXPLAIN FORMAT="json" INSERT INTO t1 VALUES(19,'u'),(20,'v') RETURNING id1;
EXPLAIN
{
@@ -236,6 +240,8 @@ EXPLAIN EXTENDED INSERT INTO ins_duplicate(id,val) VALUES (2,'b')
ON DUPLICATE KEY UPDATE val='i' RETURNING val;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 INSERT ins_duplicate ALL NULL NULL NULL NULL NULL 100.00 NULL
+Warnings:
+Note 1003 insert into `test`.`ins_duplicate`(id,val) values (2,'b') on duplicate key update `test`.`ins_duplicate`.`val` = 'i'
EXPLAIN FORMAT="json" INSERT INTO ins_duplicate(id,val) VALUES (2,'b')
ON DUPLICATE KEY UPDATE val='j' RETURNING val;
EXPLAIN
@@ -320,6 +326,8 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN EXTENDED INSERT INTO t1 SET id1=10, val1='j' RETURNING val1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL
+Warnings:
+Note 1003 insert into `test`.`t1`(id1,val1) values (10,'j')
EXPLAIN FORMAT="json" INSERT INTO t1 SET id1=11, val1='k' RETURNING val1;
EXPLAIN
{
@@ -404,6 +412,8 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN EXTENDED INSERT INTO t1 SELECT * FROM t1 WHERE id1=9 RETURNING val1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+Warnings:
+Note 1003 insert into `test`.`t1` select sql_buffer_result NULL AS `id1`,NULL AS `val1` from `test`.`t1` where 0
EXPLAIN FORMAT="json" INSERT INTO t1 SELECT * FROM t1 WHERE id1=10 RETURNING val1;
EXPLAIN
{
diff --git a/mysql-test/main/insert_update.result b/mysql-test/main/insert_update.result
index 68a1003ad85..3cbc1944b5e 100644
--- a/mysql-test/main/insert_update.result
+++ b/mysql-test/main/insert_update.result
@@ -412,3 +412,45 @@ select if( @stamp1 = @stamp2, "correct", "wrong");
if( @stamp1 = @stamp2, "correct", "wrong")
correct
drop table t1;
+#
+# MDEV-31164 default current_timestamp() not working when used INSERT ON DUPLICATE KEY in some cases
+#
+set timestamp=unix_timestamp('2000-10-20 0:0:0');
+create table t1 (pk integer primary key, val varchar(20) not null, ts timestamp
+default current_timestamp on update current_timestamp);
+insert t1 (pk, val) values(1, 'val1');
+select * from t1;
+pk val ts
+1 val1 2000-10-20 00:00:00
+set timestamp=unix_timestamp('2000-10-20 1:0:0');
+insert t1 (pk, val) select 2, 'val3' union select 3, 'val4'
+ on duplicate key update ts=now();
+select * from t1;
+pk val ts
+1 val1 2000-10-20 00:00:00
+2 val3 2000-10-20 01:00:00
+3 val4 2000-10-20 01:00:00
+set timestamp=unix_timestamp('2000-10-20 2:0:0');
+insert t1 (pk, val) select 1, 'val1' union select 4, 'val2'
+ on duplicate key update ts=now();
+select * from t1;
+pk val ts
+1 val1 2000-10-20 02:00:00
+2 val3 2000-10-20 01:00:00
+3 val4 2000-10-20 01:00:00
+4 val2 2000-10-20 02:00:00
+set timestamp=unix_timestamp('2000-10-20 3:0:0');
+insert t1 (pk, val) select 5, 'val1' union select 1, 'val2'
+ on duplicate key update ts=now();
+select * from t1;
+pk val ts
+1 val1 2000-10-20 03:00:00
+2 val3 2000-10-20 01:00:00
+3 val4 2000-10-20 01:00:00
+4 val2 2000-10-20 02:00:00
+5 val1 2000-10-20 03:00:00
+drop table t1;
+set timestamp=default;
+#
+# End of 10.4 tests
+#
diff --git a/mysql-test/main/insert_update.test b/mysql-test/main/insert_update.test
index 06e16be84d7..bb56f04c532 100644
--- a/mysql-test/main/insert_update.test
+++ b/mysql-test/main/insert_update.test
@@ -311,3 +311,30 @@ insert into t1(f1) values(1) on duplicate key update f1=1;
select @stamp2:=f2 from t1;
select if( @stamp1 = @stamp2, "correct", "wrong");
drop table t1;
+
+--echo #
+--echo # MDEV-31164 default current_timestamp() not working when used INSERT ON DUPLICATE KEY in some cases
+--echo #
+set timestamp=unix_timestamp('2000-10-20 0:0:0');
+create table t1 (pk integer primary key, val varchar(20) not null, ts timestamp
+ default current_timestamp on update current_timestamp);
+insert t1 (pk, val) values(1, 'val1');
+select * from t1;
+set timestamp=unix_timestamp('2000-10-20 1:0:0');
+insert t1 (pk, val) select 2, 'val3' union select 3, 'val4'
+ on duplicate key update ts=now();
+select * from t1;
+set timestamp=unix_timestamp('2000-10-20 2:0:0');
+insert t1 (pk, val) select 1, 'val1' union select 4, 'val2'
+ on duplicate key update ts=now();
+select * from t1;
+set timestamp=unix_timestamp('2000-10-20 3:0:0');
+insert t1 (pk, val) select 5, 'val1' union select 1, 'val2'
+ on duplicate key update ts=now();
+select * from t1;
+drop table t1;
+set timestamp=default;
+
+--echo #
+--echo # End of 10.4 tests
+--echo #
diff --git a/mysql-test/main/intersect.result b/mysql-test/main/intersect.result
index 83a607f4e45..9e1b60ca381 100644
--- a/mysql-test/main/intersect.result
+++ b/mysql-test/main/intersect.result
@@ -508,8 +508,11 @@ ANALYZE
"buffer_type": "flat",
"buffer_size": "256Kb",
"join_type": "BNL",
+ "r_loops": 3,
"r_filtered": 100,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 3
}
}
]
@@ -618,8 +621,11 @@ ANALYZE
"buffer_type": "flat",
"buffer_size": "256Kb",
"join_type": "BNL",
+ "r_loops": 3,
"r_filtered": 100,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 3
}
}
]
diff --git a/mysql-test/main/intersect_all.result b/mysql-test/main/intersect_all.result
index 8f826a193aa..3b1f3f2ac47 100644
--- a/mysql-test/main/intersect_all.result
+++ b/mysql-test/main/intersect_all.result
@@ -539,8 +539,11 @@ ANALYZE
"buffer_type": "flat",
"buffer_size": "65",
"join_type": "BNL",
+ "r_loops": 5,
"r_filtered": 100,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 7
}
}
]
@@ -649,8 +652,11 @@ ANALYZE
"buffer_type": "flat",
"buffer_size": "65",
"join_type": "BNL",
+ "r_loops": 5,
"r_filtered": 100,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 7
}
}
]
diff --git a/mysql-test/main/join_cache.result b/mysql-test/main/join_cache.result
index c02ac192dde..d6a530a9f77 100644
--- a/mysql-test/main/join_cache.result
+++ b/mysql-test/main/join_cache.result
@@ -5977,10 +5977,9 @@ LEFT JOIN t5 ON t4.e1 = t5.e1
LEFT JOIN (SELECT e1 FROM t2 ) AS d ON t4.e1 = d.e1) a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 128 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t4 ALL NULL NULL NULL NULL 128
-2 MATERIALIZED t5 hash_ALL NULL #hash#$hj 5 test.t4.e1 128 Using where; Using join buffer (flat, BNLH join)
-2 MATERIALIZED t2 hash_ALL NULL #hash#$hj 5 test.t4.e1 128 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY t4 hash_ALL NULL #hash#$hj 5 test.t1.i1 128 Using where; Start temporary; Using join buffer (flat, BNLH join)
+1 PRIMARY t5 hash_ALL NULL #hash#$hj 5 test.t4.e1 128 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY t2 hash_ALL NULL #hash#$hj 5 test.t4.e1 128 Using where; End temporary; Using join buffer (incremental, BNLH join)
SELECT * FROM t1
WHERE
i1 < 10 AND
@@ -6035,12 +6034,11 @@ f1 f2
EXPLAIN EXTENDED SELECT * FROM temp
WHERE (f1,f2) IN (SELECT t1.i1, t1.v1 FROM (t2 JOIN t1 ON (t1.v1 = t2.v1)));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY temp ALL NULL NULL NULL NULL 7 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 100.00
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 1 100.00 Using where
-2 MATERIALIZED t2 hash_index v1 #hash#v1:v1 4:9 test.t1.v1 10 33.33 Using index; Using join buffer (flat, BNLH join)
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 100.00 Using where; Start temporary
+1 PRIMARY temp hash_ALL NULL #hash#$hj 9 test.t1.i1,test.t1.v1 7 10.00 Using where; Using join buffer (flat, BNLH join)
+1 PRIMARY t2 hash_index v1 #hash#v1:v1 4:9 test.t1.v1 10 10.00 Using index; End temporary; Using join buffer (incremental, BNLH join)
Warnings:
-Note 1003 select `test`.`temp`.`f1` AS `f1`,`test`.`temp`.`f2` AS `f2` from `test`.`temp` semi join (`test`.`t2` join `test`.`t1`) where `test`.`t2`.`v1` = `test`.`t1`.`v1`
+Note 1003 select `test`.`temp`.`f1` AS `f1`,`test`.`temp`.`f2` AS `f2` from `test`.`temp` semi join (`test`.`t2` join `test`.`t1`) where `test`.`temp`.`f1` = `test`.`t1`.`i1` and `test`.`temp`.`f2` = `test`.`t1`.`v1` and `test`.`t2`.`v1` = `test`.`t1`.`v1`
DROP TABLE t1,t2,temp;
set join_cache_level=@save_join_cache_level;
#
@@ -6163,9 +6161,9 @@ b c d e
EXPLAIN SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t4 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t4.e 2 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t3 hash_index d #hash#d:d 5:5 test.t2.c 2 Using where; Using index; Using join buffer (incremental, BNLH join)
-1 SIMPLE t4 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.b 2 Using index; Using join buffer (incremental, BNLH join)
SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e;
a b c d e
1 1 2 2 1
@@ -6176,9 +6174,9 @@ EXPLAIN SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b
WHERE e IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t4 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index; Not exists; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t4.e 2 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t3 hash_index d #hash#d:d 5:5 test.t2.c 2 Using where; Using index; Using join buffer (incremental, BNLH join)
-1 SIMPLE t4 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.b 2 Using where; Using index; Not exists; Using join buffer (incremental, BNLH join)
SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e
WHERE e IS NULL;
a b c d e
diff --git a/mysql-test/main/join_cache_cardinality.result b/mysql-test/main/join_cache_cardinality.result
new file mode 100644
index 00000000000..de6b99f4b3a
--- /dev/null
+++ b/mysql-test/main/join_cache_cardinality.result
@@ -0,0 +1,105 @@
+create table t1 (a int, b int, c int);
+insert into t1 select seq,seq/2, seq/4 from seq_1_to_100;
+create table t2 (a int, b int, c int);
+insert into t2 select seq, seq/2, seq/4 from seq_1_to_200;
+analyze table t1,t2 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze status OK
+set optimizer_trace=1;
+set join_cache_level=6;
+set optimizer_switch='hash_join_cardinality=on';
+explain select *
+from t1, t2
+where t1.a=t2.a and t1.a=t2.b and t1.c=t2.c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 15 test.t1.a,test.t1.a,test.t1.c 200 Using where; Using join buffer (flat, BNLH join)
+set @json= (select trace from information_schema.optimizer_trace);
+select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS;
+JS
+[
+ {
+ "hash_join_columns":
+ [
+ {
+ "field": "a",
+ "avg_frequency": 1
+ },
+ {
+ "field": "b",
+ "avg_frequency": 2
+ },
+ {
+ "field": "c",
+ "avg_frequency": 3.9216
+ }
+ ],
+ "rows": 1
+ }
+]
+select json_detailed(json_extract(@json, '$**.rest_of_plan[*].rows_for_plan'))
+as ROWS_FOR_PLAN;
+ROWS_FOR_PLAN
+[100]
+explain select *
+from t1, t2 where t1.c=t2.c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.c 200 Using where; Using join buffer (flat, BNLH join)
+set @json= (select trace from information_schema.optimizer_trace);
+select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS;
+JS
+[
+ {
+ "hash_join_columns":
+ [
+ {
+ "field": "c",
+ "avg_frequency": 3.9216
+ }
+ ],
+ "rows": 3.9216
+ }
+]
+select json_detailed(json_extract(@json, '$**.rest_of_plan[*].rows_for_plan'))
+as ROWS_FOR_PLAN;
+ROWS_FOR_PLAN
+[392.16]
+explain select *
+from t1 straight_join t2 where t1.c=t2.c and t2.a<30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.c 200 Using where; Using join buffer (flat, BNLH join)
+set @json= (select trace from information_schema.optimizer_trace);
+# Note that rows is the same:
+select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS;
+JS
+[
+ {
+ "hash_join_columns":
+ [
+ {
+ "field": "c",
+ "avg_frequency": 3.9216
+ }
+ ],
+ "rows": 0.568632
+ }
+]
+# Despite available selectivity:
+select json_detailed(json_extract(@json, '$**.selectivity_for_columns')) as JS;
+JS
+[
+ [
+ {
+ "column_name": "a",
+ "ranges":
+ ["NULL < a < 30"],
+ "selectivity_from_histogram": 0.145
+ }
+ ]
+]
+drop table t1,t2;
diff --git a/mysql-test/main/join_cache_cardinality.test b/mysql-test/main/join_cache_cardinality.test
new file mode 100644
index 00000000000..b178810b807
--- /dev/null
+++ b/mysql-test/main/join_cache_cardinality.test
@@ -0,0 +1,41 @@
+--source include/have_sequence.inc
+
+# Embedded doesn't have optimizer trace:
+--source include/not_embedded.inc
+
+create table t1 (a int, b int, c int);
+insert into t1 select seq,seq/2, seq/4 from seq_1_to_100;
+
+create table t2 (a int, b int, c int);
+insert into t2 select seq, seq/2, seq/4 from seq_1_to_200;
+
+analyze table t1,t2 persistent for all;
+
+set optimizer_trace=1;
+set join_cache_level=6;
+set optimizer_switch='hash_join_cardinality=on';
+explain select *
+from t1, t2
+where t1.a=t2.a and t1.a=t2.b and t1.c=t2.c;
+
+set @json= (select trace from information_schema.optimizer_trace);
+select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS;
+select json_detailed(json_extract(@json, '$**.rest_of_plan[*].rows_for_plan'))
+as ROWS_FOR_PLAN;
+
+explain select *
+from t1, t2 where t1.c=t2.c;
+set @json= (select trace from information_schema.optimizer_trace);
+select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS;
+select json_detailed(json_extract(@json, '$**.rest_of_plan[*].rows_for_plan'))
+as ROWS_FOR_PLAN;
+
+explain select *
+from t1 straight_join t2 where t1.c=t2.c and t2.a<30;
+set @json= (select trace from information_schema.optimizer_trace);
+--echo # Note that rows is the same:
+select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS;
+
+--echo # Despite available selectivity:
+select json_detailed(json_extract(@json, '$**.selectivity_for_columns')) as JS;
+drop table t1,t2;
diff --git a/mysql-test/main/join_nested_jcl6.result b/mysql-test/main/join_nested_jcl6.result
index d5c46d48e68..3c292484c9e 100644
--- a/mysql-test/main/join_nested_jcl6.result
+++ b/mysql-test/main/join_nested_jcl6.result
@@ -61,8 +61,8 @@ LEFT JOIN
ON t2.b=t4.b;
a b a b a b
4 2 1 2 3 2
-4 2 2 2 3 2
4 2 1 2 4 2
+4 2 2 2 3 2
4 2 2 2 4 2
3 3 NULL NULL NULL NULL
5 3 NULL NULL NULL NULL
@@ -85,8 +85,8 @@ ON t2.b=t4.b
WHERE t3.a=1 OR t3.c IS NULL;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00
-1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) where `test`.`t3`.`a` = 1 or `test`.`t3`.`c` is null
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
@@ -139,16 +139,16 @@ LEFT JOIN
ON t2.b=t4.b;
a b a b a b a b
4 2 1 2 3 2 3 1
-4 2 2 2 3 2 3 1
4 2 1 2 4 2 3 1
+4 2 2 2 3 2 3 1
4 2 2 2 4 2 3 1
4 2 1 2 3 2 2 2
-4 2 2 2 3 2 2 2
4 2 1 2 4 2 2 2
+4 2 2 2 3 2 2 2
4 2 2 2 4 2 2 2
4 2 1 2 3 2 3 3
-4 2 2 2 3 2 3 3
4 2 1 2 4 2 3 3
+4 2 2 2 3 2 3 3
4 2 2 2 4 2 3 3
3 3 NULL NULL NULL NULL NULL NULL
5 3 NULL NULL NULL NULL NULL NULL
@@ -161,8 +161,8 @@ ON t2.b=t4.b
WHERE t3.a>1 OR t3.c IS NULL;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00
-1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4` join `test`.`t5`) on(`test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) where `test`.`t3`.`a` > 1 or `test`.`t3`.`c` is null
@@ -191,8 +191,8 @@ WHERE (t3.a>1 OR t3.c IS NULL) AND
(t5.a<3 OR t5.c IS NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00
-1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4` join `test`.`t5`) on(`test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) where (`test`.`t3`.`a` > 1 or `test`.`t3`.`c` is null) and (`test`.`t5`.`a` < 3 or `test`.`t5`.`c` is null)
@@ -242,7 +242,7 @@ ON t7.b=t8.b AND t6.b < 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join)
-1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t7.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t7.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
Warnings:
Note 1003 select `test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t7`.`b` and `test`.`t6`.`b` < 10 and `test`.`t7`.`b` is not null) where 1
SELECT t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
@@ -556,14 +556,14 @@ t0.b=t1.b AND
(t2.a >= 4 OR t2.c IS NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 10.00 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join)
-1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
Warnings:
Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null)
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
@@ -651,17 +651,17 @@ t0.b=t1.b AND
(t9.a=1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 10.00 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
Warnings:
-Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null)
+Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t3`.`b` = `test`.`t4`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null)
SELECT t9.a,t9.b
FROM t9;
a b
@@ -849,8 +849,8 @@ WHERE t1.a <= 2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t1` join `test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) where `test`.`t1`.`a` <= 2
INSERT INTO t2 VALUES (-1,9,0), (-3,10,0), (-2,8,0), (-4,11,0), (-5,15,0);
@@ -919,17 +919,17 @@ t0.b=t1.b AND
(t9.a=1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 10.00 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
Warnings:
-Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null)
+Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t3`.`b` = `test`.`t4`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null)
INSERT INTO t4 VALUES (-3,12,0), (-4,13,0), (-1,11,0), (-3,11,0), (-5,15,0);
INSERT INTO t5 VALUES (-3,11,0), (-2,12,0), (-3,13,0), (-4,12,0);
CREATE INDEX idx_b ON t4(b);
@@ -971,12 +971,12 @@ t0.b=t1.b AND
(t9.a=1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 10.00 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE t5 ALL idx_b NULL NULL NULL 7 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 1 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
@@ -1021,10 +1021,10 @@ t0.b=t1.b AND
(t9.a=1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 10.00 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE t5 ALL idx_b NULL NULL NULL 7 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 1 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (incremental, BNL join)
@@ -1075,7 +1075,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ref idx_b idx_b 5 test.t0.b 1 100.00 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE t5 ALL idx_b NULL NULL NULL 7 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 1 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (incremental, BNL join)
@@ -1848,8 +1848,8 @@ ON t1.a=t2.a
WHERE t3.a IS NULL;
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
-1 SIMPLE t2 hash_ALL NULL #hash#$hj 4 test.t1.a 1 100.00 Using where; Using join buffer (flat, BNLH join)
-1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t1.a 1 100.00 Using where; Not exists; Using join buffer (incremental, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 4 test.t1.a 1 10.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t1.a 1 10.00 Using where; Not exists; Using join buffer (incremental, BNLH join)
1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t3.a 0 0.00 Using where; Using join buffer (incremental, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`b` AS `b` from `test`.`t1` left join (`test`.`t2` left join `test`.`t3` on(`test`.`t3`.`b` = `test`.`t1`.`a`) left join `test`.`t4` on(`test`.`t4`.`b` = `test`.`t3`.`a` and `test`.`t3`.`a` is not null)) on(`test`.`t2`.`a` = `test`.`t1`.`a`) where `test`.`t3`.`a` is null
diff --git a/mysql-test/main/join_outer_jcl6.result b/mysql-test/main/join_outer_jcl6.result
index ff5e76b78ad..a34bf96a0ef 100644
--- a/mysql-test/main/join_outer_jcl6.result
+++ b/mysql-test/main/join_outer_jcl6.result
@@ -2230,8 +2230,8 @@ SELECT * FROM t1 LEFT JOIN t2 LEFT JOIN t3 ON i2 = i3 ON i1 = i3
WHERE d3 IS NULL;
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
-1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.i1 2 100.00 Using where; Using join buffer (flat, BNLH join)
-1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t1.i1 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.i1 2 10.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t1.i1 2 10.00 Using where; Using join buffer (incremental, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t2`.`i2` AS `i2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`d3` AS `d3` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`i2` = `test`.`t1`.`i1` and `test`.`t3`.`i3` = `test`.`t1`.`i1` and `test`.`t1`.`i1` is not null and `test`.`t1`.`i1` is not null) where `test`.`t3`.`d3` = 0 or `test`.`t3`.`d3` is null
DROP TABLE t1,t2,t3;
@@ -2251,7 +2251,7 @@ WHERE b IN (1,2,3) OR b = d;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 const 2 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 const 2 10.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select 10 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t2` left join `test`.`t3` on(`test`.`t3`.`d` = 10 and 10 is not null) where `test`.`t2`.`c` = 8 and `test`.`t3`.`d` = 8
SELECT * FROM t1 INNER JOIN t2 ON c = b LEFT JOIN t3 ON d = a
@@ -2368,7 +2368,7 @@ ON t1.x = t2.x
WHERE IFNULL(t2.x,0)=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
-1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 2 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 2 10.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on(`test`.`t2`.`x` = `test`.`t1`.`x` and `test`.`t1`.`x` is not null) where ifnull(`test`.`t2`.`x`,0) = 0
SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0)
@@ -2384,7 +2384,7 @@ ON t1.x = t2.x
WHERE f(t2.x,0)=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
-1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 2 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 2 10.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on(`test`.`t2`.`x` = `test`.`t1`.`x` and `test`.`t1`.`x` is not null) where `f`(`test`.`t2`.`x`,0) = 0
drop function f;
@@ -2424,7 +2424,7 @@ FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE IFNULL(t2.col3,0) = 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
-1 SIMPLE t2 hash_ALL NULL #hash#$hj 17 test.t1.col1 2 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 17 test.t1.col1 2 10.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`col2` = `test`.`t1`.`col1` and `test`.`t1`.`col1` is not null) where ifnull(`test`.`t2`.`col3`,0) = 0
SELECT t1.col1, t2.col1, t2.col3
@@ -2438,7 +2438,7 @@ FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE f1(t2.col3,0) = 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
-1 SIMPLE t2 hash_ALL NULL #hash#$hj 17 test.t1.col1 2 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 17 test.t1.col1 2 10.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`col2` = `test`.`t1`.`col1` and `test`.`t1`.`col1` is not null) where `f1`(`test`.`t2`.`col3`,0) = 0
DROP FUNCTION f1;
@@ -2542,7 +2542,7 @@ a b
explain extended select * from t1 left join t2 on a=b where (b > 3) is not true;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
-1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 3 10.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` is not null) where `test`.`t2`.`b` > 3 is not true
select * from t1 left join t2 on a=b where (b > 3) is not false;
@@ -2552,7 +2552,7 @@ a b
explain extended select * from t1 left join t2 on a=b where (b > 3) is not false;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
-1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 3 10.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` is not null) where `test`.`t2`.`b` > 3 is not false
drop table t1,t2;
@@ -2783,8 +2783,8 @@ id select_type table type possible_keys key key_len ref rows Extra
explain select * from t1 left join (t3 join t2) on t1.a=t3.b and t3.a<5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 10
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t3 hash_range a #hash#$hj:a 5:5 test.t1.a 5 Using where; Rowid-ordered scan; Using join buffer (incremental, BNLH join)
+1 SIMPLE t3 hash_range a #hash#$hj:a 5:5 test.t1.a 5 Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join)
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using join buffer (incremental, BNL join)
#
# .. part 2: make sure condition selectivity can use the condition too.
#
diff --git a/mysql-test/main/kill-2.result b/mysql-test/main/kill-2.result
index daaba2c092a..0f9d069aacc 100644
--- a/mysql-test/main/kill-2.result
+++ b/mysql-test/main/kill-2.result
@@ -10,3 +10,34 @@ foo
root
kill user foo@'127.0.0.1';
drop user foo@'127.0.0.1';
+#
+# KILL USER and missing privileges
+#
+create user a@'127.0.0.1';
+create user b@'127.0.0.1';
+grant process on *.* to a@'127.0.0.1';
+grant select on *.* to b@'127.0.0.1';
+connect a,127.0.0.1,a;
+show grants;
+Grants for a@127.0.0.1
+GRANT PROCESS ON *.* TO `a`@`127.0.0.1`
+connect b,127.0.0.1,b;
+show processlist;
+Id User Host db Command Time State Info Progress
+# b # test # # starting show processlist #
+kill user a;
+kill user x;
+connection a;
+show processlist;
+Id User Host db Command Time State Info Progress
+# root # test # # # # #
+# a # NULL # # # # #
+# b # test # # # # #
+kill user b;
+ERROR HY000: Operation KILL USER failed for b@%
+connection default;
+drop user a@'127.0.0.1';
+drop user b@'127.0.0.1';
+#
+# End of 10.3 tests
+#
diff --git a/mysql-test/main/kill-2.test b/mysql-test/main/kill-2.test
index 6d40e14a700..9bc4fe03346 100644
--- a/mysql-test/main/kill-2.test
+++ b/mysql-test/main/kill-2.test
@@ -27,3 +27,30 @@ let $wait_condition=
--source include/wait_condition.inc
drop user foo@'127.0.0.1';
--enable_service_connection
+
+--echo #
+--echo # KILL USER and missing privileges
+--echo #
+create user a@'127.0.0.1';
+create user b@'127.0.0.1';
+grant process on *.* to a@'127.0.0.1';
+grant select on *.* to b@'127.0.0.1';
+--connect a,127.0.0.1,a
+show grants;
+--connect b,127.0.0.1,b
+--replace_column 1 # 3 # 5 # 6 # 9 #
+show processlist;
+kill user a; # existing connection, but not visible to current_user
+kill user x; # not existing connection
+--connection a
+--replace_column 1 # 3 # 5 # 6 # 7 # 8 # 9 #
+show processlist;
+--error ER_KILL_DENIED_ERROR
+kill user b;
+--connection default
+drop user a@'127.0.0.1';
+drop user b@'127.0.0.1';
+
+--echo #
+--echo # End of 10.3 tests
+--echo #
diff --git a/mysql-test/main/locale.result b/mysql-test/main/locale.result
index 39f11053df6..b1d41709a9d 100644
--- a/mysql-test/main/locale.result
+++ b/mysql-test/main/locale.result
@@ -307,6 +307,16 @@ select date_format('2001-09-01', '%c %b %M', 'de_CH');
date_format('2001-09-01', '%c %b %M', 'de_CH')
9 Sep September
#
+# MDEV-30630 locale: Chinese error message for ZH_CN
+#
+SET lc_messages=ZH_CN;
+SELECT x;
+ERROR 42S22: 未知列'x'在'field list'
+SET lc_messages=DEFAULT;
+#
+# End of 10.4 tests
+#
+#
# MDEV-30789 Add Georgian error messages and locale
#
SET lc_messages=ka_GE;
@@ -314,5 +324,47 @@ SELECT x;
ERROR 42S22: უცნობი სვეტი 'x' 'field list'-ში
SET lc_messages=DEFAULT;
#
+# MDEV-30997 SIGSEGV in __strlen_avx2 | make_date_time | Item_func_date_format::val_str
+#
+SET lc_messages=en_US;
+SET lc_time_names=111;
+SELECT DATE_FORMAT('1-12-01','%c %b %M');
+DATE_FORMAT('1-12-01','%c %b %M')
+12 დეკ დეკემბერი
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12);
+SELECT d, DATE_FORMAT(d, '%b') AS MONTH_ABBR, MONTHNAME(d) FROM
+(
+SELECT CAST(CONCAT('2001-', i, '-01') AS DATE) AS d FROM t1
+) d1 ORDER BY d;
+d MONTH_ABBR MONTHNAME(d)
+2001-01-01 იან იანვარი
+2001-02-01 თებ თებერვალი
+2001-03-01 მარ მარტი
+2001-04-01 აპრ აპრილი
+2001-05-01 მაი მაისი
+2001-06-01 ივნ ივნისი
+2001-07-01 ივლ ივლისი
+2001-08-01 აგვ აგვისტო
+2001-09-01 სექტ სექტემბერი
+2001-10-01 ოქტ ოქტომბერი
+2001-11-01 ნოე ნოემბერი
+2001-12-01 დეკ დეკემბერი
+SELECT d, WEEKDAY(d), DATE_FORMAT(d, '%a') AS DAY_ABBR, DAYNAME(d) FROM
+(
+SELECT CAST(CONCAT('2001-01-', i) AS DATE) AS d FROM t1 WHERE i BETWEEN 1 AND 7
+) d1 ORDER BY d;
+d WEEKDAY(d) DAY_ABBR DAYNAME(d)
+2001-01-01 0 ორშ ორშაბათი
+2001-01-02 1 სამშ სამშაბათი
+2001-01-03 2 ოთხშ ოთხშაბათი
+2001-01-04 3 ხუთშ ხუთშაბათი
+2001-01-05 4 პარ პარასკევი
+2001-01-06 5 შაბ შაბათი
+2001-01-07 6 კვ კვირა
+DROP TABLE t1;
+SET lc_time_names=DEFAULT;
+SET lc_messages=DEFAULT;
+#
# End of 10.11 tests
#
diff --git a/mysql-test/main/locale.test b/mysql-test/main/locale.test
index 9f4ceb270d9..c99f2cb3865 100644
--- a/mysql-test/main/locale.test
+++ b/mysql-test/main/locale.test
@@ -182,6 +182,20 @@ select date_format('2001-12-01', '%c %b %M', 'rm_CH');
select date_format('2001-01-06', '%w %a %W', 'de_CH');
select date_format('2001-09-01', '%c %b %M', 'de_CH');
+--echo #
+--echo # MDEV-30630 locale: Chinese error message for ZH_CN
+--echo #
+
+SET lc_messages=ZH_CN;
+--error ER_BAD_FIELD_ERROR
+SELECT x;
+
+SET lc_messages=DEFAULT;
+
+--echo #
+--echo # End of 10.4 tests
+--echo #
+
--echo #
--echo # MDEV-30789 Add Georgian error messages and locale
@@ -193,6 +207,32 @@ SELECT x;
SET lc_messages=DEFAULT;
+
+--echo #
+--echo # MDEV-30997 SIGSEGV in __strlen_avx2 | make_date_time | Item_func_date_format::val_str
+--echo #
+
+SET lc_messages=en_US;
+SET lc_time_names=111;
+SELECT DATE_FORMAT('1-12-01','%c %b %M');
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12);
+SELECT d, DATE_FORMAT(d, '%b') AS MONTH_ABBR, MONTHNAME(d) FROM
+(
+ SELECT CAST(CONCAT('2001-', i, '-01') AS DATE) AS d FROM t1
+) d1 ORDER BY d;
+
+SELECT d, WEEKDAY(d), DATE_FORMAT(d, '%a') AS DAY_ABBR, DAYNAME(d) FROM
+(
+ SELECT CAST(CONCAT('2001-01-', i) AS DATE) AS d FROM t1 WHERE i BETWEEN 1 AND 7
+) d1 ORDER BY d;
+
+
+DROP TABLE t1;
+SET lc_time_names=DEFAULT;
+SET lc_messages=DEFAULT;
+
+
--echo #
--echo # End of 10.11 tests
--echo #
diff --git a/mysql-test/main/long_unique_bugs.result b/mysql-test/main/long_unique_bugs.result
index 283ea870a5f..ed13c668ec3 100644
--- a/mysql-test/main/long_unique_bugs.result
+++ b/mysql-test/main/long_unique_bugs.result
@@ -451,6 +451,12 @@ a b
1 xxx
drop table t1;
#
+# MDEV-22756 SQL Error (1364): Field 'DB_ROW_HASH_1' doesn't have a default value
+#
+create table t1 (f text not null, unique (f));
+insert into t1 (f) select 'f';
+drop table t1;
+#
# End of 10.4 tests
#
#
diff --git a/mysql-test/main/long_unique_bugs.test b/mysql-test/main/long_unique_bugs.test
index 27bb402bd8b..6fc29e1d2dd 100644
--- a/mysql-test/main/long_unique_bugs.test
+++ b/mysql-test/main/long_unique_bugs.test
@@ -444,6 +444,13 @@ select * from t1;
drop table t1;
--echo #
+--echo # MDEV-22756 SQL Error (1364): Field 'DB_ROW_HASH_1' doesn't have a default value
+--echo #
+create table t1 (f text not null, unique (f));
+insert into t1 (f) select 'f';
+drop table t1;
+
+--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/myisam_explain_non_select_all.result b/mysql-test/main/myisam_explain_non_select_all.result
index 28107af3770..84b8d9ae4c5 100644
--- a/mysql-test/main/myisam_explain_non_select_all.result
+++ b/mysql-test/main/myisam_explain_non_select_all.result
@@ -15,6 +15,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t1 SET a = 10 WHERE a < 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 update `test`.`t1` set `test`.`t1`.`a` = 10 where `test`.`t1`.`a` < 10
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 2
@@ -54,6 +56,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t1 WHERE a < 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` < 10
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 2
@@ -93,6 +97,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t1 USING t1 WHERE a = 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 delete from `test`.`t1` using `test`.`t1` where `test`.`t1`.`a` = 1
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 2
@@ -136,6 +142,8 @@ EXPLAIN EXTENDED UPDATE t1, t2 SET t1.a = 10 WHERE t1.a = 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 update `test`.`t1` join `test`.`t2` set `test`.`t1`.`a` = 10 where `test`.`t1`.`a` = 1
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -182,6 +190,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t11 ALL NULL NULL NULL NULL 3 100.00 Using where
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 100.00
2 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 /* select#1 */ update `test`.`t1` `t11` join (/* select#2 */ select `test`.`t2`.`b` AS `b` from `test`.`t2`) `t12` set `test`.`t11`.`a` = 10 where `test`.`t11`.`a` = 1
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -226,6 +236,8 @@ EXPLAIN EXTENDED UPDATE t1 SET a = 10 WHERE 1 IN (SELECT 1 FROM t2 WHERE
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 33.33 Using where; FirstMatch
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 update `test`.`t1` semi join (`test`.`t2`) set `test`.`t1`.`a` = 10 where `test`.`t2`.`b` < 3
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -273,6 +285,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 33.33 Using where; FirstMatch(t1)
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1003 update `test`.`t1` semi join (`test`.`t2`) set `test`.`t1`.`a` = 10 where `test`.`t2`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` < 3
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -325,6 +338,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 4 100.00
2 MATERIALIZED t3 ALL NULL NULL NULL NULL 1004 100.00 Using where
+Warnings:
+Note 1003 update `test`.`t1` semi join (`test`.`t3`) join `test`.`t2` set `test`.`t1`.`a` = 10 where `test`.`t3`.`b` < 3
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 6
@@ -373,6 +388,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t11 ALL NULL NULL NULL NULL 3 100.00
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 100.00
2 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 /* select#1 */ update `test`.`t1` `t11` join (/* select#2 */ select `test`.`t2`.`b` AS `b` from `test`.`t2`) `t12` set `test`.`t11`.`a` = `test`.`t11`.`a` + 10
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -421,6 +438,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 1 100.00
1 PRIMARY t11 ALL NULL NULL NULL NULL 3 100.00
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 /* select#1 */ update `test`.`t1` `t11` set `test`.`t11`.`a` = `test`.`t11`.`a` + 10
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 2
@@ -471,6 +490,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t11 ALL NULL NULL NULL NULL 3 100.00 Using where
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 100.00
2 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 /* select#1 */ update `test`.`t1` `t11` join (/* select#2 */ select `test`.`t2`.`b` AS `b` from `test`.`t2`) `t12` set `test`.`t11`.`a` = 10 where `test`.`t11`.`a` > 1
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -511,6 +532,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t1 WHERE a > 1 LIMIT 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` > 1 limit 1
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 2
@@ -550,6 +573,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t1 WHERE 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 delete from `test`.`t1` using dual where 0
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 2
@@ -586,6 +611,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t1 USING t1 WHERE 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 delete from `test`.`t1` using `test`.`t1` where 0
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 2
@@ -622,6 +649,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t1 WHERE a = 3;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range a a 5 NULL 1 100.00 Using where
+Warnings:
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` = 3
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 5
@@ -659,6 +688,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t1 WHERE a < 3;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range a a 5 NULL 1 100.00 Using where
+Warnings:
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` < 3
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 5
@@ -694,6 +725,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` > 0 order by `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 3
@@ -729,6 +762,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where
+Warnings:
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` > 0 order by `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 3
@@ -768,6 +803,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t1 WHERE (@a:= a) ORDER BY a LIMIT 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 1 100.00 Using where
+Warnings:
+Note 1003 delete from `test`.`t1` using dual where @a:=`test`.`t1`.`a` order by `test`.`t1`.`a` limit 1
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 3
@@ -808,6 +845,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t1 ORDER BY a ASC, b ASC LIMIT 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using filesort
+Warnings:
+Note 1003 delete from `test`.`t1` using dual order by `test`.`t1`.`a`,`test`.`t1`.`b` limit 1
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 7
@@ -861,6 +900,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a1 1 100.00
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 8 test.t2.b2,test.t1.b1 1 100.00
+Warnings:
+Note 1003 delete from `test`.`t1`,`test`.`t2`,`test`.`t3` using `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t2`.`a2` = `test`.`t1`.`a1` and `test`.`t3`.`a3` = `test`.`t2`.`b2` and `test`.`t3`.`b3` = `test`.`t1`.`b1`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 13
@@ -909,6 +950,8 @@ EXPLAIN EXTENDED UPDATE t1 SET a = 10 WHERE a IN (SELECT a FROM t2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 4 25.00 Using where; FirstMatch(t1)
+Warnings:
+Note 1003 update `test`.`t1` semi join (`test`.`t2`) set `test`.`t1`.`a` = 10 where `test`.`t2`.`a` = `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -954,6 +997,8 @@ EXPLAIN EXTENDED DELETE FROM t1 WHERE a1 IN (SELECT a2 FROM t2 WHERE a2 > 2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ delete from `test`.`t1` using dual where <in_optimizer>(`test`.`t1`.`a1`,<exists>(/* select#2 */ select `test`.`t2`.`a2` from `test`.`t2` where `test`.`t2`.`a2` > 2 and <cache>(`test`.`t1`.`a1`) = `test`.`t2`.`a2`))
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -995,6 +1040,8 @@ EXPLAIN EXTENDED DELETE FROM t1 WHERE a1 IN (SELECT a2 FROM t2 WHERE a2 > 2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 20.00 Using where; FirstMatch(t1)
+Warnings:
+Note 1003 delete from `test`.`t1` using (`test`.`t2`) where `test`.`t2`.`a2` > 2 and `test`.`t1`.`a1` = `test`.`t2`.`a2`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -1035,6 +1082,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t1 SET i = 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00
+Warnings:
+Note 1003 update `test`.`t1` set `test`.`t1`.`i` = 10
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 3
@@ -1074,6 +1123,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL 5 NULL Deleting all rows
+Warnings:
+Note 1003 delete from `test`.`t1` using dual
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 3
@@ -1116,6 +1167,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where
+Warnings:
+Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 8
@@ -1158,6 +1211,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED INSERT INTO t2 SELECT * FROM t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 insert into `test`.`t2` select `test`.`t1`.`i` AS `i` from `test`.`t1`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -1198,6 +1253,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED REPLACE INTO t2 SELECT * FROM t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 replace into `test`.`t2` select `test`.`t1`.`i` AS `i` from `test`.`t1`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -1236,6 +1293,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED INSERT INTO t1 SET i = 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL
+Warnings:
+Note 1003 insert into `test`.`t1`(i) values (10)
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 2
@@ -1259,6 +1318,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED REPLACE INTO t1 SET i = 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL
+Warnings:
+Note 1003 replace into `test`.`t1`(i) values (10)
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 2
@@ -1285,6 +1346,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t1 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 5 100.00 Using where
+Warnings:
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`i` > 10 and `test`.`t1`.`i` <= 18 order by `test`.`t1`.`i` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -1326,6 +1389,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t1 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort
+Warnings:
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`i` > 10 and `test`.`t1`.`i` <= 18 order by `test`.`t1`.`i` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -1375,6 +1440,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where
+Warnings:
+Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 8
@@ -1421,6 +1488,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where
+Warnings:
+Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 8
@@ -1466,6 +1535,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort
+Warnings:
+Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 8
@@ -1516,6 +1587,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort
+Warnings:
+Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 8
@@ -1567,6 +1640,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index_merge key1,key2 key1,key2 5,5 NULL 7 100.00 Using sort_union(key1,key2); Using where; Using filesort
+Warnings:
+Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`key1` < 13 or `test`.`t2`.`key2` < 14 order by `test`.`t2`.`key1`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 6
@@ -1616,6 +1691,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 5 100.00 Using where
+Warnings:
+Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` desc limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -1659,6 +1736,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t2 ORDER BY a, b DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using filesort
+Warnings:
+Note 1003 delete from `test`.`t2` using dual order by `test`.`t2`.`a`,`test`.`t2`.`b` desc limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 6
@@ -1709,6 +1788,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t2 ORDER BY a DESC, b DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index NULL a 6 NULL 5 100.00
+Warnings:
+Note 1003 delete from `test`.`t2` using dual order by `test`.`t2`.`a` desc,`test`.`t2`.`b` desc limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 6
@@ -1754,6 +1835,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t2 SET a = 10 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 5 100.00 Using where; Using buffer
+Warnings:
+Note 1003 update `test`.`t2` set `test`.`t2`.`a` = 10 where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -1798,6 +1881,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t2 SET a = 10 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort
+Warnings:
+Note 1003 update `test`.`t2` set `test`.`t2`.`a` = 10 where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -1848,6 +1933,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where; Using buffer
+Warnings:
+Note 1003 update `test`.`t2` set `test`.`t2`.`d` = 10 where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 8
@@ -1895,6 +1982,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where; Using buffer
+Warnings:
+Note 1003 update `test`.`t2` set `test`.`t2`.`d` = 10 where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 8
@@ -1941,6 +2030,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort
+Warnings:
+Note 1003 update `test`.`t2` set `test`.`t2`.`d` = 10 where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 8
@@ -1991,6 +2082,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort
+Warnings:
+Note 1003 update `test`.`t2` set `test`.`t2`.`d` = 10 where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 8
@@ -2042,6 +2135,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t2 SET i = 123 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index_merge key1,key2 key1,key2 5,5 NULL 7 100.00 Using sort_union(key1,key2); Using where; Using filesort
+Warnings:
+Note 1003 update `test`.`t2` set `test`.`t2`.`i` = 123 where `test`.`t2`.`key1` < 13 or `test`.`t2`.`key2` < 14 order by `test`.`t2`.`key1`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 6
@@ -2091,6 +2186,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t2 SET a = 10 WHERE i > 10 AND i <= 18 ORDER BY i DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 5 100.00 Using where; Using buffer
+Warnings:
+Note 1003 update `test`.`t2` set `test`.`t2`.`a` = 10 where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` desc limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -2135,6 +2232,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t2 SET c = 10 ORDER BY a, b DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using filesort
+Warnings:
+Note 1003 update `test`.`t2` set `test`.`t2`.`c` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`b` desc limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 6
@@ -2186,6 +2285,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t2 SET c = 10 ORDER BY a DESC, b DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index NULL a 6 NULL 5 100.00 Using buffer
+Warnings:
+Note 1003 update `test`.`t2` set `test`.`t2`.`c` = 10 order by `test`.`t2`.`a` desc,`test`.`t2`.`b` desc limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 6
@@ -2234,6 +2335,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t1 SET c2 = 0 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range c1_idx c1_idx 2 NULL 2 100.00 Using where; Using filesort
+Warnings:
+Note 1003 update `test`.`t1` set `test`.`t1`.`c2` = 0 where `test`.`t1`.`c1_idx` = 'y' order by `test`.`t1`.`pk` desc limit 2
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 6
@@ -2276,6 +2379,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range c1_idx c1_idx 2 NULL 2 100.00 Using where; Using filesort
+Warnings:
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`c1_idx` = 'y' order by `test`.`t1`.`pk` desc limit 2
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 6
@@ -2321,6 +2426,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t1 SET a=a+10 WHERE a > 34;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using buffer
+Warnings:
+Note 1003 update `test`.`t1` set `test`.`t1`.`a` = `test`.`t1`.`a` + 10 where `test`.`t1`.`a` > 34
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 3
@@ -2364,6 +2471,8 @@ EXPLAIN EXTENDED UPDATE t1 LEFT JOIN t2 ON t1.c1 = t2.c1 SET t2.c2 = 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 system NULL NULL NULL NULL 0 0.00 Const row not found
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
+Warnings:
+Note 1003 update `test`.`t1` set NULL = 10
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 7
@@ -2403,6 +2512,8 @@ EXPLAIN EXTENDED UPDATE t1 LEFT JOIN t2 ON t1.c1 = t2.c1 SET t2.c2 = 10 W
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 system NULL NULL NULL NULL 0 0.00 Const row not found
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 update `test`.`t1` set NULL = 10 where `test`.`t1`.`c3` = 10
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 7
@@ -2451,6 +2562,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 DEPENDENT SUBQUERY t2 ref IDX IDX 5 test.t1.f1 1 100.00
Warnings:
Note 1276 Field or reference 'test.t1.f1' of SELECT #2 was resolved in SELECT #1
+Note 1003 /* select#1 */ update `test`.`t1` set `test`.`t1`.`f2` = (/* select#2 */ select max(`test`.`t2`.`f4`) from `test`.`t2` where `test`.`t2`.`f3` = `test`.`t1`.`f1`)
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 7
@@ -2520,6 +2632,8 @@ EXPLAIN EXTENDED UPDATE v1 SET a = 1 WHERE a > 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t11 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t12 ALL NULL NULL NULL NULL 2 100.00
+Warnings:
+Note 1003 update `test`.`t1` `t11` join `test`.`t1` `t12` set `test`.`t11`.`a` = 1 where `test`.`t11`.`a` > 0
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 2
@@ -2561,6 +2675,8 @@ 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
1 SIMPLE t11 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t12 ALL NULL NULL NULL NULL 2 100.00
+Warnings:
+Note 1003 update `test`.`t1` join `test`.`t1` `t11` join `test`.`t1` `t12` set `test`.`t11`.`a` = 1 where `test`.`t11`.`a` = `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 2
@@ -2606,6 +2722,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM v1 WHERE a < 4;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ delete from `test`.`t1` using dual where `test`.`t1`.`a` < 4
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 3
@@ -2653,6 +2771,8 @@ EXPLAIN EXTENDED DELETE v1 FROM t2, v1 WHERE t2.x = v1.a;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 100.00 Using where
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.x 1 100.00
+Warnings:
+Note 1003 delete from `test`.`t1` using `test`.`t2` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t2`.`x`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 6
@@ -2700,6 +2820,8 @@ EXPLAIN EXTENDED DELETE v1 FROM t2, v1 WHERE t2.x = v1.a;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 100.00 Using where
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.x 1 100.00
+Warnings:
+Note 1003 delete from `test`.`t1` using `test`.`t2` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t2`.`x`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 6
@@ -2742,6 +2864,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED INSERT INTO v1 VALUES (10);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL
+Warnings:
+Note 1003 insert into `test`.`t1`(x) values (10)
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 2
@@ -2780,6 +2904,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED INSERT INTO v1 SELECT * FROM t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found
+Warnings:
+Note 1003 insert into `test`.`t2`(x) /* select#1 */ select NULL AS `a` from `test`.`t1`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -2833,6 +2959,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
1 PRIMARY <derived3> eq_ref distinct_key distinct_key 5 test.t1.a 1 100.00
3 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00 Using filesort
+Warnings:
+Note 1003 /* select#1 */ update (/* select#3 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x` join `test`.`t1` set `test`.`t1`.`a` = 10 where `x`.`b` = `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -2882,6 +3010,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived3> eq_ref distinct_key distinct_key 5 test.t1.a 1 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00
3 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00 Using filesort
+Warnings:
+Note 1003 /* select#1 */ update (/* select#3 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x` join `test`.`t1` join `test`.`t2` set `test`.`t1`.`a` = 10 where `x`.`b` = `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -2933,6 +3063,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 100.00
4 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00 Using filesort
2 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 /* select#1 */ update (/* select#4 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x` join `test`.`t1` join (/* select#2 */ select `test`.`t2`.`b` AS `b` from `test`.`t2`) `y` set `test`.`t1`.`a` = 10 where `x`.`b` = `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -2979,6 +3111,8 @@ JOIN t1 AS a12 ON a12.c1 = a11.c1
);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 /* select#1 */ update `test`.`t3` set `test`.`t3`.`c3` = (/* select#2 */ select count(NULL) from `test`.`t1` `a11` straight_join `test`.`t2` `a21` join `test`.`t1` `a12` where 0)
DROP TABLE t1, t2, t3;
#73
CREATE TABLE t1 (id INT);
@@ -3005,6 +3139,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t1 SET a=a+1 WHERE a>10;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 1 100.00 Using where; Using buffer
+Warnings:
+Note 1003 update `test`.`t1` set `test`.`t1`.`a` = `test`.`t1`.`a` + 1 where `test`.`t1`.`a` > 10
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 3
@@ -3038,6 +3174,8 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t1 SET a=a+1 WHERE a>10 ORDER BY a+20;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 1 100.00 Using where; Using filesort
+Warnings:
+Note 1003 update `test`.`t1` set `test`.`t1`.`a` = `test`.`t1`.`a` + 1 where `test`.`t1`.`a` > 10 order by `test`.`t1`.`a` + 20
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 3
@@ -3061,6 +3199,61 @@ Handler_read_key 4
Sort_range 1
DROP TABLE t1;
+#75
+CREATE TABLE t1 (id INT PRIMARY KEY, i INT);
+#
+# query: INSERT INTO t1 VALUES (3,10), (7,11), (3,11) ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);
+# select:
+#
+EXPLAIN INSERT INTO t1 VALUES (3,10), (7,11), (3,11) ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);;
+id select_type table type possible_keys key key_len ref rows Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
+FLUSH STATUS;
+FLUSH TABLES;
+EXPLAIN EXTENDED INSERT INTO t1 VALUES (3,10), (7,11), (3,11) ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL
+Warnings:
+Note 1003 insert into `test`.`t1` values (3,10),(7,11),(3,11) on duplicate key update `test`.`t1`.`id` = last_insert_id(`test`.`t1`.`id`)
+# Status of EXPLAIN EXTENDED query
+Variable_name Value
+Handler_read_key 4
+# Status of testing query execution:
+Variable_name Value
+Handler_read_key 4
+Handler_read_rnd 1
+Handler_write 3
+
+DROP TABLE t1;
+#76
+CREATE TABLE t1 (id INT PRIMARY KEY, i INT);
+CREATE TABLE t2 (a INT, b INT);
+INSERT INTO t2 VALUES (1,10), (3,10), (7,11), (3,11);
+#
+# query: INSERT INTO t1 SELECT * FROM t2 ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);
+# select:
+#
+EXPLAIN INSERT INTO t1 SELECT * FROM t2 ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 4
+FLUSH STATUS;
+FLUSH TABLES;
+EXPLAIN EXTENDED INSERT INTO t1 SELECT * FROM t2 ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 4 100.00
+Warnings:
+Note 1003 insert into `test`.`t1` select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` on duplicate key update `test`.`t1`.`id` = last_insert_id(`test`.`t1`.`id`)
+# Status of EXPLAIN EXTENDED query
+Variable_name Value
+Handler_read_key 7
+# Status of testing query execution:
+Variable_name Value
+Handler_read_key 7
+Handler_read_rnd 1
+Handler_read_rnd_next 5
+Handler_write 4
+
+DROP TABLE t1,t2;
#
# Bug #12949629: CLIENT LOSES CONNECTION AFTER EXECUTING A PROCEDURE WITH
# EXPLAIN UPDATE/DEL/INS
diff --git a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result
index b6b35e44988..97548768a2d 100644
--- a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result
+++ b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result
@@ -10,13 +10,13 @@ CREATE TABLE time_zone_leap_second LIKE mysql.time_zone_leap_second;
set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
SET STATEMENT SQL_MODE='' FOR SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC;
set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_name''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_name ENGINE=InnoDB', 'do 0');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition_type''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0');
TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name;
@@ -59,13 +59,13 @@ execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_t
set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
SET STATEMENT SQL_MODE='' FOR SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC;
set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_name''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_name ENGINE=InnoDB', 'do 0');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition_type''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0');
TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name;
@@ -191,13 +191,13 @@ TRUNCATE TABLE time_zone_leap_second;
set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
SET STATEMENT SQL_MODE='' FOR SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC;
set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_name''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_name ENGINE=InnoDB', 'do 0');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition_type''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0');
/*M!100602 execute immediate if(@wsrep_cannot_replicate_tz, 'start transaction', 'LOCK TABLES time_zone WRITE,
time_zone_leap_second WRITE,
@@ -313,20 +313,20 @@ TRUNCATE TABLE time_zone_leap_second;
set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
SET STATEMENT SQL_MODE='' FOR SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC;
set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_name''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_name ENGINE=InnoDB', 'do 0');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition_type''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0');
/*M!100602 execute immediate if(@wsrep_cannot_replicate_tz, 'start transaction', 'LOCK TABLES time_zone WRITE,
time_zone_leap_second WRITE,
time_zone_name WRITE,
time_zone_transition WRITE,
time_zone_transition_type WRITE')*/;
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_leap_second_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_leap_second'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_leap_second_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_leap_second''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_leap_second ENGINE=InnoDB', 'do 0');
TRUNCATE TABLE time_zone_leap_second;
execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_leap_second ENGINE=', @time_zone_leap_second_engine), 'do 0');
@@ -497,13 +497,13 @@ set sql_mode=default;
set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
SET STATEMENT SQL_MODE='' FOR SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC;
set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_name''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_name ENGINE=InnoDB', 'do 0');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0');
-execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'", 'do 0');
+execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition_type''', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0');
TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name;
diff --git a/mysql-test/main/mysqlbinlog.test b/mysql-test/main/mysqlbinlog.test
index 430cdb708cd..9394ca3fbd3 100644
--- a/mysql-test/main/mysqlbinlog.test
+++ b/mysql-test/main/mysqlbinlog.test
@@ -534,7 +534,7 @@ remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn;
--echo # MYSQL_BINLOG std_data/master-bin.000001 --base64-output 2>&1
# The error produces the absolute path of the mysqlbinlog executable, remove it.
--replace_regex /.*mariadb-binlog.*:/mariadb-binlog:/i
---error 1
+--error 5
--exec $MYSQL_BINLOG std_data/master-bin.000001 --base64-output 2>&1
--echo #
diff --git a/mysql-test/main/mysqld--help,win.rdiff b/mysql-test/main/mysqld--help,win.rdiff
index a43d7f0d86c..3e9541d7d2f 100644
--- a/mysql-test/main/mysqld--help,win.rdiff
+++ b/mysql-test/main/mysqld--help,win.rdiff
@@ -1,6 +1,12 @@
---- a/mysql-test/r/mysqld--help.result
-+++ b/mysql-test/r/mysqld--help.result
-@@ -685,6 +685,7 @@
+@@ -180,6 +180,7 @@
+ --console Write error output on screen; don't remove the console
+ window on windows.
+ --core-file Write core on crashes
++ (Defaults to on; use --skip-core-file to disable.)
+ -h, --datadir=name Path to the database root directory
+ --date-format=name The DATE format (ignored)
+ --datetime-format=name
+@@ -650,6 +651,7 @@
Use MySQL-5.6 (instead of MariaDB-5.3) format for TIME,
DATETIME, TIMESTAMP columns.
(Defaults to on; use --skip-mysql56-temporal-format to disable.)
diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result
index fb059b8b988..dbb4fbc262d 100644
--- a/mysql-test/main/mysqld--help.result
+++ b/mysql-test/main/mysqld--help.result
@@ -190,7 +190,7 @@ The following specify which files/extra groups are read (specified before remain
ALWAYS
--console Write error output on screen; don't remove the console
window on windows.
- --core-file Write core on errors.
+ --core-file Write core on crashes
-h, --datadir=name Path to the database root directory
--date-format=name The DATE format (ignored)
--datetime-format=name
@@ -799,7 +799,8 @@ The following specify which files/extra groups are read (specified before remain
extended_keys, exists_to_in, orderby_uses_equalities,
condition_pushdown_for_derived, split_materialized,
condition_pushdown_for_subquery, rowid_filter,
- condition_pushdown_from_having, not_null_range_scan
+ condition_pushdown_from_having, not_null_range_scan,
+ hash_join_cardinality
--optimizer-trace=name
Controls tracing of the Optimizer:
optimizer_trace=option=val[,option=val...], where option
@@ -1583,6 +1584,7 @@ column-compression-zlib-wrap FALSE
completion-type NO_CHAIN
concurrent-insert AUTO
console TRUE
+core-file TRUE
date-format %Y-%m-%d
datetime-format %Y-%m-%d %H:%i:%s
deadlock-search-depth-long 15
@@ -1757,7 +1759,7 @@ optimizer-rowid-copy-cost 0.002653
optimizer-scan-setup-cost 10
optimizer-search-depth 62
optimizer-selectivity-sampling-limit 100
-optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on
+optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on
optimizer-trace
optimizer-trace-max-mem-size 1048576
optimizer-use-condition-selectivity 4
diff --git a/mysql-test/main/mysqltest_tracking_info.result b/mysql-test/main/mysqltest_tracking_info.result
index 61bb3f2d1e2..c4fedd6b59c 100644
--- a/mysql-test/main/mysqltest_tracking_info.result
+++ b/mysql-test/main/mysqltest_tracking_info.result
@@ -38,7 +38,7 @@ SET @@session.session_track_system_variables='optimizer_switch';
set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off';
-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
-- optimizer_switch
--- index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off
+-- index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on
Warnings:
Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release
diff --git a/mysql-test/main/name_resolution_cache_debug.result b/mysql-test/main/name_resolution_cache_debug.result
new file mode 100644
index 00000000000..7030176c5fe
--- /dev/null
+++ b/mysql-test/main/name_resolution_cache_debug.result
@@ -0,0 +1,25 @@
+connect con1,localhost,root;
+create table t1 (a int, b int);
+create table t2 (c int, d int);
+create view v1 as select c+1 as e, d+1 as f from t2;
+SET DEBUG_SYNC= 'table_field_cached SIGNAL in_sync WAIT_FOR go';
+prepare stmt1 from "select a from t1";
+execute stmt1;
+connection default;
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+SET DEBUG_SYNC= 'now SIGNAL go';
+connection con1;
+a
+SET DEBUG_SYNC= 'table_field_cached SIGNAL in_sync WAIT_FOR go';
+prepare stmt1 from "select e from v1";
+execute stmt1;
+connection default;
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+SET DEBUG_SYNC= 'now SIGNAL go';
+connection con1;
+e
+connection default;
+disconnect con1;
+SET DEBUG_SYNC = 'RESET';
+drop view v1;
+drop table t1,t2;
diff --git a/mysql-test/main/name_resolution_cache_debug.test b/mysql-test/main/name_resolution_cache_debug.test
new file mode 100644
index 00000000000..362d883cbd1
--- /dev/null
+++ b/mysql-test/main/name_resolution_cache_debug.test
@@ -0,0 +1,36 @@
+
+source include/have_debug_sync.inc;
+
+connect con1,localhost,root;
+create table t1 (a int, b int);
+create table t2 (c int, d int);
+create view v1 as select c+1 as e, d+1 as f from t2;
+
+SET DEBUG_SYNC= 'table_field_cached SIGNAL in_sync WAIT_FOR go';
+prepare stmt1 from "select a from t1";
+--send execute stmt1
+
+connection default;
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+SET DEBUG_SYNC= 'now SIGNAL go';
+
+connection con1;
+--reap
+
+SET DEBUG_SYNC= 'table_field_cached SIGNAL in_sync WAIT_FOR go';
+prepare stmt1 from "select e from v1";
+--send execute stmt1
+
+connection default;
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+SET DEBUG_SYNC= 'now SIGNAL go';
+
+connection con1;
+--reap
+
+connection default;
+disconnect con1;
+
+SET DEBUG_SYNC = 'RESET';
+drop view v1;
+drop table t1,t2;
diff --git a/mysql-test/main/old-mode.result b/mysql-test/main/old-mode.result
index 44e8f5bfece..daa2a4dc915 100644
--- a/mysql-test/main/old-mode.result
+++ b/mysql-test/main/old-mode.result
@@ -221,3 +221,39 @@ a UNIX_TIMESTAMP(t1.a) a UNIX_TIMESTAMP(t2.a)
DROP TABLE t1;
SET time_zone=DEFAULT;
SET global mysql56_temporal_format=true;
+#
+# MDEV-26765 UNIX_TIMESTAMP(CURRENT_TIME()) return null ?!?
+#
+SET old_mode=zero_date_time_cast;
+SET @@time_zone='+00:00';
+SET timestamp=1234567;
+SELECT CURRENT_TIMESTAMP;
+CURRENT_TIMESTAMP
+1970-01-15 06:56:07
+SELECT UNIX_TIMESTAMP(CURRENT_TIME());
+UNIX_TIMESTAMP(CURRENT_TIME())
+NULL
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '06:56:07'
+SELECT UNIX_TIMESTAMP(TIME'06:56:07');
+UNIX_TIMESTAMP(TIME'06:56:07')
+NULL
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '06:56:07'
+SELECT UNIX_TIMESTAMP(TIME'10:20:30');
+UNIX_TIMESTAMP(TIME'10:20:30')
+NULL
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '10:20:30'
+CREATE OR REPLACE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES (TIME'06:56:07'),('10:20:30');
+SELECT UNIX_TIMESTAMP(a) FROM t1 ORDER BY a;
+UNIX_TIMESTAMP(a)
+NULL
+NULL
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+Warning 1264 Out of range value for column 'a' at row 2
+DROP TABLE t1;
+SET @@time_zone=DEFAULT;
+SET TIMESTAMP=DEFAULT;
diff --git a/mysql-test/main/old-mode.test b/mysql-test/main/old-mode.test
index 0419be4bf6a..e4928329b47 100644
--- a/mysql-test/main/old-mode.test
+++ b/mysql-test/main/old-mode.test
@@ -149,3 +149,23 @@ SELECT t1.a, UNIX_TIMESTAMP(t1.a), t2.a, UNIX_TIMESTAMP(t2.a) FROM t1 t1, t1 t2
DROP TABLE t1;
SET time_zone=DEFAULT;
SET global mysql56_temporal_format=true;
+
+
+--echo #
+--echo # MDEV-26765 UNIX_TIMESTAMP(CURRENT_TIME()) return null ?!?
+--echo #
+
+SET old_mode=zero_date_time_cast;
+SET @@time_zone='+00:00';
+SET timestamp=1234567;
+SELECT CURRENT_TIMESTAMP;
+SELECT UNIX_TIMESTAMP(CURRENT_TIME());
+SELECT UNIX_TIMESTAMP(TIME'06:56:07');
+SELECT UNIX_TIMESTAMP(TIME'10:20:30');
+CREATE OR REPLACE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES (TIME'06:56:07'),('10:20:30');
+SELECT UNIX_TIMESTAMP(a) FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+SET @@time_zone=DEFAULT;
+SET TIMESTAMP=DEFAULT;
diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result
index 634ef3343a4..1342bc65f17 100644
--- a/mysql-test/main/opt_trace.result
+++ b/mysql-test/main/opt_trace.result
@@ -515,6 +515,11 @@ select * from v2 {
]
},
{
+ "check_split_materialized": {
+ "not_applicable": "no candidate field can be accessed through ref"
+ }
+ },
+ {
"best_join_order": ["t1"],
"rows": 1,
"cost": 0.010978597
@@ -901,6 +906,11 @@ explain select * from v1 {
]
},
{
+ "check_split_materialized": {
+ "not_applicable": "group list has no candidates"
+ }
+ },
+ {
"best_join_order": ["t1"],
"rows": 10,
"cost": 0.017968034
@@ -4266,7 +4276,7 @@ explain delete from t0 where t0.a<3 {
"select_id": 1,
"steps": [
{
- "expanded_query": "select from dual where t0.a < 3"
+ "expanded_query": "delete from t0 using dual where t0.a < 3"
}
]
}
@@ -4346,7 +4356,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
"select_id": 1,
"steps": [
{
- "expanded_query": "select from t0 join t1 where t0.a = t1.a and t1.a < 3"
+ "expanded_query": "delete from t0,t1 using t0 join t1 where t0.a = t1.a and t1.a < 3"
}
]
}
@@ -4792,7 +4802,7 @@ explain select * from (select rand() from t1)q {
"derived": {
"table": "q",
"select_id": 2,
- "algorithm": "merged"
+ "algorithm": "materialized"
}
},
{
@@ -4806,7 +4816,7 @@ explain select * from (select rand() from t1)q {
}
},
{
- "expanded_query": "/* select#1 */ select rand() AS `rand()` from (/* select#2 */ select rand() AS `rand()` from t1) q"
+ "expanded_query": "/* select#1 */ select q.`rand()` AS `rand()` from (/* select#2 */ select rand() AS `rand()` from t1) q"
}
]
}
@@ -4816,14 +4826,6 @@ explain select * from (select rand() from t1)q {
"select_id": 1,
"steps": [
{
- "derived": {
- "table": "q",
- "select_id": 2,
- "algorithm": "materialized",
- "cause": "Random function in the select"
- }
- },
- {
"join_optimization": {
"select_id": 2,
"steps": [
@@ -11586,6 +11588,518 @@ SELECT a FROM t1 WHERE (a,b) in (SELECT @c,@d);
a
DROP TABLE t1;
#
+# MDEV-31085: multi-update using view with optimizer trace enabled
+#
+SET SESSION optimizer_trace = 'enabled=on';
+CREATE TABLE t (a int, b int);
+CREATE VIEW v AS SELECT 1 AS c UNION SELECT 2 AS c;
+INSERT INTO t VALUES (0,4),(5,6);
+UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a;
+SELECT * FROM information_schema.optimizer_trace;
+QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES
+UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a {
+ "steps": [
+ {
+ "view": {
+ "table": "v",
+ "select_id": 2,
+ "algorithm": "materialized"
+ }
+ },
+ {
+ "join_preparation": {
+ "select_id": 2,
+ "steps": [
+ {
+ "expanded_query": "/* select#2 */ select 1 AS c"
+ }
+ ]
+ }
+ },
+ {
+ "join_preparation": {
+ "select_id": 3,
+ "steps": [
+ {
+ "expanded_query": "/* select#3 */ select 2 AS c"
+ }
+ ]
+ }
+ },
+ {
+ "join_preparation": {
+ "select_id": 1,
+ "steps": [
+ {
+ "expanded_query": "/* select#1 */ update t join v set t.b = t.a,t.a = v.c where v.c < t.a"
+ }
+ ]
+ }
+ },
+ {
+ "join_optimization": {
+ "select_id": 1,
+ "steps": [
+ {
+ "condition_processing": {
+ "condition": "WHERE",
+ "original_condition": "v.c < t.a",
+ "steps": [
+ {
+ "transformation": "equality_propagation",
+ "resulting_condition": "v.c < t.a"
+ },
+ {
+ "transformation": "constant_propagation",
+ "resulting_condition": "v.c < t.a"
+ },
+ {
+ "transformation": "trivial_condition_removal",
+ "resulting_condition": "v.c < t.a"
+ }
+ ]
+ }
+ },
+ {
+ "join_optimization": {
+ "select_id": 2,
+ "steps": []
+ }
+ },
+ {
+ "join_optimization": {
+ "select_id": 3,
+ "steps": []
+ }
+ },
+ {
+ "table_dependencies": [
+ {
+ "table": "t",
+ "row_may_be_null": false,
+ "map_bit": 0,
+ "depends_on_map_bits": []
+ },
+ {
+ "table": "<derived2>",
+ "row_may_be_null": false,
+ "map_bit": 1,
+ "depends_on_map_bits": []
+ }
+ ]
+ },
+ {
+ "ref_optimizer_key_uses": []
+ },
+ {
+ "rows_estimation": [
+ {
+ "table": "t",
+ "table_scan": {
+ "rows": 2,
+ "read_cost": 0.01028441,
+ "read_and_compare_cost": 0.01034841
+ }
+ },
+ {
+ "table": "<derived2>",
+ "table_scan": {
+ "rows": 2,
+ "read_cost": 0.012350033,
+ "read_and_compare_cost": 0.012418701
+ }
+ }
+ ]
+ },
+ {
+ "considered_execution_plans": [
+ {
+ "plan_prefix": "",
+ "get_costs_for_tables": [
+ {
+ "best_access_path": {
+ "table": "t",
+ "plan_details": {
+ "record_count": 1
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan",
+ "rows": 2,
+ "rows_after_filter": 2,
+ "rows_out": 2,
+ "cost": 0.01034841,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 2,
+ "rows_out": 2,
+ "cost": 0.01034841,
+ "uses_join_buffering": false
+ }
+ }
+ },
+ {
+ "best_access_path": {
+ "table": "<derived2>",
+ "plan_details": {
+ "record_count": 1
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan",
+ "rows": 2,
+ "rows_after_filter": 2,
+ "rows_out": 2,
+ "cost": 0.012418701,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 2,
+ "rows_out": 2,
+ "cost": 0.012418701,
+ "uses_join_buffering": false
+ }
+ }
+ }
+ ]
+ },
+ {
+ "plan_prefix": "",
+ "table": "t",
+ "rows_for_plan": 2,
+ "cost_for_plan": 0.01034841,
+ "rest_of_plan": [
+ {
+ "plan_prefix": "t",
+ "get_costs_for_tables": [
+ {
+ "best_access_path": {
+ "table": "<derived2>",
+ "plan_details": {
+ "record_count": 2
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan_with_join_cache",
+ "rows": 2,
+ "rows_after_filter": 2,
+ "rows_out": 2,
+ "cost": 0.012911897,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 2,
+ "rows_out": 2,
+ "cost": 0.012911897,
+ "uses_join_buffering": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "plan_prefix": "t",
+ "table": "<derived2>",
+ "rows_for_plan": 4,
+ "cost_for_plan": 0.023260307
+ }
+ ]
+ },
+ {
+ "plan_prefix": "",
+ "table": "<derived2>",
+ "rows_for_plan": 2,
+ "cost_for_plan": 0.012418701,
+ "pruned_by_heuristic": true
+ }
+ ]
+ },
+ {
+ "best_join_order": ["t", "<derived2>"],
+ "rows": 4,
+ "cost": 0.023260307
+ },
+ {
+ "substitute_best_equal": {
+ "condition": "WHERE",
+ "resulting_condition": "v.c < t.a"
+ }
+ },
+ {
+ "attaching_conditions_to_tables": {
+ "attached_conditions_computation": [],
+ "attached_conditions_summary": [
+ {
+ "table": "t",
+ "attached_condition": null
+ },
+ {
+ "table": "<derived2>",
+ "attached_condition": "v.c < t.a"
+ }
+ ]
+ }
+ },
+ {
+ "make_join_readinfo": []
+ }
+ ]
+ }
+ },
+ {
+ "join_execution": {
+ "select_id": 1,
+ "steps": [
+ {
+ "join_execution": {
+ "select_id": 2,
+ "steps": []
+ }
+ },
+ {
+ "join_execution": {
+ "select_id": 3,
+ "steps": []
+ }
+ },
+ {
+ "join_preparation": {
+ "select_id": "fake",
+ "steps": [
+ {
+ "expanded_query": "select c AS c from dual"
+ }
+ ]
+ }
+ },
+ {
+ "join_optimization": {
+ "select_id": "fake",
+ "steps": [
+ {
+ "table_dependencies": [
+ {
+ "table": "union",
+ "row_may_be_null": false,
+ "map_bit": 0,
+ "depends_on_map_bits": []
+ }
+ ]
+ },
+ {
+ "rows_estimation": [
+ {
+ "table": "union",
+ "table_scan": {
+ "rows": 2,
+ "read_cost": 0.010020701,
+ "read_and_compare_cost": 0.010084701
+ }
+ }
+ ]
+ },
+ {
+ "considered_execution_plans": [
+ {
+ "plan_prefix": "",
+ "get_costs_for_tables": [
+ {
+ "best_access_path": {
+ "table": "union",
+ "plan_details": {
+ "record_count": 1
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan",
+ "rows": 2,
+ "rows_after_filter": 2,
+ "rows_out": 2,
+ "cost": 0.010084701,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 2,
+ "rows_out": 2,
+ "cost": 0.010084701,
+ "uses_join_buffering": false
+ }
+ }
+ }
+ ]
+ },
+ {
+ "plan_prefix": "",
+ "table": "union",
+ "rows_for_plan": 2,
+ "cost_for_plan": 0.010084701
+ }
+ ]
+ },
+ {
+ "best_join_order": ["union"],
+ "rows": 2,
+ "cost": 0.010084701
+ },
+ {
+ "attaching_conditions_to_tables": {
+ "attached_conditions_computation": [],
+ "attached_conditions_summary": [
+ {
+ "table": "union",
+ "attached_condition": null
+ }
+ ]
+ }
+ },
+ {
+ "make_join_readinfo": []
+ }
+ ]
+ }
+ },
+ {
+ "join_execution": {
+ "select_id": "fake",
+ "steps": []
+ }
+ }
+ ]
+ }
+ }
+ ]
+} 0 0
+SELECT * FROM t;
+a b
+0 4
+1 5
+SET optimizer_trace=DEFAULT;
+DROP VIEW v;
+DROP TABLE t;
+#
+# MDEV-26301: Split optimization improvements: Optimizer Trace coverage
+#
+create table t1(a int, b int);
+insert into t1 select seq,seq from seq_1_to_5;
+create table t2(a int, b int, key(a));
+insert into t2
+select A.seq,B.seq from seq_1_to_25 A, seq_1_to_2 B;
+create table t3(a int, b int, key(a));
+insert into t3
+select A.seq,B.seq from seq_1_to_5 A, seq_1_to_3 B;
+analyze table t1,t2,t3 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze status Table is already up to date
+test.t3 analyze status Engine-independent statistics collected
+test.t3 analyze status Table is already up to date
+create table t10 (
+grp_id int,
+col1 int,
+key(grp_id)
+);
+insert into t10
+select
+A.seq,
+B.seq
+from
+seq_1_to_100 A,
+seq_1_to_100 B;
+create table t11 (
+col1 int,
+col2 int
+);
+insert into t11
+select A.seq, A.seq from seq_1_to_10 A;
+analyze table t10,t11 persistent for all;
+Table Op Msg_type Msg_text
+test.t10 analyze status Engine-independent statistics collected
+test.t10 analyze status Table is already up to date
+test.t11 analyze status Engine-independent statistics collected
+test.t11 analyze status OK
+set optimizer_trace=1;
+explain
+select * from
+(
+(t1 left join t2 on t2.a=t1.b)
+left join t3 on t3.a=t1.b
+) left join (select grp_id, count(*)
+from t10 left join t11 on t11.col1=t10.col1
+group by grp_id) T on T.grp_id=t1.b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5
+1 PRIMARY t2 ref a a 5 test.t1.b 2 Using where
+1 PRIMARY t3 ref a a 5 test.t1.b 3 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.b 10 Using where
+2 LATERAL DERIVED t10 ref grp_id grp_id 5 test.t1.b 100
+2 LATERAL DERIVED t11 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
+select json_detailed(json_extract(trace, '$**.check_split_materialized')) as JS
+from information_schema.optimizer_trace;
+JS
+[
+ {
+ "split_candidates":
+ ["t10.grp_id"]
+ }
+]
+select
+json_detailed(
+json_remove(
+json_extract(trace, '$**.choose_best_splitting')
+, '$[0].split_plan_search[0]'
+ )
+) as JS
+from information_schema.optimizer_trace;
+JS
+[
+ {
+ "considered_keys":
+ [
+ {
+ "table_name": "t10",
+ "index": "grp_id",
+ "rec_per_key": 100,
+ "param_tables": 1
+ }
+ ],
+ "refills": 5,
+ "spl_pd_boundary": 2,
+ "split_plan_search":
+ [],
+ "split_materialized":
+ {
+ "table": "t10",
+ "key": "grp_id",
+ "org_cost": 1.159965,
+ "postjoin_cost": 4.020888502,
+ "one_splitting_cost": 5.180853502,
+ "unsplit_postjoin_cost": 32.78652054,
+ "unsplit_cost": 148.7830205,
+ "rows": 100,
+ "refills": 5,
+ "total_splitting_cost": 25.90426751,
+ "chosen": true
+ }
+ }
+]
+drop table t1,t2,t3,t10,t11;
+set optimizer_trace=DEFAULT;
+#
# End of 10.4 tests
#
set optimizer_trace='enabled=on';
@@ -12017,84 +12531,94 @@ from
information_schema.optimizer_trace;
json_detailed(json_extract(trace, '$**.choose_best_splitting'))
[
- [
- {
- "considered_execution_plans":
- [
- {
- "plan_prefix": "",
- "get_costs_for_tables":
- [
- {
- "best_access_path":
+ {
+ "considered_keys":
+ []
+ },
+ {
+ "considered_keys":
+ [
+ {
+ "table_name": "t2",
+ "index": "idx_a",
+ "rec_per_key": 1.8367,
+ "param_tables": 1
+ }
+ ],
+ "refills": 4,
+ "spl_pd_boundary": 2,
+ "split_plan_search":
+ [
+ {
+ "considered_execution_plans":
+ [
+ {
+ "plan_prefix": "",
+ "get_costs_for_tables":
+ [
{
- "table": "t2",
- "plan_details":
+ "best_access_path":
{
- "record_count": 1
- },
- "considered_access_paths":
- [
+ "table": "t2",
+ "plan_details":
{
- "access_type": "ref",
- "index": "idx_a",
- "used_range_estimates": false,
- "reason": "not available",
- "rows": 1.8367,
- "cost": 0.002051185,
- "chosen": true
+ "record_count": 1
},
+ "considered_access_paths":
+ [
+ {
+ "access_type": "ref",
+ "index": "idx_a",
+ "used_range_estimates": false,
+ "reason": "not available",
+ "rows": 1.8367,
+ "cost": 0.002051185,
+ "chosen": true
+ },
+ {
+ "type": "scan",
+ "chosen": false,
+ "cause": "cost"
+ }
+ ],
+ "chosen_access_method":
{
- "type": "scan",
- "chosen": false,
- "cause": "cost"
+ "type": "ref",
+ "rows_read": 1.8367,
+ "rows_out": 1.8367,
+ "cost": 0.002051185,
+ "uses_join_buffering": false
}
- ],
- "chosen_access_method":
- {
- "type": "ref",
- "rows_read": 1.8367,
- "rows_out": 1.8367,
- "cost": 0.002051185,
- "uses_join_buffering": false
}
}
- }
- ]
- },
- {
- "plan_prefix": "",
- "table": "t2",
- "rows_for_plan": 1.8367,
- "cost_for_plan": 0.002051185,
- "cost_for_sorting": 0.001155201
- }
- ]
- },
- {
- "split_materialized":
- {
- "table": "t2",
- "key": "idx_a",
- "org_cost": 0.002051185,
- "postjoin_cost": 0.001135418,
- "one_splitting_cost": 0.003186603,
- "unsplit_postjoin_cost": 0.036032575,
- "unsplit_cost": 0.060625425,
- "rows": 1.8367,
- "outer_rows": 4,
- "total_splitting_cost": 0.012746412,
- "chosen": true
+ ]
+ },
+ {
+ "plan_prefix": "",
+ "table": "t2",
+ "rows_for_plan": 1.8367,
+ "cost_for_plan": 0.002051185,
+ "cost_for_sorting": 0.001155201
+ }
+ ]
}
+ ],
+ "split_materialized":
+ {
+ "table": "t2",
+ "key": "idx_a",
+ "org_cost": 0.002051185,
+ "postjoin_cost": 0.001135418,
+ "one_splitting_cost": 0.003186603,
+ "unsplit_postjoin_cost": 0.036032575,
+ "unsplit_cost": 0.060625425,
+ "rows": 1.8367,
+ "refills": 4,
+ "total_splitting_cost": 0.012746412,
+ "chosen": true
}
- ]
+ }
]
-select
-json_detailed(json_extract(trace, '$**.lateral_derived'))
-from
-information_schema.optimizer_trace;
-json_detailed(json_extract(trace, '$**.lateral_derived'))
-NULL
drop table t1,t2;
#
# Test table functions.
diff --git a/mysql-test/main/opt_trace.test b/mysql-test/main/opt_trace.test
index 6f8040f1689..b60cb95fcd6 100644
--- a/mysql-test/main/opt_trace.test
+++ b/mysql-test/main/opt_trace.test
@@ -654,6 +654,101 @@ SELECT a FROM t1 WHERE (a,b) in (SELECT @c,@d);
DROP TABLE t1;
--echo #
+--echo # MDEV-31085: multi-update using view with optimizer trace enabled
+--echo #
+
+SET SESSION optimizer_trace = 'enabled=on';
+
+CREATE TABLE t (a int, b int);
+CREATE VIEW v AS SELECT 1 AS c UNION SELECT 2 AS c;
+INSERT INTO t VALUES (0,4),(5,6);
+UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a;
+SELECT * FROM information_schema.optimizer_trace;
+
+SELECT * FROM t;
+
+SET optimizer_trace=DEFAULT;
+
+DROP VIEW v;
+DROP TABLE t;
+
+--echo #
+--echo # MDEV-26301: Split optimization improvements: Optimizer Trace coverage
+--echo #
+
+# 5 values
+create table t1(a int, b int);
+insert into t1 select seq,seq from seq_1_to_5;
+
+# 5 value groups of size 2 each
+create table t2(a int, b int, key(a));
+insert into t2
+select A.seq,B.seq from seq_1_to_25 A, seq_1_to_2 B;
+
+# 5 value groups of size 3 each
+create table t3(a int, b int, key(a));
+insert into t3
+select A.seq,B.seq from seq_1_to_5 A, seq_1_to_3 B;
+
+analyze table t1,t2,t3 persistent for all;
+
+create table t10 (
+ grp_id int,
+ col1 int,
+ key(grp_id)
+);
+
+# 100 groups of 100 values each
+insert into t10
+select
+ A.seq,
+ B.seq
+from
+ seq_1_to_100 A,
+ seq_1_to_100 B;
+
+# and X10 multiplier
+create table t11 (
+ col1 int,
+ col2 int
+);
+insert into t11
+select A.seq, A.seq from seq_1_to_10 A;
+
+analyze table t10,t11 persistent for all;
+
+set optimizer_trace=1;
+explain
+select * from
+ (
+ (t1 left join t2 on t2.a=t1.b)
+ left join t3 on t3.a=t1.b
+ ) left join (select grp_id, count(*)
+ from t10 left join t11 on t11.col1=t10.col1
+ group by grp_id) T on T.grp_id=t1.b;
+
+# Not sure how MDEV-27871 is related but this test uses this reason
+# all over the place:
+#enable after fix MDEV-27871
+--disable_view_protocol
+
+select json_detailed(json_extract(trace, '$**.check_split_materialized')) as JS
+from information_schema.optimizer_trace;
+
+select
+ json_detailed(
+ json_remove(
+ json_extract(trace, '$**.choose_best_splitting')
+ , '$[0].split_plan_search[0]'
+ )
+ ) as JS
+from information_schema.optimizer_trace;
+
+--enable_view_protocol
+drop table t1,t2,t3,t10,t11;
+set optimizer_trace=DEFAULT;
+
+--echo #
--echo # End of 10.4 tests
--echo #
@@ -861,13 +956,6 @@ from
information_schema.optimizer_trace;
--enable_view_protocol
-# Same as above. just to show that splitting plan has some coverage in the
-# trace.
-select
- json_detailed(json_extract(trace, '$**.lateral_derived'))
-from
- information_schema.optimizer_trace;
-
drop table t1,t2;
--echo #
diff --git a/mysql-test/main/parser.result b/mysql-test/main/parser.result
index c0c459e57b4..2f343c7bca8 100644
--- a/mysql-test/main/parser.result
+++ b/mysql-test/main/parser.result
@@ -1905,12 +1905,32 @@ SET @@sql_mode=@save_sql_mode;
#
# MDEV-30151 parse error 1=2 not between/in
#
-select 1=2 not in (3,4);
-1=2 not in (3,4)
+SELECT 1=2 NOT IN (3,4);
+1=2 NOT IN (3,4)
1
-select 1=2 not between 3 and 4;
-1=2 not between 3 and 4
+SELECT 1=2 NOT BETWEEN 3 AND 4;
+1=2 NOT BETWEEN 3 AND 4
1
+CREATE TABLE t1 ( f INT AS ( 1 IN ( 2 NOT BETWEEN 3 AND 4 ) ) );
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f` int(11) GENERATED ALWAYS AS (1 = 2 not between 3 and 4) VIRTUAL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+DROP TABLE t1;
+CREATE TABLE t1 ( f INT, CHECK ( 1 IN ( 2 NOT BETWEEN 3 AND 4 ) ) );
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f` int(11) DEFAULT NULL,
+ CONSTRAINT `CONSTRAINT_1` CHECK (1 = 2 not between 3 and 4)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+DROP TABLE t1;
+CREATE VIEW v1 AS SELECT 1 IN ( 2 NOT BETWEEN 3 AND 4 );
+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 1 = 2 not between 3 and 4 AS `1 IN ( 2 NOT BETWEEN 3 AND 4 )` latin1 latin1_swedish_ci
+DROP VIEW v1;
#
# End of 10.3 tests
#
diff --git a/mysql-test/main/parser.test b/mysql-test/main/parser.test
index 48cda68b416..dcad30b36b8 100644
--- a/mysql-test/main/parser.test
+++ b/mysql-test/main/parser.test
@@ -1687,8 +1687,21 @@ SET @@sql_mode=@save_sql_mode;
--echo #
--echo # MDEV-30151 parse error 1=2 not between/in
--echo #
-select 1=2 not in (3,4);
-select 1=2 not between 3 and 4;
+
+SELECT 1=2 NOT IN (3,4);
+SELECT 1=2 NOT BETWEEN 3 AND 4;
+
+CREATE TABLE t1 ( f INT AS ( 1 IN ( 2 NOT BETWEEN 3 AND 4 ) ) );
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 ( f INT, CHECK ( 1 IN ( 2 NOT BETWEEN 3 AND 4 ) ) );
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE VIEW v1 AS SELECT 1 IN ( 2 NOT BETWEEN 3 AND 4 );
+SHOW CREATE VIEW v1;
+DROP VIEW v1;
--echo #
--echo # End of 10.3 tests
diff --git a/mysql-test/main/partition.result b/mysql-test/main/partition.result
index ad4c3cf1ad3..78d4aa3f87c 100644
--- a/mysql-test/main/partition.result
+++ b/mysql-test/main/partition.result
@@ -2820,3 +2820,41 @@ DROP TABLE t1,t2;
#
# End of 10.1 tests
#
+#
+# MDEV-30596: Assertion 'pushed_rowid_filter != __null ...' failed
+#
+create table t1 (a int);
+insert into t1 values (NULL),(1),(2);
+create table t2 (a int);
+insert into t2 select seq from seq_1_to_1000;
+create table t3 (
+a1 int,
+a2 int,
+b int,
+c int,
+filler1 char(200),
+filler2 char(200),
+key(a1,a2),
+key(b)
+) partition by hash(a1) partitions 2;
+insert into t3 select seq/100, seq/100, seq, seq, seq, seq from seq_1_to_10000;
+analyze table t3 persistent for all;
+Table Op Msg_type Msg_text
+test.t3 analyze status Engine-independent statistics collected
+test.t3 analyze status OK
+set @tmp_os= @@optimizer_switch;
+set optimizer_switch='materialization=off';
+# Must not show "Using rowid filter":
+explain
+select *
+from t1
+where
+t1.a not in (select straight_join t3.a1
+from t2, t3
+where t3.b < 3000 and t3.a2=t2.a);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1000 Using where
+2 DEPENDENT SUBQUERY t3 ref_or_null a1,b a1 10 func,test.t2.a 198 Using where; Full scan on NULL key
+set optimizer_switch=@tmp_os;
+drop table t1,t2,t3;
diff --git a/mysql-test/main/partition.test b/mysql-test/main/partition.test
index 5f4c5f659ca..d96031a6b2b 100644
--- a/mysql-test/main/partition.test
+++ b/mysql-test/main/partition.test
@@ -3021,7 +3021,44 @@ INSERT INTO t2 VALUES (1),(2);
UPDATE t1 SET a = 7 WHERE a = ( SELECT b FROM t2 ) ORDER BY a LIMIT 6;
DROP TABLE t1,t2;
-
--echo #
--echo # End of 10.1 tests
--echo #
+
+--echo #
+--echo # MDEV-30596: Assertion 'pushed_rowid_filter != __null ...' failed
+--echo #
+--source include/have_sequence.inc
+create table t1 (a int);
+insert into t1 values (NULL),(1),(2);
+create table t2 (a int);
+insert into t2 select seq from seq_1_to_1000;
+
+create table t3 (
+ a1 int,
+ a2 int,
+ b int,
+ c int,
+ filler1 char(200),
+ filler2 char(200),
+ key(a1,a2),
+ key(b)
+) partition by hash(a1) partitions 2;
+insert into t3 select seq/100, seq/100, seq, seq, seq, seq from seq_1_to_10000;
+analyze table t3 persistent for all;
+
+set @tmp_os= @@optimizer_switch;
+set optimizer_switch='materialization=off';
+
+--echo # Must not show "Using rowid filter":
+explain
+select *
+from t1
+where
+ t1.a not in (select straight_join t3.a1
+ from t2, t3
+ where t3.b < 3000 and t3.a2=t2.a);
+set optimizer_switch=@tmp_os;
+
+drop table t1,t2,t3;
+
diff --git a/mysql-test/main/ps.result b/mysql-test/main/ps.result
index cb2e9651c3d..cb7b215a110 100644
--- a/mysql-test/main/ps.result
+++ b/mysql-test/main/ps.result
@@ -5553,10 +5553,14 @@ CREATE TABLE t3 (c3 INT) ENGINE=MyISAM;
EXPLAIN EXTENDED UPDATE t3 SET c3 = ( SELECT COUNT(d1.c1) FROM ( SELECT a11.c1 FROM t1 AS a11 STRAIGHT_JOIN t2 AS a21 ON a21.c2 = a11.c1 JOIN t1 AS a12 ON a12.c1 = a11.c1 ) d1 );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 /* select#1 */ update `test`.`t3` set `test`.`t3`.`c3` = (/* select#2 */ select count(NULL) from `test`.`t1` `a11` straight_join `test`.`t2` `a21` join `test`.`t1` `a12` where 0)
PREPARE stmt FROM "EXPLAIN EXTENDED UPDATE t3 SET c3 = ( SELECT COUNT(d1.c1) FROM ( SELECT a11.c1 FROM t1 AS a11 STRAIGHT_JOIN t2 AS a21 ON a21.c2 = a11.c1 JOIN t1 AS a12 ON a12.c1 = a11.c1 ) d1 )";
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+Warnings:
+Note 1003 /* select#1 */ update `test`.`t3` set `test`.`t3`.`c3` = (/* select#2 */ select count(NULL) from `test`.`t1` `a11` straight_join `test`.`t2` `a21` join `test`.`t1` `a12` where 0)
DEALLOCATE PREPARE stmt;
DROP TABLE t1, t2, t3;
#
diff --git a/mysql-test/main/rowid_filter_innodb.result b/mysql-test/main/rowid_filter_innodb.result
index da6c848e334..5b8c56c87d3 100644
--- a/mysql-test/main/rowid_filter_innodb.result
+++ b/mysql-test/main/rowid_filter_innodb.result
@@ -3342,8 +3342,11 @@ ANALYZE
"join_type": "BKA",
"mrr_type": "Rowid-ordered scan",
"attached_condition": "a.atp = 1",
+ "r_loops": 3,
"r_filtered": 100,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 1
}
},
{
@@ -3384,8 +3387,11 @@ ANALYZE
"join_type": "BKA",
"mrr_type": "Rowid-ordered scan",
"attached_condition": "fi.fh in (6311439873746261694,-397087483897438286,8518228073041491534,-5420422472375069774)",
+ "r_loops": 3,
"r_filtered": 100,
- "r_unpack_time_ms": "REPLACED"
+ "r_unpack_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_effective_rows": 10.66666667
}
}
]
diff --git a/mysql-test/main/rownum.result b/mysql-test/main/rownum.result
index 3ad51c93260..b61269b1b47 100644
--- a/mysql-test/main/rownum.result
+++ b/mysql-test/main/rownum.result
@@ -139,6 +139,13 @@ select * from t1,t2 where t1.a=t2.a and rownum()<=2 order by t1.a,t2.a;
a b a b
2 20 2 21
3 30 3 31
+create view v1 as
+select * from (select * from t1 order by a desc) as t where rownum() <= 2;
+select * from v1;
+a b
+3 30
+2 20
+drop view v1;
#
# Having
#
@@ -984,3 +991,29 @@ next row is 3
3
next row is 5
5
+#
+# MDEV-31073: Server crash, assertion `table != 0 &&
+# view->field_translation != 0' failure with ROWNUM and view
+#
+CREATE TABLE t (f INT);
+INSERT INTO t VALUES (1),(2);
+CREATE VIEW v AS SELECT * FROM t;
+UPDATE v SET f = 10 WHERE ROWNUM() > 42 LIMIT 1;
+DROP VIEW v;
+DROP TABLE t;
+CREATE TABLE t (f INT);
+INSERT INTO t VALUES (1),(2);
+CREATE VIEW v AS SELECT f, 3 as e FROM t;
+UPDATE v SET f = 10 WHERE e > 42 LIMIT 1;
+DROP VIEW v;
+DROP TABLE t;
+CREATE TABLE t (f INT);
+INSERT INTO t VALUES (1),(2);
+CREATE VIEW v AS SELECT f, ROWNUM() as e FROM t;
+UPDATE v SET f = 10 WHERE e > 42 LIMIT 1;
+ERROR HY000: The target table v of the UPDATE is not updatable
+DROP VIEW v;
+DROP TABLE t;
+#
+# End of 10.6 tests
+#
diff --git a/mysql-test/main/rownum.test b/mysql-test/main/rownum.test
index bdd0bfa4f41..291bd9bd993 100644
--- a/mysql-test/main/rownum.test
+++ b/mysql-test/main/rownum.test
@@ -58,6 +58,11 @@ select *,rownum() from t1,t2 order by t2.a desc, t1.a desc;
select * from (select * from t1 order by a desc) as t where rownum() <= 2;
select * from t1,t2 where t1.a=t2.a and rownum()<=2 order by t1.a,t2.a;
+create view v1 as
+select * from (select * from t1 order by a desc) as t where rownum() <= 2;
+select * from v1;
+drop view v1;
+
--echo #
--echo # Having
--echo #
@@ -568,3 +573,40 @@ drop table t1;
--echo # Table value constructors
--echo #
values ("first row"),("next row is 3"),(rownum()),("next row is 5"),(rownum());
+
+--echo #
+--echo # MDEV-31073: Server crash, assertion `table != 0 &&
+--echo # view->field_translation != 0' failure with ROWNUM and view
+--echo #
+
+CREATE TABLE t (f INT);
+INSERT INTO t VALUES (1),(2);
+CREATE VIEW v AS SELECT * FROM t;
+UPDATE v SET f = 10 WHERE ROWNUM() > 42 LIMIT 1;
+
+# Cleanup
+DROP VIEW v;
+DROP TABLE t;
+
+CREATE TABLE t (f INT);
+INSERT INTO t VALUES (1),(2);
+CREATE VIEW v AS SELECT f, 3 as e FROM t;
+UPDATE v SET f = 10 WHERE e > 42 LIMIT 1;
+
+# Cleanup
+DROP VIEW v;
+DROP TABLE t;
+
+CREATE TABLE t (f INT);
+INSERT INTO t VALUES (1),(2);
+CREATE VIEW v AS SELECT f, ROWNUM() as e FROM t;
+--error ER_NON_UPDATABLE_TABLE
+UPDATE v SET f = 10 WHERE e > 42 LIMIT 1;
+
+# Cleanup
+DROP VIEW v;
+DROP TABLE t;
+
+--echo #
+--echo # End of 10.6 tests
+--echo #
diff --git a/mysql-test/main/selectivity.result b/mysql-test/main/selectivity.result
index 54c39d090d2..ad8d733a163 100644
--- a/mysql-test/main/selectivity.result
+++ b/mysql-test/main/selectivity.result
@@ -834,7 +834,7 @@ flush table t1;
set optimizer_use_condition_selectivity=4;
explain extended select * from t1 where a=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 1025 0.39 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1025 0.78 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 0
drop table t1;
@@ -1977,11 +1977,11 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 25.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2
+DROP TABLE t1;
+# End of 10.2 tests
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
set histogram_size=@save_histogram_size;
set use_stat_tables= @save_use_stat_tables;
-DROP TABLE t1;
-# End of 10.2 tests
set @@global.histogram_size=@save_histogram_size;
#
# MDEV-20595
diff --git a/mysql-test/main/selectivity.test b/mysql-test/main/selectivity.test
index 6957773fc8e..c96fb864408 100644
--- a/mysql-test/main/selectivity.test
+++ b/mysql-test/main/selectivity.test
@@ -1331,17 +1331,18 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2;
FLUSH TABLES;
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2;
-set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
-set histogram_size=@save_histogram_size;
-set use_stat_tables= @save_use_stat_tables;
DROP TABLE t1;
--echo # End of 10.2 tests
+
#
# Clean up
#
+set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
+set histogram_size=@save_histogram_size;
+set use_stat_tables= @save_use_stat_tables;
--source include/restore_charset.inc
set @@global.histogram_size=@save_histogram_size;
diff --git a/mysql-test/main/selectivity_innodb.result b/mysql-test/main/selectivity_innodb.result
index 03e5079eff0..99723013eaa 100644
--- a/mysql-test/main/selectivity_innodb.result
+++ b/mysql-test/main/selectivity_innodb.result
@@ -840,7 +840,7 @@ flush table t1;
set optimizer_use_condition_selectivity=4;
explain extended select * from t1 where a=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 1025 0.39 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1025 0.78 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 0
drop table t1;
@@ -1984,11 +1984,11 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 25.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2
+DROP TABLE t1;
+# End of 10.2 tests
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
set histogram_size=@save_histogram_size;
set use_stat_tables= @save_use_stat_tables;
-DROP TABLE t1;
-# End of 10.2 tests
set @@global.histogram_size=@save_histogram_size;
#
# MDEV-20595
diff --git a/mysql-test/main/selectivity_innodb_notembedded.result b/mysql-test/main/selectivity_innodb_notembedded.result
new file mode 100644
index 00000000000..8b06fe7556b
--- /dev/null
+++ b/mysql-test/main/selectivity_innodb_notembedded.result
@@ -0,0 +1,104 @@
+SET SESSION STORAGE_ENGINE='InnoDB';
+Warnings:
+Warning 1287 '@@storage_engine' is deprecated and will be removed in a future release. Please use '@@default_storage_engine' instead
+set @save_optimizer_switch_for_selectivity_test=@@optimizer_switch;
+set optimizer_switch='extended_keys=on';
+drop table if exists t0,t1,t2,t3;
+select @@global.use_stat_tables;
+@@global.use_stat_tables
+COMPLEMENTARY
+select @@session.use_stat_tables;
+@@session.use_stat_tables
+COMPLEMENTARY
+set @save_use_stat_tables=@@use_stat_tables;
+set use_stat_tables='preferably';
+set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
+set @save_histogram_size=@@histogram_size;
+set @save_histogram_type=@@histogram_type;
+set join_cache_level=2;
+set @@global.histogram_size=0,@@local.histogram_size=0;
+set histogram_type='single_prec_hb';
+set optimizer_use_condition_selectivity=3;
+#
+# MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram
+#
+create table t0(a int);
+insert into t0 select 1 from seq_1_to_78;
+create table t1(a int);
+insert into t1 select 1 from seq_1_to_26;
+create table t10 (a int);
+insert into t10 select 0 from t0, seq_1_to_4;
+insert into t10 select 8693 from t1;
+insert into t10 select 8694 from t1;
+insert into t10 select 8695 from t1;
+insert into t10 select 34783 from t1;
+insert into t10 select 34784 from t1;
+insert into t10 select 34785 from t1;
+insert into t10 select 34785 from t0, seq_1_to_8;
+insert into t10 select 65214 from t1;
+insert into t10 select 65215 from t1;
+insert into t10 select 65216 from t1;
+insert into t10 select 65216 from t0, seq_1_to_52;
+insert into t10 select 65217 from t1;
+insert into t10 select 65218 from t1;
+insert into t10 select 65219 from t1;
+insert into t10 select 65219 from t0;
+insert into t10 select 73913 from t1;
+insert into t10 select 73914 from t1;
+insert into t10 select 73915 from t1;
+insert into t10 select 73915 from t0, seq_1_to_40;
+insert into t10 select 78257 from t1;
+insert into t10 select 78258 from t1;
+insert into t10 select 78259 from t1;
+insert into t10 select 91300 from t1;
+insert into t10 select 91301 from t1;
+insert into t10 select 91302 from t1;
+insert into t10 select 91302 from t0, seq_1_to_6;
+insert into t10 select 91303 from t1;
+insert into t10 select 91304 from t1;
+insert into t10 select 91305 from t1;
+insert into t10 select 91305 from t0, seq_1_to_8;
+insert into t10 select 99998 from t1;
+insert into t10 select 99999 from t1;
+insert into t10 select 100000 from t1;
+set use_stat_tables=preferably;
+analyze table t10 persistent for all;
+Table Op Msg_type Msg_text
+test.t10 analyze status Engine-independent statistics collected
+test.t10 analyze status OK
+flush tables;
+set @tmp=@@optimizer_trace;
+set optimizer_trace=1;
+explain select * from t10 where a in (91303);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t10 ALL NULL NULL NULL NULL 9984 Using where
+# Must have selectivity_from_histogram <= 1.0:
+select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) as sel
+from information_schema.optimizer_trace;
+sel
+[
+ [
+ {
+ "column_name": "a",
+ "ranges":
+ ["91303 <= a <= 91303"],
+ "selectivity_from_histogram": 0.035714283
+ }
+ ]
+]
+set optimizer_trace=@tmp;
+drop table t0,t1,t10;
+set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
+set histogram_size=@save_histogram_size;
+set use_stat_tables= @save_use_stat_tables;
+#
+# End of 10.4 tests
+#
+#
+# Clean up
+#
+set @@global.histogram_size=@save_histogram_size;
+set optimizer_switch=@save_optimizer_switch_for_selectivity_test;
+SET SESSION STORAGE_ENGINE=DEFAULT;
+Warnings:
+Warning 1287 '@@storage_engine' is deprecated and will be removed in a future release. Please use '@@default_storage_engine' instead
diff --git a/mysql-test/main/selectivity_innodb_notembedded.test b/mysql-test/main/selectivity_innodb_notembedded.test
new file mode 100644
index 00000000000..387f7dcb7de
--- /dev/null
+++ b/mysql-test/main/selectivity_innodb_notembedded.test
@@ -0,0 +1,16 @@
+--source include/have_innodb.inc
+# This test is slow on buildbot.
+--source include/big_test.inc
+--source include/default_optimizer_switch.inc
+--source include/not_embedded.inc
+
+SET SESSION STORAGE_ENGINE='InnoDB';
+
+set @save_optimizer_switch_for_selectivity_test=@@optimizer_switch;
+set optimizer_switch='extended_keys=on';
+
+--source selectivity_notembedded.test
+
+set optimizer_switch=@save_optimizer_switch_for_selectivity_test;
+
+SET SESSION STORAGE_ENGINE=DEFAULT;
diff --git a/mysql-test/main/selectivity_no_engine.result b/mysql-test/main/selectivity_no_engine.result
index 5df1c61e758..3f23b579b23 100644
--- a/mysql-test/main/selectivity_no_engine.result
+++ b/mysql-test/main/selectivity_no_engine.result
@@ -36,12 +36,12 @@ test.t2 analyze status OK
# The following two must have the same in 'Extra' column:
explain extended select * from t2 where col1 IN (20, 180);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1100 1.35 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1100 1.00 Using where
Warnings:
Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where `test`.`t2`.`col1` in (20,180)
explain extended select * from t2 where col1 IN (180, 20);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1100 1.35 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1100 1.00 Using where
Warnings:
Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where `test`.`t2`.`col1` in (180,20)
drop table t1, t2;
@@ -102,7 +102,7 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
explain extended select * from t1 where col1 in (1,2,3);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 3.37 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 2.97 Using where
Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` in (1,2,3)
# Must not cause fp division by zero, or produce nonsense numbers:
@@ -333,6 +333,29 @@ SELECT * FROM t1 JOIN t2 ON t1.a = t2.c WHERE t2.b IN ('o') OR t2.e >= 'f' OR t2
a b c d e
set join_cache_level=@tmp_jcl;
drop table t1,t2;
+#
+# MDEV-31199: Assertion `field->table->stats_is_read' fails with hash_join_cardinality=on
+#
+CREATE TABLE t1 (a VARCHAR(255));
+INSERT INTO t1 VALUES ('u'),('uu');
+CREATE TABLE t2 (b VARCHAR(255)) CHARACTER SET utf8mb4;
+INSERT INTO t2 VALUES ('x'),('xx');
+CREATE TABLE t3 (c VARCHAR(255));
+INSERT INTO t3 VALUES ('z'),('zz');
+ANALYZE TABLE t1, t2, t3 PERSISTENT FOR ALL;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze status OK
+test.t3 analyze status Engine-independent statistics collected
+test.t3 analyze status OK
+set @tmp1=@@optimizer_switch, @tmp2=@@join_cache_level;
+set optimizer_switch='hash_join_cardinality=on', join_cache_level=3;
+SELECT t1.* FROM t1 JOIN (SELECT DISTINCT b FROM t2 JOIN t3) sq ON sq.b = t1.a;
+a
+set optimizer_switch=@tmp1, join_cache_level=@tmp2;
+DROP TABLE t1, t2, t3;
#
# End of the test file
#
diff --git a/mysql-test/main/selectivity_no_engine.test b/mysql-test/main/selectivity_no_engine.test
index 8596fce9bf2..4d050513015 100644
--- a/mysql-test/main/selectivity_no_engine.test
+++ b/mysql-test/main/selectivity_no_engine.test
@@ -271,6 +271,27 @@ SELECT * FROM t1 JOIN t2 ON t1.a = t2.c WHERE t2.b IN ('o') OR t2.e >= 'f' OR t2
set join_cache_level=@tmp_jcl;
drop table t1,t2;
+
+--echo #
+--echo # MDEV-31199: Assertion `field->table->stats_is_read' fails with hash_join_cardinality=on
+--echo #
+CREATE TABLE t1 (a VARCHAR(255));
+INSERT INTO t1 VALUES ('u'),('uu');
+
+CREATE TABLE t2 (b VARCHAR(255)) CHARACTER SET utf8mb4;
+INSERT INTO t2 VALUES ('x'),('xx');
+
+CREATE TABLE t3 (c VARCHAR(255));
+INSERT INTO t3 VALUES ('z'),('zz');
+
+ANALYZE TABLE t1, t2, t3 PERSISTENT FOR ALL; # Optional, fails either way
+
+set @tmp1=@@optimizer_switch, @tmp2=@@join_cache_level;
+set optimizer_switch='hash_join_cardinality=on', join_cache_level=3;
+SELECT t1.* FROM t1 JOIN (SELECT DISTINCT b FROM t2 JOIN t3) sq ON sq.b = t1.a;
+set optimizer_switch=@tmp1, join_cache_level=@tmp2;
+DROP TABLE t1, t2, t3;
+
--echo #
--echo # End of the test file
--echo #
diff --git a/mysql-test/main/selectivity_notembedded.result b/mysql-test/main/selectivity_notembedded.result
new file mode 100644
index 00000000000..d2e90a19a68
--- /dev/null
+++ b/mysql-test/main/selectivity_notembedded.result
@@ -0,0 +1,95 @@
+drop table if exists t0,t1,t2,t3;
+select @@global.use_stat_tables;
+@@global.use_stat_tables
+COMPLEMENTARY
+select @@session.use_stat_tables;
+@@session.use_stat_tables
+COMPLEMENTARY
+set @save_use_stat_tables=@@use_stat_tables;
+set use_stat_tables='preferably';
+set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
+set @save_histogram_size=@@histogram_size;
+set @save_histogram_type=@@histogram_type;
+set join_cache_level=2;
+set @@global.histogram_size=0,@@local.histogram_size=0;
+set histogram_type='single_prec_hb';
+set optimizer_use_condition_selectivity=3;
+#
+# MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram
+#
+create table t0(a int);
+insert into t0 select 1 from seq_1_to_78;
+create table t1(a int);
+insert into t1 select 1 from seq_1_to_26;
+create table t10 (a int);
+insert into t10 select 0 from t0, seq_1_to_4;
+insert into t10 select 8693 from t1;
+insert into t10 select 8694 from t1;
+insert into t10 select 8695 from t1;
+insert into t10 select 34783 from t1;
+insert into t10 select 34784 from t1;
+insert into t10 select 34785 from t1;
+insert into t10 select 34785 from t0, seq_1_to_8;
+insert into t10 select 65214 from t1;
+insert into t10 select 65215 from t1;
+insert into t10 select 65216 from t1;
+insert into t10 select 65216 from t0, seq_1_to_52;
+insert into t10 select 65217 from t1;
+insert into t10 select 65218 from t1;
+insert into t10 select 65219 from t1;
+insert into t10 select 65219 from t0;
+insert into t10 select 73913 from t1;
+insert into t10 select 73914 from t1;
+insert into t10 select 73915 from t1;
+insert into t10 select 73915 from t0, seq_1_to_40;
+insert into t10 select 78257 from t1;
+insert into t10 select 78258 from t1;
+insert into t10 select 78259 from t1;
+insert into t10 select 91300 from t1;
+insert into t10 select 91301 from t1;
+insert into t10 select 91302 from t1;
+insert into t10 select 91302 from t0, seq_1_to_6;
+insert into t10 select 91303 from t1;
+insert into t10 select 91304 from t1;
+insert into t10 select 91305 from t1;
+insert into t10 select 91305 from t0, seq_1_to_8;
+insert into t10 select 99998 from t1;
+insert into t10 select 99999 from t1;
+insert into t10 select 100000 from t1;
+set use_stat_tables=preferably;
+analyze table t10 persistent for all;
+Table Op Msg_type Msg_text
+test.t10 analyze status Engine-independent statistics collected
+test.t10 analyze status OK
+flush tables;
+set @tmp=@@optimizer_trace;
+set optimizer_trace=1;
+explain select * from t10 where a in (91303);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t10 ALL NULL NULL NULL NULL 9984 Using where
+# Must have selectivity_from_histogram <= 1.0:
+select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) as sel
+from information_schema.optimizer_trace;
+sel
+[
+ [
+ {
+ "column_name": "a",
+ "ranges":
+ ["91303 <= a <= 91303"],
+ "selectivity_from_histogram": 0.035714283
+ }
+ ]
+]
+set optimizer_trace=@tmp;
+drop table t0,t1,t10;
+set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
+set histogram_size=@save_histogram_size;
+set use_stat_tables= @save_use_stat_tables;
+#
+# End of 10.4 tests
+#
+#
+# Clean up
+#
+set @@global.histogram_size=@save_histogram_size;
diff --git a/mysql-test/main/selectivity_notembedded.test b/mysql-test/main/selectivity_notembedded.test
new file mode 100644
index 00000000000..6752bd3c7e1
--- /dev/null
+++ b/mysql-test/main/selectivity_notembedded.test
@@ -0,0 +1,121 @@
+--source include/no_valgrind_without_big.inc
+--source include/have_stat_tables.inc
+--source include/have_sequence.inc
+--source include/default_charset.inc
+--source include/not_embedded.inc
+
+--disable_warnings
+drop table if exists t0,t1,t2,t3;
+--enable_warnings
+
+select @@global.use_stat_tables;
+select @@session.use_stat_tables;
+
+set @save_use_stat_tables=@@use_stat_tables;
+set use_stat_tables='preferably';
+
+--source include/default_optimizer_switch.inc
+set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
+set @save_histogram_size=@@histogram_size;
+set @save_histogram_type=@@histogram_type;
+set join_cache_level=2;
+set @@global.histogram_size=0,@@local.histogram_size=0;
+set histogram_type='single_prec_hb';
+
+# check that statistics on nulls is used
+
+set optimizer_use_condition_selectivity=3;
+
+--echo #
+--echo # MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram
+--echo #
+create table t0(a int); # This holds how many rows we hold in a bucket.
+insert into t0 select 1 from seq_1_to_78;
+
+create table t1(a int); # one-third of a bucket
+insert into t1 select 1 from seq_1_to_26;
+
+create table t10 (a int);
+insert into t10 select 0 from t0, seq_1_to_4;
+
+insert into t10 select 8693 from t1;
+insert into t10 select 8694 from t1;
+insert into t10 select 8695 from t1;
+
+
+insert into t10 select 34783 from t1;
+insert into t10 select 34784 from t1;
+insert into t10 select 34785 from t1;
+
+
+insert into t10 select 34785 from t0, seq_1_to_8;
+
+insert into t10 select 65214 from t1;
+insert into t10 select 65215 from t1;
+insert into t10 select 65216 from t1;
+
+insert into t10 select 65216 from t0, seq_1_to_52;
+
+insert into t10 select 65217 from t1;
+insert into t10 select 65218 from t1;
+insert into t10 select 65219 from t1;
+
+insert into t10 select 65219 from t0;
+
+
+insert into t10 select 73913 from t1;
+insert into t10 select 73914 from t1;
+insert into t10 select 73915 from t1;
+
+insert into t10 select 73915 from t0, seq_1_to_40;
+
+
+insert into t10 select 78257 from t1;
+insert into t10 select 78258 from t1;
+insert into t10 select 78259 from t1;
+
+insert into t10 select 91300 from t1;
+insert into t10 select 91301 from t1;
+insert into t10 select 91302 from t1;
+
+insert into t10 select 91302 from t0, seq_1_to_6;
+
+insert into t10 select 91303 from t1; # Only 1/3rd of bucket matches the search tuple
+insert into t10 select 91304 from t1;
+insert into t10 select 91305 from t1;
+
+insert into t10 select 91305 from t0, seq_1_to_8;
+
+insert into t10 select 99998 from t1;
+insert into t10 select 99999 from t1;
+insert into t10 select 100000 from t1;
+
+set use_stat_tables=preferably;
+analyze table t10 persistent for all;
+flush tables;
+
+set @tmp=@@optimizer_trace;
+set optimizer_trace=1;
+explain select * from t10 where a in (91303);
+
+--echo # Must have selectivity_from_histogram <= 1.0:
+select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) as sel
+from information_schema.optimizer_trace;
+
+set optimizer_trace=@tmp;
+drop table t0,t1,t10;
+
+set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
+set histogram_size=@save_histogram_size;
+set use_stat_tables= @save_use_stat_tables;
+
+
+--echo #
+--echo # End of 10.4 tests
+--echo #
+
+--echo #
+--echo # Clean up
+--echo #
+--source include/restore_charset.inc
+set @@global.histogram_size=@save_histogram_size;
diff --git a/mysql-test/main/shutdown.test b/mysql-test/main/shutdown.test
index 13b7ac3f672..71f2156a17f 100644
--- a/mysql-test/main/shutdown.test
+++ b/mysql-test/main/shutdown.test
@@ -18,8 +18,8 @@ disconnect c1;
create procedure try_shutdown() shutdown;
drop procedure try_shutdown;
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name
--send shutdown
diff --git a/mysql-test/main/skr.result b/mysql-test/main/skr.result
deleted file mode 100644
index 291377573bc..00000000000
--- a/mysql-test/main/skr.result
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# MDEV-23406: query with mutually recursive CTEs when big_tables=1
-#
-set @save_big_tables=@@big_tables;
-set big_tables=1;
-Warnings:
-Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
-create table folks(id int, name char(32), dob date, father int, mother int);
-insert into folks values
-(100, 'Me', '2000-01-01', 20, 30),
-(20, 'Dad', '1970-02-02', 10, 9),
-(30, 'Mom', '1975-03-03', 8, 7),
-(10, 'Grandpa Bill', '1940-04-05', null, null),
-(9, 'Grandma Ann', '1941-10-15', null, null),
-(25, 'Uncle Jim', '1968-11-18', 8, 7),
-(98, 'Sister Amy', '2001-06-20', 20, 30),
-(7, 'Grandma Sally', '1943-08-23', null, 6),
-(8, 'Grandpa Ben', '1940-10-21', null, null),
-(6, 'Grandgrandma Martha', '1923-05-17', null, null),
-(67, 'Cousin Eddie', '1992-02-28', 25, 27),
-(27, 'Auntie Melinda', '1971-03-29', null, null);
-with recursive
-ancestor_couples(h_id, h_name, h_dob, h_father, h_mother,
-w_id, w_name, w_dob, w_father, w_mother)
-as
-(
-select h.*, w.*
-from folks h, folks w, coupled_ancestors a
-where a.father = h.id AND a.mother = w.id
-union
-select h.*, w.*
-from folks v, folks h, folks w
-where v.name = 'Me' and
-(v.father = h.id AND v.mother= w.id)
-),
-coupled_ancestors (id, name, dob, father, mother)
-as
-(
-select h_id, h_name, h_dob, h_father, h_mother
-from ancestor_couples
-union
-select w_id, w_name, w_dob, w_father, w_mother
-from ancestor_couples
-)
-select h_name, h_dob, w_name, w_dob
-from ancestor_couples;
-h_name h_dob w_name w_dob
-Dad 1970-02-02 Mom 1975-03-03
-Grandpa Bill 1940-04-05 Grandma Ann 1941-10-15
-Grandpa Ben 1940-10-21 Grandma Sally 1943-08-23
-drop table folks;
-set big_tables=@save_big_tables;
-Warnings:
-Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
diff --git a/mysql-test/main/skr.test b/mysql-test/main/skr.test
deleted file mode 100644
index 3094faff696..00000000000
--- a/mysql-test/main/skr.test
+++ /dev/null
@@ -1,56 +0,0 @@
---source include/default_optimizer_switch.inc
-
---echo #
---echo # MDEV-23406: query with mutually recursive CTEs when big_tables=1
---echo #
-
-set @save_big_tables=@@big_tables;
-set big_tables=1;
-
-create table folks(id int, name char(32), dob date, father int, mother int);
-
-insert into folks values
-(100, 'Me', '2000-01-01', 20, 30),
-(20, 'Dad', '1970-02-02', 10, 9),
-(30, 'Mom', '1975-03-03', 8, 7),
-(10, 'Grandpa Bill', '1940-04-05', null, null),
-(9, 'Grandma Ann', '1941-10-15', null, null),
-(25, 'Uncle Jim', '1968-11-18', 8, 7),
-(98, 'Sister Amy', '2001-06-20', 20, 30),
-(7, 'Grandma Sally', '1943-08-23', null, 6),
-(8, 'Grandpa Ben', '1940-10-21', null, null),
-(6, 'Grandgrandma Martha', '1923-05-17', null, null),
-(67, 'Cousin Eddie', '1992-02-28', 25, 27),
-(27, 'Auntie Melinda', '1971-03-29', null, null);
-
-let q=
-with recursive
-ancestor_couples(h_id, h_name, h_dob, h_father, h_mother,
- w_id, w_name, w_dob, w_father, w_mother)
-as
-(
- select h.*, w.*
- from folks h, folks w, coupled_ancestors a
- where a.father = h.id AND a.mother = w.id
- union
- select h.*, w.*
- from folks v, folks h, folks w
- where v.name = 'Me' and
- (v.father = h.id AND v.mother= w.id)
-),
-coupled_ancestors (id, name, dob, father, mother)
-as
-(
- select h_id, h_name, h_dob, h_father, h_mother
- from ancestor_couples
- union
- select w_id, w_name, w_dob, w_father, w_mother
- from ancestor_couples
-)
-select h_name, h_dob, w_name, w_dob
- from ancestor_couples;
-
-eval $q;
-drop table folks;
-
-set big_tables=@save_big_tables;
diff --git a/mysql-test/main/sql_mode_pad_char_to_full_length.result b/mysql-test/main/sql_mode_pad_char_to_full_length.result
new file mode 100644
index 00000000000..6f68aade613
--- /dev/null
+++ b/mysql-test/main/sql_mode_pad_char_to_full_length.result
@@ -0,0 +1,94 @@
+#
+# Start of 10.4 tests
+#
+#
+# MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
+#
+SET default_storage_engine=MyISAM;
+#
+# MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
+#
+CREATE TABLE t1 (a INT,b CHAR(20));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
+INSERT INTO t1 VALUES (0,0);
+SET sql_mode='pad_char_to_full_length';
+DELETE FROM t1;
+DROP TABLE t1;
+SET sql_mode='';
+CREATE TABLE t1 (a INT,b CHAR(20));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
+SET sql_mode='pad_char_to_full_length';
+INSERT INTO t1 VALUES (0,0);
+DELETE FROM t1;
+DROP TABLE t1;
+SET sql_mode='';
+CREATE OR REPLACE TABLE t1 (a CHAR(20),b CHAR(20));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(20) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
+INSERT INTO t1 VALUES (0,0);
+SET sql_mode='pad_char_to_full_length';
+DELETE FROM t1;
+DROP TABLE t1;
+SET default_storage_engine=MEMORY;
+#
+# MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
+#
+CREATE TABLE t1 (a INT,b CHAR(20));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
+INSERT INTO t1 VALUES (0,0);
+SET sql_mode='pad_char_to_full_length';
+DELETE FROM t1;
+DROP TABLE t1;
+SET sql_mode='';
+CREATE TABLE t1 (a INT,b CHAR(20));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
+SET sql_mode='pad_char_to_full_length';
+INSERT INTO t1 VALUES (0,0);
+DELETE FROM t1;
+DROP TABLE t1;
+SET sql_mode='';
+CREATE OR REPLACE TABLE t1 (a CHAR(20),b CHAR(20));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(20) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
+INSERT INTO t1 VALUES (0,0);
+SET sql_mode='pad_char_to_full_length';
+DELETE FROM t1;
+DROP TABLE t1;
+SET default_storage_engine=DEFAULT;
+#
+# End of 10.4 tests
+#
diff --git a/mysql-test/main/sql_mode_pad_char_to_full_length.test b/mysql-test/main/sql_mode_pad_char_to_full_length.test
new file mode 100644
index 00000000000..4d492bc1b70
--- /dev/null
+++ b/mysql-test/main/sql_mode_pad_char_to_full_length.test
@@ -0,0 +1,19 @@
+--echo #
+--echo # Start of 10.4 tests
+--echo #
+
+--echo #
+--echo # MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
+--echo #
+
+SET default_storage_engine=MyISAM;
+--source include/sql_mode_pad_char_to_full_length.inc
+
+SET default_storage_engine=MEMORY;
+--source include/sql_mode_pad_char_to_full_length.inc
+
+SET default_storage_engine=DEFAULT;
+
+--echo #
+--echo # End of 10.4 tests
+--echo #
diff --git a/mysql-test/main/status.result b/mysql-test/main/status.result
index 0669bdf3b34..9a4dd7c9302 100644
--- a/mysql-test/main/status.result
+++ b/mysql-test/main/status.result
@@ -447,3 +447,22 @@ Feature_json 2
connection default;
set @@global.concurrent_insert= @old_concurrent_insert;
SET GLOBAL log_output = @old_log_output;
+#
+# MDEV-30543 New status variable: Max_used_connections_time
+#
+FLUSH STATUS;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
+disconnect con2;
+SELECT 'DTVALUE' = 'DTVALUE' AS expect_1;
+expect_1
+1
+connect con3,localhost,root,,;
+connect con4,localhost,root,,;
+SELECT 'DTVALUE' < 'DTVALUE' as expect_1;
+expect_1
+1
+disconnect con4;
+disconnect con3;
+disconnect con1;
diff --git a/mysql-test/main/status.test b/mysql-test/main/status.test
index 78626615d45..acf29f35b9e 100644
--- a/mysql-test/main/status.test
+++ b/mysql-test/main/status.test
@@ -280,7 +280,6 @@ show status like 'Com%function';
#
connect (root, localhost, root,,test);
connection root;
-let $root_connection_id= `select connection_id()`;
--disable_warnings
create database db37908;
--enable_warnings
@@ -296,7 +295,6 @@ delimiter ;|
connect (user1,localhost,mysqltest_1,,test);
connection user1;
-let $user1_connection_id= `select connection_id()`;
--error ER_TABLEACCESS_DENIED_ERROR
select * from db37908.t1;
@@ -315,11 +313,8 @@ drop procedure proc37908;
drop function func37908;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
DROP USER mysqltest_1@localhost;
-# Wait till the sessions user1 and root are disconnected
-let $wait_condition =
- SELECT COUNT(*) = 0
- FROM information_schema.processlist
- WHERE id in ('$root_connection_id','$user1_connection_id');
+# Wait until all non-default sessions are disconnected
+let $wait_condition = SELECT COUNT(*) = 1 FROM information_schema.processlist;
--source include/wait_condition.inc
#
@@ -447,3 +442,34 @@ SET GLOBAL log_output = @old_log_output;
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
+--echo #
+--echo # MDEV-30543 New status variable: Max_used_connections_time
+--echo #
+
+FLUSH STATUS;
+
+connect (con1,localhost,root,,);
+--sleep 1
+connect (con2,localhost,root,,);
+--sleep 1
+let $time_1=`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections_time'`;
+--sleep 1
+connection con1;
+disconnect con2;
+--sleep 1
+let $time_2=`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections_time'`;
+--replace_regex /[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*/DTVALUE/
+eval SELECT '$time_1' = '$time_2' AS expect_1;
+--sleep 1
+connect (con3,localhost,root,,);
+--sleep 1
+connect (con4,localhost,root,,);
+--sleep 1
+let $time_3=`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections_time'`;
+--replace_regex /[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*/DTVALUE/
+eval SELECT '$time_1' < '$time_3' as expect_1;
+
+disconnect con4;
+disconnect con3;
+disconnect con1;
+
diff --git a/mysql-test/main/subselect.result b/mysql-test/main/subselect.result
index e0cf1e61d95..6e0c956b77e 100644
--- a/mysql-test/main/subselect.result
+++ b/mysql-test/main/subselect.result
@@ -118,27 +118,27 @@ ROW(1,2,3) > (SELECT 1,2,1)
SELECT ROW(1,2,3) = (SELECT 1,2,NULL);
ROW(1,2,3) = (SELECT 1,2,NULL)
NULL
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a');
-(SELECT 1.5,2,'a') = ROW(1.5,2,'a')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a') AS m;
+m
1
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b');
-(SELECT 1.5,2,'a') = ROW(1.5,2,'b')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b') AS m;
+m
0
-SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b');
-(SELECT 1.5,2,'a') = ROW('1.5b',2,'b')
+SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '1.5b'
-SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a');
-(SELECT 'b',2,'a') = ROW(1.5,2,'a')
+SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'b'
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a');
-(SELECT 1.5,2,'a') = ROW(1.5,'2','a')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a') AS m;
+m
1
-SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
-(SELECT 1.5,'c','a') = ROW(1.5,2,'a')
+SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: 'c'
@@ -228,19 +228,26 @@ a
2
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1);
a
-select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4;
-b (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)
+select
+b,
+(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m
+from t4;
+b m
8 7.5000
8 4.5000
9 7.5000
-explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4;
+explain extended
+select
+b,
+(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m
+from t4;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t4 ALL NULL NULL NULL NULL 3 100.00
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,<expr_cache><`test`.`t4`.`a`>((/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4`
+Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,<expr_cache><`test`.`t4`.`a`>((/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `m` from `test`.`t4`
select * from t3 where exists (select * from t2 where t2.b=t3.a);
a
7
@@ -307,21 +314,34 @@ select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 w
b ma
7 12
create table t5 (a int);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
insert into t5 values (5);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
insert into t5 values (2);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
-explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
+explain extended
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00
@@ -330,7 +350,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 /* select#1 */ select <expr_cache><`test`.`t2`.`a`>((/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
+Note 1003 /* select#1 */ select <expr_cache><`test`.`t2`.`a`>((/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `m`,`test`.`t2`.`a` AS `a` from `test`.`t2`
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
ERROR 21000: Subquery returns more than 1 row
create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
@@ -486,8 +506,11 @@ SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING t
mot topic date pseudo
joce 40143 2002-10-22 joce
joce 43506 2002-10-22 joce
-SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2;
-mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100)
+SELECT
+*,
+topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) AS m
+FROM t2;
+mot topic date pseudo m
joce 40143 2002-10-22 joce 1
joce 43506 2002-10-22 joce 1
SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2);
@@ -505,8 +528,11 @@ joce 40143 2002-10-22 joce
SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000);
mot topic date pseudo
joce 40143 2002-10-22 joce
-SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2;
-mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000)
+SELECT
+*,
+topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) AS m
+FROM t2;
+mot topic date pseudo m
joce 40143 2002-10-22 joce 1
joce 43506 2002-10-22 joce 0
drop table t1,t2;
@@ -890,6 +916,25 @@ NULL
select 1.5 > ANY (SELECT * from t1);
1.5 > ANY (SELECT * from t1)
NULL
+update t1 set a=NULL where a=2.5;
+select 1.5 IN (SELECT * from t1);
+1.5 IN (SELECT * from t1)
+1
+select 3.5 IN (SELECT * from t1);
+3.5 IN (SELECT * from t1)
+1
+select 10.5 IN (SELECT * from t1);
+10.5 IN (SELECT * from t1)
+NULL
+select 1.5 > ALL (SELECT * from t1);
+1.5 > ALL (SELECT * from t1)
+0
+select 10.5 > ALL (SELECT * from t1);
+10.5 > ALL (SELECT * from t1)
+NULL
+select 1.5 > ANY (SELECT * from t1);
+1.5 > ANY (SELECT * from t1)
+NULL
select 10.5 > ANY (SELECT * from t1);
10.5 > ANY (SELECT * from t1)
1
@@ -900,6 +945,20 @@ Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1249 Select 2 was reduced during optimization
Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
+explain extended select (select a+1) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1249 Select 2 was reduced during optimization
+Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
+explain extended select (select a+1) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1249 Select 2 was reduced during optimization
+Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
select (select a+1) from t1;
(select a+1)
2.5
@@ -1547,8 +1606,8 @@ create table t3 (a int, b int);
insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10);
insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1);
insert into t3 values (3,3), (2,2), (1,1);
-select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3;
-a (select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1)
+select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) as m from t3;
+a m
3 1
2 2
1 2
@@ -1746,8 +1805,8 @@ CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(1
INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1);
CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status');
-select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid;
-dbid name (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01')
+select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') as m FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') as m from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid;
+dbid name m
-1 Valid 1
-1 Valid 2 1
-1 Should Not Return 0
@@ -3809,9 +3868,10 @@ SELECT (SELECT COUNT(DISTINCT t1.b) from t2) FROM t1 GROUP BY t1.a;
2
1
1
-SELECT (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3)
+SELECT
+(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) AS m
FROM t1 GROUP BY t1.a;
-(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3)
+m
2
1
1
@@ -3821,9 +3881,9 @@ COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b))
1 1
1 1
SELECT COUNT(DISTINCT t1.b),
-(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3)
+(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) AS m
FROM t1 GROUP BY t1.a;
-COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3)
+COUNT(DISTINCT t1.b) m
2 2
1 1
1 1
@@ -3847,16 +3907,10 @@ SELECT (
SELECT COUNT(DISTINCT t1.b)
)
)
-FROM t1 GROUP BY t1.a LIMIT 1)
+FROM t1 GROUP BY t1.a LIMIT 1) AS m
FROM t1 t2
GROUP BY t2.a;
-(
-SELECT (
-SELECT (
-SELECT COUNT(DISTINCT t1.b)
-)
-)
-FROM t1 GROUP BY t1.a LIMIT 1)
+m
2
2
2
@@ -6453,11 +6507,10 @@ CREATE TABLE t3 (a int, b int);
INSERT INTO t3 VALUES (10,7), (0,7);
SELECT SUM(DISTINCT b),
(SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0
-WHERE t.a != 0 AND t2.a != 0)
+WHERE t.a != 0 AND t2.a != 0) AS m
FROM (SELECT * FROM t3) AS t
GROUP BY 2;
-SUM(DISTINCT b) (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0
-WHERE t.a != 0 AND t2.a != 0)
+SUM(DISTINCT b) m
7 NULL
SELECT SUM(DISTINCT b),
(SELECT t2.a FROM t1,t2 WHERE t.a != 0 or 1=2 LIMIT 1)
@@ -6590,66 +6643,93 @@ CREATE TABLE t3 (f3a int default 1, f3b int default 2);
INSERT INTO t3 VALUES (1,1),(2,2);
set @old_optimizer_switch = @@session.optimizer_switch;
set @@optimizer_switch='materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=off,subquery_cache=off,semijoin=off';
-SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
-SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
set @@session.optimizer_switch=@old_optimizer_switch;
-SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
-SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2;
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2 AS m;
(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1)
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
select (null, null) = (null, null);
(null, null) = (null, null)
@@ -6695,8 +6775,10 @@ INSERT INTO t2 VALUES (1);
CREATE TABLE t3 ( c INT );
INSERT INTO t3 VALUES (4),(5);
SET optimizer_switch='subquery_cache=off';
-SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1;
-( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) )
+SELECT
+( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) AS m
+FROM t1;
+m
1
NULL
SELECT ( SELECT b FROM t2 WHERE b = a OR b * 0) FROM t1;
@@ -6913,7 +6995,9 @@ CREATE TABLE t3 (c INT);
INSERT INTO t3 VALUES (8),(3);
set @@expensive_subquery_limit= 0;
EXPLAIN
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 ALL NULL NULL NULL NULL 2
@@ -6923,9 +7007,11 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 SUBQUERY t3 ALL NULL NULL NULL NULL 2
flush status;
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
-(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+m
NULL
NULL
NULL
@@ -6951,7 +7037,9 @@ Handler_read_rnd_deleted 0
Handler_read_rnd_next 22
set @@expensive_subquery_limit= default;
EXPLAIN
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 ALL NULL NULL NULL NULL 2
@@ -6961,9 +7049,11 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 SUBQUERY t3 ALL NULL NULL NULL NULL 2
flush status;
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
-(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+m
NULL
NULL
NULL
diff --git a/mysql-test/main/subselect.test b/mysql-test/main/subselect.test
index 578dbe86406..089eb10b6f0 100644
--- a/mysql-test/main/subselect.test
+++ b/mysql-test/main/subselect.test
@@ -79,13 +79,13 @@ SELECT ROW(1,2,3) > (SELECT 1,2,1);
#enable after fix MDEV-28585
--disable_view_protocol
SELECT ROW(1,2,3) = (SELECT 1,2,NULL);
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a');
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b');
-SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b');
-SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a');
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a');
-SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
--enable_view_protocol
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a') AS m;
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b') AS m;
+SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b') AS m;
+SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a') AS m;
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a') AS m;
+SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a') AS m;
-- error ER_OPERAND_COLUMNS
SELECT (SELECT * FROM (SELECT 'test' a,'test' b) a);
@@ -123,11 +123,15 @@ set optimizer_switch=@tmp_optimizer_switch;
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1);
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a > t1.a) order by 1 desc limit 1);
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1);
-#enable afte fix MDEV-27871
---disable_view_protocol
-select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4;
-explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4;
---enable_view_protocol
+select
+ b,
+ (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m
+from t4;
+explain extended
+select
+ b,
+ (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m
+from t4;
select * from t3 where exists (select * from t2 where t2.b=t3.a);
select * from t3 where not exists (select * from t2 where t2.b=t3.a);
select * from t3 where a in (select b from t2);
@@ -160,16 +164,25 @@ delete from t2 where a=2 and b=10;
select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 where t2.b=t4.b);
create table t5 (a int);
-#enable afte fix MDEV-27871
---disable_view_protocol
-
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
+select
+ (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+ a
+from t2;
insert into t5 values (5);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
+select
+ (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+ a
+from t2;
insert into t5 values (2);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
---enable_view_protocol
+select
+ (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+ a
+from t2;
+explain extended
+select
+ (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+ a
+from t2;
-- error ER_SUBQUERY_NO_1_ROW
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
@@ -274,19 +287,19 @@ SELECT * from t2 where topic = any (SELECT topic FROM t2 GROUP BY topic HAVING t
SELECT * from t2 where topic = any (SELECT SUM(topic) FROM t1);
SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic);
SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100);
-#enable after fix MDEV-27871
---disable_view_protocol
-SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2;
---enable_view_protocol
+SELECT
+ *,
+ topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) AS m
+FROM t2;
SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2);
SELECT * from t2 where topic <> any (SELECT SUM(topic) FROM t2);
SELECT * from t2 where topic IN (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000);
SELECT * from t2 where topic = any (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000);
SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000);
-#enable after fix MDEV-27871
---disable_view_protocol
-SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2;
---enable_view_protocol
+SELECT
+ *,
+ topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) AS m
+FROM t2;
drop table t1,t2;
#forumconthardwarefr7
@@ -535,13 +548,22 @@ select 10.5 IN (SELECT * from t1);
select 1.5 > ALL (SELECT * from t1);
select 10.5 > ALL (SELECT * from t1);
select 1.5 > ANY (SELECT * from t1);
+update t1 set a=NULL where a=2.5;
+select 1.5 IN (SELECT * from t1);
+select 3.5 IN (SELECT * from t1);
+select 10.5 IN (SELECT * from t1);
+select 1.5 > ALL (SELECT * from t1);
+select 10.5 > ALL (SELECT * from t1);
+select 1.5 > ANY (SELECT * from t1);
select 10.5 > ANY (SELECT * from t1);
--enable_prepare_warnings
+--enable_view_protocol
+explain extended select (select a+1) from t1;
+explain extended select (select a+1) from t1;
explain extended select (select a+1) from t1;
--disable_prepare_warnings
select (select a+1) from t1;
drop table t1;
---enable_view_protocol
--echo #
--echo # Null with keys
@@ -961,10 +983,7 @@ create table t3 (a int, b int);
insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10);
insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1);
insert into t3 values (3,3), (2,2), (1,1);
-#enable after fix MDEV-27871
---disable_view_protocol
-select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3;
---enable_view_protocol
+select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) as m from t3;
drop table t1,t2,t3;
#
@@ -1083,10 +1102,7 @@ CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(1
INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1);
CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status');
-#enable after fix MDEV-27871
---disable_view_protocol
-select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid;
---enable_view_protocol
+select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') as m FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') as m from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid;
SELECT dbid, name FROM t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND ((date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01')) AND t4.task_id = taskid;
drop table t1,t2,t3,t4;
@@ -2406,9 +2422,6 @@ SELECT a, MAX(b), MIN(b) FROM t1 GROUP BY a;
SELECT * FROM t2;
SELECT * FROM t3;
-#enable after fix MDEV-28570
---disable_view_protocol
-
SELECT a FROM t1 GROUP BY a
HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20);
SELECT a FROM t1 GROUP BY a
@@ -2473,8 +2486,6 @@ SELECT t1.a, SUM(b) AS sum FROM t1 GROUP BY t1.a
HAVING t1.a IN (SELECT t2.c FROM t2 GROUP BY t2.c
HAVING t2.c+sum > 20);
---enable_view_protocol
-
DROP TABLE t1,t2,t3;
@@ -2705,19 +2716,17 @@ DROP TABLE t1;
# Bug#21540 Subqueries with no from and aggregate functions return
# wrong results
-#enable after fix MDEV-27871, MDEV-28573
---disable_view_protocol
-
CREATE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (a INT);
INSERT INTO t2 values (1);
INSERT INTO t1 VALUES (1,1),(1,2),(2,3),(3,4);
SELECT (SELECT COUNT(DISTINCT t1.b) from t2) FROM t1 GROUP BY t1.a;
-SELECT (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3)
+SELECT
+ (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) AS m
FROM t1 GROUP BY t1.a;
SELECT COUNT(DISTINCT t1.b), (SELECT COUNT(DISTINCT t1.b)) FROM t1 GROUP BY t1.a;
SELECT COUNT(DISTINCT t1.b),
- (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3)
+ (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) AS m
FROM t1 GROUP BY t1.a;
SELECT (
SELECT (
@@ -2731,11 +2740,10 @@ SELECT (
SELECT COUNT(DISTINCT t1.b)
)
)
- FROM t1 GROUP BY t1.a LIMIT 1)
+ FROM t1 GROUP BY t1.a LIMIT 1) AS m
FROM t1 t2
GROUP BY t2.a;
DROP TABLE t1,t2;
---enable_view_protocol
#
# Bug#21727 Correlated subquery that requires filesort:
@@ -2970,8 +2978,6 @@ DROP TABLE t1,t2;
# Bug#27229 GROUP_CONCAT in subselect with COUNT() as an argument
#
-#enable after fix MDEV-28571
---disable_view_protocol
CREATE TABLE t1 (a int, b int);
CREATE TABLE t2 (m int, n int);
INSERT INTO t1 VALUES (2,2), (2,2), (3,3), (3,3), (3,3), (4,4);
@@ -2986,7 +2992,6 @@ SELECT COUNT(*) c, a,
FROM t1 GROUP BY a;
DROP table t1,t2;
---enable_view_protocol
#
# Bug#27321 Wrong subquery result in a grouping select
@@ -3017,14 +3022,11 @@ SELECT tt.a,
FROM t1 WHERE t1.a=tt.a GROUP BY a LIMIT 1) as test
FROM t1 as tt GROUP BY tt.a;
-#enable after fix MDEV-28571
---disable_view_protocol
SELECT tt.a, MAX(
(SELECT (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.d=MAX(t1.b + tt.a)
LIMIT 1)
FROM t1 WHERE t1.a=tt.a GROUP BY a LIMIT 1)) as test
FROM t1 as tt GROUP BY tt.a;
---enable_view_protocol
DROP TABLE t1;
@@ -3180,8 +3182,6 @@ CREATE TABLE t2 (x INTEGER);
INSERT INTO t1 VALUES (1,11), (2,22), (2,22);
INSERT INTO t2 VALUES (1), (2);
-#enable after fix MDEV-28573
---disable_view_protocol
# wasn't failing, but should
--error ER_SUBQUERY_NO_1_ROW
SELECT a, COUNT(b), (SELECT COUNT(b) FROM t2) FROM t1 GROUP BY a;
@@ -3191,7 +3191,6 @@ SELECT a, COUNT(b), (SELECT COUNT(b) FROM t2) FROM t1 GROUP BY a;
SELECT a, COUNT(b), (SELECT COUNT(b)+0 FROM t2) FROM t1 GROUP BY a;
SELECT (SELECT SUM(t1.a)/AVG(t2.x) FROM t2) FROM t1;
---enable_view_protocol
DROP TABLE t1,t2;
@@ -3206,8 +3205,6 @@ GROUP BY a1.a;
DROP TABLE t1;
#test cases from 29297
-#enable after fix MDEV-28573
---disable_view_protocol
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (1),(2);
@@ -3217,7 +3214,6 @@ SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=0) FROM t1;
SELECT (SELECT SUM(t1.a) FROM t2 WHERE a!=0) FROM t1;
SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=1) FROM t1;
DROP TABLE t1,t2;
---enable_view_protocol
#
# Bug#31884 Assertion + crash in subquery in the SELECT clause.
@@ -5420,14 +5416,11 @@ INSERT INTO t2 VALUES (10,7,0), (0,7,0);
CREATE TABLE t3 (a int, b int);
INSERT INTO t3 VALUES (10,7), (0,7);
-#enable after fix MDEV-27871
---disable_view_protocol
SELECT SUM(DISTINCT b),
(SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0
- WHERE t.a != 0 AND t2.a != 0)
+ WHERE t.a != 0 AND t2.a != 0) AS m
FROM (SELECT * FROM t3) AS t
GROUP BY 2;
---enable_view_protocol
SELECT SUM(DISTINCT b),
(SELECT t2.a FROM t1,t2 WHERE t.a != 0 or 1=2 LIMIT 1)
@@ -5585,29 +5578,53 @@ INSERT INTO t3 VALUES (1,1),(2,2);
set @old_optimizer_switch = @@session.optimizer_switch;
set @@optimizer_switch='materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=off,subquery_cache=off,semijoin=off';
-#enable after fix MDEV-27871
---disable_view_protocol
-SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2;
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2;
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2;
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1);
-SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2;
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2;
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2;
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1);
+SELECT
+ (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m
+FROM t2;
+SELECT
+ (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m
+ FROM t2;
+SELECT
+ (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+SELECT
+ (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m;
+SELECT
+ (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) AS m
+FROM t2;
+SELECT
+ (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+SELECT
+ (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+SELECT
+ (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m;
set @@session.optimizer_switch=@old_optimizer_switch;
# check different IN with default switches
-SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2;
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2;
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2;
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1);
-SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2;
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2;
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2;
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1);
---enable_view_protocol
+SELECT
+ (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m
+FROM t2;
+SELECT
+ (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+SELECT
+ (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+SELECT
+ (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m;
+SELECT
+ (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2 AS m;
+SELECT
+ (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+SELECT
+ (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+SELECT
+ (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m;
# other row operation with NULL single row subquery also should work
select (null, null) = (null, null);
@@ -5647,10 +5664,9 @@ INSERT INTO t3 VALUES (4),(5);
SET optimizer_switch='subquery_cache=off';
-#enable after fix MDEV-27871
---disable_view_protocol
-SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1;
---enable_view_protocol
+SELECT
+ ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) AS m
+FROM t1;
# This query just for example, it should return the same as above (1 and NULL)
SELECT ( SELECT b FROM t2 WHERE b = a OR b * 0) FROM t1;
@@ -5839,15 +5855,17 @@ INSERT INTO t3 VALUES (8),(3);
set @@expensive_subquery_limit= 0;
-#enable after fix MDEV-27871
---disable_view_protocol
EXPLAIN
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+ (SELECT MIN(b) FROM t1, t2
+ WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
flush status;
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+ (SELECT MIN(b) FROM t1, t2
+ WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
show status like "subquery_cache%";
@@ -5856,17 +5874,20 @@ show status like '%Handler_read%';
set @@expensive_subquery_limit= default;
EXPLAIN
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+ (SELECT MIN(b) FROM t1, t2
+ WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
flush status;
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+ (SELECT MIN(b) FROM t1, t2
+ WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
show status like "subquery_cache%";
show status like '%Handler_read%';
---enable_view_protocol
drop table t1, t2, t3;
@@ -6120,22 +6141,16 @@ INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (f2 int);
INSERT INTO t2 VALUES (3);
-#enable after fix MDEV-29224
---disable_view_protocol
SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1;
SELECT ( SELECT MAX(f1) FROM t2 ) FROM v1;
---enable_view_protocol
INSERT INTO t2 VALUES (4);
-#enable after fix MDEV-28573
---disable_view_protocol
--error ER_SUBQUERY_NO_1_ROW
SELECT ( SELECT MAX(f1) FROM t2 ) FROM v1;
--error ER_SUBQUERY_NO_1_ROW
SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1;
---enable_view_protocol
drop view v1;
drop table t1,t2;
diff --git a/mysql-test/main/subselect3_jcl6.result b/mysql-test/main/subselect3_jcl6.result
index acd1269d875..ca06d25db49 100644
--- a/mysql-test/main/subselect3_jcl6.result
+++ b/mysql-test/main/subselect3_jcl6.result
@@ -1170,11 +1170,11 @@ set @@optimizer_switch='firstmatch=off,materialization=off';
set @@max_heap_table_size= 16384;
explain select count(*) from t0 A, t0 B, t0 C, t0 D where D.a in (select a from t1 E where a+1 < 10000 + A.a + B.a +C.a+D.a);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY E ALL NULL NULL NULL NULL 5 Using where; Start temporary
-1 PRIMARY A ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
+1 PRIMARY A ALL NULL NULL NULL NULL 10
+1 PRIMARY E ALL NULL NULL NULL NULL 5 Using where; Start temporary; Using join buffer (flat, BNL join)
+1 PRIMARY D hash_ALL NULL #hash#$hj 5 test.E.a 10 Using where; Using join buffer (incremental, BNLH join)
1 PRIMARY B ALL NULL NULL NULL NULL 10 Using join buffer (incremental, BNL join)
-1 PRIMARY C ALL NULL NULL NULL NULL 10 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY D hash_ALL NULL #hash#$hj 5 test.E.a 10 Using where; End temporary; Using join buffer (incremental, BNLH join)
+1 PRIMARY C ALL NULL NULL NULL NULL 10 Using where; End temporary; Using join buffer (incremental, BNL join)
flush status;
select count(*) from t0 A, t0 B, t0 C, t0 D where D.a in (select a from t1 E where a+1 < 10000 + A.a + B.a +C.a+D.a);
count(*)
diff --git a/mysql-test/main/subselect4.result b/mysql-test/main/subselect4.result
index 29e7e11f0ba..cef56e27d91 100644
--- a/mysql-test/main/subselect4.result
+++ b/mysql-test/main/subselect4.result
@@ -20,8 +20,8 @@ WHERE NOT EXISTS (SELECT 1 FROM t2 WHERE 1 = (SELECT MIN(t2.b) FROM t3))
ORDER BY count(*);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL a 5 NULL 2 Using index
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
-3 DEPENDENT SUBQUERY t3 system NULL NULL NULL NULL 0 Const row not found
+2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
# should not crash the next statement
SELECT 1 FROM t1
WHERE NOT EXISTS (SELECT 1 FROM t2 WHERE 1 = (SELECT MIN(t2.b) FROM t3))
diff --git a/mysql-test/main/subselect_no_exists_to_in.result b/mysql-test/main/subselect_no_exists_to_in.result
index 3be4f07b8ca..3750c96871b 100644
--- a/mysql-test/main/subselect_no_exists_to_in.result
+++ b/mysql-test/main/subselect_no_exists_to_in.result
@@ -122,27 +122,27 @@ ROW(1,2,3) > (SELECT 1,2,1)
SELECT ROW(1,2,3) = (SELECT 1,2,NULL);
ROW(1,2,3) = (SELECT 1,2,NULL)
NULL
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a');
-(SELECT 1.5,2,'a') = ROW(1.5,2,'a')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a') AS m;
+m
1
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b');
-(SELECT 1.5,2,'a') = ROW(1.5,2,'b')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b') AS m;
+m
0
-SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b');
-(SELECT 1.5,2,'a') = ROW('1.5b',2,'b')
+SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '1.5b'
-SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a');
-(SELECT 'b',2,'a') = ROW(1.5,2,'a')
+SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'b'
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a');
-(SELECT 1.5,2,'a') = ROW(1.5,'2','a')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a') AS m;
+m
1
-SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
-(SELECT 1.5,'c','a') = ROW(1.5,2,'a')
+SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: 'c'
@@ -232,19 +232,26 @@ a
2
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1);
a
-select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4;
-b (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)
+select
+b,
+(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m
+from t4;
+b m
8 7.5000
8 4.5000
9 7.5000
-explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4;
+explain extended
+select
+b,
+(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m
+from t4;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t4 ALL NULL NULL NULL NULL 3 100.00
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,<expr_cache><`test`.`t4`.`a`>((/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4`
+Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,<expr_cache><`test`.`t4`.`a`>((/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `m` from `test`.`t4`
select * from t3 where exists (select * from t2 where t2.b=t3.a);
a
7
@@ -311,21 +318,34 @@ select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 w
b ma
7 12
create table t5 (a int);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
insert into t5 values (5);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
insert into t5 values (2);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
-explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
+explain extended
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00
@@ -334,7 +354,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 /* select#1 */ select <expr_cache><`test`.`t2`.`a`>((/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
+Note 1003 /* select#1 */ select <expr_cache><`test`.`t2`.`a`>((/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `m`,`test`.`t2`.`a` AS `a` from `test`.`t2`
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
ERROR 21000: Subquery returns more than 1 row
create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
@@ -490,8 +510,11 @@ SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING t
mot topic date pseudo
joce 40143 2002-10-22 joce
joce 43506 2002-10-22 joce
-SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2;
-mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100)
+SELECT
+*,
+topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) AS m
+FROM t2;
+mot topic date pseudo m
joce 40143 2002-10-22 joce 1
joce 43506 2002-10-22 joce 1
SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2);
@@ -509,8 +532,11 @@ joce 40143 2002-10-22 joce
SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000);
mot topic date pseudo
joce 40143 2002-10-22 joce
-SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2;
-mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000)
+SELECT
+*,
+topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) AS m
+FROM t2;
+mot topic date pseudo m
joce 40143 2002-10-22 joce 1
joce 43506 2002-10-22 joce 0
drop table t1,t2;
@@ -894,6 +920,25 @@ NULL
select 1.5 > ANY (SELECT * from t1);
1.5 > ANY (SELECT * from t1)
NULL
+update t1 set a=NULL where a=2.5;
+select 1.5 IN (SELECT * from t1);
+1.5 IN (SELECT * from t1)
+1
+select 3.5 IN (SELECT * from t1);
+3.5 IN (SELECT * from t1)
+1
+select 10.5 IN (SELECT * from t1);
+10.5 IN (SELECT * from t1)
+NULL
+select 1.5 > ALL (SELECT * from t1);
+1.5 > ALL (SELECT * from t1)
+0
+select 10.5 > ALL (SELECT * from t1);
+10.5 > ALL (SELECT * from t1)
+NULL
+select 1.5 > ANY (SELECT * from t1);
+1.5 > ANY (SELECT * from t1)
+NULL
select 10.5 > ANY (SELECT * from t1);
10.5 > ANY (SELECT * from t1)
1
@@ -904,6 +949,20 @@ Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1249 Select 2 was reduced during optimization
Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
+explain extended select (select a+1) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1249 Select 2 was reduced during optimization
+Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
+explain extended select (select a+1) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1249 Select 2 was reduced during optimization
+Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
select (select a+1) from t1;
(select a+1)
2.5
@@ -1551,8 +1610,8 @@ create table t3 (a int, b int);
insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10);
insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1);
insert into t3 values (3,3), (2,2), (1,1);
-select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3;
-a (select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1)
+select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) as m from t3;
+a m
3 1
2 2
1 2
@@ -1750,8 +1809,8 @@ CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(1
INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1);
CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status');
-select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid;
-dbid name (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01')
+select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') as m FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') as m from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid;
+dbid name m
-1 Valid 1
-1 Valid 2 1
-1 Should Not Return 0
@@ -3812,9 +3871,10 @@ SELECT (SELECT COUNT(DISTINCT t1.b) from t2) FROM t1 GROUP BY t1.a;
2
1
1
-SELECT (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3)
+SELECT
+(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) AS m
FROM t1 GROUP BY t1.a;
-(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3)
+m
2
1
1
@@ -3824,9 +3884,9 @@ COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b))
1 1
1 1
SELECT COUNT(DISTINCT t1.b),
-(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3)
+(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) AS m
FROM t1 GROUP BY t1.a;
-COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3)
+COUNT(DISTINCT t1.b) m
2 2
1 1
1 1
@@ -3850,16 +3910,10 @@ SELECT (
SELECT COUNT(DISTINCT t1.b)
)
)
-FROM t1 GROUP BY t1.a LIMIT 1)
+FROM t1 GROUP BY t1.a LIMIT 1) AS m
FROM t1 t2
GROUP BY t2.a;
-(
-SELECT (
-SELECT (
-SELECT COUNT(DISTINCT t1.b)
-)
-)
-FROM t1 GROUP BY t1.a LIMIT 1)
+m
2
2
2
@@ -6455,11 +6509,10 @@ CREATE TABLE t3 (a int, b int);
INSERT INTO t3 VALUES (10,7), (0,7);
SELECT SUM(DISTINCT b),
(SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0
-WHERE t.a != 0 AND t2.a != 0)
+WHERE t.a != 0 AND t2.a != 0) AS m
FROM (SELECT * FROM t3) AS t
GROUP BY 2;
-SUM(DISTINCT b) (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0
-WHERE t.a != 0 AND t2.a != 0)
+SUM(DISTINCT b) m
7 NULL
SELECT SUM(DISTINCT b),
(SELECT t2.a FROM t1,t2 WHERE t.a != 0 or 1=2 LIMIT 1)
@@ -6592,66 +6645,93 @@ CREATE TABLE t3 (f3a int default 1, f3b int default 2);
INSERT INTO t3 VALUES (1,1),(2,2);
set @old_optimizer_switch = @@session.optimizer_switch;
set @@optimizer_switch='materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=off,subquery_cache=off,semijoin=off';
-SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
-SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
set @@session.optimizer_switch=@old_optimizer_switch;
-SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
-SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2;
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2 AS m;
(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1)
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
select (null, null) = (null, null);
(null, null) = (null, null)
@@ -6697,8 +6777,10 @@ INSERT INTO t2 VALUES (1);
CREATE TABLE t3 ( c INT );
INSERT INTO t3 VALUES (4),(5);
SET optimizer_switch='subquery_cache=off';
-SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1;
-( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) )
+SELECT
+( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) AS m
+FROM t1;
+m
1
NULL
SELECT ( SELECT b FROM t2 WHERE b = a OR b * 0) FROM t1;
@@ -6915,7 +6997,9 @@ CREATE TABLE t3 (c INT);
INSERT INTO t3 VALUES (8),(3);
set @@expensive_subquery_limit= 0;
EXPLAIN
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 ALL NULL NULL NULL NULL 2
@@ -6925,9 +7009,11 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 SUBQUERY t3 ALL NULL NULL NULL NULL 2
flush status;
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
-(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+m
NULL
NULL
NULL
@@ -6953,7 +7039,9 @@ Handler_read_rnd_deleted 0
Handler_read_rnd_next 22
set @@expensive_subquery_limit= default;
EXPLAIN
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 ALL NULL NULL NULL NULL 2
@@ -6963,9 +7051,11 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 SUBQUERY t3 ALL NULL NULL NULL NULL 2
flush status;
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
-(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+m
NULL
NULL
NULL
diff --git a/mysql-test/main/subselect_no_mat.result b/mysql-test/main/subselect_no_mat.result
index a47e2977774..f837e20be8b 100644
--- a/mysql-test/main/subselect_no_mat.result
+++ b/mysql-test/main/subselect_no_mat.result
@@ -125,27 +125,27 @@ ROW(1,2,3) > (SELECT 1,2,1)
SELECT ROW(1,2,3) = (SELECT 1,2,NULL);
ROW(1,2,3) = (SELECT 1,2,NULL)
NULL
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a');
-(SELECT 1.5,2,'a') = ROW(1.5,2,'a')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a') AS m;
+m
1
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b');
-(SELECT 1.5,2,'a') = ROW(1.5,2,'b')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b') AS m;
+m
0
-SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b');
-(SELECT 1.5,2,'a') = ROW('1.5b',2,'b')
+SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '1.5b'
-SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a');
-(SELECT 'b',2,'a') = ROW(1.5,2,'a')
+SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'b'
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a');
-(SELECT 1.5,2,'a') = ROW(1.5,'2','a')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a') AS m;
+m
1
-SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
-(SELECT 1.5,'c','a') = ROW(1.5,2,'a')
+SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: 'c'
@@ -235,19 +235,26 @@ a
2
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1);
a
-select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4;
-b (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)
+select
+b,
+(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m
+from t4;
+b m
8 7.5000
8 4.5000
9 7.5000
-explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4;
+explain extended
+select
+b,
+(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m
+from t4;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t4 ALL NULL NULL NULL NULL 3 100.00
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,<expr_cache><`test`.`t4`.`a`>((/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4`
+Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,<expr_cache><`test`.`t4`.`a`>((/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `m` from `test`.`t4`
select * from t3 where exists (select * from t2 where t2.b=t3.a);
a
7
@@ -314,21 +321,34 @@ select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 w
b ma
7 12
create table t5 (a int);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
insert into t5 values (5);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
insert into t5 values (2);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
-explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
+explain extended
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00
@@ -337,7 +357,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 /* select#1 */ select <expr_cache><`test`.`t2`.`a`>((/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
+Note 1003 /* select#1 */ select <expr_cache><`test`.`t2`.`a`>((/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `m`,`test`.`t2`.`a` AS `a` from `test`.`t2`
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
ERROR 21000: Subquery returns more than 1 row
create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
@@ -493,8 +513,11 @@ SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING t
mot topic date pseudo
joce 40143 2002-10-22 joce
joce 43506 2002-10-22 joce
-SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2;
-mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100)
+SELECT
+*,
+topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) AS m
+FROM t2;
+mot topic date pseudo m
joce 40143 2002-10-22 joce 1
joce 43506 2002-10-22 joce 1
SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2);
@@ -512,8 +535,11 @@ joce 40143 2002-10-22 joce
SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000);
mot topic date pseudo
joce 40143 2002-10-22 joce
-SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2;
-mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000)
+SELECT
+*,
+topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) AS m
+FROM t2;
+mot topic date pseudo m
joce 40143 2002-10-22 joce 1
joce 43506 2002-10-22 joce 0
drop table t1,t2;
@@ -897,6 +923,25 @@ NULL
select 1.5 > ANY (SELECT * from t1);
1.5 > ANY (SELECT * from t1)
NULL
+update t1 set a=NULL where a=2.5;
+select 1.5 IN (SELECT * from t1);
+1.5 IN (SELECT * from t1)
+1
+select 3.5 IN (SELECT * from t1);
+3.5 IN (SELECT * from t1)
+1
+select 10.5 IN (SELECT * from t1);
+10.5 IN (SELECT * from t1)
+NULL
+select 1.5 > ALL (SELECT * from t1);
+1.5 > ALL (SELECT * from t1)
+0
+select 10.5 > ALL (SELECT * from t1);
+10.5 > ALL (SELECT * from t1)
+NULL
+select 1.5 > ANY (SELECT * from t1);
+1.5 > ANY (SELECT * from t1)
+NULL
select 10.5 > ANY (SELECT * from t1);
10.5 > ANY (SELECT * from t1)
1
@@ -907,6 +952,20 @@ Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1249 Select 2 was reduced during optimization
Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
+explain extended select (select a+1) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1249 Select 2 was reduced during optimization
+Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
+explain extended select (select a+1) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1249 Select 2 was reduced during optimization
+Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
select (select a+1) from t1;
(select a+1)
2.5
@@ -1554,8 +1613,8 @@ create table t3 (a int, b int);
insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10);
insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1);
insert into t3 values (3,3), (2,2), (1,1);
-select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3;
-a (select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1)
+select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) as m from t3;
+a m
3 1
2 2
1 2
@@ -1753,8 +1812,8 @@ CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(1
INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1);
CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status');
-select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid;
-dbid name (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01')
+select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') as m FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') as m from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid;
+dbid name m
-1 Valid 1
-1 Valid 2 1
-1 Should Not Return 0
@@ -3812,9 +3871,10 @@ SELECT (SELECT COUNT(DISTINCT t1.b) from t2) FROM t1 GROUP BY t1.a;
2
1
1
-SELECT (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3)
+SELECT
+(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) AS m
FROM t1 GROUP BY t1.a;
-(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3)
+m
2
1
1
@@ -3824,9 +3884,9 @@ COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b))
1 1
1 1
SELECT COUNT(DISTINCT t1.b),
-(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3)
+(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) AS m
FROM t1 GROUP BY t1.a;
-COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3)
+COUNT(DISTINCT t1.b) m
2 2
1 1
1 1
@@ -3850,16 +3910,10 @@ SELECT (
SELECT COUNT(DISTINCT t1.b)
)
)
-FROM t1 GROUP BY t1.a LIMIT 1)
+FROM t1 GROUP BY t1.a LIMIT 1) AS m
FROM t1 t2
GROUP BY t2.a;
-(
-SELECT (
-SELECT (
-SELECT COUNT(DISTINCT t1.b)
-)
-)
-FROM t1 GROUP BY t1.a LIMIT 1)
+m
2
2
2
@@ -6452,11 +6506,10 @@ CREATE TABLE t3 (a int, b int);
INSERT INTO t3 VALUES (10,7), (0,7);
SELECT SUM(DISTINCT b),
(SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0
-WHERE t.a != 0 AND t2.a != 0)
+WHERE t.a != 0 AND t2.a != 0) AS m
FROM (SELECT * FROM t3) AS t
GROUP BY 2;
-SUM(DISTINCT b) (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0
-WHERE t.a != 0 AND t2.a != 0)
+SUM(DISTINCT b) m
7 NULL
SELECT SUM(DISTINCT b),
(SELECT t2.a FROM t1,t2 WHERE t.a != 0 or 1=2 LIMIT 1)
@@ -6589,66 +6642,93 @@ CREATE TABLE t3 (f3a int default 1, f3b int default 2);
INSERT INTO t3 VALUES (1,1),(2,2);
set @old_optimizer_switch = @@session.optimizer_switch;
set @@optimizer_switch='materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=off,subquery_cache=off,semijoin=off';
-SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
-SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
set @@session.optimizer_switch=@old_optimizer_switch;
-SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
-SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2;
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2 AS m;
(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1)
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
select (null, null) = (null, null);
(null, null) = (null, null)
@@ -6694,8 +6774,10 @@ INSERT INTO t2 VALUES (1);
CREATE TABLE t3 ( c INT );
INSERT INTO t3 VALUES (4),(5);
SET optimizer_switch='subquery_cache=off';
-SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1;
-( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) )
+SELECT
+( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) AS m
+FROM t1;
+m
1
NULL
SELECT ( SELECT b FROM t2 WHERE b = a OR b * 0) FROM t1;
@@ -6911,7 +6993,9 @@ CREATE TABLE t3 (c INT);
INSERT INTO t3 VALUES (8),(3);
set @@expensive_subquery_limit= 0;
EXPLAIN
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 ALL NULL NULL NULL NULL 2
@@ -6921,9 +7005,11 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 SUBQUERY t3 ALL NULL NULL NULL NULL 2
flush status;
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
-(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+m
NULL
NULL
NULL
@@ -6949,7 +7035,9 @@ Handler_read_rnd_deleted 0
Handler_read_rnd_next 22
set @@expensive_subquery_limit= default;
EXPLAIN
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 ALL NULL NULL NULL NULL 2
@@ -6959,9 +7047,11 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 SUBQUERY t3 ALL NULL NULL NULL NULL 2
flush status;
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
-(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+m
NULL
NULL
NULL
diff --git a/mysql-test/main/subselect_no_opts.result b/mysql-test/main/subselect_no_opts.result
index 10153b0f60c..e2352090797 100644
--- a/mysql-test/main/subselect_no_opts.result
+++ b/mysql-test/main/subselect_no_opts.result
@@ -121,27 +121,27 @@ ROW(1,2,3) > (SELECT 1,2,1)
SELECT ROW(1,2,3) = (SELECT 1,2,NULL);
ROW(1,2,3) = (SELECT 1,2,NULL)
NULL
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a');
-(SELECT 1.5,2,'a') = ROW(1.5,2,'a')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a') AS m;
+m
1
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b');
-(SELECT 1.5,2,'a') = ROW(1.5,2,'b')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b') AS m;
+m
0
-SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b');
-(SELECT 1.5,2,'a') = ROW('1.5b',2,'b')
+SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '1.5b'
-SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a');
-(SELECT 'b',2,'a') = ROW(1.5,2,'a')
+SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'b'
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a');
-(SELECT 1.5,2,'a') = ROW(1.5,'2','a')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a') AS m;
+m
1
-SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
-(SELECT 1.5,'c','a') = ROW(1.5,2,'a')
+SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: 'c'
@@ -231,19 +231,26 @@ a
2
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1);
a
-select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4;
-b (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)
+select
+b,
+(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m
+from t4;
+b m
8 7.5000
8 4.5000
9 7.5000
-explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4;
+explain extended
+select
+b,
+(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m
+from t4;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t4 ALL NULL NULL NULL NULL 3 100.00
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,(/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4`
+Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,(/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`) AS `m` from `test`.`t4`
select * from t3 where exists (select * from t2 where t2.b=t3.a);
a
7
@@ -310,21 +317,34 @@ select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 w
b ma
7 12
create table t5 (a int);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
insert into t5 values (5);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
insert into t5 values (2);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
-explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
+explain extended
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00
@@ -333,7 +353,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 /* select#1 */ select (/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
+Note 1003 /* select#1 */ select (/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`) AS `m`,`test`.`t2`.`a` AS `a` from `test`.`t2`
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
ERROR 21000: Subquery returns more than 1 row
create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
@@ -489,8 +509,11 @@ SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING t
mot topic date pseudo
joce 40143 2002-10-22 joce
joce 43506 2002-10-22 joce
-SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2;
-mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100)
+SELECT
+*,
+topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) AS m
+FROM t2;
+mot topic date pseudo m
joce 40143 2002-10-22 joce 1
joce 43506 2002-10-22 joce 1
SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2);
@@ -508,8 +531,11 @@ joce 40143 2002-10-22 joce
SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000);
mot topic date pseudo
joce 40143 2002-10-22 joce
-SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2;
-mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000)
+SELECT
+*,
+topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) AS m
+FROM t2;
+mot topic date pseudo m
joce 40143 2002-10-22 joce 1
joce 43506 2002-10-22 joce 0
drop table t1,t2;
@@ -893,6 +919,25 @@ NULL
select 1.5 > ANY (SELECT * from t1);
1.5 > ANY (SELECT * from t1)
NULL
+update t1 set a=NULL where a=2.5;
+select 1.5 IN (SELECT * from t1);
+1.5 IN (SELECT * from t1)
+1
+select 3.5 IN (SELECT * from t1);
+3.5 IN (SELECT * from t1)
+1
+select 10.5 IN (SELECT * from t1);
+10.5 IN (SELECT * from t1)
+NULL
+select 1.5 > ALL (SELECT * from t1);
+1.5 > ALL (SELECT * from t1)
+0
+select 10.5 > ALL (SELECT * from t1);
+10.5 > ALL (SELECT * from t1)
+NULL
+select 1.5 > ANY (SELECT * from t1);
+1.5 > ANY (SELECT * from t1)
+NULL
select 10.5 > ANY (SELECT * from t1);
10.5 > ANY (SELECT * from t1)
1
@@ -903,6 +948,20 @@ Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1249 Select 2 was reduced during optimization
Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
+explain extended select (select a+1) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1249 Select 2 was reduced during optimization
+Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
+explain extended select (select a+1) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1249 Select 2 was reduced during optimization
+Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
select (select a+1) from t1;
(select a+1)
2.5
@@ -1550,8 +1609,8 @@ create table t3 (a int, b int);
insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10);
insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1);
insert into t3 values (3,3), (2,2), (1,1);
-select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3;
-a (select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1)
+select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) as m from t3;
+a m
3 1
2 2
1 2
@@ -1749,8 +1808,8 @@ CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(1
INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1);
CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status');
-select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid;
-dbid name (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01')
+select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') as m FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') as m from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid;
+dbid name m
-1 Valid 1
-1 Valid 2 1
-1 Should Not Return 0
@@ -3808,9 +3867,10 @@ SELECT (SELECT COUNT(DISTINCT t1.b) from t2) FROM t1 GROUP BY t1.a;
2
1
1
-SELECT (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3)
+SELECT
+(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) AS m
FROM t1 GROUP BY t1.a;
-(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3)
+m
2
1
1
@@ -3820,9 +3880,9 @@ COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b))
1 1
1 1
SELECT COUNT(DISTINCT t1.b),
-(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3)
+(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) AS m
FROM t1 GROUP BY t1.a;
-COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3)
+COUNT(DISTINCT t1.b) m
2 2
1 1
1 1
@@ -3846,16 +3906,10 @@ SELECT (
SELECT COUNT(DISTINCT t1.b)
)
)
-FROM t1 GROUP BY t1.a LIMIT 1)
+FROM t1 GROUP BY t1.a LIMIT 1) AS m
FROM t1 t2
GROUP BY t2.a;
-(
-SELECT (
-SELECT (
-SELECT COUNT(DISTINCT t1.b)
-)
-)
-FROM t1 GROUP BY t1.a LIMIT 1)
+m
2
2
2
@@ -6448,11 +6502,10 @@ CREATE TABLE t3 (a int, b int);
INSERT INTO t3 VALUES (10,7), (0,7);
SELECT SUM(DISTINCT b),
(SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0
-WHERE t.a != 0 AND t2.a != 0)
+WHERE t.a != 0 AND t2.a != 0) AS m
FROM (SELECT * FROM t3) AS t
GROUP BY 2;
-SUM(DISTINCT b) (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0
-WHERE t.a != 0 AND t2.a != 0)
+SUM(DISTINCT b) m
7 NULL
SELECT SUM(DISTINCT b),
(SELECT t2.a FROM t1,t2 WHERE t.a != 0 or 1=2 LIMIT 1)
@@ -6585,66 +6638,93 @@ CREATE TABLE t3 (f3a int default 1, f3b int default 2);
INSERT INTO t3 VALUES (1,1),(2,2);
set @old_optimizer_switch = @@session.optimizer_switch;
set @@optimizer_switch='materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=off,subquery_cache=off,semijoin=off';
-SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
-SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
set @@session.optimizer_switch=@old_optimizer_switch;
-SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
-SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2;
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2 AS m;
(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1)
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
select (null, null) = (null, null);
(null, null) = (null, null)
@@ -6690,8 +6770,10 @@ INSERT INTO t2 VALUES (1);
CREATE TABLE t3 ( c INT );
INSERT INTO t3 VALUES (4),(5);
SET optimizer_switch='subquery_cache=off';
-SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1;
-( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) )
+SELECT
+( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) AS m
+FROM t1;
+m
1
NULL
SELECT ( SELECT b FROM t2 WHERE b = a OR b * 0) FROM t1;
@@ -6908,7 +6990,9 @@ CREATE TABLE t3 (c INT);
INSERT INTO t3 VALUES (8),(3);
set @@expensive_subquery_limit= 0;
EXPLAIN
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 ALL NULL NULL NULL NULL 2
@@ -6918,9 +7002,11 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 SUBQUERY t3 ALL NULL NULL NULL NULL 2
flush status;
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
-(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+m
NULL
NULL
NULL
@@ -6946,7 +7032,9 @@ Handler_read_rnd_deleted 0
Handler_read_rnd_next 22
set @@expensive_subquery_limit= default;
EXPLAIN
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 ALL NULL NULL NULL NULL 2
@@ -6956,9 +7044,11 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 SUBQUERY t3 ALL NULL NULL NULL NULL 2
flush status;
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
-(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+m
NULL
NULL
NULL
diff --git a/mysql-test/main/subselect_no_scache.result b/mysql-test/main/subselect_no_scache.result
index 456d1dec846..0e5216eb120 100644
--- a/mysql-test/main/subselect_no_scache.result
+++ b/mysql-test/main/subselect_no_scache.result
@@ -124,27 +124,27 @@ ROW(1,2,3) > (SELECT 1,2,1)
SELECT ROW(1,2,3) = (SELECT 1,2,NULL);
ROW(1,2,3) = (SELECT 1,2,NULL)
NULL
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a');
-(SELECT 1.5,2,'a') = ROW(1.5,2,'a')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a') AS m;
+m
1
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b');
-(SELECT 1.5,2,'a') = ROW(1.5,2,'b')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b') AS m;
+m
0
-SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b');
-(SELECT 1.5,2,'a') = ROW('1.5b',2,'b')
+SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '1.5b'
-SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a');
-(SELECT 'b',2,'a') = ROW(1.5,2,'a')
+SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'b'
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a');
-(SELECT 1.5,2,'a') = ROW(1.5,'2','a')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a') AS m;
+m
1
-SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
-(SELECT 1.5,'c','a') = ROW(1.5,2,'a')
+SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: 'c'
@@ -234,19 +234,26 @@ a
2
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1);
a
-select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4;
-b (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)
+select
+b,
+(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m
+from t4;
+b m
8 7.5000
8 4.5000
9 7.5000
-explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4;
+explain extended
+select
+b,
+(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m
+from t4;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t4 ALL NULL NULL NULL NULL 3 100.00
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,(/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4`
+Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,(/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`) AS `m` from `test`.`t4`
select * from t3 where exists (select * from t2 where t2.b=t3.a);
a
7
@@ -313,21 +320,34 @@ select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 w
b ma
7 12
create table t5 (a int);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
insert into t5 values (5);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
insert into t5 values (2);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
-explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
+explain extended
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00
@@ -336,7 +356,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 /* select#1 */ select (/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
+Note 1003 /* select#1 */ select (/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`) AS `m`,`test`.`t2`.`a` AS `a` from `test`.`t2`
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
ERROR 21000: Subquery returns more than 1 row
create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
@@ -492,8 +512,11 @@ SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING t
mot topic date pseudo
joce 40143 2002-10-22 joce
joce 43506 2002-10-22 joce
-SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2;
-mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100)
+SELECT
+*,
+topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) AS m
+FROM t2;
+mot topic date pseudo m
joce 40143 2002-10-22 joce 1
joce 43506 2002-10-22 joce 1
SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2);
@@ -511,8 +534,11 @@ joce 40143 2002-10-22 joce
SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000);
mot topic date pseudo
joce 40143 2002-10-22 joce
-SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2;
-mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000)
+SELECT
+*,
+topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) AS m
+FROM t2;
+mot topic date pseudo m
joce 40143 2002-10-22 joce 1
joce 43506 2002-10-22 joce 0
drop table t1,t2;
@@ -896,6 +922,25 @@ NULL
select 1.5 > ANY (SELECT * from t1);
1.5 > ANY (SELECT * from t1)
NULL
+update t1 set a=NULL where a=2.5;
+select 1.5 IN (SELECT * from t1);
+1.5 IN (SELECT * from t1)
+1
+select 3.5 IN (SELECT * from t1);
+3.5 IN (SELECT * from t1)
+1
+select 10.5 IN (SELECT * from t1);
+10.5 IN (SELECT * from t1)
+NULL
+select 1.5 > ALL (SELECT * from t1);
+1.5 > ALL (SELECT * from t1)
+0
+select 10.5 > ALL (SELECT * from t1);
+10.5 > ALL (SELECT * from t1)
+NULL
+select 1.5 > ANY (SELECT * from t1);
+1.5 > ANY (SELECT * from t1)
+NULL
select 10.5 > ANY (SELECT * from t1);
10.5 > ANY (SELECT * from t1)
1
@@ -906,6 +951,20 @@ Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1249 Select 2 was reduced during optimization
Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
+explain extended select (select a+1) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1249 Select 2 was reduced during optimization
+Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
+explain extended select (select a+1) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1249 Select 2 was reduced during optimization
+Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
select (select a+1) from t1;
(select a+1)
2.5
@@ -1553,8 +1612,8 @@ create table t3 (a int, b int);
insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10);
insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1);
insert into t3 values (3,3), (2,2), (1,1);
-select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3;
-a (select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1)
+select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) as m from t3;
+a m
3 1
2 2
1 2
@@ -1752,8 +1811,8 @@ CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(1
INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1);
CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status');
-select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid;
-dbid name (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01')
+select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') as m FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') as m from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid;
+dbid name m
-1 Valid 1
-1 Valid 2 1
-1 Should Not Return 0
@@ -3815,9 +3874,10 @@ SELECT (SELECT COUNT(DISTINCT t1.b) from t2) FROM t1 GROUP BY t1.a;
2
1
1
-SELECT (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3)
+SELECT
+(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) AS m
FROM t1 GROUP BY t1.a;
-(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3)
+m
2
1
1
@@ -3827,9 +3887,9 @@ COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b))
1 1
1 1
SELECT COUNT(DISTINCT t1.b),
-(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3)
+(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) AS m
FROM t1 GROUP BY t1.a;
-COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3)
+COUNT(DISTINCT t1.b) m
2 2
1 1
1 1
@@ -3853,16 +3913,10 @@ SELECT (
SELECT COUNT(DISTINCT t1.b)
)
)
-FROM t1 GROUP BY t1.a LIMIT 1)
+FROM t1 GROUP BY t1.a LIMIT 1) AS m
FROM t1 t2
GROUP BY t2.a;
-(
-SELECT (
-SELECT (
-SELECT COUNT(DISTINCT t1.b)
-)
-)
-FROM t1 GROUP BY t1.a LIMIT 1)
+m
2
2
2
@@ -6459,11 +6513,10 @@ CREATE TABLE t3 (a int, b int);
INSERT INTO t3 VALUES (10,7), (0,7);
SELECT SUM(DISTINCT b),
(SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0
-WHERE t.a != 0 AND t2.a != 0)
+WHERE t.a != 0 AND t2.a != 0) AS m
FROM (SELECT * FROM t3) AS t
GROUP BY 2;
-SUM(DISTINCT b) (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0
-WHERE t.a != 0 AND t2.a != 0)
+SUM(DISTINCT b) m
7 NULL
SELECT SUM(DISTINCT b),
(SELECT t2.a FROM t1,t2 WHERE t.a != 0 or 1=2 LIMIT 1)
@@ -6596,66 +6649,93 @@ CREATE TABLE t3 (f3a int default 1, f3b int default 2);
INSERT INTO t3 VALUES (1,1),(2,2);
set @old_optimizer_switch = @@session.optimizer_switch;
set @@optimizer_switch='materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=off,subquery_cache=off,semijoin=off';
-SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
-SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
set @@session.optimizer_switch=@old_optimizer_switch;
-SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
-SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2;
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2 AS m;
(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1)
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
select (null, null) = (null, null);
(null, null) = (null, null)
@@ -6701,8 +6781,10 @@ INSERT INTO t2 VALUES (1);
CREATE TABLE t3 ( c INT );
INSERT INTO t3 VALUES (4),(5);
SET optimizer_switch='subquery_cache=off';
-SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1;
-( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) )
+SELECT
+( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) AS m
+FROM t1;
+m
1
NULL
SELECT ( SELECT b FROM t2 WHERE b = a OR b * 0) FROM t1;
@@ -6919,7 +7001,9 @@ CREATE TABLE t3 (c INT);
INSERT INTO t3 VALUES (8),(3);
set @@expensive_subquery_limit= 0;
EXPLAIN
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 ALL NULL NULL NULL NULL 2
@@ -6929,9 +7013,11 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 SUBQUERY t3 ALL NULL NULL NULL NULL 2
flush status;
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
-(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+m
NULL
NULL
NULL
@@ -6957,7 +7043,9 @@ Handler_read_rnd_deleted 0
Handler_read_rnd_next 58
set @@expensive_subquery_limit= default;
EXPLAIN
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 ALL NULL NULL NULL NULL 2
@@ -6967,9 +7055,11 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 SUBQUERY t3 ALL NULL NULL NULL NULL 2
flush status;
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
-(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+m
NULL
NULL
NULL
diff --git a/mysql-test/main/subselect_no_semijoin.result b/mysql-test/main/subselect_no_semijoin.result
index eba0f55a072..c7acdc2990c 100644
--- a/mysql-test/main/subselect_no_semijoin.result
+++ b/mysql-test/main/subselect_no_semijoin.result
@@ -121,27 +121,27 @@ ROW(1,2,3) > (SELECT 1,2,1)
SELECT ROW(1,2,3) = (SELECT 1,2,NULL);
ROW(1,2,3) = (SELECT 1,2,NULL)
NULL
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a');
-(SELECT 1.5,2,'a') = ROW(1.5,2,'a')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a') AS m;
+m
1
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b');
-(SELECT 1.5,2,'a') = ROW(1.5,2,'b')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b') AS m;
+m
0
-SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b');
-(SELECT 1.5,2,'a') = ROW('1.5b',2,'b')
+SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '1.5b'
-SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a');
-(SELECT 'b',2,'a') = ROW(1.5,2,'a')
+SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'b'
-SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a');
-(SELECT 1.5,2,'a') = ROW(1.5,'2','a')
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a') AS m;
+m
1
-SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
-(SELECT 1.5,'c','a') = ROW(1.5,2,'a')
+SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a') AS m;
+m
0
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: 'c'
@@ -231,19 +231,26 @@ a
2
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1);
a
-select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4;
-b (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)
+select
+b,
+(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m
+from t4;
+b m
8 7.5000
8 4.5000
9 7.5000
-explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4;
+explain extended
+select
+b,
+(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m
+from t4;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t4 ALL NULL NULL NULL NULL 3 100.00
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,<expr_cache><`test`.`t4`.`a`>((/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4`
+Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,<expr_cache><`test`.`t4`.`a`>((/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `m` from `test`.`t4`
select * from t3 where exists (select * from t2 where t2.b=t3.a);
a
7
@@ -310,21 +317,34 @@ select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 w
b ma
7 12
create table t5 (a int);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
insert into t5 values (5);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
insert into t5 values (2);
-select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
-(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
+m a
NULL 1
2 2
-explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
+explain extended
+select
+(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m,
+a
+from t2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00
@@ -333,7 +353,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 /* select#1 */ select <expr_cache><`test`.`t2`.`a`>((/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
+Note 1003 /* select#1 */ select <expr_cache><`test`.`t2`.`a`>((/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `m`,`test`.`t2`.`a` AS `a` from `test`.`t2`
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
ERROR 21000: Subquery returns more than 1 row
create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
@@ -489,8 +509,11 @@ SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING t
mot topic date pseudo
joce 40143 2002-10-22 joce
joce 43506 2002-10-22 joce
-SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2;
-mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100)
+SELECT
+*,
+topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) AS m
+FROM t2;
+mot topic date pseudo m
joce 40143 2002-10-22 joce 1
joce 43506 2002-10-22 joce 1
SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2);
@@ -508,8 +531,11 @@ joce 40143 2002-10-22 joce
SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000);
mot topic date pseudo
joce 40143 2002-10-22 joce
-SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2;
-mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000)
+SELECT
+*,
+topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) AS m
+FROM t2;
+mot topic date pseudo m
joce 40143 2002-10-22 joce 1
joce 43506 2002-10-22 joce 0
drop table t1,t2;
@@ -893,6 +919,25 @@ NULL
select 1.5 > ANY (SELECT * from t1);
1.5 > ANY (SELECT * from t1)
NULL
+update t1 set a=NULL where a=2.5;
+select 1.5 IN (SELECT * from t1);
+1.5 IN (SELECT * from t1)
+1
+select 3.5 IN (SELECT * from t1);
+3.5 IN (SELECT * from t1)
+1
+select 10.5 IN (SELECT * from t1);
+10.5 IN (SELECT * from t1)
+NULL
+select 1.5 > ALL (SELECT * from t1);
+1.5 > ALL (SELECT * from t1)
+0
+select 10.5 > ALL (SELECT * from t1);
+10.5 > ALL (SELECT * from t1)
+NULL
+select 1.5 > ANY (SELECT * from t1);
+1.5 > ANY (SELECT * from t1)
+NULL
select 10.5 > ANY (SELECT * from t1);
10.5 > ANY (SELECT * from t1)
1
@@ -903,6 +948,20 @@ Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1249 Select 2 was reduced during optimization
Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
+explain extended select (select a+1) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1249 Select 2 was reduced during optimization
+Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
+explain extended select (select a+1) from t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1249 Select 2 was reduced during optimization
+Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1`
select (select a+1) from t1;
(select a+1)
2.5
@@ -1550,8 +1609,8 @@ create table t3 (a int, b int);
insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10);
insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1);
insert into t3 values (3,3), (2,2), (1,1);
-select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3;
-a (select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1)
+select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) as m from t3;
+a m
3 1
2 2
1 2
@@ -1749,8 +1808,8 @@ CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(1
INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1);
CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status');
-select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid;
-dbid name (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01')
+select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') as m FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') as m from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid;
+dbid name m
-1 Valid 1
-1 Valid 2 1
-1 Should Not Return 0
@@ -3808,9 +3867,10 @@ SELECT (SELECT COUNT(DISTINCT t1.b) from t2) FROM t1 GROUP BY t1.a;
2
1
1
-SELECT (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3)
+SELECT
+(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) AS m
FROM t1 GROUP BY t1.a;
-(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3)
+m
2
1
1
@@ -3820,9 +3880,9 @@ COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b))
1 1
1 1
SELECT COUNT(DISTINCT t1.b),
-(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3)
+(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) AS m
FROM t1 GROUP BY t1.a;
-COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3)
+COUNT(DISTINCT t1.b) m
2 2
1 1
1 1
@@ -3846,16 +3906,10 @@ SELECT (
SELECT COUNT(DISTINCT t1.b)
)
)
-FROM t1 GROUP BY t1.a LIMIT 1)
+FROM t1 GROUP BY t1.a LIMIT 1) AS m
FROM t1 t2
GROUP BY t2.a;
-(
-SELECT (
-SELECT (
-SELECT COUNT(DISTINCT t1.b)
-)
-)
-FROM t1 GROUP BY t1.a LIMIT 1)
+m
2
2
2
@@ -6448,11 +6502,10 @@ CREATE TABLE t3 (a int, b int);
INSERT INTO t3 VALUES (10,7), (0,7);
SELECT SUM(DISTINCT b),
(SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0
-WHERE t.a != 0 AND t2.a != 0)
+WHERE t.a != 0 AND t2.a != 0) AS m
FROM (SELECT * FROM t3) AS t
GROUP BY 2;
-SUM(DISTINCT b) (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0
-WHERE t.a != 0 AND t2.a != 0)
+SUM(DISTINCT b) m
7 NULL
SELECT SUM(DISTINCT b),
(SELECT t2.a FROM t1,t2 WHERE t.a != 0 or 1=2 LIMIT 1)
@@ -6585,66 +6638,93 @@ CREATE TABLE t3 (f3a int default 1, f3b int default 2);
INSERT INTO t3 VALUES (1,1),(2,2);
set @old_optimizer_switch = @@session.optimizer_switch;
set @@optimizer_switch='materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=off,subquery_cache=off,semijoin=off';
-SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
-SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
set @@session.optimizer_switch=@old_optimizer_switch;
-SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2;
-(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1)
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
-SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2;
+SELECT
+(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2 AS m;
(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1)
NULL
NULL
-SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2;
-(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1)
+SELECT
+(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2;
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m
+FROM t2;
+m
NULL
NULL
-SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1);
-(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1)
+SELECT
+(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m;
+m
NULL
select (null, null) = (null, null);
(null, null) = (null, null)
@@ -6690,8 +6770,10 @@ INSERT INTO t2 VALUES (1);
CREATE TABLE t3 ( c INT );
INSERT INTO t3 VALUES (4),(5);
SET optimizer_switch='subquery_cache=off';
-SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1;
-( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) )
+SELECT
+( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) AS m
+FROM t1;
+m
1
NULL
SELECT ( SELECT b FROM t2 WHERE b = a OR b * 0) FROM t1;
@@ -6908,7 +6990,9 @@ CREATE TABLE t3 (c INT);
INSERT INTO t3 VALUES (8),(3);
set @@expensive_subquery_limit= 0;
EXPLAIN
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 ALL NULL NULL NULL NULL 2
@@ -6918,9 +7002,11 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 SUBQUERY t3 ALL NULL NULL NULL NULL 2
flush status;
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
-(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+m
NULL
NULL
NULL
@@ -6946,7 +7032,9 @@ Handler_read_rnd_deleted 0
Handler_read_rnd_next 22
set @@expensive_subquery_limit= default;
EXPLAIN
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 ALL NULL NULL NULL NULL 2
@@ -6956,9 +7044,11 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 SUBQUERY t3 ALL NULL NULL NULL NULL 2
flush status;
-SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+SELECT
+(SELECT MIN(b) FROM t1, t2
+WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m
FROM t2 alias1, t1 alias2, t1 alias3;
-(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3)))
+m
NULL
NULL
NULL
diff --git a/mysql-test/main/subselect_sj.test b/mysql-test/main/subselect_sj.test
index 3c046c6321c..b4aff7561cf 100644
--- a/mysql-test/main/subselect_sj.test
+++ b/mysql-test/main/subselect_sj.test
@@ -780,7 +780,13 @@ eval $query;
let $query=
SELECT pk FROM t1 WHERE (b, i) IN (SELECT b, i FROM t2 WHERE pk > 0);
+#set optimizer_trace=1;
+#select @@optimizer_switch;
+#select @@join_cache_level;
+#select @@optimizer_use_condition_selectivity;
eval EXPLAIN EXTENDED $query;
+#select * from information_schema.optimizer_trace;
+
eval $query;
let $query=
diff --git a/mysql-test/main/subselect_sj2.result b/mysql-test/main/subselect_sj2.result
index fa10a4aa066..e2e44fd8e80 100644
--- a/mysql-test/main/subselect_sj2.result
+++ b/mysql-test/main/subselect_sj2.result
@@ -152,7 +152,7 @@ insert into t1 values (2, 'duplicate ok', 'duplicate ok');
insert into t1 values (18, 'duplicate ok', 'duplicate ok');
insert into t2 values (3, 'duplicate ok', 'duplicate ok');
insert into t2 values (19, 'duplicate ok', 'duplicate ok');
-explain select
+explain select
a, mid(filler1, 1,10), length(filler1)=length(filler2) as Z
from t1 ot where a in (select a from t2 it);
id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/main/subselect_sj2.test b/mysql-test/main/subselect_sj2.test
index 4ccdcc50a38..67c70d449d7 100644
--- a/mysql-test/main/subselect_sj2.test
+++ b/mysql-test/main/subselect_sj2.test
@@ -124,7 +124,7 @@ insert into t1 values (18, 'duplicate ok', 'duplicate ok');
insert into t2 values (3, 'duplicate ok', 'duplicate ok');
insert into t2 values (19, 'duplicate ok', 'duplicate ok');
-explain select
+explain select
a, mid(filler1, 1,10), length(filler1)=length(filler2) as Z
from t1 ot where a in (select a from t2 it);
select
@@ -1248,6 +1248,7 @@ INSERT INTO t2 VALUES
analyze table t1 persistent for all;
analyze table t2 persistent for all;
--replace_column 9 #
+
EXPLAIN
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
WHERE alias3.d IN (
diff --git a/mysql-test/main/subselect_sj2_jcl6.result b/mysql-test/main/subselect_sj2_jcl6.result
index 6ccec99ba5e..a5bcfbfa147 100644
--- a/mysql-test/main/subselect_sj2_jcl6.result
+++ b/mysql-test/main/subselect_sj2_jcl6.result
@@ -161,7 +161,7 @@ insert into t1 values (2, 'duplicate ok', 'duplicate ok');
insert into t1 values (18, 'duplicate ok', 'duplicate ok');
insert into t2 values (3, 'duplicate ok', 'duplicate ok');
insert into t2 values (19, 'duplicate ok', 'duplicate ok');
-explain select
+explain select
a, mid(filler1, 1,10), length(filler1)=length(filler2) as Z
from t1 ot where a in (select a from t2 it);
id select_type table type possible_keys key key_len ref rows Extra
@@ -912,11 +912,10 @@ EXPLAIN
SELECT * FROM t3 LEFT JOIN (v1,t2) ON t3.a = t2.a
WHERE t3.b IN (SELECT b FROM t4);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t3 ALL NULL NULL NULL NULL 1
+1 PRIMARY t3 ALL NULL NULL NULL NULL 1 Using where
1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t3.a 1 Using where; Using join buffer (flat, BNLH join)
1 PRIMARY <derived3> ALL NULL NULL NULL NULL 2 Using join buffer (incremental, BNL join)
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t4 ALL NULL NULL NULL NULL 2
+1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t3.b 2 Using where; Start temporary; End temporary; Using join buffer (incremental, BNLH join)
3 DERIVED t1 ALL NULL NULL NULL NULL 1
SELECT * FROM t3 LEFT JOIN (v1,t2) ON t3.a = t2.a
WHERE t3.b IN (SELECT b FROM t4);
@@ -1151,10 +1150,10 @@ WHERE alias5.b = alias4.b
AND ( alias5.b >= alias3.b OR alias5.c != alias3.c )
);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL # Using where
-1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d # Using index
-1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using where; FirstMatch(alias3)
-1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
+1 PRIMARY alias4 index PRIMARY,c c 4 NULL # Using where; Using index; Start temporary
+1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using join buffer (flat, BKA join); Key-ordered scan
+1 PRIMARY alias3 hash_ALL PRIMARY #hash#$hj 4 test.alias4.c # Using where; End temporary; Using join buffer (incremental, BNLH join)
+1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join)
1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join)
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
WHERE alias3.d IN (
@@ -1172,10 +1171,10 @@ WHERE alias5.b = alias4.b
AND ( alias5.b >= alias3.b OR alias3.c != alias5.c )
);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL # Using where
-1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d # Using index
-1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using where; FirstMatch(alias3)
-1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
+1 PRIMARY alias4 index PRIMARY,c c 4 NULL # Using where; Using index; Start temporary
+1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using join buffer (flat, BKA join); Key-ordered scan
+1 PRIMARY alias3 hash_ALL PRIMARY #hash#$hj 4 test.alias4.c # Using where; End temporary; Using join buffer (incremental, BNLH join)
+1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join)
1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join)
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
WHERE alias3.d IN (
diff --git a/mysql-test/main/subselect_sj2_mat.result b/mysql-test/main/subselect_sj2_mat.result
index 5bc7751eeaa..acd600a734f 100644
--- a/mysql-test/main/subselect_sj2_mat.result
+++ b/mysql-test/main/subselect_sj2_mat.result
@@ -154,7 +154,7 @@ insert into t1 values (2, 'duplicate ok', 'duplicate ok');
insert into t1 values (18, 'duplicate ok', 'duplicate ok');
insert into t2 values (3, 'duplicate ok', 'duplicate ok');
insert into t2 values (19, 'duplicate ok', 'duplicate ok');
-explain select
+explain select
a, mid(filler1, 1,10), length(filler1)=length(filler2) as Z
from t1 ot where a in (select a from t2 it);
id select_type table type possible_keys key key_len ref rows Extra
@@ -1661,7 +1661,7 @@ SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00
-2 DEPENDENT SUBQUERY t3 hash_ALL NULL #hash#$hj 5 func 3 100.00 Using where; Using join buffer (flat, BNLH join)
+2 DEPENDENT SUBQUERY t3 hash_ALL NULL #hash#$hj 5 func 3 10.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`i1` AS `i1` from `test`.`t1` where <expr_cache><`test`.`t1`.`i1`>(<in_optimizer>(`test`.`t1`.`i1`,<exists>(/* select#2 */ select `test`.`t3`.`i3` from `test`.`t2` join `test`.`t3` where `test`.`t3`.`i3` = `test`.`t2`.`i2` and <cache>(`test`.`t1`.`i1`) = `test`.`t3`.`i3`)))
SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2);
@@ -1671,12 +1671,11 @@ set optimizer_switch='materialization=on,semijoin=on';
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 MATERIALIZED t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary
+1 PRIMARY t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 10.00 Using where; Using join buffer (flat, BNLH join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 test.t2.i2 5 10.00 Using where; End temporary; Using join buffer (flat, BNLH join)
Warnings:
-Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t3`.`i3` = `test`.`t2`.`i2`
+Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t3`.`i3` = `test`.`t2`.`i2` and `test`.`t1`.`i1` = `test`.`t2`.`i2`
SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2);
i1
7
@@ -1684,12 +1683,11 @@ EXPLAIN EXTENDED
SELECT * FROM t1
WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 > 0 AND i3 = i2 OR 1=2);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 MATERIALIZED t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary
+1 PRIMARY t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 10.00 Using where; Using join buffer (flat, BNLH join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 test.t2.i2 5 10.00 Using where; End temporary; Using join buffer (flat, BNLH join)
Warnings:
-Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t3`.`i3` = `test`.`t2`.`i2` and `test`.`t3`.`i3` > 0
+Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t3`.`i3` = `test`.`t2`.`i2` and `test`.`t1`.`i1` = `test`.`t2`.`i2` and `test`.`t3`.`i3` > 0
SELECT * FROM t1
WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 > 0 AND i3 = i2 OR 1=2);
i1
diff --git a/mysql-test/main/subselect_sj_jcl6.result b/mysql-test/main/subselect_sj_jcl6.result
index 5971fa30e89..6e397ddd754 100644
--- a/mysql-test/main/subselect_sj_jcl6.result
+++ b/mysql-test/main/subselect_sj_jcl6.result
@@ -3575,8 +3575,8 @@ SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a)
GROUP BY a HAVING a != 'z';
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t range idx_a idx_a 4 NULL 3 Using where; Using index
-1 PRIMARY t1 ref idx_a idx_a 4 test.t.a 1 Using index
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
+1 PRIMARY t1 ref idx_a idx_a 4 test.t.a 1 Using index; FirstMatch(t)
SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a)
GROUP BY a HAVING a != 'z';
a
diff --git a/mysql-test/main/system_mysql_db_fix50030.result b/mysql-test/main/system_mysql_db_fix50030.result
index b99b8678b1a..a257c16b865 100644
--- a/mysql-test/main/system_mysql_db_fix50030.result
+++ b/mysql-test/main/system_mysql_db_fix50030.result
@@ -166,14 +166,14 @@ show create table servers;
Table Create Table
servers CREATE TABLE `servers` (
`Server_name` char(64) NOT NULL DEFAULT '',
- `Host` char(64) NOT NULL DEFAULT '',
+ `Host` varchar(2048) NOT NULL DEFAULT '',
`Db` char(64) NOT NULL DEFAULT '',
`Username` char(128) NOT NULL DEFAULT '',
`Password` char(64) NOT NULL DEFAULT '',
`Port` int(4) NOT NULL DEFAULT 0,
`Socket` char(64) NOT NULL DEFAULT '',
`Wrapper` char(64) NOT NULL DEFAULT '',
- `Owner` char(64) NOT NULL DEFAULT '',
+ `Owner` varchar(512) NOT NULL DEFAULT '',
PRIMARY KEY (`Server_name`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='MySQL Foreign Servers table'
show create table proc;
diff --git a/mysql-test/main/system_mysql_db_fix50117.result b/mysql-test/main/system_mysql_db_fix50117.result
index 8e48c2accb7..fde130839d4 100644
--- a/mysql-test/main/system_mysql_db_fix50117.result
+++ b/mysql-test/main/system_mysql_db_fix50117.result
@@ -146,14 +146,14 @@ show create table servers;
Table Create Table
servers CREATE TABLE `servers` (
`Server_name` char(64) NOT NULL DEFAULT '',
- `Host` char(64) NOT NULL DEFAULT '',
+ `Host` varchar(2048) NOT NULL DEFAULT '',
`Db` char(64) NOT NULL DEFAULT '',
`Username` char(128) NOT NULL DEFAULT '',
`Password` char(64) NOT NULL DEFAULT '',
`Port` int(4) NOT NULL DEFAULT 0,
`Socket` char(64) NOT NULL DEFAULT '',
`Wrapper` char(64) NOT NULL DEFAULT '',
- `Owner` char(64) NOT NULL DEFAULT '',
+ `Owner` varchar(512) NOT NULL DEFAULT '',
PRIMARY KEY (`Server_name`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='MySQL Foreign Servers table'
show create table proc;
diff --git a/mysql-test/main/system_mysql_db_fix50568.result b/mysql-test/main/system_mysql_db_fix50568.result
new file mode 100644
index 00000000000..763fcb866d0
--- /dev/null
+++ b/mysql-test/main/system_mysql_db_fix50568.result
@@ -0,0 +1,297 @@
+use test;
+CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges';
+Warnings:
+Warning 1280 Name 'Host' ignored for PRIMARY key.
+CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges';
+Warnings:
+Warning 1280 Name 'Host' ignored for PRIMARY key.
+CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) DEFAULT 0 NOT NULL, plugin char(64) CHARACTER SET latin1 DEFAULT '' NOT NULL, authentication_string TEXT NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges';
+Warnings:
+Warning 1280 Name 'Host' ignored for PRIMARY key.
+CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions';
+CREATE TABLE IF NOT EXISTS plugin ( name varchar(64) DEFAULT '' NOT NULL, dl varchar(128) DEFAULT '' NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci comment='MySQL plugins';
+CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', Host char(64) NOT NULL DEFAULT '', Db char(64) NOT NULL DEFAULT '', Username char(64) NOT NULL DEFAULT '', Password char(64) NOT NULL DEFAULT '', Port INT(4) NOT NULL DEFAULT '0', Socket char(64) NOT NULL DEFAULT '', Wrapper char(64) NOT NULL DEFAULT '', Owner char(64) NOT NULL DEFAULT '', PRIMARY KEY (Server_name)) CHARACTER SET utf8 comment='MySQL Foreign Servers table';
+CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges';
+CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges';
+CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, name char(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, url text not null, primary key (help_topic_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help topics';
+CREATE TABLE IF NOT EXISTS help_category ( help_category_id smallint unsigned not null, name char(64) not null, parent_category_id smallint unsigned null, url text not null, primary key (help_category_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help categories';
+CREATE TABLE IF NOT EXISTS help_relation ( help_topic_id int unsigned not null references help_topic, help_keyword_id int unsigned not null references help_keyword, primary key (help_keyword_id, help_topic_id) ) engine=MyISAM CHARACTER SET utf8 comment='keyword-topic relation';
+CREATE TABLE IF NOT EXISTS help_keyword ( help_keyword_id int unsigned not null, name char(64) not null, primary key (help_keyword_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help keywords';
+CREATE TABLE IF NOT EXISTS time_zone_name ( Name char(64) NOT NULL, Time_zone_id int unsigned NOT NULL, PRIMARY KEY Name (Name) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone names';
+Warnings:
+Warning 1280 Name 'Name' ignored for PRIMARY key.
+CREATE TABLE IF NOT EXISTS time_zone ( Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY TzId (Time_zone_id) ) engine=MyISAM CHARACTER SET utf8 comment='Time zones';
+Warnings:
+Warning 1280 Name 'TzId' ignored for PRIMARY key.
+CREATE TABLE IF NOT EXISTS time_zone_transition ( Time_zone_id int unsigned NOT NULL, Transition_time bigint signed NOT NULL, Transition_type_id int unsigned NOT NULL, PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone transitions';
+Warnings:
+Warning 1280 Name 'TzIdTranTime' ignored for PRIMARY key.
+CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsigned NOT NULL, Transition_type_id int unsigned NOT NULL, `Offset` int signed DEFAULT 0 NOT NULL, Is_DST tinyint unsigned DEFAULT 0 NOT NULL, Abbreviation char(8) DEFAULT '' NOT NULL, PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone transition types';
+Warnings:
+Warning 1280 Name 'TzIdTrTId' ignored for PRIMARY key.
+CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones';
+Warnings:
+Warning 1280 Name 'TranTime' ignored for PRIMARY key.
+CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'IGNORE_BAD_TABLE_OPTIONS', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE', 'NO_ENGINE_SUBSTITUTION', 'PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment text collate utf8_bin NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures';
+CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) COLLATE utf8_general_ci DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges';
+CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator INTEGER UNSIGNED NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';
+CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
+CREATE TABLE IF NOT EXISTS proxies_priv (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Proxied_host char(60) binary DEFAULT '' NOT NULL, Proxied_user char(16) binary DEFAULT '' NOT NULL, With_grant BOOL DEFAULT 0 NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY Host (Host,User,Proxied_host,Proxied_user), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User proxy privileges';
+Warnings:
+Warning 1280 Name 'Host' ignored for PRIMARY key.
+show tables;
+Tables_in_db
+column_stats
+columns_priv
+db
+event
+func
+general_log
+global_priv
+gtid_slave_pos
+help_category
+help_keyword
+help_relation
+help_topic
+host
+index_stats
+innodb_index_stats
+innodb_table_stats
+ndb_binlog_index
+plugin
+proc
+procs_priv
+proxies_priv
+roles_mapping
+servers
+slow_log
+table_stats
+tables_priv
+time_zone
+time_zone_leap_second
+time_zone_name
+time_zone_transition
+time_zone_transition_type
+transaction_registry
+user
+show create table db;
+Table Create Table
+db CREATE TABLE `db` (
+ `Host` char(255) NOT NULL DEFAULT '',
+ `Db` char(64) NOT NULL DEFAULT '',
+ `User` char(128) NOT NULL DEFAULT '',
+ `Select_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Insert_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Update_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Delete_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Create_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Drop_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Grant_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `References_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Index_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Alter_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Create_view_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Show_view_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Create_routine_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Execute_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Event_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Trigger_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Delete_history_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ PRIMARY KEY (`Host`,`Db`,`User`),
+ KEY `User` (`User`)
+) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges'
+show create table user;
+View Create View character_set_client collation_connection
+user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `test`.`global_priv`.`Host` AS `Host`,`test`.`global_priv`.`User` AS `User`,if(json_value(`test`.`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`test`.`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`test`.`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`test`.`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`test`.`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`test`.`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`test`.`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`test`.`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`test`.`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`test`.`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`test`.`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`test`.`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`test`.`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,if(ifnull(json_value(`test`.`global_priv`.`Priv`,'$.password_last_changed'),1) = 0,'Y','N') AS `password_expired`,elt(ifnull(json_value(`test`.`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`test`.`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`test`.`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci
+show create table func;
+Table Create Table
+func CREATE TABLE `func` (
+ `name` char(64) NOT NULL DEFAULT '',
+ `ret` tinyint(1) NOT NULL DEFAULT 0,
+ `dl` char(128) NOT NULL DEFAULT '',
+ `type` enum('function','aggregate') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
+ PRIMARY KEY (`name`)
+) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='User defined functions'
+show create table global_priv;
+Table Create Table
+global_priv CREATE TABLE `global_priv` (
+ `Host` char(255) NOT NULL DEFAULT '',
+ `User` char(128) NOT NULL DEFAULT '',
+ `Priv` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '{}' CHECK (json_valid(`Priv`)),
+ PRIMARY KEY (`Host`,`User`)
+) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Users and global privileges'
+show create table tables_priv;
+Table Create Table
+tables_priv CREATE TABLE `tables_priv` (
+ `Host` char(255) NOT NULL DEFAULT '',
+ `Db` char(64) NOT NULL DEFAULT '',
+ `User` char(128) NOT NULL DEFAULT '',
+ `Table_name` char(64) NOT NULL DEFAULT '',
+ `Grantor` varchar(384) NOT NULL DEFAULT '',
+ `Timestamp` timestamp NULL DEFAULT NULL,
+ `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','Delete versioning rows') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
+ `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
+ PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
+ KEY `Grantor` (`Grantor`)
+) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Table privileges'
+show create table columns_priv;
+Table Create Table
+columns_priv CREATE TABLE `columns_priv` (
+ `Host` char(255) NOT NULL DEFAULT '',
+ `Db` char(64) NOT NULL DEFAULT '',
+ `User` char(128) NOT NULL DEFAULT '',
+ `Table_name` char(64) NOT NULL DEFAULT '',
+ `Column_name` char(64) NOT NULL DEFAULT '',
+ `Timestamp` timestamp NULL DEFAULT NULL,
+ `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
+ PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
+) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Column privileges'
+show create table procs_priv;
+Table Create Table
+procs_priv CREATE TABLE `procs_priv` (
+ `Host` char(60) NOT NULL DEFAULT '',
+ `Db` char(64) NOT NULL DEFAULT '',
+ `User` char(128) NOT NULL DEFAULT '',
+ `Routine_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
+ `Routine_type` enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') NOT NULL,
+ `Grantor` varchar(384) NOT NULL DEFAULT '',
+ `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
+ `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
+ PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
+ KEY `Grantor` (`Grantor`)
+) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Procedure privileges'
+show create table servers;
+Table Create Table
+servers CREATE TABLE `servers` (
+ `Server_name` char(64) NOT NULL DEFAULT '',
+ `Host` varchar(2048) NOT NULL DEFAULT '',
+ `Db` char(64) NOT NULL DEFAULT '',
+ `Username` char(128) NOT NULL DEFAULT '',
+ `Password` char(64) NOT NULL DEFAULT '',
+ `Port` int(4) NOT NULL DEFAULT 0,
+ `Socket` char(64) NOT NULL DEFAULT '',
+ `Wrapper` char(64) NOT NULL DEFAULT '',
+ `Owner` varchar(512) NOT NULL DEFAULT '',
+ PRIMARY KEY (`Server_name`)
+) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='MySQL Foreign Servers table'
+show create table proc;
+Table Create Table
+proc CREATE TABLE `proc` (
+ `db` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
+ `name` char(64) NOT NULL DEFAULT '',
+ `type` enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') NOT NULL,
+ `specific_name` char(64) NOT NULL DEFAULT '',
+ `language` enum('SQL') NOT NULL DEFAULT 'SQL',
+ `sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL',
+ `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO',
+ `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER',
+ `param_list` blob NOT NULL,
+ `returns` longblob NOT NULL,
+ `body` longblob NOT NULL,
+ `definer` varchar(384) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
+ `created` timestamp NULL DEFAULT NULL,
+ `modified` timestamp NULL DEFAULT NULL,
+ `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') NOT NULL DEFAULT '',
+ `comment` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
+ `character_set_client` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
+ `collation_connection` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
+ `db_collation` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
+ `body_utf8` longblob DEFAULT NULL,
+ `aggregate` enum('NONE','GROUP') NOT NULL DEFAULT 'NONE',
+ PRIMARY KEY (`db`,`name`,`type`)
+) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Stored Procedures'
+show create table event;
+Table Create Table
+event CREATE TABLE `event` (
+ `db` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
+ `name` char(64) NOT NULL DEFAULT '',
+ `body` longblob NOT NULL,
+ `definer` varchar(384) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
+ `execute_at` datetime DEFAULT NULL,
+ `interval_value` int(11) DEFAULT NULL,
+ `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL,
+ `created` timestamp NOT NULL,
+ `modified` timestamp NOT NULL,
+ `last_executed` datetime DEFAULT NULL,
+ `starts` datetime DEFAULT NULL,
+ `ends` datetime DEFAULT NULL,
+ `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED',
+ `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP',
+ `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') NOT NULL DEFAULT '',
+ `comment` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '',
+ `originator` int(10) unsigned NOT NULL,
+ `time_zone` char(64) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'SYSTEM',
+ `character_set_client` char(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
+ `collation_connection` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
+ `db_collation` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
+ `body_utf8` longblob DEFAULT NULL,
+ PRIMARY KEY (`db`,`name`)
+) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Events'
+show create table general_log;
+Table Create Table
+general_log CREATE TABLE `general_log` (
+ `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
+ `user_host` mediumtext NOT NULL,
+ `thread_id` bigint(21) unsigned NOT NULL,
+ `server_id` int(10) unsigned NOT NULL,
+ `command_type` varchar(64) NOT NULL,
+ `argument` mediumtext NOT NULL
+) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='General log'
+show create table slow_log;
+Table Create Table
+slow_log CREATE TABLE `slow_log` (
+ `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
+ `user_host` mediumtext NOT NULL,
+ `query_time` time(6) NOT NULL,
+ `lock_time` time(6) NOT NULL,
+ `rows_sent` int(11) NOT NULL,
+ `rows_examined` int(11) NOT NULL,
+ `db` varchar(512) NOT NULL,
+ `last_insert_id` int(11) NOT NULL,
+ `insert_id` int(11) NOT NULL,
+ `server_id` int(10) unsigned NOT NULL,
+ `sql_text` mediumtext NOT NULL,
+ `thread_id` bigint(21) unsigned NOT NULL,
+ `rows_affected` int(11) NOT NULL
+) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='Slow log'
+show create table table_stats;
+Table Create Table
+table_stats CREATE TABLE `table_stats` (
+ `db_name` varchar(64) NOT NULL,
+ `table_name` varchar(64) NOT NULL,
+ `cardinality` bigint(21) unsigned DEFAULT NULL,
+ PRIMARY KEY (`db_name`,`table_name`)
+) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=0 COMMENT='Statistics on Tables'
+show create table column_stats;
+Table Create Table
+column_stats CREATE TABLE `column_stats` (
+ `db_name` varchar(64) NOT NULL,
+ `table_name` varchar(64) NOT NULL,
+ `column_name` varchar(64) NOT NULL,
+ `min_value` varbinary(255) DEFAULT NULL,
+ `max_value` varbinary(255) DEFAULT NULL,
+ `nulls_ratio` decimal(12,4) DEFAULT NULL,
+ `avg_length` decimal(12,4) DEFAULT NULL,
+ `avg_frequency` decimal(12,4) DEFAULT NULL,
+ `hist_size` tinyint(3) unsigned DEFAULT NULL,
+ `hist_type` enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB') DEFAULT NULL,
+ `histogram` longblob DEFAULT NULL,
+ PRIMARY KEY (`db_name`,`table_name`,`column_name`)
+) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=0 COMMENT='Statistics on Columns'
+show create table index_stats;
+Table Create Table
+index_stats CREATE TABLE `index_stats` (
+ `db_name` varchar(64) NOT NULL,
+ `table_name` varchar(64) NOT NULL,
+ `index_name` varchar(64) NOT NULL,
+ `prefix_arity` int(11) unsigned NOT NULL,
+ `avg_frequency` decimal(12,4) DEFAULT NULL,
+ PRIMARY KEY (`db_name`,`table_name`,`index_name`,`prefix_arity`)
+) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=0 COMMENT='Statistics on Indexes'
+DROP VIEW user;
+DROP TABLE db, host, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, event, proxies_priv, general_log, slow_log, innodb_index_stats, innodb_table_stats, transaction_registry, table_stats, column_stats, index_stats, roles_mapping, gtid_slave_pos, global_priv, ndb_binlog_index;
+show tables;
+Tables_in_test
diff --git a/mysql-test/main/system_mysql_db_fix50568.test b/mysql-test/main/system_mysql_db_fix50568.test
new file mode 100644
index 00000000000..3429f8c5478
--- /dev/null
+++ b/mysql-test/main/system_mysql_db_fix50568.test
@@ -0,0 +1,99 @@
+# Embedded server doesn't support external clients
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+
+# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set
+# to the location of mysql_fix_privilege_tables.sql
+if (!$MYSQL_FIX_PRIVILEGE_TABLES)
+{
+ skip Test needs MYSQL_FIX_PRIVILEGE_TABLES;
+}
+
+#
+# This is the test for mysql_fix_privilege_tables
+# It checks that a system tables from mysql 5.5.68
+# can be upgraded to current system table format
+#
+# Note: If this test fails, don't be confused about the errors reported
+# by mysql-test-run This shows warnings generated by
+# mysql_fix_system_tables which should be ignored.
+# Instead, concentrate on the errors in r/system_mysql_db.reject
+
+use test;
+
+# create system tables as in mysql-5.5.68
+CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges';
+
+CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges';
+
+CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) DEFAULT 0 NOT NULL, plugin char(64) CHARACTER SET latin1 DEFAULT '' NOT NULL, authentication_string TEXT NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges';
+
+CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions';
+
+
+CREATE TABLE IF NOT EXISTS plugin ( name varchar(64) DEFAULT '' NOT NULL, dl varchar(128) DEFAULT '' NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci comment='MySQL plugins';
+
+
+CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', Host char(64) NOT NULL DEFAULT '', Db char(64) NOT NULL DEFAULT '', Username char(64) NOT NULL DEFAULT '', Password char(64) NOT NULL DEFAULT '', Port INT(4) NOT NULL DEFAULT '0', Socket char(64) NOT NULL DEFAULT '', Wrapper char(64) NOT NULL DEFAULT '', Owner char(64) NOT NULL DEFAULT '', PRIMARY KEY (Server_name)) CHARACTER SET utf8 comment='MySQL Foreign Servers table';
+
+
+CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges';
+
+CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges';
+
+
+CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, name char(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, url text not null, primary key (help_topic_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help topics';
+
+
+CREATE TABLE IF NOT EXISTS help_category ( help_category_id smallint unsigned not null, name char(64) not null, parent_category_id smallint unsigned null, url text not null, primary key (help_category_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help categories';
+
+
+CREATE TABLE IF NOT EXISTS help_relation ( help_topic_id int unsigned not null references help_topic, help_keyword_id int unsigned not null references help_keyword, primary key (help_keyword_id, help_topic_id) ) engine=MyISAM CHARACTER SET utf8 comment='keyword-topic relation';
+
+
+CREATE TABLE IF NOT EXISTS help_keyword ( help_keyword_id int unsigned not null, name char(64) not null, primary key (help_keyword_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help keywords';
+
+
+CREATE TABLE IF NOT EXISTS time_zone_name ( Name char(64) NOT NULL, Time_zone_id int unsigned NOT NULL, PRIMARY KEY Name (Name) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone names';
+
+
+CREATE TABLE IF NOT EXISTS time_zone ( Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY TzId (Time_zone_id) ) engine=MyISAM CHARACTER SET utf8 comment='Time zones';
+
+
+CREATE TABLE IF NOT EXISTS time_zone_transition ( Time_zone_id int unsigned NOT NULL, Transition_time bigint signed NOT NULL, Transition_type_id int unsigned NOT NULL, PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone transitions';
+
+
+CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsigned NOT NULL, Transition_type_id int unsigned NOT NULL, `Offset` int signed DEFAULT 0 NOT NULL, Is_DST tinyint unsigned DEFAULT 0 NOT NULL, Abbreviation char(8) DEFAULT '' NOT NULL, PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone transition types';
+
+
+CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones';
+
+CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'IGNORE_BAD_TABLE_OPTIONS', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE', 'NO_ENGINE_SUBSTITUTION', 'PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment text collate utf8_bin NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures';
+
+CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) COLLATE utf8_general_ci DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges';
+
+
+CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator INTEGER UNSIGNED NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';
+
+
+CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
+
+CREATE TABLE IF NOT EXISTS proxies_priv (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Proxied_host char(60) binary DEFAULT '' NOT NULL, Proxied_user char(16) binary DEFAULT '' NOT NULL, With_grant BOOL DEFAULT 0 NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY Host (Host,User,Proxied_host,Proxied_user), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User proxy privileges';
+
+
+-- disable_result_log
+# Run the mysql_fix_privilege_tables.sql using "mysql --force"
+--exec $MYSQL --force test < $MYSQL_FIX_PRIVILEGE_TABLES
+-- enable_result_log
+
+# Dump the tables that should be compared
+-- source include/system_db_struct.inc
+
+# Drop all tables created by this test
+DROP VIEW user;
+DROP TABLE db, host, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, event, proxies_priv, general_log, slow_log, innodb_index_stats, innodb_table_stats, transaction_registry, table_stats, column_stats, index_stats, roles_mapping, gtid_slave_pos, global_priv, ndb_binlog_index;
+
+# check that we dropped all system tables
+show tables;
+
+# End of 4.1 tests
diff --git a/mysql-test/main/table_value_constr.result b/mysql-test/main/table_value_constr.result
index 86479c843c2..6d8dd6826e8 100644
--- a/mysql-test/main/table_value_constr.result
+++ b/mysql-test/main/table_value_constr.result
@@ -3156,5 +3156,124 @@ INSERT INTO t1 (VALUES (IGNORE) UNION VALUES (IGNORE));
ERROR HY000: 'ignore' is not allowed in this context
DROP TABLE t1;
#
+# MDEV-28603: VIEW with table value constructor used as single-value
+# subquery contains subquery as its first element
+#
+create table t1 (a int);
+insert into t1 values (3), (7), (1);
+create table t2 (b int);
+insert into t2 values (1), (2);
+create view v as select (values ((select * from t1 where a > 5))) as m from t2;
+select (values ((select * from t1 where a > 5))) as m from t2;
+m
+7
+7
+select * from v;
+m
+7
+7
+with cte as ( select (values ((select * from t1 where a > 5))) as m from t2 ) select * from cte;
+m
+7
+7
+explain select (values ((select * from t1 where a > 5))) as m from t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2
+4 SUBQUERY <derived2> ALL NULL NULL NULL NULL 2
+2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
+3 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where
+explain select * from v;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2
+5 SUBQUERY <derived3> ALL NULL NULL NULL NULL 2
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
+4 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where
+explain with cte as ( select (values ((select * from t1 where a > 5))) as m from t2 ) select * from cte;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2
+5 SUBQUERY <derived3> ALL NULL NULL NULL NULL 2
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
+4 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where
+prepare stmt from "select (values ((select * from t1 where a > 5))) as m from t2";
+execute stmt;
+m
+7
+7
+execute stmt;
+m
+7
+7
+deallocate prepare stmt;
+prepare stmt from "select * from v";
+execute stmt;
+m
+7
+7
+execute stmt;
+m
+7
+7
+deallocate prepare stmt;
+prepare stmt from "with cte as ( select (values ((select * from t1 where a > 5))) as m from t2 ) select * from cte";
+execute stmt;
+m
+7
+7
+execute stmt;
+m
+7
+7
+deallocate prepare stmt;
+show create view v;
+View Create View character_set_client collation_connection
+v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select (values ((select `t1`.`a` from `t1` where `t1`.`a` > 5))) AS `m` from `t2` latin1 latin1_swedish_ci
+drop view v;
+prepare stmt from "create view v as select (values ((select * from t1 where a > 5))) as m from t2";
+execute stmt;
+show create view v;
+View Create View character_set_client collation_connection
+v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select (values ((select `t1`.`a` from `t1` where `t1`.`a` > 5))) AS `m` from `t2` latin1 latin1_swedish_ci
+select * from v;
+m
+7
+7
+drop view v;
+execute stmt;
+show create view v;
+View Create View character_set_client collation_connection
+v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select (values ((select `t1`.`a` from `t1` where `t1`.`a` > 5))) AS `m` from `t2` latin1 latin1_swedish_ci
+select * from v;
+m
+7
+7
+deallocate prepare stmt;
+prepare stmt from "show create view v";
+execute stmt;
+View Create View character_set_client collation_connection
+v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select (values ((select `t1`.`a` from `t1` where `t1`.`a` > 5))) AS `m` from `t2` latin1 latin1_swedish_ci
+execute stmt;
+View Create View character_set_client collation_connection
+v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select (values ((select `t1`.`a` from `t1` where `t1`.`a` > 5))) AS `m` from `t2` latin1 latin1_swedish_ci
+deallocate prepare stmt;
+drop view v;
+create view v as select (values ((select * from t1 where a > 5
+union
+select * from t1 where a > 7))) as m from t2;
+select (values ((select * from t1 where a > 5
+union
+select * from t1 where a > 7))) as m from t2;
+m
+7
+7
+select * from v;
+m
+7
+7
+show create view v;
+View Create View character_set_client collation_connection
+v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select (values ((select `t1`.`a` from `t1` where `t1`.`a` > 5 union select `t1`.`a` from `t1` where `t1`.`a` > 7))) AS `m` from `t2` latin1 latin1_swedish_ci
+drop view v;
+drop table t1,t2;
+#
# End of 10.4 tests
#
diff --git a/mysql-test/main/table_value_constr.test b/mysql-test/main/table_value_constr.test
index ade90400b63..ac623eaaf0b 100644
--- a/mysql-test/main/table_value_constr.test
+++ b/mysql-test/main/table_value_constr.test
@@ -1761,5 +1761,79 @@ INSERT INTO t1 (VALUES (IGNORE) UNION VALUES (IGNORE));
DROP TABLE t1;
--echo #
+--echo # MDEV-28603: VIEW with table value constructor used as single-value
+--echo # subquery contains subquery as its first element
+--echo #
+
+create table t1 (a int);
+insert into t1 values (3), (7), (1);
+create table t2 (b int);
+insert into t2 values (1), (2);
+
+let $q=
+select (values ((select * from t1 where a > 5))) as m from t2;
+
+eval create view v as $q;
+
+eval $q;
+eval select * from v;
+eval with cte as ( $q ) select * from cte;
+
+eval explain $q;
+eval explain select * from v;
+eval explain with cte as ( $q ) select * from cte;
+
+eval prepare stmt from "$q";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+eval prepare stmt from "select * from v";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+eval prepare stmt from "with cte as ( $q ) select * from cte";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+show create view v;
+
+drop view v;
+
+eval prepare stmt from "create view v as $q";
+execute stmt;
+show create view v;
+select * from v;
+drop view v;
+execute stmt;
+show create view v;
+select * from v;
+deallocate prepare stmt;
+
+prepare stmt from "show create view v";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+drop view v;
+
+let $q=
+select (values ((select * from t1 where a > 5
+ union
+ select * from t1 where a > 7))) as m from t2;
+
+eval create view v as $q;
+
+eval $q;
+eval select * from v;
+
+show create view v;
+
+drop view v;
+drop table t1,t2;
+
+--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/type_datetime.result b/mysql-test/main/type_datetime.result
index 96f3c568446..0c351bcb3cd 100644
--- a/mysql-test/main/type_datetime.result
+++ b/mysql-test/main/type_datetime.result
@@ -545,7 +545,7 @@ select * from t1
where id in (select id from t1 as x1 where (t1.cur_date is null));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 PRIMARY x1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(t1)
+1 PRIMARY x1 ALL NULL NULL NULL NULL 2 50.00 Using where; FirstMatch(t1)
Warnings:
Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` semi join (`test`.`t1` `x1`) where `test`.`x1`.`id` = `test`.`t1`.`id` and `test`.`t1`.`cur_date` = 0
@@ -557,7 +557,7 @@ select * from t2
where id in (select id from t2 as x1 where (t2.cur_date is null));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 PRIMARY x1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(t2)
+1 PRIMARY x1 ALL NULL NULL NULL NULL 2 50.00 Using where; FirstMatch(t2)
Warnings:
Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` semi join (`test`.`t2` `x1`) where `test`.`x1`.`id` = `test`.`t2`.`id` and `test`.`t2`.`cur_date` = 0
diff --git a/mysql-test/main/type_time.result b/mysql-test/main/type_time.result
index 40746345bdf..a863eaea686 100644
--- a/mysql-test/main/type_time.result
+++ b/mysql-test/main/type_time.result
@@ -2420,5 +2420,31 @@ SET @@global.mysql56_temporal_format=default;
DROP PROCEDURE p1;
SET timestamp=DEFAULT;
#
+# MDEV-26765 UNIX_TIMESTAMP(CURRENT_TIME()) return null ?!?
+#
+SET @@time_zone='+00:00';
+SET timestamp=1234567;
+SELECT CURRENT_TIMESTAMP;
+CURRENT_TIMESTAMP
+1970-01-15 06:56:07
+SELECT UNIX_TIMESTAMP(CURRENT_TIME());
+UNIX_TIMESTAMP(CURRENT_TIME())
+1234567
+SELECT UNIX_TIMESTAMP(TIME'06:56:07');
+UNIX_TIMESTAMP(TIME'06:56:07')
+1234567
+SELECT UNIX_TIMESTAMP(TIME'10:20:30');
+UNIX_TIMESTAMP(TIME'10:20:30')
+1246830
+CREATE OR REPLACE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES (TIME'06:56:07'),('10:20:30');
+SELECT UNIX_TIMESTAMP(a) FROM t1 ORDER BY a;
+UNIX_TIMESTAMP(a)
+1234567
+1246830
+DROP TABLE t1;
+SET @@time_zone=DEFAULT;
+SET TIMESTAMP=DEFAULT;
+#
# End of 10.4 tests
#
diff --git a/mysql-test/main/type_time.test b/mysql-test/main/type_time.test
index 0f67223238c..9ed5c3a73dc 100644
--- a/mysql-test/main/type_time.test
+++ b/mysql-test/main/type_time.test
@@ -1567,5 +1567,24 @@ DROP PROCEDURE p1;
SET timestamp=DEFAULT;
--echo #
+--echo # MDEV-26765 UNIX_TIMESTAMP(CURRENT_TIME()) return null ?!?
+--echo #
+
+SET @@time_zone='+00:00';
+SET timestamp=1234567;
+SELECT CURRENT_TIMESTAMP;
+SELECT UNIX_TIMESTAMP(CURRENT_TIME());
+SELECT UNIX_TIMESTAMP(TIME'06:56:07');
+SELECT UNIX_TIMESTAMP(TIME'10:20:30');
+CREATE OR REPLACE TABLE t1 (a TIME);
+INSERT INTO t1 VALUES (TIME'06:56:07'),('10:20:30');
+SELECT UNIX_TIMESTAMP(a) FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+SET @@time_zone=DEFAULT;
+SET TIMESTAMP=DEFAULT;
+
+
+--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/update.result b/mysql-test/main/update.result
index c6c55da229e..8dda69e4e78 100644
--- a/mysql-test/main/update.result
+++ b/mysql-test/main/update.result
@@ -735,6 +735,35 @@ ERROR 22007: Incorrect datetime value: '19' for column `test`.`t1`.`i1` at row 1
DROP TABLE t1,t2;
# End of MariaDB 10.2 tests
#
+# MDEV-20773: UPDATE with LIKE predicate over non-indexed column
+# of VARCHAR type
+#
+create table t1 (a1 varchar(30), a2 varchar(30) collate utf8_bin);
+insert into t1 values
+('aa','zzz'), ('b','xxaa'), ('ccc','yyy'), ('ddd','xxb');
+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
+explain extended
+update t1 set a1 = 'u'
+ where a2 like 'xx%' and exists(select 1 from t1 where t1.a1 < 'c');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 50.00 Using where
+2 SUBQUERY t1 ALL NULL NULL NULL NULL 4 50.00 Using where
+Warnings:
+Note 1003 /* select#1 */ update `test`.`t1` set `test`.`t1`.`a1` = 'u' where `test`.`t1`.`a2` like 'xx%'
+update t1 set a1 = 'u'
+ where a2 like 'xx%' and exists(select 1 from t1 where t1.a1 < 'c');
+select * from t1;
+a1 a2
+aa zzz
+u xxaa
+ccc yyy
+u xxb
+drop table t1;
+# End of MariaDB 10.4 tests
+#
# MDEV-29189: Second execution of SF using UPDATE?DELETE
# after reported error by the first execution
#
diff --git a/mysql-test/main/update.test b/mysql-test/main/update.test
index 88fea88f120..c10c1b82a50 100644
--- a/mysql-test/main/update.test
+++ b/mysql-test/main/update.test
@@ -678,6 +678,29 @@ DROP TABLE t1,t2;
--echo # End of MariaDB 10.2 tests
--echo #
+--echo # MDEV-20773: UPDATE with LIKE predicate over non-indexed column
+--echo # of VARCHAR type
+--echo #
+
+create table t1 (a1 varchar(30), a2 varchar(30) collate utf8_bin);
+insert into t1 values
+ ('aa','zzz'), ('b','xxaa'), ('ccc','yyy'), ('ddd','xxb');
+analyze table t1 persistent for all;
+
+explain extended
+update t1 set a1 = 'u'
+ where a2 like 'xx%' and exists(select 1 from t1 where t1.a1 < 'c');
+
+update t1 set a1 = 'u'
+ where a2 like 'xx%' and exists(select 1 from t1 where t1.a1 < 'c');
+
+select * from t1;
+
+drop table t1;
+
+--echo # End of MariaDB 10.4 tests
+
+--echo #
--echo # MDEV-29189: Second execution of SF using UPDATE?DELETE
--echo # after reported error by the first execution
--echo #
diff --git a/mysql-test/main/view.result b/mysql-test/main/view.result
index b5c5564a7da..9a21c4d5c0a 100644
--- a/mysql-test/main/view.result
+++ b/mysql-test/main/view.result
@@ -6959,6 +6959,24 @@ create algorithm=merge view v as
select * from t1 left join t2 on t1.a=t2.b and t1.a in (select d from t3);
ERROR 42S22: Unknown column 'd' in 'field list'
drop table t1,t2,t3;
+#
+# MDEV-31189: Server crash or assertion failure in upon 2nd
+# execution of PS with views and HAVING
+#
+CREATE TABLE t (f INT);
+INSERT INTO t VALUES (1),(2);
+CREATE VIEW v1 AS SELECT 1 AS a;
+CREATE VIEW v2 AS SELECT a FROM v1;
+PREPARE stmt FROM "SELECT * FROM v2 HAVING 1 IN (SELECT f FROM t)";
+EXECUTE stmt;
+a
+1
+EXECUTE stmt;
+a
+1
+DROP VIEW v1;
+DROP VIEW v2;
+DROP TABLE t;
# End of 10.4 tests
#
# MDEV-13115: SELECT .. SKIP LOCKED - ensure SHOW CREATE VIEW is correct
diff --git a/mysql-test/main/view.test b/mysql-test/main/view.test
index 3b3d1124a09..0892f00e65b 100644
--- a/mysql-test/main/view.test
+++ b/mysql-test/main/view.test
@@ -6704,6 +6704,25 @@ create algorithm=merge view v as
drop table t1,t2,t3;
+--echo #
+--echo # MDEV-31189: Server crash or assertion failure in upon 2nd
+--echo # execution of PS with views and HAVING
+--echo #
+
+CREATE TABLE t (f INT);
+INSERT INTO t VALUES (1),(2); # Optional, fails either way
+CREATE VIEW v1 AS SELECT 1 AS a;
+CREATE VIEW v2 AS SELECT a FROM v1;
+
+PREPARE stmt FROM "SELECT * FROM v2 HAVING 1 IN (SELECT f FROM t)";
+EXECUTE stmt;
+EXECUTE stmt;
+
+# Cleanup
+DROP VIEW v1;
+DROP VIEW v2;
+DROP TABLE t;
+
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/mariadb-test-run.pl b/mysql-test/mariadb-test-run.pl
index 07aac0f63b0..245e5d42ed2 100755
--- a/mysql-test/mariadb-test-run.pl
+++ b/mysql-test/mariadb-test-run.pl
@@ -145,7 +145,6 @@ my $opt_start_exit;
my $start_only;
my $file_wsrep_provider;
my $num_saved_cores= 0; # Number of core files saved in vardir/log/ so far.
-my $test_name_for_report;
our @global_suppressions;
@@ -187,6 +186,7 @@ my @DEFAULT_SUITES= qw(
compat/mssql-
compat/maxdb-
encryption-
+ events-
federated-
funcs_1-
funcs_2-
@@ -201,6 +201,7 @@ my @DEFAULT_SUITES= qw(
json-
maria-
mariabackup-
+ merge-
multi_source-
optimizer_unfixed_bugs-
parts-
@@ -402,6 +403,11 @@ sub main {
mtr_report("Collecting tests...");
my $tests= collect_test_cases($opt_reorder, $opt_suites, \@opt_cases, \@opt_skip_test_list);
+ if (@$tests == 0) {
+ mtr_report("No tests to run...");
+ exit 0;
+ }
+
mark_time_used('collect');
mysql_install_db(default_mysqld(), "$opt_vardir/install.db") unless using_extern();
@@ -516,13 +522,13 @@ sub main {
}
if ( not @$completed ) {
- if ($test_name_for_report)
- {
- my $tinfo = My::Test->new(name => $test_name_for_report);
- $tinfo->{result}= 'MTR_RES_FAILED';
- $tinfo->{comment}=' ';
- mtr_report_test($tinfo);
- }
+ my $test_name= mtr_grab_file($path_testlog);
+ $test_name =~ s/^CURRENT_TEST:\s//;
+ chomp($test_name);
+ my $tinfo = My::Test->new(name => $test_name);
+ $tinfo->{result}= 'MTR_RES_FAILED';
+ $tinfo->{comment}=' ';
+ mtr_report_test($tinfo);
mtr_error("Test suite aborted");
}
@@ -3749,8 +3755,8 @@ sub resfile_report_test ($) {
sub run_testcase ($$) {
my ($tinfo, $server_socket)= @_;
my $print_freq=20;
- $test_name_for_report= $tinfo->{name};
- mtr_verbose("Running test:", $test_name_for_report);
+
+ mtr_verbose("Running test:", $tinfo->{name});
$ENV{'MTR_TEST_NAME'} = $tinfo->{name};
resfile_report_test($tinfo) if $opt_resfile;
@@ -5139,10 +5145,12 @@ sub mysqld_start ($$) {
if (!$rc)
{
# Report failure about the last test case before exit
- my $tinfo = My::Test->new(name => $test_name_for_report);
+ my $test_name= mtr_grab_file($path_current_testlog);
+ $test_name =~ s/^CURRENT_TEST:\s//;
+ my $tinfo = My::Test->new(name => $test_name);
$tinfo->{result}= 'MTR_RES_FAILED';
$tinfo->{failures}= 1;
- $tinfo->{logfile}=get_log_from_proc($mysqld->{'proc'}, $test_name_for_report);
+ $tinfo->{logfile}=get_log_from_proc($mysqld->{'proc'}, $tinfo->{name});
report_option('verbose', 1);
mtr_report_test($tinfo);
}
@@ -5961,7 +5969,7 @@ Misc options
phases of test execution.
stress=ARGS Run stress test, providing options to
mysql-stress-test.pl. Options are separated by comma.
- xml-report=<file> Output jUnit xml file of the results.
+ xml-report=<file> Output xml file of the results.
tail-lines=N Number of lines of the result to include in a failure
report.
diff --git a/mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYD b/mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYD
new file mode 100644
index 00000000000..77a281667b5
--- /dev/null
+++ b/mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYD
Binary files differ
diff --git a/mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYI b/mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYI
new file mode 100644
index 00000000000..20fc1b97c00
--- /dev/null
+++ b/mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYI
Binary files differ
diff --git a/mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.frm b/mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.frm
new file mode 100644
index 00000000000..1eb8ac15133
--- /dev/null
+++ b/mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.frm
Binary files differ
diff --git a/mysql-test/std_data/rpl/master-bin-seq_10.3.36.000001 b/mysql-test/std_data/rpl/master-bin-seq_10.3.36.000001
new file mode 100644
index 00000000000..0fa163d0484
--- /dev/null
+++ b/mysql-test/std_data/rpl/master-bin-seq_10.3.36.000001
Binary files differ
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result
index 9148f0e8c2b..294e96e5997 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result
@@ -1,3 +1,7 @@
+#
+# MDEV-30698 Cover missing test cases for mariadb-binlog options
+# --raw [and] --flashback
+#
CREATE TABLE t1 (a int);
FLUSH LOGS;
INSERT INTO t1 VALUES (1);
diff --git a/mysql-test/suite/binlog/r/flashback.result b/mysql-test/suite/binlog/r/flashback.result
index 2eac49397a9..ec767f62152 100644
--- a/mysql-test/suite/binlog/r/flashback.result
+++ b/mysql-test/suite/binlog/r/flashback.result
@@ -702,6 +702,10 @@ include/assert.inc [Table t1 should have 0 rows.]
# 6- Rows must be present upon restoring from flashback
include/assert.inc [Table t1 should have six rows.]
DROP TABLE t1;
+#
+# MDEV-30698 Cover missing test cases for mariadb-binlog options
+# --raw [and] --flashback
+#
SET binlog_format=statement;
Warnings:
Warning 1105 MariaDB Galera and flashback do not support binlog format: STATEMENT
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_raw_flush.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_raw_flush.test
index 8ec3856dcb5..793aa8a0607 100644
--- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_raw_flush.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_raw_flush.test
@@ -5,6 +5,7 @@
# respective log file specified by --result-file, and shown on-disk. This test
# ensures that the log files on disk, created by mariadb-binlog, have the most
# up-to-date events from the master.
+# Option --raw works only with --read-from-remote-server, otherwise returns error.
#
# Methodology:
# On the master, rotate to a newly active binlog file and write an event to
@@ -20,6 +21,14 @@
--source include/linux.inc
--source include/have_log_bin.inc
+--echo #
+--echo # MDEV-30698 Cover missing test cases for mariadb-binlog options
+--echo # --raw [and] --flashback
+--echo #
+# Test --raw format without -R (--read-from-remote-server)
+--error 1 # Error 1 operation not permitted
+--exec $MYSQL_BINLOG --raw --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --stop-never --result-file=$MYSQLTEST_VARDIR/tmp/ master-bin.000001
+
# Create newly active log
CREATE TABLE t1 (a int);
FLUSH LOGS;
diff --git a/mysql-test/suite/binlog/t/binlog_truncate_multi_engine.inc b/mysql-test/suite/binlog/t/binlog_truncate_multi_engine.inc
index 52ce4741eaa..f3801070851 100644
--- a/mysql-test/suite/binlog/t/binlog_truncate_multi_engine.inc
+++ b/mysql-test/suite/binlog/t/binlog_truncate_multi_engine.inc
@@ -20,7 +20,9 @@ connect(con1,localhost,root,,);
--source include/show_binary_logs.inc
INSERT INTO t1 VALUES (1, REPEAT("x", 1));
INSERT INTO t2 VALUES (1, REPEAT("x", 1));
-if (`SELECT $case = "B"`)
+--let $is_case_B=`SELECT $case = "B"`
+
+if ($is_case_B)
{
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
wait-binlog_truncate_multi_engine.test
@@ -39,12 +41,12 @@ if (`SELECT $debug_sync_action != ""`)
send COMMIT;
--connection default
-if (`SELECT $case = "B"`)
+if ($is_case_B)
{
--source include/wait_until_disconnected.inc
--source include/start_mysqld.inc
}
-if (`SELECT $case != "B"`)
+if (!$is_case_B)
{
SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
--echo List of binary logs after rotation
diff --git a/mysql-test/suite/binlog/t/flashback.test b/mysql-test/suite/binlog/t/flashback.test
index 76379f35dae..7c58b56c935 100644
--- a/mysql-test/suite/binlog/t/flashback.test
+++ b/mysql-test/suite/binlog/t/flashback.test
@@ -364,6 +364,14 @@ FLUSH LOGS;
DROP TABLE t1;
+--echo #
+--echo # MDEV-30698 Cover missing test cases for mariadb-binlog options
+--echo # --raw [and] --flashback
+--echo #
+
+--error 1 # --raw mode and --flashback mode are not allowed
+--exec $MYSQL_BINLOG -vv -B --raw --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000003> $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_8.sql
+
## Clear
SET binlog_format=statement;
--error ER_FLASHBACK_NOT_SUPPORTED
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.cnf b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.cnf
index 73c9ad655bf..73c9ad655bf 100644
--- a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.cnf
+++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.cnf
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.result b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.result
index a628d0d409b..35b44be02cf 100644
--- a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.result
+++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.result
@@ -9,6 +9,7 @@ include/start_slave.inc
connection server_1;
connection server_2;
include/stop_slave.inc
+CHANGE MASTER TO MASTER_USE_GTID=NO;
#####################################################
# Part 1: unencrypted master
#####################################################
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.test b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.test
index d36086da73b..e05994f1943 100644
--- a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.test
+++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.test
@@ -1,14 +1,19 @@
#
-# TODO: write here what the test checks after MDEV-11288 is fixed
-#
-# The test starts with unencrypted master.
+# The test starts with unencrypted master.
# It stops replication, generates a few statement and row events
-# on the master, then restarts the server with encrypted binlog,
-# generates some more events and restarts it back without encryption
+# on the master, then restarts the server with encrypted binlog,
+# generates some more events and restarts it back without encryption
# (no encryption plugin).
-# Then it resumes replication and checks what happens when the server
-# tries to feed the binary logs (included the encrypted ones)
-# to the slave.
+# Then it resumes replication and should error with
+# ER_MASTER_FATAL_ERROR_READING_BINLOG because the encrypted binlog is
+# sent and unable to be decrypted.
+#
+# Note this variation of encrypted_master_switch_to_unencrypted tests
+# using MASTER_USE_GTID=NO. In contrast to the GTID variant of this
+# test, at part 3 (the error case), the master will scan binlogs
+# starting from the first one (which is unencrypted initially, so
+# replication is okay) and continue until the slave encounters the
+# first encrypted event, which causes the slave to error.
#
--source include/have_binlog_format_mixed.inc
@@ -34,6 +39,7 @@ CHANGE MASTER TO MASTER_USE_GTID=NO;
--connection server_2
--disable_connect_log
--source include/stop_slave.inc
+CHANGE MASTER TO MASTER_USE_GTID=NO;
--enable_connect_log
--echo #####################################################
@@ -48,7 +54,7 @@ CREATE TABLE table1_no_encryption (
pk INT AUTO_INCREMENT PRIMARY KEY,
ts TIMESTAMP NULL,
b BLOB
-) ENGINE=MyISAM;
+) ENGINE=MyISAM;
INSERT INTO table1_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
@@ -81,7 +87,7 @@ CREATE TABLE table2_to_encrypt (
pk INT AUTO_INCREMENT PRIMARY KEY,
ts TIMESTAMP NULL,
b BLOB
-) ENGINE=MyISAM;
+) ENGINE=MyISAM;
INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
@@ -108,7 +114,7 @@ CREATE TABLE table3_no_encryption (
pk INT AUTO_INCREMENT PRIMARY KEY,
ts TIMESTAMP NULL,
b BLOB
-) ENGINE=MyISAM;
+) ENGINE=MyISAM;
INSERT INTO table3_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
@@ -120,7 +126,7 @@ INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
--connection server_2
start slave;
-# The slave should be able to synchronize with master up to
+# The slave should be able to synchronize with master up to
# the previously saved position (when the log was still unencrypted)
--sync_with_master
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.cnf b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.cnf
new file mode 100644
index 00000000000..ad1b8b44c24
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.cnf
@@ -0,0 +1,8 @@
+!include my.cnf
+
+[mysqld.1]
+encrypt-binlog=0
+skip-file-key-management
+
+[mysqld.2]
+gtid-domain-id=1
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result
new file mode 100644
index 00000000000..16ea30557e7
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result
@@ -0,0 +1,84 @@
+#################
+# Initialization
+#################
+include/rpl_init.inc [topology=1->2]
+connection server_2;
+include/stop_slave.inc
+CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS;
+call mtr.add_suppression(" Got fatal error 1236 from master when reading data from binary log: 'Could not set up decryption for binlog.'");
+#####################################################
+# Part 1: unencrypted master
+#####################################################
+connection server_1;
+CREATE TABLE table1_no_encryption (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+ts TIMESTAMP NULL,
+b BLOB
+) ENGINE=MyISAM;
+INSERT INTO table1_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+FLUSH BINARY LOGS;
+SET binlog_format=ROW;
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+NOT FOUND /table1_no_encryption/ in master-bin.0*
+#####################################################
+# Part 2: restart master, now with binlog encryption
+#####################################################
+connection default;
+connection server_1;
+CREATE TABLE table2_to_encrypt (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+ts TIMESTAMP NULL,
+b BLOB
+) ENGINE=MyISAM;
+INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+FLUSH BINARY LOGS;
+SET binlog_format=ROW;
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+NOT FOUND /table2_to_encrypt/ in master-bin.0*
+#####################################################
+# Part 3: restart master again without encryption
+#####################################################
+connection default;
+connection server_1;
+CREATE TABLE table3_no_encryption (
+pk INT AUTO_INCREMENT PRIMARY KEY,
+ts TIMESTAMP NULL,
+b BLOB
+) ENGINE=MyISAM;
+INSERT INTO table3_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
+INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
+INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
+#####################################################
+# Check: resume replication and check how it goes
+#####################################################
+connection server_2;
+start slave;
+include/wait_for_slave_io_error.inc [errno=1236]
+# Ensuring slave was unable to replicate any transactions..
+# ..success
+SHOW TABLES;
+Tables_in_test
+include/stop_slave.inc
+reset slave;
+##########
+# Cleanup
+##########
+connection server_1;
+reset master;
+SELECT COUNT(*) FROM table1_no_encryption;
+COUNT(*)
+8
+SELECT COUNT(*) FROM table2_to_encrypt;
+COUNT(*)
+8
+SELECT COUNT(*) FROM table3_no_encryption;
+COUNT(*)
+4
+DROP TABLE table1_no_encryption, table2_to_encrypt, table3_no_encryption;
+connection server_2;
+include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test
new file mode 100644
index 00000000000..f882e8f3440
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test
@@ -0,0 +1,154 @@
+#
+# The test starts with unencrypted master.
+# It stops replication, generates a few statement and row events
+# on the master, then restarts the server with encrypted binlog,
+# generates some more events and restarts it back without encryption
+# (no encryption plugin).
+# Then it resumes replication and should error with
+# ER_MASTER_FATAL_ERROR_READING_BINLOG because the encrypted binlog is
+# sent and unable to be decrypted.
+#
+# Note this variation of encrypted_master_switch_to_unencrypted tests
+# using MASTER_USE_GTID=SLAVE_POS. encrypted_master_switch_to_unencrypted
+# was the original test which only used binlog coordinates. When tested
+# using MASTER_USE_GTID=Slave_Pos, the master optimizes the detection of
+# an undecryptable binlog. I.e, the master will initially look for a
+# Gtid_list_log_event, but fail to decrypt it and fail immediately in
+# part 3.
+#
+
+--source include/have_binlog_format_mixed.inc
+
+--echo #################
+--echo # Initialization
+--echo #################
+
+--let $rpl_topology= 1->2
+--source include/rpl_init.inc
+
+--enable_connect_log
+
+# We stop replication because we want it to happen after the switch
+
+--connection server_2
+--disable_connect_log
+--source include/stop_slave.inc
+CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS;
+--enable_connect_log
+call mtr.add_suppression(" Got fatal error 1236 from master when reading data from binary log: 'Could not set up decryption for binlog.'");
+
+--echo #####################################################
+--echo # Part 1: unencrypted master
+--echo #####################################################
+
+--connection server_1
+
+CREATE TABLE table1_no_encryption (
+ pk INT AUTO_INCREMENT PRIMARY KEY,
+ ts TIMESTAMP NULL,
+ b BLOB
+) ENGINE=MyISAM;
+
+INSERT INTO table1_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+FLUSH BINARY LOGS;
+SET binlog_format=ROW;
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+
+# Make sure that binary logs are not encrypted
+
+--let SEARCH_RANGE = 500000
+--let SEARCH_FILE= master-bin.0*
+--let SEARCH_PATTERN= table1_no_encryption
+--source include/search_pattern_in_file.inc
+
+--echo #####################################################
+--echo # Part 2: restart master, now with binlog encryption
+--echo #####################################################
+
+--let $rpl_server_parameters= --encrypt-binlog=1 --plugin-load-add=$FILE_KEY_MANAGEMENT_SO --file-key-management --loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
+
+--let $rpl_server_number= 1
+--source restart_server.inc
+
+CREATE TABLE table2_to_encrypt (
+ pk INT AUTO_INCREMENT PRIMARY KEY,
+ ts TIMESTAMP NULL,
+ b BLOB
+) ENGINE=MyISAM;
+
+INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt');
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+FLUSH BINARY LOGS;
+SET binlog_format=ROW;
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt;
+
+# Make sure that binary logs are encrypted
+
+--let SEARCH_FILE= master-bin.0*
+--let SEARCH_PATTERN= table2_to_encrypt
+--source include/search_pattern_in_file.inc
+
+--echo #####################################################
+--echo # Part 3: restart master again without encryption
+--echo #####################################################
+
+--let $rpl_server_parameters= --encrypt-binlog=0
+--let $rpl_server_number= 1
+--source restart_server.inc
+
+CREATE TABLE table3_no_encryption (
+ pk INT AUTO_INCREMENT PRIMARY KEY,
+ ts TIMESTAMP NULL,
+ b BLOB
+) ENGINE=MyISAM;
+
+INSERT INTO table3_no_encryption VALUES (NULL,NOW(),'data_no_encryption');
+INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
+INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
+
+--echo #####################################################
+--echo # Check: resume replication and check how it goes
+--echo #####################################################
+
+--connection server_2
+start slave;
+# Make slave to try to synchronize. It shouldn't work, the slave IO thread is
+# expected to abort with an error
+--let $slave_io_errno= 1236
+--source include/wait_for_slave_io_error.inc
+
+--echo # Ensuring slave was unable to replicate any transactions..
+--let $gsp= `SELECT @@global.gtid_slave_pos`
+if (`SELECT strcmp("$gsp","")`)
+{
+ die Slave without encryption configured should fail to read encrypted binlog;
+}
+--echo # ..success
+
+--sorted_result
+SHOW TABLES;
+
+--disable_connect_log
+--source include/stop_slave.inc
+--enable_connect_log
+reset slave;
+
+--echo ##########
+--echo # Cleanup
+--echo ##########
+
+--connection server_1
+reset master;
+
+SELECT COUNT(*) FROM table1_no_encryption;
+SELECT COUNT(*) FROM table2_to_encrypt;
+SELECT COUNT(*) FROM table3_no_encryption;
+DROP TABLE table1_no_encryption, table2_to_encrypt, table3_no_encryption;
+
+--connection server_2
+--disable_connect_log
+--source include/start_slave.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.test b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.test
index c2a7ec9d27a..25849c111a7 100644
--- a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.test
+++ b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.test
@@ -1,2 +1,2 @@
--let $binlog_limit= 5,1
---source suite/rpl/include/rpl_binlog_errors.inc
+--source suite/rpl/t/rpl_binlog_errors.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test b/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test
index acbe0d59a5e..406af58c03b 100644
--- a/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test
+++ b/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_cant_read_event_incident.inc
+--source suite/rpl/t/rpl_cant_read_event_incident.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_checksum.test b/mysql-test/suite/binlog_encryption/rpl_checksum.test
index ca8cdc06726..a2abd019e24 100644
--- a/mysql-test/suite/binlog_encryption/rpl_checksum.test
+++ b/mysql-test/suite/binlog_encryption/rpl_checksum.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_checksum.inc
+--source suite/rpl/t/rpl_checksum.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_checksum_cache.test b/mysql-test/suite/binlog_encryption/rpl_checksum_cache.test
index 8fa44136fc2..56fb2be0ce3 100644
--- a/mysql-test/suite/binlog_encryption/rpl_checksum_cache.test
+++ b/mysql-test/suite/binlog_encryption/rpl_checksum_cache.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_checksum_cache.inc
+--source suite/rpl/t/rpl_checksum_cache.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_corruption.test b/mysql-test/suite/binlog_encryption/rpl_corruption.test
index 1abf2c882ec..f6ba2944398 100644
--- a/mysql-test/suite/binlog_encryption/rpl_corruption.test
+++ b/mysql-test/suite/binlog_encryption/rpl_corruption.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_corruption.inc
+--source suite/rpl/t/rpl_corruption.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_gtid_basic.result b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.result
index 99eda3b61a0..07ef909d8a6 100644
--- a/mysql-test/suite/binlog_encryption/rpl_gtid_basic.result
+++ b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.result
@@ -564,3 +564,27 @@ a
connection server_1;
DROP TABLE t1;
include/rpl_end.inc
+#
+# Start of 10.2 tests
+#
+#
+# MDEV-10134 Add full support for DEFAULT
+#
+CREATE TABLE t1 (a VARCHAR(100) DEFAULT BINLOG_GTID_POS("master-bin.000001", 600));
+ERROR HY000: Function or expression 'binlog_gtid_pos()' cannot be used in the DEFAULT clause of `a`
+#
+# End of 10.2 tests
+#
+#
+# Start of 10.3 tests
+#
+#
+# MDEV-13967 Parameter data type control for Item_long_func
+#
+SELECT MASTER_GTID_WAIT(ROW(1,1),'str');
+ERROR HY000: Illegal parameter data type row for operation 'master_gtid_wait'
+SELECT MASTER_GTID_WAIT('str',ROW(1,1));
+ERROR HY000: Illegal parameter data type row for operation 'master_gtid_wait'
+#
+# End of 10.3 tests
+#
diff --git a/mysql-test/suite/binlog_encryption/rpl_gtid_basic.test b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.test
index b9f5a18a588..b183c1d4b4e 100644
--- a/mysql-test/suite/binlog_encryption/rpl_gtid_basic.test
+++ b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_gtid_basic.inc
+--source suite/rpl/t/rpl_gtid_basic.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_incident.test b/mysql-test/suite/binlog_encryption/rpl_incident.test
index b6d2a24a71e..5a707774f3c 100644
--- a/mysql-test/suite/binlog_encryption/rpl_incident.test
+++ b/mysql-test/suite/binlog_encryption/rpl_incident.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_incident.inc
+--source suite/rpl/t/rpl_incident.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test b/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test
index 872b8cd3598..532db963e63 100644
--- a/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test
+++ b/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_init_slave_errors.inc
+--source suite/rpl/t/rpl_init_slave_errors.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_loaddata_local.test b/mysql-test/suite/binlog_encryption/rpl_loaddata_local.test
index 9e0bb9598bf..35ad09647a6 100644
--- a/mysql-test/suite/binlog_encryption/rpl_loaddata_local.test
+++ b/mysql-test/suite/binlog_encryption/rpl_loaddata_local.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_loaddata_local.inc
+--source suite/rpl/t/rpl_loaddata_local.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_loadfile.test b/mysql-test/suite/binlog_encryption/rpl_loadfile.test
index 84e6ecd7a0d..235c4a3d29e 100644
--- a/mysql-test/suite/binlog_encryption/rpl_loadfile.test
+++ b/mysql-test/suite/binlog_encryption/rpl_loadfile.test
@@ -1,4 +1,4 @@
---source suite/rpl/include/rpl_loadfile.inc
+--source suite/rpl/t/rpl_loadfile.test
--let $datadir= `SELECT @@datadir`
diff --git a/mysql-test/suite/binlog_encryption/rpl_packet.test b/mysql-test/suite/binlog_encryption/rpl_packet.test
index 43637314236..28beae1a91c 100644
--- a/mysql-test/suite/binlog_encryption/rpl_packet.test
+++ b/mysql-test/suite/binlog_encryption/rpl_packet.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_packet.inc
+--source suite/rpl/t/rpl_packet.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.test b/mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.test
index 8a26778c8f2..0c3e5386930 100644
--- a/mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.test
+++ b/mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_parallel_ignored_errors.inc
+--source suite/rpl/t/rpl_parallel_ignored_errors.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test b/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test
index 7bdfaaf9adb..e342e4d61ff 100644
--- a/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test
+++ b/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc
+--source suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_relayrotate.test b/mysql-test/suite/binlog_encryption/rpl_relayrotate.test
index e52f5159fcc..a8dabdc3e8d 100644
--- a/mysql-test/suite/binlog_encryption/rpl_relayrotate.test
+++ b/mysql-test/suite/binlog_encryption/rpl_relayrotate.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_relayrotate.inc
+--source suite/rpl/t/rpl_relayrotate.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_semi_sync.test b/mysql-test/suite/binlog_encryption/rpl_semi_sync.test
index dfc68b699c0..2e0907cce30 100644
--- a/mysql-test/suite/binlog_encryption/rpl_semi_sync.test
+++ b/mysql-test/suite/binlog_encryption/rpl_semi_sync.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_semi_sync.inc
+--source suite/rpl/t/rpl_semi_sync.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_skip_replication.test b/mysql-test/suite/binlog_encryption/rpl_skip_replication.test
index 40992586c7c..11c5b33b362 100644
--- a/mysql-test/suite/binlog_encryption/rpl_skip_replication.test
+++ b/mysql-test/suite/binlog_encryption/rpl_skip_replication.test
@@ -1,2 +1,2 @@
--let $use_remote_mysqlbinlog= 1
---source suite/rpl/include/rpl_skip_replication.inc
+--source suite/rpl/t/rpl_skip_replication.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_special_charset.test b/mysql-test/suite/binlog_encryption/rpl_special_charset.test
index eb697204860..c74f8915798 100644
--- a/mysql-test/suite/binlog_encryption/rpl_special_charset.test
+++ b/mysql-test/suite/binlog_encryption/rpl_special_charset.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_special_charset.inc
+--source suite/rpl/t/rpl_special_charset.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_sporadic_master.test b/mysql-test/suite/binlog_encryption/rpl_sporadic_master.test
index 0dab68a4b08..1e3992dc5d9 100644
--- a/mysql-test/suite/binlog_encryption/rpl_sporadic_master.test
+++ b/mysql-test/suite/binlog_encryption/rpl_sporadic_master.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_sporadic_master.inc
+--source suite/rpl/t/rpl_sporadic_master.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_ssl.test b/mysql-test/suite/binlog_encryption/rpl_ssl.test
index 9a4788c1d2d..fb30d83ab5e 100644
--- a/mysql-test/suite/binlog_encryption/rpl_ssl.test
+++ b/mysql-test/suite/binlog_encryption/rpl_ssl.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_ssl.inc
+--source suite/rpl/t/rpl_ssl.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test b/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test
index 45d18a25410..d5a08bde969 100644
--- a/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test
+++ b/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_stm_relay_ign_space.inc
+--source suite/rpl/t/rpl_stm_relay_ign_space.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test b/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test
index 2a16d90f9ad..c65cc202ba2 100644
--- a/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test
+++ b/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_switch_stm_row_mixed.inc
+--source suite/rpl/t/rpl_switch_stm_row_mixed.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_sync.test b/mysql-test/suite/binlog_encryption/rpl_sync.test
index 8dbd6ff254b..1ff72228565 100644
--- a/mysql-test/suite/binlog_encryption/rpl_sync.test
+++ b/mysql-test/suite/binlog_encryption/rpl_sync.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_sync_test.inc
+--source suite/rpl/t/rpl_sync.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test b/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test
index 30f5f247c23..5a9a79bad42 100644
--- a/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test
+++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_temporal_format_default_to_default.inc
+--source suite/rpl/t/rpl_temporal_format_default_to_default.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test
index 68afb4148ef..b9576b30f92 100644
--- a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test
+++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test
@@ -3,4 +3,4 @@
--let $force_master_mysql56_temporal_format=false;
--let $force_slave_mysql56_temporal_format=true;
---source suite/rpl/include/rpl_temporal_format_default_to_default.inc
+--source suite/rpl/t/rpl_temporal_format_default_to_default.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test
index 96d928fcf08..7d09942814e 100644
--- a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test
+++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test
@@ -1,4 +1,4 @@
--let $force_master_mysql56_temporal_format=true;
--let $force_slave_mysql56_temporal_format=false;
---source suite/rpl/include/rpl_temporal_format_default_to_default.inc
+--source suite/rpl/t/rpl_temporal_format_default_to_default.test
diff --git a/mysql-test/suite/binlog_encryption/rpl_typeconv.test b/mysql-test/suite/binlog_encryption/rpl_typeconv.test
index fe56a148256..6761cddfb87 100644
--- a/mysql-test/suite/binlog_encryption/rpl_typeconv.test
+++ b/mysql-test/suite/binlog_encryption/rpl_typeconv.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_typeconv.inc
+--source suite/rpl/t/rpl_typeconv.test
diff --git a/mysql-test/suite/encryption/r/import_4k.result b/mysql-test/suite/encryption/r/import_4k.result
new file mode 100644
index 00000000000..959e2498e00
--- /dev/null
+++ b/mysql-test/suite/encryption/r/import_4k.result
@@ -0,0 +1,10 @@
+set @save_limit = @@GLOBAL.innodb_limit_optimistic_insert_debug;
+set global innodb_limit_optimistic_insert_debug=3;
+create table t1 (a INT PRIMARY KEY) engine=InnoDB ENCRYPTED=YES;
+insert into t1 select * from seq_1_to_6000;
+flush table t1 for export;
+unlock tables;
+alter table t1 discard tablespace;
+alter table t1 import tablespace;
+set global innodb_limit_optimistic_insert_debug=@save_limit;
+drop table t1;
diff --git a/mysql-test/suite/encryption/t/import_4k.opt b/mysql-test/suite/encryption/t/import_4k.opt
new file mode 100644
index 00000000000..e5b58602036
--- /dev/null
+++ b/mysql-test/suite/encryption/t/import_4k.opt
@@ -0,0 +1 @@
+--innodb-page-size=4k
diff --git a/mysql-test/suite/encryption/t/import_4k.test b/mysql-test/suite/encryption/t/import_4k.test
new file mode 100644
index 00000000000..aef7c702d12
--- /dev/null
+++ b/mysql-test/suite/encryption/t/import_4k.test
@@ -0,0 +1,20 @@
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+--source include/have_example_key_management_plugin.inc
+--source include/have_debug.inc
+
+set @save_limit = @@GLOBAL.innodb_limit_optimistic_insert_debug;
+set global innodb_limit_optimistic_insert_debug=3;
+create table t1 (a INT PRIMARY KEY) engine=InnoDB ENCRYPTED=YES;
+insert into t1 select * from seq_1_to_6000;
+flush table t1 for export;
+--let $datadir= `select @@datadir`
+--copy_file $datadir/test/t1.ibd $datadir/t1.ibd
+--copy_file $datadir/test/t1.cfg $datadir/t1.cfg
+unlock tables;
+alter table t1 discard tablespace;
+--move_file $datadir/t1.ibd $datadir/test/t1.ibd
+--move_file $datadir/t1.cfg $datadir/test/t1.cfg
+alter table t1 import tablespace;
+set global innodb_limit_optimistic_insert_debug=@save_limit;
+drop table t1;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test
index 2a16d90f9ad..c65cc202ba2 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test
@@ -1 +1 @@
---source suite/rpl/include/rpl_switch_stm_row_mixed.inc
+--source suite/rpl/t/rpl_switch_stm_row_mixed.test
diff --git a/mysql-test/suite/events/disabled.def b/mysql-test/suite/events/disabled.def
new file mode 100644
index 00000000000..d895d7d221e
--- /dev/null
+++ b/mysql-test/suite/events/disabled.def
@@ -0,0 +1,12 @@
+##############################################################################
+#
+# List the test cases that are to be disabled temporarily.
+#
+# Separate the test case name and the comment with ':'.
+#
+# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
+#
+# Do not use any TAB characters for whitespace.
+#
+##############################################################################
+events_time_zone : Test is not predictable as it depends on precise timing.
diff --git a/mysql-test/main/events_1.result b/mysql-test/suite/events/events_1.result
index 2f2a951158c..2f2a951158c 100644
--- a/mysql-test/main/events_1.result
+++ b/mysql-test/suite/events/events_1.result
diff --git a/mysql-test/main/events_1.test b/mysql-test/suite/events/events_1.test
index ba8a2059e2d..ba8a2059e2d 100644
--- a/mysql-test/main/events_1.test
+++ b/mysql-test/suite/events/events_1.test
diff --git a/mysql-test/main/events_2.result b/mysql-test/suite/events/events_2.result
index 1753fa41ad0..1753fa41ad0 100644
--- a/mysql-test/main/events_2.result
+++ b/mysql-test/suite/events/events_2.result
diff --git a/mysql-test/main/events_2.test b/mysql-test/suite/events/events_2.test
index cd0d908b870..cd0d908b870 100644
--- a/mysql-test/main/events_2.test
+++ b/mysql-test/suite/events/events_2.test
diff --git a/mysql-test/main/events_bugs-master.opt b/mysql-test/suite/events/events_bugs-master.opt
index f93413a61e5..f93413a61e5 100644
--- a/mysql-test/main/events_bugs-master.opt
+++ b/mysql-test/suite/events/events_bugs-master.opt
diff --git a/mysql-test/main/events_bugs.result b/mysql-test/suite/events/events_bugs.result
index 0615dac53b1..0615dac53b1 100644
--- a/mysql-test/main/events_bugs.result
+++ b/mysql-test/suite/events/events_bugs.result
diff --git a/mysql-test/main/events_bugs.test b/mysql-test/suite/events/events_bugs.test
index fe744de86c9..fe744de86c9 100644
--- a/mysql-test/main/events_bugs.test
+++ b/mysql-test/suite/events/events_bugs.test
diff --git a/mysql-test/main/events_embedded.result b/mysql-test/suite/events/events_embedded.result
index 1a02188f2df..1a02188f2df 100644
--- a/mysql-test/main/events_embedded.result
+++ b/mysql-test/suite/events/events_embedded.result
diff --git a/mysql-test/main/events_embedded.test b/mysql-test/suite/events/events_embedded.test
index c607573b2dc..c607573b2dc 100644
--- a/mysql-test/main/events_embedded.test
+++ b/mysql-test/suite/events/events_embedded.test
diff --git a/mysql-test/main/events_grant.result b/mysql-test/suite/events/events_grant.result
index 5952097a8d2..5952097a8d2 100644
--- a/mysql-test/main/events_grant.result
+++ b/mysql-test/suite/events/events_grant.result
diff --git a/mysql-test/main/events_grant.test b/mysql-test/suite/events/events_grant.test
index 2fe39a6cf2d..2fe39a6cf2d 100644
--- a/mysql-test/main/events_grant.test
+++ b/mysql-test/suite/events/events_grant.test
diff --git a/mysql-test/main/events_logs_tests-master.opt b/mysql-test/suite/events/events_logs_tests-master.opt
index 73d26b7260d..73d26b7260d 100644
--- a/mysql-test/main/events_logs_tests-master.opt
+++ b/mysql-test/suite/events/events_logs_tests-master.opt
diff --git a/mysql-test/main/events_logs_tests.result b/mysql-test/suite/events/events_logs_tests.result
index d332767a9f1..d332767a9f1 100644
--- a/mysql-test/main/events_logs_tests.result
+++ b/mysql-test/suite/events/events_logs_tests.result
diff --git a/mysql-test/main/events_logs_tests.test b/mysql-test/suite/events/events_logs_tests.test
index f7445352079..f7445352079 100644
--- a/mysql-test/main/events_logs_tests.test
+++ b/mysql-test/suite/events/events_logs_tests.test
diff --git a/mysql-test/main/events_microsec.result b/mysql-test/suite/events/events_microsec.result
index 2a9f3587706..2a9f3587706 100644
--- a/mysql-test/main/events_microsec.result
+++ b/mysql-test/suite/events/events_microsec.result
diff --git a/mysql-test/main/events_microsec.test b/mysql-test/suite/events/events_microsec.test
index 3e9abf6ec56..3e9abf6ec56 100644
--- a/mysql-test/main/events_microsec.test
+++ b/mysql-test/suite/events/events_microsec.test
diff --git a/mysql-test/main/events_restart-master.opt b/mysql-test/suite/events/events_restart-master.opt
index f93413a61e5..f93413a61e5 100644
--- a/mysql-test/main/events_restart-master.opt
+++ b/mysql-test/suite/events/events_restart-master.opt
diff --git a/mysql-test/main/events_restart.result b/mysql-test/suite/events/events_restart.result
index 58401c7be80..58401c7be80 100644
--- a/mysql-test/main/events_restart.result
+++ b/mysql-test/suite/events/events_restart.result
diff --git a/mysql-test/main/events_restart.test b/mysql-test/suite/events/events_restart.test
index 6f7c01d81c2..6f7c01d81c2 100644
--- a/mysql-test/main/events_restart.test
+++ b/mysql-test/suite/events/events_restart.test
diff --git a/mysql-test/main/events_scheduling.result b/mysql-test/suite/events/events_scheduling.result
index 262caea3d7f..262caea3d7f 100644
--- a/mysql-test/main/events_scheduling.result
+++ b/mysql-test/suite/events/events_scheduling.result
diff --git a/mysql-test/main/events_scheduling.test b/mysql-test/suite/events/events_scheduling.test
index 5f16f8bea6a..5f16f8bea6a 100644
--- a/mysql-test/main/events_scheduling.test
+++ b/mysql-test/suite/events/events_scheduling.test
diff --git a/mysql-test/main/events_slowlog.result b/mysql-test/suite/events/events_slowlog.result
index be0a1e78d2a..be0a1e78d2a 100644
--- a/mysql-test/main/events_slowlog.result
+++ b/mysql-test/suite/events/events_slowlog.result
diff --git a/mysql-test/main/events_slowlog.test b/mysql-test/suite/events/events_slowlog.test
index 9679714dba3..9679714dba3 100644
--- a/mysql-test/main/events_slowlog.test
+++ b/mysql-test/suite/events/events_slowlog.test
diff --git a/mysql-test/main/events_stress.result b/mysql-test/suite/events/events_stress.result
index 1a91ff0f528..1a91ff0f528 100644
--- a/mysql-test/main/events_stress.result
+++ b/mysql-test/suite/events/events_stress.result
diff --git a/mysql-test/main/events_stress.test b/mysql-test/suite/events/events_stress.test
index 080707f029f..080707f029f 100644
--- a/mysql-test/main/events_stress.test
+++ b/mysql-test/suite/events/events_stress.test
diff --git a/mysql-test/main/events_time_zone.result b/mysql-test/suite/events/events_time_zone.result
index 155a9d155af..155a9d155af 100644
--- a/mysql-test/main/events_time_zone.result
+++ b/mysql-test/suite/events/events_time_zone.result
diff --git a/mysql-test/main/events_time_zone.test b/mysql-test/suite/events/events_time_zone.test
index 5291eb96e6b..5291eb96e6b 100644
--- a/mysql-test/main/events_time_zone.test
+++ b/mysql-test/suite/events/events_time_zone.test
diff --git a/mysql-test/main/events_trans.result b/mysql-test/suite/events/events_trans.result
index a7b268fe2a7..a7b268fe2a7 100644
--- a/mysql-test/main/events_trans.result
+++ b/mysql-test/suite/events/events_trans.result
diff --git a/mysql-test/main/events_trans.test b/mysql-test/suite/events/events_trans.test
index cc83fa6e578..cc83fa6e578 100644
--- a/mysql-test/main/events_trans.test
+++ b/mysql-test/suite/events/events_trans.test
diff --git a/mysql-test/main/events_trans_notembedded.result b/mysql-test/suite/events/events_trans_notembedded.result
index 324e28ddb62..324e28ddb62 100644
--- a/mysql-test/main/events_trans_notembedded.result
+++ b/mysql-test/suite/events/events_trans_notembedded.result
diff --git a/mysql-test/main/events_trans_notembedded.test b/mysql-test/suite/events/events_trans_notembedded.test
index 3cf823bf713..3cf823bf713 100644
--- a/mysql-test/main/events_trans_notembedded.test
+++ b/mysql-test/suite/events/events_trans_notembedded.test
diff --git a/mysql-test/suite/galera/galera_2x2nodes.cnf b/mysql-test/suite/galera/galera_2x2nodes.cnf
new file mode 100644
index 00000000000..922906eac6f
--- /dev/null
+++ b/mysql-test/suite/galera/galera_2x2nodes.cnf
@@ -0,0 +1,77 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+loose-innodb
+log-bin=mysqld-bin
+log-slave-updates
+binlog-format=row
+innodb-autoinc-lock-mode=2
+default-storage-engine=innodb
+wsrep_gtid_mode=1
+gtid_ignore_duplicates
+auto_increment_increment=3
+
+wsrep-provider=@ENV.WSREP_PROVIDER
+# enforce read-committed characteristics across the cluster
+# wsrep-causal-reads=ON
+wsrep-sync-wait=15
+
+[mysqld.1]
+wsrep-on=1
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address=gcomm://
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M'
+wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port'
+wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
+
+[mysqld.2]
+wsrep-on=1
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M'
+wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port'
+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
+
+[mysqld.3]
+wsrep-on=1
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address=gcomm://
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M'
+wsrep_node_address='127.0.0.1:@mysqld.3.#galera_port'
+wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
+
+[mysqld.4]
+wsrep-on=1
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.3.#galera_port'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M'
+wsrep_node_address='127.0.0.1:@mysqld.4.#galera_port'
+wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.4.#sst_port'
+
+[ENV]
+NODE_MYPORT_1= @mysqld.1.port
+NODE_MYSOCK_1= @mysqld.1.socket
+
+NODE_MYPORT_2= @mysqld.2.port
+NODE_MYSOCK_2= @mysqld.2.socket
+
+NODE_MYPORT_3= @mysqld.3.port
+NODE_MYSOCK_3= @mysqld.3.socket
+
+NODE_MYPORT_4= @mysqld.4.port
+NODE_MYSOCK_4= @mysqld.4.socket
+
+
diff --git a/mysql-test/suite/galera/include/kill_galera.inc b/mysql-test/suite/galera/include/kill_galera.inc
index 56118df84f9..28a1b0f368c 100644
--- a/mysql-test/suite/galera/include/kill_galera.inc
+++ b/mysql-test/suite/galera/include/kill_galera.inc
@@ -6,8 +6,8 @@ if (!$kill_signal)
}
# Write file to make mysql-test-run.pl expect the crash, but don't start it
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name
# Kill the connected server
diff --git a/mysql-test/suite/galera/include/shutdown_mysqld.inc b/mysql-test/suite/galera/include/shutdown_mysqld.inc
index 54bba1318e7..793be8d76ac 100644
--- a/mysql-test/suite/galera/include/shutdown_mysqld.inc
+++ b/mysql-test/suite/galera/include/shutdown_mysqld.inc
@@ -8,8 +8,8 @@ if ($rpl_inited)
}
# Write file to make mysql-test-run.pl expect the "crash", but don't start it
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name
# Send shutdown to the connected server
diff --git a/mysql-test/suite/galera/r/MDEV-30804.result b/mysql-test/suite/galera/r/MDEV-30804.result
new file mode 100644
index 00000000000..2bf323d19f8
--- /dev/null
+++ b/mysql-test/suite/galera/r/MDEV-30804.result
@@ -0,0 +1,11 @@
+connection node_2;
+connection node_1;
+CREATE TABLE t (a INT) ENGINE=Aria;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+START TRANSACTION;
+INSERT INTO t VALUES ('1');
+INSERT INTO t1 VALUES ('1');
+COMMIT;
+ERROR HY000: Transactional commit not supported by involved engine(s)
+DROP TABLE t;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/MDEV-30955.result b/mysql-test/suite/galera/r/MDEV-30955.result
new file mode 100644
index 00000000000..2a090cb58bc
--- /dev/null
+++ b/mysql-test/suite/galera/r/MDEV-30955.result
@@ -0,0 +1,26 @@
+connection node_2;
+connection node_1;
+CREATE TABLE t (a CHAR(1) KEY);
+START TRANSACTION;
+HANDLER t OPEN;
+disconnect node_1;
+connect node_1, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+DROP TABLE t;
+BACKUP STAGE START;
+START TRANSACTION;
+disconnect node_1;
+connect node_1, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+connection node_1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY);
+START TRANSACTION;
+INSERT INTO t1 VALUES(1);
+HANDLER t2 OPEN;
+connection node_2;
+INSERT INTO t1 VALUES(1);
+connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+connection node_1a;
+connection node_1;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP TABLE t1,t2;
diff --git a/mysql-test/suite/galera/r/galera_query_cache_invalidate.result b/mysql-test/suite/galera/r/galera_query_cache_invalidate.result
new file mode 100644
index 00000000000..98438b3b527
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_query_cache_invalidate.result
@@ -0,0 +1,119 @@
+connection node_2;
+connection node_1;
+connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
+connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4;
+connection node_2;
+call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node.");
+connection node_4;
+call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node.");
+connection node_3;
+CHANGE MASTER TO master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_1, master_use_gtid=current_pos;;
+START SLAVE;
+include/wait_for_slave_to_start.inc
+connection node_1;
+CREATE TABLE t1 (id bigint primary key, msg varchar(100)) engine=innodb;
+SET AUTOCOMMIT=1;
+INSERT INTO t1 VALUES (4000000, 'foobar');
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+50001
+connection node_3;
+connection node_1;
+# node_1
+SELECT * FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+SELECT * FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+connection node_2;
+# node_2
+SELECT * FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+SELECT * FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+connection node_3;
+# node_3
+SELECT * FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+SELECT * FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+connection node_4;
+# node_4
+SELECT * FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+SELECT * FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+connection node_1;
+# node_1 insert new
+INSERT INTO t1 values (5000000, 'foobar');
+connection node_3;
+SELECT * FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+5000000 foobar
+SELECT * FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+5000000 foobar
+connection node_2;
+# node_2
+SELECT * FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+5000000 foobar
+SELECT * FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+5000000 foobar
+connection node_3;
+# node_3
+SELECT * FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+5000000 foobar
+SELECT * FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+5000000 foobar
+connection node_4;
+# node_4
+SELECT * FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+5000000 foobar
+SELECT * FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+5000000 foobar
+connection node_2;
+# node_3 different query same table
+SELECT id, msg FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+5000000 foobar
+connection node_4;
+# node_6 different query same table
+SELECT id, msg FROM t1 WHERE msg='foobar';
+id msg
+4000000 foobar
+5000000 foobar
+connection node_1;
+drop table t1;
+connection node_3;
+connection node_3;
+STOP SLAVE;
+RESET SLAVE ALL;
+connection node_1;
+SET SESSION WSREP_ON=OFF;
+RESET MASTER;
+SET SESSION WSREP_ON=ON;
+disconnect node_2;
+disconnect node_1;
+# End of test
diff --git a/mysql-test/suite/galera/r/galera_sequences.result b/mysql-test/suite/galera/r/galera_sequences.result
index 7276cb8dbde..da669e6774e 100644
--- a/mysql-test/suite/galera/r/galera_sequences.result
+++ b/mysql-test/suite/galera/r/galera_sequences.result
@@ -1,6 +1,11 @@
connection node_2;
connection node_1;
connection node_1;
+CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster.");
+CALL mtr.add_suppression("WSREP: CREATE TABLE isolation failure");
+connection node_2;
+CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster.");
+connection node_1;
CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 1000000 increment by 0 cache 1000 nocycle ENGINE=InnoDB;
SHOW CREATE SEQUENCE seq;
Table Create Table
@@ -47,6 +52,58 @@ NEXT VALUE FOR Seq1_1
3001
connection node_1;
DROP SEQUENCE Seq1_1;
-CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster.");
+connection node_1;
+CREATE TABLE t2 (d CHAR(1)KEY);
+SET SESSION autocommit=0;
+INSERT INTO t2 VALUES(1);
+CREATE TEMPORARY SEQUENCE seq1 NOCACHE ENGINE=INNODB;
+CREATE SEQUENCE seq2 NOCACHE ENGINE=INNODB;
+COMMIT;
+SET SESSION AUTOCOMMIT=1;
+SHOW CREATE TABLE seq1;
+Table Create Table
+seq1 CREATE TEMPORARY TABLE `seq1` (
+ `next_not_cached_value` bigint(21) NOT NULL,
+ `minimum_value` bigint(21) NOT NULL,
+ `maximum_value` bigint(21) NOT NULL,
+ `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
+ `increment` bigint(21) NOT NULL COMMENT 'increment value',
+ `cache_size` bigint(21) unsigned NOT NULL,
+ `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
+ `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
+) ENGINE=InnoDB SEQUENCE=1
connection node_2;
-CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster.");
+SHOW CREATE SEQUENCE seq1;
+ERROR 42S02: Table 'test.seq1' doesn't exist
+SHOW CREATE SEQUENCE seq2;
+Table Create Table
+seq2 CREATE SEQUENCE `seq2` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=InnoDB
+connection node_1;
+SET SESSION autocommit=1;
+DROP SEQUENCE seq1;
+DROP SEQUENCE seq2;
+DROP TABLE t2;
+SET SESSION AUTOCOMMIT=0;
+SET SESSION wsrep_OSU_method='RSU';
+CREATE TABLE t1(c1 VARCHAR(10));
+INSERT INTO t1 (c1) VALUES('');
+create temporary sequence sq1 NOCACHE engine=innodb;
+create sequence sq2 NOCACHE engine=innodb;
+COMMIT;
+SHOW CREATE SEQUENCE sq1;
+Table Create Table
+sq1 CREATE SEQUENCE `sq1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=InnoDB
+SHOW CREATE SEQUENCE sq2;
+Table Create Table
+sq2 CREATE SEQUENCE `sq2` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=InnoDB
+connection node_2;
+SHOW CREATE SEQUENCE sq1;
+ERROR 42S02: Table 'test.sq1' doesn't exist
+SHOW CREATE SEQUENCE sq2;
+ERROR 42S02: Table 'test.sq2' doesn't exist
+connection node_1;
+SET SESSION AUTOCOMMIT=1;
+DROP TABLE t1;
+DROP SEQUENCE sq1;
+DROP SEQUENCE sq2;
+SET SESSION wsrep_OSU_method='TOI';
diff --git a/mysql-test/suite/galera/r/galera_var_replicate_aria_on.result b/mysql-test/suite/galera/r/galera_var_replicate_aria_on.result
index 39fd748314c..91c07ba6681 100644
--- a/mysql-test/suite/galera/r/galera_var_replicate_aria_on.result
+++ b/mysql-test/suite/galera/r/galera_var_replicate_aria_on.result
@@ -89,11 +89,8 @@ connection node_1;
SET GLOBAL wsrep_sync_wait=15;
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=Aria;
CREATE TABLE t2 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
-SET AUTOCOMMIT=OFF;
-START TRANSACTION;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
-COMMIT;
connection node_2;
SET GLOBAL wsrep_sync_wait=15;
SELECT COUNT(*) AS EXPECT_1 FROM t1;
@@ -103,6 +100,7 @@ SELECT COUNT(*) AS EXPECT_1 FROM t2;
EXPECT_1
1
connection node_1;
+SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES (2);
INSERT INTO t2 VALUES (2);
@@ -129,6 +127,7 @@ INSERT INTO t1 VALUES (1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
connection node_1;
COMMIT;
+ERROR HY000: Transactional commit not supported by involved engine(s)
DROP TABLE t1,t2;
connection node_1;
CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY) ENGINE=INNODB;
diff --git a/mysql-test/suite/galera/r/galera_var_retry_autocommit.result b/mysql-test/suite/galera/r/galera_var_retry_autocommit.result
index 56c2c995402..50667b0a4fa 100644
--- a/mysql-test/suite/galera/r/galera_var_retry_autocommit.result
+++ b/mysql-test/suite/galera/r/galera_var_retry_autocommit.result
@@ -20,17 +20,25 @@ DROP TABLE t1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
SET SESSION wsrep_retry_autocommit = 1;
+SET GLOBAL debug_dbug = '+d,sync.wsrep_retry_autocommit';
SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continue';
INSERT INTO t1 (f1) VALUES (3);
connection node_1a;
SET DEBUG_SYNC = 'now WAIT_FOR before_cert';
connection node_2;
TRUNCATE TABLE t1;
-connection node_1;
+connection node_1a;
+SET DEBUG_SYNC = 'now WAIT_FOR wsrep_retry_autocommit_reached';
SELECT COUNT(*) FROM t1;
COUNT(*)
0
+SET DEBUG_SYNC = 'now SIGNAL wsrep_retry_autocommit_continue';
+connection node_1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
SET DEBUG_SYNC = 'RESET';
+SET GLOBAL debug_dbug = NULL;
DROP TABLE t1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
@@ -64,6 +72,8 @@ SET SESSION wsrep_retry_autocommit = 64;
SET GLOBAL debug_dbug = '+d,sync.wsrep_retry_autocommit';
SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continue EXECUTE 64';
INSERT INTO t1 VALUES (5);
+connection node_2;
+connection node_1;
connection node_1;
SELECT COUNT(*) FROM t1;
COUNT(*)
diff --git a/mysql-test/suite/galera/r/mdev-26175.result b/mysql-test/suite/galera/r/mdev-26175.result
new file mode 100644
index 00000000000..f84244fe916
--- /dev/null
+++ b/mysql-test/suite/galera/r/mdev-26175.result
@@ -0,0 +1,24 @@
+connection node_2;
+connection node_1;
+connection node_1;
+SET sql_mode="no_zero_date";
+SET GLOBAL wsrep_max_ws_rows=1;
+CREATE TABLE t2 (a INT);
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
+CREATE TRIGGER tgr BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (0);
+INSERT INTO t1 VALUES (0),(1);
+ERROR HY000: wsrep_max_ws_rows exceeded
+SELECT * FROM t1;
+a
+SELECT * FROM t2;
+a
+connection node_2;
+SELECT * FROM t1;
+a
+SELECT * FROM t2;
+a
+connection node_1;
+SET sql_mode=DEFAULT;
+SET GLOBAL wsrep_max_ws_rows=DEFAULT;
+DROP TRIGGER tgr;
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/galera/t/MDEV-30804.cnf b/mysql-test/suite/galera/t/MDEV-30804.cnf
new file mode 100644
index 00000000000..9dbd81f758d
--- /dev/null
+++ b/mysql-test/suite/galera/t/MDEV-30804.cnf
@@ -0,0 +1,7 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+log-bin
+
+[mysqld.2]
+log-bin
diff --git a/mysql-test/suite/galera/t/MDEV-30804.test b/mysql-test/suite/galera/t/MDEV-30804.test
new file mode 100644
index 00000000000..561953a0578
--- /dev/null
+++ b/mysql-test/suite/galera/t/MDEV-30804.test
@@ -0,0 +1,21 @@
+#
+# Test that transaction requiring two-phase commit and involving
+# storage engines not supporting it rolls back with a message.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_aria.inc
+
+CREATE TABLE t (a INT) ENGINE=Aria;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+
+START TRANSACTION;
+INSERT INTO t VALUES ('1');
+INSERT INTO t1 VALUES ('1');
+
+--error ER_ERROR_DURING_COMMIT
+COMMIT;
+
+DROP TABLE t;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/MDEV-30955.test b/mysql-test/suite/galera/t/MDEV-30955.test
new file mode 100644
index 00000000000..18577120e83
--- /dev/null
+++ b/mysql-test/suite/galera/t/MDEV-30955.test
@@ -0,0 +1,70 @@
+#
+# MDEV-30955
+# Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE,
+# table->s->db.str, table->s->table_name.str, MDL_SHARED)'
+# failed in close_thread_table()
+#
+
+--source include/galera_cluster.inc
+
+#
+# Test 1: Assertion thd->mdl_context.is_lock_owner()
+# failed in close_thread_table()
+#
+CREATE TABLE t (a CHAR(1) KEY);
+START TRANSACTION;
+HANDLER t OPEN;
+
+#
+# If bug is present the transaction will be aborted
+# through Wsrep_client_service::bf_rollback() and
+# release explicit locks too early. Later, during
+# THD::cleanup(), table t will be closed and the
+# THD is expected to be owner of the MDL lock that
+# was just released.
+#
+--disconnect node_1
+
+--connect node_1, 127.0.0.1, root, , test, $NODE_MYPORT_1
+DROP TABLE t;
+
+
+#
+# Test 2: Similar issue reproduces also with BACKUP STAGE locks.
+# See comments in MDEV-25037
+#
+
+BACKUP STAGE START;
+START TRANSACTION;
+--disconnect node_1
+--connect node_1, 127.0.0.1, root, , test, $NODE_MYPORT_1
+
+
+#
+# Test 3: Assertion `!thd->mdl_context.has_locks()' failed
+# in do_command()
+#
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY);
+
+--let $bf_count = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.global_status WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
+
+START TRANSACTION;
+INSERT INTO t1 VALUES(1);
+HANDLER t2 OPEN;
+
+--connection node_2
+INSERT INTO t1 VALUES(1);
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+--let $wait_condition = SELECT VARIABLE_VALUE = $bf_count + 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'
+--source include/wait_condition.inc
+
+--connection node_1
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+DROP TABLE t1,t2;
diff --git a/mysql-test/suite/galera/t/galera_ist_restart_joiner.test b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test
index c535ac455b9..b36a0de57b6 100644
--- a/mysql-test/suite/galera/t/galera_ist_restart_joiner.test
+++ b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test
@@ -35,8 +35,8 @@ UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
--connection node_2
# Write file to make mysql-test-run.pl expect the crash, but don't start it
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name
--let KILL_NODE_PIDFILE = `SELECT @@pid_file`
diff --git a/mysql-test/suite/galera/t/galera_query_cache_invalidate.cnf b/mysql-test/suite/galera/t/galera_query_cache_invalidate.cnf
new file mode 100644
index 00000000000..49269422a35
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_query_cache_invalidate.cnf
@@ -0,0 +1,25 @@
+!include ../galera_2x2nodes.cnf
+
+[mysqld.1]
+wsrep_gtid_domain_id=1
+server-id=11
+query_cache_type=1
+query_cache_size=15M
+
+[mysqld.2]
+wsrep_gtid_domain_id=1
+server-id=12
+query_cache_type=1
+query_cache_size=15M
+
+[mysqld.3]
+wsrep_gtid_domain_id=2
+server-id=13
+query_cache_type=1
+query_cache_size=15M
+
+[mysqld.4]
+wsrep_gtid_domain_id=2
+server-id=21
+query_cache_type=1
+query_cache_size=15M
diff --git a/mysql-test/suite/galera/t/galera_query_cache_invalidate.test b/mysql-test/suite/galera/t/galera_query_cache_invalidate.test
new file mode 100644
index 00000000000..d72d8a9ba40
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_query_cache_invalidate.test
@@ -0,0 +1,120 @@
+--source include/big_test.inc
+--source include/force_restart.inc
+--source include/galera_cluster.inc
+--source include/have_sequence.inc
+
+#
+# MDEV-28641 : Query cache entries not invalidated on slave of a Galera cluster
+#
+# We use two 2-node galera clusters as follows
+#
+# A(1) <-> B(2) {Galera cluster 1}
+# | {Async replication}
+# D(3) <-> E(4) {Galera cluster 2}
+#
+# Normal asyncronous replication is used between nodes 1 and 3
+# so that node_1 is master and node_3 a slave.
+#
+# In this test we can't test is some query fast or slow but we can
+# test does all nodes see all rows (this is not true before fix)
+#
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
+
+--connection node_2
+call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node.");
+--connection node_4
+call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node.");
+
+--connection node_3
+
+--replace_result $NODE_MYPORT_1 NODE_MYPORT_1
+--eval CHANGE MASTER TO master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_1, master_use_gtid=current_pos;
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+
+--connection node_1
+
+CREATE TABLE t1 (id bigint primary key, msg varchar(100)) engine=innodb;
+--disable_query_log
+INSERT INTO t1 SELECT seq, md5(rand()) from seq_1_to_50000;
+COMMIT;
+--enable_query_log
+SET AUTOCOMMIT=1;
+INSERT INTO t1 VALUES (4000000, 'foobar');
+SELECT COUNT(*) FROM t1;
+--sync_slave_with_master node_3
+
+#
+# All nodes should see one row and first query is slow and second fast
+#
+--connection node_1
+--echo # node_1
+SELECT * FROM t1 WHERE msg='foobar';
+SELECT * FROM t1 WHERE msg='foobar';
+--connection node_2
+--echo # node_2
+SELECT * FROM t1 WHERE msg='foobar';
+SELECT * FROM t1 WHERE msg='foobar';
+--connection node_3
+--echo # node_3
+SELECT * FROM t1 WHERE msg='foobar';
+SELECT * FROM t1 WHERE msg='foobar';
+--connection node_4
+--echo # node_4
+SELECT * FROM t1 WHERE msg='foobar';
+SELECT * FROM t1 WHERE msg='foobar';
+#
+# Insert a new row in master, this should cause query cache
+# invalidation
+#
+--connection node_1
+--echo # node_1 insert new
+INSERT INTO t1 values (5000000, 'foobar');
+--sync_slave_with_master node_3
+
+#
+# All nodes should see 2 rows
+#
+SELECT * FROM t1 WHERE msg='foobar';
+SELECT * FROM t1 WHERE msg='foobar';
+
+--connection node_2
+--echo # node_2
+SELECT * FROM t1 WHERE msg='foobar';
+SELECT * FROM t1 WHERE msg='foobar';
+--connection node_3
+--echo # node_3
+SELECT * FROM t1 WHERE msg='foobar';
+SELECT * FROM t1 WHERE msg='foobar';
+--connection node_4
+--echo # node_4
+SELECT * FROM t1 WHERE msg='foobar';
+SELECT * FROM t1 WHERE msg='foobar';
+
+--connection node_2
+--echo # node_3 different query same table
+SELECT id, msg FROM t1 WHERE msg='foobar';
+
+--connection node_4
+--echo # node_6 different query same table
+SELECT id, msg FROM t1 WHERE msg='foobar';
+
+#
+# Cleanup
+#
+--connection node_1
+drop table t1;
+--sync_slave_with_master node_3
+
+--connection node_3
+STOP SLAVE;
+RESET SLAVE ALL;
+
+--connection node_1
+SET SESSION WSREP_ON=OFF;
+RESET MASTER;
+SET SESSION WSREP_ON=ON;
+
+--source include/galera_end.inc
+--echo # End of test
diff --git a/mysql-test/suite/galera/t/galera_sequences.cnf b/mysql-test/suite/galera/t/galera_sequences.cnf
new file mode 100644
index 00000000000..98e724fb2d0
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sequences.cnf
@@ -0,0 +1,9 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+log-bin
+log-slave-updates
+
+[mysqld.2]
+log-bin
+log-slave-updates
diff --git a/mysql-test/suite/galera/t/galera_sequences.test b/mysql-test/suite/galera/t/galera_sequences.test
index d469cc73516..613823d83e9 100644
--- a/mysql-test/suite/galera/t/galera_sequences.test
+++ b/mysql-test/suite/galera/t/galera_sequences.test
@@ -1,10 +1,18 @@
--source include/galera_cluster.inc
+--source include/have_innodb.inc
#
# MDEV-19353 : Alter Sequence do not replicate to another nodes with in Galera Cluster
#
--connection node_1
+CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster.");
+CALL mtr.add_suppression("WSREP: CREATE TABLE isolation failure");
+--connection node_2
+
+CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster.");
+
+--connection node_1
CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 1000000 increment by 0 cache 1000 nocycle ENGINE=InnoDB;
SHOW CREATE SEQUENCE seq;
@@ -45,8 +53,48 @@ select NEXT VALUE FOR Seq1_1;
--connection node_1
DROP SEQUENCE Seq1_1;
-CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster.");
+#
+# MDEV-24045 : Assertion client_state_.mode() != wsrep::client_state::m_toi failed in int wsrep::transaction::before_commit()
+#
+--connection node_1
+CREATE TABLE t2 (d CHAR(1)KEY);
+SET SESSION autocommit=0;
+INSERT INTO t2 VALUES(1);
+CREATE TEMPORARY SEQUENCE seq1 NOCACHE ENGINE=INNODB;
+CREATE SEQUENCE seq2 NOCACHE ENGINE=INNODB;
+COMMIT;
+SET SESSION AUTOCOMMIT=1;
+SHOW CREATE TABLE seq1;
--connection node_2
-
-CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster.");
+--error ER_NO_SUCH_TABLE
+SHOW CREATE SEQUENCE seq1;
+SHOW CREATE SEQUENCE seq2;
+--connection node_1
+SET SESSION autocommit=1;
+DROP SEQUENCE seq1;
+DROP SEQUENCE seq2;
+DROP TABLE t2;
+#
+# Case2
+#
+SET SESSION AUTOCOMMIT=0;
+SET SESSION wsrep_OSU_method='RSU';
+CREATE TABLE t1(c1 VARCHAR(10));
+INSERT INTO t1 (c1) VALUES('');
+create temporary sequence sq1 NOCACHE engine=innodb;
+create sequence sq2 NOCACHE engine=innodb;
+COMMIT;
+SHOW CREATE SEQUENCE sq1;
+SHOW CREATE SEQUENCE sq2;
+--connection node_2
+--error ER_NO_SUCH_TABLE
+SHOW CREATE SEQUENCE sq1;
+--error ER_NO_SUCH_TABLE
+SHOW CREATE SEQUENCE sq2;
+--connection node_1
+SET SESSION AUTOCOMMIT=1;
+DROP TABLE t1;
+DROP SEQUENCE sq1;
+DROP SEQUENCE sq2;
+SET SESSION wsrep_OSU_method='TOI';
diff --git a/mysql-test/suite/galera/t/galera_var_replicate_aria_on.test b/mysql-test/suite/galera/t/galera_var_replicate_aria_on.test
index c3bc53ee17f..ac9a79e6196 100644
--- a/mysql-test/suite/galera/t/galera_var_replicate_aria_on.test
+++ b/mysql-test/suite/galera/t/galera_var_replicate_aria_on.test
@@ -85,18 +85,15 @@ SELECT * FROM t1;
DROP TABLE t1;
#
-# Transaction
+# Preparation for next tests
#
--connection node_1
SET GLOBAL wsrep_sync_wait=15;
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=Aria;
CREATE TABLE t2 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
-SET AUTOCOMMIT=OFF;
-START TRANSACTION;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
-COMMIT;
--connection node_2
SET GLOBAL wsrep_sync_wait=15;
@@ -108,6 +105,7 @@ SELECT COUNT(*) AS EXPECT_1 FROM t2;
#
--connection node_1
+SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES (2);
INSERT INTO t2 VALUES (2);
@@ -138,6 +136,8 @@ INSERT INTO t2 VALUES (1);
INSERT INTO t1 VALUES (1);
--connection node_1
+
+--error ER_ERROR_DURING_COMMIT
COMMIT;
DROP TABLE t1,t2;
diff --git a/mysql-test/suite/galera/t/galera_var_retry_autocommit.test b/mysql-test/suite/galera/t/galera_var_retry_autocommit.test
index bd10e448e06..c58eba1410e 100644
--- a/mysql-test/suite/galera/t/galera_var_retry_autocommit.test
+++ b/mysql-test/suite/galera/t/galera_var_retry_autocommit.test
@@ -25,6 +25,8 @@ SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continu
SET DEBUG_SYNC = 'now WAIT_FOR before_cert';
--connection node_2
+--let $wait_condition = SELECT count(*)=1 FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'
+--source include/wait_condition.inc
TRUNCATE TABLE t1;
--connection node_1
@@ -44,6 +46,7 @@ DROP TABLE t1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
SET SESSION wsrep_retry_autocommit = 1;
+SET GLOBAL debug_dbug = '+d,sync.wsrep_retry_autocommit';
SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continue';
--send INSERT INTO t1 (f1) VALUES (3)
@@ -51,14 +54,21 @@ SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continu
SET DEBUG_SYNC = 'now WAIT_FOR before_cert';
--connection node_2
+--let $wait_condition = SELECT count(*)=1 FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'
+--source include/wait_condition.inc
TRUNCATE TABLE t1;
+--connection node_1a
+SET DEBUG_SYNC = 'now WAIT_FOR wsrep_retry_autocommit_reached';
+SELECT COUNT(*) FROM t1;
+SET DEBUG_SYNC = 'now SIGNAL wsrep_retry_autocommit_continue';
+
--connection node_1
---error 0,ER_LOCK_DEADLOCK
--reap
SELECT COUNT(*) FROM t1;
SET DEBUG_SYNC = 'RESET';
+SET GLOBAL debug_dbug = NULL;
DROP TABLE t1;
@@ -79,6 +89,8 @@ SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continu
SET DEBUG_SYNC = 'now WAIT_FOR before_cert';
--connection node_2
+--let $wait_condition = SELECT count(*)=1 FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'
+--source include/wait_condition.inc
TRUNCATE TABLE t1;
--connection node_1a
@@ -114,6 +126,11 @@ SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continu
--send INSERT INTO t1 VALUES (5)
+--connection node_2
+--let $wait_condition = SELECT count(*)=1 FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'
+--source include/wait_condition.inc
+
+--connection node_1
--disable_query_log
--disable_result_log
--let $count = 64
diff --git a/mysql-test/suite/galera/t/mdev-26175.test b/mysql-test/suite/galera/t/mdev-26175.test
new file mode 100644
index 00000000000..1a3f1153e03
--- /dev/null
+++ b/mysql-test/suite/galera/t/mdev-26175.test
@@ -0,0 +1,27 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# MDEV-26175 : Assertion `! thd->in_sub_stmt' failed in bool trans_rollback_stmt(THD*)
+#
+--connection node_1
+SET sql_mode="no_zero_date";
+SET GLOBAL wsrep_max_ws_rows=1;
+CREATE TABLE t2 (a INT);
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
+CREATE TRIGGER tgr BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (0);
+
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 VALUES (0),(1);
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+--connection node_2
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+--connection node_1
+SET sql_mode=DEFAULT;
+SET GLOBAL wsrep_max_ws_rows=DEFAULT;
+DROP TRIGGER tgr;
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf b/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf
index 9f99adbd711..cd7a892f4c9 100644
--- a/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf
+++ b/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf
@@ -55,7 +55,7 @@ wsrep-on=1
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
-wsrep_cluster_address='gcomm://
+wsrep_cluster_address=gcomm://
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M'
wsrep_node_address='127.0.0.1:@mysqld.4.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port
diff --git a/mysql-test/suite/galera_3nodes_sr/t/GCF-832.test b/mysql-test/suite/galera_3nodes_sr/t/GCF-832.test
index eb7f5603452..ab8b62b969a 100644
--- a/mysql-test/suite/galera_3nodes_sr/t/GCF-832.test
+++ b/mysql-test/suite/galera_3nodes_sr/t/GCF-832.test
@@ -15,8 +15,8 @@
--connection node_2
SET GLOBAL debug_dbug="d,crash_last_fragment_commit_after_fragment_removal";
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name
CREATE TABLE t1 (f1 VARCHAR(30)) ENGINE=InnoDB;
diff --git a/mysql-test/suite/galera_sr/r/MDEV-30838.result b/mysql-test/suite/galera_sr/r/MDEV-30838.result
new file mode 100644
index 00000000000..6997b9c4d5d
--- /dev/null
+++ b/mysql-test/suite/galera_sr/r/MDEV-30838.result
@@ -0,0 +1,15 @@
+connection node_2;
+connection node_1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+SET SESSION wsrep_trx_fragment_size=1;
+START TRANSACTION;
+INSERT INTO t1 VALUES(1);
+SET debug_dbug='+d,ib_create_table_fail_too_many_trx';
+INSERT INTO t1 VALUES(2);
+ERROR HY000: Error while appending streaming replication fragment
+COMMIT;
+SELECT * FROM t1;
+f1
+SET debug_dbug='-d,ib_create_table_fail_too_many_trx';
+DROP TABLE t1;
+CALL mtr.add_suppression("Error writing into mysql.wsrep_streaming_log: 177");
diff --git a/mysql-test/suite/galera_sr/r/MDEV-30862.result b/mysql-test/suite/galera_sr/r/MDEV-30862.result
new file mode 100644
index 00000000000..43da77f24df
--- /dev/null
+++ b/mysql-test/suite/galera_sr/r/MDEV-30862.result
@@ -0,0 +1,11 @@
+connection node_2;
+connection node_1;
+SET autocommit=0;
+SET SESSION wsrep_trx_fragment_size=1;
+CREATE TABLE t2 SELECT seq FROM seq_1_to_50;
+ERROR 42000: CREATE TABLE AS SELECT is not supported with streaming replication
+CREATE TABLE t1 (f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
+INSERT INTO t1 VALUES(DEFAULT);
+CREATE TABLE t2 SELECT * FROM t1;
+ERROR 42000: CREATE TABLE AS SELECT is not supported with streaming replication
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera_sr/t/MDEV-30838.test b/mysql-test/suite/galera_sr/t/MDEV-30838.test
new file mode 100644
index 00000000000..39ca7d2a375
--- /dev/null
+++ b/mysql-test/suite/galera_sr/t/MDEV-30838.test
@@ -0,0 +1,18 @@
+#
+# MDEV-30838 - Assertion `m_thd == _current_thd()' failed in
+# virtual int Wsrep_client_service::bf_rollback()
+#
+--source include/galera_cluster.inc
+--source include/have_debug_sync.inc
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+SET SESSION wsrep_trx_fragment_size=1;
+START TRANSACTION;
+INSERT INTO t1 VALUES(1);
+SET debug_dbug='+d,ib_create_table_fail_too_many_trx';
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 VALUES(2);
+COMMIT;
+SELECT * FROM t1;
+SET debug_dbug='-d,ib_create_table_fail_too_many_trx';
+DROP TABLE t1;
+CALL mtr.add_suppression("Error writing into mysql.wsrep_streaming_log: 177");
diff --git a/mysql-test/suite/galera_sr/t/MDEV-30862.test b/mysql-test/suite/galera_sr/t/MDEV-30862.test
new file mode 100644
index 00000000000..6be77b4d71b
--- /dev/null
+++ b/mysql-test/suite/galera_sr/t/MDEV-30862.test
@@ -0,0 +1,24 @@
+#
+# MDEV-30862 Assertion `mode_ == m_high_priority' failed in
+# void wsrep::client_state::after_applying()
+#
+
+--source include/galera_cluster.inc
+--source include/have_sequence.inc
+
+SET autocommit=0;
+SET SESSION wsrep_trx_fragment_size=1;
+--error ER_NOT_ALLOWED_COMMAND
+CREATE TABLE t2 SELECT seq FROM seq_1_to_50;
+
+
+#
+# Same test without using seq
+#
+CREATE TABLE t1 (f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
+INSERT INTO t1 VALUES(DEFAULT);
+--error ER_NOT_ALLOWED_COMMAND
+CREATE TABLE t2 SELECT * FROM t1;
+
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/gcol/r/gcol_rollback.result b/mysql-test/suite/gcol/r/gcol_rollback.result
index 5ee94d3ef44..0bbf034122b 100644
--- a/mysql-test/suite/gcol/r/gcol_rollback.result
+++ b/mysql-test/suite/gcol/r/gcol_rollback.result
@@ -79,10 +79,29 @@ a b c d
ROLLBACK;
SET DEBUG_SYNC = 'now SIGNAL dml_done';
connection con1;
-disconnect con1;
connection default;
SELECT * FROM t;
a b d
9 10 29
DROP TABLE t;
SET DEBUG_SYNC = 'RESET';
+#
+# MDEV-30597 Assertion `flag == 1' failed in
+# row_build_index_entry_low
+#
+CREATE TABLE t1 (
+col1 INT PRIMARY KEY, col_text TEXT,
+col_text_g TEXT GENERATED ALWAYS AS (SUBSTR(col_text,1,499))
+) ENGINE = InnoDB ROW_FORMAT = Compact;
+connection con1;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection default;
+INSERT INTO t1 (col1) VALUES (1) ;
+DELETE FROM t1 WHERE col1 = 1;
+ALTER TABLE t1 ADD UNIQUE INDEX (col_text_g(9));
+BEGIN;
+INSERT INTO t1 (col1) VALUES (1);
+ROLLBACK;
+disconnect con1;
+DROP TABLE t1;
+# End of 10.4 tests
diff --git a/mysql-test/suite/gcol/t/gcol_rollback.test b/mysql-test/suite/gcol/t/gcol_rollback.test
index ba88dda45d7..888e6be861e 100644
--- a/mysql-test/suite/gcol/t/gcol_rollback.test
+++ b/mysql-test/suite/gcol/t/gcol_rollback.test
@@ -103,7 +103,6 @@ SET DEBUG_SYNC = 'now SIGNAL dml_done';
connection con1;
reap;
-disconnect con1;
connection default;
SELECT * FROM t;
@@ -111,5 +110,27 @@ SELECT * FROM t;
DROP TABLE t;
SET DEBUG_SYNC = 'RESET';
+--echo #
+--echo # MDEV-30597 Assertion `flag == 1' failed in
+--echo # row_build_index_entry_low
+--echo #
+CREATE TABLE t1 (
+col1 INT PRIMARY KEY, col_text TEXT,
+col_text_g TEXT GENERATED ALWAYS AS (SUBSTR(col_text,1,499))
+) ENGINE = InnoDB ROW_FORMAT = Compact;
+connection con1;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection default;
+INSERT INTO t1 (col1) VALUES (1) ;
+DELETE FROM t1 WHERE col1 = 1;
+ALTER TABLE t1 ADD UNIQUE INDEX (col_text_g(9));
+BEGIN;
+INSERT INTO t1 (col1) VALUES (1);
+ROLLBACK;
+disconnect con1;
+DROP TABLE t1;
+
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
+
+--echo # End of 10.4 tests
diff --git a/mysql-test/suite/innodb/r/default_row_format_alter.result b/mysql-test/suite/innodb/r/default_row_format_alter.result
index 42cbab8a5f2..33936b59003 100644
--- a/mysql-test/suite/innodb/r/default_row_format_alter.result
+++ b/mysql-test/suite/innodb/r/default_row_format_alter.result
@@ -129,5 +129,25 @@ SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
ROW_FORMAT
Dynamic
DROP TABLE t1;
+#
+# MDEV-31025 Redundant table alter fails when fixed column
+# stored externally
+#
+set @old_sql_mode = @@sql_mode;
+SET @@sql_mode='';
+CREATE TABLE t1(pk INT,c CHAR(255),c2 CHAR(255),c3 CHAR(255),
+c4 char(255), c5 char(255), c6 char(255),
+c7 char(255), c8 char(255), primary key(pk)
+)Engine=InnoDB character set utf32 ROW_FORMAT=REDUNDANT;
+INSERT INTO t1(pk, c) VALUES (1, repeat('a', 255));
+ALTER TABLE t1 FORCE;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+SELECT LENGTH(c) FROM t1;
+LENGTH(c)
+1020
+DROP TABLE t1;
+set @@sql_mode = @old_sql_mode;
# End of 10.4 tests
SET GLOBAL innodb_default_row_format = @row_format;
diff --git a/mysql-test/suite/innodb/r/full_crc32_import.result b/mysql-test/suite/innodb/r/full_crc32_import.result
index 99f11548420..32964be46d4 100644
--- a/mysql-test/suite/innodb/r/full_crc32_import.result
+++ b/mysql-test/suite/innodb/r/full_crc32_import.result
@@ -177,6 +177,17 @@ UNLOCK TABLES;
SET GLOBAL innodb_compression_algorithm=0;
ALTER TABLE t1 FORCE;
ALTER TABLE t1 DISCARD TABLESPACE;
+# Display the discarded table name by using SPACE and PAGE_NO
+# column in INNODB_SYS_INDEXES and discard doesn't affect the
+# SPACE in INNODB_SYS_TABLES
+SELECT t.NAME, t.SPACE BETWEEN 1 and 0xFFFFFFEF as SYS_TABLE_SPACE_RANGE
+FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t
+WHERE t.TABLE_ID IN (
+SELECT i.TABLE_ID FROM
+INFORMATION_SCHEMA.INNODB_SYS_INDEXES i WHERE
+i.PAGE_NO IS NULL and i.SPACE IS NULL);
+NAME SYS_TABLE_SPACE_RANGE
+test/t1 1
db.opt
t1.frm
restore: t1 .ibd and .cfg files
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522.result b/mysql-test/suite/innodb/r/innodb-wl5522.result
index 819ca949c88..2733809e0bd 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5522.result
@@ -64,16 +64,24 @@ a b c
# Done restarting server
# List before t1 DISCARD
db.opt
+t1.cfg.sav
t1.frm
t1.ibd
+t1.ibd.sav
+t2.cfg.sav
t2.frm
t2.ibd
+t2.ibd.sav
ALTER TABLE t1 DISCARD TABLESPACE;
# List after t1 DISCARD
db.opt
+t1.cfg.sav
t1.frm
+t1.ibd.sav
+t2.cfg.sav
t2.frm
t2.ibd
+t2.ibd.sav
ALTER TABLE t1 IMPORT TABLESPACE;
ALTER TABLE t1 ENGINE InnoDB;
SELECT COUNT(*) FROM t1;
@@ -91,10 +99,14 @@ a b c
638 Cavalry ..asdasdfaeraf
db.opt
t1.cfg
+t1.cfg.sav
t1.frm
t1.ibd
+t1.ibd.sav
+t2.cfg.sav
t2.frm
t2.ibd
+t2.ibd.sav
SELECT COUNT(*) FROM t1;
COUNT(*)
640
@@ -113,7 +125,9 @@ ALTER TABLE t2 ROW_FORMAT=DYNAMIC;
ALTER TABLE t2 DISCARD TABLESPACE;
# List after t2 DISCARD
db.opt
+t2.cfg.sav
t2.frm
+t2.ibd.sav
ALTER TABLE t2 IMPORT TABLESPACE;
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x1; .cfg file uses ROW_FORMAT=COMPACT)
ALTER TABLE t2 IMPORT TABLESPACE;
diff --git a/mysql-test/suite/innodb/r/innodb_buffer_pool_dump_pct.result b/mysql-test/suite/innodb/r/innodb_buffer_pool_dump_pct.result
index d9f5e4dfeed..fa17487df97 100644
--- a/mysql-test/suite/innodb/r/innodb_buffer_pool_dump_pct.result
+++ b/mysql-test/suite/innodb/r/innodb_buffer_pool_dump_pct.result
@@ -2,13 +2,11 @@ CREATE TABLE tab5 (col1 int auto_increment primary key,
col2 VARCHAR(25), col3 varchar(25)) ENGINE=InnoDB;
CREATE INDEX idx1 ON tab5(col2(10));
CREATE INDEX idx2 ON tab5(col3(10));
-SET GLOBAL innodb_buffer_pool_filename=ib_buffer_pool100;
SET GLOBAL innodb_buffer_pool_dump_pct=100;
SELECT variable_value INTO @IBPDS
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS';
SET GLOBAL innodb_buffer_pool_dump_now=ON;
-SET GLOBAL innodb_buffer_pool_filename=ib_buffer_pool1;
SET GLOBAL innodb_buffer_pool_dump_pct=1;
SELECT @@global.innodb_buffer_pool_dump_pct;
@@global.innodb_buffer_pool_dump_pct
@@ -18,5 +16,4 @@ FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS';
SET GLOBAL innodb_buffer_pool_dump_now=ON;
SET GLOBAL innodb_buffer_pool_dump_pct=DEFAULT;
-SET GLOBAL innodb_buffer_pool_filename=DEFAULT;
DROP TABLE tab5;
diff --git a/mysql-test/suite/innodb/r/innodb_ctype_utf8.result b/mysql-test/suite/innodb/r/innodb_ctype_utf8.result
index 5f29fad8a1c..3ce1d3a1d53 100644
--- a/mysql-test/suite/innodb/r/innodb_ctype_utf8.result
+++ b/mysql-test/suite/innodb/r/innodb_ctype_utf8.result
@@ -283,3 +283,101 @@ DROP TABLE t1;
#
# End of 10.2 tests
#
+#
+# Start of 10.4 tests
+#
+SET NAMES utf8mb3 COLLATE utf8mb3_unicode_nopad_ci;
+#
+# MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations
+#
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a TEXT COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a TEXT COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3)) USING HASH
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a VARCHAR(2000) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a VARCHAR(2000) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3)) USING HASH
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a CHAR(20) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a CHAR(20) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3)) USING HASH
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+#
+# End 10.4 tests
+#
diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
index b51a7fb3f6d..8cc2a11545f 100644
--- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
+++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
@@ -151,8 +151,8 @@ trx_commits_insert_update transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NUL
trx_rollbacks transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of transactions rolled back
trx_rollbacks_savepoint transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of transactions rolled back to savepoint
trx_rseg_history_len transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Length of the TRX_RSEG_HISTORY list
-trx_undo_slots_used transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of undo slots used
-trx_undo_slots_cached transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of undo slots cached
+trx_undo_slots_used transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of undo slots used
+trx_undo_slots_cached transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of undo slots cached
trx_rseg_current_size transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Current rollback segment size in pages
purge_del_mark_records purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of delete-marked rows purged
purge_upd_exist_or_extern_records purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of purges on updates of existing records and updates on delete marked record with externally stored field
diff --git a/mysql-test/suite/innodb/r/innodb_sys_var_valgrind.result b/mysql-test/suite/innodb/r/innodb_sys_var_valgrind.result
index 32d87b4668a..6932b8f2292 100644
--- a/mysql-test/suite/innodb/r/innodb_sys_var_valgrind.result
+++ b/mysql-test/suite/innodb/r/innodb_sys_var_valgrind.result
@@ -25,27 +25,6 @@ select @@innodb_ft_server_stopword_table;
@@innodb_ft_server_stopword_table
NULL
drop table user_stopword_1, user_stopword_2;
-select @@innodb_buffer_pool_filename;
-@@innodb_buffer_pool_filename
-ib_buffer_pool
-set @blah='hello';
-set global innodb_buffer_pool_filename = @blah;
-select @@innodb_buffer_pool_filename;
-@@innodb_buffer_pool_filename
-hello
-set global innodb_buffer_pool_filename="bye";
-select @@innodb_buffer_pool_filename;
-@@innodb_buffer_pool_filename
-bye
-set global innodb_buffer_pool_filename=NULL;
-ERROR 42000: Variable 'innodb_buffer_pool_filename' can't be set to the value of 'NULL'
-select @@innodb_buffer_pool_filename;
-@@innodb_buffer_pool_filename
-bye
-set global innodb_buffer_pool_filename=default;
-select @@innodb_buffer_pool_filename;
-@@innodb_buffer_pool_filename
-ib_buffer_pool
CREATE TABLE t1 ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
opening_line TEXT(500), author VARCHAR(200), title VARCHAR(200), FULLTEXT idx
(opening_line)) ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/r/instant_alter_crash.result b/mysql-test/suite/innodb/r/instant_alter_crash.result
index f0fedcc7673..7855aa24264 100644
--- a/mysql-test/suite/innodb/r/instant_alter_crash.result
+++ b/mysql-test/suite/innodb/r/instant_alter_crash.result
@@ -206,3 +206,27 @@ Table Op Msg_type Msg_text
test.t2 check status OK
DROP TABLE t1,t2;
db.opt
+#
+# MDEV-26198 Assertion `0' failed in row_log_table_apply_op during
+# ADD PRIMARY KEY or OPTIMIZE TABLE
+#
+CREATE TABLE t1(f1 year default null, f2 year default null,
+f3 text, f4 year default null, f5 year default null,
+f6 year default null, f7 year default null,
+f8 year default null)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1);
+ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE;
+set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish";
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ADD COLUMN f10 YEAR DEFAULT NULL, ALGORITHM=INPLACE;
+connect con1,localhost,root,,,;
+SET DEBUG_SYNC="now WAIT_FOR con1_insert";
+INSERT IGNORE INTO t1 (f3) VALUES ( 'b' );
+INSERT IGNORE INTO t1 (f3) VALUES ( 'l' );
+SET DEBUG_SYNC="now SIGNAL con1_finish";
+connection default;
+disconnect con1;
+SET DEBUG_SYNC=RESET;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/sql_mode_pad_char_to_full_length.result b/mysql-test/suite/innodb/r/sql_mode_pad_char_to_full_length.result
new file mode 100644
index 00000000000..09c1cf57497
--- /dev/null
+++ b/mysql-test/suite/innodb/r/sql_mode_pad_char_to_full_length.result
@@ -0,0 +1,51 @@
+SET default_storage_engine=InnoDB;
+#
+# Start of 10.4 tests
+#
+#
+# MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
+#
+#
+# MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
+#
+CREATE TABLE t1 (a INT,b CHAR(20));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
+INSERT INTO t1 VALUES (0,0);
+SET sql_mode='pad_char_to_full_length';
+DELETE FROM t1;
+DROP TABLE t1;
+SET sql_mode='';
+CREATE TABLE t1 (a INT,b CHAR(20));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
+SET sql_mode='pad_char_to_full_length';
+INSERT INTO t1 VALUES (0,0);
+DELETE FROM t1;
+DROP TABLE t1;
+SET sql_mode='';
+CREATE OR REPLACE TABLE t1 (a CHAR(20),b CHAR(20));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(20) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
+INSERT INTO t1 VALUES (0,0);
+SET sql_mode='pad_char_to_full_length';
+DELETE FROM t1;
+DROP TABLE t1;
+#
+# End of 10.4 tests
+#
diff --git a/mysql-test/suite/innodb/t/alter_crash.test b/mysql-test/suite/innodb/t/alter_crash.test
index e0e294ae4f0..164ff877b62 100644
--- a/mysql-test/suite/innodb/t/alter_crash.test
+++ b/mysql-test/suite/innodb/t/alter_crash.test
@@ -51,8 +51,8 @@ let $MYSQLD_DATADIR= `select @@datadir`;
let datadir= `select @@datadir`;
# These are from include/shutdown_mysqld.inc and allow to call start_mysqld.inc
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--echo #
--echo # Bug #14669848 CRASH DURING ALTER MAKES ORIGINAL TABLE INACCESSIBLE
diff --git a/mysql-test/suite/innodb/t/default_row_format_alter.test b/mysql-test/suite/innodb/t/default_row_format_alter.test
index f5dd246efb5..5f2170454f3 100644
--- a/mysql-test/suite/innodb/t/default_row_format_alter.test
+++ b/mysql-test/suite/innodb/t/default_row_format_alter.test
@@ -150,6 +150,23 @@ ALTER TABLE t1 DROP b;
SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
DROP TABLE t1;
+--echo #
+--echo # MDEV-31025 Redundant table alter fails when fixed column
+--echo # stored externally
+--echo #
+set @old_sql_mode = @@sql_mode;
+SET @@sql_mode='';
+CREATE TABLE t1(pk INT,c CHAR(255),c2 CHAR(255),c3 CHAR(255),
+ c4 char(255), c5 char(255), c6 char(255),
+ c7 char(255), c8 char(255), primary key(pk)
+ )Engine=InnoDB character set utf32 ROW_FORMAT=REDUNDANT;
+INSERT INTO t1(pk, c) VALUES (1, repeat('a', 255));
+ALTER TABLE t1 FORCE;
+CHECK TABLE t1;
+SELECT LENGTH(c) FROM t1;
+DROP TABLE t1;
+set @@sql_mode = @old_sql_mode;
+
--echo # End of 10.4 tests
SET GLOBAL innodb_default_row_format = @row_format;
diff --git a/mysql-test/suite/innodb/t/full_crc32_import.test b/mysql-test/suite/innodb/t/full_crc32_import.test
index c50e3899fc8..b79fd95471b 100644
--- a/mysql-test/suite/innodb/t/full_crc32_import.test
+++ b/mysql-test/suite/innodb/t/full_crc32_import.test
@@ -199,6 +199,16 @@ SET GLOBAL innodb_compression_algorithm=0;
ALTER TABLE t1 FORCE;
ALTER TABLE t1 DISCARD TABLESPACE;
+--echo # Display the discarded table name by using SPACE and PAGE_NO
+--echo # column in INNODB_SYS_INDEXES and discard doesn't affect the
+--echo # SPACE in INNODB_SYS_TABLES
+SELECT t.NAME, t.SPACE BETWEEN 1 and 0xFFFFFFEF as SYS_TABLE_SPACE_RANGE
+FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t
+WHERE t.TABLE_ID IN (
+ SELECT i.TABLE_ID FROM
+ INFORMATION_SCHEMA.INNODB_SYS_INDEXES i WHERE
+ i.PAGE_NO IS NULL and i.SPACE IS NULL);
+
--list_files $MYSQLD_DATADIR/test
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
diff --git a/mysql-test/suite/innodb/t/import_tablespace_race.test b/mysql-test/suite/innodb/t/import_tablespace_race.test
index 10ffe061ed1..aca0b5df06d 100644
--- a/mysql-test/suite/innodb/t/import_tablespace_race.test
+++ b/mysql-test/suite/innodb/t/import_tablespace_race.test
@@ -37,8 +37,8 @@ ALTER TABLE t NOWAIT ADD INDEX (c);
FLUSH TABLE t FOR EXPORT;
--let $create= query_get_value(SHOW CREATE TABLE t, Create Table, 1)
---copy_file $datadir/test/t.cfg $MYSQL_TMP_DIR/t.cfg
---copy_file $datadir/test/t.ibd $MYSQL_TMP_DIR/t.ibd
+--copy_file $datadir/test/t.cfg $datadir/test/t.cfg.sav
+--copy_file $datadir/test/t.ibd $datadir/test/t.ibd.sav
UNLOCK TABLES;
DROP TABLE t;
@@ -47,8 +47,8 @@ eval $create;
--enable_query_log
ALTER TABLE t DISCARD TABLESPACE;
---move_file $MYSQL_TMP_DIR/t.cfg $datadir/test/t.cfg
---move_file $MYSQL_TMP_DIR/t.ibd $datadir/test/t.ibd
+--move_file $datadir/test/t.cfg.sav $datadir/test/t.cfg
+--move_file $datadir/test/t.ibd.sav $datadir/test/t.ibd
ALTER TABLE t IMPORT TABLESPACE;
# Cleanup
diff --git a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
index ab6e1586897..0ae116f58f0 100644
--- a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
+++ b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test
@@ -29,8 +29,8 @@ call mtr.add_suppression("InnoDB could not find key no 1 with name f2 from dict
let datadir= `select @@datadir`;
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name=$MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb;
SET debug_dbug='+d,innodb_alter_commit_crash_before_commit';
diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
index e970bd842e2..2c3c95487f0 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
@@ -39,8 +39,8 @@ let $strerrfix=/ (\(.+\))//;
CREATE TABLE t1 (c1 INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES(1),(2),(3);
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo wait > $_expect_file_name
SET SESSION debug_dbug="+d,ib_discard_before_commit_crash";
diff --git a/mysql-test/suite/innodb/t/innodb-wl5522.test b/mysql-test/suite/innodb/t/innodb-wl5522.test
index c5c61ded651..873cf6b3a23 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5522.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5522.test
@@ -11,7 +11,6 @@ call mtr.add_suppression("InnoDB: Cannot save statistics for table `test`\\.`t1`
FLUSH TABLES;
-let $MYSQLD_TMPDIR = `SELECT @@tmpdir`;
let $MYSQLD_DATADIR = `SELECT @@datadir`;
let $checksum_algorithm = `SELECT @@innodb_checksum_algorithm`;
@@ -41,10 +40,10 @@ CREATE TABLE t2(a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPACT;
FLUSH TABLE t1, t2 FOR EXPORT;
--echo # List before copying files
--list_files $MYSQLD_DATADIR/test
---copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_TMPDIR/t1.cfg
---copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_TMPDIR/t1.ibd
---move_file $MYSQLD_DATADIR/test/t2.cfg $MYSQLD_TMPDIR/t2.cfg
---copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_TMPDIR/t2.ibd
+--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t1.cfg.sav
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t1.ibd.sav
+--move_file $MYSQLD_DATADIR/test/t2.cfg $MYSQLD_DATADIR/test/t2.cfg.sav
+--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_DATADIR/test/t2.ibd.sav
UNLOCK TABLES;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
SELECT COUNT(*) FROM t1;
@@ -58,8 +57,8 @@ SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
ALTER TABLE t1 DISCARD TABLESPACE;
--echo # List after t1 DISCARD
--list_files $MYSQLD_DATADIR/test
---copy_file $MYSQLD_TMPDIR/t1.cfg $MYSQLD_DATADIR/test/t1.cfg
---copy_file $MYSQLD_TMPDIR/t1.ibd $MYSQLD_DATADIR/test/t1.ibd
+--copy_file $MYSQLD_DATADIR/test/t1.cfg.sav $MYSQLD_DATADIR/test/t1.cfg
+--copy_file $MYSQLD_DATADIR/test/t1.ibd.sav $MYSQLD_DATADIR/test/t1.ibd
ALTER TABLE t1 IMPORT TABLESPACE;
ALTER TABLE t1 ENGINE InnoDB;
SELECT COUNT(*) FROM t1;
@@ -70,15 +69,15 @@ SELECT COUNT(*) FROM t1;
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
DROP TABLE t1;
---remove_file $MYSQLD_TMPDIR/t1.cfg
---remove_file $MYSQLD_TMPDIR/t1.ibd
+--remove_file $MYSQLD_DATADIR/test/t1.cfg.sav
+--remove_file $MYSQLD_DATADIR/test/t1.ibd.sav
ALTER TABLE t2 ROW_FORMAT=DYNAMIC;
ALTER TABLE t2 DISCARD TABLESPACE;
--echo # List after t2 DISCARD
--list_files $MYSQLD_DATADIR/test
---move_file $MYSQLD_TMPDIR/t2.ibd $MYSQLD_DATADIR/test/t2.ibd
---move_file $MYSQLD_TMPDIR/t2.cfg $MYSQLD_DATADIR/test/t2.cfg
+--move_file $MYSQLD_DATADIR/test/t2.ibd.sav $MYSQLD_DATADIR/test/t2.ibd
+--move_file $MYSQLD_DATADIR/test/t2.cfg.sav $MYSQLD_DATADIR/test/t2.cfg
--error ER_TABLE_SCHEMA_MISMATCH
ALTER TABLE t2 IMPORT TABLESPACE;
--remove_file $MYSQLD_DATADIR/test/t2.cfg
diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_dump_pct.test b/mysql-test/suite/innodb/t/innodb_buffer_pool_dump_pct.test
index a7a414d61da..381091165ef 100644
--- a/mysql-test/suite/innodb/t/innodb_buffer_pool_dump_pct.test
+++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_dump_pct.test
@@ -15,7 +15,6 @@ col2 VARCHAR(25), col3 varchar(25)) ENGINE=InnoDB;
CREATE INDEX idx1 ON tab5(col2(10));
CREATE INDEX idx2 ON tab5(col3(10));
-SET GLOBAL innodb_buffer_pool_filename=ib_buffer_pool100;
SET GLOBAL innodb_buffer_pool_dump_pct=100;
#***********************************************************
@@ -58,8 +57,7 @@ AND variable_value != @IBPDS
AND variable_value like 'Buffer pool(s) dump completed at%';
--source include/wait_condition.inc
---file_exists $MYSQLD_DATADIR/ib_buffer_pool100
-SET GLOBAL innodb_buffer_pool_filename=ib_buffer_pool1;
+--move_file $MYSQLD_DATADIR/ib_buffer_pool $MYSQLD_DATADIR/ib_buffer_pool100
SET GLOBAL innodb_buffer_pool_dump_pct=1;
SELECT @@global.innodb_buffer_pool_dump_pct;
@@ -83,17 +81,15 @@ AND variable_value != @IBPDS
AND variable_value like 'Buffer pool(s) dump completed at%';
--source include/wait_condition.inc
---file_exists $MYSQLD_DATADIR/ib_buffer_pool1
+--file_exists $MYSQLD_DATADIR/ib_buffer_pool
perl;
-my $size1 = -s "$ENV{MYSQLD_DATADIR}/ib_buffer_pool1";
+my $size1 = -s "$ENV{MYSQLD_DATADIR}/ib_buffer_pool";
my $size100 = -s "$ENV{MYSQLD_DATADIR}/ib_buffer_pool100";
die "$size100<=$size1\n" unless $size100 > $size1;
EOF
SET GLOBAL innodb_buffer_pool_dump_pct=DEFAULT;
-SET GLOBAL innodb_buffer_pool_filename=DEFAULT;
--remove_file $MYSQLD_DATADIR/ib_buffer_pool100
---remove_file $MYSQLD_DATADIR/ib_buffer_pool1
DROP TABLE tab5;
diff --git a/mysql-test/suite/innodb/t/innodb_ctype_utf8.test b/mysql-test/suite/innodb/t/innodb_ctype_utf8.test
index c3abaa99731..99b79253215 100644
--- a/mysql-test/suite/innodb/t/innodb_ctype_utf8.test
+++ b/mysql-test/suite/innodb/t/innodb_ctype_utf8.test
@@ -23,3 +23,15 @@ let $coll_pad='utf8_bin';
--echo #
--echo # End of 10.2 tests
--echo #
+
+
+--echo #
+--echo # Start of 10.4 tests
+--echo #
+
+SET NAMES utf8mb3 COLLATE utf8mb3_unicode_nopad_ci;
+--source include/ctype_nopad_prefix_unique.inc
+
+--echo #
+--echo # End 10.4 tests
+--echo #
diff --git a/mysql-test/suite/innodb/t/innodb_sys_var_valgrind.test b/mysql-test/suite/innodb/t/innodb_sys_var_valgrind.test
index 2e1391355b9..4383e26877d 100644
--- a/mysql-test/suite/innodb/t/innodb_sys_var_valgrind.test
+++ b/mysql-test/suite/innodb/t/innodb_sys_var_valgrind.test
@@ -25,24 +25,6 @@ select @@innodb_ft_server_stopword_table;
drop table user_stopword_1, user_stopword_2;
-#Test innodb_buffer_pool_filename (global variable)
-
-select @@innodb_buffer_pool_filename;
-
-set @blah='hello';
-set global innodb_buffer_pool_filename = @blah;
-select @@innodb_buffer_pool_filename;
-
-set global innodb_buffer_pool_filename="bye";
-select @@innodb_buffer_pool_filename;
-
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_buffer_pool_filename=NULL;
-select @@innodb_buffer_pool_filename;
-
-set global innodb_buffer_pool_filename=default;
-select @@innodb_buffer_pool_filename;
-
#Test innodb_ft_aux_table (global variable)
CREATE TABLE t1 ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
opening_line TEXT(500), author VARCHAR(200), title VARCHAR(200), FULLTEXT idx
diff --git a/mysql-test/suite/innodb/t/instant_alter_crash.test b/mysql-test/suite/innodb/t/instant_alter_crash.test
index 0bd983a2b4c..37cdb2862ad 100644
--- a/mysql-test/suite/innodb/t/instant_alter_crash.test
+++ b/mysql-test/suite/innodb/t/instant_alter_crash.test
@@ -236,3 +236,29 @@ CHECK TABLE t2;
DROP TABLE t1,t2;
--list_files $MYSQLD_DATADIR/test
+
+--echo #
+--echo # MDEV-26198 Assertion `0' failed in row_log_table_apply_op during
+--echo # ADD PRIMARY KEY or OPTIMIZE TABLE
+--echo #
+CREATE TABLE t1(f1 year default null, f2 year default null,
+ f3 text, f4 year default null, f5 year default null,
+ f6 year default null, f7 year default null,
+ f8 year default null)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1);
+ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE;
+set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish";
+send ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ADD COLUMN f10 YEAR DEFAULT NULL, ALGORITHM=INPLACE;
+
+connect(con1,localhost,root,,,);
+SET DEBUG_SYNC="now WAIT_FOR con1_insert";
+INSERT IGNORE INTO t1 (f3) VALUES ( 'b' );
+INSERT IGNORE INTO t1 (f3) VALUES ( 'l' );
+SET DEBUG_SYNC="now SIGNAL con1_finish";
+
+connection default;
+reap;
+disconnect con1;
+SET DEBUG_SYNC=RESET;
+CHECK TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/purge_thread_shutdown.test b/mysql-test/suite/innodb/t/purge_thread_shutdown.test
index 447f1fd3804..53b375b80fd 100644
--- a/mysql-test/suite/innodb/t/purge_thread_shutdown.test
+++ b/mysql-test/suite/innodb/t/purge_thread_shutdown.test
@@ -12,8 +12,8 @@ select user,state from information_schema.processlist order by 2;
set global debug_dbug='+d,only_kill_system_threads';
set global innodb_fast_shutdown=0;
-let $_server_id= `SELECT @@server_id`;
-let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect;
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
exec echo "wait" > $_expect_file_name;
send shutdown;
diff --git a/mysql-test/suite/innodb/t/restart.test b/mysql-test/suite/innodb/t/restart.test
index 5be076c6198..a1e45b37f9c 100644
--- a/mysql-test/suite/innodb/t/restart.test
+++ b/mysql-test/suite/innodb/t/restart.test
@@ -4,6 +4,7 @@
let datadir= `select @@datadir`;
let page_size= `select @@innodb_page_size`;
+let tmp_in_vardir=$MYSQLTEST_VARDIR/tmp;
--echo #
--echo # MDEV-15333 MariaDB (still) slow start
@@ -27,19 +28,19 @@ call mtr.add_suppression("\\[Warning\\] InnoDB: Ignoring tablespace for test/td
CREATE TABLE tr(a INT)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
CREATE TABLE tc(a INT)ENGINE=InnoDB ROW_FORMAT=COMPACT
PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
---replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+--replace_result $tmp_in_vardir MYSQL_TMP_DIR
eval CREATE TABLE td(a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
-STATS_PERSISTENT=0 DATA DIRECTORY='$MYSQL_TMP_DIR';
+STATS_PERSISTENT=0 DATA DIRECTORY='$tmp_in_vardir';
--source include/shutdown_mysqld.inc
--move_file $datadir/test/tr.ibd $datadir/test/tr0.ibd
--move_file $datadir/test/tc.ibd $datadir/test/tc0.ibd
---move_file $MYSQL_TMP_DIR/test/td.ibd $datadir/test/td0.ibd
+--move_file $tmp_in_vardir/test/td.ibd $datadir/test/td0.ibd
# TODO: test that MariaDB does not even attempt to open the files
#--mkdir $datadir/test/tr.ibd
#--mkdir $datadir/test/tc.ibd
-#--mkdir $MYSQL_TMP_DIR/test/td.ibd
+#--mkdir $tmp_in_vardir/test/td.ibd
perl;
die unless open OUT, ">", "$ENV{datadir}/test/tr.ibd";
@@ -48,7 +49,7 @@ close OUT or die;
die unless open OUT, ">", "$ENV{datadir}/test/tc.ibd";
print OUT "bar " x $ENV{page_size};
close OUT or die;
-die unless open OUT, ">", "$ENV{MYSQL_TMP_DIR}/test/td.ibd";
+die unless open OUT, ">", "$ENV{tmp_in_vardir}/test/td.ibd";
print OUT "Xyz " x $ENV{page_size};
close OUT or die;
die unless open ISL, "+<", "$ENV{datadir}/test/td.isl";
@@ -75,14 +76,14 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
# TODO: test that MariaDB does not even attempt to open the files
#--rmdir $datadir/test/tr.ibd
#--rmdir $datadir/test/tc.ibd
-#--rmdir $MYSQL_TMP_DIR/test/td.ibd
+#--rmdir $tmp_in_vardir/test/td.ibd
--remove_file $datadir/test/tr.ibd
--remove_file $datadir/test/tc.ibd
---remove_file $MYSQL_TMP_DIR/test/td.ibd
+--remove_file $tmp_in_vardir/test/td.ibd
--move_file $datadir/test/tr0.ibd $datadir/test/tr.ibd
--move_file $datadir/test/tc0.ibd $datadir/test/tc.ibd
---move_file $datadir/test/td0.ibd $MYSQL_TMP_DIR/test/td.ibd
+--move_file $datadir/test/td0.ibd $tmp_in_vardir/test/td.ibd
--source include/start_mysqld.inc
SELECT * FROM tr;
@@ -118,8 +119,6 @@ SET GLOBAL innodb_buffer_pool_size = @innodb_buffer_pool_size_orig;
--echo #
--let MYSQLD_DATADIR= `SELECT @@datadir`
---let SERVER_ID= `SELECT @@server_id`
---let EXPECT_FILE_NAME= $MYSQLTEST_VARDIR/tmp/mysqld.$SERVER_ID.expect
--source include/shutdown_mysqld.inc
@@ -154,13 +153,13 @@ if ($MTR_COMBINATION_64K)
}
--error 1
-exec $MYSQLD --no-defaults --skip-networking --innodb_data_file_path=ibdata1:$ibdata_size --innodb-page-size=$page_size --datadir=$MYSQLD_DATADIR --log-error=$MYSQL_TMP_DIR/attempted_start.err;
+exec $MYSQLD --no-defaults --skip-networking --innodb_data_file_path=ibdata1:$ibdata_size --innodb-page-size=$page_size --datadir=$MYSQLD_DATADIR --log-error=$tmp_in_vardir/attempted_start.err;
-let SEARCH_FILE= $MYSQL_TMP_DIR/attempted_start.err;
+let SEARCH_FILE= $tmp_in_vardir/attempted_start.err;
let SEARCH_PATTERN= InnoDB: MySQL-8\.0 tablespace in \./ibdata1;
source include/search_pattern_in_file.inc;
---remove_file $MYSQL_TMP_DIR/attempted_start.err
+--remove_file $tmp_in_vardir/attempted_start.err
--remove_file $MYSQLD_DATADIR/ibdata1
--move_file $MYSQLD_DATADIR/ibdata1.bak $MYSQLD_DATADIR/ibdata1
diff --git a/mysql-test/suite/innodb/t/sql_mode_pad_char_to_full_length.test b/mysql-test/suite/innodb/t/sql_mode_pad_char_to_full_length.test
new file mode 100644
index 00000000000..ba286c744d9
--- /dev/null
+++ b/mysql-test/suite/innodb/t/sql_mode_pad_char_to_full_length.test
@@ -0,0 +1,18 @@
+--source include/have_innodb.inc
+
+SET default_storage_engine=InnoDB;
+
+--echo #
+--echo # Start of 10.4 tests
+--echo #
+
+--echo #
+--echo # MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
+--echo #
+
+--source include/sql_mode_pad_char_to_full_length.inc
+
+
+--echo #
+--echo # End of 10.4 tests
+--echo #
diff --git a/mysql-test/suite/innodb/t/temporary_table.test b/mysql-test/suite/innodb/t/temporary_table.test
index 6f3f293f2a2..a374f9e1bba 100644
--- a/mysql-test/suite/innodb/t/temporary_table.test
+++ b/mysql-test/suite/innodb/t/temporary_table.test
@@ -11,8 +11,8 @@
--source include/no_valgrind_without_big.inc
--disable_query_log
-call mtr.add_suppression("Can't create/write to file '/dev/null/nonexistent/ib");
call mtr.add_suppression("Can't create/write to file '' \\\(Errcode: 20 \"Not a directory\"\\\)");
+call mtr.add_suppression("Can't create/write to file '/dev/null/.*/ib");
call mtr.add_suppression("InnoDB: Unable to create temporary file");
call mtr.add_suppression("last file in setting innodb_temp_data_file_path");
call mtr.add_suppression("The table 't1' is full");
@@ -135,7 +135,7 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
# We cannot use include/restart_mysqld.inc in this particular test,
# because SHOW STATUS would fail due to unwritable (nonexistent) tmpdir.
--source include/shutdown_mysqld.inc
---exec echo "restart: --tmpdir=/dev/null/nonexistent --skip-innodb-fast-shutdown" > $_expect_file_name
+--exec echo "restart: --tmpdir=/dev/null/$MYSQL_TMP_DIR --skip-innodb-fast-shutdown" > $_expect_file_name
--enable_reconnect
--disable_result_log
--disable_query_log
diff --git a/mysql-test/suite/innodb_fts/r/concurrent_insert.result b/mysql-test/suite/innodb_fts/r/concurrent_insert.result
index 2335982816b..bc47511b046 100644
--- a/mysql-test/suite/innodb_fts/r/concurrent_insert.result
+++ b/mysql-test/suite/innodb_fts/r/concurrent_insert.result
@@ -19,7 +19,7 @@ INSERT INTO t2 VALUES('mariadb');
connection default;
SET @saved_dbug = @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug ='+d,fts_instrument_sync_request,ib_optimize_wq_hang';
-SET DEBUG_SYNC= 'fts_sync_end
+SET DEBUG_SYNC= 'fts_instrument_sync_request
SIGNAL drop_index_start WAIT_FOR sync_op';
INSERT INTO t1 VALUES('Keyword');
connect con1,localhost,root,,,;
diff --git a/mysql-test/suite/innodb_fts/r/sync.result b/mysql-test/suite/innodb_fts/r/sync.result
index 74a5d2f13fb..928efffdb21 100644
--- a/mysql-test/suite/innodb_fts/r/sync.result
+++ b/mysql-test/suite/innodb_fts/r/sync.result
@@ -11,19 +11,19 @@ INSERT INTO t1(title) VALUES('database');
connection con1;
SET @old_dbug = @@SESSION.debug_dbug;
SET debug_dbug = '+d,fts_instrument_sync_debug';
-SET DEBUG_SYNC= 'fts_sync_end SIGNAL written WAIT_FOR selected';
+SET DEBUG_SYNC= 'fts_write_node SIGNAL written WAIT_FOR selected';
INSERT INTO t1(title) VALUES('mysql database');
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR written';
SET GLOBAL innodb_ft_aux_table="test/t1";
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
-SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
-WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
database 2 3 2 2 0
database 2 3 2 3 6
mysql 1 3 2 1 0
mysql 1 3 2 3 0
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
+WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
SET GLOBAL innodb_ft_aux_table=default;
SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
FTS_DOC_ID title
@@ -59,7 +59,7 @@ INSERT INTO t1(title) VALUES('mysql');
INSERT INTO t1(title) VALUES('database');
connection con1;
SET debug_dbug = '+d,fts_instrument_sync_debug';
-SET DEBUG_SYNC= 'fts_sync_end SIGNAL written WAIT_FOR inserted';
+SET DEBUG_SYNC= 'fts_write_node SIGNAL written WAIT_FOR inserted';
INSERT INTO t1(title) VALUES('mysql database');
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR written';
@@ -70,14 +70,14 @@ SET debug_dbug = @old_dbug;
SET GLOBAL innodb_ft_aux_table="test/t1";
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
-database 4 4 1 4 6
-mysql 4 4 1 4 0
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
database 2 3 2 2 0
database 2 3 2 3 6
-mysql 1 3 2 1 0
-mysql 1 3 2 3 0
+database 4 4 1 4 6
+mysql 1 4 3 1 0
+mysql 1 4 3 3 0
+mysql 1 4 3 4 0
SET GLOBAL innodb_ft_aux_table=default;
SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
FTS_DOC_ID title
diff --git a/mysql-test/suite/innodb_fts/r/sync_block.result b/mysql-test/suite/innodb_fts/r/sync_block.result
new file mode 100644
index 00000000000..65bee127e80
--- /dev/null
+++ b/mysql-test/suite/innodb_fts/r/sync_block.result
@@ -0,0 +1,83 @@
+SET @old_log_output = @@global.log_output;
+SET @old_slow_query_log = @@global.slow_query_log;
+SET @old_general_log = @@global.general_log;
+SET @old_long_query_time = @@global.long_query_time;
+SET @old_debug = @@global.debug_dbug;
+SET GLOBAL log_output = 'TABLE';
+SET GLOBAL general_log = 1;
+SET GLOBAL slow_query_log = 1;
+SET GLOBAL long_query_time = 1;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection default;
+# Case 1: Sync blocks DML(insert) on the same table.
+CREATE TABLE t1 (
+FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+title VARCHAR(200),
+FULLTEXT(title)
+) ENGINE = InnoDB;
+connection con1;
+SET GLOBAL debug_dbug='+d,fts_instrument_sync_debug,fts_instrument_sync_sleep';
+SET DEBUG_SYNC= 'fts_sync_begin SIGNAL begin WAIT_FOR continue';
+INSERT INTO t1(title) VALUES('mysql database');
+connection con2;
+SET DEBUG_SYNC= 'now WAIT_FOR begin';
+SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
+connection default;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+connection con1;
+/* connection con1 */ INSERT INTO t1(title) VALUES('mysql database');
+connection con2;
+/* conneciton con2 */ SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
+FTS_DOC_ID title
+connection default;
+# make con1 & con2 show up in mysql.slow_log
+SELECT SLEEP(2);
+SLEEP(2)
+0
+# slow log results should only contain INSERT INTO t1.
+SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02';
+sql_text
+INSERT INTO t1(title) VALUES('mysql database')
+SET GLOBAL debug_dbug = @old_debug;
+TRUNCATE TABLE mysql.slow_log;
+DROP TABLE t1;
+# Case 2: Sync blocks DML(insert) on other tables.
+CREATE TABLE t1 (
+FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+title VARCHAR(200),
+FULLTEXT(title)
+) ENGINE = InnoDB;
+CREATE TABLE t2(id INT);
+connection con1;
+SET GLOBAL debug_dbug='+d,fts_instrument_sync_request,fts_instrument_sync_sleep';
+SET DEBUG_SYNC= 'fts_instrument_sync_request SIGNAL begin WAIT_FOR continue';
+INSERT INTO t1(title) VALUES('mysql database');
+connection con2;
+SET DEBUG_SYNC= 'now WAIT_FOR begin';
+INSERT INTO t2 VALUES(1);
+connection default;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+connection con1;
+/* connection con1 */ INSERT INTO t1(title) VALUES('mysql database');
+connection con2;
+/* conneciton con2 */ INSERT INTO t2 VALUES(1);
+connection default;
+SET DEBUG_SYNC = 'RESET';
+# make con1 & con2 show up in mysql.slow_log
+SELECT SLEEP(2);
+SLEEP(2)
+0
+# slow log results should be empty here.
+SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02';
+sql_text
+SET GLOBAL debug_dbug = @old_debug;
+TRUNCATE TABLE mysql.slow_log;
+DROP TABLE t1,t2;
+disconnect con1;
+disconnect con2;
+# Restore slow log settings.
+SET GLOBAL log_output = @old_log_output;
+SET GLOBAL general_log = @old_general_log;
+SET GLOBAL slow_query_log = @old_slow_query_log;
+SET GLOBAL long_query_time = @old_long_query_time;
diff --git a/mysql-test/suite/innodb_fts/t/concurrent_insert.test b/mysql-test/suite/innodb_fts/t/concurrent_insert.test
index b6991f6e503..9b4d9517b1a 100644
--- a/mysql-test/suite/innodb_fts/t/concurrent_insert.test
+++ b/mysql-test/suite/innodb_fts/t/concurrent_insert.test
@@ -31,7 +31,7 @@ INSERT INTO t2 VALUES('mariadb');
connection default;
SET @saved_dbug = @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug ='+d,fts_instrument_sync_request,ib_optimize_wq_hang';
-SET DEBUG_SYNC= 'fts_sync_end
+SET DEBUG_SYNC= 'fts_instrument_sync_request
SIGNAL drop_index_start WAIT_FOR sync_op';
send INSERT INTO t1 VALUES('Keyword');
diff --git a/mysql-test/suite/innodb_fts/t/sync.test b/mysql-test/suite/innodb_fts/t/sync.test
index 49663f20b8a..168309a5c92 100644
--- a/mysql-test/suite/innodb_fts/t/sync.test
+++ b/mysql-test/suite/innodb_fts/t/sync.test
@@ -27,7 +27,7 @@ connection con1;
SET @old_dbug = @@SESSION.debug_dbug;
SET debug_dbug = '+d,fts_instrument_sync_debug';
-SET DEBUG_SYNC= 'fts_sync_end SIGNAL written WAIT_FOR selected';
+SET DEBUG_SYNC= 'fts_write_node SIGNAL written WAIT_FOR selected';
send INSERT INTO t1(title) VALUES('mysql database');
@@ -74,7 +74,7 @@ connection con1;
SET debug_dbug = '+d,fts_instrument_sync_debug';
-SET DEBUG_SYNC= 'fts_sync_end SIGNAL written WAIT_FOR inserted';
+SET DEBUG_SYNC= 'fts_write_node SIGNAL written WAIT_FOR inserted';
send INSERT INTO t1(title) VALUES('mysql database');
@@ -104,7 +104,8 @@ disconnect con1;
DROP TABLE t1;
--echo # Case 3: Test insert crash recovery
---let $_expect_file_name=$MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
CREATE TABLE t1 (
FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
diff --git a/mysql-test/suite/innodb_fts/t/sync_block.test b/mysql-test/suite/innodb_fts/t/sync_block.test
new file mode 100644
index 00000000000..895d2ba8a59
--- /dev/null
+++ b/mysql-test/suite/innodb_fts/t/sync_block.test
@@ -0,0 +1,124 @@
+#
+# BUG#22516559 MYSQL INSTANCE STALLS WHEN SYNCING FTS INDEX
+#
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/have_log_bin.inc
+--source include/count_sessions.inc
+
+SET @old_log_output = @@global.log_output;
+SET @old_slow_query_log = @@global.slow_query_log;
+SET @old_general_log = @@global.general_log;
+SET @old_long_query_time = @@global.long_query_time;
+SET @old_debug = @@global.debug_dbug;
+
+SET GLOBAL log_output = 'TABLE';
+SET GLOBAL general_log = 1;
+SET GLOBAL slow_query_log = 1;
+SET GLOBAL long_query_time = 1;
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+connection default;
+
+--echo # Case 1: Sync blocks DML(insert) on the same table.
+CREATE TABLE t1 (
+ FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+ title VARCHAR(200),
+ FULLTEXT(title)
+) ENGINE = InnoDB;
+
+connection con1;
+
+SET GLOBAL debug_dbug='+d,fts_instrument_sync_debug,fts_instrument_sync_sleep';
+
+SET DEBUG_SYNC= 'fts_sync_begin SIGNAL begin WAIT_FOR continue';
+
+send INSERT INTO t1(title) VALUES('mysql database');
+
+connection con2;
+
+SET DEBUG_SYNC= 'now WAIT_FOR begin';
+
+send SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
+
+connection default;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+connection con1;
+--echo /* connection con1 */ INSERT INTO t1(title) VALUES('mysql database');
+--reap
+
+connection con2;
+--echo /* conneciton con2 */ SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
+--reap
+
+connection default;
+-- echo # make con1 & con2 show up in mysql.slow_log
+SELECT SLEEP(2);
+-- echo # slow log results should only contain INSERT INTO t1.
+SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02';
+
+SET GLOBAL debug_dbug = @old_debug;
+TRUNCATE TABLE mysql.slow_log;
+
+DROP TABLE t1;
+
+--echo # Case 2: Sync blocks DML(insert) on other tables.
+CREATE TABLE t1 (
+ FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
+ title VARCHAR(200),
+ FULLTEXT(title)
+) ENGINE = InnoDB;
+
+CREATE TABLE t2(id INT);
+
+connection con1;
+
+SET GLOBAL debug_dbug='+d,fts_instrument_sync_request,fts_instrument_sync_sleep';
+
+SET DEBUG_SYNC= 'fts_instrument_sync_request SIGNAL begin WAIT_FOR continue';
+
+send INSERT INTO t1(title) VALUES('mysql database');
+
+connection con2;
+
+SET DEBUG_SYNC= 'now WAIT_FOR begin';
+
+send INSERT INTO t2 VALUES(1);
+
+connection default;
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+connection con1;
+--echo /* connection con1 */ INSERT INTO t1(title) VALUES('mysql database');
+--reap
+
+connection con2;
+--echo /* conneciton con2 */ INSERT INTO t2 VALUES(1);
+--reap
+
+connection default;
+SET DEBUG_SYNC = 'RESET';
+-- echo # make con1 & con2 show up in mysql.slow_log
+SELECT SLEEP(2);
+-- echo # slow log results should be empty here.
+SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02';
+
+SET GLOBAL debug_dbug = @old_debug;
+TRUNCATE TABLE mysql.slow_log;
+
+DROP TABLE t1,t2;
+
+disconnect con1;
+disconnect con2;
+
+--source include/wait_until_count_sessions.inc
+
+-- echo # Restore slow log settings.
+SET GLOBAL log_output = @old_log_output;
+SET GLOBAL general_log = @old_general_log;
+SET GLOBAL slow_query_log = @old_slow_query_log;
+SET GLOBAL long_query_time = @old_long_query_time;
diff --git a/mysql-test/suite/innodb_gis/r/rtree_optimize.result b/mysql-test/suite/innodb_gis/r/rtree_optimize.result
new file mode 100644
index 00000000000..4abdb5f2cf4
--- /dev/null
+++ b/mysql-test/suite/innodb_gis/r/rtree_optimize.result
@@ -0,0 +1,44 @@
+CREATE TABLE t (
+id INT AUTO_INCREMENT,
+c BINARY(226) DEFAULT '',
+s POINT NOT NULL,
+PRIMARY KEY(id,c)
+) ENGINE=InnoDB;
+INSERT INTO t (s) VALUES
+(POINTFromText('POINT(0.78 0.72)')),(POINTFromText('POINT(0.44 0.21)')),
+(POINTFromText('POINT(0.93 0.56)')),(POINTFromText('POINT(0.57 0.21)')),
+(POINTFromText('POINT(0.12 0.65)')),(POINTFromText('POINT(0.20 0.96)')),
+(POINTFromText('POINT(0.99 0.71)')),(POINTFromText('POINT(0.27 0.23)')),
+(POINTFromText('POINT(0.68 0.14)')),(POINTFromText('POINT(0.20 0.05)')),
+(POINTFromText('POINT(0.47 0.57)')),(POINTFromText('POINT(0.89 0.79)')),
+(POINTFromText('POINT(0.09 0.57)')),(POINTFromText('POINT(0.58 0.52)')),
+(POINTFromText('POINT(0.73 0.32)')),(POINTFromText('POINT(0.87 0.35)')),
+(POINTFromText('POINT(0.60 0.12)')),(POINTFromText('POINT(0.14 0.17)')),
+(POINTFromText('POINT(0.76 0.29)')),(POINTFromText('POINT(0.60 0.35)')),
+(POINTFromText('POINT(0.48 0.69)')),(POINTFromText('POINT(0.79 0.45)')),
+(POINTFromText('POINT(0.85 0.11)')),(POINTFromText('POINT(0.59 0.99)')),
+(POINTFromText('POINT(0.95 0.18)')),(POINTFromText('POINT(0.78 0.49)')),
+(POINTFromText('POINT(0.11 0.22)')),(POINTFromText('POINT(0.26 0.85)')),
+(POINTFromText('POINT(0.28 0.10)')),(POINTFromText('POINT(0.45 0.25)')),
+(POINTFromText('POINT(0.70 0.40)')),(POINTFromText('POINT(0.65 0.86)')),
+(POINTFromText('POINT(0.69 0.98)')),(POINTFromText('POINT(0.56 0.11)')),
+(POINTFromText('POINT(0.94 0.59)')),(POINTFromText('POINT(0.19 0.94)')),
+(POINTFromText('POINT(0.82 0.85)')),(POINTFromText('POINT(0.74 0.07)')),
+(POINTFromText('POINT(0.33 0.48)')),(POINTFromText('POINT(0.37 0.37)')),
+(POINTFromText('POINT(0.40 0.08)')),(POINTFromText('POINT(0.45 0.74)')),
+(POINTFromText('POINT(0.57 0.07)')),(POINTFromText('POINT(0.36 0.11)')),
+(POINTFromText('POINT(0.94 0.60)')),(POINTFromText('POINT(0.75 0.76)')),
+(POINTFromText('POINT(0.92 0.56)')),(POINTFromText('POINT(0.88 0.52)')),
+(POINTFromText('POINT(0.49 0.24)')),(POINTFromText('POINT(0.96 0.08)')),
+(POINTFromText('POINT(0.93 0.99)')),(POINTFromText('POINT(0.88 0.31)')),
+(POINTFromText('POINT(0.93 0.78)')),(POINTFromText('POINT(0.62 0.50)')),
+(POINTFromText('POINT(0.54 0.53)')),(POINTFromText('POINT(0.66 0.83)')),
+(POINTFromText('POINT(0.21 0.87)')),(POINTFromText('POINT(0.42 0.28)')),
+(POINTFromText('POINT(0.80 0.84)')),(POINTFromText('POINT(0.39 0.68)')),
+(POINTFromText('POINT(0.05 0.24)')),(POINTFromText('POINT(0.05 0.58)'));
+ALTER TABLE t ADD SPATIAL INDEX(s);
+OPTIMIZE TABLE t;
+Table Op Msg_type Msg_text
+test.t optimize note Table does not support optimize, doing recreate + analyze instead
+test.t optimize status OK
+DROP TABLE t;
diff --git a/mysql-test/suite/innodb_gis/t/rtree_optimize.test b/mysql-test/suite/innodb_gis/t/rtree_optimize.test
new file mode 100644
index 00000000000..c3de282da27
--- /dev/null
+++ b/mysql-test/suite/innodb_gis/t/rtree_optimize.test
@@ -0,0 +1,44 @@
+--source include/have_innodb.inc
+
+CREATE TABLE t (
+ id INT AUTO_INCREMENT,
+ c BINARY(226) DEFAULT '',
+ s POINT NOT NULL,
+ PRIMARY KEY(id,c)
+) ENGINE=InnoDB;
+INSERT INTO t (s) VALUES
+ (POINTFromText('POINT(0.78 0.72)')),(POINTFromText('POINT(0.44 0.21)')),
+ (POINTFromText('POINT(0.93 0.56)')),(POINTFromText('POINT(0.57 0.21)')),
+ (POINTFromText('POINT(0.12 0.65)')),(POINTFromText('POINT(0.20 0.96)')),
+ (POINTFromText('POINT(0.99 0.71)')),(POINTFromText('POINT(0.27 0.23)')),
+ (POINTFromText('POINT(0.68 0.14)')),(POINTFromText('POINT(0.20 0.05)')),
+ (POINTFromText('POINT(0.47 0.57)')),(POINTFromText('POINT(0.89 0.79)')),
+ (POINTFromText('POINT(0.09 0.57)')),(POINTFromText('POINT(0.58 0.52)')),
+ (POINTFromText('POINT(0.73 0.32)')),(POINTFromText('POINT(0.87 0.35)')),
+ (POINTFromText('POINT(0.60 0.12)')),(POINTFromText('POINT(0.14 0.17)')),
+ (POINTFromText('POINT(0.76 0.29)')),(POINTFromText('POINT(0.60 0.35)')),
+ (POINTFromText('POINT(0.48 0.69)')),(POINTFromText('POINT(0.79 0.45)')),
+ (POINTFromText('POINT(0.85 0.11)')),(POINTFromText('POINT(0.59 0.99)')),
+ (POINTFromText('POINT(0.95 0.18)')),(POINTFromText('POINT(0.78 0.49)')),
+ (POINTFromText('POINT(0.11 0.22)')),(POINTFromText('POINT(0.26 0.85)')),
+ (POINTFromText('POINT(0.28 0.10)')),(POINTFromText('POINT(0.45 0.25)')),
+ (POINTFromText('POINT(0.70 0.40)')),(POINTFromText('POINT(0.65 0.86)')),
+ (POINTFromText('POINT(0.69 0.98)')),(POINTFromText('POINT(0.56 0.11)')),
+ (POINTFromText('POINT(0.94 0.59)')),(POINTFromText('POINT(0.19 0.94)')),
+ (POINTFromText('POINT(0.82 0.85)')),(POINTFromText('POINT(0.74 0.07)')),
+ (POINTFromText('POINT(0.33 0.48)')),(POINTFromText('POINT(0.37 0.37)')),
+ (POINTFromText('POINT(0.40 0.08)')),(POINTFromText('POINT(0.45 0.74)')),
+ (POINTFromText('POINT(0.57 0.07)')),(POINTFromText('POINT(0.36 0.11)')),
+ (POINTFromText('POINT(0.94 0.60)')),(POINTFromText('POINT(0.75 0.76)')),
+ (POINTFromText('POINT(0.92 0.56)')),(POINTFromText('POINT(0.88 0.52)')),
+ (POINTFromText('POINT(0.49 0.24)')),(POINTFromText('POINT(0.96 0.08)')),
+ (POINTFromText('POINT(0.93 0.99)')),(POINTFromText('POINT(0.88 0.31)')),
+ (POINTFromText('POINT(0.93 0.78)')),(POINTFromText('POINT(0.62 0.50)')),
+ (POINTFromText('POINT(0.54 0.53)')),(POINTFromText('POINT(0.66 0.83)')),
+ (POINTFromText('POINT(0.21 0.87)')),(POINTFromText('POINT(0.42 0.28)')),
+ (POINTFromText('POINT(0.80 0.84)')),(POINTFromText('POINT(0.39 0.68)')),
+ (POINTFromText('POINT(0.05 0.24)')),(POINTFromText('POINT(0.05 0.58)'));
+ALTER TABLE t ADD SPATIAL INDEX(s);
+OPTIMIZE TABLE t;
+# Cleanup
+DROP TABLE t;
diff --git a/mysql-test/suite/innodb_i_s/innodb_sys_indexes.result b/mysql-test/suite/innodb_i_s/innodb_sys_indexes.result
index ea42e7ea784..f898e1a978e 100644
--- a/mysql-test/suite/innodb_i_s/innodb_sys_indexes.result
+++ b/mysql-test/suite/innodb_i_s/innodb_sys_indexes.result
@@ -6,7 +6,7 @@ INNODB_SYS_INDEXES CREATE TEMPORARY TABLE `INNODB_SYS_INDEXES` (
`TABLE_ID` bigint(21) unsigned NOT NULL,
`TYPE` int(11) NOT NULL,
`N_FIELDS` int(11) NOT NULL,
- `PAGE_NO` int(11) NOT NULL,
- `SPACE` int(11) NOT NULL,
+ `PAGE_NO` int(11),
+ `SPACE` int(11),
`MERGE_THRESHOLD` int(11) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
diff --git a/mysql-test/suite/maria/aria_log_dir_path.result b/mysql-test/suite/maria/aria_log_dir_path.result
new file mode 100644
index 00000000000..0a4201544a5
--- /dev/null
+++ b/mysql-test/suite/maria/aria_log_dir_path.result
@@ -0,0 +1,29 @@
+#
+# MDEV-30971 Add a new system variable aria_data_home_dir
+#
+# restart: --loose-aria-log-file-size=8388608 --loose-aria-log-dir-path=MYSQLTEST_VARDIR/tmp/aria_log_dir_path_1
+SET @@global.aria_log_purge_type=external;
+SHOW VARIABLES LIKE 'aria_log_file_size';
+Variable_name Value
+aria_log_file_size 8388608
+SELECT @@aria_log_dir_path;
+@@aria_log_dir_path
+MYSQLTEST_VARDIR/tmp/aria_log_dir_path_1
+SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
+SHOW ENGINE aria logs;
+Type Name Status
+Aria aria_log.00000001 in use
+CREATE TABLE t1 (id INT, txt LONGTEXT) ENGINE=Aria;
+BEGIN NOT ATOMIC
+FOR id IN 0..9 DO
+INSERT INTO test.t1 (id, txt) VALUES (id, REPEAT(id,1024*1024));
+END FOR;
+END;
+$$
+SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
+SHOW ENGINE aria logs;
+Type Name Status
+Aria aria_log.00000001 free
+Aria aria_log.00000002 in use
+DROP TABLE t1;
+# restart
diff --git a/mysql-test/suite/maria/aria_log_dir_path.test b/mysql-test/suite/maria/aria_log_dir_path.test
new file mode 100644
index 00000000000..bc0a31a76b9
--- /dev/null
+++ b/mysql-test/suite/maria/aria_log_dir_path.test
@@ -0,0 +1,65 @@
+--source include/have_maria.inc
+--let $datadir= `SELECT @@datadir`
+
+--echo #
+--echo # MDEV-30971 Add a new system variable aria_data_home_dir
+--echo #
+
+--let $ARIA_LOGDIR=$MYSQLTEST_VARDIR/tmp/aria_log_dir_path_1
+--mkdir $ARIA_LOGDIR
+--let $restart_parameters=--loose-aria-log-file-size=8388608 --loose-aria-log-dir-path=$ARIA_LOGDIR
+--source include/restart_mysqld.inc
+
+#
+# Test that:
+# - aria_log_dir_path is set to a non-default directory.
+# - New Aria log files are created in the non-default directory.
+# - The contents of the log directory (according to "file_exists" commands)
+# is in sync with the "SHOW ENGINE aria logs" ouput.
+#
+
+# Prevent automatic purge
+SET @@global.aria_log_purge_type=external;
+
+SHOW VARIABLES LIKE 'aria_log_file_size';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SELECT @@aria_log_dir_path;
+
+
+SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
+--file_exists $ARIA_LOGDIR/aria_log_control
+--file_exists $ARIA_LOGDIR/aria_log.00000001
+--error 1
+--file_exists $ARIA_LOGDIR/aria_log.00000002
+--replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
+SHOW ENGINE aria logs;
+
+
+CREATE TABLE t1 (id INT, txt LONGTEXT) ENGINE=Aria;
+DELIMITER $$;
+BEGIN NOT ATOMIC
+ FOR id IN 0..9 DO
+ INSERT INTO test.t1 (id, txt) VALUES (id, REPEAT(id,1024*1024));
+ END FOR;
+END;
+$$
+DELIMITER ;$$
+
+
+SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
+--file_exists $ARIA_LOGDIR/aria_log_control
+--file_exists $ARIA_LOGDIR/aria_log.00000001
+--file_exists $ARIA_LOGDIR/aria_log.00000002
+--error 1
+--file_exists $ARIA_LOGDIR/aria_log.00000003
+--replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
+SHOW ENGINE aria logs;
+
+DROP TABLE t1;
+
+--let $restart_parameters=
+--source include/restart_mysqld.inc
+--remove_file $ARIA_LOGDIR/aria_log_control
+--remove_file $ARIA_LOGDIR/aria_log.00000001
+--remove_file $ARIA_LOGDIR/aria_log.00000002
+--rmdir $ARIA_LOGDIR
diff --git a/mysql-test/suite/maria/maria3.result b/mysql-test/suite/maria/maria3.result
index ad69d5f2050..fcdd08382a0 100644
--- a/mysql-test/suite/maria/maria3.result
+++ b/mysql-test/suite/maria/maria3.result
@@ -311,6 +311,7 @@ aria_encrypt_tables #
aria_force_start_after_recovery_failures #
aria_group_commit #
aria_group_commit_interval #
+aria_log_dir_path #
aria_log_file_size #
aria_log_purge_type #
aria_max_sort_file_size #
diff --git a/mysql-test/suite/mariabackup/aria_log_dir_path.result b/mysql-test/suite/mariabackup/aria_log_dir_path.result
new file mode 100644
index 00000000000..1a877321bbe
--- /dev/null
+++ b/mysql-test/suite/mariabackup/aria_log_dir_path.result
@@ -0,0 +1,41 @@
+#
+# MDEV-30968 mariadb-backup does not copy Aria logs if aria_log_dir_path is used
+#
+# Restart mariadbd with the test specific parameters
+# restart: --aria-log-file-size=8388608 --aria-log-purge-type=external --loose-aria-log-dir-path=MYSQLTEST_VARDIR/tmp/backup_aria_log_dir_path
+# Create and populate an Aria table (and Aria logs)
+CREATE TABLE t1 (id INT, txt LONGTEXT) ENGINE=Aria;
+BEGIN NOT ATOMIC
+FOR id IN 0..9 DO
+INSERT INTO test.t1 (id, txt) VALUES (id, REPEAT(id,1024*1024));
+END FOR;
+END;
+$$
+# Testing aria log files before --backup
+SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
+SHOW ENGINE aria logs;
+Type Name Status
+Aria aria_log.00000001 free
+Aria aria_log.00000002 in use
+# mariadb-backup --backup
+# mariadb-backup --prepare
+# shutdown server
+# remove datadir
+# remove aria-log-dir-path
+# mariadb-backup --copy-back
+# with parameters: --defaults-file=MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=MYSQLTEST_VARDIR/mysqld.1/data/ --target-dir=MYSQLTEST_VARDIR/tmp/backup --parallel=2 --throttle=1 --aria-log-dir-path=MYSQLTEST_VARDIR/tmp/backup_aria_log_dir_path
+# starting server
+# restart: --aria-log-file-size=8388608 --aria-log-purge-type=external --loose-aria-log-dir-path=MYSQLTEST_VARDIR/tmp/backup_aria_log_dir_path
+# Check that the table is there after --copy-back
+SELECT COUNT(*) from t1;
+COUNT(*)
+10
+DROP TABLE t1;
+# Testing aria log files after --copy-back
+SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
+SHOW ENGINE aria logs;
+Type Name Status
+Aria aria_log.00000001 free
+Aria aria_log.00000002 in use
+# Restarting mariadbd with default parameters
+# restart
diff --git a/mysql-test/suite/mariabackup/aria_log_dir_path.test b/mysql-test/suite/mariabackup/aria_log_dir_path.test
new file mode 100644
index 00000000000..0178cd4eae5
--- /dev/null
+++ b/mysql-test/suite/mariabackup/aria_log_dir_path.test
@@ -0,0 +1,105 @@
+--source include/have_maria.inc
+
+--echo #
+--echo # MDEV-30968 mariadb-backup does not copy Aria logs if aria_log_dir_path is used
+--echo #
+
+--let $datadir=`SELECT @@datadir`
+--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
+
+if ($ARIA_LOGDIR_MARIADB == '')
+{
+ --let $ARIA_LOGDIR_MARIADB=$MYSQLTEST_VARDIR/tmp/backup_aria_log_dir_path
+}
+
+if ($ARIA_LOGDIR_FS == '')
+{
+ --let $ARIA_LOGDIR_FS=$MYSQLTEST_VARDIR/tmp/backup_aria_log_dir_path
+}
+
+--let $server_parameters=--aria-log-file-size=8388608 --aria-log-purge-type=external --loose-aria-log-dir-path=$ARIA_LOGDIR_MARIADB
+
+
+--echo # Restart mariadbd with the test specific parameters
+--mkdir $ARIA_LOGDIR_FS
+--let $restart_parameters=$server_parameters
+--source include/restart_mysqld.inc
+
+
+--echo # Create and populate an Aria table (and Aria logs)
+CREATE TABLE t1 (id INT, txt LONGTEXT) ENGINE=Aria;
+DELIMITER $$;
+BEGIN NOT ATOMIC
+ FOR id IN 0..9 DO
+ INSERT INTO test.t1 (id, txt) VALUES (id, REPEAT(id,1024*1024));
+ END FOR;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo # Testing aria log files before --backup
+SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
+--file_exists $ARIA_LOGDIR_FS/aria_log_control
+--file_exists $ARIA_LOGDIR_FS/aria_log.00000001
+--file_exists $ARIA_LOGDIR_FS/aria_log.00000002
+--error 1
+--file_exists $ARIA_LOGDIR_FS/aria_log.00000003
+--replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
+SHOW ENGINE aria logs;
+
+
+--echo # mariadb-backup --backup
+--disable_result_log
+--mkdir $targetdir
+--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir
+--enable_result_log
+
+
+--echo # mariadb-backup --prepare
+--disable_result_log
+--exec $XTRABACKUP --prepare --target-dir=$targetdir
+--enable_result_log
+
+
+--echo # shutdown server
+--disable_result_log
+--source include/shutdown_mysqld.inc
+--echo # remove datadir
+--rmdir $datadir
+--echo # remove aria-log-dir-path
+--rmdir $ARIA_LOGDIR_FS
+
+--echo # mariadb-backup --copy-back
+--let $mariadb_backup_parameters=--defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$datadir --target-dir=$targetdir --parallel=2 --throttle=1 --aria-log-dir-path=$ARIA_LOGDIR_MARIADB
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--exec echo "# with parameters: $mariadb_backup_parameters"
+--exec $XTRABACKUP $mariadb_backup_parameters
+
+--echo # starting server
+--let $restart_parameters=$server_parameters
+--source include/start_mysqld.inc
+--enable_result_log
+--rmdir $targetdir
+
+
+--echo # Check that the table is there after --copy-back
+SELECT COUNT(*) from t1;
+DROP TABLE t1;
+
+
+--echo # Testing aria log files after --copy-back
+SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
+--file_exists $ARIA_LOGDIR_FS/aria_log_control
+--file_exists $ARIA_LOGDIR_FS/aria_log.00000001
+--file_exists $ARIA_LOGDIR_FS/aria_log.00000002
+--error 1
+--file_exists $ARIA_LOGDIR_FS/aria_log.00000003
+--replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
+SHOW ENGINE aria logs;
+
+
+--echo # Restarting mariadbd with default parameters
+--let $restart_parameters=
+--source include/restart_mysqld.inc
+--rmdir $ARIA_LOGDIR_FS
diff --git a/mysql-test/suite/mariabackup/aria_log_dir_path_rel.result b/mysql-test/suite/mariabackup/aria_log_dir_path_rel.result
new file mode 100644
index 00000000000..7fef26096e0
--- /dev/null
+++ b/mysql-test/suite/mariabackup/aria_log_dir_path_rel.result
@@ -0,0 +1,41 @@
+#
+# MDEV-30968 mariadb-backup does not copy Aria logs if aria_log_dir_path is used
+#
+# Restart mariadbd with the test specific parameters
+# restart: --aria-log-file-size=8388608 --aria-log-purge-type=external --loose-aria-log-dir-path=../../tmp/backup_aria_log_dir_path_rel
+# Create and populate an Aria table (and Aria logs)
+CREATE TABLE t1 (id INT, txt LONGTEXT) ENGINE=Aria;
+BEGIN NOT ATOMIC
+FOR id IN 0..9 DO
+INSERT INTO test.t1 (id, txt) VALUES (id, REPEAT(id,1024*1024));
+END FOR;
+END;
+$$
+# Testing aria log files before --backup
+SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
+SHOW ENGINE aria logs;
+Type Name Status
+Aria aria_log.00000001 free
+Aria aria_log.00000002 in use
+# mariadb-backup --backup
+# mariadb-backup --prepare
+# shutdown server
+# remove datadir
+# remove aria-log-dir-path
+# mariadb-backup --copy-back
+# with parameters: --defaults-file=MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=MYSQLTEST_VARDIR/mysqld.1/data/ --target-dir=MYSQLTEST_VARDIR/tmp/backup --parallel=2 --throttle=1 --aria-log-dir-path=../../tmp/backup_aria_log_dir_path_rel
+# starting server
+# restart: --aria-log-file-size=8388608 --aria-log-purge-type=external --loose-aria-log-dir-path=../../tmp/backup_aria_log_dir_path_rel
+# Check that the table is there after --copy-back
+SELECT COUNT(*) from t1;
+COUNT(*)
+10
+DROP TABLE t1;
+# Testing aria log files after --copy-back
+SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
+SHOW ENGINE aria logs;
+Type Name Status
+Aria aria_log.00000001 free
+Aria aria_log.00000002 in use
+# Restarting mariadbd with default parameters
+# restart
diff --git a/mysql-test/suite/mariabackup/aria_log_dir_path_rel.test b/mysql-test/suite/mariabackup/aria_log_dir_path_rel.test
new file mode 100644
index 00000000000..c8169959929
--- /dev/null
+++ b/mysql-test/suite/mariabackup/aria_log_dir_path_rel.test
@@ -0,0 +1,4 @@
+--let $ARIA_LOGDIR_MARIADB=../../tmp/backup_aria_log_dir_path_rel
+--let $ARIA_LOGDIR_FS=$MYSQLTEST_VARDIR/tmp/backup_aria_log_dir_path_rel
+
+--source aria_log_dir_path.test
diff --git a/mysql-test/suite/mariabackup/include/restart_and_restore.inc b/mysql-test/suite/mariabackup/include/restart_and_restore.inc
index 2d1e5493957..aa26d28efba 100644
--- a/mysql-test/suite/mariabackup/include/restart_and_restore.inc
+++ b/mysql-test/suite/mariabackup/include/restart_and_restore.inc
@@ -4,5 +4,5 @@ echo # shutdown server;
echo # remove datadir;
rmdir $_datadir;
echo # xtrabackup move back;
-exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir --target-dir=$targetdir --parallel=2 --throttle=1;
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir --target-dir=$targetdir --parallel=2 --throttle=1 $backup_opts;
--source include/start_mysqld.inc
diff --git a/mysql-test/suite/mariabackup/partial_exclude.result b/mysql-test/suite/mariabackup/partial_exclude.result
index a31197b9e9d..f57a5f63e68 100644
--- a/mysql-test/suite/mariabackup/partial_exclude.result
+++ b/mysql-test/suite/mariabackup/partial_exclude.result
@@ -8,8 +8,15 @@ CREATE DATABASE db2;
USE db2;
CREATE TABLE t1(i INT) ENGINE INNODB;
USE test;
+BEGIN;
+INSERT INTO db2.t1 VALUES(20);
+INSERT INTO test.t1 VALUES(20);
+INSERT INTO test.t2 VALUES(20);
# xtrabackup backup
+COMMIT;
t1.new
DROP TABLE t1;
DROP TABLE t2;
DROP DATABASE db2;
+NOT FOUND /Operating system error number/ in backup.log
+NOT FOUND /Could not find a valid tablespace file for/ in backup.log
diff --git a/mysql-test/suite/mariabackup/partial_exclude.test b/mysql-test/suite/mariabackup/partial_exclude.test
index 3642a2c6f46..6a1ae13b512 100644
--- a/mysql-test/suite/mariabackup/partial_exclude.test
+++ b/mysql-test/suite/mariabackup/partial_exclude.test
@@ -19,6 +19,11 @@ CREATE TABLE t1(i INT) ENGINE INNODB;
USE test;
+BEGIN;
+INSERT INTO db2.t1 VALUES(20);
+INSERT INTO test.t1 VALUES(20);
+INSERT INTO test.t2 VALUES(20);
+
echo # xtrabackup backup;
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
@@ -26,6 +31,8 @@ let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup "--tables-exclude=test.*2" "--databases-exclude=db2" --target-dir=$targetdir;
--enable_result_log
+COMMIT;
+
# check that only t1 table is in backup (t2 is excluded)
list_files $targetdir/test *.new;
list_files $targetdir/test *.ibd;
@@ -47,4 +54,17 @@ DROP DATABASE db2;
rmdir $MYSQLD_DATADIR/db3;
rmdir $MYSQLD_DATADIR/db4;
rmdir $MYSQLD_DATADIR/db5;
+
+--let $backup_log=$MYSQLTEST_VARDIR/tmp/backup.log
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --export --prepare --target-dir="$targetdir" > $backup_log;
+--enable_result_log
+
+--let SEARCH_FILE=$backup_log
+--let SEARCH_PATTERN=Operating system error number
+--source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=Could not find a valid tablespace file for
+--source include/search_pattern_in_file.inc
+--remove_file $backup_log
+
rmdir $targetdir;
diff --git a/mysql-test/suite/mariabackup/relative_path.opt b/mysql-test/suite/mariabackup/relative_path.opt
new file mode 100644
index 00000000000..3e3c33e44f8
--- /dev/null
+++ b/mysql-test/suite/mariabackup/relative_path.opt
@@ -0,0 +1 @@
+--innodb-undo-tablespaces=2
diff --git a/mysql-test/suite/mariabackup/relative_path.result b/mysql-test/suite/mariabackup/relative_path.result
new file mode 100644
index 00000000000..7aa0c6968f3
--- /dev/null
+++ b/mysql-test/suite/mariabackup/relative_path.result
@@ -0,0 +1,20 @@
+CREATE TABLE t(i INT) ENGINE INNODB;
+INSERT INTO t VALUES(1);
+# xtrabackup backup
+# xtrabackup prepare
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart
+SELECT * FROM t;
+i
+1
+DROP TABLE t;
diff --git a/mysql-test/suite/mariabackup/relative_path.test b/mysql-test/suite/mariabackup/relative_path.test
new file mode 100644
index 00000000000..bd25a217e71
--- /dev/null
+++ b/mysql-test/suite/mariabackup/relative_path.test
@@ -0,0 +1,35 @@
+--source include/have_innodb.inc
+
+CREATE TABLE t(i INT) ENGINE INNODB;
+INSERT INTO t VALUES(1);
+
+echo # xtrabackup backup;
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+--let $backup_log=$MYSQLTEST_VARDIR/tmp/backup.log
+
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir > $backup_log 2>&1;
+--enable_result_log
+
+echo # xtrabackup prepare;
+--disable_result_log
+exec $XTRABACKUP --prepare --target-dir=$targetdir;
+
+# If MDEV-28187 is not fixed, the following tries to copy backup to data
+# directory will fail, because their destination path will be the same as
+# their source path
+
+--let $backup_opts=--innodb_undo_directory=./
+--source include/restart_and_restore.inc
+
+--let $backup_opts=--innodb_log_group_home_dir=./
+--source include/restart_and_restore.inc
+
+--let $backup_opts=--innodb_data_home_dir=./
+--source include/restart_and_restore.inc
+
+--enable_result_log
+
+SELECT * FROM t;
+DROP TABLE t;
+rmdir $targetdir;
diff --git a/mysql-test/suite/merge/alter_table.result b/mysql-test/suite/merge/alter_table.result
new file mode 100644
index 00000000000..5adf610e5c0
--- /dev/null
+++ b/mysql-test/suite/merge/alter_table.result
@@ -0,0 +1,22 @@
+#
+# BUG#6236 - ALTER TABLE MODIFY should set implicit NOT NULL on PK columns
+#
+create table t1 ( a varchar(10) not null primary key ) engine=myisam;
+create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1);
+flush tables;
+alter table t1 modify a varchar(10);
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` varchar(10) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci UNION=(`t1`)
+flush tables;
+alter table t1 modify a varchar(10) not null;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` varchar(10) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci UNION=(`t1`)
+drop table if exists t1, t2;
diff --git a/mysql-test/suite/merge/alter_table.test b/mysql-test/suite/merge/alter_table.test
new file mode 100644
index 00000000000..da56772bf60
--- /dev/null
+++ b/mysql-test/suite/merge/alter_table.test
@@ -0,0 +1,12 @@
+--echo #
+--echo # BUG#6236 - ALTER TABLE MODIFY should set implicit NOT NULL on PK columns
+--echo #
+create table t1 ( a varchar(10) not null primary key ) engine=myisam;
+create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1);
+flush tables;
+alter table t1 modify a varchar(10);
+show create table t2;
+flush tables;
+alter table t1 modify a varchar(10) not null;
+show create table t2;
+drop table if exists t1, t2;
diff --git a/mysql-test/main/merge.result b/mysql-test/suite/merge/merge.result
index 7144fd1d349..d0df8334949 100644
--- a/mysql-test/main/merge.result
+++ b/mysql-test/suite/merge/merge.result
@@ -3962,6 +3962,20 @@ SELECT DISTINCT f FROM tm WHERE f IN (47, 126, 97, 48, 73, 0);
f
DROP TABLE tm, t1, t2;
#
+# MDEV-30786 SIGFPE in cost_group_min_max on EXP
+#
+SET use_stat_tables='preferably';
+CREATE TABLE t1 (a INT,b INT,KEY i1 (a),KEY i2 (b)) ENGINE=MRG_MyISAM;
+ANALYZE LOCAL TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+EXPLAIN SELECT DISTINCT a FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL i1 5 NULL 1 Using index for group-by
+drop table t1;
+set use_stat_tables=default;
+#
# End of 11.0 tests
#
#
diff --git a/mysql-test/main/merge.test b/mysql-test/suite/merge/merge.test
index f8f421994e9..f35a41a06b2 100644
--- a/mysql-test/main/merge.test
+++ b/mysql-test/suite/merge/merge.test
@@ -2919,6 +2919,16 @@ SELECT DISTINCT f FROM tm WHERE f IN (47, 126, 97, 48, 73, 0);
DROP TABLE tm, t1, t2;
--echo #
+--echo # MDEV-30786 SIGFPE in cost_group_min_max on EXP
+--echo #
+SET use_stat_tables='preferably';
+CREATE TABLE t1 (a INT,b INT,KEY i1 (a),KEY i2 (b)) ENGINE=MRG_MyISAM;
+ANALYZE LOCAL TABLE t1;
+EXPLAIN SELECT DISTINCT a FROM t1;
+drop table t1;
+set use_stat_tables=default;
+
+--echo #
--echo # End of 11.0 tests
--echo #
--echo #
diff --git a/mysql-test/main/merge_debug.result b/mysql-test/suite/merge/merge_debug.result
index 36cf254f87e..36cf254f87e 100644
--- a/mysql-test/main/merge_debug.result
+++ b/mysql-test/suite/merge/merge_debug.result
diff --git a/mysql-test/main/merge_debug.test b/mysql-test/suite/merge/merge_debug.test
index 4141042c261..4141042c261 100644
--- a/mysql-test/main/merge_debug.test
+++ b/mysql-test/suite/merge/merge_debug.test
diff --git a/mysql-test/main/merge_innodb.result b/mysql-test/suite/merge/merge_innodb.result
index 5aa344a9391..5aa344a9391 100644
--- a/mysql-test/main/merge_innodb.result
+++ b/mysql-test/suite/merge/merge_innodb.result
diff --git a/mysql-test/main/merge_innodb.test b/mysql-test/suite/merge/merge_innodb.test
index 9f87f241d00..9f87f241d00 100644
--- a/mysql-test/main/merge_innodb.test
+++ b/mysql-test/suite/merge/merge_innodb.test
diff --git a/mysql-test/main/merge_mmap-master.opt b/mysql-test/suite/merge/merge_mmap-master.opt
index 9606fb57187..9606fb57187 100644
--- a/mysql-test/main/merge_mmap-master.opt
+++ b/mysql-test/suite/merge/merge_mmap-master.opt
diff --git a/mysql-test/main/merge_mmap.result b/mysql-test/suite/merge/merge_mmap.result
index 8e655a0491b..8e655a0491b 100644
--- a/mysql-test/main/merge_mmap.result
+++ b/mysql-test/suite/merge/merge_mmap.result
diff --git a/mysql-test/main/merge_mmap.test b/mysql-test/suite/merge/merge_mmap.test
index 01c3896bd02..01c3896bd02 100644
--- a/mysql-test/main/merge_mmap.test
+++ b/mysql-test/suite/merge/merge_mmap.test
diff --git a/mysql-test/suite/perfschema/r/digest_view.result b/mysql-test/suite/perfschema/r/digest_view.result
index 3fd7a090459..9b9f31dcde9 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 333a53e537d74bf74dd28c78ad5b23dd EXPLAIN SELECT * FROM `test` . `v1` 1
-test 1fb578da66e6583bae8e64061486f1b1 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 1
-test 923bca939a55826e231e1335016ba418 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 1
-test 6fa6d75432fd499d1c7d6f964c8310a2 EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 1
-test 3421da1ec8ecb8cac97e12a0609f73cb EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 1
-test c2f68fd41bfbf3acd52eb5e7306b0c00 SELECT * FROM `test` . `v1` 1
-test dd68812cbe4c1ed5a38921222981f8c5 SELECT * FROM `test` . `v1` WHERE `a` = ? 1
-test 7563bcc32c6d0d872c8d9f0bf7717e6a SELECT * FROM `test` . `v1` WHERE `b` > ? 1
-test 0817c53833dc6adbca581e8fe4c598c7 SELECT `a` , `b` FROM `test` . `v1` 1
-test a5f13903c70812ae08fa8c084e9cd503 SELECT `b` , `a` FROM `test` . `v1` 1
-test 66b14a14f2a42e1335dd28dfad8ea084 TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
+test 78b80220002834f612d11b0663f64d59 EXPLAIN SELECT * FROM `test` . `v1` 1
+test 9649c572f7c7b927e314d31620294e34 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 1
+test 304c0393779f7b183065e7b577f1be26 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 1
+test 6e400ce1796d40cfefa45333d6e5895c EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 1
+test 36c8726233a5c621742d35107d72e5e0 EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 1
+test 0aeb23572eed79a9e05cafe0e9cd1909 SELECT * FROM `test` . `v1` 1
+test 28bd92caf5c189316fab14a67b622203 SELECT * FROM `test` . `v1` WHERE `a` = ? 1
+test 637dba52704594bc4275ba3f37b8f851 SELECT * FROM `test` . `v1` WHERE `b` > ? 1
+test fd8e83e523b0eec97a94eef612154591 SELECT `a` , `b` FROM `test` . `v1` 1
+test c58ed156113959965ebf619b6dd3a8b2 SELECT `b` , `a` FROM `test` . `v1` 1
+test 4d9d22440ce86533e3fac764ab259bbd 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 98531b331031b84ddfbb2de8b601a704 CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1
-test 5352d7d117e97fecd312e354e9e290ce DROP TABLE `test` . `v1` 1
-test 333a53e537d74bf74dd28c78ad5b23dd EXPLAIN SELECT * FROM `test` . `v1` 2
-test 1fb578da66e6583bae8e64061486f1b1 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 2
-test 923bca939a55826e231e1335016ba418 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 2
-test 6fa6d75432fd499d1c7d6f964c8310a2 EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 2
-test 3421da1ec8ecb8cac97e12a0609f73cb EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 2
-test c2f68fd41bfbf3acd52eb5e7306b0c00 SELECT * FROM `test` . `v1` 2
-test dd68812cbe4c1ed5a38921222981f8c5 SELECT * FROM `test` . `v1` WHERE `a` = ? 2
-test 7563bcc32c6d0d872c8d9f0bf7717e6a SELECT * FROM `test` . `v1` WHERE `b` > ? 2
-test 21c19dd7ef5b894f3e32d0585cb3007f SELECT SCHEMA_NAME , `DIGEST` , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1
-test 0817c53833dc6adbca581e8fe4c598c7 SELECT `a` , `b` FROM `test` . `v1` 2
-test a5f13903c70812ae08fa8c084e9cd503 SELECT `b` , `a` FROM `test` . `v1` 2
-test 66b14a14f2a42e1335dd28dfad8ea084 TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
+test 4ccb56972e9c19941d4928d31502e796 CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1
+test a087be31e6440102676ef0171b8b2734 DROP TABLE `test` . `v1` 1
+test 78b80220002834f612d11b0663f64d59 EXPLAIN SELECT * FROM `test` . `v1` 2
+test 9649c572f7c7b927e314d31620294e34 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 2
+test 304c0393779f7b183065e7b577f1be26 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 2
+test 6e400ce1796d40cfefa45333d6e5895c EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 2
+test 36c8726233a5c621742d35107d72e5e0 EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 2
+test 0aeb23572eed79a9e05cafe0e9cd1909 SELECT * FROM `test` . `v1` 2
+test 28bd92caf5c189316fab14a67b622203 SELECT * FROM `test` . `v1` WHERE `a` = ? 2
+test 637dba52704594bc4275ba3f37b8f851 SELECT * FROM `test` . `v1` WHERE `b` > ? 2
+test 765bf27a2d45249dcc6377bcc02e1c4b SELECT SCHEMA_NAME , `DIGEST` , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1
+test fd8e83e523b0eec97a94eef612154591 SELECT `a` , `b` FROM `test` . `v1` 2
+test c58ed156113959965ebf619b6dd3a8b2 SELECT `b` , `a` FROM `test` . `v1` 2
+test 4d9d22440ce86533e3fac764ab259bbd 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/events_waits_current_MDEV-29091.result b/mysql-test/suite/perfschema/r/events_waits_current_MDEV-29091.result
new file mode 100644
index 00000000000..8f3a17a0fc5
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/events_waits_current_MDEV-29091.result
@@ -0,0 +1,41 @@
+SET default_storage_engine=InnoDB;
+SELECT @save_instrument_enabled := ENABLED
+, @save_instrument_timed := TIMED
+FROM performance_schema.setup_instruments
+WHERE NAME = 'wait/lock/table/sql/handler';
+@save_instrument_enabled := ENABLED @save_instrument_timed := TIMED
+YES YES
+SELECT @save_consumer_enabled := ENABLED
+FROM performance_schema.setup_consumers
+WHERE NAME = 'events_waits_current';
+@save_consumer_enabled := ENABLED
+YES
+UPDATE performance_schema.setup_instruments
+SET ENABLED = 'YES', TIMED = 'YES'
+WHERE NAME = 'wait/lock/table/sql/handler';
+UPDATE performance_schema.setup_consumers
+SET ENABLED = 'YES'
+WHERE NAME = 'events_waits_current';
+CREATE TABLE t1 (id1 INT(11), col1 VARCHAR (200));
+INSERT INTO t1 VALUES (1, 'aa');
+INSERT INTO t1 VALUES (2, 'bb');
+connect con1,localhost,root,,test;
+connect con2,localhost,root,,test;
+connection con1;
+START TRANSACTION;
+connection con2;
+START TRANSACTION;
+SELECT id1 FROM t1 WHERE id1=1 FOR UPDATE;
+connection default;
+SELECT event_name FROM performance_schema.events_waits_current
+WHERE event_name LIKE '%wait/lock/table/sql/handler%';
+event_name
+UPDATE performance_schema.setup_instruments
+SET ENABLED = @save_instrument_enabled, TIMED = @save_instrument_timed
+WHERE NAME = 'wait/lock/table/sql/handler';
+UPDATE performance_schema.setup_consumers
+SET ENABLED = @save_consumer_enabled
+WHERE NAME = 'events_waits_current';
+disconnect con1;
+disconnect con2;
+DROP TABLE t1;
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 ff554155f33..8772d7bf003 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 96a6bb95edaf100857f09c968aca354b SELECT ? + ? + SELECT ...
-statement/sql/truncate c1d647bb870f2c63c22a16707bb8aee3 TRUNCATE TABLE truncat...
+statement/sql/select be5dd6a08f2e34c86168c154f61cbf8c SELECT ? + ? + SELECT ...
+statement/sql/truncate e2b84d4b47baf073fa24b65f724e9431 TRUNCATE TABLE truncat...
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
index 52ece6d289d..47f4d7ba346 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
@@ -202,10 +202,8 @@ wait/io/table/sql/handler 23
wait/lock/table/sql/handler 24
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 8 TABLE test t1
-wait/lock/table/sql/handler 10 TABLE test t1
-wait/io/table/sql/handler 15 TABLE test t3
-wait/lock/table/sql/handler 14 TABLE test t3
+wait/lock/table/sql/handler 18 TABLE test t1
+wait/lock/table/sql/handler 29 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 6 4 2 4 1 1 0
@@ -262,10 +260,8 @@ wait/io/table/sql/handler 23
wait/lock/table/sql/handler 24
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 8 TABLE test t1
-wait/lock/table/sql/handler 10 TABLE test t1
-wait/io/table/sql/handler 15 TABLE test t3
-wait/lock/table/sql/handler 14 TABLE test t3
+wait/lock/table/sql/handler 18 TABLE test t1
+wait/lock/table/sql/handler 29 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 6 4 2 4 1 1 0
@@ -328,10 +324,8 @@ wait/io/table/sql/handler 23
wait/lock/table/sql/handler 24
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 8 TABLE test t1
-wait/lock/table/sql/handler 10 TABLE test t1
-wait/io/table/sql/handler 15 TABLE test t3
-wait/lock/table/sql/handler 14 TABLE test t3
+wait/lock/table/sql/handler 18 TABLE test t1
+wait/lock/table/sql/handler 29 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 6 4 2 4 1 1 0
@@ -429,10 +423,8 @@ wait/io/table/sql/handler 23
wait/lock/table/sql/handler 24
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 8 TABLE test t1
-wait/lock/table/sql/handler 10 TABLE test t1
-wait/io/table/sql/handler 15 TABLE test t3
-wait/lock/table/sql/handler 14 TABLE test t3
+wait/lock/table/sql/handler 18 TABLE test t1
+wait/lock/table/sql/handler 29 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 6 4 2 4 1 1 0
@@ -500,10 +492,8 @@ wait/io/table/sql/handler 23
wait/lock/table/sql/handler 24
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 8 TABLE test t1
-wait/lock/table/sql/handler 10 TABLE test t1
-wait/io/table/sql/handler 15 TABLE test t3
-wait/lock/table/sql/handler 14 TABLE test t3
+wait/lock/table/sql/handler 18 TABLE test t1
+wait/lock/table/sql/handler 29 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 6 4 2 4 1 1 0
@@ -613,10 +603,8 @@ wait/io/table/sql/handler 71
wait/lock/table/sql/handler 48
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 20 TABLE test t1
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 28 TABLE test t3
+wait/lock/table/sql/handler 41 TABLE test t1
+wait/lock/table/sql/handler 78 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -689,10 +677,8 @@ wait/io/table/sql/handler 71
wait/lock/table/sql/handler 48
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 20 TABLE test t1
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 28 TABLE test t3
+wait/lock/table/sql/handler 41 TABLE test t1
+wait/lock/table/sql/handler 78 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -814,10 +800,8 @@ wait/io/table/sql/handler 71
wait/lock/table/sql/handler 48
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 20 TABLE test t1
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 28 TABLE test t3
+wait/lock/table/sql/handler 41 TABLE test t1
+wait/lock/table/sql/handler 78 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -891,10 +875,8 @@ wait/io/table/sql/handler 71
wait/lock/table/sql/handler 56
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -965,10 +947,8 @@ wait/io/table/sql/handler 71
wait/lock/table/sql/handler 56
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1039,10 +1019,8 @@ wait/io/table/sql/handler 71
wait/lock/table/sql/handler 56
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1110,10 +1088,8 @@ wait/io/table/sql/handler 71
wait/lock/table/sql/handler 56
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1180,10 +1156,8 @@ wait/io/table/sql/handler 71
wait/lock/table/sql/handler 56
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1249,10 +1223,8 @@ wait/io/table/sql/handler 71
wait/lock/table/sql/handler 56
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1317,10 +1289,8 @@ wait/io/table/sql/handler 71
wait/lock/table/sql/handler 56
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1387,10 +1357,8 @@ wait/io/table/sql/handler 71
wait/lock/table/sql/handler 56
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1456,10 +1424,8 @@ wait/io/table/sql/handler 71
wait/lock/table/sql/handler 56
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1525,10 +1491,8 @@ wait/io/table/sql/handler 71
wait/lock/table/sql/handler 56
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1594,10 +1558,8 @@ wait/io/table/sql/handler 71
wait/lock/table/sql/handler 56
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1663,10 +1625,8 @@ wait/io/table/sql/handler 0
wait/lock/table/sql/handler 0
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 0 0 0 0 0 0 0
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
index b0ea06f4254..9810d104ed9 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
@@ -211,12 +211,9 @@ wait/io/table/sql/handler 33
wait/lock/table/sql/handler 36
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 8 TABLE test t1
-wait/lock/table/sql/handler 10 TABLE test t1
-wait/io/table/sql/handler 10 TABLE test t2
-wait/lock/table/sql/handler 12 TABLE test t2
-wait/io/table/sql/handler 15 TABLE test t3
-wait/lock/table/sql/handler 14 TABLE test t3
+wait/lock/table/sql/handler 18 TABLE test t1
+wait/lock/table/sql/handler 22 TABLE test t2
+wait/lock/table/sql/handler 29 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 6 4 2 4 1 1 0
@@ -279,12 +276,9 @@ wait/io/table/sql/handler 33
wait/lock/table/sql/handler 36
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 8 TABLE test t1
-wait/lock/table/sql/handler 10 TABLE test t1
-wait/io/table/sql/handler 10 TABLE test t2
-wait/lock/table/sql/handler 12 TABLE test t2
-wait/io/table/sql/handler 15 TABLE test t3
-wait/lock/table/sql/handler 14 TABLE test t3
+wait/lock/table/sql/handler 18 TABLE test t1
+wait/lock/table/sql/handler 22 TABLE test t2
+wait/lock/table/sql/handler 29 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 6 4 2 4 1 1 0
@@ -353,12 +347,9 @@ wait/io/table/sql/handler 33
wait/lock/table/sql/handler 36
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 8 TABLE test t1
-wait/lock/table/sql/handler 10 TABLE test t1
-wait/io/table/sql/handler 10 TABLE test t2
-wait/lock/table/sql/handler 12 TABLE test t2
-wait/io/table/sql/handler 15 TABLE test t3
-wait/lock/table/sql/handler 14 TABLE test t3
+wait/lock/table/sql/handler 18 TABLE test t1
+wait/lock/table/sql/handler 22 TABLE test t2
+wait/lock/table/sql/handler 29 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 6 4 2 4 1 1 0
@@ -462,12 +453,9 @@ wait/io/table/sql/handler 33
wait/lock/table/sql/handler 36
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 8 TABLE test t1
-wait/lock/table/sql/handler 10 TABLE test t1
-wait/io/table/sql/handler 10 TABLE test t2
-wait/lock/table/sql/handler 12 TABLE test t2
-wait/io/table/sql/handler 15 TABLE test t3
-wait/lock/table/sql/handler 14 TABLE test t3
+wait/lock/table/sql/handler 18 TABLE test t1
+wait/lock/table/sql/handler 22 TABLE test t2
+wait/lock/table/sql/handler 29 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 6 4 2 4 1 1 0
@@ -541,12 +529,9 @@ wait/io/table/sql/handler 33
wait/lock/table/sql/handler 36
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 8 TABLE test t1
-wait/lock/table/sql/handler 10 TABLE test t1
-wait/io/table/sql/handler 10 TABLE test t2
-wait/lock/table/sql/handler 12 TABLE test t2
-wait/io/table/sql/handler 15 TABLE test t3
-wait/lock/table/sql/handler 14 TABLE test t3
+wait/lock/table/sql/handler 18 TABLE test t1
+wait/lock/table/sql/handler 22 TABLE test t2
+wait/lock/table/sql/handler 29 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 6 4 2 4 1 1 0
@@ -662,12 +647,9 @@ wait/io/table/sql/handler 103
wait/lock/table/sql/handler 72
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 20 TABLE test t1
-wait/io/table/sql/handler 32 TABLE test t2
-wait/lock/table/sql/handler 24 TABLE test t2
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 28 TABLE test t3
+wait/lock/table/sql/handler 41 TABLE test t1
+wait/lock/table/sql/handler 56 TABLE test t2
+wait/lock/table/sql/handler 78 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -746,12 +728,9 @@ wait/io/table/sql/handler 103
wait/lock/table/sql/handler 72
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 20 TABLE test t1
-wait/io/table/sql/handler 32 TABLE test t2
-wait/lock/table/sql/handler 24 TABLE test t2
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 28 TABLE test t3
+wait/lock/table/sql/handler 41 TABLE test t1
+wait/lock/table/sql/handler 56 TABLE test t2
+wait/lock/table/sql/handler 78 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -879,12 +858,9 @@ wait/io/table/sql/handler 103
wait/lock/table/sql/handler 72
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 20 TABLE test t1
-wait/io/table/sql/handler 32 TABLE test t2
-wait/lock/table/sql/handler 24 TABLE test t2
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 28 TABLE test t3
+wait/lock/table/sql/handler 41 TABLE test t1
+wait/lock/table/sql/handler 56 TABLE test t2
+wait/lock/table/sql/handler 78 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -964,12 +940,9 @@ wait/io/table/sql/handler 103
wait/lock/table/sql/handler 84
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 32 TABLE test t2
-wait/lock/table/sql/handler 28 TABLE test t2
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t2
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1046,12 +1019,9 @@ wait/io/table/sql/handler 103
wait/lock/table/sql/handler 84
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 32 TABLE test t2
-wait/lock/table/sql/handler 28 TABLE test t2
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t2
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1128,12 +1098,9 @@ wait/io/table/sql/handler 103
wait/lock/table/sql/handler 84
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 32 TABLE test t2
-wait/lock/table/sql/handler 28 TABLE test t2
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t2
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1207,12 +1174,9 @@ wait/io/table/sql/handler 103
wait/lock/table/sql/handler 84
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 32 TABLE test t2
-wait/lock/table/sql/handler 28 TABLE test t2
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t2
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1285,12 +1249,9 @@ wait/io/table/sql/handler 103
wait/lock/table/sql/handler 84
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 32 TABLE test t2
-wait/lock/table/sql/handler 28 TABLE test t2
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t2
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1362,12 +1323,9 @@ wait/io/table/sql/handler 103
wait/lock/table/sql/handler 84
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 32 TABLE test t2
-wait/lock/table/sql/handler 28 TABLE test t2
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t2
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1438,12 +1396,9 @@ wait/io/table/sql/handler 103
wait/lock/table/sql/handler 84
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 32 TABLE test t2
-wait/lock/table/sql/handler 28 TABLE test t2
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t2
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1516,12 +1471,9 @@ wait/io/table/sql/handler 103
wait/lock/table/sql/handler 84
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 32 TABLE test t2
-wait/lock/table/sql/handler 28 TABLE test t2
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t2
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1593,12 +1545,9 @@ wait/io/table/sql/handler 103
wait/lock/table/sql/handler 84
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 32 TABLE test t2
-wait/lock/table/sql/handler 28 TABLE test t2
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t2
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1670,12 +1619,9 @@ wait/io/table/sql/handler 103
wait/lock/table/sql/handler 84
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 32 TABLE test t2
-wait/lock/table/sql/handler 28 TABLE test t2
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t2
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1747,12 +1693,9 @@ wait/io/table/sql/handler 103
wait/lock/table/sql/handler 84
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 32 TABLE test t2
-wait/lock/table/sql/handler 28 TABLE test t2
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t2
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 17 11 6 11 2 4 0
@@ -1824,12 +1767,9 @@ wait/io/table/sql/handler 0
wait/lock/table/sql/handler 0
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 21 TABLE test t1
-wait/lock/table/sql/handler 24 TABLE test t1
-wait/io/table/sql/handler 32 TABLE test t2
-wait/lock/table/sql/handler 28 TABLE test t2
-wait/io/table/sql/handler 50 TABLE test t3
-wait/lock/table/sql/handler 32 TABLE test t3
+wait/lock/table/sql/handler 45 TABLE test t1
+wait/lock/table/sql/handler 60 TABLE test t2
+wait/lock/table/sql/handler 82 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 0 0 0 0 0 0 0
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
index 0a6dea739e4..367a8a089eb 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
@@ -202,10 +202,8 @@ wait/io/table/sql/handler 23
wait/lock/table/sql/handler 24
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 8 TABLE test t1
-wait/lock/table/sql/handler 10 TABLE test t1
-wait/io/table/sql/handler 15 TABLE test t3
-wait/lock/table/sql/handler 14 TABLE test t3
+wait/lock/table/sql/handler 18 TABLE test t1
+wait/lock/table/sql/handler 29 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 6 4 2 4 1 1 0
@@ -262,10 +260,8 @@ wait/io/table/sql/handler 23
wait/lock/table/sql/handler 24
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 8 TABLE test t1
-wait/lock/table/sql/handler 10 TABLE test t1
-wait/io/table/sql/handler 15 TABLE test t3
-wait/lock/table/sql/handler 14 TABLE test t3
+wait/lock/table/sql/handler 18 TABLE test t1
+wait/lock/table/sql/handler 29 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 6 4 2 4 1 1 0
@@ -328,10 +324,8 @@ wait/io/table/sql/handler 23
wait/lock/table/sql/handler 24
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 8 TABLE test t1
-wait/lock/table/sql/handler 10 TABLE test t1
-wait/io/table/sql/handler 15 TABLE test t3
-wait/lock/table/sql/handler 14 TABLE test t3
+wait/lock/table/sql/handler 18 TABLE test t1
+wait/lock/table/sql/handler 29 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 6 4 2 4 1 1 0
@@ -429,10 +423,8 @@ wait/io/table/sql/handler 58
wait/lock/table/sql/handler 48
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 18 TABLE test t1
-wait/lock/table/sql/handler 20 TABLE test t1
-wait/io/table/sql/handler 40 TABLE test t3
-wait/lock/table/sql/handler 28 TABLE test t3
+wait/lock/table/sql/handler 38 TABLE test t1
+wait/lock/table/sql/handler 68 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 14 9 5 9 2 3 0
@@ -500,10 +492,8 @@ wait/io/table/sql/handler 58
wait/lock/table/sql/handler 48
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 18 TABLE test t1
-wait/lock/table/sql/handler 20 TABLE test t1
-wait/io/table/sql/handler 40 TABLE test t3
-wait/lock/table/sql/handler 28 TABLE test t3
+wait/lock/table/sql/handler 38 TABLE test t1
+wait/lock/table/sql/handler 68 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 14 9 5 9 2 3 0
@@ -613,10 +603,8 @@ wait/io/table/sql/handler 106
wait/lock/table/sql/handler 72
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 31 TABLE test t1
-wait/lock/table/sql/handler 30 TABLE test t1
-wait/io/table/sql/handler 75 TABLE test t3
-wait/lock/table/sql/handler 42 TABLE test t3
+wait/lock/table/sql/handler 61 TABLE test t1
+wait/lock/table/sql/handler 117 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 25 16 9 16 3 6 0
@@ -689,10 +677,8 @@ wait/io/table/sql/handler 106
wait/lock/table/sql/handler 72
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 31 TABLE test t1
-wait/lock/table/sql/handler 30 TABLE test t1
-wait/io/table/sql/handler 75 TABLE test t3
-wait/lock/table/sql/handler 42 TABLE test t3
+wait/lock/table/sql/handler 61 TABLE test t1
+wait/lock/table/sql/handler 117 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 25 16 9 16 3 6 0
@@ -814,10 +800,8 @@ wait/io/table/sql/handler 167
wait/lock/table/sql/handler 96
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 40 TABLE test t1
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 56 TABLE test t3
+wait/lock/table/sql/handler 87 TABLE test t1
+wait/lock/table/sql/handler 176 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -891,10 +875,8 @@ wait/io/table/sql/handler 167
wait/lock/table/sql/handler 104
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -965,10 +947,8 @@ wait/io/table/sql/handler 167
wait/lock/table/sql/handler 104
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1039,10 +1019,8 @@ wait/io/table/sql/handler 167
wait/lock/table/sql/handler 104
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1110,10 +1088,8 @@ wait/io/table/sql/handler 167
wait/lock/table/sql/handler 104
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1180,10 +1156,8 @@ wait/io/table/sql/handler 167
wait/lock/table/sql/handler 104
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1249,10 +1223,8 @@ wait/io/table/sql/handler 167
wait/lock/table/sql/handler 104
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1317,10 +1289,8 @@ wait/io/table/sql/handler 167
wait/lock/table/sql/handler 104
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1387,10 +1357,8 @@ wait/io/table/sql/handler 167
wait/lock/table/sql/handler 104
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1456,10 +1424,8 @@ wait/io/table/sql/handler 167
wait/lock/table/sql/handler 104
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1525,10 +1491,8 @@ wait/io/table/sql/handler 167
wait/lock/table/sql/handler 104
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1594,10 +1558,8 @@ wait/io/table/sql/handler 167
wait/lock/table/sql/handler 104
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1663,10 +1625,8 @@ wait/io/table/sql/handler 0
wait/lock/table/sql/handler 0
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 0 0 0 0 0 0 0
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
index c2eda2b8f23..ed1ac9d979b 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
@@ -211,12 +211,9 @@ wait/io/table/sql/handler 33
wait/lock/table/sql/handler 36
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 8 TABLE test t1
-wait/lock/table/sql/handler 10 TABLE test t1
-wait/io/table/sql/handler 10 TABLE test t2
-wait/lock/table/sql/handler 12 TABLE test t2
-wait/io/table/sql/handler 15 TABLE test t3
-wait/lock/table/sql/handler 14 TABLE test t3
+wait/lock/table/sql/handler 18 TABLE test t1
+wait/lock/table/sql/handler 22 TABLE test t2
+wait/lock/table/sql/handler 29 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 6 4 2 4 1 1 0
@@ -279,12 +276,9 @@ wait/io/table/sql/handler 33
wait/lock/table/sql/handler 36
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 8 TABLE test t1
-wait/lock/table/sql/handler 10 TABLE test t1
-wait/io/table/sql/handler 10 TABLE test t2
-wait/lock/table/sql/handler 12 TABLE test t2
-wait/io/table/sql/handler 15 TABLE test t3
-wait/lock/table/sql/handler 14 TABLE test t3
+wait/lock/table/sql/handler 18 TABLE test t1
+wait/lock/table/sql/handler 22 TABLE test t2
+wait/lock/table/sql/handler 29 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 6 4 2 4 1 1 0
@@ -353,12 +347,9 @@ wait/io/table/sql/handler 33
wait/lock/table/sql/handler 36
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 8 TABLE test t1
-wait/lock/table/sql/handler 10 TABLE test t1
-wait/io/table/sql/handler 10 TABLE test t2
-wait/lock/table/sql/handler 12 TABLE test t2
-wait/io/table/sql/handler 15 TABLE test t3
-wait/lock/table/sql/handler 14 TABLE test t3
+wait/lock/table/sql/handler 18 TABLE test t1
+wait/lock/table/sql/handler 22 TABLE test t2
+wait/lock/table/sql/handler 29 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 6 4 2 4 1 1 0
@@ -462,12 +453,9 @@ wait/io/table/sql/handler 84
wait/lock/table/sql/handler 72
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 18 TABLE test t1
-wait/lock/table/sql/handler 20 TABLE test t1
-wait/io/table/sql/handler 26 TABLE test t2
-wait/lock/table/sql/handler 24 TABLE test t2
-wait/io/table/sql/handler 40 TABLE test t3
-wait/lock/table/sql/handler 28 TABLE test t3
+wait/lock/table/sql/handler 38 TABLE test t1
+wait/lock/table/sql/handler 50 TABLE test t2
+wait/lock/table/sql/handler 68 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 14 9 5 9 2 3 0
@@ -541,12 +529,9 @@ wait/io/table/sql/handler 84
wait/lock/table/sql/handler 72
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 18 TABLE test t1
-wait/lock/table/sql/handler 20 TABLE test t1
-wait/io/table/sql/handler 26 TABLE test t2
-wait/lock/table/sql/handler 24 TABLE test t2
-wait/io/table/sql/handler 40 TABLE test t3
-wait/lock/table/sql/handler 28 TABLE test t3
+wait/lock/table/sql/handler 38 TABLE test t1
+wait/lock/table/sql/handler 50 TABLE test t2
+wait/lock/table/sql/handler 68 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 14 9 5 9 2 3 0
@@ -662,12 +647,9 @@ wait/io/table/sql/handler 154
wait/lock/table/sql/handler 108
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 31 TABLE test t1
-wait/lock/table/sql/handler 30 TABLE test t1
-wait/io/table/sql/handler 48 TABLE test t2
-wait/lock/table/sql/handler 36 TABLE test t2
-wait/io/table/sql/handler 75 TABLE test t3
-wait/lock/table/sql/handler 42 TABLE test t3
+wait/lock/table/sql/handler 61 TABLE test t1
+wait/lock/table/sql/handler 84 TABLE test t2
+wait/lock/table/sql/handler 117 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 25 16 9 16 3 6 0
@@ -746,12 +728,9 @@ wait/io/table/sql/handler 154
wait/lock/table/sql/handler 108
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 31 TABLE test t1
-wait/lock/table/sql/handler 30 TABLE test t1
-wait/io/table/sql/handler 48 TABLE test t2
-wait/lock/table/sql/handler 36 TABLE test t2
-wait/io/table/sql/handler 75 TABLE test t3
-wait/lock/table/sql/handler 42 TABLE test t3
+wait/lock/table/sql/handler 61 TABLE test t1
+wait/lock/table/sql/handler 84 TABLE test t2
+wait/lock/table/sql/handler 117 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 25 16 9 16 3 6 0
@@ -879,12 +858,9 @@ wait/io/table/sql/handler 243
wait/lock/table/sql/handler 144
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 40 TABLE test t1
-wait/io/table/sql/handler 76 TABLE test t2
-wait/lock/table/sql/handler 48 TABLE test t2
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 56 TABLE test t3
+wait/lock/table/sql/handler 87 TABLE test t1
+wait/lock/table/sql/handler 124 TABLE test t2
+wait/lock/table/sql/handler 176 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -964,12 +940,9 @@ wait/io/table/sql/handler 243
wait/lock/table/sql/handler 156
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 76 TABLE test t2
-wait/lock/table/sql/handler 52 TABLE test t2
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 128 TABLE test t2
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1046,12 +1019,9 @@ wait/io/table/sql/handler 243
wait/lock/table/sql/handler 156
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 76 TABLE test t2
-wait/lock/table/sql/handler 52 TABLE test t2
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 128 TABLE test t2
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1128,12 +1098,9 @@ wait/io/table/sql/handler 243
wait/lock/table/sql/handler 156
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 76 TABLE test t2
-wait/lock/table/sql/handler 52 TABLE test t2
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 128 TABLE test t2
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1207,12 +1174,9 @@ wait/io/table/sql/handler 243
wait/lock/table/sql/handler 156
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 76 TABLE test t2
-wait/lock/table/sql/handler 52 TABLE test t2
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 128 TABLE test t2
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1285,12 +1249,9 @@ wait/io/table/sql/handler 243
wait/lock/table/sql/handler 156
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 76 TABLE test t2
-wait/lock/table/sql/handler 52 TABLE test t2
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 128 TABLE test t2
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1362,12 +1323,9 @@ wait/io/table/sql/handler 243
wait/lock/table/sql/handler 156
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 76 TABLE test t2
-wait/lock/table/sql/handler 52 TABLE test t2
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 128 TABLE test t2
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1438,12 +1396,9 @@ wait/io/table/sql/handler 243
wait/lock/table/sql/handler 156
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 76 TABLE test t2
-wait/lock/table/sql/handler 52 TABLE test t2
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 128 TABLE test t2
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1516,12 +1471,9 @@ wait/io/table/sql/handler 243
wait/lock/table/sql/handler 156
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 76 TABLE test t2
-wait/lock/table/sql/handler 52 TABLE test t2
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 128 TABLE test t2
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1593,12 +1545,9 @@ wait/io/table/sql/handler 243
wait/lock/table/sql/handler 156
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 76 TABLE test t2
-wait/lock/table/sql/handler 52 TABLE test t2
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 128 TABLE test t2
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1670,12 +1619,9 @@ wait/io/table/sql/handler 243
wait/lock/table/sql/handler 156
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 76 TABLE test t2
-wait/lock/table/sql/handler 52 TABLE test t2
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 128 TABLE test t2
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1747,12 +1693,9 @@ wait/io/table/sql/handler 243
wait/lock/table/sql/handler 156
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 76 TABLE test t2
-wait/lock/table/sql/handler 52 TABLE test t2
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 128 TABLE test t2
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 39 25 14 25 4 10 0
@@ -1824,12 +1767,9 @@ wait/io/table/sql/handler 0
wait/lock/table/sql/handler 0
execute dump_waits_history;
event_name count(event_name) object_type object_schema object_name
-wait/io/table/sql/handler 47 TABLE test t1
-wait/lock/table/sql/handler 44 TABLE test t1
-wait/io/table/sql/handler 76 TABLE test t2
-wait/lock/table/sql/handler 52 TABLE test t2
-wait/io/table/sql/handler 120 TABLE test t3
-wait/lock/table/sql/handler 60 TABLE test t3
+wait/lock/table/sql/handler 91 TABLE test t1
+wait/lock/table/sql/handler 128 TABLE test t2
+wait/lock/table/sql/handler 180 TABLE test t3
execute dump_waits_index_io;
object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete
TABLE test t1 NULL 0 0 0 0 0 0 0
diff --git a/mysql-test/suite/perfschema/t/events_waits_current_MDEV-29091.test b/mysql-test/suite/perfschema/t/events_waits_current_MDEV-29091.test
new file mode 100644
index 00000000000..d9330ee5a9d
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/events_waits_current_MDEV-29091.test
@@ -0,0 +1,62 @@
+#
+# proper event name wait/lock/table/sql/handler recorded in
+# PERFORMANCE_SCHEMA.EVENTS_WAITS_CURRENT. Before this fix, it was
+# labeled as wait/io/table/sql/handler.
+#
+
+--source include/have_innodb.inc
+--source include/have_perfschema.inc
+--source include/not_embedded.inc
+
+SET default_storage_engine=InnoDB;
+
+SELECT @save_instrument_enabled := ENABLED
+, @save_instrument_timed := TIMED
+FROM performance_schema.setup_instruments
+WHERE NAME = 'wait/lock/table/sql/handler';
+
+SELECT @save_consumer_enabled := ENABLED
+FROM performance_schema.setup_consumers
+WHERE NAME = 'events_waits_current';
+
+UPDATE performance_schema.setup_instruments
+SET ENABLED = 'YES', TIMED = 'YES'
+WHERE NAME = 'wait/lock/table/sql/handler';
+
+UPDATE performance_schema.setup_consumers
+SET ENABLED = 'YES'
+WHERE NAME = 'events_waits_current';
+
+CREATE TABLE t1 (id1 INT(11), col1 VARCHAR (200));
+INSERT INTO t1 VALUES (1, 'aa');
+INSERT INTO t1 VALUES (2, 'bb');
+
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
+
+connection con1;
+START TRANSACTION;
+let $wait_condition=
+ SELECT id1 FROM t1 WHERE id1=1 FOR UPDATE;
+--source include/wait_condition.inc
+
+connection con2;
+START TRANSACTION;
+send SELECT id1 FROM t1 WHERE id1=1 FOR UPDATE;
+
+connection default;
+SELECT event_name FROM performance_schema.events_waits_current
+WHERE event_name LIKE '%wait/lock/table/sql/handler%';
+
+# clean up
+UPDATE performance_schema.setup_instruments
+SET ENABLED = @save_instrument_enabled, TIMED = @save_instrument_timed
+WHERE NAME = 'wait/lock/table/sql/handler';
+
+UPDATE performance_schema.setup_consumers
+SET ENABLED = @save_consumer_enabled
+WHERE NAME = 'events_waits_current';
+
+disconnect con1;
+disconnect con2;
+DROP TABLE t1;
diff --git a/mysql-test/suite/period/r/overlaps.result b/mysql-test/suite/period/r/overlaps.result
index 3ed8e1a0014..78b1ac18b8d 100644
--- a/mysql-test/suite/period/r/overlaps.result
+++ b/mysql-test/suite/period/r/overlaps.result
@@ -351,3 +351,101 @@ primary key(id, p without overlaps)
) engine=heap partition by hash(id);
update t set id = 1;
drop table t, t1;
+#
+# MDEV-30415 PERIOD false positive overlap wtih utf8mb4_unicode_nopad_ci
+#
+CREATE TABLE t1 (
+datetime_column_name_1 DATETIME(6) NOT NULL,
+datetime_column_name_2 DATETIME(6) NOT NULL,
+text_column_name TEXT COLLATE utf8mb4_unicode_nopad_ci NOT NULL,
+PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2),
+UNIQUE KEY index_name (text_column_name(191),period_name WITHOUT OVERLAPS)
+) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci;
+INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, text_column_name)
+VALUES
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'),
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc ');
+TRUNCATE TABLE t1;
+INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, text_column_name)
+VALUES
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '),
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc');
+DROP TABLE t1;
+CREATE TABLE `t1` (
+datetime_column_name_1 DATETIME(6) NOT NULL,
+datetime_column_name_2 DATETIME(6) NOT NULL,
+text_column_name TEXT COLLATE utf8mb4_unicode_nopad_ci NOT NULL,
+PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2),
+UNIQUE KEY index_name (text_column_name(191),period_name WITHOUT OVERLAPS)
+) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci;
+INSERT INTO t1 VALUES
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def '),
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def');
+TRUNCATE TABLE t1;
+INSERT INTO t1 VALUES
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def'),
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def '),
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def ');
+SELECT *, LENGTH(text_column_name) FROM t1;
+datetime_column_name_1 datetime_column_name_2 text_column_name LENGTH(text_column_name)
+2000-01-01 00:00:00.000000 2001-01-01 00:00:00.000000 def 3
+2000-01-01 00:00:00.000000 2001-01-01 00:00:00.000000 def 4
+2000-01-01 00:00:00.000000 2001-01-01 00:00:00.000000 def 5
+DROP TABLE t1;
+CREATE TABLE t1 (
+datetime_column_name_1 DATETIME(6) NOT NULL,
+datetime_column_name_2 DATETIME(6) NOT NULL,
+text_column_name TEXT COLLATE utf8mb4_unicode_nopad_ci NOT NULL,
+PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2),
+UNIQUE KEY index_name (text_column_name(3),period_name WITHOUT OVERLAPS)
+) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci;
+INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, text_column_name)
+VALUES
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'),
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc ');
+ERROR 23000: Duplicate entry 'abc-2001-01-01 00:00:00.000000-2000-01-01 00:00:00.000000' for key 'index_name'
+TRUNCATE TABLE t1;
+INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, text_column_name)
+VALUES
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '),
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc');
+ERROR 23000: Duplicate entry 'abc-2001-01-01 00:00:00.000000-2000-01-01 00:00:00.000000' for key 'index_name'
+DROP TABLE t1;
+CREATE TABLE t1 (
+datetime_column_name_1 DATETIME(6) NOT NULL,
+datetime_column_name_2 DATETIME(6) NOT NULL,
+char_column_name CHAR(255) COLLATE utf8mb4_unicode_nopad_ci NOT NULL,
+PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2),
+UNIQUE KEY index_name (char_column_name(191),period_name WITHOUT OVERLAPS)
+) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci;
+INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, char_column_name)
+VALUES
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'),
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc ');
+ERROR 23000: Duplicate entry 'abc-2001-01-01 00:00:00.000000-2000-01-01 00:00:00.000000' for key 'index_name'
+TRUNCATE TABLE t1;
+INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, char_column_name)
+VALUES
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '),
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc');
+ERROR 23000: Duplicate entry 'abc-2001-01-01 00:00:00.000000-2000-01-01 00:00:00.000000' for key 'index_name'
+DROP TABLE t1;
+CREATE TABLE t1 (
+datetime_column_name_1 DATETIME(6) NOT NULL,
+datetime_column_name_2 DATETIME(6) NOT NULL,
+char_column_name CHAR(255) COLLATE utf8mb4_unicode_nopad_ci NOT NULL,
+PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2),
+UNIQUE KEY index_name (char_column_name(3),period_name WITHOUT OVERLAPS)
+) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci;
+INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, char_column_name)
+VALUES
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'),
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc ');
+ERROR 23000: Duplicate entry 'abc-2001-01-01 00:00:00.000000-2000-01-01 00:00:00.000000' for key 'index_name'
+TRUNCATE TABLE t1;
+INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, char_column_name)
+VALUES
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '),
+('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc');
+ERROR 23000: Duplicate entry 'abc-2001-01-01 00:00:00.000000-2000-01-01 00:00:00.000000' for key 'index_name'
+DROP TABLE t1;
diff --git a/mysql-test/suite/period/t/overlaps.test b/mysql-test/suite/period/t/overlaps.test
index 6cd78769d4a..4611aa15ddd 100644
--- a/mysql-test/suite/period/t/overlaps.test
+++ b/mysql-test/suite/period/t/overlaps.test
@@ -344,3 +344,113 @@ create or replace table t (id int, s date, e date, period for p(s,e),
update t set id = 1;
drop table t, t1;
+
+--echo #
+--echo # MDEV-30415 PERIOD false positive overlap wtih utf8mb4_unicode_nopad_ci
+--echo #
+
+# The originally reported script with a TEXT column (slightly modified)
+CREATE TABLE t1 (
+ datetime_column_name_1 DATETIME(6) NOT NULL,
+ datetime_column_name_2 DATETIME(6) NOT NULL,
+ text_column_name TEXT COLLATE utf8mb4_unicode_nopad_ci NOT NULL,
+ PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2),
+ UNIQUE KEY index_name (text_column_name(191),period_name WITHOUT OVERLAPS)
+) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci;
+INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, text_column_name)
+VALUES
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'),
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc ');
+TRUNCATE TABLE t1;
+INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, text_column_name)
+VALUES
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '),
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc');
+DROP TABLE t1;
+
+
+# The script reported by Alice with a TEXT column
+CREATE TABLE `t1` (
+ datetime_column_name_1 DATETIME(6) NOT NULL,
+ datetime_column_name_2 DATETIME(6) NOT NULL,
+ text_column_name TEXT COLLATE utf8mb4_unicode_nopad_ci NOT NULL,
+ PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2),
+ UNIQUE KEY index_name (text_column_name(191),period_name WITHOUT OVERLAPS)
+) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci;
+INSERT INTO t1 VALUES
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def '),
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def');
+TRUNCATE TABLE t1;
+INSERT INTO t1 VALUES
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def'),
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def '),
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def ');
+--sorted_result
+SELECT *, LENGTH(text_column_name) FROM t1;
+DROP TABLE t1;
+
+
+# A TEXT column with a short prefix
+CREATE TABLE t1 (
+ datetime_column_name_1 DATETIME(6) NOT NULL,
+ datetime_column_name_2 DATETIME(6) NOT NULL,
+ text_column_name TEXT COLLATE utf8mb4_unicode_nopad_ci NOT NULL,
+ PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2),
+ UNIQUE KEY index_name (text_column_name(3),period_name WITHOUT OVERLAPS)
+) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci;
+--error ER_DUP_ENTRY
+INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, text_column_name)
+VALUES
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'),
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc ');
+TRUNCATE TABLE t1;
+--error ER_DUP_ENTRY
+INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, text_column_name)
+VALUES
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '),
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc');
+DROP TABLE t1;
+
+
+# A CHAR with a long prefix
+CREATE TABLE t1 (
+ datetime_column_name_1 DATETIME(6) NOT NULL,
+ datetime_column_name_2 DATETIME(6) NOT NULL,
+ char_column_name CHAR(255) COLLATE utf8mb4_unicode_nopad_ci NOT NULL,
+ PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2),
+ UNIQUE KEY index_name (char_column_name(191),period_name WITHOUT OVERLAPS)
+) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci;
+--error ER_DUP_ENTRY
+INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, char_column_name)
+VALUES
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'),
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc ');
+TRUNCATE TABLE t1;
+--error ER_DUP_ENTRY
+INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, char_column_name)
+VALUES
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '),
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc');
+DROP TABLE t1;
+
+
+# A CHAR column with a short prefix
+CREATE TABLE t1 (
+ datetime_column_name_1 DATETIME(6) NOT NULL,
+ datetime_column_name_2 DATETIME(6) NOT NULL,
+ char_column_name CHAR(255) COLLATE utf8mb4_unicode_nopad_ci NOT NULL,
+ PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2),
+ UNIQUE KEY index_name (char_column_name(3),period_name WITHOUT OVERLAPS)
+) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci;
+--error ER_DUP_ENTRY
+INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, char_column_name)
+VALUES
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'),
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc ');
+TRUNCATE TABLE t1;
+--error ER_DUP_ENTRY
+INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, char_column_name)
+VALUES
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '),
+ ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc');
+DROP TABLE t1;
diff --git a/mysql-test/suite/plugins/r/feedback_plugin_install.result b/mysql-test/suite/plugins/r/feedback_plugin_install.result
index c7f7a5c79f3..d2291f20b4f 100644
--- a/mysql-test/suite/plugins/r/feedback_plugin_install.result
+++ b/mysql-test/suite/plugins/r/feedback_plugin_install.result
@@ -11,6 +11,6 @@ FEEDBACK version 1.1
FEEDBACK_HTTP_PROXY
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
-FEEDBACK_URL http://mariadb.org/feedback_plugin/post
+FEEDBACK_URL http://feedback.mariadb.org/rest/v1/post
FEEDBACK_USER_INFO mysql-test
uninstall plugin feedback;
diff --git a/mysql-test/suite/plugins/r/feedback_plugin_load.result b/mysql-test/suite/plugins/r/feedback_plugin_load.result
index f31c7325ca1..23376c684dd 100644
--- a/mysql-test/suite/plugins/r/feedback_plugin_load.result
+++ b/mysql-test/suite/plugins/r/feedback_plugin_load.result
@@ -13,7 +13,7 @@ FEEDBACK version 1.1
FEEDBACK_HTTP_PROXY
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
-FEEDBACK_URL http://mariadb.org/feedback_plugin/post
+FEEDBACK_URL http://feedback.mariadb.org/rest/v1/post
FEEDBACK_USER_INFO mysql-test
SELECT VARIABLE_VALUE>0, VARIABLE_NAME FROM INFORMATION_SCHEMA.FEEDBACK
WHERE VARIABLE_NAME LIKE 'Collation used %'
diff --git a/mysql-test/suite/plugins/r/feedback_plugin_send.result b/mysql-test/suite/plugins/r/feedback_plugin_send.result
index b10ea915a4f..1f7539978c8 100644
--- a/mysql-test/suite/plugins/r/feedback_plugin_send.result
+++ b/mysql-test/suite/plugins/r/feedback_plugin_send.result
@@ -13,7 +13,7 @@ FEEDBACK version 1.1
FEEDBACK_HTTP_PROXY
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
-FEEDBACK_URL http://mariadb.org/feedback_plugin/post
+FEEDBACK_URL http://feedback.mariadb.org/rest/v1/post
FEEDBACK_USER_INFO mysql-test
SELECT VARIABLE_VALUE>0, VARIABLE_NAME FROM INFORMATION_SCHEMA.FEEDBACK
WHERE VARIABLE_NAME LIKE 'Collation used %'
@@ -42,5 +42,5 @@ VARIABLE_VALUE>0 VARIABLE_NAME
deallocate prepare stmt;
set global sql_mode=ONLY_FULL_GROUP_BY;
# restart
-feedback plugin: report to 'http://mariadb.org/feedback_plugin/post' was sent
+feedback plugin: report to 'http://feedback.mariadb.org/rest/v1/post' was sent
feedback plugin: server replied 'ok'
diff --git a/mysql-test/suite/plugins/r/locales.result b/mysql-test/suite/plugins/r/locales.result
index a6848fb8486..de71d9548f7 100644
--- a/mysql-test/suite/plugins/r/locales.result
+++ b/mysql-test/suite/plugins/r/locales.result
@@ -57,7 +57,7 @@ ID NAME DESCRIPTION MAX_MONTH_NAME_LENGTH MAX_DAY_NAME_LENGTH DECIMAL_POINT THOU
53 uk_UA Ukrainian - Ukraine 8 9 , . ukrainian
54 ur_PK Urdu - Pakistan 6 6 . , english
55 vi_VN Vietnamese - Vietnam 16 11 , . english
-56 zh_CN Chinese - Peoples Republic of China 3 3 . , english
+56 zh_CN Chinese - Peoples Republic of China 3 3 . , chinese
57 zh_TW Chinese - Taiwan 3 2 . , english
58 ar_DZ Arabic - Algeria 6 8 . , english
59 ar_EG Arabic - Egypt 6 8 . , english
@@ -171,7 +171,7 @@ Id Name Description Error_Message_Language
53 uk_UA Ukrainian - Ukraine ukrainian
54 ur_PK Urdu - Pakistan english
55 vi_VN Vietnamese - Vietnam english
-56 zh_CN Chinese - Peoples Republic of China english
+56 zh_CN Chinese - Peoples Republic of China chinese
57 zh_TW Chinese - Taiwan english
58 ar_DZ Arabic - Algeria english
59 ar_EG Arabic - Egypt english
diff --git a/mysql-test/suite/roles/role_grant_propagate.result b/mysql-test/suite/roles/role_grant_propagate.result
index 7804b7b7a3c..111fd4dbc28 100644
--- a/mysql-test/suite/roles/role_grant_propagate.result
+++ b/mysql-test/suite/roles/role_grant_propagate.result
@@ -163,5 +163,18 @@ drop role student;
drop role admin;
drop database crm;
#
+# MDEV-30526 Assertion `rights == merged->cols' failed in update_role_columns
+#
+create table t1 ( pk int, i int);
+create role a;
+grant select (i), update (pk) on t1 to a;
+revoke update (pk) on t1 from a;
+show grants for a;
+Grants for a
+GRANT USAGE ON *.* TO `a`
+GRANT SELECT (`i`) ON `test`.`t1` TO `a`
+drop role a;
+drop table t1;
+#
# End of 10.3 tests
#
diff --git a/mysql-test/suite/roles/role_grant_propagate.test b/mysql-test/suite/roles/role_grant_propagate.test
index bf20bc00809..02d451f0afd 100644
--- a/mysql-test/suite/roles/role_grant_propagate.test
+++ b/mysql-test/suite/roles/role_grant_propagate.test
@@ -197,5 +197,16 @@ drop role admin;
drop database crm;
--echo #
+--echo # MDEV-30526 Assertion `rights == merged->cols' failed in update_role_columns
+--echo #
+create table t1 ( pk int, i int);
+create role a;
+grant select (i), update (pk) on t1 to a;
+revoke update (pk) on t1 from a;
+show grants for a;
+drop role a;
+drop table t1;
+
+--echo #
--echo # End of 10.3 tests
--echo #
diff --git a/mysql-test/suite/rpl/include/rpl_binlog_errors.inc b/mysql-test/suite/rpl/include/rpl_binlog_errors.inc
deleted file mode 100644
index ab95c9b4ee3..00000000000
--- a/mysql-test/suite/rpl/include/rpl_binlog_errors.inc
+++ /dev/null
@@ -1,443 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-# Usage:
-# --let $binlog_limit= X[,Y] # optional
-#
-# Semantics of the value is the same as in include/show_binlog_events.inc
-# which the script calls as a part of the test flow.
-# The goal is to print the event demonstrating the triggered error,
-# so normally Y should be 1 (print the exact event only);
-# however, depending on test-specific server options, the offset X
-# can be different.
-#
-
-# BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error
-# when generating new name.
-#
-# WHY
-# ===
-#
-# We want to check whether error is reported or not when
-# new_file_impl fails (this may happen when rotation is not
-# possible because there is some problem finding an
-# unique filename).
-#
-# HOW
-# ===
-#
-# Test cases are documented inline.
-
--- source include/have_innodb.inc
--- source include/have_debug.inc
--- source include/master-slave.inc
-
--- echo #######################################################################
--- echo ####################### PART 1: MASTER TESTS ##########################
--- echo #######################################################################
-
-
-### ACTION: stopping slave as it is not needed for the first part of
-### the test
-
--- connection slave
--- source include/stop_slave.inc
--- connection master
-
-call mtr.add_suppression("Can't generate a unique log-filename");
-call mtr.add_suppression("Writing one row to the row-based binary log failed.*");
-call mtr.add_suppression("Error writing file .*");
-call mtr.add_suppression("Could not use master-bin for logging");
-
-SET @old_debug= @@global.debug_dbug;
-
-### ACTION: create a large file (> 4096 bytes) that will be later used
-### in LOAD DATA INFILE to check binlog errors in its vacinity
--- let $load_file= $MYSQLTEST_VARDIR/tmp/bug_46166.data
--- let $MYSQLD_DATADIR= `select @@datadir`
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval SELECT repeat('x',8192) INTO OUTFILE '$load_file'
-
-### ACTION: create a small file (< 4096 bytes) that will be later used
-### in LOAD DATA INFILE to check for absence of binlog errors
-### when file loading this file does not force flushing and
-### rotating the binary log
--- let $load_file2= $MYSQLTEST_VARDIR/tmp/bug_46166-2.data
--- let $MYSQLD_DATADIR= `select @@datadir`
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval SELECT repeat('x',10) INTO OUTFILE '$load_file2'
-
-RESET MASTER;
-
--- echo ###################### TEST #1
-
-### ASSERTION: no problem flushing logs (should show two binlogs)
-FLUSH LOGS;
--- echo # assert: must show two binlogs
--- source include/show_binary_logs.inc
-
--- echo ###################### TEST #2
-
-### ASSERTION: check that FLUSH LOGS actually fails and reports
-### failure back to the user if find_uniq_filename fails
-### (should show just one binlog)
-
-RESET MASTER;
-SET @@global.debug_dbug="d,error_unique_log_filename";
--- error ER_NO_UNIQUE_LOGFILE
-FLUSH LOGS;
--- echo # assert: must show one binlog
--- source include/show_binary_logs.inc
-
-### ACTION: clean up and move to next test
-SET @@global.debug_dbug=@old_debug;
-RESET MASTER;
-
--- echo ###################### TEST #3
-
-### ACTION: create some tables (t1, t2, t4) and insert some values in
-### table t1
-CREATE TABLE t1 (a INT);
-CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB;
-CREATE TABLE t4 (a VARCHAR(16384));
-INSERT INTO t1 VALUES (1);
-RESET MASTER;
-
-### ASSERTION: we force rotation of the binary log because it exceeds
-### the max_binlog_size option (should show two binary
-### logs)
-
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
-
-# shows two binary logs
--- echo # assert: must show two binlog
--- source include/show_binary_logs.inc
-
-# clean up the table and the binlog to be used in next part of test
-SET @@global.debug_dbug=@old_debug;
-DELETE FROM t2;
-RESET MASTER;
-
--- echo ###################### TEST #4
-
-### ASSERTION: load the big file into a transactional table and check
-### that it reports error. The table will contain the
-### changes performed despite the fact that it reported an
-### error.
-
-SET @@global.debug_dbug="d,error_unique_log_filename";
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- error ER_NO_UNIQUE_LOGFILE
--- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
-
-# show table
--- echo # assert: must show one entry
-SELECT count(*) FROM t2;
-
-# clean up the table and the binlog to be used in next part of test
-SET @@global.debug_dbug=@old_debug;
-DELETE FROM t2;
-RESET MASTER;
-
--- echo ###################### TEST #5
-
-### ASSERTION: load the small file into a transactional table and
-### check that it succeeds
-
-SET @@global.debug_dbug="d,error_unique_log_filename";
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval LOAD DATA INFILE '$load_file2' INTO TABLE t2
-
-# show table
--- echo # assert: must show one entry
-SELECT count(*) FROM t2;
-
-# clean up the table and the binlog to be used in next part of test
-SET @@global.debug_dbug=@old_debug;
-DELETE FROM t2;
-RESET MASTER;
-
--- echo ###################### TEST #6
-
-### ASSERTION: check that even if one is using a transactional table
-### and explicit transactions (no autocommit) if rotation
-### fails we get the error. Transaction is not rolledback
-### because rotation happens after the commit.
-
-SET @@global.debug_dbug="d,error_unique_log_filename";
-SET AUTOCOMMIT=0;
-INSERT INTO t2 VALUES ('muse');
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
-INSERT INTO t2 VALUES ('muse');
--- error ER_NO_UNIQUE_LOGFILE
-COMMIT;
-
-### ACTION: Show the contents of the table after the test
--- echo # assert: must show three entries
-SELECT count(*) FROM t2;
-
-### ACTION: clean up and move to the next test
-SET AUTOCOMMIT= 1;
-SET @@global.debug_dbug=@old_debug;
-DELETE FROM t2;
-RESET MASTER;
-
--- echo ###################### TEST #7
-
-### ASSERTION: check that on a non-transactional table, if rotation
-### fails then an error is reported and an incident event
-### is written to the current binary log.
-
-SET @@global.debug_dbug="d,error_unique_log_filename";
-
-# Disable logging Annotate_rows events to preserve events count.
-let $binlog_annotate_row_events_saved= `SELECT @@binlog_annotate_row_events`;
-SET @@binlog_annotate_row_events= 0;
-
-SELECT count(*) FROM t4;
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- error ER_NO_UNIQUE_LOGFILE
--- eval LOAD DATA INFILE '$load_file' INTO TABLE t4
-
--- echo # assert: must show 1 entry
-SELECT count(*) FROM t4;
-
--- echo ### check that the incident event is written to the current log
-SET @@global.debug_dbug=@old_debug;
-if (!$binlog_limit)
-{
- -- let $binlog_limit= 4,1
-}
--- source include/show_binlog_events.inc
-
-# clean up and move to next test
-DELETE FROM t4;
-
---disable_query_log
-eval SET @@binlog_annotate_row_events= $binlog_annotate_row_events_saved;
---enable_query_log
-
-RESET MASTER;
-
--- echo ###################### TEST #8
-
-### ASSERTION: check that statements end up in error but they succeed
-### on changing the data.
-
-SET @@global.debug_dbug="d,error_unique_log_filename";
--- echo # must show 0 entries
-SELECT count(*) FROM t4;
-SELECT count(*) FROM t2;
-
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- error ER_NO_UNIQUE_LOGFILE
--- eval LOAD DATA INFILE '$load_file' INTO TABLE t4
--- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--- error ER_NO_UNIQUE_LOGFILE
--- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
--- error ER_NO_UNIQUE_LOGFILE
-INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc');
-
--- echo # INFO: Count(*) Before Offending DELETEs
--- echo # assert: must show 1 entry
-SELECT count(*) FROM t4;
--- echo # assert: must show 4 entries
-SELECT count(*) FROM t2;
-
--- error ER_NO_UNIQUE_LOGFILE
-DELETE FROM t4;
--- error ER_NO_UNIQUE_LOGFILE
-DELETE FROM t2;
-
--- echo # INFO: Count(*) After Offending DELETEs
--- echo # assert: must show zero entries
-SELECT count(*) FROM t4;
-SELECT count(*) FROM t2;
-
-# remove fault injection
-SET @@global.debug_dbug=@old_debug;
-
--- echo ###################### TEST #9
-
-### ASSERTION: check that if we disable binlogging, then statements
-### succeed.
-SET @@global.debug_dbug="d,error_unique_log_filename";
-SET SQL_LOG_BIN=0;
-INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd');
-INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh');
--- echo # assert: must show four entries
-SELECT count(*) FROM t2;
-SELECT count(*) FROM t4;
-DELETE FROM t2;
-DELETE FROM t4;
--- echo # assert: must show zero entries
-SELECT count(*) FROM t2;
-SELECT count(*) FROM t4;
-SET SQL_LOG_BIN=1;
-SET @@global.debug_dbug=@old_debug;
-
--- echo ###################### TEST #10
-
-### ASSERTION: check that error is reported if there is a failure
-### while registering the index file and the binary log
-### file or failure to write the rotate event.
-
-call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
-call mtr.add_suppression("Could not use .*");
-
-RESET MASTER;
-SHOW WARNINGS;
-
-# +d,fault_injection_registering_index => injects fault on MYSQL_BIN_LOG::open
-SET @@global.debug_dbug="d,fault_injection_registering_index";
--- replace_regex /\.[\\\/]master/master/
--- error ER_CANT_OPEN_FILE
-FLUSH LOGS;
-SET @@global.debug_dbug=@old_debug;
-
--- error ER_NO_BINARY_LOGGING
-SHOW BINARY LOGS;
-
-# issue some statements and check that they don't fail
-CREATE TABLE t5 (a INT);
-INSERT INTO t4 VALUES ('bbbbb');
-INSERT INTO t2 VALUES ('aaaaa');
-DELETE FROM t4;
-DELETE FROM t2;
-DROP TABLE t5;
-flush tables;
-
--- echo ###################### TEST #11
-
-### ASSERTION: check that error is reported if there is a failure
-### while opening the index file and the binary log file or
-### failure to write the rotate event.
-
-# restart the server so that we have binlog again
---let $rpl_server_number= 1
---source include/rpl_restart_server.inc
-
-# +d,fault_injection_openning_index => injects fault on MYSQL_BIN_LOG::open_index_file
-SET @@global.debug_dbug="d,fault_injection_openning_index";
--- replace_regex /\.[\\\/]master/master/
--- error ER_CANT_OPEN_FILE
-FLUSH LOGS;
-SET @@global.debug_dbug=@old_debug;
-
--- error ER_FLUSH_MASTER_BINLOG_CLOSED
-RESET MASTER;
-
-# issue some statements and check that they don't fail
-CREATE TABLE t5 (a INT);
-INSERT INTO t4 VALUES ('bbbbb');
-INSERT INTO t2 VALUES ('aaaaa');
-DELETE FROM t4;
-DELETE FROM t2;
-DROP TABLE t5;
-flush tables;
-
-# restart the server so that we have binlog again
---let $rpl_server_number= 1
---source include/rpl_restart_server.inc
-
--- echo ###################### TEST #12
-
-### ASSERTION: check that error is reported if there is a failure
-### while writing the rotate event when creating a new log
-### file.
-
-# +d,fault_injection_new_file_rotate_event => injects fault on MYSQL_BIN_LOG::MYSQL_BIN_LOG::new_file_impl
-SET @@global.debug_dbug="d,fault_injection_new_file_rotate_event";
--- error ER_ERROR_ON_WRITE
-FLUSH LOGS;
-SET @@global.debug_dbug=@old_debug;
-
--- error ER_FLUSH_MASTER_BINLOG_CLOSED
-RESET MASTER;
-
-# issue some statements and check that they don't fail
-CREATE TABLE t5 (a INT);
-INSERT INTO t4 VALUES ('bbbbb');
-INSERT INTO t2 VALUES ('aaaaa');
-DELETE FROM t4;
-DELETE FROM t2;
-DROP TABLE t5;
-flush tables;
-
-# restart the server so that we have binlog again
---let $rpl_server_number= 1
---source include/rpl_restart_server.inc
-
-## clean up
-DROP TABLE t1, t2, t4;
-RESET MASTER;
-
-# restart slave again
--- connection slave
--- source include/start_slave.inc
--- connection master
-
--- echo #######################################################################
--- echo ####################### PART 2: SLAVE TESTS ###########################
--- echo #######################################################################
-
-### setup
---source include/rpl_reset.inc
--- connection slave
-
-# Slave tests rely on logic of non-gtid mode
---source include/stop_slave.inc
-CHANGE MASTER TO MASTER_USE_GTID=NO;
---source include/start_slave.inc
-
-# slave suppressions
-
-call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
-call mtr.add_suppression("Error writing file .*");
-call mtr.add_suppression("Could not use .*");
-call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
-call mtr.add_suppression("Can't generate a unique log-filename .*");
--- echo ###################### TEST #13
-
-#### ASSERTION: check against unique log filename error
--- let $io_thd_injection_fault_flag= error_unique_log_filename
--- let $slave_io_errno= 1595
--- let $show_slave_io_error= 1
--- source include/io_thd_fault_injection.inc
-
--- echo ###################### TEST #14
-
-#### ASSERTION: check against rotate failing
--- let $io_thd_injection_fault_flag= fault_injection_new_file_rotate_event
--- let $slave_io_errno= 1595
--- let $show_slave_io_error= 1
--- source include/io_thd_fault_injection.inc
-
--- echo ###################### TEST #15
-
-#### ASSERTION: check against relay log open failure
--- let $io_thd_injection_fault_flag= fault_injection_registering_index
--- let $slave_io_errno= 1595
--- let $show_slave_io_error= 1
--- source include/io_thd_fault_injection.inc
-
--- echo ###################### TEST #16
-
-#### ASSERTION: check against relay log index open failure
--- let $io_thd_injection_fault_flag= fault_injection_openning_index
--- let $slave_io_errno= 1595
--- let $show_slave_io_error= 1
--- source include/io_thd_fault_injection.inc
-
-### clean up
--- source include/stop_slave_sql.inc
-RESET SLAVE;
-RESET MASTER;
---remove_file $load_file
---remove_file $load_file2
---let $rpl_only_running_threads= 1
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_cant_read_event_incident.inc b/mysql-test/suite/rpl/include/rpl_cant_read_event_incident.inc
deleted file mode 100644
index 7c1d0ea25e2..00000000000
--- a/mysql-test/suite/rpl/include/rpl_cant_read_event_incident.inc
+++ /dev/null
@@ -1,88 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
-#
-# Bug#11747416 : 32228 A disk full makes binary log corrupt.
-#
-#
-# The test demonstrates reading from binlog error propagation to slave
-# and reporting there.
-# Conditions for the bug include a crash at time of the last event to
-# the binlog was written partly. With the fixes the event is not sent out
-# any longer, but rather the dump thread sends out a sound error message.
-#
-# Crash is not simulated. A binlog with partly written event in its end is installed
-# and replication is started from it.
-#
-
---source include/have_binlog_format_mixed.inc
---source include/master-slave.inc
-
---connection slave
---source include/stop_slave.inc
-CHANGE MASTER TO MASTER_USE_GTID=NO;
---source include/start_slave.inc
-
-# Make sure the slave is stopped while we are messing with master.
-# Otherwise we get occasional failures as the slave manages to re-connect
-# to the newly started master and we get extra events applied, causing
-# conflicts.
---source include/stop_slave.inc
-
---connection master
-call mtr.add_suppression("Error in Log_event::read_log_event()");
---let $datadir= `SELECT @@datadir`
-
---let $rpl_server_number= 1
---source include/rpl_stop_server.inc
-
---remove_file $datadir/master-bin.000001
---copy_file $MYSQL_TEST_DIR/std_data/bug11747416_32228_binlog.000001 $datadir/master-bin.000001
-
---let $rpl_server_number= 1
---source include/rpl_start_server.inc
-
---source include/wait_until_connected_again.inc
-
-# evidence of the partial binlog
---error ER_ERROR_WHEN_EXECUTING_COMMAND
-show binlog events;
-
---connection slave
-call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
---let $master_use_gtid_option= No
---source include/reset_slave.inc
-start slave;
-
-# ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
---let $slave_param=Last_IO_Errno
---let $slave_param_value=1236
---source include/wait_for_slave_param.inc
-
---let $slave_field_result_replace= / at [0-9]*/ at XXX/
---let $status_items= Last_IO_Errno, Last_IO_Error
---source include/show_slave_status.inc
-
-#
-# Cleanup
-#
-
---connection master
-reset master;
-
---connection slave
-stop slave;
-reset slave;
-# Table was created from binlog, it may not be created if SQL thread is running
-# slowly and IO thread reaches incident before SQL thread applies it.
---disable_warnings
-drop table if exists t;
---enable_warnings
-reset master;
-
---echo End of the tests
---let $rpl_only_running_threads= 1
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_checksum.inc b/mysql-test/suite/rpl/include/rpl_checksum.inc
deleted file mode 100644
index fc765744b3f..00000000000
--- a/mysql-test/suite/rpl/include/rpl_checksum.inc
+++ /dev/null
@@ -1,342 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
-# WL2540 replication events checksum
-# Testing configuration parameters
-
---source include/have_debug.inc
---source include/have_binlog_format_mixed.inc
---source include/master-slave.inc
-
---connection slave
---source include/stop_slave.inc
-CHANGE MASTER TO MASTER_USE_GTID=NO;
---source include/start_slave.inc
-
---connection master
-call mtr.add_suppression('Slave can not handle replication events with the checksum that master is configured to log');
-call mtr.add_suppression('Replication event checksum verification failed');
-# due to C failure simulation
-call mtr.add_suppression('Relay log write failure: could not queue event from master');
-call mtr.add_suppression('Master is configured to log replication events with checksum, but will not send such events to slaves that cannot process them');
-
-# A. read/write access to the global vars:
-# binlog_checksum master_verify_checksum slave_sql_verify_checksum
-
-connection master;
-
-set @master_save_binlog_checksum= @@global.binlog_checksum;
-set @save_master_verify_checksum = @@global.master_verify_checksum;
-
-select @@global.binlog_checksum as 'must be CRC32 because of the command line option';
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.binlog_checksum as 'no session var';
-
-select @@global.master_verify_checksum as 'must be zero because of default';
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.master_verify_checksum as 'no session var';
-
-connection slave;
-
-set @slave_save_binlog_checksum= @@global.binlog_checksum;
-set @save_slave_sql_verify_checksum = @@global.slave_sql_verify_checksum;
-
-select @@global.slave_sql_verify_checksum as 'must be one because of default';
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.slave_sql_verify_checksum as 'no session var';
-
-connection master;
-
-source include/show_binary_logs.inc;
-set @@global.binlog_checksum = NONE;
-select @@global.binlog_checksum;
---echo *** must be rotations seen ***
-source include/show_binary_logs.inc;
-
-set @@global.binlog_checksum = default;
-select @@global.binlog_checksum;
-
-# testing lack of side-effects in non-effective update of binlog_checksum:
-set @@global.binlog_checksum = CRC32;
-select @@global.binlog_checksum;
-set @@global.binlog_checksum = CRC32;
-
-set @@global.master_verify_checksum = 0;
-set @@global.master_verify_checksum = default;
-
---error ER_WRONG_VALUE_FOR_VAR
-set @@global.binlog_checksum = ADLER32;
---error ER_WRONG_VALUE_FOR_VAR
-set @@global.master_verify_checksum = 2; # the var is of bool type
-
-connection slave;
-
-set @@global.slave_sql_verify_checksum = 0;
-set @@global.slave_sql_verify_checksum = default;
---error ER_WRONG_VALUE_FOR_VAR
-set @@global.slave_sql_verify_checksum = 2; # the var is of bool type
-
-#
-# B. Old Slave to New master conditions
-#
-# while master does not send a checksum-ed binlog the Old Slave can
-# work with the New Master
-
-connection master;
-
-set @@global.binlog_checksum = NONE;
-create table t1 (a int);
-
-# testing that binlog rotation preserves opt_binlog_checksum value
-flush logs;
-flush logs;
--- source include/wait_for_binlog_checkpoint.inc
-flush logs;
-
-sync_slave_with_master;
-#connection slave;
-# checking that rotation on the slave side leaves slave stable
-flush logs;
-flush logs;
-flush logs;
-select count(*) as zero from t1;
-
-source include/stop_slave.inc;
-
-connection master;
-set @@global.binlog_checksum = CRC32;
--- source include/wait_for_binlog_checkpoint.inc
-insert into t1 values (1) /* will not be applied on slave due to simulation */;
-
-# instruction to the dump thread
-
-connection slave;
-set @saved_dbug = @@global.debug_dbug;
-set @@global.debug_dbug='d,simulate_slave_unaware_checksum';
-start slave;
---let $slave_io_errno= 1236
---let $show_slave_io_error= 1
-source include/wait_for_slave_io_error.inc;
-
-select count(*) as zero from t1;
-
-set @@global.debug_dbug = @saved_dbug;
-
-connection slave;
-source include/start_slave.inc;
-
-#
-# C. checksum failure simulations
-#
-
-# C1. Failure by a client thread
-connection master;
-set @@global.master_verify_checksum = 1;
-set @save_dbug = @@session.debug_dbug;
-set @@session.debug_dbug='d,simulate_checksum_test_failure';
---error ER_ERROR_WHEN_EXECUTING_COMMAND
-show binlog events;
-SET debug_dbug= @save_dbug;
-set @@global.master_verify_checksum = default;
-
-#connection master;
-sync_slave_with_master;
-
-connection slave;
-source include/stop_slave.inc;
-
-connection master;
-create table t2 (a int);
-let $pos_master= query_get_value(SHOW MASTER STATUS, Position, 1);
-
-connection slave;
-
-# C2. Failure by IO thread
-# instruction to io thread
-set @saved_dbug = @@global.debug_dbug;
-set @@global.debug_dbug='d,simulate_checksum_test_failure';
-start slave io_thread;
-# When the checksum error is detected, the slave sets error code 1913
-# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately
-# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io().
-# So we usually get 1595, but it is occasionally possible to get 1913.
---let $slave_io_errno= 1595,1913
---let $show_slave_io_error= 0
-source include/wait_for_slave_io_error.inc;
-set @@global.debug_dbug = @saved_dbug;
-
-# to make IO thread re-read it again w/o the failure
-start slave io_thread;
-let $slave_param= Read_Master_Log_Pos;
-let $slave_param_value= $pos_master;
-source include/wait_for_slave_param.inc;
-
-# C3. Failure by SQL thread
-# instruction to sql thread;
-set @@global.slave_sql_verify_checksum = 1;
-
-set @@global.debug_dbug='d,simulate_checksum_test_failure';
-
-start slave sql_thread;
---let $slave_sql_errno= 1593
---let $show_slave_sql_error= 1
-source include/wait_for_slave_sql_error.inc;
-
-# resuming SQL thread to parse out the event w/o the failure
-
-set @@global.debug_dbug = @saved_dbug;
-source include/start_slave.inc;
-
-connection master;
-sync_slave_with_master;
-
-#connection slave;
-select count(*) as 'must be zero' from t2;
-
-#
-# D. Reset slave, Change-Master, Binlog & Relay-log rotations with
-# random value on binlog_checksum on both master and slave
-#
-connection slave;
-stop slave;
---let $master_use_gtid_option= No
---source include/reset_slave.inc
-
-# randomize slave server's own checksum policy
-set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
-flush logs;
-
-connection master;
-set @@global.binlog_checksum= CRC32;
-reset master;
-flush logs;
-create table t3 (a int, b char(5));
-
-connection slave;
-source include/start_slave.inc;
-
-connection master;
-sync_slave_with_master;
-
-#connection slave;
-select count(*) as 'must be zero' from t3;
-source include/stop_slave.inc;
---replace_result $MASTER_MYPORT MASTER_PORT
-eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
-
-connection master;
-flush logs;
-reset master;
-insert into t3 value (1, @@global.binlog_checksum);
-
-connection slave;
-source include/start_slave.inc;
-flush logs;
-
-connection master;
-sync_slave_with_master;
-
-#connection slave;
-select count(*) as 'must be one' from t3;
-
-connection master;
-set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
-insert into t3 value (1, @@global.binlog_checksum);
-sync_slave_with_master;
-
-#connection slave;
-
-#clean-up
-
-connection master;
-drop table t1, t2, t3;
-set @@global.binlog_checksum = @master_save_binlog_checksum;
-set @@global.master_verify_checksum = @save_master_verify_checksum;
-
-#
-# BUG#58564: flush_read_lock fails in mysql-trunk-bugfixing after merging with WL#2540
-#
-# Sanity check that verifies that no assertions are triggered because
-# of old FD events (generated by versions prior to server released with
-# checksums feature)
-#
-# There is no need for query log, if something wrong this should trigger
-# an assertion
-
---disable_query_log
-
-BINLOG '
-MfmqTA8BAAAAZwAAAGsAAAABAAQANS41LjctbTMtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAx+apMEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
-';
-
---enable_query_log
-
-#connection slave;
-sync_slave_with_master;
-
-
---echo *** Bug#59123 / MDEV-5799: INCIDENT_EVENT checksum written to error log as garbage characters ***
-
---connection master
-
---source include/wait_for_binlog_checkpoint.inc
-CREATE TABLE t4 (a INT PRIMARY KEY);
-INSERT INTO t4 VALUES (1);
-
-SET sql_log_bin=0;
-CALL mtr.add_suppression("\\[ERROR\\] Can't generate a unique log-filename");
-SET sql_log_bin=1;
-SET @old_dbug= @@GLOBAL.debug_dbug;
-SET debug_dbug= '+d,binlog_inject_new_name_error';
---error ER_NO_UNIQUE_LOGFILE
-FLUSH LOGS;
-SET debug_dbug= @old_dbug;
-
-INSERT INTO t4 VALUES (2);
-
---connection slave
---let $slave_sql_errno= 1590
---source include/wait_for_slave_sql_error.inc
-
-# Search the error log for the error message.
-# The bug was that 4 garbage bytes were output in the middle of the error
-# message; by searching for a pattern that spans that location, we can
-# catch the error.
-let $log_error_= `SELECT @@GLOBAL.log_error`;
-if(!$log_error_)
-{
- # MySQL Server on windows is started with --console and thus
- # does not know the location of its .err log, use default location
- let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
-}
---let SEARCH_FILE= $log_error_
---let SEARCH_PATTERN= Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590
---source include/search_pattern_in_file.inc
-
-SELECT * FROM t4 ORDER BY a;
-STOP SLAVE IO_THREAD;
-SET sql_slave_skip_counter= 1;
---source include/start_slave.inc
-
---connection master
---save_master_pos
-
---connection slave
---sync_with_master
-SELECT * FROM t4 ORDER BY a;
-
-
---connection slave
-set @@global.binlog_checksum = @slave_save_binlog_checksum;
-set @@global.slave_sql_verify_checksum = @save_slave_sql_verify_checksum;
-
---echo End of tests
-
---connection master
-DROP TABLE t4;
-
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_checksum_cache.inc b/mysql-test/suite/rpl/include/rpl_checksum_cache.inc
deleted file mode 100644
index e04f618b81e..00000000000
--- a/mysql-test/suite/rpl/include/rpl_checksum_cache.inc
+++ /dev/null
@@ -1,261 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
--- source include/have_innodb.inc
--- source include/master-slave.inc
-
---disable_warnings
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. .*Statement: insert into t2 set data=repeat.*'a', @act_size.*");
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. .*Statement: insert into t1 values.* NAME_CONST.*'n',.*, @data .*");
---enable_warnings
-
-connection master;
-set @save_binlog_cache_size = @@global.binlog_cache_size;
-set @save_binlog_checksum = @@global.binlog_checksum;
-set @save_master_verify_checksum = @@global.master_verify_checksum;
-set @@global.binlog_cache_size = 4096;
-set @@global.binlog_checksum = CRC32;
-set @@global.master_verify_checksum = 1;
-
-# restart slave to force the dump thread to verify events (on master side)
-connection slave;
-source include/stop_slave.inc;
-source include/start_slave.inc;
-
-connection master;
-
-#
-# Testing a critical part of checksum handling dealing with transaction cache.
-# The cache's buffer size is set to be less than the transaction's footprint
-# in binlog.
-#
-# To verify combined buffer-by-buffer read out of the file and fixing crc per event
-# there are the following parts:
-#
-# 1. the event size is much less than the cache's buffer
-# 2. the event size is bigger than the cache's buffer
-# 3. the event size if approximately the same as the cache's buffer
-# 4. all in above
-
-#
-# 1. the event size is much less than the cache's buffer
-#
-
-flush status;
-show status like "binlog_cache_use";
-show status like "binlog_cache_disk_use";
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#
-# parameter to ensure the test slightly varies binlog content
-# between different invocations
-#
-let $deviation_size=32;
-eval create table t1 (a int PRIMARY KEY, b CHAR($deviation_size)) engine=innodb;
-
-# Now we are going to create transaction which is long enough so its
-# transaction binlog will be flushed to disk...
-
-delimiter |;
-create procedure test.p_init (n int, size int)
-begin
- while n > 0 do
- select round(RAND() * size) into @act_size;
- set @data = repeat('a', @act_size);
- insert into t1 values(n, @data );
- set n= n-1;
- end while;
-end|
-
-delimiter ;|
-
-let $1 = 4000; # PB2 can run it slow to time out on following sync_slave_with_master:s
-
-begin;
---disable_warnings
-# todo: check if it is really so.
-#+Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave.
-eval call test.p_init($1, $deviation_size);
---enable_warnings
-commit;
-
-show status like "binlog_cache_use";
---echo *** binlog_cache_disk_use must be non-zero ***
-show status like "binlog_cache_disk_use";
-
-sync_slave_with_master;
-
-let $diff_tables=master:test.t1, slave:test.t1;
-source include/diff_tables.inc;
-
-# undoing changes with verifying the above once again
-connection master;
-
-begin;
-delete from t1;
-commit;
-
-sync_slave_with_master;
-
-
-#
-# 2. the event size is bigger than the cache's buffer
-#
-connection master;
-
-flush status;
-let $t2_data_size= `select 3 * @@global.binlog_cache_size`;
-let $t2_aver_size= `select 2 * @@global.binlog_cache_size`;
-let $t2_max_rand= `select 1 * @@global.binlog_cache_size`;
-
-eval create table t2(a int auto_increment primary key, data VARCHAR($t2_data_size)) ENGINE=Innodb;
-let $1=100;
---disable_query_log
-begin;
-while ($1)
-{
- eval select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size;
- set @data = repeat('a', @act_size);
- insert into t2 set data = @data;
- dec $1;
-}
-commit;
---enable_query_log
-show status like "binlog_cache_use";
---echo *** binlog_cache_disk_use must be non-zero ***
-show status like "binlog_cache_disk_use";
-
-sync_slave_with_master;
-
-let $diff_tables=master:test.t2, slave:test.t2;
-source include/diff_tables.inc;
-
-# undoing changes with verifying the above once again
-connection master;
-
-begin;
-delete from t2;
-commit;
-
-sync_slave_with_master;
-
-#
-# 3. the event size if approximately the same as the cache's buffer
-#
-
-connection master;
-
-flush status;
-let $t3_data_size= `select 2 * @@global.binlog_cache_size`;
-let $t3_aver_size= `select (9 * @@global.binlog_cache_size) / 10`;
-let $t3_max_rand= `select (2 * @@global.binlog_cache_size) / 10`;
-
-eval create table t3(a int auto_increment primary key, data VARCHAR($t3_data_size)) engine=innodb;
-
-let $1= 300;
---disable_query_log
-begin;
-while ($1)
-{
- eval select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size;
- insert into t3 set data= repeat('a', @act_size);
- dec $1;
-}
-commit;
---enable_query_log
-show status like "binlog_cache_use";
---echo *** binlog_cache_disk_use must be non-zero ***
-show status like "binlog_cache_disk_use";
-
-sync_slave_with_master;
-
-let $diff_tables=master:test.t3, slave:test.t3;
-source include/diff_tables.inc;
-
-# undoing changes with verifying the above once again
-connection master;
-
-begin;
-delete from t3;
-commit;
-
-sync_slave_with_master;
-
-
-#
-# 4. all in above
-#
-
-connection master;
-flush status;
-
-delimiter |;
-eval create procedure test.p1 (n int)
-begin
- while n > 0 do
- case (select (round(rand()*100) % 3) + 1)
- when 1 then
- select round(RAND() * $deviation_size) into @act_size;
- set @data = repeat('a', @act_size);
- insert into t1 values(n, @data);
- when 2 then
- begin
- select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size;
- insert into t2 set data=repeat('a', @act_size);
- end;
- when 3 then
- begin
- select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size;
- insert into t3 set data= repeat('a', @act_size);
- end;
- end case;
- set n= n-1;
- end while;
-end|
-delimiter ;|
-
-let $1= 1000;
-set autocommit= 0;
-begin;
---disable_warnings
-eval call test.p1($1);
---enable_warnings
-commit;
-
-show status like "binlog_cache_use";
---echo *** binlog_cache_disk_use must be non-zero ***
-show status like "binlog_cache_disk_use";
-
-sync_slave_with_master;
-
-let $diff_tables=master:test.t1, slave:test.t1;
-source include/diff_tables.inc;
-
-let $diff_tables=master:test.t2, slave:test.t2;
-source include/diff_tables.inc;
-
-let $diff_tables=master:test.t3, slave:test.t3;
-source include/diff_tables.inc;
-
-
-connection master;
-
-begin;
-delete from t1;
-delete from t2;
-delete from t3;
-commit;
-
-drop table t1, t2, t3;
-set @@global.binlog_cache_size = @save_binlog_cache_size;
-set @@global.binlog_checksum = @save_binlog_checksum;
-set @@global.master_verify_checksum = @save_master_verify_checksum;
-drop procedure test.p_init;
-drop procedure test.p1;
-
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_corruption.inc b/mysql-test/suite/rpl/include/rpl_corruption.inc
deleted file mode 100644
index cd2a1cc7ef2..00000000000
--- a/mysql-test/suite/rpl/include/rpl_corruption.inc
+++ /dev/null
@@ -1,181 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
-############################################################
-# Purpose: WL#5064 Testing with corrupted events.
-# The test emulates the corruption at the vary stages
-# of replication:
-# - in binlog file
-# - in network
-# - in relay log
-############################################################
-
-#
-# The tests intensively utilize @@global.debug. Note,
-# Bug#11765758 - 58754,
-# @@global.debug is read by the slave threads through dbug-interface.
-# Hence, before a client thread set @@global.debug we have to ensure that:
-# (a) the slave threads are stopped, or (b) the slave threads are in
-# sync and waiting.
-
---source include/have_debug.inc
---source include/master-slave.inc
-
---connection slave
---source include/stop_slave.inc
-CHANGE MASTER TO MASTER_USE_GTID=NO;
---source include/start_slave.inc
---connection master
-
-# Block legal errors for MTR
-call mtr.add_suppression('Found invalid event in binary log');
-call mtr.add_suppression('Slave I/O: Relay log write failure: could not queue event from master');
-call mtr.add_suppression('event read from binlog did not pass crc check');
-call mtr.add_suppression('Replication event checksum verification failed');
-call mtr.add_suppression('Event crc check failed! Most likely there is event corruption');
-call mtr.add_suppression('Slave SQL: Error initializing relay log position: I/O error reading event at position .*, error.* 1593');
-
-SET @old_master_verify_checksum = @@master_verify_checksum;
-
-# Creating test table/data and set corruption position for testing
---echo # 1. Creating test table/data and set corruption position for testing
---connection master
---echo * insert/update/delete rows in table t1 *
-# Corruption algorithm modifies only the first event and
-# then will be reset. To avoid checking always the first event
-# from binlog (usually it is FD) we randomly execute different
-# statements and set position for corruption inside events.
-
-CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c VARCHAR(100));
---disable_query_log
-let $i=`SELECT 3+CEILING(10*RAND())`;
-let $j=1;
-let $pos=0;
-while ($i) {
- eval INSERT INTO t1 VALUES ($j, 'a', NULL);
- if (`SELECT RAND() > 0.7`)
- {
- eval UPDATE t1 SET c = REPEAT('a', 20) WHERE a = $j;
- }
- if (`SELECT RAND() > 0.8`)
- {
- eval DELETE FROM t1 WHERE a = $j;
- }
- if (!$pos) {
- let $pos= query_get_value(SHOW MASTER STATUS, Position, 1);
- --sync_slave_with_master
- --source include/stop_slave.inc
- --disable_query_log
- --connection master
- }
- dec $i;
- inc $j;
-}
---enable_query_log
-
-
-# Emulate corruption in binlog file when SHOW BINLOG EVENTS is executing
---echo # 2. Corruption in master binlog and SHOW BINLOG EVENTS
-SET @saved_dbug = @@global.debug_dbug;
-SET @@global.debug_dbug="d,corrupt_read_log_event_char";
---echo SHOW BINLOG EVENTS;
---disable_query_log
-send_eval SHOW BINLOG EVENTS FROM $pos;
---enable_query_log
---error ER_ERROR_WHEN_EXECUTING_COMMAND
-reap;
-
-SET @@global.debug_dbug=@saved_dbug;
-
-# Emulate corruption on master with crc checking on master
---echo # 3. Master read a corrupted event from binlog and send the error to slave
-
-# We have a rare but nasty potential race here: if the dump thread on
-# the master for the _old_ slave connection has not yet discovered
-# that the slave has disconnected, we will inject the corrupt event on
-# the wrong connection, and the test will fail
-# (+d,corrupt_read_log_event2 corrupts only one event).
-# So kill any lingering dump thread (we need to kill; otherwise dump thread
-# could manage to send all events down the socket before seeing it close, and
-# hang forever waiting for new binlog events to be created).
-let $id= `select id from information_schema.processlist where command = "Binlog Dump"`;
-if ($id)
-{
- --disable_query_log
- --error 0,1094
- eval kill $id;
- --enable_query_log
-}
-let $wait_condition=
- SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE command = 'Binlog Dump';
---source include/wait_condition.inc
-
-SET @@global.debug_dbug="d,corrupt_read_log_event2_set";
---connection slave
-START SLAVE IO_THREAD;
-let $slave_io_errno= 1236;
---let $slave_timeout= 10
---source include/wait_for_slave_io_error.inc
---connection master
-SET @@global.debug_dbug=@saved_dbug;
-
-# Emulate corruption on master without crc checking on master
---echo # 4. Master read a corrupted event from binlog and send it to slave
---connection master
-SET GLOBAL master_verify_checksum=0;
-SET @@global.debug_dbug="d,corrupt_read_log_event2_set";
---connection slave
-START SLAVE IO_THREAD;
-# When the checksum error is detected, the slave sets error code 1743
-# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately
-# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io().
-# So we usually get 1595, but it is occasionally possible to get 1743.
-let $slave_io_errno= 1595,1743; # ER_SLAVE_RELAY_LOG_WRITE_FAILURE, ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE
---source include/wait_for_slave_io_error.inc
---connection master
-SET @@global.debug_dbug=@saved_dbug;
-SET GLOBAL master_verify_checksum=1;
-
-# Emulate corruption in network
---echo # 5. Slave. Corruption in network
---connection slave
-SET @saved_dbug_slave = @@GLOBAL.debug_dbug;
-SET @@global.debug_dbug="d,corrupt_queue_event";
-START SLAVE IO_THREAD;
-let $slave_io_errno= 1595,1743; # ER_SLAVE_RELAY_LOG_WRITE_FAILURE, ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE
---source include/wait_for_slave_io_error.inc
-SET @@global.debug_dbug=@saved_dbug_slave;
-
-# Emulate corruption in relay log
---echo # 6. Slave. Corruption in relay log
-
-SET @@global.debug_dbug="d,corrupt_read_log_event_char";
-
-START SLAVE SQL_THREAD;
-let $slave_sql_errno= 1593;
---source include/wait_for_slave_sql_error.inc
-
-SET @@global.debug_dbug=@saved_dbug_slave;
-
-# Start normal replication and compare same table on master
-# and slave
---echo # 7. Seek diff for tables on master and slave
---connection slave
---source include/start_slave.inc
---connection master
---sync_slave_with_master
-let $diff_tables= master:test.t1, slave:test.t1;
---source include/diff_tables.inc
-
-# Clean up
---echo # 8. Clean up
---connection master
-set @@global.debug_dbug = @saved_dbug;
-SET GLOBAL master_verify_checksum = @old_master_verify_checksum;
-DROP TABLE t1;
---sync_slave_with_master
-
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_gtid_basic.inc b/mysql-test/suite/rpl/include/rpl_gtid_basic.inc
deleted file mode 100644
index 68a5d05ffe9..00000000000
--- a/mysql-test/suite/rpl/include/rpl_gtid_basic.inc
+++ /dev/null
@@ -1,572 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
---source include/have_innodb.inc
---let $rpl_topology=1->2->3->4
---source include/rpl_init.inc
-
-# Set up a 4-deep replication topology, then test various fail-overs
-# using GTID.
-#
-# A -> B -> C -> D
-
-connection server_1;
---source include/wait_for_binlog_checkpoint.inc
---let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
---let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
---echo *** GTID position should be empty here ***
---replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS>
-eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
-
-CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
-CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1, "m1");
-INSERT INTO t1 VALUES (2, "m2"), (3, "m3"), (4, "m4");
-INSERT INTO t2 VALUES (1, "i1");
-BEGIN;
-INSERT INTO t2 VALUES (2, "i2"), (3, "i3");
-INSERT INTO t2 VALUES (4, "i4");
-COMMIT;
-save_master_pos;
-source include/wait_for_binlog_checkpoint.inc;
---let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
---let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
---let $gtid_pos_server_1 = `SELECT @@gtid_binlog_pos`
---echo *** GTID position should be non-empty here ***
---replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS> $gtid_pos_server_1 <GTID_POS_SERVER_1>
-eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
-
-connection server_2;
-sync_with_master;
-source include/wait_for_binlog_checkpoint.inc;
---let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
---let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
---echo *** GTID position should be the same as on server_1 ***
---replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS> $gtid_pos_server_1 <GTID_POS_SERVER_1>
-eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-save_master_pos;
-
-connection server_3;
-sync_with_master;
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-save_master_pos;
-
-connection server_4;
-sync_with_master;
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-
-
---echo *** Now take out D, let it fall behind a bit, and then test re-attaching it to A ***
-connection server_4;
---source include/stop_slave.inc
-
-connection server_1;
-INSERT INTO t1 VALUES (5, "m1a");
-INSERT INTO t2 VALUES (5, "i1a");
-save_master_pos;
-
-connection server_4;
---replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
- MASTER_USE_GTID=CURRENT_POS;
---source include/start_slave.inc
-sync_with_master;
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-
---echo *** Now move B to D (C is still replicating from B) ***
-connection server_2;
---source include/stop_slave.inc
---replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4
-eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4,
- MASTER_USE_GTID=CURRENT_POS;
---source include/start_slave.inc
-
-connection server_4;
-UPDATE t2 SET b="j1a" WHERE a=5;
-save_master_pos;
-
-connection server_2;
-sync_with_master;
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-
---echo *** Now move C to D, after letting it fall a little behind ***
-connection server_3;
---source include/stop_slave.inc
-
-connection server_1;
-INSERT INTO t2 VALUES (6, "i6b");
-INSERT INTO t2 VALUES (7, "i7b");
---source include/save_master_gtid.inc
-
-connection server_3;
---replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4
-eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4,
- MASTER_USE_GTID=CURRENT_POS;
---source include/start_slave.inc
---source include/sync_with_master_gtid.inc
-SELECT * FROM t2 ORDER BY a;
-
---echo *** Now change everything back to what it was, to make rpl_end.inc happy
-# Also check that MASTER_USE_GTID=CURRENT_POS is still enabled.
-connection server_2;
-# We need to sync up server_2 before switching. If it happened to have reached
-# the point 'UPDATE t2 SET b="j1a" WHERE a=5' it will fail to connect to
-# server_1, which is (deliberately) missing that transaction.
---source include/sync_with_master_gtid.inc
---source include/stop_slave.inc
---replace_result $MASTER_MYPORT MASTER_MYPORT
-eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT;
---source include/start_slave.inc
---source include/wait_for_slave_to_start.inc
-
-connection server_3;
---source include/stop_slave.inc
---replace_result $SLAVE_MYPORT SLAVE_MYPORT
-eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT;
---source include/start_slave.inc
---source include/sync_with_master_gtid.inc
-
-connection server_4;
---source include/stop_slave.inc
---replace_result $SERVER_MYPORT_3 SERVER_MYPORT_3
-eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_3;
---source include/start_slave.inc
-
-connection server_1;
-DROP TABLE t1,t2;
---source include/save_master_gtid.inc
-
---echo *** A few more checks for BINLOG_GTID_POS function ***
---let $valid_binlog_name = query_get_value(SHOW BINARY LOGS,Log_name,1)
---error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-SELECT BINLOG_GTID_POS();
---error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-SELECT BINLOG_GTID_POS('a');
---error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-SELECT BINLOG_GTID_POS('a',1,NULL);
-SELECT BINLOG_GTID_POS(1,'a');
-SELECT BINLOG_GTID_POS(NULL,NULL);
-SELECT BINLOG_GTID_POS('',1);
-SELECT BINLOG_GTID_POS('a',1);
-eval SELECT BINLOG_GTID_POS('$valid_binlog_name',-1);
-eval SELECT BINLOG_GTID_POS('$valid_binlog_name',0);
-eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551615);
-eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551616);
-
-
---echo *** Some tests of @@GLOBAL.gtid_binlog_state ***
---connection server_2
---source include/sync_with_master_gtid.inc
---source include/stop_slave.inc
-
---connection server_1
-SET @old_state= @@GLOBAL.gtid_binlog_state;
-
---error ER_BINLOG_MUST_BE_EMPTY
-SET GLOBAL gtid_binlog_state = '';
-RESET MASTER;
-SET GLOBAL gtid_binlog_state = '';
-FLUSH LOGS;
---source include/show_binary_logs.inc
-SET GLOBAL gtid_binlog_state = '0-1-10,1-2-20,0-3-30';
---source include/show_binary_logs.inc
---let $binlog_file= master-bin.000001
---let $binlog_start= 4
---source include/show_binlog_events.inc
-#SELECT @@GLOBAL.gtid_binlog_pos;
-#SELECT @@GLOBAL.gtid_binlog_state;
---error ER_BINLOG_MUST_BE_EMPTY
-SET GLOBAL gtid_binlog_state = @old_state;
-RESET MASTER;
-SET GLOBAL gtid_binlog_state = @old_state;
-
-# Check that slave can reconnect again, despite the RESET MASTER, as we
-# restored the state.
-
-CREATE TABLE t1 (a INT PRIMARY KEY);
-SET gtid_seq_no=100;
-INSERT INTO t1 VALUES (1);
---source include/save_master_gtid.inc
-
---connection server_2
---source include/start_slave.inc
-# We cannot just use sync_with_master as we've done RESET MASTER, so
-# slave old-style position is wrong.
-# So sync on gtid position instead.
---source include/sync_with_master_gtid.inc
-
-SELECT * FROM t1;
-# Check that the IO gtid position in SHOW SLAVE STATUS is also correct.
---let $status_items= Gtid_IO_Pos
---source include/show_slave_status.inc
-
---echo *** Test @@LAST_GTID and MASTER_GTID_WAIT() ***
-
---connection server_1
-DROP TABLE t1;
-CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
---save_master_pos
-
---connection server_2
---sync_with_master
---source include/stop_slave.inc
-
---connect (m1,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
-SELECT @@last_gtid;
-SET gtid_seq_no=110;
-SELECT @@last_gtid;
-BEGIN;
-SELECT @@last_gtid;
-INSERT INTO t1 VALUES (2);
-SELECT @@last_gtid;
-COMMIT;
-SELECT @@last_gtid;
---let $pos= `SELECT @@gtid_binlog_pos`
-
---connect (s1,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-eval SET @pos= '$pos';
-# Check NULL argument.
-SELECT master_gtid_wait(NULL);
-# Check empty argument returns immediately.
-SELECT master_gtid_wait('', NULL);
-# Check this gets counted
-SHOW STATUS LIKE 'Master_gtid_wait_count';
-SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
-SHOW STATUS LIKE 'Master_gtid_wait_time';
-# Let's check that we get a timeout
-SELECT master_gtid_wait(@pos, 0.5);
-SELECT * FROM t1 ORDER BY a;
-# Now actually wait until the slave reaches the position
-send SELECT master_gtid_wait(@pos);
-
---connection server_2
---source include/start_slave.inc
-
---connection s1
-reap;
-SELECT * FROM t1 ORDER BY a;
-
-# Test waiting on a domain that does not exist yet.
---source include/stop_slave.inc
-
---connection server_1
-SET gtid_domain_id= 1;
-INSERT INTO t1 VALUES (3);
---let $pos= `SELECT @@gtid_binlog_pos`
-
---connection s1
---replace_result $pos POS
-eval SET @pos= '$pos';
-SELECT master_gtid_wait(@pos, 0);
-SELECT * FROM t1 WHERE a >= 3;
-send SELECT master_gtid_wait(@pos, -1);
-
---connection server_2
---source include/start_slave.inc
-
---connection s1
-reap;
-SELECT * FROM t1 WHERE a >= 3;
-# Waiting for only part of the position.
-SELECT master_gtid_wait('1-1-1', 0);
-
-# Now test a lot of parallel master_gtid_wait() calls, completing in different
-# order, and some of which time out or get killed on the way.
-
---connection s1
-send SELECT master_gtid_wait('2-1-1,1-1-4,0-1-110');
-
---connect (s2,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-# This will time out. No event 0-1-1000 exists
-send SELECT master_gtid_wait('0-1-1000', 0.5);
-
---connect (s3,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-# This one we will kill
---let $kill1_id= `SELECT connection_id()`
-send SELECT master_gtid_wait('0-1-2000');
-
---connect (s4,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-send SELECT master_gtid_wait('2-1-10');
-
---connect (s5,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-send SELECT master_gtid_wait('2-1-6', 1);
-
-# This one we will kill also.
---connect (s6,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
---let $kill2_id= `SELECT connection_id()`
-send SELECT master_gtid_wait('2-1-5');
-
---connect (s7,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-send SELECT master_gtid_wait('2-1-10');
-
---connect (s8,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-send SELECT master_gtid_wait('2-1-5,1-1-4,0-1-110');
-
---connect (s9,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-send SELECT master_gtid_wait('2-1-2');
-
---connection server_2
-# This one completes immediately.
-SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
-SHOW STATUS LIKE 'Master_gtid_wait_count';
-SELECT master_gtid_wait('1-1-1');
-SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
-SHOW STATUS LIKE 'Master_gtid_wait_count';
-let $wait_time = query_get_value(SHOW STATUS LIKE 'Master_gtid_wait_time', Value, 1);
---replace_result $wait_time MASTER_GTID_WAIT_TIME
-eval SET @a= $wait_time;
-SELECT IF(@a <= 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " is larger than expected"))
- AS Master_gtid_wait_time_as_expected;
-
-
---connect (s10,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-send SELECT master_gtid_wait('0-1-109');
-
---connection server_2
-# This one should time out.
-SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
-SHOW STATUS LIKE 'Master_gtid_wait_count';
-SELECT master_gtid_wait('2-1-2', 0.5);
-SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
-SHOW STATUS LIKE 'Master_gtid_wait_count';
-let $wait_time = query_get_value(SHOW STATUS LIKE 'Master_gtid_wait_time', Value, 1);
---replace_result $wait_time MASTER_GTID_WAIT_TIME
-eval SET @a= $wait_time;
-# We expect a wait time of just a bit over 0.5 seconds. But thread scheduling
-# and timer inaccuracies could introduce significant jitter. So allow a
-# generous interval.
-SELECT IF(@a BETWEEN 0.4*1000*1000 AND 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " not as expected")) AS Master_gtid_wait_time_as_expected;
-
---replace_result $kill1_id KILL_ID
-eval KILL QUERY $kill1_id;
---connection s3
---error ER_QUERY_INTERRUPTED
-reap;
-
---connection server_1
-SET gtid_domain_id=2;
-SET gtid_seq_no=2;
-INSERT INTO t1 VALUES (4);
-
---connection s9
-reap;
-
---connection server_2
---replace_result $kill2_id KILL_ID
-eval KILL CONNECTION $kill2_id;
-
---connection s6
---error 2013,ER_CONNECTION_KILLED
-reap;
-
---connection server_1
-SET gtid_domain_id=1;
-SET gtid_seq_no=4;
-INSERT INTO t1 VALUES (5);
-SET gtid_domain_id=2;
-SET gtid_seq_no=5;
-INSERT INTO t1 VALUES (6);
-
---connection s8
-reap;
---connection s1
-reap;
---connection s2
-reap;
---connection s5
-reap;
---connection s10
-reap;
-
---connection server_1
-SET gtid_domain_id=2;
-SET gtid_seq_no=10;
-INSERT INTO t1 VALUES (7);
-
---connection s4
-reap;
---connection s7
-reap;
-
-
---echo *** Test gtid_slave_pos when used with GTID ***
-
---connection server_2
---source include/stop_slave.inc
-
---connection server_1
-SET gtid_domain_id=2;
-SET gtid_seq_no=1000;
-INSERT INTO t1 VALUES (10);
-INSERT INTO t1 VALUES (11);
---save_master_pos
-
---connection server_2
-SET sql_slave_skip_counter= 1;
---source include/start_slave.inc
---sync_with_master
-SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
-SELECT IF(LOCATE("2-1-1001", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1001 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
-
---source include/stop_slave.inc
-
---connection server_1
-SET gtid_domain_id=2;
-SET gtid_seq_no=1010;
-INSERT INTO t1 VALUES (12);
-INSERT INTO t1 VALUES (13);
---save_master_pos
-
---connection server_2
-SET sql_slave_skip_counter= 2;
---source include/start_slave.inc
---sync_with_master
-SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
-SELECT IF(LOCATE("2-1-1011", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1011 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
-
---source include/stop_slave.inc
-
---connection server_1
-SET gtid_domain_id=2;
-SET gtid_seq_no=1020;
-INSERT INTO t1 VALUES (14);
-INSERT INTO t1 VALUES (15);
-INSERT INTO t1 VALUES (16);
---save_master_pos
-
---connection server_2
-SET sql_slave_skip_counter= 3;
---source include/start_slave.inc
---sync_with_master
-SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
-SELECT IF(LOCATE("2-1-1022", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1022 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
-
---source include/stop_slave.inc
-
---connection server_1
-SET gtid_domain_id=2;
-SET gtid_seq_no=1030;
-# Disable logging Annotate_rows events to preserve events count.
-let $binlog_annotate_row_events_saved= `SELECT @@binlog_annotate_row_events`;
-SET @@binlog_annotate_row_events= 0;
-INSERT INTO t1 VALUES (17);
-INSERT INTO t1 VALUES (18);
-INSERT INTO t1 VALUES (19);
-eval SET @@binlog_annotate_row_events= $binlog_annotate_row_events_saved;
---save_master_pos
-
---connection server_2
-SET sql_slave_skip_counter= 5;
---source include/start_slave.inc
---sync_with_master
-SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
-SELECT IF(LOCATE("2-1-1032", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1032 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
-
-
---source include/stop_slave.inc
-
---connection server_1
-SET gtid_domain_id=3;
-SET gtid_seq_no=100;
-CREATE TABLE t2 (a INT PRIMARY KEY);
-DROP TABLE t2;
-SET gtid_domain_id=2;
-SET gtid_seq_no=1040;
-INSERT INTO t1 VALUES (20);
---save_master_pos
-
---connection server_2
-SET @saved_mode= @@GLOBAL.slave_ddl_exec_mode;
-SET GLOBAL slave_ddl_exec_mode=STRICT;
-SET sql_slave_skip_counter=1;
-START SLAVE UNTIL master_gtid_pos="3-1-100";
---let $master_pos=3-1-100
---source include/sync_with_master_gtid.inc
---source include/wait_for_slave_to_stop.inc
---error ER_NO_SUCH_TABLE
-SELECT * FROM t2;
-SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
-
-# Start the slave again, it should fail on the DROP TABLE as the table is not there.
-SET sql_log_bin=0;
-CALL mtr.add_suppression("Slave: Unknown table 'test\\.t2' Error_code: 1051");
-SET sql_log_bin=1;
-START SLAVE;
---let $slave_sql_errno=1051
---source include/wait_for_slave_sql_error.inc
-SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
-
-STOP SLAVE IO_THREAD;
-SET sql_slave_skip_counter=2;
---source include/start_slave.inc
---sync_with_master
-
-SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
-SELECT IF(LOCATE("3-1-101", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-101 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
-SELECT IF(LOCATE("2-1-1040", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1040 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
-
-SET GLOBAL slave_ddl_exec_mode= @saved_mode;
-
-
---echo *** Test GTID-connecting to a master with out-of-order sequence numbers in the binlog. ***
-
-# Create an out-of-order binlog on server 2.
-# Let server 3 replicate to an out-of-order point, stop it, restart it,
-# and check that it replicates correctly despite the out-of-order.
-
---connection server_1
-SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
-INSERT INTO t1 VALUES (31);
---save_master_pos
-
---connection server_2
---sync_with_master
-SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
-INSERT INTO t1 VALUES (32);
-
---connection server_1
-INSERT INTO t1 VALUES (33);
---save_master_pos
-
---connection server_2
---sync_with_master
---save_master_pos
-
---connection server_3
---sync_with_master
---source include/stop_slave.inc
-
---connection server_1
-INSERT INTO t1 VALUES (34);
---save_master_pos
-
---connection server_2
---sync_with_master
---save_master_pos
-
---connection server_3
---source include/start_slave.inc
---sync_with_master
-SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
---save_master_pos
-
---connection server_4
---sync_with_master
-SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
-
-
-# Clean up.
---connection server_1
-DROP TABLE t1;
-
-
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_incident.inc b/mysql-test/suite/rpl/include/rpl_incident.inc
deleted file mode 100644
index 75d28d6a6c6..00000000000
--- a/mysql-test/suite/rpl/include/rpl_incident.inc
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
---source include/have_debug.inc
---source include/master-slave.inc
-
-SET @old_binlog_checksum=@@binlog_checksum;
-SET GLOBAL BINLOG_CHECKSUM=none;
-connection slave;
-SET @old_binlog_checksum=@@binlog_checksum;
-SET GLOBAL BINLOG_CHECKSUM=none;
-connection master;
-
---echo **** On Master ****
-CREATE TABLE t1 (a INT);
-
-INSERT INTO t1 VALUES (1),(2),(3);
-SELECT * FROM t1;
-
-set @saved_dbug = @@global.debug_dbug;
-SET GLOBAL debug_dbug= '+d,incident_database_resync_on_replace,*';
-
-# This will generate an incident log event and store it in the binary
-# log before the replace statement.
-REPLACE INTO t1 VALUES (4);
---save_master_pos
-SELECT * FROM t1;
-
-set @@global.debug_dbug = @saved_dbug;
-
-connection slave;
-# Wait until SQL thread stops with error LOST_EVENT on master
-call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590");
-let $slave_sql_errno= 1590;
-let $show_slave_sql_error= 1;
-source include/wait_for_slave_sql_error.inc;
-
-# The 4 should not be inserted into the table, since the incident log
-# event should have stop the slave.
---echo **** On Slave ****
-SELECT * FROM t1;
-
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
---sync_with_master
-
-# Now, we should have inserted the row into the table and the slave
-# should be running. We should also have rotated to a new binary log.
-
-SELECT * FROM t1;
-source include/check_slave_is_running.inc;
-
-connection master;
-SET GLOBAL BINLOG_CHECKSUM=@old_binlog_checksum;
-DROP TABLE t1;
---sync_slave_with_master
-SET GLOBAL BINLOG_CHECKSUM=@old_binlog_checksum;
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_init_slave_errors.inc b/mysql-test/suite/rpl/include/rpl_init_slave_errors.inc
deleted file mode 100644
index 46673ea4764..00000000000
--- a/mysql-test/suite/rpl/include/rpl_init_slave_errors.inc
+++ /dev/null
@@ -1,96 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
-######################################################################
-# Some errors that cause the slave SQL thread to stop are not shown in
-# the Slave_SQL_Error column of "SHOW SLAVE STATUS". Instead, the error
-# is only in the server's error log.
-#
-# Two failures and their respective reporting are verified:
-#
-# 1 - Failures during slave thread initialization
-# 2 - Failures while processing queries passed through the init_slave
-# option.
-#
-# In order to check the first type of failure, we inject a fault in the
-# SQL/IO Threads through SET GLOBAL debug.
-#
-# To check the second type, we set @@global.init_slave to an invalid
-# command thus preventing the initialization of the SQL Thread.
-#
-# Obs:
-# 1 - Note that testing failures while initializing the relay log position
-# is hard as the same function is called before the code reaches the point
-# that we want to test.
-#
-# 2 - This test does not target failures that are reported while applying
-# events such as duplicate keys, errors while reading the relay-log.bin*,
-# etc. Such errors are already checked on other tests.
-######################################################################
-
-######################################################################
-# Configuring the Environment
-######################################################################
-source include/have_debug.inc;
-source include/have_log_bin.inc;
-source include/master-slave.inc;
-
-connection slave;
-
---disable_warnings
-stop slave;
---enable_warnings
-reset slave;
-
-######################################################################
-# Injecting faults in the threads' initialization
-######################################################################
-connection slave;
-
-# Set debug flags on slave to force errors to occur
-set @saved_dbug = @@global.debug_dbug;
-SET GLOBAL debug_dbug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
-
-start slave;
-
-#
-# slave is going to stop because of emulated failures
-# but there won't be any crashes nor asserts hit.
-#
-# 1593 = ER_SLAVE_FATAL_ERROR
---let $slave_sql_errno= 1593
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error.inc
-
-call mtr.add_suppression("Failed during slave.* thread initialization");
-
-set @@global.debug_dbug = @saved_dbug;
-
-######################################################################
-# Injecting faults in the init_slave option
-######################################################################
-connection slave;
-
-reset slave;
-
-SET GLOBAL init_slave= "garbage";
-
-start slave;
-# 1064 = ER_PARSE_ERROR
---let $slave_sql_errno= 1064
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error.inc
-
-######################################################################
-# Clean up
-######################################################################
-SET GLOBAL init_slave= "";
-
-# Clean up Last_SQL_Error
---source include/stop_slave_io.inc
-RESET SLAVE;
---let $rpl_only_running_threads= 1
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_loadfile.inc b/mysql-test/suite/rpl/include/rpl_loadfile.inc
deleted file mode 100644
index 9cd64530690..00000000000
--- a/mysql-test/suite/rpl/include/rpl_loadfile.inc
+++ /dev/null
@@ -1,120 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
-#############################################################################
-# Original Author: JBM #
-# Original Date: Aug/18/2005 #
-#############################################################################
-# TEST: To test the LOAD_FILE() in rbr #
-#############################################################################
-# Change Author: JBM
-# Change Date: 2006-01-16
-##########
-
-# Includes
--- source include/have_binlog_format_mixed_or_row.inc
--- source include/master-slave.inc
-
--- source suite/rpl/include/rpl_loadfile.test
-
-# BUG#39701: Mixed binlog format does not switch to row mode on LOAD_FILE
-#
-# DESCRIPTION
-#
-# Problem: when using load_file string function and mixed binlogging format
-# there was no switch to row based binlogging format. This leads
-# to scenarios on which the slave replicates the statement and it
-# will try to load the file from local file system, which in most
-# likely it will not exist.
-#
-# Solution:
-# Marking this function as unsafe for statement format, makes the
-# statement using it to be logged in row based format. As such, data
-# replicated from the master, becomes the content of the loaded file.
-# Consequently, the slave receives the necessary data to complete
-# the load_file instruction correctly.
-#
-# IMPLEMENTATION
-#
-# The test is implemented as follows:
-#
-# On Master,
-# i) write to file the desired content.
-# ii) create table and stored procedure with load_file
-# iii) stop slave
-# iii) execute load_file
-# iv) remove file
-#
-# On Slave,
-# v) start slave
-# vi) sync it with master so that it gets the updates from binlog (which
-# should have bin logged in row format).
-#
-# If the the binlog format does not change to row, then the assertion
-# done in the following step fails. This happens because tables differ
-# since the file does not exist anymore, meaning that when slave
-# attempts to execute LOAD_FILE statement it inserts NULL on table
-# instead of the same contents that the master loaded when it executed
-# the procedure (which was executed when file existed).
-#
-# vii) assert that the contents of master and slave
-# table are the same
-
---source include/rpl_reset.inc
-
-connection master;
-let $file= $MYSQLTEST_VARDIR/tmp/bug_39701.data;
-
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---eval SELECT repeat('x',20) INTO OUTFILE '$file'
-
-disable_warnings;
-DROP TABLE IF EXISTS t1;
-enable_warnings;
-
-CREATE TABLE t1 (t text);
-DELIMITER |;
-CREATE PROCEDURE p(file varchar(4096))
- BEGIN
- INSERT INTO t1 VALUES (LOAD_FILE(file));
- END|
-DELIMITER ;|
-
-# stop slave before issuing the load_file on master
-connection slave;
-source include/stop_slave.inc;
-
-connection master;
-
-# test: check that logging falls back to rbr.
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---eval CALL p('$file')
-
-# test: remove the file from the filesystem and assert that slave still
-# gets the loaded file
-remove_file $file;
-
-# now that the file is removed it is safe (regarding what we want to test)
-# to start slave
-connection slave;
-source include/start_slave.inc;
-
-connection master;
-sync_slave_with_master;
-
-# assertion: assert that the slave got the updates even
-# if the file was removed before the slave started,
-# meaning that contents were indeed transfered
-# through binlog (in row format)
-let $diff_tables= master:t1, slave:t1;
-source include/diff_tables.inc;
-
-# CLEAN UP
---connection master
-DROP TABLE t1;
-DROP PROCEDURE p;
-
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_packet.inc b/mysql-test/suite/rpl/include/rpl_packet.inc
deleted file mode 100644
index cbde486bcbb..00000000000
--- a/mysql-test/suite/rpl/include/rpl_packet.inc
+++ /dev/null
@@ -1,184 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
-# ==== Purpose ====
-#
-# Check replication protocol packet size handling
-#
-# ==== Related bugs ====
-# Bug#19402 SQL close to the size of the max_allowed_packet fails on slave
-# BUG#23755: Replicated event larger that max_allowed_packet infinitely re-transmits
-# BUG#42914: No LAST_IO_ERROR for max_allowed_packet errors
-# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET
-
-# max-out size db name
-source include/have_binlog_format_row.inc;
-source include/master-slave.inc;
-
-call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, .*error.* 1153");
-call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet");
-let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
-disable_warnings;
-eval drop database if exists $db;
-enable_warnings;
-eval create database $db;
-
-connection master;
-let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`;
-let $old_net_buffer_length= `SELECT @@global.net_buffer_length`;
-let $old_slave_max_allowed_packet= `SELECT @@global.slave_max_allowed_packet`;
-SET @@global.max_allowed_packet=1024;
-SET @@global.net_buffer_length=1024;
-
-sync_slave_with_master;
-# Restart slave for setting to take effect
-source include/stop_slave.inc;
-source include/start_slave.inc;
-
-# Reconnect to master for new setting to take effect
-disconnect master;
-
-# alas, can't use eval here; if db name changed apply the change here
-connect (master,localhost,root,,DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________);
-
-connection master;
-select @@net_buffer_length, @@max_allowed_packet;
-
-create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
-
-INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023');
-sync_slave_with_master;
-
-eval select count(*) from `$db`.`t1` /* must be 1 */;
-
-SHOW STATUS LIKE 'Slave_running';
-select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING';
-connection master;
-eval drop database $db;
-sync_slave_with_master;
-
-#
-# Bug #23755: Replicated event larger that max_allowed_packet infinitely re-transmits
-#
-# Check that a situation when the size of event on the master is greater than
-# max_allowed_packet on the slave does not lead to infinite re-transmits.
-
-connection master;
-
-# Change the max packet size on master
-
-SET @@global.max_allowed_packet=4096;
-SET @@global.net_buffer_length=4096;
-
-# Restart slave for new setting to take effect
-connection slave;
-source include/stop_slave.inc;
-source include/start_slave.inc;
-
-# Reconnect to master for new setting to take effect
-disconnect master;
-connect (master, localhost, root);
-connection master;
-
-CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
-
-sync_slave_with_master;
-
-connection master;
-
-INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
-
-
-#
-# Bug#42914: The slave I/O thread must stop after trying to read the above
-# event, However there is no Last_IO_Error report.
-#
-
-# The slave I/O thread must stop after trying to read the above event
-connection slave;
-# 1153 = ER_NET_PACKET_TOO_LARGE
---let $slave_io_errno= 1153
---let $show_slave_io_error= 1
---source include/wait_for_slave_io_error.inc
-
-# TODO: this is needed because of BUG#55790. Remove once that is fixed.
---source include/stop_slave_sql.inc
-
-#
-# Bug#42914: On the master, if a binary log event is larger than
-# max_allowed_packet, the error message ER_MASTER_FATAL_ERROR_READING_BINLOG
-# is sent to a slave when it requests a dump from the master, thus leading the
-# I/O thread to stop. However, there is no Last_IO_Error reported.
-#
-
---let $rpl_only_running_threads= 1
---source include/rpl_reset.inc
---connection master
-DROP TABLE t1;
---sync_slave_with_master
-
-
-connection master;
-CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
-sync_slave_with_master;
-
-connection master;
-INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
-
-connection slave;
-# The slave I/O thread must stop after receiving
-# 1153 = ER_NET_PACKET_TOO_LARGE
---let $slave_io_errno= 1153
---let $show_slave_io_error= 1
---source include/wait_for_slave_io_error.inc
-
-# Remove the bad binlog and clear error status on slave.
-STOP SLAVE;
-RESET SLAVE;
---connection master
-RESET MASTER;
-
-
-#
-# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET
-#
-# In BUG#55322, @@session.max_allowed_packet increased each time SHOW
-# BINLOG EVENTS was issued. To verify that this bug is fixed, we
-# execute SHOW BINLOG EVENTS twice and check that max_allowed_packet
-# never changes. We turn off the result log because we don't care
-# about the contents of the binlog.
-
---disable_result_log
-SET @max_allowed_packet_0= @@session.max_allowed_packet;
-SHOW BINLOG EVENTS;
-SET @max_allowed_packet_1= @@session.max_allowed_packet;
-SHOW BINLOG EVENTS;
-SET @max_allowed_packet_2= @@session.max_allowed_packet;
---enable_result_log
-if (`SELECT NOT(@max_allowed_packet_0 = @max_allowed_packet_1 AND @max_allowed_packet_1 = @max_allowed_packet_2)`)
-{
- --echo ERROR: max_allowed_packet changed after executing SHOW BINLOG EVENTS
- --source include/show_rpl_debug_info.inc
- SELECT @max_allowed_packet_0, @max_allowed_packet_1, @max_allowed_packet_2;
- --die @max_allowed_packet changed after executing SHOW BINLOG EVENTS
-}
-
-
---echo ==== clean up ====
-connection master;
-DROP TABLE t1;
-eval SET @@global.max_allowed_packet= $old_max_allowed_packet;
-eval SET @@global.net_buffer_length= $old_net_buffer_length;
-eval SET @@global.slave_max_allowed_packet= $old_slave_max_allowed_packet;
-# slave is stopped
-connection slave;
-DROP TABLE t1;
-
-# Clear Last_IO_Error
-RESET SLAVE;
-
---source include/rpl_end.inc
-# End of tests
diff --git a/mysql-test/suite/rpl/include/rpl_parallel_ignored_errors.inc b/mysql-test/suite/rpl/include/rpl_parallel_ignored_errors.inc
deleted file mode 100644
index 493385f1ae3..00000000000
--- a/mysql-test/suite/rpl/include/rpl_parallel_ignored_errors.inc
+++ /dev/null
@@ -1,115 +0,0 @@
-# ==== Purpose ====
-#
-# Test verifies that, in parallel replication, transaction failure notification
-# is propagated to all the workers. Workers should abort the execution of
-# transaction event groups, whose event positions are higher than the failing
-# transaction group.
-#
-# ==== Implementation ====
-#
-# Steps:
-# 0 - Create a table t1 on master which has a primary key. Enable parallel
-# replication on slave with slave_parallel_mode='optimistic' and
-# slave_parallel_threads=3.
-# 1 - On slave start a transaction and execute a local INSERT statement
-# which will insert value 32. This is done to block the INSERT coming
-# from master.
-# 2 - On master execute an INSERT statement with value 32, so that it is
-# blocked on slave.
-# 3 - On slave enable a debug sync point such that it holds the worker thread
-# execution as soon as work is scheduled to it.
-# 4 - INSERT value 33 on master. It will be held on slave by other worker
-# thread due to debug simulation.
-# 5 - INSERT value 34 on master.
-# 6 - On slave, enusre that INSERT 34 has reached a state where it waits for
-# its prior transactions to commit.
-# 7 - Commit the local INSERT 32 on slave server so that first worker will
-# error out.
-# 8 - Now send a continue signal to second worker processing 33. It should
-# wakeup and propagate the error to INSERT 34.
-# 9 - Upon slave stop due to error, check that no rows are found after the
-# failed INSERT 32.
-#
-# ==== References ====
-#
-# MDEV-20645: Replication consistency is broken as workers miss the error
-# notification from an earlier failed group.
-#
-
---source include/have_innodb.inc
---source include/have_debug.inc
---source include/have_debug_sync.inc
---source include/have_binlog_format_statement.inc
---source include/master-slave.inc
-
---enable_connect_log
---connection server_2
---source include/stop_slave.inc
-SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
-SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
-SET @old_debug= @@GLOBAL.debug_dbug;
-SET GLOBAL slave_parallel_mode='optimistic';
-SET GLOBAL slave_parallel_threads= 3;
-CHANGE MASTER TO master_use_gtid=slave_pos;
-CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends");
---source include/start_slave.inc
-
---connection server_1
-ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
-CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=InnoDB;
-# MDEV-515 takes X-lock on the table for the first insert.
-# So concurrent insert won't happen on the table
-INSERT INTO t1 VALUES(1);
---source include/save_master_gtid.inc
-
---connection server_2
---source include/sync_with_master_gtid.inc
-
---connect (con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
-BEGIN;
-INSERT INTO t1 VALUES (32);
-
---connection server_1
-INSERT INTO t1 VALUES (32);
-
---connection server_2
---let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE info like "INSERT INTO t1 VALUES (32)"
---source include/wait_condition.inc
-SET GLOBAL debug_dbug="+d,hold_worker_on_schedule";
-SET debug_sync="debug_sync_action SIGNAL reached_pause WAIT_FOR continue_worker";
-
---connection server_1
-SET gtid_seq_no=100;
-INSERT INTO t1 VALUES (33);
-
---connection server_2
-SET debug_sync='now WAIT_FOR reached_pause';
-
---connection server_1
-INSERT INTO t1 VALUES (34);
-
---connection server_2
---let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE state like "Waiting for prior transaction to commit"
---source include/wait_condition.inc
---connection con_temp2
-COMMIT;
-
-# Clean up.
---connection server_2
---source include/stop_slave.inc
---let $assert_cond= COUNT(*) = 0 FROM t1 WHERE a>32
---let $assert_text= table t1 should have zero rows where a>32
---source include/assert.inc
-SELECT * FROM t1 WHERE a>32;
-DELETE FROM t1 WHERE a=32;
-
-SET GLOBAL slave_parallel_threads=@old_parallel_threads;
-SET GLOBAL slave_parallel_mode=@old_parallel_mode;
-SET GLOBAL debug_dbug=@old_debug;
-SET DEBUG_SYNC= 'RESET';
---source include/start_slave.inc
-
---connection server_1
-DROP TABLE t1;
---disable_connect_log
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc b/mysql-test/suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc
deleted file mode 100644
index cddc9286bd2..00000000000
--- a/mysql-test/suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
-# BUG#13979418: SHOW BINLOG EVENTS MAY CRASH THE SERVER
-#
-# The function mysql_show_binlog_events has a local stack variable
-# 'LOG_INFO linfo;', which is assigned to thd->current_linfo, however
-# this variable goes out of scope and is destroyed before clean
-# thd->current_linfo.
-#
-# This test case runs SHOW BINLOG EVENTS and FLUSH LOGS to make sure
-# that with the fix local variable linfo is valid along all
-# mysql_show_binlog_events function scope.
-#
---source include/have_debug.inc
---source include/have_debug_sync.inc
---source include/master-slave.inc
-
---connection slave
-SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end';
---send SHOW BINLOG EVENTS
-
---connection slave1
-SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events';
-FLUSH LOGS;
-SET DEBUG_SYNC= 'now SIGNAL end';
-
---connection slave
---disable_result_log
---reap
---enable_result_log
-SET DEBUG_SYNC= 'RESET';
-
---connection master
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_relayrotate.inc b/mysql-test/suite/rpl/include/rpl_relayrotate.inc
deleted file mode 100644
index 4de554d3143..00000000000
--- a/mysql-test/suite/rpl/include/rpl_relayrotate.inc
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
-#######################################################
-# Wrapper for rpl_relayrotate.test to allow multi #
-# Engines to reuse test code. By JBM 2006-02-15 #
-#######################################################
--- source include/have_innodb.inc
-# Slow test, don't run during staging part
--- source include/not_staging.inc
--- source include/master-slave.inc
-
-let $engine_type=innodb;
--- source suite/rpl/include/rpl_relayrotate.test
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_semi_sync.inc b/mysql-test/suite/rpl/include/rpl_semi_sync.inc
deleted file mode 100644
index 720ec059350..00000000000
--- a/mysql-test/suite/rpl/include/rpl_semi_sync.inc
+++ /dev/null
@@ -1,532 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
-source include/not_embedded.inc;
-source include/have_innodb.inc;
-source include/master-slave.inc;
-
-let $engine_type= InnoDB;
-
-# Suppress warnings that might be generated during the test
-connection master;
-call mtr.add_suppression("Timeout waiting for reply of binlog");
-call mtr.add_suppression("Read semi-sync reply");
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
-call mtr.add_suppression("mysqld: Got an error reading communication packets");
-connection slave;
-# While 'Current_Pos' exists as an option for Using_Gtd, keeping these
-# events in the binlog will update gtid_binlog_pos, and the later calls to
-# set `@@global.gtid_slave_pos= ""` will provide warning messages with
-# inconsistent GTID values because the seq_nos are non-deterministic with
-# the masters events coming in concurrently
-set sql_log_bin=0;
-call mtr.add_suppression("Master server does not support semi-sync");
-call mtr.add_suppression("Semi-sync slave .* reply");
-call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
-set sql_log_bin=1;
-connection master;
-
-# wait for dying connections (if any) to disappear
-let $wait_condition= select count(*) = 0 from information_schema.processlist where command='killed';
---source include/wait_condition.inc
-
-# After fix of BUG#45848, semi-sync slave should not create any extra
-# connections on master, save the count of connections before start
-# semi-sync slave for comparison below.
-let $_connections_normal_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
-
---echo #
---echo # Uninstall semi-sync plugins on master and slave
---echo #
-connection slave;
-source include/stop_slave.inc;
---source include/reset_slave.inc
-set global rpl_semi_sync_master_enabled= 0;
-set global rpl_semi_sync_slave_enabled= 0;
-
-connection master;
-reset master;
-set global rpl_semi_sync_master_enabled= 0;
-set global rpl_semi_sync_slave_enabled= 0;
-
---echo #
---echo # Main test of semi-sync replication start here
---echo #
-
-connection master;
-
-set global rpl_semi_sync_master_timeout= 60000; # 60s
-
-echo [ default state of semi-sync on master should be OFF ];
-show variables like 'rpl_semi_sync_master_enabled';
-
-echo [ enable semi-sync on master ];
-set global rpl_semi_sync_master_enabled = 1;
-show variables like 'rpl_semi_sync_master_enabled';
-
-echo [ status of semi-sync on master should be ON even without any semi-sync slaves ];
-show status like 'Rpl_semi_sync_master_clients';
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_yes_tx';
-
---echo #
---echo # BUG#45672 Semisync repl: ActiveTranx:insert_tranx_node: transaction node allocation failed
---echo # BUG#45673 Semisynch reports correct operation even if no slave is connected
---echo #
-
-# BUG#45672 When semi-sync is enabled on master, it would allocate
-# transaction node even without semi-sync slave connected, and would
-# finally result in transaction node allocation error.
-#
-# Semi-sync master will pre-allocate 'max_connections' transaction
-# nodes, so here we do more than that much transactions to check if it
-# will fail or not.
-# select @@global.max_connections + 1;
-let $i= `select @@global.max_connections + 1`;
-disable_query_log;
-eval create table t1 (a int) engine=$engine_type;
-while ($i)
-{
- eval insert into t1 values ($i);
- dec $i;
-}
-drop table t1;
-enable_query_log;
-
-# BUG#45673
-echo [ status of semi-sync on master should be OFF ];
-show status like 'Rpl_semi_sync_master_clients';
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_yes_tx';
-
-# reset master to make sure the following test will start with a clean environment
-reset master;
-
-connection slave;
-
-echo [ default state of semi-sync on slave should be OFF ];
-show variables like 'rpl_semi_sync_slave_enabled';
-
-echo [ enable semi-sync on slave ];
-set global rpl_semi_sync_slave_enabled = 1;
-show variables like 'rpl_semi_sync_slave_enabled';
-source include/start_slave.inc;
-
-connection master;
-
-# NOTE: Rpl_semi_sync_master_client will only be updated when
-# semi-sync slave has started binlog dump request
-let $status_var= Rpl_semi_sync_master_clients;
-let $status_var_value= 1;
-source include/wait_for_status_var.inc;
-
-echo [ initial master state after the semi-sync slave connected ];
-show status like 'Rpl_semi_sync_master_clients';
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
-show status like 'Rpl_semi_sync_master_yes_tx';
-
-replace_result $engine_type ENGINE_TYPE;
-eval create table t1(a int) engine = $engine_type;
-
-echo [ master state after CREATE TABLE statement ];
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
-show status like 'Rpl_semi_sync_master_yes_tx';
-
-# After fix of BUG#45848, semi-sync slave should not create any extra
-# connections on master.
-let $_connections_semisync_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
-replace_result $_connections_normal_slave CONNECTIONS_NORMAL_SLAVE $_connections_semisync_slave CONNECTIONS_SEMISYNC_SLAVE;
-eval select $_connections_semisync_slave - $_connections_normal_slave as 'Should be 0';
-
-echo [ insert records to table ];
-insert t1 values (10);
-insert t1 values (9);
-insert t1 values (8);
-insert t1 values (7);
-insert t1 values (6);
-insert t1 values (5);
-insert t1 values (4);
-insert t1 values (3);
-insert t1 values (2);
-insert t1 values (1);
-
-echo [ master status after inserts ];
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
-show status like 'Rpl_semi_sync_master_yes_tx';
-
-sync_slave_with_master;
-
-echo [ slave status after replicated inserts ];
-show status like 'Rpl_semi_sync_slave_status';
-
-select count(distinct a) from t1;
-select min(a) from t1;
-select max(a) from t1;
-
---echo
---echo # BUG#50157
---echo # semi-sync replication crashes when replicating a transaction which
---echo # include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ;
-
-connection master;
-SET SESSION AUTOCOMMIT= 0;
-CREATE TABLE t2(c1 INT) ENGINE=innodb;
-sync_slave_with_master;
-
-connection master;
-BEGIN;
---echo
---echo # Even though it is in a transaction, this statement is binlogged into binlog
---echo # file immediately.
---disable_warnings
-CREATE TEMPORARY TABLE t3 SELECT c1 FROM t2 where 1=1;
---enable_warnings
---echo
---echo # These statements will not be binlogged until the transaction is committed
-INSERT INTO t2 VALUES(11);
-INSERT INTO t2 VALUES(22);
-COMMIT;
-
-DROP TABLE t2, t3;
-SET SESSION AUTOCOMMIT= 1;
-sync_slave_with_master;
-
-
---echo #
---echo # Test semi-sync master will switch OFF after one transaction
---echo # timeout waiting for slave reply.
---echo #
-connection slave;
-source include/stop_slave.inc;
-
-connection master;
---source include/kill_binlog_dump_threads.inc
-set global rpl_semi_sync_master_timeout= 5000;
-
-# The first semi-sync check should be on because after slave stop,
-# there are no transactions on the master.
-echo [ master status should be ON ];
-
-let $status_var= Rpl_semi_sync_master_status;
-let $status_var_value= ON;
-source include/wait_for_status_var.inc;
-
-let $status_var= Rpl_semi_sync_master_clients;
-let $status_var_value= 0;
-source include/wait_for_status_var.inc;
-
-show status like 'Rpl_semi_sync_master_no_tx';
-show status like 'Rpl_semi_sync_master_yes_tx';
-
-echo [ semi-sync replication of these transactions will fail ];
-insert into t1 values (500);
-
-# Wait for the semi-sync replication of this transaction to timeout
-let $status_var= Rpl_semi_sync_master_status;
-let $status_var_value= OFF;
-source include/wait_for_status_var.inc;
-
-# The second semi-sync check should be off because one transaction
-# times out during waiting.
-echo [ master status should be OFF ];
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
-show status like 'Rpl_semi_sync_master_yes_tx';
-
-# Semi-sync status on master is now OFF, so all these transactions
-# will be replicated asynchronously.
-delete from t1 where a=10;
-delete from t1 where a=9;
-delete from t1 where a=8;
-delete from t1 where a=7;
-delete from t1 where a=6;
-delete from t1 where a=5;
-delete from t1 where a=4;
-delete from t1 where a=3;
-delete from t1 where a=2;
-delete from t1 where a=1;
-
-insert into t1 values (100);
-
-echo [ master status should be OFF ];
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
-show status like 'Rpl_semi_sync_master_yes_tx';
-
---echo #
---echo # Test semi-sync status on master will be ON again when slave catches up
---echo #
-
-# Save the master position for later use.
-save_master_pos;
-
-connection slave;
-
-echo [ slave status should be OFF ];
-show status like 'Rpl_semi_sync_slave_status';
-source include/start_slave.inc;
-sync_with_master;
-
-echo [ slave status should be ON ];
-show status like 'Rpl_semi_sync_slave_status';
-
-select count(distinct a) from t1;
-select min(a) from t1;
-select max(a) from t1;
-
-connection master;
-
-# The master semi-sync status should be on again after slave catches up.
-echo [ master status should be ON again after slave catches up ];
-
-let $status_var= Rpl_semi_sync_master_status;
-let $status_var_value= ON;
-source include/wait_for_status_var.inc;
-show status like 'Rpl_semi_sync_master_no_tx';
-show status like 'Rpl_semi_sync_master_yes_tx';
-show status like 'Rpl_semi_sync_master_clients';
-
---echo #
---echo # Test disable/enable master semi-sync on the fly.
---echo #
-
-drop table t1;
-sync_slave_with_master;
-
-source include/stop_slave.inc;
-
---echo #
---echo # Flush status
---echo #
-connection master;
-echo [ Semi-sync master status variables before FLUSH STATUS ];
-SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
-SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
-# Do not write the FLUSH STATUS to binlog, to make sure we'll get a
-# clean status after this.
-FLUSH NO_WRITE_TO_BINLOG STATUS;
-echo [ Semi-sync master status variables after FLUSH STATUS ];
-SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
-SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
-
-connection master;
-
-source include/show_master_logs.inc;
-show variables like 'rpl_semi_sync_master_enabled';
-
-echo [ disable semi-sync on the fly ];
-set global rpl_semi_sync_master_enabled=0;
-show variables like 'rpl_semi_sync_master_enabled';
-show status like 'Rpl_semi_sync_master_status';
-
-echo [ enable semi-sync on the fly ];
-set global rpl_semi_sync_master_enabled=1;
-show variables like 'rpl_semi_sync_master_enabled';
-show status like 'Rpl_semi_sync_master_status';
-
---echo #
---echo # Test RESET MASTER/SLAVE
---echo #
-
-connection slave;
-
-source include/start_slave.inc;
-
-connection master;
-
-replace_result $engine_type ENGINE_TYPE;
-eval create table t1 (a int) engine = $engine_type;
-drop table t1;
-
-sync_slave_with_master;
-
-echo [ test reset master ];
-connection master;
-
-reset master;
-
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
-show status like 'Rpl_semi_sync_master_yes_tx';
-
-connection slave;
-
-source include/stop_slave.inc;
---source include/reset_slave.inc
-
-# Kill the dump thread on master for previous slave connection and
---source include/kill_binlog_dump_threads.inc
-
-connection slave;
-source include/start_slave.inc;
-
-connection master;
-
-# Wait for dump thread to start, Rpl_semi_sync_master_clients will be
-# 1 after dump thread started.
-let $status_var= Rpl_semi_sync_master_clients;
-let $status_var_value= 1;
-source include/wait_for_status_var.inc;
-
-replace_result $engine_type ENGINE_TYPE;
-eval create table t1 (a int) engine = $engine_type;
-insert into t1 values (1);
-insert into t1 values (2), (3);
-
-sync_slave_with_master;
-
-select * from t1;
-
-connection master;
-
-echo [ master semi-sync status should be ON ];
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
-show status like 'Rpl_semi_sync_master_yes_tx';
-
---echo #
---echo # Start semi-sync replication without SUPER privilege
---echo #
-connection slave;
-source include/stop_slave.inc;
---source include/reset_slave.inc
-connection master;
-reset master;
-
-# Kill the dump thread on master for previous slave connection and wait for it to exit
---source include/kill_binlog_dump_threads.inc
-
-# Do not binlog the following statement because it will generate
-# different events for ROW and STATEMENT format
-set sql_log_bin=0;
-grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
-flush privileges;
-set sql_log_bin=1;
-connection slave;
-grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
-flush privileges;
-change master to master_user='rpl',master_password='rpl_password';
-source include/start_slave.inc;
-show status like 'Rpl_semi_sync_slave_status';
-connection master;
-
-# Wait for the semi-sync binlog dump thread to start
-let $status_var= Rpl_semi_sync_master_clients;
-let $status_var_value= 1;
-source include/wait_for_status_var.inc;
-echo [ master semi-sync should be ON ];
-show status like 'Rpl_semi_sync_master_clients';
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
-show status like 'Rpl_semi_sync_master_yes_tx';
-insert into t1 values (4);
-insert into t1 values (5);
-echo [ master semi-sync should be ON ];
-show status like 'Rpl_semi_sync_master_clients';
-show status like 'Rpl_semi_sync_master_status';
-show status like 'Rpl_semi_sync_master_no_tx';
-show status like 'Rpl_semi_sync_master_yes_tx';
-
---echo #
---echo # Test semi-sync slave connect to non-semi-sync master
---echo #
-
-# Disable semi-sync on master
-connection slave;
-source include/stop_slave.inc;
-SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
-
-connection master;
-
-# Kill the dump thread on master for previous slave connection and wait for it to exit
---source include/kill_binlog_dump_threads.inc
-
-echo [ Semi-sync status on master should be ON ];
-let $status_var= Rpl_semi_sync_master_clients;
-let $status_var_value= 0;
-source include/wait_for_status_var.inc;
-show status like 'Rpl_semi_sync_master_status';
-let $status_var= Rpl_semi_sync_master_status;
-let $status_var_value= ON;
-source include/wait_for_status_var.inc;
-set global rpl_semi_sync_master_enabled= 0;
-
-connection slave;
-SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
-source include/start_slave.inc;
-connection master;
-insert into t1 values (8);
-let $status_var= Rpl_semi_sync_master_clients;
-let $status_var_value= 1;
-source include/wait_for_status_var.inc;
-echo [ master semi-sync clients should be 1, status should be OFF ];
-show status like 'Rpl_semi_sync_master_clients';
-show status like 'Rpl_semi_sync_master_status';
-sync_slave_with_master;
-show status like 'Rpl_semi_sync_slave_status';
-
-# Uninstall semi-sync plugin on master
-connection slave;
-source include/stop_slave.inc;
-connection master;
-set global rpl_semi_sync_master_enabled= 0;
-
-connection slave;
-SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
-source include/start_slave.inc;
-
-connection master;
-insert into t1 values (10);
-sync_slave_with_master;
-
---echo #
---echo # Test non-semi-sync slave connect to semi-sync master
---echo #
-
-connection master;
-set global rpl_semi_sync_master_timeout= 5000; # 5s
-set global rpl_semi_sync_master_enabled= 1;
-
-connection slave;
-source include/stop_slave.inc;
-SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
-
-echo [ uninstall semi-sync slave plugin ];
-set global rpl_semi_sync_slave_enabled= 0;
-
-echo [ reinstall semi-sync slave plugin and disable semi-sync ];
-SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
-SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
-source include/start_slave.inc;
-SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
-
---echo #
---echo # Clean up
---echo #
-
-connection slave;
-source include/stop_slave.inc;
-set global rpl_semi_sync_slave_enabled= 0;
-
-connection master;
-set global rpl_semi_sync_master_enabled= 0;
-
-connection slave;
-change master to master_user='root',master_password='';
-source include/start_slave.inc;
-
-connection master;
-drop table t1;
-sync_slave_with_master;
-
-connection master;
-drop user rpl@127.0.0.1;
-flush privileges;
-set global rpl_semi_sync_master_timeout= default;
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_skip_replication.inc b/mysql-test/suite/rpl/include/rpl_skip_replication.inc
deleted file mode 100644
index d1044c4bf51..00000000000
--- a/mysql-test/suite/rpl/include/rpl_skip_replication.inc
+++ /dev/null
@@ -1,408 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it.
-#
-# Usage:
-#
-# --let $use_remote_mysqlbinlog= 1 # optional
-# --source suite/rpl/include/rpl_skip_replication.inc
-#
-# The script uses MYSQLBINLOG to verify certain results.
-# By default, it uses binary logs directly. If it is undesirable,
-# this behavior can be overridden by setting $use_remote_binlog
-# as shown above.
-# The value will be unset after every execution of the script,
-# so if it is needed, it should be set explicitly before each call.
-#
-
---source include/have_innodb.inc
---source include/master-slave.inc
-
---connection slave
---source include/stop_slave.inc
-CHANGE MASTER TO MASTER_USE_GTID=NO;
---source include/start_slave.inc
---connection master
-
-connection slave;
-# Test that SUPER is required to change @@replicate_events_marked_for_skip.
-CREATE USER 'nonsuperuser'@'127.0.0.1';
-GRANT ALTER,CREATE,DELETE,DROP,EVENT,INSERT,PROCESS,REPLICATION SLAVE,
- SELECT,UPDATE ON *.* TO 'nonsuperuser'@'127.0.0.1';
-connect(nonpriv, 127.0.0.1, nonsuperuser,, test, $SLAVE_MYPORT,);
-connection nonpriv;
---error ER_SPECIFIC_ACCESS_DENIED_ERROR
-SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
-disconnect nonpriv;
-connection slave;
-DROP USER'nonsuperuser'@'127.0.0.1';
-
-SELECT @@global.replicate_events_marked_for_skip;
---error ER_SLAVE_MUST_STOP
-SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
-SELECT @@global.replicate_events_marked_for_skip;
-STOP SLAVE;
---error ER_GLOBAL_VARIABLE
-SET SESSION replicate_events_marked_for_skip=FILTER_ON_MASTER;
-SELECT @@global.replicate_events_marked_for_skip;
-SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
-SELECT @@global.replicate_events_marked_for_skip;
-START SLAVE;
-
-connection master;
-SELECT @@skip_replication;
---error ER_LOCAL_VARIABLE
-SET GLOBAL skip_replication=1;
-SELECT @@skip_replication;
-
-CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
-CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=innodb;
-INSERT INTO t1(a) VALUES (1);
-INSERT INTO t2(a) VALUES (1);
-
-
-# Test that master-side filtering works.
-SET skip_replication=1;
-
-CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
-INSERT INTO t1(a) VALUES (2);
-INSERT INTO t2(a) VALUES (2);
-
-# Inject a rotate event in the binlog stream sent to slave (otherwise we will
-# fail sync_slave_with_master as the last event on the master is not present
-# on the slave).
-FLUSH NO_WRITE_TO_BINLOG LOGS;
-
-sync_slave_with_master;
-connection slave;
-SHOW TABLES;
-SELECT * FROM t1;
-SELECT * FROM t2;
-
-connection master;
-DROP TABLE t3;
-
-FLUSH NO_WRITE_TO_BINLOG LOGS;
-sync_slave_with_master;
-
-
-# Test that slave-side filtering works.
-connection slave;
-STOP SLAVE;
-SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
-START SLAVE;
-
-connection master;
-SET skip_replication=1;
-CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
-INSERT INTO t1(a) VALUES (3);
-INSERT INTO t2(a) VALUES (3);
-
-# Inject a rotate event in the binlog stream sent to slave (otherwise we will
-# fail sync_slave_with_master as the last event on the master is not present
-# on the slave).
-FLUSH NO_WRITE_TO_BINLOG LOGS;
-
-sync_slave_with_master;
-connection slave;
-SHOW TABLES;
-SELECT * FROM t1;
-SELECT * FROM t2;
-
-connection master;
-DROP TABLE t3;
-
-FLUSH NO_WRITE_TO_BINLOG LOGS;
-sync_slave_with_master;
-connection slave;
-STOP SLAVE;
-SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
-START SLAVE;
-
-
-# Test that events with @@skip_replication=1 are not filtered when filtering is
-# not set on slave.
-connection master;
-SET skip_replication=1;
-CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
-INSERT INTO t3(a) VALUES(2);
-sync_slave_with_master;
-connection slave;
-SELECT * FROM t3;
-connection master;
-DROP TABLE t3;
-
-#
-# Test that the slave will preserve the @@skip_replication flag in its
-# own binlog.
-#
-
-TRUNCATE t1;
-sync_slave_with_master;
-connection slave;
-RESET MASTER;
-
-connection master;
-SET skip_replication=0;
-INSERT INTO t1 VALUES (1,0);
-SET skip_replication=1;
-INSERT INTO t1 VALUES (2,0);
-SET skip_replication=0;
-INSERT INTO t1 VALUES (3,0);
-
-sync_slave_with_master;
-connection slave;
-# Since slave has @@replicate_events_marked_for_skip=REPLICATE, it should have
-# applied all events.
-SELECT * FROM t1 ORDER by a;
-
-STOP SLAVE;
-SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
-let $SLAVE_DATADIR= `select @@datadir`;
-
-connection master;
-TRUNCATE t1;
-
-# Now apply the slave binlog to the master, to check that both the slave
-# and mysqlbinlog will preserve the @@skip_replication flag.
-
---let $mysqlbinlog_args= $SLAVE_DATADIR/slave-bin.000001
-if ($use_remote_mysqlbinlog)
-{
- --let $mysqlbinlog_args= --read-from-remote-server --protocol=tcp --host=127.0.0.1 --port=$SLAVE_MYPORT -uroot slave-bin.000001
- --let $use_remote_mysqlbinlog= 0
-}
---exec $MYSQL_BINLOG $mysqlbinlog_args > $MYSQLTEST_VARDIR/tmp/rpl_skip_replication.binlog
---exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/rpl_skip_replication.binlog
-
-# The master should have all three events.
-SELECT * FROM t1 ORDER by a;
-
-# The slave should be missing event 2, which is marked with the
-# @@skip_replication flag.
-
-connection slave;
-START SLAVE;
-
-connection master;
-sync_slave_with_master;
-
-connection slave;
-SELECT * FROM t1 ORDER by a;
-
-#
-# Test that @@sql_slave_skip_counter does not count skipped @@skip_replication
-# events.
-#
-
-connection master;
-TRUNCATE t1;
-
-sync_slave_with_master;
-connection slave;
-STOP SLAVE;
-# We will skip two INSERTs (in addition to any skipped due to
-# @@skip_replication). Since from 5.5 every statement is wrapped in
-# BEGIN ... END, we need to skip 6 events for this.
-SET GLOBAL sql_slave_skip_counter=6;
-SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
-START SLAVE;
-
-connection master;
-# Need to fix @@binlog_format to get consistent event count.
-SET @old_binlog_format= @@binlog_format;
-SET binlog_format= statement;
-SET skip_replication=0;
-INSERT INTO t1 VALUES (1,5);
-SET skip_replication=1;
-INSERT INTO t1 VALUES (2,5);
-SET skip_replication=0;
-INSERT INTO t1 VALUES (3,5);
-INSERT INTO t1 VALUES (4,5);
-SET binlog_format= @old_binlog_format;
-
-sync_slave_with_master;
-connection slave;
-
-# The slave should have skipped the first three inserts (number 1 and 3 due
-# to @@sql_slave_skip_counter=2, number 2 due to
-# @@replicate_events_marked_for_skip=FILTER_ON_SLAVE). So only number 4
-# should be left.
-SELECT * FROM t1;
-
-
-#
-# Check that BINLOG statement preserves the @@skip_replication flag.
-#
-connection slave;
-# Need row @@binlog_format for BINLOG statements containing row events.
---source include/stop_slave.inc
-SET @old_slave_binlog_format= @@global.binlog_format;
-SET GLOBAL binlog_format= row;
---source include/start_slave.inc
-
-connection master;
-TRUNCATE t1;
-
-SET @old_binlog_format= @@binlog_format;
-SET binlog_format= row;
-# Format description log event.
-BINLOG 'wlZOTw8BAAAA8QAAAPUAAAAAAAQANS41LjIxLU1hcmlhREItZGVidWctbG9nAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAA2QAEGggAAAAICAgCAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAA371saA==';
-# INSERT INTO t1 VALUES (1,8) # with @@skip_replication=1
-BINLOG 'wlZOTxMBAAAAKgAAAGMBAAAAgCkAAAAAAAEABHRlc3QAAnQxAAIDAwAC
-wlZOTxcBAAAAJgAAAIkBAAAAgCkAAAAAAAEAAv/8AQAAAAgAAAA=';
-# INSERT INTO t1 VALUES (2,8) # with @@skip_replication=0
-BINLOG 'wlZOTxMBAAAAKgAAADwCAAAAACkAAAAAAAEABHRlc3QAAnQxAAIDAwAC
-wlZOTxcBAAAAJgAAAGICAAAAACkAAAAAAAEAAv/8AgAAAAgAAAA=';
-SET binlog_format= @old_binlog_format;
-
-SELECT * FROM t1 ORDER BY a;
-sync_slave_with_master;
-connection slave;
-# Slave should have only the second insert, the first should be ignored due to
-# the @@skip_replication flag.
-SELECT * FROM t1 ORDER by a;
-
---source include/stop_slave.inc
-SET GLOBAL binlog_format= @old_slave_binlog_format;
---source include/start_slave.inc
-
-
-# Test that it is not possible to change @@skip_replication inside a
-# transaction or statement, thereby replicating only parts of statements
-# or transactions.
-connection master;
-SET skip_replication=0;
-
-BEGIN;
---error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SET skip_replication=0;
---error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SET skip_replication=1;
-ROLLBACK;
-SET skip_replication=1;
-BEGIN;
---error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SET skip_replication=0;
---error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SET skip_replication=1;
-COMMIT;
-SET autocommit=0;
-INSERT INTO t2(a) VALUES(100);
---error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SET skip_replication=1;
-ROLLBACK;
-SET autocommit=1;
-
-SET skip_replication=1;
---delimiter |
-CREATE FUNCTION foo (x INT) RETURNS INT BEGIN SET SESSION skip_replication=x; RETURN x; END|
-CREATE PROCEDURE bar(x INT) BEGIN SET SESSION skip_replication=x; END|
-CREATE FUNCTION baz (x INT) RETURNS INT BEGIN CALL bar(x); RETURN x; END|
---delimiter ;
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SELECT foo(0);
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SELECT baz(0);
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SET @a= foo(1);
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
-SET @a= baz(1);
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
-UPDATE t2 SET b=foo(0);
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
-UPDATE t2 SET b=baz(0);
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
-INSERT INTO t1 VALUES (101, foo(1));
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
-INSERT INTO t1 VALUES (101, baz(0));
-SELECT @@skip_replication;
-CALL bar(0);
-SELECT @@skip_replication;
-CALL bar(1);
-SELECT @@skip_replication;
-DROP FUNCTION foo;
-DROP PROCEDURE bar;
-DROP FUNCTION baz;
-
-
-# Test that master-side filtering happens on the master side, and that
-# slave-side filtering happens on the slave.
-
-# First test that events do not reach the slave when master-side filtering
-# is configured. Do this by replicating first with only the IO thread running
-# and master-side filtering; then change to no filtering and start the SQL
-# thread. This should still skip the events, as master-side filtering
-# means the events never reached the slave.
-connection master;
-SET skip_replication= 0;
-TRUNCATE t1;
-sync_slave_with_master;
-connection slave;
-STOP SLAVE;
-SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
-START SLAVE IO_THREAD;
-connection master;
-SET skip_replication= 1;
-INSERT INTO t1(a) VALUES (1);
-SET skip_replication= 0;
-INSERT INTO t1(a) VALUES (2);
---source include/save_master_pos.inc
-connection slave;
---source include/sync_io_with_master.inc
-STOP SLAVE IO_THREAD;
-SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
-START SLAVE;
-connection master;
-sync_slave_with_master;
-connection slave;
-# Now only the second insert of (2) should be visible, as the first was
-# filtered on the master, so even though the SQL thread ran without skipping
-# events, it will never see the event in the first place.
-SELECT * FROM t1;
-
-# Now tests that when slave-side filtering is configured, events _do_ reach
-# the slave.
-connection master;
-SET skip_replication= 0;
-TRUNCATE t1;
-sync_slave_with_master;
-connection slave;
-STOP SLAVE;
-SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
-START SLAVE IO_THREAD;
-connection master;
-SET skip_replication= 1;
-INSERT INTO t1(a) VALUES (1);
-SET skip_replication= 0;
-INSERT INTO t1(a) VALUES (2);
---source include/save_master_pos.inc
-connection slave;
---source include/sync_io_with_master.inc
-STOP SLAVE IO_THREAD;
-SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
-START SLAVE;
-connection master;
-sync_slave_with_master;
-connection slave;
-# Now both inserts should be visible. Since filtering was configured to be
-# slave-side, the event is in the relay log, and when the SQL thread ran we
-# had disabled filtering again.
-SELECT * FROM t1 ORDER BY a;
-
-
-# Clean up.
-connection master;
-SET skip_replication=0;
-DROP TABLE t1,t2;
-connection slave;
-STOP SLAVE;
-SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
-START SLAVE;
-
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_special_charset.inc b/mysql-test/suite/rpl/include/rpl_special_charset.inc
deleted file mode 100644
index 641aa483d32..00000000000
--- a/mysql-test/suite/rpl/include/rpl_special_charset.inc
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
-################################################################################
-# Bug#19855907 IO THREAD AUTHENTICATION ISSUE WITH SOME CHARACTER SETS
-# Problem: IO thread fails to connect to master if servers are configured with
-# special character sets like utf16, utf32, ucs2.
-#
-# Analysis: MySQL server does not support few special character sets like
-# utf16,utf32 and ucs2 as "client's character set"(eg: utf16,utf32, ucs2).
-# When IO thread is trying to connect to Master, it sets server's character
-# set as client's character set. When Slave server is started with these
-# special character sets, IO thread (a connection to Master) fails because
-# of the above said reason.
-#
-# Fix: If server's character set is not supported as client's character set,
-# then set default's client character set(latin1) as client's character set.
-###############################################################################
---source include/master-slave.inc
-call mtr.add_suppression("'utf16' can not be used as client character set");
-CREATE TABLE t1(i VARCHAR(20));
-INSERT INTO t1 VALUES (0xFFFF);
---sync_slave_with_master
---let diff_tables=master:t1, slave:t1
---source include/diff_tables.inc
-# Cleanup
---connection master
-DROP TABLE t1;
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_sporadic_master.inc b/mysql-test/suite/rpl/include/rpl_sporadic_master.inc
deleted file mode 100644
index ad4c44cbf74..00000000000
--- a/mysql-test/suite/rpl/include/rpl_sporadic_master.inc
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
-# test to see if replication can continue when master sporadically fails on
-# COM_BINLOG_DUMP and additionally limits the number of events per dump
-
-source include/master-slave.inc;
-
-create table t2(n int);
-create table t1(n int not null auto_increment primary key);
-insert into t1 values (NULL),(NULL);
-truncate table t1;
-# We have to use 4 in the following to make this test work with all table types
-insert into t1 values (4),(NULL);
-sync_slave_with_master;
---source include/stop_slave.inc
---source include/start_slave.inc
-connection master;
-insert into t1 values (NULL),(NULL);
-flush logs;
-truncate table t1;
-insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL);
-sync_slave_with_master;
-select * from t1 ORDER BY n;
-connection master;
-drop table t1,t2;
-sync_slave_with_master;
-
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_ssl.inc b/mysql-test/suite/rpl/include/rpl_ssl.inc
deleted file mode 100644
index 59a2af9f137..00000000000
--- a/mysql-test/suite/rpl/include/rpl_ssl.inc
+++ /dev/null
@@ -1,116 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
-source include/have_ssl_communication.inc;
-source include/master-slave.inc;
-source include/no_valgrind_without_big.inc;
-
-# create a user for replication that requires ssl encryption
-connection master;
-create user replssl@localhost;
-grant replication slave on *.* to replssl@localhost require ssl;
-create table t1 (t int auto_increment, KEY(t));
-
-sync_slave_with_master;
-
-# Set slave to use SSL for connection to master
-stop slave;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval change master to
- master_user='replssl',
- master_password='',
- master_ssl=1,
- master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem',
- master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem',
- master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem';
-start slave;
-
-# Switch to master and insert one record, then sync it to slave
-connection master;
-insert into t1 values(1);
-sync_slave_with_master;
-
-# The record should now be on slave
-select * from t1;
-
-# The slave is synced and waiting/reading from master
-# SHOW SLAVE STATUS will show "Waiting for master to send event"
-let $status_items= Master_SSL_Allowed, Master_SSL_CA_Path, Master_SSL_CA_File, Master_SSL_Crl, Master_SSL_Crlpath, Master_SSL_Cert, Master_SSL_Key;
-source include/show_slave_status.inc;
-source include/check_slave_is_running.inc;
-
-# Stop the slave, as reported in bug#21871 it would hang
-STOP SLAVE;
-
-select * from t1;
-
-# Do the same thing a number of times
-disable_query_log;
-disable_result_log;
-# 2007-11-27 mats Bug #32756 Starting and stopping the slave in a loop can lose rows
-# After discussions with Engineering, I'm disabling this part of the test to avoid it causing
-# red trees.
-disable_parsing;
-let $i= 100;
-while ($i)
-{
- start slave;
- connection master;
- insert into t1 values (NULL);
- select * from t1; # Some variance
- connection slave;
- select * from t1; # Some variance
- stop slave;
- dec $i;
-}
-enable_parsing;
-START SLAVE;
-enable_query_log;
-enable_result_log;
-connection master;
-# INSERT one more record to make sure
-# the sync has something to do
-insert into t1 values (NULL);
-let $master_count= `select count(*) from t1`;
-
-sync_slave_with_master;
---source include/wait_for_slave_to_start.inc
-source include/show_slave_status.inc;
-source include/check_slave_is_running.inc;
-
-let $slave_count= `select count(*) from t1`;
-
-if ($slave_count != $master_count)
-{
- echo master and slave differed in number of rows;
- echo master: $master_count;
- echo slave: $slave_count;
-
- connection master;
- select count(*) t1;
- select * from t1;
- connection slave;
- select count(*) t1;
- select * from t1;
- query_vertical show slave status;
-}
-
-connection master;
-drop user replssl@localhost;
-drop table t1;
-sync_slave_with_master;
-
---source include/stop_slave.inc
-CHANGE MASTER TO
- master_user = 'root',
- master_ssl = 0,
- master_ssl_ca = '',
- master_ssl_cert = '',
- master_ssl_key = '';
-
---echo End of 5.0 tests
---let $rpl_only_running_threads= 1
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_stm_relay_ign_space.inc b/mysql-test/suite/rpl/include/rpl_stm_relay_ign_space.inc
deleted file mode 100644
index 654a5d47cb9..00000000000
--- a/mysql-test/suite/rpl/include/rpl_stm_relay_ign_space.inc
+++ /dev/null
@@ -1,107 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
-#
-# BUG#12400313 / BUG#64503 test case
-#
-#
-# Description
-# -----------
-#
-# This test case starts the slave server with:
-# --relay-log-space-limit=8192 --relay-log-purge --max-relay-log-size=4096
-#
-# Then it issues some queries that will cause the slave to reach
-# relay-log-space-limit. We lock the table so that the SQL thread is
-# not able to purge the log and then we issue some more statements.
-#
-# The purpose is to show that the IO thread will honor the limits
-# while the SQL thread is not able to purge the relay logs, which did
-# not happen before this patch. In addition we assert that while
-# ignoring the limit (SQL thread needs to rotate before purging), the
-# IO thread does not do it in an uncontrolled manner.
-
---source include/have_binlog_format_statement.inc
---source include/have_innodb.inc
---source include/master-slave.inc
-
---disable_query_log
-CREATE TABLE t1 (c1 TEXT) engine=InnoDB;
-
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-
---sync_slave_with_master
-
-# wait for the SQL thread to sleep
---let $show_statement= SHOW PROCESSLIST
---let $field= State
---let $condition= = 'Slave has read all relay log; waiting for more updates'
---source include/wait_show_condition.inc
-
-# now the io thread has set rli->ignore_space_limit
-# lets lock the table so that once the SQL thread awakes
-# it blocks there and does not set rli->ignore_space_limit
-# back to zero
-LOCK TABLE t1 WRITE;
-
-# now issue more statements that will overflow the
-# rli->log_space_limit (in this case ~10K)
---connection master
-
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-
---connection slave
-
-# ASSERT that the IO thread waits for the SQL thread to release some
-# space before continuing
---let $show_statement= SHOW PROCESSLIST
---let $field= State
---let $condition= LIKE 'Waiting for %'
-# before the patch (IO would have transfered everything)
-#--let $condition= = 'Waiting for master to send event'
-# after the patch (now it waits for space to be freed)
-#--let $condition= = 'Waiting for the slave SQL thread to free enough relay log space'
---source include/wait_show_condition.inc
-
-# without the patch we can uncomment the following two lines and
-# watch the IO thread synchronize with the master, thus writing
-# relay logs way over the space limit
-#--connection master
-#--source include/sync_slave_io_with_master.inc
-
-## ASSERT that the IO thread has honored the limit+few bytes required to be able to purge
---let $relay_log_space_while_sql_is_executing = query_get_value(SHOW SLAVE STATUS, Relay_Log_Space, 1)
---let $relay_log_space_limit = query_get_value(SHOW VARIABLES LIKE "relay_log_space_limit", Value, 1)
---let $assert_text= Assert that relay log space is close to the limit
---let $assert_cond= $relay_log_space_while_sql_is_executing <= $relay_log_space_limit * 1.15
---source include/assert.inc
-
-# unlock the table and let SQL thread continue applying events
-UNLOCK TABLES;
-
---connection master
---sync_slave_with_master
---let $diff_tables=master:test.t1,slave:test.t1
---source include/diff_tables.inc
-
---connection master
-DROP TABLE t1;
---enable_query_log
---sync_slave_with_master
-
---source include/rpl_end.inc
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
deleted file mode 100644
index d814a257711..00000000000
--- a/mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc
+++ /dev/null
@@ -1,633 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
-#
-# rpl_switch_stm_row_mixed tests covers
-#
-# - 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 SYS_GUID(), thereafter to serve as the
-# definition of MIXED binlog format
-# - correctness of execution
-
-
--- source include/have_binlog_format_mixed_or_row.inc
--- source include/master-slave.inc
-
-# Since this test generates row-based events in the binary log, the
-# slave SQL thread cannot be in STATEMENT mode to execute this test,
-# so we only execute it for MIXED and ROW as default value of
-# BINLOG_FORMAT.
-
-connection slave;
-
-connection master;
---disable_warnings
-drop database if exists mysqltest1;
-create database mysqltest1;
---enable_warnings
-use mysqltest1;
-
-# Save binlog format
-set @my_binlog_format= @@global.binlog_format;
-
-# play with switching
-set session binlog_format=mixed;
-show session variables like "binlog_format%";
-set session binlog_format=statement;
-show session variables like "binlog_format%";
-set session binlog_format=row;
-show session variables like "binlog_format%";
-
-set global binlog_format=DEFAULT;
-show global variables like "binlog_format%";
-set global binlog_format=MIXED;
-show global variables like "binlog_format%";
-set global binlog_format=STATEMENT;
-show global variables like "binlog_format%";
-set global binlog_format=ROW;
-show global variables like "binlog_format%";
-show session variables like "binlog_format%";
-select @@global.binlog_format, @@session.binlog_format;
-
-CREATE TABLE t1 (a varchar(100));
-
-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(SYS_GUID(),"work_3_"));
-execute stmt1 using @string;
-deallocate prepare stmt1;
-
-insert into t1 values(concat("for_4_",SYS_GUID()));
-insert into t1 select "yesterday_5_";
-
-# verify that temp tables prevent a switch to SBR
-create temporary table tmp(a char(100));
-insert into tmp values("see_6_");
---error ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
-set binlog_format=statement;
-insert into t1 select * from tmp;
-drop temporary table tmp;
-
-# Now we go to SBR
-set binlog_format=statement;
-show global variables like "binlog_format%";
-show session variables like "binlog_format%";
-select @@global.binlog_format, @@session.binlog_format;
-set global binlog_format=statement;
-show global variables like "binlog_format%";
-show session variables like "binlog_format%";
-select @@global.binlog_format, @@session.binlog_format;
-
-prepare stmt1 from 'insert into t1 select ?';
-set @string="emergency_7_";
-insert into t1 values("work_8_");
-execute stmt1 using @string;
-deallocate prepare stmt1;
-
-prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values("work_9_");
-execute stmt1 using @string;
-deallocate prepare stmt1;
-
-insert into t1 values("for_10_");
-insert into t1 select "yesterday_11_";
-
-# test statement (is not default after wl#3368)
-set binlog_format=statement;
-select @@global.binlog_format, @@session.binlog_format;
-set global binlog_format=statement;
-select @@global.binlog_format, @@session.binlog_format;
-
-prepare stmt1 from 'insert into t1 select ?';
-set @string="emergency_12_";
-insert into t1 values("work_13_");
-execute stmt1 using @string;
-deallocate prepare stmt1;
-
-prepare stmt1 from 'insert into t1 select ?';
-insert into t1 values("work_14_");
-execute stmt1 using @string;
-deallocate prepare stmt1;
-
-insert into t1 values("for_15_");
-insert into t1 select "yesterday_16_";
-
-# and now the mixed mode
-
-set global binlog_format=mixed;
-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(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(SYS_GUID(),"work_19_"));
-execute stmt1 using @string;
-deallocate prepare stmt1;
-
-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(SYS_GUID(),"work_22_"));
-execute stmt1 using @string;
-deallocate prepare stmt1;
-
-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(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 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 SYS_GUID() is first:
---disable_warnings
-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
-
-delimiter |;
-create procedure foo()
-begin
-insert into t1 values("work_25_");
-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_",SYS_GUID()));
-insert into t1 values("work_29_");
-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;
-end|
-create function foo3() returns bigint unsigned
-begin
- set session binlog_format=row; # rejected for stored funcs
- insert into t1 values("alarm");
- return 100;
-end|
-create procedure foo4(x varchar(100))
-begin
-insert into t1 values(concat("work_250_",x));
-insert into t1 select "yesterday_270_";
-end|
-delimiter ;|
-call foo();
-call foo2();
-call foo4("hello");
-call foo4(SYS_GUID());
-call foo4("world");
-
-# test that can't SET in a stored function
---error ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT
-select foo3();
-select * from t1 where a="alarm";
-
-# Tests of stored functions/triggers/views for BUG#20930 "Mixed
-# binlogging mode does not work with stored functions, triggers,
-# views"
-
-# Function which calls procedure
-drop function foo3;
-delimiter |;
-create function foo3() returns bigint unsigned
-begin
- insert into t1 values("foo3_32_");
- call foo();
- return 100;
-end|
-delimiter ;|
-insert into t2 select foo3();
-
-prepare stmt1 from 'insert into t2 select foo3()';
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-
-# Test if stored function calls stored function which calls procedure
-# which requires row-based.
-
-delimiter |;
-create function foo4() returns bigint unsigned
-begin
- insert into t2 select foo3();
- return 100;
-end|
-delimiter ;|
-select foo4();
-
-prepare stmt1 from 'select foo4()';
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-
-# A simple stored function
-delimiter |;
-create function foo5() returns bigint unsigned
-begin
- insert into t2 select SYS_GUID();
- return 100;
-end|
-delimiter ;|
-select foo5();
-
-prepare stmt1 from 'select foo5()';
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-
-# A simple stored function where SYS_GUID() is in the argument
-delimiter |;
-create function foo6(x varchar(100)) returns bigint unsigned
-begin
- insert into t2 select x;
- return 100;
-end|
-delimiter ;|
-select foo6("foo6_1_");
-select foo6(concat("foo6_2_",SYS_GUID()));
-
-prepare stmt1 from 'select foo6(concat("foo6_3_",SYS_GUID()))';
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-
-
-# Test of views using SYS_GUID()
-
-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,
-# to verify that it binlogs statement-based (is not polluted by
-# the parsing of the view's body).
-insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11');
-prepare stmt1 from "insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')";
-execute stmt1;
-execute stmt1;
-deallocate prepare stmt1;
-
-# 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,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_",SYS_GUID()));
-insert delayed into t2 values("delay_6_");
-
-# Test for BUG#20633 (INSERT DELAYED RAND()/user_variable does not
-# replicate fine in statement-based ; we test that in mixed mode it
-# works).
-insert delayed into t2 values(rand());
-set @a=2.345;
-insert delayed into t2 values(@a);
-
-# With INSERT DELAYED, rows are written to the binlog after they are
-# written to the table. Therefore, it is not enough to wait until the
-# rows make it to t2 on the master (the rows may not be in the binlog
-# at that time, and may still not be in the binlog when
-# sync_slave_with_master is later called). Instead, we wait until the
-# rows make it to t2 on the slave. We first call
-# sync_slave_with_master, so that we are sure that t2 has been created
-# on the slave.
-sync_slave_with_master;
-let $wait_condition= SELECT COUNT(*) = 19 FROM mysqltest1.t2;
---source include/wait_condition.inc
-connection master;
-
-# If you want to do manual testing of the mixed mode regarding UDFs (not
-# testable automatically as quite platform- and compiler-dependent),
-# you just need to set the variable below to 1, and to
-# "make udf_example.so" in sql/, and to copy sql/udf_example.so to
-# MYSQL_TEST_DIR/lib/mysql.
-let $you_want_to_test_UDF=0;
-if ($you_want_to_test_UDF)
-{
- CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so';
- prepare stmt1 from 'insert into t1 select metaphon(?)';
- set @string="emergency_133_";
- insert into t1 values("work_134_");
- execute stmt1 using @string;
- deallocate prepare stmt1;
- prepare stmt1 from 'insert into t1 select ?';
- insert into t1 values(metaphon("work_135_"));
- execute stmt1 using @string;
- deallocate prepare stmt1;
- insert into t1 values(metaphon("for_136_"));
- insert into t1 select "yesterday_137_";
- create table t6 select metaphon("for_138_");
- create table t7 select 1 union select metaphon("for_139_");
- create table t8 select * from t1 where 3 in (select 1 union select 2 union select metaphon("for_140_") union select 3);
- create table t9 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
-}
-
-create table t20 select * from t1; # save for comparing later
-create table t21 select * from t2;
-create table t22 select * from t3;
-drop table t1,t2,t3;
-
-# This tests the fix to
-# BUG#19630 stored function inserting into two auto_increment breaks statement-based binlog
-# We verify that under the mixed binlog mode, a stored function
-# modifying at least two tables having an auto_increment column,
-# is binlogged row-based. Indeed in statement-based binlogging,
-# only the auto_increment value generated for the first table
-# is recorded in the binlog, the value generated for the 2nd table
-# lacking.
-
-create table t1 (a int primary key auto_increment, b varchar(100));
-create table t2 (a int primary key auto_increment, b varchar(100));
-create table t3 (b varchar(100));
-delimiter |;
-create function f (x varchar(100)) returns int deterministic
-begin
- insert into t1 values(null,x);
- insert into t2 values(null,x);
- return 1;
-end|
-delimiter ;|
-select f("try_41_");
-# Two operations which compensate each other except that their net
-# effect is that they advance the auto_increment counter of t2 on slave:
-sync_slave_with_master;
-use mysqltest1;
-insert into t2 values(2,null),(3,null),(4,null);
-delete from t2 where a>=2;
-
-connection master;
-# this is the call which didn't replicate well
-select f("try_42_");
-sync_slave_with_master;
-
-# now use prepared statement and test again, just to see that the RBB
-# mode isn't set at PREPARE but at EXECUTE.
-
-insert into t2 values(3,null),(4,null);
-delete from t2 where a>=3;
-
-connection master;
-prepare stmt1 from 'select f(?)';
-set @string="try_43_";
-insert into t1 values(null,"try_44_"); # should be SBB
-execute stmt1 using @string; # should be RBB
-deallocate prepare stmt1;
-sync_slave_with_master;
-
-# verify that if only one table has auto_inc, it does not trigger RBB
-# (we'll check in binlog further below)
-
-connection master;
-create table t12 select * from t1; # save for comparing later
-drop table t1;
-create table t1 (a int, b varchar(100), key(a));
-select f("try_45_");
-
-# restore table's key
-create table t13 select * from t1;
-drop table t1;
-create table t1 (a int primary key auto_increment, b varchar(100));
-
-# now test if it's two functions, each of them inserts in one table
-
-drop function f;
-# we need a unique key to have sorting of rows by mysqldump
-create table t14 (unique (a)) select * from t2;
-truncate table t2;
-delimiter |;
-create function f1 (x varchar(100)) returns int deterministic
-begin
- insert into t1 values(null,x);
- return 1;
-end|
-create function f2 (x varchar(100)) returns int deterministic
-begin
- insert into t2 values(null,x);
- return 1;
-end|
-delimiter ;|
-select f1("try_46_"),f2("try_47_");
-
-sync_slave_with_master;
-insert into t2 values(2,null),(3,null),(4,null);
-delete from t2 where a>=2;
-
-connection master;
-# Test with SELECT and INSERT
-select f1("try_48_"),f2("try_49_");
-insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_")));
-sync_slave_with_master;
-
-# verify that if f2 does only read on an auto_inc table, this does not
-# switch to RBB
-connection master;
-drop function f2;
-delimiter |;
-create function f2 (x varchar(100)) returns int deterministic
-begin
- declare y int;
- insert into t1 values(null,x);
- set y = (select count(*) from t2);
- return y;
-end|
-delimiter ;|
-select f1("try_53_"),f2("try_54_");
-sync_slave_with_master;
-
-# And now, a normal statement with a trigger (no stored functions)
-
-connection master;
-drop function f2;
-delimiter |;
-create trigger t1_bi before insert on t1 for each row
-begin
- insert into t2 values(null,"try_55_");
-end|
-delimiter ;|
-insert into t1 values(null,"try_56_");
-# and now remove one auto_increment and verify SBB
-alter table t1 modify a int, drop primary key;
-insert into t1 values(null,"try_57_");
-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 SYS_GUID();
-create table t16 like t15;
-INSERT INTO t16 SELECT * FROM t15;
-# we'll verify that this one is done RBB
-insert into t16 values("try_65_");
-drop table t15;
-# we'll verify that this one is done SBB
-insert into t16 values("try_66_");
-sync_slave_with_master;
-
-# and now compare:
-
-connection master;
-
-# first check that data on master is sensible
-select count(*) from t1;
-select count(*) from t2;
-select count(*) from t3;
-select count(*) from t4;
-select count(*) from t5;
-select count(*) from t11;
-select count(*) from t20;
-select count(*) from t21;
-select count(*) from t22;
-select count(*) from t12;
-select count(*) from t13;
-select count(*) from t14;
-select count(*) from t16;
-if ($you_want_to_test_UDF)
-{
- select count(*) from t6;
- select count(*) from t7;
- select count(*) from t8;
- select count(*) from t9;
-}
-
-sync_slave_with_master;
-
-#
-# Bug#20863 If binlog format is changed between update and unlock of
-# tables, wrong binlog
-#
-
-connection master;
-DROP TABLE IF EXISTS t11;
-SET SESSION BINLOG_FORMAT=STATEMENT;
-CREATE TABLE t11 (song VARCHAR(255));
-LOCK TABLES t11 WRITE;
-SET SESSION BINLOG_FORMAT=ROW;
-INSERT INTO t11 VALUES('Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict');
-SET SESSION BINLOG_FORMAT=STATEMENT;
-INSERT INTO t11 VALUES('Careful With That Axe, Eugene');
-UNLOCK TABLES;
-
---query_vertical SELECT * FROM t11
-sync_slave_with_master;
-USE mysqltest1;
---query_vertical SELECT * FROM t11
-
-connection master;
-DROP TABLE IF EXISTS t12;
-SET SESSION BINLOG_FORMAT=MIXED;
-CREATE TABLE t12 (data LONG);
-LOCK TABLES t12 WRITE;
-INSERT INTO t12 VALUES(SYS_GUID());
-UNLOCK TABLES;
-sync_slave_with_master;
-
-#
-# BUG#28086: SBR of USER() becomes corrupted on slave
-#
-
-connection master;
-
-# Just to get something that is non-trivial, albeit still simple, we
-# stuff the result of USER() and CURRENT_USER() into a variable.
---delimiter $$
-CREATE FUNCTION my_user()
- RETURNS CHAR(64)
-BEGIN
- DECLARE user CHAR(64);
- SELECT USER() INTO user;
- RETURN user;
-END $$
---delimiter ;
-
---delimiter $$
-CREATE FUNCTION my_current_user()
- RETURNS CHAR(64)
-BEGIN
- DECLARE user CHAR(64);
- SELECT CURRENT_USER() INTO user;
- RETURN user;
-END $$
---delimiter ;
-
-DROP TABLE IF EXISTS t13;
-CREATE TABLE t13 (data CHAR(64));
-INSERT INTO t13 VALUES (USER());
-INSERT INTO t13 VALUES (my_user());
-INSERT INTO t13 VALUES (CURRENT_USER());
-INSERT INTO t13 VALUES (my_current_user());
-
-sync_slave_with_master;
-
-# 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
-
-# Let's compare. Note: If they match test will pass, if they do not match
-# the test will show that the diff statement failed and not reject file
-# will be created. You will need to go to the mysql-test dir and diff
-# the files your self to see what is not matching
-
-diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
-
-connection master;
-
-# Now test that mysqlbinlog works fine on a binlog generated by the
-# mixed mode
-
-# BUG#11312 "DELIMITER is not written to the binary log that causes
-# syntax error" makes that mysqlbinlog will fail if we pass it the
-# text of queries; this forces us to use --base64-output here.
-
-# BUG#20929 "BINLOG command causes invalid free plus assertion
-# failure" makes mysqld segfault when receiving --base64-output
-
-# So I can't enable this piece of test
-# SIGH
-
-if ($enable_when_11312_or_20929_fixed)
-{
---exec $MYSQL_BINLOG --base64-output $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql
-drop database mysqltest1;
---exec $MYSQL < $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql
---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
-# the old mysqldump output on slave is the same as what it was on
-# master before restoring on master.
-diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
-}
-
-drop database mysqltest1;
-sync_slave_with_master;
-
-connection master;
-# Restore binlog format setting
-set global binlog_format =@my_binlog_format;
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_sync_test.inc b/mysql-test/suite/rpl/include/rpl_sync_test.inc
deleted file mode 100644
index 1e2ec2ca83b..00000000000
--- a/mysql-test/suite/rpl/include/rpl_sync_test.inc
+++ /dev/null
@@ -1,159 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
-########################################################################################
-# This test verifies the options --sync-relay-log-info and --relay-log-recovery by
-# crashing the slave in two different situations:
-# (case-1) - Corrupt the relay log with changes which were not processed by
-# the SQL Thread and crashes it.
-# (case-2) - Corrupt the master.info with wrong coordinates and crashes it.
-#
-# Case 1:
-# 1 - Stops the SQL Thread
-# 2 - Inserts new records into the master.
-# 3 - Corrupts the relay-log.bin* which most likely has such changes.
-# 4 - Crashes the slave
-# 5 - Verifies if the slave is sync with the master which means that the information
-# loss was circumvented by the recovery process.
-#
-# Case 2:
-# 1 - Stops the SQL/IO Threads
-# 2 - Inserts new records into the master.
-# 3 - Corrupts the master.info with wrong coordinates.
-# 4 - Crashes the slave
-# 5 - Verifies if the slave is sync with the master which means that the information
-# loss was circumvented by the recovery process.
-########################################################################################
-
-########################################################################################
-# Configuring the environment
-########################################################################################
---echo =====Configuring the enviroment=======;
---source include/not_embedded.inc
---source include/not_valgrind.inc
---source include/have_debug.inc
---source include/have_innodb.inc
---source include/not_crashrep.inc
---source include/master-slave.inc
-
-call mtr.add_suppression('Attempting backtrace');
-call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
-# Use innodb so we do not get "table should be repaired" issues.
-ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
-flush tables;
-CREATE TABLE t1(a INT, PRIMARY KEY(a)) engine=innodb;
-
-insert into t1(a) values(1);
-insert into t1(a) values(2);
-insert into t1(a) values(3);
-
-########################################################################################
-# Case 1: Corrupt a relay-log.bin*
-########################################################################################
---echo =====Inserting data on the master but without the SQL Thread being running=======;
-sync_slave_with_master;
-
-connection slave;
-let $MYSQLD_SLAVE_DATADIR= `select @@datadir`;
---replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
---copy_file $MYSQLD_SLAVE_DATADIR/master.info $MYSQLD_SLAVE_DATADIR/master.backup
---source include/stop_slave_sql.inc
-
-connection master;
-insert into t1(a) values(4);
-insert into t1(a) values(5);
-insert into t1(a) values(6);
-
---echo =====Removing relay log files and crashing/recoverying the slave=======;
-connection slave;
---source include/stop_slave_io.inc
-
-let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1);
-
---let FILE_TO_CORRUPT= $MYSQLD_SLAVE_DATADIR/$file
-perl;
-$file= $ENV{'FILE_TO_CORRUPT'};
-open(FILE, ">$file") || die "Unable to open $file.";
-truncate(FILE,0);
-print FILE "failure";
-close ($file);
-EOF
-
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
-SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
---error 2013
-FLUSH LOGS;
-
---let $rpl_server_number= 2
---source include/rpl_reconnect.inc
-
---echo =====Dumping and comparing tables=======;
---source include/start_slave.inc
-
-connection master;
-sync_slave_with_master;
-
-let $diff_tables=master:t1,slave:t1;
-source include/diff_tables.inc;
-
-########################################################################################
-# Case 2: Corrupt a master.info
-########################################################################################
---echo =====Corrupting the master.info=======;
-connection slave;
---source include/stop_slave.inc
-
-connection master;
-FLUSH LOGS;
-
-insert into t1(a) values(7);
-insert into t1(a) values(8);
-insert into t1(a) values(9);
-
-connection slave;
-let MYSQLD_SLAVE_DATADIR=`select @@datadir`;
-
---perl
-use strict;
-use warnings;
-my $src= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.backup";
-my $dst= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.info";
-open(FILE, "<", $src) or die;
-my @content= <FILE>;
-close FILE;
-open(FILE, ">", $dst) or die;
-binmode FILE;
-print FILE @content;
-close FILE;
-EOF
-
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
-SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
---error 2013
-FLUSH LOGS;
-
---let $rpl_server_number= 2
---source include/rpl_reconnect.inc
-
---echo =====Dumping and comparing tables=======;
---source include/start_slave.inc
-
-connection master;
-sync_slave_with_master;
-
-let $diff_tables=master:t1,slave:t1;
-source include/diff_tables.inc;
-
-########################################################################################
-# Clean up
-########################################################################################
---echo =====Clean up=======;
-connection master;
-drop table t1;
-
---remove_file $MYSQLD_SLAVE_DATADIR/master.backup
---source include/rpl_end.inc
-
diff --git a/mysql-test/suite/rpl/include/rpl_temporal_format_default_to_default.inc b/mysql-test/suite/rpl/include/rpl_temporal_format_default_to_default.inc
deleted file mode 100644
index 6728ff55d6f..00000000000
--- a/mysql-test/suite/rpl/include/rpl_temporal_format_default_to_default.inc
+++ /dev/null
@@ -1,82 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption).
-# Please check all dependent tests after modifying it
-#
-
---source include/master-slave.inc
-
-if ($force_master_mysql56_temporal_format)
-{
- connection master;
- eval SET @@global.mysql56_temporal_format=$force_master_mysql56_temporal_format;
-}
-
-if ($force_slave_mysql56_temporal_format)
-{
- connection slave;
- eval SET @@global.mysql56_temporal_format=$force_slave_mysql56_temporal_format;
-}
-
-connection master;
-SELECT @@global.mysql56_temporal_format AS on_master;
-connection slave;
-SELECT @@global.mysql56_temporal_format AS on_slave;
-connection master;
-
-CREATE TABLE t1
-(
- c0 TIME(0),
- c1 TIME(1),
- c2 TIME(2),
- c3 TIME(3),
- c4 TIME(4),
- c5 TIME(5),
- c6 TIME(6)
-);
-CREATE TABLE t2
-(
- c0 TIMESTAMP(0),
- c1 TIMESTAMP(1),
- c2 TIMESTAMP(2),
- c3 TIMESTAMP(3),
- c4 TIMESTAMP(4),
- c5 TIMESTAMP(5),
- c6 TIMESTAMP(6)
-);
-
-CREATE TABLE t3
-(
- c0 DATETIME(0),
- c1 DATETIME(1),
- c2 DATETIME(2),
- c3 DATETIME(3),
- c4 DATETIME(4),
- c5 DATETIME(5),
- c6 DATETIME(6)
-);
-INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
-INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
-INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
-SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
-WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
-sync_slave_with_master;
-
-connection slave;
---query_vertical SELECT * FROM t1;
---query_vertical SELECT * FROM t2;
---query_vertical SELECT * FROM t3;
-SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
-WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
-
-connection master;
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE t3;
-
-connection slave;
-SET @@global.mysql56_temporal_format=DEFAULT;
-connection master;
-SET @@global.mysql56_temporal_format=DEFAULT;
-
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_typeconv.inc b/mysql-test/suite/rpl/include/rpl_typeconv.inc
deleted file mode 100644
index 9e566258882..00000000000
--- a/mysql-test/suite/rpl/include/rpl_typeconv.inc
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# This include file is used by more than one test suite
-# (currently rpl and binlog_encryption suite).
-# Please check all dependent tests after modifying it
-#
-
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
-connection slave;
-set @saved_slave_type_conversions = @@global.slave_type_conversions;
-CREATE TABLE type_conversions (
- TestNo INT AUTO_INCREMENT PRIMARY KEY,
- Source TEXT,
- Target TEXT,
- Flags TEXT,
- On_Master LONGTEXT,
- On_Slave LONGTEXT,
- Expected LONGTEXT,
- Compare INT,
- Error TEXT);
-
-SELECT @@global.slave_type_conversions;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
-SELECT @@global.slave_type_conversions;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
-SELECT @@global.slave_type_conversions;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
-SELECT @@global.slave_type_conversions;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
-SELECT @@global.slave_type_conversions;
---error ER_WRONG_VALUE_FOR_VAR
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY,NONEXISTING_BIT';
-SELECT @@global.slave_type_conversions;
-
-# Checking strict interpretation of type conversions
-connection slave;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
-source suite/rpl/include/type_conversions.test;
-
-# Checking lossy integer type conversions
-connection slave;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
-source suite/rpl/include/type_conversions.test;
-
-# Checking non-lossy integer type conversions
-connection slave;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
-source suite/rpl/include/type_conversions.test;
-
-# Checking all type conversions
-connection slave;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
-source suite/rpl/include/type_conversions.test;
-
-connection slave;
---echo **** Result of conversions ****
-disable_query_log;
-SELECT RPAD(Source, 15, ' ') AS Source_Type,
- RPAD(Target, 15, ' ') AS Target_Type,
- RPAD(Flags, 25, ' ') AS All_Type_Conversion_Flags,
- IF(Compare IS NULL AND Error IS NOT NULL, '<Correct error>',
- IF(Compare, '<Correct value>',
- CONCAT("'", On_Slave, "' != '", Expected, "'")))
- AS Value_On_Slave
- FROM type_conversions;
-enable_query_log;
-DROP TABLE type_conversions;
-
-call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677");
-
-connection master;
-DROP TABLE t1;
-sync_slave_with_master;
-
-set global slave_type_conversions = @saved_slave_type_conversions;
-
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result b/mysql-test/suite/rpl/r/rpl_loaddata_local.result
index f0d24df2cb2..f0d24df2cb2 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_local.result
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_error_stop.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_error_stop.result
new file mode 100644
index 00000000000..48672651c36
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_error_stop.result
@@ -0,0 +1,81 @@
+include/rpl_init.inc [topology=1->2]
+call mtr.add_suppression("Slave: Commit failed due to failure of an earlier commit");
+call mtr.add_suppression("Slave: Duplicate entry '99'");
+connection server_1;
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1,1);
+INSERT INTO t1 VALUES(2,1);
+INSERT INTO t1 VALUES(3,1);
+INSERT INTO t1 VALUES(4,1);
+connection server_2;
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+include/stop_slave.inc
+SET @old_debug_dbug = @@global.debug_dbug;
+SET @@global.debug_dbug = "d,hold_worker2_favor_worker3";
+SET GLOBAL slave_parallel_threads=4;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
+SET GLOBAL slave_parallel_mode='optimistic';
+connection server_1;
+SET @@gtid_seq_no = 2001;
+BEGIN;
+UPDATE t1 SET b = 11 WHERE a = 4;
+UPDATE t1 SET b = 11 WHERE a = 3;
+UPDATE t1 SET a = 99 WHERE a = 1;
+COMMIT;
+UPDATE t1 SET b = 2 WHERE a = 2;
+UPDATE t1 SET b = 3 WHERE a = 3;
+DROP TABLE IF EXISTS phantom_1;
+Warnings:
+Note 1051 Unknown table 'test.phantom_1'
+include/save_master_gtid.inc
+connect slave_local_0, 127.0.0.1, root,, test, $SLAVE_MYPORT,;
+begin;
+UPDATE t1 set b = 11 where a = 4;
+connect slave_local_1, 127.0.0.1, root,, test, $SLAVE_MYPORT,;
+begin;
+INSERT INTO t1 VALUES (99, 11);
+connect slave_local_2, 127.0.0.1, root,, test, $SLAVE_MYPORT,;
+begin;
+UPDATE t1 SET b = 12 WHERE a = 2;
+connect slave_local_3, 127.0.0.1, root,, test, $SLAVE_MYPORT,;
+begin;
+UPDATE t1 SET b = 13 WHERE a = 3;
+connection server_2;
+include/start_slave.inc
+# W4 is waiting to start its DROP
+connection slave_local_3;
+rollback;
+connection slave_local_0;
+rollback;
+SELECT count(*) = 0 as "W3 undid its commit state" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%";
+W3 undid its commit state
+1
+connection slave_local_2;
+rollback;
+connection slave_local_1;
+commit;
+SELECT COUNT(*) = 1 as "W4 remains with the same status" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to start commit%";
+W4 remains with the same status
+1
+# Slave_SQL_Running YES = Yes
+# while W2 is held back ...
+SET DEBUG_SYNC = 'now SIGNAL cont_worker2';
+include/wait_for_slave_sql_error.inc [errno=1062]
+DELETE FROM t1 WHERE a=99;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+connection server_2;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_mode=@old_parallel_mode;
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+SET @@global.debug_dbug = @old_debug_dbug;
+SET debug_sync = RESET;
+include/start_slave.inc
+connection server_1;
+DROP TABLE t1;
+include/save_master_gtid.inc
+connection server_2;
+include/sync_with_master_gtid.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_seq.result b/mysql-test/suite/rpl/r/rpl_parallel_seq.result
new file mode 100644
index 00000000000..ae4041f470d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_parallel_seq.result
@@ -0,0 +1,85 @@
+include/master-slave.inc
+[connection master]
+connection slave;
+include/stop_slave.inc
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+# MDEV-29621 the sequence engine binlog_row_image-full events
+# MDL-deadlock on the parallel slave.
+connection master;
+CREATE SEQUENCE s1;
+SET @@session.binlog_row_image=FULL;
+SET @@session.debug_dbug="+d,binlog_force_commit_id";
+SET @commit_id=7;
+SET @@gtid_seq_no=100;
+SELECT NEXT VALUE FOR s1;
+NEXT VALUE FOR s1
+1
+INSERT INTO s1 VALUES(2, 1, 10, 1, 2, 1, 1, 0);
+SET @@session.debug_dbug="";
+connection slave;
+SET @@global.slave_parallel_threads=2;
+SET @@global.slave_parallel_mode=optimistic;
+SET @@global.debug_dbug="+d,hold_worker_on_schedule";
+include/start_slave.inc
+SET DEBUG_SYNC = 'now SIGNAL continue_worker';
+connection master;
+DROP SEQUENCE s1;
+connection slave;
+include/stop_slave.inc
+# Simulate buggy 10.3.36 master to prove the parallel applier
+# does not deadlock now at replaying the above master load.
+connection master;
+include/rpl_stop_server.inc [server_number=1]
+include/rpl_start_server.inc [server_number=1]
+connection slave;
+RESET MASTER;
+SET @@global.gtid_slave_pos="";
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, master_user='root', master_use_gtid=slave_pos;
+START SLAVE UNTIL MASTER_GTID_POS='0-1-102';
+SET DEBUG_SYNC = 'now SIGNAL continue_worker';
+# Normal stop is expected
+include/wait_for_slave_to_stop.inc
+# MDEV-31077 ALTER SEQUENCE may end up in optimistic parallel slave binlog out-of-order
+# The test proves ALTER-SEQUENCE binlogs first before the following transaction does so.
+connection slave;
+include/stop_slave.inc
+Warnings:
+Note 1255 Slave already has been stopped
+RESET MASTER;
+SET @@global.gtid_slave_pos="";
+SET @@global.gtid_strict_mode=1;
+connection master;
+RESET MASTER;
+CREATE TABLE ti (a INT) ENGINE=innodb;
+CREATE SEQUENCE s2 ENGINE=innodb;
+SET @@gtid_seq_no=100;
+ALTER SEQUENCE s2 restart with 1;
+INSERT INTO ti SET a=1;
+include/save_master_gtid.inc
+SELECT @@global.gtid_binlog_state "Master gtid state";
+Master gtid state
+0-1-101
+connection slave;
+include/start_slave.inc
+SELECT @@global.gtid_binlog_state, @@global.gtid_slave_pos as "no 100,101 yet in both";
+@@global.gtid_binlog_state no 100,101 yet in both
+0-1-2 0-1-2
+SET DEBUG_SYNC = 'now SIGNAL continue_worker';
+# Normal sync with master proves the fixes correct
+include/sync_with_master_gtid.inc
+SELECT @@global.gtid_binlog_state, @@global.gtid_slave_pos as "all through 101 have been committed";
+@@global.gtid_binlog_state all through 101 have been committed
+0-1-101 0-1-101
+connection slave;
+include/stop_slave.inc
+SET debug_sync = RESET;
+SET @@global.slave_parallel_threads= 0;
+SET @@global.slave_parallel_mode= optimistic;
+SET @@global.debug_dbug = "";
+SET @@global.gtid_strict_mode=0;
+include/start_slave.inc
+connection master;
+DROP SEQUENCE s2;
+DROP TABLE ti;
+connection slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result b/mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result
index a0ea06afa89..c303abc672c 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result
@@ -7,8 +7,6 @@ SET @@global.rpl_semi_sync_master_timeout = 60000;
SET @@global.rpl_semi_sync_master_wait_no_slave = 1;
# It's okay to see "Killed" but we should not see "Timeout" in the log.
call mtr.add_suppression("Killed waiting for reply of binlog");
-call mtr.add_suppression("Run function 'after_commit' in plugin 'rpl_semi_sync_master' failed");
-call mtr.add_suppression("Run function 'after_sync' in plugin 'rpl_semi_sync_master' failed");
#
# Test wait point = AFTER_COMMIT
#
diff --git a/mysql-test/suite/rpl/r/rpl_xa_prepare_gtid_fail.result b/mysql-test/suite/rpl/r/rpl_xa_prepare_gtid_fail.result
new file mode 100644
index 00000000000..f3fecbda349
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_xa_prepare_gtid_fail.result
@@ -0,0 +1,51 @@
+include/master-slave.inc
+[connection master]
+connection slave;
+include/stop_slave.inc
+change master to master_use_gtid=slave_pos;
+set @@global.slave_parallel_threads= 4;
+set @@global.slave_parallel_mode= optimistic;
+set @@global.gtid_strict_mode=ON;
+set sql_log_bin= 0;
+alter table mysql.gtid_slave_pos engine=innodb;
+call mtr.add_suppression("Deadlock found.*");
+set sql_log_bin= 1;
+include/start_slave.inc
+connection master;
+create table t1 (a int primary key, b int) engine=innodb;
+insert t1 values (1,1);
+include/save_master_gtid.inc
+connection slave;
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+set @@global.innodb_lock_wait_timeout= 1;
+connection master;
+set @@session.gtid_seq_no=100;
+xa start '1';
+update t1 set b=b+10 where a=1;
+xa end '1';
+xa prepare '1';
+xa commit '1';
+include/save_master_gtid.inc
+connection slave;
+connection slave1;
+BEGIN;
+SELECT * FROM mysql.gtid_slave_pos WHERE seq_no=100 FOR UPDATE;
+domain_id sub_id server_id seq_no
+connection slave;
+include/start_slave.inc
+include/wait_for_slave_sql_error.inc [errno=1942,1213]
+connection slave1;
+ROLLBACK;
+# Cleanup
+connection master;
+drop table t1;
+connection slave;
+include/stop_slave.inc
+set @@global.gtid_slave_pos= "0-1-100";
+set @@global.slave_parallel_threads= 0;
+set @@global.gtid_strict_mode= 0;
+set @@global.innodb_lock_wait_timeout= 50;
+include/start_slave.inc
+include/rpl_end.inc
+# End of rpl_xa_prepare_gtid_fail.test
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_errors.test b/mysql-test/suite/rpl/t/rpl_binlog_errors.test
index 30faaf79613..ab95c9b4ee3 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_errors.test
@@ -1 +1,443 @@
---source include/rpl_binlog_errors.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+# Usage:
+# --let $binlog_limit= X[,Y] # optional
+#
+# Semantics of the value is the same as in include/show_binlog_events.inc
+# which the script calls as a part of the test flow.
+# The goal is to print the event demonstrating the triggered error,
+# so normally Y should be 1 (print the exact event only);
+# however, depending on test-specific server options, the offset X
+# can be different.
+#
+
+# BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error
+# when generating new name.
+#
+# WHY
+# ===
+#
+# We want to check whether error is reported or not when
+# new_file_impl fails (this may happen when rotation is not
+# possible because there is some problem finding an
+# unique filename).
+#
+# HOW
+# ===
+#
+# Test cases are documented inline.
+
+-- source include/have_innodb.inc
+-- source include/have_debug.inc
+-- source include/master-slave.inc
+
+-- echo #######################################################################
+-- echo ####################### PART 1: MASTER TESTS ##########################
+-- echo #######################################################################
+
+
+### ACTION: stopping slave as it is not needed for the first part of
+### the test
+
+-- connection slave
+-- source include/stop_slave.inc
+-- connection master
+
+call mtr.add_suppression("Can't generate a unique log-filename");
+call mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+call mtr.add_suppression("Error writing file .*");
+call mtr.add_suppression("Could not use master-bin for logging");
+
+SET @old_debug= @@global.debug_dbug;
+
+### ACTION: create a large file (> 4096 bytes) that will be later used
+### in LOAD DATA INFILE to check binlog errors in its vacinity
+-- let $load_file= $MYSQLTEST_VARDIR/tmp/bug_46166.data
+-- let $MYSQLD_DATADIR= `select @@datadir`
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SELECT repeat('x',8192) INTO OUTFILE '$load_file'
+
+### ACTION: create a small file (< 4096 bytes) that will be later used
+### in LOAD DATA INFILE to check for absence of binlog errors
+### when file loading this file does not force flushing and
+### rotating the binary log
+-- let $load_file2= $MYSQLTEST_VARDIR/tmp/bug_46166-2.data
+-- let $MYSQLD_DATADIR= `select @@datadir`
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SELECT repeat('x',10) INTO OUTFILE '$load_file2'
+
+RESET MASTER;
+
+-- echo ###################### TEST #1
+
+### ASSERTION: no problem flushing logs (should show two binlogs)
+FLUSH LOGS;
+-- echo # assert: must show two binlogs
+-- source include/show_binary_logs.inc
+
+-- echo ###################### TEST #2
+
+### ASSERTION: check that FLUSH LOGS actually fails and reports
+### failure back to the user if find_uniq_filename fails
+### (should show just one binlog)
+
+RESET MASTER;
+SET @@global.debug_dbug="d,error_unique_log_filename";
+-- error ER_NO_UNIQUE_LOGFILE
+FLUSH LOGS;
+-- echo # assert: must show one binlog
+-- source include/show_binary_logs.inc
+
+### ACTION: clean up and move to next test
+SET @@global.debug_dbug=@old_debug;
+RESET MASTER;
+
+-- echo ###################### TEST #3
+
+### ACTION: create some tables (t1, t2, t4) and insert some values in
+### table t1
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB;
+CREATE TABLE t4 (a VARCHAR(16384));
+INSERT INTO t1 VALUES (1);
+RESET MASTER;
+
+### ASSERTION: we force rotation of the binary log because it exceeds
+### the max_binlog_size option (should show two binary
+### logs)
+
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+
+# shows two binary logs
+-- echo # assert: must show two binlog
+-- source include/show_binary_logs.inc
+
+# clean up the table and the binlog to be used in next part of test
+SET @@global.debug_dbug=@old_debug;
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #4
+
+### ASSERTION: load the big file into a transactional table and check
+### that it reports error. The table will contain the
+### changes performed despite the fact that it reported an
+### error.
+
+SET @@global.debug_dbug="d,error_unique_log_filename";
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+
+# show table
+-- echo # assert: must show one entry
+SELECT count(*) FROM t2;
+
+# clean up the table and the binlog to be used in next part of test
+SET @@global.debug_dbug=@old_debug;
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #5
+
+### ASSERTION: load the small file into a transactional table and
+### check that it succeeds
+
+SET @@global.debug_dbug="d,error_unique_log_filename";
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA INFILE '$load_file2' INTO TABLE t2
+
+# show table
+-- echo # assert: must show one entry
+SELECT count(*) FROM t2;
+
+# clean up the table and the binlog to be used in next part of test
+SET @@global.debug_dbug=@old_debug;
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #6
+
+### ASSERTION: check that even if one is using a transactional table
+### and explicit transactions (no autocommit) if rotation
+### fails we get the error. Transaction is not rolledback
+### because rotation happens after the commit.
+
+SET @@global.debug_dbug="d,error_unique_log_filename";
+SET AUTOCOMMIT=0;
+INSERT INTO t2 VALUES ('muse');
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+INSERT INTO t2 VALUES ('muse');
+-- error ER_NO_UNIQUE_LOGFILE
+COMMIT;
+
+### ACTION: Show the contents of the table after the test
+-- echo # assert: must show three entries
+SELECT count(*) FROM t2;
+
+### ACTION: clean up and move to the next test
+SET AUTOCOMMIT= 1;
+SET @@global.debug_dbug=@old_debug;
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #7
+
+### ASSERTION: check that on a non-transactional table, if rotation
+### fails then an error is reported and an incident event
+### is written to the current binary log.
+
+SET @@global.debug_dbug="d,error_unique_log_filename";
+
+# Disable logging Annotate_rows events to preserve events count.
+let $binlog_annotate_row_events_saved= `SELECT @@binlog_annotate_row_events`;
+SET @@binlog_annotate_row_events= 0;
+
+SELECT count(*) FROM t4;
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4
+
+-- echo # assert: must show 1 entry
+SELECT count(*) FROM t4;
+
+-- echo ### check that the incident event is written to the current log
+SET @@global.debug_dbug=@old_debug;
+if (!$binlog_limit)
+{
+ -- let $binlog_limit= 4,1
+}
+-- source include/show_binlog_events.inc
+
+# clean up and move to next test
+DELETE FROM t4;
+
+--disable_query_log
+eval SET @@binlog_annotate_row_events= $binlog_annotate_row_events_saved;
+--enable_query_log
+
+RESET MASTER;
+
+-- echo ###################### TEST #8
+
+### ASSERTION: check that statements end up in error but they succeed
+### on changing the data.
+
+SET @@global.debug_dbug="d,error_unique_log_filename";
+-- echo # must show 0 entries
+SELECT count(*) FROM t4;
+SELECT count(*) FROM t2;
+
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+-- error ER_NO_UNIQUE_LOGFILE
+INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc');
+
+-- echo # INFO: Count(*) Before Offending DELETEs
+-- echo # assert: must show 1 entry
+SELECT count(*) FROM t4;
+-- echo # assert: must show 4 entries
+SELECT count(*) FROM t2;
+
+-- error ER_NO_UNIQUE_LOGFILE
+DELETE FROM t4;
+-- error ER_NO_UNIQUE_LOGFILE
+DELETE FROM t2;
+
+-- echo # INFO: Count(*) After Offending DELETEs
+-- echo # assert: must show zero entries
+SELECT count(*) FROM t4;
+SELECT count(*) FROM t2;
+
+# remove fault injection
+SET @@global.debug_dbug=@old_debug;
+
+-- echo ###################### TEST #9
+
+### ASSERTION: check that if we disable binlogging, then statements
+### succeed.
+SET @@global.debug_dbug="d,error_unique_log_filename";
+SET SQL_LOG_BIN=0;
+INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd');
+INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh');
+-- echo # assert: must show four entries
+SELECT count(*) FROM t2;
+SELECT count(*) FROM t4;
+DELETE FROM t2;
+DELETE FROM t4;
+-- echo # assert: must show zero entries
+SELECT count(*) FROM t2;
+SELECT count(*) FROM t4;
+SET SQL_LOG_BIN=1;
+SET @@global.debug_dbug=@old_debug;
+
+-- echo ###################### TEST #10
+
+### ASSERTION: check that error is reported if there is a failure
+### while registering the index file and the binary log
+### file or failure to write the rotate event.
+
+call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("Could not use .*");
+
+RESET MASTER;
+SHOW WARNINGS;
+
+# +d,fault_injection_registering_index => injects fault on MYSQL_BIN_LOG::open
+SET @@global.debug_dbug="d,fault_injection_registering_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
+FLUSH LOGS;
+SET @@global.debug_dbug=@old_debug;
+
+-- error ER_NO_BINARY_LOGGING
+SHOW BINARY LOGS;
+
+# issue some statements and check that they don't fail
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+flush tables;
+
+-- echo ###################### TEST #11
+
+### ASSERTION: check that error is reported if there is a failure
+### while opening the index file and the binary log file or
+### failure to write the rotate event.
+
+# restart the server so that we have binlog again
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
+
+# +d,fault_injection_openning_index => injects fault on MYSQL_BIN_LOG::open_index_file
+SET @@global.debug_dbug="d,fault_injection_openning_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
+FLUSH LOGS;
+SET @@global.debug_dbug=@old_debug;
+
+-- error ER_FLUSH_MASTER_BINLOG_CLOSED
+RESET MASTER;
+
+# issue some statements and check that they don't fail
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+flush tables;
+
+# restart the server so that we have binlog again
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
+
+-- echo ###################### TEST #12
+
+### ASSERTION: check that error is reported if there is a failure
+### while writing the rotate event when creating a new log
+### file.
+
+# +d,fault_injection_new_file_rotate_event => injects fault on MYSQL_BIN_LOG::MYSQL_BIN_LOG::new_file_impl
+SET @@global.debug_dbug="d,fault_injection_new_file_rotate_event";
+-- error ER_ERROR_ON_WRITE
+FLUSH LOGS;
+SET @@global.debug_dbug=@old_debug;
+
+-- error ER_FLUSH_MASTER_BINLOG_CLOSED
+RESET MASTER;
+
+# issue some statements and check that they don't fail
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+flush tables;
+
+# restart the server so that we have binlog again
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
+
+## clean up
+DROP TABLE t1, t2, t4;
+RESET MASTER;
+
+# restart slave again
+-- connection slave
+-- source include/start_slave.inc
+-- connection master
+
+-- echo #######################################################################
+-- echo ####################### PART 2: SLAVE TESTS ###########################
+-- echo #######################################################################
+
+### setup
+--source include/rpl_reset.inc
+-- connection slave
+
+# Slave tests rely on logic of non-gtid mode
+--source include/stop_slave.inc
+CHANGE MASTER TO MASTER_USE_GTID=NO;
+--source include/start_slave.inc
+
+# slave suppressions
+
+call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
+call mtr.add_suppression("Error writing file .*");
+call mtr.add_suppression("Could not use .*");
+call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("Can't generate a unique log-filename .*");
+-- echo ###################### TEST #13
+
+#### ASSERTION: check against unique log filename error
+-- let $io_thd_injection_fault_flag= error_unique_log_filename
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+-- echo ###################### TEST #14
+
+#### ASSERTION: check against rotate failing
+-- let $io_thd_injection_fault_flag= fault_injection_new_file_rotate_event
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+-- echo ###################### TEST #15
+
+#### ASSERTION: check against relay log open failure
+-- let $io_thd_injection_fault_flag= fault_injection_registering_index
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+-- echo ###################### TEST #16
+
+#### ASSERTION: check against relay log index open failure
+-- let $io_thd_injection_fault_flag= fault_injection_openning_index
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+### clean up
+-- source include/stop_slave_sql.inc
+RESET SLAVE;
+RESET MASTER;
+--remove_file $load_file
+--remove_file $load_file2
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_index.test b/mysql-test/suite/rpl/t/rpl_binlog_index.test
index 95c49c3d574..6112affb3c4 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_index.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_index.test
@@ -17,10 +17,6 @@
# BUG#12133 master.index file keeps mysqld from starting if bin log has been moved
# BUG#42576 Relay logs in relay-log.info&localhost-relay-bin.index not processed after move
-source include/master-slave.inc;
-# There is no need to run this test case on all binlog format
-source include/have_binlog_format_row.inc;
-
# Since this test relies heavily on filesystem operations (like
# moving files around, backslashes and so forth) we avoid messing
# around with windows access violations for not cluttering the
@@ -28,6 +24,10 @@ source include/have_binlog_format_row.inc;
# it is not 100% compliant.
--source include/not_windows.inc
+source include/master-slave.inc;
+# There is no need to run this test case on all binlog format
+source include/have_binlog_format_row.inc;
+
connection master;
--let $master_datadir= `select @@datadir`
connection slave;
diff --git a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test
index 573c1d111fc..7c1d0ea25e2 100644
--- a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test
+++ b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test
@@ -1 +1,88 @@
---source include/rpl_cant_read_event_incident.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#
+# Bug#11747416 : 32228 A disk full makes binary log corrupt.
+#
+#
+# The test demonstrates reading from binlog error propagation to slave
+# and reporting there.
+# Conditions for the bug include a crash at time of the last event to
+# the binlog was written partly. With the fixes the event is not sent out
+# any longer, but rather the dump thread sends out a sound error message.
+#
+# Crash is not simulated. A binlog with partly written event in its end is installed
+# and replication is started from it.
+#
+
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+
+--connection slave
+--source include/stop_slave.inc
+CHANGE MASTER TO MASTER_USE_GTID=NO;
+--source include/start_slave.inc
+
+# Make sure the slave is stopped while we are messing with master.
+# Otherwise we get occasional failures as the slave manages to re-connect
+# to the newly started master and we get extra events applied, causing
+# conflicts.
+--source include/stop_slave.inc
+
+--connection master
+call mtr.add_suppression("Error in Log_event::read_log_event()");
+--let $datadir= `SELECT @@datadir`
+
+--let $rpl_server_number= 1
+--source include/rpl_stop_server.inc
+
+--remove_file $datadir/master-bin.000001
+--copy_file $MYSQL_TEST_DIR/std_data/bug11747416_32228_binlog.000001 $datadir/master-bin.000001
+
+--let $rpl_server_number= 1
+--source include/rpl_start_server.inc
+
+--source include/wait_until_connected_again.inc
+
+# evidence of the partial binlog
+--error ER_ERROR_WHEN_EXECUTING_COMMAND
+show binlog events;
+
+--connection slave
+call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
+--let $master_use_gtid_option= No
+--source include/reset_slave.inc
+start slave;
+
+# ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
+--let $slave_param=Last_IO_Errno
+--let $slave_param_value=1236
+--source include/wait_for_slave_param.inc
+
+--let $slave_field_result_replace= / at [0-9]*/ at XXX/
+--let $status_items= Last_IO_Errno, Last_IO_Error
+--source include/show_slave_status.inc
+
+#
+# Cleanup
+#
+
+--connection master
+reset master;
+
+--connection slave
+stop slave;
+reset slave;
+# Table was created from binlog, it may not be created if SQL thread is running
+# slowly and IO thread reaches incident before SQL thread applies it.
+--disable_warnings
+drop table if exists t;
+--enable_warnings
+reset master;
+
+--echo End of the tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_checksum.test b/mysql-test/suite/rpl/t/rpl_checksum.test
index 0edf8fda7f3..fc765744b3f 100644
--- a/mysql-test/suite/rpl/t/rpl_checksum.test
+++ b/mysql-test/suite/rpl/t/rpl_checksum.test
@@ -1 +1,342 @@
---source include/rpl_checksum.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+# WL2540 replication events checksum
+# Testing configuration parameters
+
+--source include/have_debug.inc
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+
+--connection slave
+--source include/stop_slave.inc
+CHANGE MASTER TO MASTER_USE_GTID=NO;
+--source include/start_slave.inc
+
+--connection master
+call mtr.add_suppression('Slave can not handle replication events with the checksum that master is configured to log');
+call mtr.add_suppression('Replication event checksum verification failed');
+# due to C failure simulation
+call mtr.add_suppression('Relay log write failure: could not queue event from master');
+call mtr.add_suppression('Master is configured to log replication events with checksum, but will not send such events to slaves that cannot process them');
+
+# A. read/write access to the global vars:
+# binlog_checksum master_verify_checksum slave_sql_verify_checksum
+
+connection master;
+
+set @master_save_binlog_checksum= @@global.binlog_checksum;
+set @save_master_verify_checksum = @@global.master_verify_checksum;
+
+select @@global.binlog_checksum as 'must be CRC32 because of the command line option';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.binlog_checksum as 'no session var';
+
+select @@global.master_verify_checksum as 'must be zero because of default';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.master_verify_checksum as 'no session var';
+
+connection slave;
+
+set @slave_save_binlog_checksum= @@global.binlog_checksum;
+set @save_slave_sql_verify_checksum = @@global.slave_sql_verify_checksum;
+
+select @@global.slave_sql_verify_checksum as 'must be one because of default';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.slave_sql_verify_checksum as 'no session var';
+
+connection master;
+
+source include/show_binary_logs.inc;
+set @@global.binlog_checksum = NONE;
+select @@global.binlog_checksum;
+--echo *** must be rotations seen ***
+source include/show_binary_logs.inc;
+
+set @@global.binlog_checksum = default;
+select @@global.binlog_checksum;
+
+# testing lack of side-effects in non-effective update of binlog_checksum:
+set @@global.binlog_checksum = CRC32;
+select @@global.binlog_checksum;
+set @@global.binlog_checksum = CRC32;
+
+set @@global.master_verify_checksum = 0;
+set @@global.master_verify_checksum = default;
+
+--error ER_WRONG_VALUE_FOR_VAR
+set @@global.binlog_checksum = ADLER32;
+--error ER_WRONG_VALUE_FOR_VAR
+set @@global.master_verify_checksum = 2; # the var is of bool type
+
+connection slave;
+
+set @@global.slave_sql_verify_checksum = 0;
+set @@global.slave_sql_verify_checksum = default;
+--error ER_WRONG_VALUE_FOR_VAR
+set @@global.slave_sql_verify_checksum = 2; # the var is of bool type
+
+#
+# B. Old Slave to New master conditions
+#
+# while master does not send a checksum-ed binlog the Old Slave can
+# work with the New Master
+
+connection master;
+
+set @@global.binlog_checksum = NONE;
+create table t1 (a int);
+
+# testing that binlog rotation preserves opt_binlog_checksum value
+flush logs;
+flush logs;
+-- source include/wait_for_binlog_checkpoint.inc
+flush logs;
+
+sync_slave_with_master;
+#connection slave;
+# checking that rotation on the slave side leaves slave stable
+flush logs;
+flush logs;
+flush logs;
+select count(*) as zero from t1;
+
+source include/stop_slave.inc;
+
+connection master;
+set @@global.binlog_checksum = CRC32;
+-- source include/wait_for_binlog_checkpoint.inc
+insert into t1 values (1) /* will not be applied on slave due to simulation */;
+
+# instruction to the dump thread
+
+connection slave;
+set @saved_dbug = @@global.debug_dbug;
+set @@global.debug_dbug='d,simulate_slave_unaware_checksum';
+start slave;
+--let $slave_io_errno= 1236
+--let $show_slave_io_error= 1
+source include/wait_for_slave_io_error.inc;
+
+select count(*) as zero from t1;
+
+set @@global.debug_dbug = @saved_dbug;
+
+connection slave;
+source include/start_slave.inc;
+
+#
+# C. checksum failure simulations
+#
+
+# C1. Failure by a client thread
+connection master;
+set @@global.master_verify_checksum = 1;
+set @save_dbug = @@session.debug_dbug;
+set @@session.debug_dbug='d,simulate_checksum_test_failure';
+--error ER_ERROR_WHEN_EXECUTING_COMMAND
+show binlog events;
+SET debug_dbug= @save_dbug;
+set @@global.master_verify_checksum = default;
+
+#connection master;
+sync_slave_with_master;
+
+connection slave;
+source include/stop_slave.inc;
+
+connection master;
+create table t2 (a int);
+let $pos_master= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+connection slave;
+
+# C2. Failure by IO thread
+# instruction to io thread
+set @saved_dbug = @@global.debug_dbug;
+set @@global.debug_dbug='d,simulate_checksum_test_failure';
+start slave io_thread;
+# When the checksum error is detected, the slave sets error code 1913
+# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately
+# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io().
+# So we usually get 1595, but it is occasionally possible to get 1913.
+--let $slave_io_errno= 1595,1913
+--let $show_slave_io_error= 0
+source include/wait_for_slave_io_error.inc;
+set @@global.debug_dbug = @saved_dbug;
+
+# to make IO thread re-read it again w/o the failure
+start slave io_thread;
+let $slave_param= Read_Master_Log_Pos;
+let $slave_param_value= $pos_master;
+source include/wait_for_slave_param.inc;
+
+# C3. Failure by SQL thread
+# instruction to sql thread;
+set @@global.slave_sql_verify_checksum = 1;
+
+set @@global.debug_dbug='d,simulate_checksum_test_failure';
+
+start slave sql_thread;
+--let $slave_sql_errno= 1593
+--let $show_slave_sql_error= 1
+source include/wait_for_slave_sql_error.inc;
+
+# resuming SQL thread to parse out the event w/o the failure
+
+set @@global.debug_dbug = @saved_dbug;
+source include/start_slave.inc;
+
+connection master;
+sync_slave_with_master;
+
+#connection slave;
+select count(*) as 'must be zero' from t2;
+
+#
+# D. Reset slave, Change-Master, Binlog & Relay-log rotations with
+# random value on binlog_checksum on both master and slave
+#
+connection slave;
+stop slave;
+--let $master_use_gtid_option= No
+--source include/reset_slave.inc
+
+# randomize slave server's own checksum policy
+set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
+flush logs;
+
+connection master;
+set @@global.binlog_checksum= CRC32;
+reset master;
+flush logs;
+create table t3 (a int, b char(5));
+
+connection slave;
+source include/start_slave.inc;
+
+connection master;
+sync_slave_with_master;
+
+#connection slave;
+select count(*) as 'must be zero' from t3;
+source include/stop_slave.inc;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
+
+connection master;
+flush logs;
+reset master;
+insert into t3 value (1, @@global.binlog_checksum);
+
+connection slave;
+source include/start_slave.inc;
+flush logs;
+
+connection master;
+sync_slave_with_master;
+
+#connection slave;
+select count(*) as 'must be one' from t3;
+
+connection master;
+set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
+insert into t3 value (1, @@global.binlog_checksum);
+sync_slave_with_master;
+
+#connection slave;
+
+#clean-up
+
+connection master;
+drop table t1, t2, t3;
+set @@global.binlog_checksum = @master_save_binlog_checksum;
+set @@global.master_verify_checksum = @save_master_verify_checksum;
+
+#
+# BUG#58564: flush_read_lock fails in mysql-trunk-bugfixing after merging with WL#2540
+#
+# Sanity check that verifies that no assertions are triggered because
+# of old FD events (generated by versions prior to server released with
+# checksums feature)
+#
+# There is no need for query log, if something wrong this should trigger
+# an assertion
+
+--disable_query_log
+
+BINLOG '
+MfmqTA8BAAAAZwAAAGsAAAABAAQANS41LjctbTMtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAx+apMEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
+';
+
+--enable_query_log
+
+#connection slave;
+sync_slave_with_master;
+
+
+--echo *** Bug#59123 / MDEV-5799: INCIDENT_EVENT checksum written to error log as garbage characters ***
+
+--connection master
+
+--source include/wait_for_binlog_checkpoint.inc
+CREATE TABLE t4 (a INT PRIMARY KEY);
+INSERT INTO t4 VALUES (1);
+
+SET sql_log_bin=0;
+CALL mtr.add_suppression("\\[ERROR\\] Can't generate a unique log-filename");
+SET sql_log_bin=1;
+SET @old_dbug= @@GLOBAL.debug_dbug;
+SET debug_dbug= '+d,binlog_inject_new_name_error';
+--error ER_NO_UNIQUE_LOGFILE
+FLUSH LOGS;
+SET debug_dbug= @old_dbug;
+
+INSERT INTO t4 VALUES (2);
+
+--connection slave
+--let $slave_sql_errno= 1590
+--source include/wait_for_slave_sql_error.inc
+
+# Search the error log for the error message.
+# The bug was that 4 garbage bytes were output in the middle of the error
+# message; by searching for a pattern that spans that location, we can
+# catch the error.
+let $log_error_= `SELECT @@GLOBAL.log_error`;
+if(!$log_error_)
+{
+ # MySQL Server on windows is started with --console and thus
+ # does not know the location of its .err log, use default location
+ let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
+}
+--let SEARCH_FILE= $log_error_
+--let SEARCH_PATTERN= Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590
+--source include/search_pattern_in_file.inc
+
+SELECT * FROM t4 ORDER BY a;
+STOP SLAVE IO_THREAD;
+SET sql_slave_skip_counter= 1;
+--source include/start_slave.inc
+
+--connection master
+--save_master_pos
+
+--connection slave
+--sync_with_master
+SELECT * FROM t4 ORDER BY a;
+
+
+--connection slave
+set @@global.binlog_checksum = @slave_save_binlog_checksum;
+set @@global.slave_sql_verify_checksum = @save_slave_sql_verify_checksum;
+
+--echo End of tests
+
+--connection master
+DROP TABLE t4;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_checksum_cache.test b/mysql-test/suite/rpl/t/rpl_checksum_cache.test
index 59b338d2556..e04f618b81e 100644
--- a/mysql-test/suite/rpl/t/rpl_checksum_cache.test
+++ b/mysql-test/suite/rpl/t/rpl_checksum_cache.test
@@ -1 +1,261 @@
---source include/rpl_checksum_cache.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+-- source include/have_innodb.inc
+-- source include/master-slave.inc
+
+--disable_warnings
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. .*Statement: insert into t2 set data=repeat.*'a', @act_size.*");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. .*Statement: insert into t1 values.* NAME_CONST.*'n',.*, @data .*");
+--enable_warnings
+
+connection master;
+set @save_binlog_cache_size = @@global.binlog_cache_size;
+set @save_binlog_checksum = @@global.binlog_checksum;
+set @save_master_verify_checksum = @@global.master_verify_checksum;
+set @@global.binlog_cache_size = 4096;
+set @@global.binlog_checksum = CRC32;
+set @@global.master_verify_checksum = 1;
+
+# restart slave to force the dump thread to verify events (on master side)
+connection slave;
+source include/stop_slave.inc;
+source include/start_slave.inc;
+
+connection master;
+
+#
+# Testing a critical part of checksum handling dealing with transaction cache.
+# The cache's buffer size is set to be less than the transaction's footprint
+# in binlog.
+#
+# To verify combined buffer-by-buffer read out of the file and fixing crc per event
+# there are the following parts:
+#
+# 1. the event size is much less than the cache's buffer
+# 2. the event size is bigger than the cache's buffer
+# 3. the event size if approximately the same as the cache's buffer
+# 4. all in above
+
+#
+# 1. the event size is much less than the cache's buffer
+#
+
+flush status;
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+#
+# parameter to ensure the test slightly varies binlog content
+# between different invocations
+#
+let $deviation_size=32;
+eval create table t1 (a int PRIMARY KEY, b CHAR($deviation_size)) engine=innodb;
+
+# Now we are going to create transaction which is long enough so its
+# transaction binlog will be flushed to disk...
+
+delimiter |;
+create procedure test.p_init (n int, size int)
+begin
+ while n > 0 do
+ select round(RAND() * size) into @act_size;
+ set @data = repeat('a', @act_size);
+ insert into t1 values(n, @data );
+ set n= n-1;
+ end while;
+end|
+
+delimiter ;|
+
+let $1 = 4000; # PB2 can run it slow to time out on following sync_slave_with_master:s
+
+begin;
+--disable_warnings
+# todo: check if it is really so.
+#+Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave.
+eval call test.p_init($1, $deviation_size);
+--enable_warnings
+commit;
+
+show status like "binlog_cache_use";
+--echo *** binlog_cache_disk_use must be non-zero ***
+show status like "binlog_cache_disk_use";
+
+sync_slave_with_master;
+
+let $diff_tables=master:test.t1, slave:test.t1;
+source include/diff_tables.inc;
+
+# undoing changes with verifying the above once again
+connection master;
+
+begin;
+delete from t1;
+commit;
+
+sync_slave_with_master;
+
+
+#
+# 2. the event size is bigger than the cache's buffer
+#
+connection master;
+
+flush status;
+let $t2_data_size= `select 3 * @@global.binlog_cache_size`;
+let $t2_aver_size= `select 2 * @@global.binlog_cache_size`;
+let $t2_max_rand= `select 1 * @@global.binlog_cache_size`;
+
+eval create table t2(a int auto_increment primary key, data VARCHAR($t2_data_size)) ENGINE=Innodb;
+let $1=100;
+--disable_query_log
+begin;
+while ($1)
+{
+ eval select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size;
+ set @data = repeat('a', @act_size);
+ insert into t2 set data = @data;
+ dec $1;
+}
+commit;
+--enable_query_log
+show status like "binlog_cache_use";
+--echo *** binlog_cache_disk_use must be non-zero ***
+show status like "binlog_cache_disk_use";
+
+sync_slave_with_master;
+
+let $diff_tables=master:test.t2, slave:test.t2;
+source include/diff_tables.inc;
+
+# undoing changes with verifying the above once again
+connection master;
+
+begin;
+delete from t2;
+commit;
+
+sync_slave_with_master;
+
+#
+# 3. the event size if approximately the same as the cache's buffer
+#
+
+connection master;
+
+flush status;
+let $t3_data_size= `select 2 * @@global.binlog_cache_size`;
+let $t3_aver_size= `select (9 * @@global.binlog_cache_size) / 10`;
+let $t3_max_rand= `select (2 * @@global.binlog_cache_size) / 10`;
+
+eval create table t3(a int auto_increment primary key, data VARCHAR($t3_data_size)) engine=innodb;
+
+let $1= 300;
+--disable_query_log
+begin;
+while ($1)
+{
+ eval select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size;
+ insert into t3 set data= repeat('a', @act_size);
+ dec $1;
+}
+commit;
+--enable_query_log
+show status like "binlog_cache_use";
+--echo *** binlog_cache_disk_use must be non-zero ***
+show status like "binlog_cache_disk_use";
+
+sync_slave_with_master;
+
+let $diff_tables=master:test.t3, slave:test.t3;
+source include/diff_tables.inc;
+
+# undoing changes with verifying the above once again
+connection master;
+
+begin;
+delete from t3;
+commit;
+
+sync_slave_with_master;
+
+
+#
+# 4. all in above
+#
+
+connection master;
+flush status;
+
+delimiter |;
+eval create procedure test.p1 (n int)
+begin
+ while n > 0 do
+ case (select (round(rand()*100) % 3) + 1)
+ when 1 then
+ select round(RAND() * $deviation_size) into @act_size;
+ set @data = repeat('a', @act_size);
+ insert into t1 values(n, @data);
+ when 2 then
+ begin
+ select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size;
+ insert into t2 set data=repeat('a', @act_size);
+ end;
+ when 3 then
+ begin
+ select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size;
+ insert into t3 set data= repeat('a', @act_size);
+ end;
+ end case;
+ set n= n-1;
+ end while;
+end|
+delimiter ;|
+
+let $1= 1000;
+set autocommit= 0;
+begin;
+--disable_warnings
+eval call test.p1($1);
+--enable_warnings
+commit;
+
+show status like "binlog_cache_use";
+--echo *** binlog_cache_disk_use must be non-zero ***
+show status like "binlog_cache_disk_use";
+
+sync_slave_with_master;
+
+let $diff_tables=master:test.t1, slave:test.t1;
+source include/diff_tables.inc;
+
+let $diff_tables=master:test.t2, slave:test.t2;
+source include/diff_tables.inc;
+
+let $diff_tables=master:test.t3, slave:test.t3;
+source include/diff_tables.inc;
+
+
+connection master;
+
+begin;
+delete from t1;
+delete from t2;
+delete from t3;
+commit;
+
+drop table t1, t2, t3;
+set @@global.binlog_cache_size = @save_binlog_cache_size;
+set @@global.binlog_checksum = @save_binlog_checksum;
+set @@global.master_verify_checksum = @save_master_verify_checksum;
+drop procedure test.p_init;
+drop procedure test.p1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_corruption.test b/mysql-test/suite/rpl/t/rpl_corruption.test
index e51d1c65e95..cd2a1cc7ef2 100644
--- a/mysql-test/suite/rpl/t/rpl_corruption.test
+++ b/mysql-test/suite/rpl/t/rpl_corruption.test
@@ -1 +1,181 @@
---source include/rpl_corruption.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+############################################################
+# Purpose: WL#5064 Testing with corrupted events.
+# The test emulates the corruption at the vary stages
+# of replication:
+# - in binlog file
+# - in network
+# - in relay log
+############################################################
+
+#
+# The tests intensively utilize @@global.debug. Note,
+# Bug#11765758 - 58754,
+# @@global.debug is read by the slave threads through dbug-interface.
+# Hence, before a client thread set @@global.debug we have to ensure that:
+# (a) the slave threads are stopped, or (b) the slave threads are in
+# sync and waiting.
+
+--source include/have_debug.inc
+--source include/master-slave.inc
+
+--connection slave
+--source include/stop_slave.inc
+CHANGE MASTER TO MASTER_USE_GTID=NO;
+--source include/start_slave.inc
+--connection master
+
+# Block legal errors for MTR
+call mtr.add_suppression('Found invalid event in binary log');
+call mtr.add_suppression('Slave I/O: Relay log write failure: could not queue event from master');
+call mtr.add_suppression('event read from binlog did not pass crc check');
+call mtr.add_suppression('Replication event checksum verification failed');
+call mtr.add_suppression('Event crc check failed! Most likely there is event corruption');
+call mtr.add_suppression('Slave SQL: Error initializing relay log position: I/O error reading event at position .*, error.* 1593');
+
+SET @old_master_verify_checksum = @@master_verify_checksum;
+
+# Creating test table/data and set corruption position for testing
+--echo # 1. Creating test table/data and set corruption position for testing
+--connection master
+--echo * insert/update/delete rows in table t1 *
+# Corruption algorithm modifies only the first event and
+# then will be reset. To avoid checking always the first event
+# from binlog (usually it is FD) we randomly execute different
+# statements and set position for corruption inside events.
+
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c VARCHAR(100));
+--disable_query_log
+let $i=`SELECT 3+CEILING(10*RAND())`;
+let $j=1;
+let $pos=0;
+while ($i) {
+ eval INSERT INTO t1 VALUES ($j, 'a', NULL);
+ if (`SELECT RAND() > 0.7`)
+ {
+ eval UPDATE t1 SET c = REPEAT('a', 20) WHERE a = $j;
+ }
+ if (`SELECT RAND() > 0.8`)
+ {
+ eval DELETE FROM t1 WHERE a = $j;
+ }
+ if (!$pos) {
+ let $pos= query_get_value(SHOW MASTER STATUS, Position, 1);
+ --sync_slave_with_master
+ --source include/stop_slave.inc
+ --disable_query_log
+ --connection master
+ }
+ dec $i;
+ inc $j;
+}
+--enable_query_log
+
+
+# Emulate corruption in binlog file when SHOW BINLOG EVENTS is executing
+--echo # 2. Corruption in master binlog and SHOW BINLOG EVENTS
+SET @saved_dbug = @@global.debug_dbug;
+SET @@global.debug_dbug="d,corrupt_read_log_event_char";
+--echo SHOW BINLOG EVENTS;
+--disable_query_log
+send_eval SHOW BINLOG EVENTS FROM $pos;
+--enable_query_log
+--error ER_ERROR_WHEN_EXECUTING_COMMAND
+reap;
+
+SET @@global.debug_dbug=@saved_dbug;
+
+# Emulate corruption on master with crc checking on master
+--echo # 3. Master read a corrupted event from binlog and send the error to slave
+
+# We have a rare but nasty potential race here: if the dump thread on
+# the master for the _old_ slave connection has not yet discovered
+# that the slave has disconnected, we will inject the corrupt event on
+# the wrong connection, and the test will fail
+# (+d,corrupt_read_log_event2 corrupts only one event).
+# So kill any lingering dump thread (we need to kill; otherwise dump thread
+# could manage to send all events down the socket before seeing it close, and
+# hang forever waiting for new binlog events to be created).
+let $id= `select id from information_schema.processlist where command = "Binlog Dump"`;
+if ($id)
+{
+ --disable_query_log
+ --error 0,1094
+ eval kill $id;
+ --enable_query_log
+}
+let $wait_condition=
+ SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE command = 'Binlog Dump';
+--source include/wait_condition.inc
+
+SET @@global.debug_dbug="d,corrupt_read_log_event2_set";
+--connection slave
+START SLAVE IO_THREAD;
+let $slave_io_errno= 1236;
+--let $slave_timeout= 10
+--source include/wait_for_slave_io_error.inc
+--connection master
+SET @@global.debug_dbug=@saved_dbug;
+
+# Emulate corruption on master without crc checking on master
+--echo # 4. Master read a corrupted event from binlog and send it to slave
+--connection master
+SET GLOBAL master_verify_checksum=0;
+SET @@global.debug_dbug="d,corrupt_read_log_event2_set";
+--connection slave
+START SLAVE IO_THREAD;
+# When the checksum error is detected, the slave sets error code 1743
+# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately
+# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io().
+# So we usually get 1595, but it is occasionally possible to get 1743.
+let $slave_io_errno= 1595,1743; # ER_SLAVE_RELAY_LOG_WRITE_FAILURE, ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE
+--source include/wait_for_slave_io_error.inc
+--connection master
+SET @@global.debug_dbug=@saved_dbug;
+SET GLOBAL master_verify_checksum=1;
+
+# Emulate corruption in network
+--echo # 5. Slave. Corruption in network
+--connection slave
+SET @saved_dbug_slave = @@GLOBAL.debug_dbug;
+SET @@global.debug_dbug="d,corrupt_queue_event";
+START SLAVE IO_THREAD;
+let $slave_io_errno= 1595,1743; # ER_SLAVE_RELAY_LOG_WRITE_FAILURE, ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE
+--source include/wait_for_slave_io_error.inc
+SET @@global.debug_dbug=@saved_dbug_slave;
+
+# Emulate corruption in relay log
+--echo # 6. Slave. Corruption in relay log
+
+SET @@global.debug_dbug="d,corrupt_read_log_event_char";
+
+START SLAVE SQL_THREAD;
+let $slave_sql_errno= 1593;
+--source include/wait_for_slave_sql_error.inc
+
+SET @@global.debug_dbug=@saved_dbug_slave;
+
+# Start normal replication and compare same table on master
+# and slave
+--echo # 7. Seek diff for tables on master and slave
+--connection slave
+--source include/start_slave.inc
+--connection master
+--sync_slave_with_master
+let $diff_tables= master:test.t1, slave:test.t1;
+--source include/diff_tables.inc
+
+# Clean up
+--echo # 8. Clean up
+--connection master
+set @@global.debug_dbug = @saved_dbug;
+SET GLOBAL master_verify_checksum = @old_master_verify_checksum;
+DROP TABLE t1;
+--sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_basic.test b/mysql-test/suite/rpl/t/rpl_gtid_basic.test
index 004003ea524..5975c6f03c3 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_basic.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_basic.test
@@ -1,4 +1,575 @@
---source include/rpl_gtid_basic.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+--source include/have_innodb.inc
+--let $rpl_topology=1->2->3->4
+--source include/rpl_init.inc
+
+# Set up a 4-deep replication topology, then test various fail-overs
+# using GTID.
+#
+# A -> B -> C -> D
+
+connection server_1;
+--source include/wait_for_binlog_checkpoint.inc
+--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
+--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
+--echo *** GTID position should be empty here ***
+--replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS>
+eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM;
+CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, "m1");
+INSERT INTO t1 VALUES (2, "m2"), (3, "m3"), (4, "m4");
+INSERT INTO t2 VALUES (1, "i1");
+BEGIN;
+INSERT INTO t2 VALUES (2, "i2"), (3, "i3");
+INSERT INTO t2 VALUES (4, "i4");
+COMMIT;
+save_master_pos;
+source include/wait_for_binlog_checkpoint.inc;
+--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
+--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
+--let $gtid_pos_server_1 = `SELECT @@gtid_binlog_pos`
+--echo *** GTID position should be non-empty here ***
+--replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS> $gtid_pos_server_1 <GTID_POS_SERVER_1>
+eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
+
+connection server_2;
+sync_with_master;
+source include/wait_for_binlog_checkpoint.inc;
+--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1)
+--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1)
+--echo *** GTID position should be the same as on server_1 ***
+--replace_result $binlog_file <BINLOG_FILE> $binlog_pos <BINLOG_POS> $gtid_pos_server_1 <GTID_POS_SERVER_1>
+eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos);
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+save_master_pos;
+
+connection server_3;
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+save_master_pos;
+
+connection server_4;
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+
+--echo *** Now take out D, let it fall behind a bit, and then test re-attaching it to A ***
+connection server_4;
+--source include/stop_slave.inc
+
+connection server_1;
+INSERT INTO t1 VALUES (5, "m1a");
+INSERT INTO t2 VALUES (5, "i1a");
+save_master_pos;
+
+connection server_4;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
+ MASTER_USE_GTID=CURRENT_POS;
+--source include/start_slave.inc
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Now move B to D (C is still replicating from B) ***
+connection server_2;
+--source include/stop_slave.inc
+--replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4,
+ MASTER_USE_GTID=CURRENT_POS;
+--source include/start_slave.inc
+
+connection server_4;
+UPDATE t2 SET b="j1a" WHERE a=5;
+save_master_pos;
+
+connection server_2;
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Now move C to D, after letting it fall a little behind ***
+connection server_3;
+--source include/stop_slave.inc
+
+connection server_1;
+INSERT INTO t2 VALUES (6, "i6b");
+INSERT INTO t2 VALUES (7, "i7b");
+--source include/save_master_gtid.inc
+
+connection server_3;
+--replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4,
+ MASTER_USE_GTID=CURRENT_POS;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Now change everything back to what it was, to make rpl_end.inc happy
+# Also check that MASTER_USE_GTID=CURRENT_POS is still enabled.
+connection server_2;
+# We need to sync up server_2 before switching. If it happened to have reached
+# the point 'UPDATE t2 SET b="j1a" WHERE a=5' it will fail to connect to
+# server_1, which is (deliberately) missing that transaction.
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT;
+--source include/start_slave.inc
+--source include/wait_for_slave_to_start.inc
+
+connection server_3;
+--source include/stop_slave.inc
+--replace_result $SLAVE_MYPORT SLAVE_MYPORT
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+connection server_4;
+--source include/stop_slave.inc
+--replace_result $SERVER_MYPORT_3 SERVER_MYPORT_3
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_3;
+--source include/start_slave.inc
+
+connection server_1;
+DROP TABLE t1,t2;
+--source include/save_master_gtid.inc
+
+--echo *** A few more checks for BINLOG_GTID_POS function ***
+--let $valid_binlog_name = query_get_value(SHOW BINARY LOGS,Log_name,1)
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT BINLOG_GTID_POS();
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT BINLOG_GTID_POS('a');
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+SELECT BINLOG_GTID_POS('a',1,NULL);
+SELECT BINLOG_GTID_POS(1,'a');
+SELECT BINLOG_GTID_POS(NULL,NULL);
+SELECT BINLOG_GTID_POS('',1);
+SELECT BINLOG_GTID_POS('a',1);
+eval SELECT BINLOG_GTID_POS('$valid_binlog_name',-1);
+eval SELECT BINLOG_GTID_POS('$valid_binlog_name',0);
+eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551615);
+eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551616);
+
+
+--echo *** Some tests of @@GLOBAL.gtid_binlog_state ***
+--connection server_2
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+
+--connection server_1
+SET @old_state= @@GLOBAL.gtid_binlog_state;
+
+--error ER_BINLOG_MUST_BE_EMPTY
+SET GLOBAL gtid_binlog_state = '';
+RESET MASTER;
+SET GLOBAL gtid_binlog_state = '';
+FLUSH LOGS;
+--source include/show_binary_logs.inc
+SET GLOBAL gtid_binlog_state = '0-1-10,1-2-20,0-3-30';
+--source include/show_binary_logs.inc
+--let $binlog_file= master-bin.000001
+--let $binlog_start= 4
+--source include/show_binlog_events.inc
+#SELECT @@GLOBAL.gtid_binlog_pos;
+#SELECT @@GLOBAL.gtid_binlog_state;
+--error ER_BINLOG_MUST_BE_EMPTY
+SET GLOBAL gtid_binlog_state = @old_state;
+RESET MASTER;
+SET GLOBAL gtid_binlog_state = @old_state;
+
+# Check that slave can reconnect again, despite the RESET MASTER, as we
+# restored the state.
+
+CREATE TABLE t1 (a INT PRIMARY KEY);
+SET gtid_seq_no=100;
+INSERT INTO t1 VALUES (1);
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/start_slave.inc
+# We cannot just use sync_with_master as we've done RESET MASTER, so
+# slave old-style position is wrong.
+# So sync on gtid position instead.
+--source include/sync_with_master_gtid.inc
+
+SELECT * FROM t1;
+# Check that the IO gtid position in SHOW SLAVE STATUS is also correct.
+--let $status_items= Gtid_IO_Pos
+--source include/show_slave_status.inc
+
+--echo *** Test @@LAST_GTID and MASTER_GTID_WAIT() ***
+
+--connection server_1
+DROP TABLE t1;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--source include/stop_slave.inc
+
+--connect (m1,127.0.0.1,root,,test,$SERVER_MYPORT_1,)
+SELECT @@last_gtid;
+SET gtid_seq_no=110;
+SELECT @@last_gtid;
+BEGIN;
+SELECT @@last_gtid;
+INSERT INTO t1 VALUES (2);
+SELECT @@last_gtid;
+COMMIT;
+SELECT @@last_gtid;
+--let $pos= `SELECT @@gtid_binlog_pos`
+
+--connect (s1,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+eval SET @pos= '$pos';
+# Check NULL argument.
+SELECT master_gtid_wait(NULL);
+# Check empty argument returns immediately.
+SELECT master_gtid_wait('', NULL);
+# Check this gets counted
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+SHOW STATUS LIKE 'Master_gtid_wait_time';
+# Let's check that we get a timeout
+SELECT master_gtid_wait(@pos, 0.5);
+SELECT * FROM t1 ORDER BY a;
+# Now actually wait until the slave reaches the position
+send SELECT master_gtid_wait(@pos);
+
+--connection server_2
+--source include/start_slave.inc
+
+--connection s1
+reap;
+SELECT * FROM t1 ORDER BY a;
+
+# Test waiting on a domain that does not exist yet.
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id= 1;
+INSERT INTO t1 VALUES (3);
+--let $pos= `SELECT @@gtid_binlog_pos`
+
+--connection s1
+--replace_result $pos POS
+eval SET @pos= '$pos';
+SELECT master_gtid_wait(@pos, 0);
+SELECT * FROM t1 WHERE a >= 3;
+send SELECT master_gtid_wait(@pos, -1);
+
+--connection server_2
+--source include/start_slave.inc
+
+--connection s1
+reap;
+SELECT * FROM t1 WHERE a >= 3;
+# Waiting for only part of the position.
+SELECT master_gtid_wait('1-1-1', 0);
+
+# Now test a lot of parallel master_gtid_wait() calls, completing in different
+# order, and some of which time out or get killed on the way.
+
+--connection s1
+send SELECT master_gtid_wait('2-1-1,1-1-4,0-1-110');
+
+--connect (s2,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+# This will time out. No event 0-1-1000 exists
+send SELECT master_gtid_wait('0-1-1000', 0.5);
+
+--connect (s3,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+# This one we will kill
+--let $kill1_id= `SELECT connection_id()`
+send SELECT master_gtid_wait('0-1-2000');
+
+--connect (s4,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('2-1-10');
+
+--connect (s5,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('2-1-6', 1);
+
+# This one we will kill also.
+--connect (s6,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+--let $kill2_id= `SELECT connection_id()`
+send SELECT master_gtid_wait('2-1-5');
+
+--connect (s7,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('2-1-10');
+
+--connect (s8,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('2-1-5,1-1-4,0-1-110');
+
+--connect (s9,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('2-1-2');
+
+--connection server_2
+# This one completes immediately.
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+SELECT master_gtid_wait('1-1-1');
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+let $wait_time = query_get_value(SHOW STATUS LIKE 'Master_gtid_wait_time', Value, 1);
+--replace_result $wait_time MASTER_GTID_WAIT_TIME
+eval SET @a= $wait_time;
+SELECT IF(@a <= 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " is larger than expected"))
+ AS Master_gtid_wait_time_as_expected;
+
+
+--connect (s10,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+send SELECT master_gtid_wait('0-1-109');
+
+--connection server_2
+# This one should time out.
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+SELECT master_gtid_wait('2-1-2', 0.5);
+SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
+SHOW STATUS LIKE 'Master_gtid_wait_count';
+let $wait_time = query_get_value(SHOW STATUS LIKE 'Master_gtid_wait_time', Value, 1);
+--replace_result $wait_time MASTER_GTID_WAIT_TIME
+eval SET @a= $wait_time;
+# We expect a wait time of just a bit over 0.5 seconds. But thread scheduling
+# and timer inaccuracies could introduce significant jitter. So allow a
+# generous interval.
+SELECT IF(@a BETWEEN 0.4*1000*1000 AND 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " not as expected")) AS Master_gtid_wait_time_as_expected;
+
+--replace_result $kill1_id KILL_ID
+eval KILL QUERY $kill1_id;
+--connection s3
+--error ER_QUERY_INTERRUPTED
+reap;
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=2;
+INSERT INTO t1 VALUES (4);
+
+--connection s9
+reap;
+
+--connection server_2
+--replace_result $kill2_id KILL_ID
+eval KILL CONNECTION $kill2_id;
+
+--connection s6
+--error 2013,ER_CONNECTION_KILLED
+reap;
+
+--connection server_1
+SET gtid_domain_id=1;
+SET gtid_seq_no=4;
+INSERT INTO t1 VALUES (5);
+SET gtid_domain_id=2;
+SET gtid_seq_no=5;
+INSERT INTO t1 VALUES (6);
+
+--connection s8
+reap;
+--connection s1
+reap;
+--connection s2
+reap;
+--connection s5
+reap;
+--connection s10
+reap;
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=10;
+INSERT INTO t1 VALUES (7);
+
+--connection s4
+reap;
+--connection s7
+reap;
+
+
+--echo *** Test gtid_slave_pos when used with GTID ***
+
+--connection server_2
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=1000;
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (11);
+--save_master_pos
+
+--connection server_2
+SET sql_slave_skip_counter= 1;
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+SELECT IF(LOCATE("2-1-1001", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1001 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=1010;
+INSERT INTO t1 VALUES (12);
+INSERT INTO t1 VALUES (13);
+--save_master_pos
+
+--connection server_2
+SET sql_slave_skip_counter= 2;
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+SELECT IF(LOCATE("2-1-1011", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1011 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=1020;
+INSERT INTO t1 VALUES (14);
+INSERT INTO t1 VALUES (15);
+INSERT INTO t1 VALUES (16);
+--save_master_pos
+
+--connection server_2
+SET sql_slave_skip_counter= 3;
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+SELECT IF(LOCATE("2-1-1022", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1022 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id=2;
+SET gtid_seq_no=1030;
+# Disable logging Annotate_rows events to preserve events count.
+let $binlog_annotate_row_events_saved= `SELECT @@binlog_annotate_row_events`;
+SET @@binlog_annotate_row_events= 0;
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (18);
+INSERT INTO t1 VALUES (19);
+eval SET @@binlog_annotate_row_events= $binlog_annotate_row_events_saved;
+--save_master_pos
+
+--connection server_2
+SET sql_slave_skip_counter= 5;
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
+SELECT IF(LOCATE("2-1-1032", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1032 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+
+--source include/stop_slave.inc
+
+--connection server_1
+SET gtid_domain_id=3;
+SET gtid_seq_no=100;
+CREATE TABLE t2 (a INT PRIMARY KEY);
+DROP TABLE t2;
+SET gtid_domain_id=2;
+SET gtid_seq_no=1040;
+INSERT INTO t1 VALUES (20);
+--save_master_pos
+
+--connection server_2
+SET @saved_mode= @@GLOBAL.slave_ddl_exec_mode;
+SET GLOBAL slave_ddl_exec_mode=STRICT;
+SET sql_slave_skip_counter=1;
+START SLAVE UNTIL master_gtid_pos="3-1-100";
+--let $master_pos=3-1-100
+--source include/sync_with_master_gtid.inc
+--source include/wait_for_slave_to_stop.inc
+--error ER_NO_SUCH_TABLE
+SELECT * FROM t2;
+SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+# Start the slave again, it should fail on the DROP TABLE as the table is not there.
+SET sql_log_bin=0;
+CALL mtr.add_suppression("Slave: Unknown table 'test\\.t2' Error_code: 1051");
+SET sql_log_bin=1;
+START SLAVE;
+--let $slave_sql_errno=1051
+--source include/wait_for_slave_sql_error.inc
+SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+STOP SLAVE IO_THREAD;
+SET sql_slave_skip_counter=2;
+--source include/start_slave.inc
+--sync_with_master
+
+SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
+SELECT IF(LOCATE("3-1-101", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-101 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+SELECT IF(LOCATE("2-1-1040", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1040 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status;
+
+SET GLOBAL slave_ddl_exec_mode= @saved_mode;
+
+
+--echo *** Test GTID-connecting to a master with out-of-order sequence numbers in the binlog. ***
+
+# Create an out-of-order binlog on server 2.
+# Let server 3 replicate to an out-of-order point, stop it, restart it,
+# and check that it replicates correctly despite the out-of-order.
+
+--connection server_1
+SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
+INSERT INTO t1 VALUES (31);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
+INSERT INTO t1 VALUES (32);
+
+--connection server_1
+INSERT INTO t1 VALUES (33);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--save_master_pos
+
+--connection server_3
+--sync_with_master
+--source include/stop_slave.inc
+
+--connection server_1
+INSERT INTO t1 VALUES (34);
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+--save_master_pos
+
+--connection server_3
+--source include/start_slave.inc
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+--save_master_pos
+
+--connection server_4
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
+
+
+# Clean up.
+--connection server_1
+DROP TABLE t1;
+
+
+--source include/rpl_end.inc
--echo #
--echo # Start of 10.2 tests
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
index 7fb457f6d7f..9760d4df00c 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
@@ -2,10 +2,10 @@ if (`SELECT $PS_PROTOCOL != 0`)
{
--skip Test temporarily disabled for ps-protocol
}
+--source include/no_valgrind_without_big.inc
--let $rpl_topology=1->2
--source include/rpl_init.inc
--source include/have_innodb.inc
---source include/no_valgrind_without_big.inc
--echo *** Test normal shutdown/restart of slave server configured as a GTID slave. ***
diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test
index 4bb6477ca98..75d28d6a6c6 100644
--- a/mysql-test/suite/rpl/t/rpl_incident.test
+++ b/mysql-test/suite/rpl/t/rpl_incident.test
@@ -1 +1,61 @@
---source include/rpl_incident.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+--source include/have_debug.inc
+--source include/master-slave.inc
+
+SET @old_binlog_checksum=@@binlog_checksum;
+SET GLOBAL BINLOG_CHECKSUM=none;
+connection slave;
+SET @old_binlog_checksum=@@binlog_checksum;
+SET GLOBAL BINLOG_CHECKSUM=none;
+connection master;
+
+--echo **** On Master ****
+CREATE TABLE t1 (a INT);
+
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT * FROM t1;
+
+set @saved_dbug = @@global.debug_dbug;
+SET GLOBAL debug_dbug= '+d,incident_database_resync_on_replace,*';
+
+# This will generate an incident log event and store it in the binary
+# log before the replace statement.
+REPLACE INTO t1 VALUES (4);
+--save_master_pos
+SELECT * FROM t1;
+
+set @@global.debug_dbug = @saved_dbug;
+
+connection slave;
+# Wait until SQL thread stops with error LOST_EVENT on master
+call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590");
+let $slave_sql_errno= 1590;
+let $show_slave_sql_error= 1;
+source include/wait_for_slave_sql_error.inc;
+
+# The 4 should not be inserted into the table, since the incident log
+# event should have stop the slave.
+--echo **** On Slave ****
+SELECT * FROM t1;
+
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+START SLAVE;
+--sync_with_master
+
+# Now, we should have inserted the row into the table and the slave
+# should be running. We should also have rotated to a new binary log.
+
+SELECT * FROM t1;
+source include/check_slave_is_running.inc;
+
+connection master;
+SET GLOBAL BINLOG_CHECKSUM=@old_binlog_checksum;
+DROP TABLE t1;
+--sync_slave_with_master
+SET GLOBAL BINLOG_CHECKSUM=@old_binlog_checksum;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test
index 6f6ab7e8d7c..46673ea4764 100644
--- a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test
@@ -1 +1,96 @@
---source include/rpl_init_slave_errors.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+######################################################################
+# Some errors that cause the slave SQL thread to stop are not shown in
+# the Slave_SQL_Error column of "SHOW SLAVE STATUS". Instead, the error
+# is only in the server's error log.
+#
+# Two failures and their respective reporting are verified:
+#
+# 1 - Failures during slave thread initialization
+# 2 - Failures while processing queries passed through the init_slave
+# option.
+#
+# In order to check the first type of failure, we inject a fault in the
+# SQL/IO Threads through SET GLOBAL debug.
+#
+# To check the second type, we set @@global.init_slave to an invalid
+# command thus preventing the initialization of the SQL Thread.
+#
+# Obs:
+# 1 - Note that testing failures while initializing the relay log position
+# is hard as the same function is called before the code reaches the point
+# that we want to test.
+#
+# 2 - This test does not target failures that are reported while applying
+# events such as duplicate keys, errors while reading the relay-log.bin*,
+# etc. Such errors are already checked on other tests.
+######################################################################
+
+######################################################################
+# Configuring the Environment
+######################################################################
+source include/have_debug.inc;
+source include/have_log_bin.inc;
+source include/master-slave.inc;
+
+connection slave;
+
+--disable_warnings
+stop slave;
+--enable_warnings
+reset slave;
+
+######################################################################
+# Injecting faults in the threads' initialization
+######################################################################
+connection slave;
+
+# Set debug flags on slave to force errors to occur
+set @saved_dbug = @@global.debug_dbug;
+SET GLOBAL debug_dbug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
+
+start slave;
+
+#
+# slave is going to stop because of emulated failures
+# but there won't be any crashes nor asserts hit.
+#
+# 1593 = ER_SLAVE_FATAL_ERROR
+--let $slave_sql_errno= 1593
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+
+call mtr.add_suppression("Failed during slave.* thread initialization");
+
+set @@global.debug_dbug = @saved_dbug;
+
+######################################################################
+# Injecting faults in the init_slave option
+######################################################################
+connection slave;
+
+reset slave;
+
+SET GLOBAL init_slave= "garbage";
+
+start slave;
+# 1064 = ER_PARSE_ERROR
+--let $slave_sql_errno= 1064
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+
+######################################################################
+# Clean up
+######################################################################
+SET GLOBAL init_slave= "";
+
+# Clean up Last_SQL_Error
+--source include/stop_slave_io.inc
+RESET SLAVE;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test b/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test
index 9c804d8206a..a27a50d0fc4 100644
--- a/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test
+++ b/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test
@@ -15,8 +15,8 @@
#
# (iii) master and slave tables do not differ
#
--- source include/master-slave.inc
-- source include/not_windows.inc
+-- source include/master-slave.inc
SET SQL_LOG_BIN=0;
CREATE DATABASE B37656;
diff --git a/mysql-test/suite/rpl/include/rpl_loaddata_local.inc b/mysql-test/suite/rpl/t/rpl_loaddata_local.test
index 20962d74e98..20962d74e98 100644
--- a/mysql-test/suite/rpl/include/rpl_loaddata_local.inc
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_local.test
diff --git a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
deleted file mode 100644
index 712041467ab..00000000000
--- a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
+++ /dev/null
@@ -1 +0,0 @@
---source include/rpl_loaddata_local.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loadfile.test b/mysql-test/suite/rpl/t/rpl_loadfile.test
index 10fecf1f653..9cd64530690 100644
--- a/mysql-test/suite/rpl/t/rpl_loadfile.test
+++ b/mysql-test/suite/rpl/t/rpl_loadfile.test
@@ -1 +1,120 @@
---source include/rpl_loadfile.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/18/2005 #
+#############################################################################
+# TEST: To test the LOAD_FILE() in rbr #
+#############################################################################
+# Change Author: JBM
+# Change Date: 2006-01-16
+##########
+
+# Includes
+-- source include/have_binlog_format_mixed_or_row.inc
+-- source include/master-slave.inc
+
+-- source suite/rpl/include/rpl_loadfile.test
+
+# BUG#39701: Mixed binlog format does not switch to row mode on LOAD_FILE
+#
+# DESCRIPTION
+#
+# Problem: when using load_file string function and mixed binlogging format
+# there was no switch to row based binlogging format. This leads
+# to scenarios on which the slave replicates the statement and it
+# will try to load the file from local file system, which in most
+# likely it will not exist.
+#
+# Solution:
+# Marking this function as unsafe for statement format, makes the
+# statement using it to be logged in row based format. As such, data
+# replicated from the master, becomes the content of the loaded file.
+# Consequently, the slave receives the necessary data to complete
+# the load_file instruction correctly.
+#
+# IMPLEMENTATION
+#
+# The test is implemented as follows:
+#
+# On Master,
+# i) write to file the desired content.
+# ii) create table and stored procedure with load_file
+# iii) stop slave
+# iii) execute load_file
+# iv) remove file
+#
+# On Slave,
+# v) start slave
+# vi) sync it with master so that it gets the updates from binlog (which
+# should have bin logged in row format).
+#
+# If the the binlog format does not change to row, then the assertion
+# done in the following step fails. This happens because tables differ
+# since the file does not exist anymore, meaning that when slave
+# attempts to execute LOAD_FILE statement it inserts NULL on table
+# instead of the same contents that the master loaded when it executed
+# the procedure (which was executed when file existed).
+#
+# vii) assert that the contents of master and slave
+# table are the same
+
+--source include/rpl_reset.inc
+
+connection master;
+let $file= $MYSQLTEST_VARDIR/tmp/bug_39701.data;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT repeat('x',20) INTO OUTFILE '$file'
+
+disable_warnings;
+DROP TABLE IF EXISTS t1;
+enable_warnings;
+
+CREATE TABLE t1 (t text);
+DELIMITER |;
+CREATE PROCEDURE p(file varchar(4096))
+ BEGIN
+ INSERT INTO t1 VALUES (LOAD_FILE(file));
+ END|
+DELIMITER ;|
+
+# stop slave before issuing the load_file on master
+connection slave;
+source include/stop_slave.inc;
+
+connection master;
+
+# test: check that logging falls back to rbr.
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval CALL p('$file')
+
+# test: remove the file from the filesystem and assert that slave still
+# gets the loaded file
+remove_file $file;
+
+# now that the file is removed it is safe (regarding what we want to test)
+# to start slave
+connection slave;
+source include/start_slave.inc;
+
+connection master;
+sync_slave_with_master;
+
+# assertion: assert that the slave got the updates even
+# if the file was removed before the slave started,
+# meaning that contents were indeed transfered
+# through binlog (in row format)
+let $diff_tables= master:t1, slave:t1;
+source include/diff_tables.inc;
+
+# CLEAN UP
+--connection master
+DROP TABLE t1;
+DROP PROCEDURE p;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mdev12179.test b/mysql-test/suite/rpl/t/rpl_mdev12179.test
index c8b9e665747..aa0d05211ff 100644
--- a/mysql-test/suite/rpl/t/rpl_mdev12179.test
+++ b/mysql-test/suite/rpl/t/rpl_mdev12179.test
@@ -1,7 +1,7 @@
+--source include/no_valgrind_without_big.inc
--source include/have_innodb.inc
--let $rpl_topology=1->2
--source include/rpl_init.inc
---source include/no_valgrind_without_big.inc
--connection server_2
call mtr.add_suppression("The automatically created table.*name may not be entirely in lowercase");
diff --git a/mysql-test/suite/rpl/t/rpl_mdev382.test b/mysql-test/suite/rpl/t/rpl_mdev382.test
index 093b7b92413..84e3c84982d 100644
--- a/mysql-test/suite/rpl/t/rpl_mdev382.test
+++ b/mysql-test/suite/rpl/t/rpl_mdev382.test
@@ -1,7 +1,7 @@
+--source include/not_windows.inc #unix shell escaping used for mysqlbinlog
--source include/have_innodb.inc
--source include/have_binlog_format_statement.inc
--source include/master-slave.inc
---source include/not_windows.inc #unix shell escaping used for mysqlbinlog
# MDEV-382: multiple SQL injections in replication code.
diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test
index 1bf99c2366b..cbde486bcbb 100644
--- a/mysql-test/suite/rpl/t/rpl_packet.test
+++ b/mysql-test/suite/rpl/t/rpl_packet.test
@@ -1 +1,184 @@
---source include/rpl_packet.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+# ==== Purpose ====
+#
+# Check replication protocol packet size handling
+#
+# ==== Related bugs ====
+# Bug#19402 SQL close to the size of the max_allowed_packet fails on slave
+# BUG#23755: Replicated event larger that max_allowed_packet infinitely re-transmits
+# BUG#42914: No LAST_IO_ERROR for max_allowed_packet errors
+# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET
+
+# max-out size db name
+source include/have_binlog_format_row.inc;
+source include/master-slave.inc;
+
+call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, .*error.* 1153");
+call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet");
+let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
+disable_warnings;
+eval drop database if exists $db;
+enable_warnings;
+eval create database $db;
+
+connection master;
+let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`;
+let $old_net_buffer_length= `SELECT @@global.net_buffer_length`;
+let $old_slave_max_allowed_packet= `SELECT @@global.slave_max_allowed_packet`;
+SET @@global.max_allowed_packet=1024;
+SET @@global.net_buffer_length=1024;
+
+sync_slave_with_master;
+# Restart slave for setting to take effect
+source include/stop_slave.inc;
+source include/start_slave.inc;
+
+# Reconnect to master for new setting to take effect
+disconnect master;
+
+# alas, can't use eval here; if db name changed apply the change here
+connect (master,localhost,root,,DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________);
+
+connection master;
+select @@net_buffer_length, @@max_allowed_packet;
+
+create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+
+INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023');
+sync_slave_with_master;
+
+eval select count(*) from `$db`.`t1` /* must be 1 */;
+
+SHOW STATUS LIKE 'Slave_running';
+select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING';
+connection master;
+eval drop database $db;
+sync_slave_with_master;
+
+#
+# Bug #23755: Replicated event larger that max_allowed_packet infinitely re-transmits
+#
+# Check that a situation when the size of event on the master is greater than
+# max_allowed_packet on the slave does not lead to infinite re-transmits.
+
+connection master;
+
+# Change the max packet size on master
+
+SET @@global.max_allowed_packet=4096;
+SET @@global.net_buffer_length=4096;
+
+# Restart slave for new setting to take effect
+connection slave;
+source include/stop_slave.inc;
+source include/start_slave.inc;
+
+# Reconnect to master for new setting to take effect
+disconnect master;
+connect (master, localhost, root);
+connection master;
+
+CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+
+sync_slave_with_master;
+
+connection master;
+
+INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
+
+
+#
+# Bug#42914: The slave I/O thread must stop after trying to read the above
+# event, However there is no Last_IO_Error report.
+#
+
+# The slave I/O thread must stop after trying to read the above event
+connection slave;
+# 1153 = ER_NET_PACKET_TOO_LARGE
+--let $slave_io_errno= 1153
+--let $show_slave_io_error= 1
+--source include/wait_for_slave_io_error.inc
+
+# TODO: this is needed because of BUG#55790. Remove once that is fixed.
+--source include/stop_slave_sql.inc
+
+#
+# Bug#42914: On the master, if a binary log event is larger than
+# max_allowed_packet, the error message ER_MASTER_FATAL_ERROR_READING_BINLOG
+# is sent to a slave when it requests a dump from the master, thus leading the
+# I/O thread to stop. However, there is no Last_IO_Error reported.
+#
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_reset.inc
+--connection master
+DROP TABLE t1;
+--sync_slave_with_master
+
+
+connection master;
+CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
+sync_slave_with_master;
+
+connection master;
+INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
+
+connection slave;
+# The slave I/O thread must stop after receiving
+# 1153 = ER_NET_PACKET_TOO_LARGE
+--let $slave_io_errno= 1153
+--let $show_slave_io_error= 1
+--source include/wait_for_slave_io_error.inc
+
+# Remove the bad binlog and clear error status on slave.
+STOP SLAVE;
+RESET SLAVE;
+--connection master
+RESET MASTER;
+
+
+#
+# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET
+#
+# In BUG#55322, @@session.max_allowed_packet increased each time SHOW
+# BINLOG EVENTS was issued. To verify that this bug is fixed, we
+# execute SHOW BINLOG EVENTS twice and check that max_allowed_packet
+# never changes. We turn off the result log because we don't care
+# about the contents of the binlog.
+
+--disable_result_log
+SET @max_allowed_packet_0= @@session.max_allowed_packet;
+SHOW BINLOG EVENTS;
+SET @max_allowed_packet_1= @@session.max_allowed_packet;
+SHOW BINLOG EVENTS;
+SET @max_allowed_packet_2= @@session.max_allowed_packet;
+--enable_result_log
+if (`SELECT NOT(@max_allowed_packet_0 = @max_allowed_packet_1 AND @max_allowed_packet_1 = @max_allowed_packet_2)`)
+{
+ --echo ERROR: max_allowed_packet changed after executing SHOW BINLOG EVENTS
+ --source include/show_rpl_debug_info.inc
+ SELECT @max_allowed_packet_0, @max_allowed_packet_1, @max_allowed_packet_2;
+ --die @max_allowed_packet changed after executing SHOW BINLOG EVENTS
+}
+
+
+--echo ==== clean up ====
+connection master;
+DROP TABLE t1;
+eval SET @@global.max_allowed_packet= $old_max_allowed_packet;
+eval SET @@global.net_buffer_length= $old_net_buffer_length;
+eval SET @@global.slave_max_allowed_packet= $old_slave_max_allowed_packet;
+# slave is stopped
+connection slave;
+DROP TABLE t1;
+
+# Clear Last_IO_Error
+RESET SLAVE;
+
+--source include/rpl_end.inc
+# End of tests
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_ignored_errors.test b/mysql-test/suite/rpl/t/rpl_parallel_ignored_errors.test
index 90f09a76546..493385f1ae3 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel_ignored_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel_ignored_errors.test
@@ -1 +1,115 @@
---source include/rpl_parallel_ignored_errors.inc
+# ==== Purpose ====
+#
+# Test verifies that, in parallel replication, transaction failure notification
+# is propagated to all the workers. Workers should abort the execution of
+# transaction event groups, whose event positions are higher than the failing
+# transaction group.
+#
+# ==== Implementation ====
+#
+# Steps:
+# 0 - Create a table t1 on master which has a primary key. Enable parallel
+# replication on slave with slave_parallel_mode='optimistic' and
+# slave_parallel_threads=3.
+# 1 - On slave start a transaction and execute a local INSERT statement
+# which will insert value 32. This is done to block the INSERT coming
+# from master.
+# 2 - On master execute an INSERT statement with value 32, so that it is
+# blocked on slave.
+# 3 - On slave enable a debug sync point such that it holds the worker thread
+# execution as soon as work is scheduled to it.
+# 4 - INSERT value 33 on master. It will be held on slave by other worker
+# thread due to debug simulation.
+# 5 - INSERT value 34 on master.
+# 6 - On slave, enusre that INSERT 34 has reached a state where it waits for
+# its prior transactions to commit.
+# 7 - Commit the local INSERT 32 on slave server so that first worker will
+# error out.
+# 8 - Now send a continue signal to second worker processing 33. It should
+# wakeup and propagate the error to INSERT 34.
+# 9 - Upon slave stop due to error, check that no rows are found after the
+# failed INSERT 32.
+#
+# ==== References ====
+#
+# MDEV-20645: Replication consistency is broken as workers miss the error
+# notification from an earlier failed group.
+#
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/have_binlog_format_statement.inc
+--source include/master-slave.inc
+
+--enable_connect_log
+--connection server_2
+--source include/stop_slave.inc
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
+SET @old_debug= @@GLOBAL.debug_dbug;
+SET GLOBAL slave_parallel_mode='optimistic';
+SET GLOBAL slave_parallel_threads= 3;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends");
+--source include/start_slave.inc
+
+--connection server_1
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=InnoDB;
+# MDEV-515 takes X-lock on the table for the first insert.
+# So concurrent insert won't happen on the table
+INSERT INTO t1 VALUES(1);
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+
+--connect (con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
+BEGIN;
+INSERT INTO t1 VALUES (32);
+
+--connection server_1
+INSERT INTO t1 VALUES (32);
+
+--connection server_2
+--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE info like "INSERT INTO t1 VALUES (32)"
+--source include/wait_condition.inc
+SET GLOBAL debug_dbug="+d,hold_worker_on_schedule";
+SET debug_sync="debug_sync_action SIGNAL reached_pause WAIT_FOR continue_worker";
+
+--connection server_1
+SET gtid_seq_no=100;
+INSERT INTO t1 VALUES (33);
+
+--connection server_2
+SET debug_sync='now WAIT_FOR reached_pause';
+
+--connection server_1
+INSERT INTO t1 VALUES (34);
+
+--connection server_2
+--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE state like "Waiting for prior transaction to commit"
+--source include/wait_condition.inc
+--connection con_temp2
+COMMIT;
+
+# Clean up.
+--connection server_2
+--source include/stop_slave.inc
+--let $assert_cond= COUNT(*) = 0 FROM t1 WHERE a>32
+--let $assert_text= table t1 should have zero rows where a>32
+--source include/assert.inc
+SELECT * FROM t1 WHERE a>32;
+DELETE FROM t1 WHERE a=32;
+
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+SET GLOBAL slave_parallel_mode=@old_parallel_mode;
+SET GLOBAL debug_dbug=@old_debug;
+SET DEBUG_SYNC= 'RESET';
+--source include/start_slave.inc
+
+--connection server_1
+DROP TABLE t1;
+--disable_connect_log
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_error_stop.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_error_stop.test
new file mode 100644
index 00000000000..27f38d47bdb
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_error_stop.test
@@ -0,0 +1,180 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--let $rpl_topology=1->2
+--source include/rpl_init.inc
+
+call mtr.add_suppression("Slave: Commit failed due to failure of an earlier commit");
+call mtr.add_suppression("Slave: Duplicate entry '99'");
+
+--connection server_1
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1,1); # hit a dup entry on slave
+INSERT INTO t1 VALUES(2,1); # races to "win" the last exit
+INSERT INTO t1 VALUES(3,1);
+INSERT INTO t1 VALUES(4,1); # make W3 race over W1
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+--source include/stop_slave.inc
+SET @old_debug_dbug = @@global.debug_dbug;
+# In a group of W1,W2,W3 of the same batch W2 simulates slowness.
+SET @@global.debug_dbug = "d,hold_worker2_favor_worker3";
+SET GLOBAL slave_parallel_threads=4;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
+SET GLOBAL slave_parallel_mode='optimistic';
+
+# MDEV-30780 optimistic parallel slave hangs after hit an error
+# Test workers hang scenario to prove it's no more neither
+# out-of-order access to the active gco list.
+#
+# The test provides how to reproduce on the OLD version, false by default.
+# That branch approximates the original hang with an assert that
+# confirms the OLD version indeed could access already reclaimed gco.
+--let $old_version_regression=0
+
+
+--connection server_1
+
+# Let W1,W2,W3,W4 parallel workers that are going to execute
+# the following transaction.
+# W1 holds on with the 1st statement
+# then crashes W3 with the 2nd into retry,
+# finally hits with the 3rd a dup entry, on slave.
+SET @@gtid_seq_no = 2001;
+BEGIN;
+ UPDATE t1 SET b = 11 WHERE a = 4;
+ UPDATE t1 SET b = 11 WHERE a = 3;
+ UPDATE t1 SET a = 99 WHERE a = 1;
+COMMIT;
+# In the buggy version W2 races to "win" the exit last (of W1..3)
+# and by that to access last a gco struct, garbage-collected.
+UPDATE t1 SET b = 2 WHERE a = 2;
+# W3 garbage-collects the gco struct in the buggy version.
+UPDATE t1 SET b = 3 WHERE a = 3;
+# W4 resides in following "singleton" batch to a W2 replacement
+# in the buggy version to allow W3 reclaim the batch's gco.
+DROP TABLE IF EXISTS phantom_1;
+
+--source include/save_master_gtid.inc
+
+--connect (slave_local_0, 127.0.0.1, root,, test, $SLAVE_MYPORT,)
+begin;
+ UPDATE t1 set b = 11 where a = 4;
+--connect (slave_local_1, 127.0.0.1, root,, test, $SLAVE_MYPORT,)
+begin;
+ INSERT INTO t1 VALUES (99, 11);
+
+--connect (slave_local_2, 127.0.0.1, root,, test, $SLAVE_MYPORT,)
+begin;
+ UPDATE t1 SET b = 12 WHERE a = 2;
+
+--connect (slave_local_3, 127.0.0.1, root,, test, $SLAVE_MYPORT,)
+begin;
+ UPDATE t1 SET b = 13 WHERE a = 3;
+
+--connection server_2
+--source include/start_slave.inc
+
+--echo # W4 is waiting to start its DROP
+
+--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to start commit%"
+--source include/wait_condition.inc
+
+--connection slave_local_3
+# make W3 to set E.cc <- 1
+ rollback;
+--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%"
+--source include/wait_condition.inc
+
+--connection slave_local_0
+# make W3 into retry and delay it to let W1 hit a dupicate error first,
+# see 'commit' by slave_local_1.
+ rollback;
+--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "debug sync point: now"
+--source include/wait_condition.inc
+SELECT count(*) = 0 as "W3 undid its commit state" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%";
+
+
+--connection slave_local_2
+ rollback;
+# wait for W2 to start committing E.cc <- 2
+--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state like "Waiting for prior transaction to commit"
+--source include/wait_condition.inc
+
+--connection slave_local_1
+
+# W1 errors out
+# A. to alert W3
+# B. W3 will *not* wake up W4 in the fixed version, having to wait for W2 demise.
+# C. W2 will notify W3 that releases W4 as it would do in normal cases.
+commit;
+
+if (!$old_version_regression)
+{
+# A. In the fixed version show-processlist W4 is still in the ordered waiting
+SELECT COUNT(*) = 1 as "W4 remains with the same status" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to start commit%";
+--let $status= query_get_value("show slave status", Slave_SQL_Running, 1)
+--echo # Slave_SQL_Running YES = $status
+
+# B. In the fixed version W3 is waiting for W2,...
+--let $wait_condition= SELECT count(*) = 1 as "W4 is waiting" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%"
+--source include/wait_condition.inc
+--echo # while W2 is held back ...
+--let $wait_condition= SELECT count(*) = 1 as "W2 simulates slowness" FROM information_schema.processlist WHERE state LIKE "debug sync point: now"
+--source include/wait_condition.inc
+
+# C. # ...until NOW.
+SET DEBUG_SYNC = 'now SIGNAL cont_worker2';
+
+}
+
+# To reproduce the hang on the OLD version ...
+if ($old_version_regression)
+{
+ # replace the actual fixes block with checking W3,W4 have actually committed,
+ # followed by signaling to W2 like on behalf of W4 which would end up in the hang.
+ --let $wait_condition= SELECT COUNT(*) = 0 as "W4 has moved on" FROM information_schema.processlist WHERE state like "Waiting for prior transaction to start commit"
+ --source include/wait_condition.inc
+ --let $wait_condition= SELECT count(*) = 0 as "W3 does not wait on W2" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%"
+--source include/wait_condition.inc
+
+ --let $wait_condition= SELECT count(*) = 1 as "W2 simulates slowness" FROM information_schema.processlist WHERE state LIKE "debug sync point: now"
+ --source include/wait_condition.inc
+
+ # Like above, but signaling is done after W4 is done to violate the commit order
+ # that must fire a debug assert.
+ SET DEBUG_SYNC = 'now SIGNAL cont_worker2';
+}
+
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
+
+# Restore the slave data and resume with replication
+DELETE FROM t1 WHERE a=99;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+#
+# Clean up.
+#
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_mode=@old_parallel_mode;
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+SET @@global.debug_dbug = @old_debug_dbug;
+SET debug_sync = RESET;
+--source include/start_slave.inc
+
+--connection server_1
+DROP TABLE t1;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_seq.test b/mysql-test/suite/rpl/t/rpl_parallel_seq.test
new file mode 100644
index 00000000000..2a4fd96ff34
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_parallel_seq.test
@@ -0,0 +1,131 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+--connection slave
+--source include/stop_slave.inc
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+
+--echo # MDEV-29621 the sequence engine binlog_row_image-full events
+--echo # MDL-deadlock on the parallel slave.
+--connection master
+CREATE SEQUENCE s1;
+SET @@session.binlog_row_image=FULL;
+SET @@session.debug_dbug="+d,binlog_force_commit_id";
+SET @commit_id=7;
+SET @@gtid_seq_no=100;
+SELECT NEXT VALUE FOR s1;
+INSERT INTO s1 VALUES(2, 1, 10, 1, 2, 1, 1, 0);
+SET @@session.debug_dbug="";
+
+--connection slave
+--let $slave_parallel_threads=`select @@global.slave_parallel_threads`
+--let $slave_parallel_mode=`select @@global.slave_parallel_mode`
+SET @@global.slave_parallel_threads=2;
+SET @@global.slave_parallel_mode=optimistic;
+SET @@global.debug_dbug="+d,hold_worker_on_schedule";
+--source include/start_slave.inc
+
+--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to start commit"
+--source include/wait_condition.inc
+SET DEBUG_SYNC = 'now SIGNAL continue_worker';
+
+--connection master
+DROP SEQUENCE s1;
+--sync_slave_with_master
+--source include/stop_slave.inc
+
+--echo # Simulate buggy 10.3.36 master to prove the parallel applier
+--echo # does not deadlock now at replaying the above master load.
+--connection master
+--let $datadir= `SELECT @@datadir`
+
+--let $rpl_server_number= 1
+--source include/rpl_stop_server.inc
+
+--remove_file $datadir/master-bin.000001
+--copy_file $MYSQL_TEST_DIR/std_data/rpl/master-bin-seq_10.3.36.000001 $datadir/master-bin.000001
+
+--let $rpl_server_number= 1
+--source include/rpl_start_server.inc
+
+--source include/wait_until_connected_again.inc
+--save_master_pos
+
+--connection slave
+RESET MASTER;
+SET @@global.gtid_slave_pos="";
+
+--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
+eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, master_user='root', master_use_gtid=slave_pos;
+
+START SLAVE UNTIL MASTER_GTID_POS='0-1-102';
+
+--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit"
+--source include/wait_condition.inc
+SET DEBUG_SYNC = 'now SIGNAL continue_worker';
+
+--echo # Normal stop is expected
+--source include/wait_for_slave_to_stop.inc
+
+--echo # MDEV-31077 ALTER SEQUENCE may end up in optimistic parallel slave binlog out-of-order
+--echo # The test proves ALTER-SEQUENCE binlogs first before the following transaction does so.
+
+--connection slave
+--source include/stop_slave.inc
+RESET MASTER;
+SET @@global.gtid_slave_pos="";
+--let $slave_gtid_strict_mode=`select @@global.gtid_strict_mode`
+SET @@global.gtid_strict_mode=1;
+--connection master
+RESET MASTER;
+
+# Load from master
+CREATE TABLE ti (a INT) ENGINE=innodb;
+CREATE SEQUENCE s2 ENGINE=innodb;
+
+SET @@gtid_seq_no=100;
+ALTER SEQUENCE s2 restart with 1;
+INSERT INTO ti SET a=1;
+--source include/save_master_gtid.inc
+SELECT @@global.gtid_binlog_state "Master gtid state";
+
+--connection slave
+--source include/start_slave.inc
+
+--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit"
+--source include/wait_condition.inc
+
+SELECT @@global.gtid_binlog_state, @@global.gtid_slave_pos as "no 100,101 yet in both";
+
+# DEBUG_DBUG extension point of hold_worker_on_schedule is reused
+# (gets deployed) in Sql_cmd_alter_sequence::execute.
+SET DEBUG_SYNC = 'now SIGNAL continue_worker';
+
+--echo # Normal sync with master proves the fixes correct
+--source include/sync_with_master_gtid.inc
+
+SELECT @@global.gtid_binlog_state, @@global.gtid_slave_pos as "all through 101 have been committed";
+
+#
+# MDEV-29621/MDEV-31077 clean up.
+#
+--connection slave
+--source include/stop_slave.inc
+
+SET debug_sync = RESET;
+--eval SET @@global.slave_parallel_threads= $slave_parallel_threads
+--eval SET @@global.slave_parallel_mode= $slave_parallel_mode
+ SET @@global.debug_dbug = "";
+--eval SET @@global.gtid_strict_mode=$slave_gtid_strict_mode
+--source include/start_slave.inc
+
+--connection master
+DROP SEQUENCE s2;
+DROP TABLE ti;
+
+--sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test b/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
index 8c8892d5370..cddc9286bd2 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
@@ -1 +1,38 @@
---source include/rpl_parallel_show_binlog_events_purge_logs.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+# BUG#13979418: SHOW BINLOG EVENTS MAY CRASH THE SERVER
+#
+# The function mysql_show_binlog_events has a local stack variable
+# 'LOG_INFO linfo;', which is assigned to thd->current_linfo, however
+# this variable goes out of scope and is destroyed before clean
+# thd->current_linfo.
+#
+# This test case runs SHOW BINLOG EVENTS and FLUSH LOGS to make sure
+# that with the fix local variable linfo is valid along all
+# mysql_show_binlog_events function scope.
+#
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/master-slave.inc
+
+--connection slave
+SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end';
+--send SHOW BINLOG EVENTS
+
+--connection slave1
+SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events';
+FLUSH LOGS;
+SET DEBUG_SYNC= 'now SIGNAL end';
+
+--connection slave
+--disable_result_log
+--reap
+--enable_result_log
+SET DEBUG_SYNC= 'RESET';
+
+--connection master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_relayrotate.test b/mysql-test/suite/rpl/t/rpl_relayrotate.test
index 720739e14c0..4de554d3143 100644
--- a/mysql-test/suite/rpl/t/rpl_relayrotate.test
+++ b/mysql-test/suite/rpl/t/rpl_relayrotate.test
@@ -1 +1,18 @@
---source include/rpl_relayrotate.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#######################################################
+# Wrapper for rpl_relayrotate.test to allow multi #
+# Engines to reuse test code. By JBM 2006-02-15 #
+#######################################################
+-- source include/have_innodb.inc
+# Slow test, don't run during staging part
+-- source include/not_staging.inc
+-- source include/master-slave.inc
+
+let $engine_type=innodb;
+-- source suite/rpl/include/rpl_relayrotate.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test b/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test
index 44c04dd62d3..7decd130a43 100644
--- a/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test
+++ b/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test
@@ -3,10 +3,10 @@
# For details look into extra/rpl_tests/rpl_lower_case_table_names.test
#
--- source include/master-slave.inc
--- source include/have_innodb.inc
-- source include/not_windows.inc
+-- source include/have_innodb.inc
-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
-- let $engine=InnoDB
-- source include/rpl_lower_case_table_names.test
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test
index 5c17bcb2344..720ec059350 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test
@@ -1 +1,532 @@
---source include/rpl_semi_sync.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+source include/not_embedded.inc;
+source include/have_innodb.inc;
+source include/master-slave.inc;
+
+let $engine_type= InnoDB;
+
+# Suppress warnings that might be generated during the test
+connection master;
+call mtr.add_suppression("Timeout waiting for reply of binlog");
+call mtr.add_suppression("Read semi-sync reply");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
+call mtr.add_suppression("mysqld: Got an error reading communication packets");
+connection slave;
+# While 'Current_Pos' exists as an option for Using_Gtd, keeping these
+# events in the binlog will update gtid_binlog_pos, and the later calls to
+# set `@@global.gtid_slave_pos= ""` will provide warning messages with
+# inconsistent GTID values because the seq_nos are non-deterministic with
+# the masters events coming in concurrently
+set sql_log_bin=0;
+call mtr.add_suppression("Master server does not support semi-sync");
+call mtr.add_suppression("Semi-sync slave .* reply");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+set sql_log_bin=1;
+connection master;
+
+# wait for dying connections (if any) to disappear
+let $wait_condition= select count(*) = 0 from information_schema.processlist where command='killed';
+--source include/wait_condition.inc
+
+# After fix of BUG#45848, semi-sync slave should not create any extra
+# connections on master, save the count of connections before start
+# semi-sync slave for comparison below.
+let $_connections_normal_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
+
+--echo #
+--echo # Uninstall semi-sync plugins on master and slave
+--echo #
+connection slave;
+source include/stop_slave.inc;
+--source include/reset_slave.inc
+set global rpl_semi_sync_master_enabled= 0;
+set global rpl_semi_sync_slave_enabled= 0;
+
+connection master;
+reset master;
+set global rpl_semi_sync_master_enabled= 0;
+set global rpl_semi_sync_slave_enabled= 0;
+
+--echo #
+--echo # Main test of semi-sync replication start here
+--echo #
+
+connection master;
+
+set global rpl_semi_sync_master_timeout= 60000; # 60s
+
+echo [ default state of semi-sync on master should be OFF ];
+show variables like 'rpl_semi_sync_master_enabled';
+
+echo [ enable semi-sync on master ];
+set global rpl_semi_sync_master_enabled = 1;
+show variables like 'rpl_semi_sync_master_enabled';
+
+echo [ status of semi-sync on master should be ON even without any semi-sync slaves ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+--echo #
+--echo # BUG#45672 Semisync repl: ActiveTranx:insert_tranx_node: transaction node allocation failed
+--echo # BUG#45673 Semisynch reports correct operation even if no slave is connected
+--echo #
+
+# BUG#45672 When semi-sync is enabled on master, it would allocate
+# transaction node even without semi-sync slave connected, and would
+# finally result in transaction node allocation error.
+#
+# Semi-sync master will pre-allocate 'max_connections' transaction
+# nodes, so here we do more than that much transactions to check if it
+# will fail or not.
+# select @@global.max_connections + 1;
+let $i= `select @@global.max_connections + 1`;
+disable_query_log;
+eval create table t1 (a int) engine=$engine_type;
+while ($i)
+{
+ eval insert into t1 values ($i);
+ dec $i;
+}
+drop table t1;
+enable_query_log;
+
+# BUG#45673
+echo [ status of semi-sync on master should be OFF ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+# reset master to make sure the following test will start with a clean environment
+reset master;
+
+connection slave;
+
+echo [ default state of semi-sync on slave should be OFF ];
+show variables like 'rpl_semi_sync_slave_enabled';
+
+echo [ enable semi-sync on slave ];
+set global rpl_semi_sync_slave_enabled = 1;
+show variables like 'rpl_semi_sync_slave_enabled';
+source include/start_slave.inc;
+
+connection master;
+
+# NOTE: Rpl_semi_sync_master_client will only be updated when
+# semi-sync slave has started binlog dump request
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+
+echo [ initial master state after the semi-sync slave connected ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+replace_result $engine_type ENGINE_TYPE;
+eval create table t1(a int) engine = $engine_type;
+
+echo [ master state after CREATE TABLE statement ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+# After fix of BUG#45848, semi-sync slave should not create any extra
+# connections on master.
+let $_connections_semisync_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
+replace_result $_connections_normal_slave CONNECTIONS_NORMAL_SLAVE $_connections_semisync_slave CONNECTIONS_SEMISYNC_SLAVE;
+eval select $_connections_semisync_slave - $_connections_normal_slave as 'Should be 0';
+
+echo [ insert records to table ];
+insert t1 values (10);
+insert t1 values (9);
+insert t1 values (8);
+insert t1 values (7);
+insert t1 values (6);
+insert t1 values (5);
+insert t1 values (4);
+insert t1 values (3);
+insert t1 values (2);
+insert t1 values (1);
+
+echo [ master status after inserts ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+sync_slave_with_master;
+
+echo [ slave status after replicated inserts ];
+show status like 'Rpl_semi_sync_slave_status';
+
+select count(distinct a) from t1;
+select min(a) from t1;
+select max(a) from t1;
+
+--echo
+--echo # BUG#50157
+--echo # semi-sync replication crashes when replicating a transaction which
+--echo # include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ;
+
+connection master;
+SET SESSION AUTOCOMMIT= 0;
+CREATE TABLE t2(c1 INT) ENGINE=innodb;
+sync_slave_with_master;
+
+connection master;
+BEGIN;
+--echo
+--echo # Even though it is in a transaction, this statement is binlogged into binlog
+--echo # file immediately.
+--disable_warnings
+CREATE TEMPORARY TABLE t3 SELECT c1 FROM t2 where 1=1;
+--enable_warnings
+--echo
+--echo # These statements will not be binlogged until the transaction is committed
+INSERT INTO t2 VALUES(11);
+INSERT INTO t2 VALUES(22);
+COMMIT;
+
+DROP TABLE t2, t3;
+SET SESSION AUTOCOMMIT= 1;
+sync_slave_with_master;
+
+
+--echo #
+--echo # Test semi-sync master will switch OFF after one transaction
+--echo # timeout waiting for slave reply.
+--echo #
+connection slave;
+source include/stop_slave.inc;
+
+connection master;
+--source include/kill_binlog_dump_threads.inc
+set global rpl_semi_sync_master_timeout= 5000;
+
+# The first semi-sync check should be on because after slave stop,
+# there are no transactions on the master.
+echo [ master status should be ON ];
+
+let $status_var= Rpl_semi_sync_master_status;
+let $status_var_value= ON;
+source include/wait_for_status_var.inc;
+
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 0;
+source include/wait_for_status_var.inc;
+
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+echo [ semi-sync replication of these transactions will fail ];
+insert into t1 values (500);
+
+# Wait for the semi-sync replication of this transaction to timeout
+let $status_var= Rpl_semi_sync_master_status;
+let $status_var_value= OFF;
+source include/wait_for_status_var.inc;
+
+# The second semi-sync check should be off because one transaction
+# times out during waiting.
+echo [ master status should be OFF ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+# Semi-sync status on master is now OFF, so all these transactions
+# will be replicated asynchronously.
+delete from t1 where a=10;
+delete from t1 where a=9;
+delete from t1 where a=8;
+delete from t1 where a=7;
+delete from t1 where a=6;
+delete from t1 where a=5;
+delete from t1 where a=4;
+delete from t1 where a=3;
+delete from t1 where a=2;
+delete from t1 where a=1;
+
+insert into t1 values (100);
+
+echo [ master status should be OFF ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+--echo #
+--echo # Test semi-sync status on master will be ON again when slave catches up
+--echo #
+
+# Save the master position for later use.
+save_master_pos;
+
+connection slave;
+
+echo [ slave status should be OFF ];
+show status like 'Rpl_semi_sync_slave_status';
+source include/start_slave.inc;
+sync_with_master;
+
+echo [ slave status should be ON ];
+show status like 'Rpl_semi_sync_slave_status';
+
+select count(distinct a) from t1;
+select min(a) from t1;
+select max(a) from t1;
+
+connection master;
+
+# The master semi-sync status should be on again after slave catches up.
+echo [ master status should be ON again after slave catches up ];
+
+let $status_var= Rpl_semi_sync_master_status;
+let $status_var_value= ON;
+source include/wait_for_status_var.inc;
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+show status like 'Rpl_semi_sync_master_clients';
+
+--echo #
+--echo # Test disable/enable master semi-sync on the fly.
+--echo #
+
+drop table t1;
+sync_slave_with_master;
+
+source include/stop_slave.inc;
+
+--echo #
+--echo # Flush status
+--echo #
+connection master;
+echo [ Semi-sync master status variables before FLUSH STATUS ];
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
+# Do not write the FLUSH STATUS to binlog, to make sure we'll get a
+# clean status after this.
+FLUSH NO_WRITE_TO_BINLOG STATUS;
+echo [ Semi-sync master status variables after FLUSH STATUS ];
+SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
+SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
+
+connection master;
+
+source include/show_master_logs.inc;
+show variables like 'rpl_semi_sync_master_enabled';
+
+echo [ disable semi-sync on the fly ];
+set global rpl_semi_sync_master_enabled=0;
+show variables like 'rpl_semi_sync_master_enabled';
+show status like 'Rpl_semi_sync_master_status';
+
+echo [ enable semi-sync on the fly ];
+set global rpl_semi_sync_master_enabled=1;
+show variables like 'rpl_semi_sync_master_enabled';
+show status like 'Rpl_semi_sync_master_status';
+
+--echo #
+--echo # Test RESET MASTER/SLAVE
+--echo #
+
+connection slave;
+
+source include/start_slave.inc;
+
+connection master;
+
+replace_result $engine_type ENGINE_TYPE;
+eval create table t1 (a int) engine = $engine_type;
+drop table t1;
+
+sync_slave_with_master;
+
+echo [ test reset master ];
+connection master;
+
+reset master;
+
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+connection slave;
+
+source include/stop_slave.inc;
+--source include/reset_slave.inc
+
+# Kill the dump thread on master for previous slave connection and
+--source include/kill_binlog_dump_threads.inc
+
+connection slave;
+source include/start_slave.inc;
+
+connection master;
+
+# Wait for dump thread to start, Rpl_semi_sync_master_clients will be
+# 1 after dump thread started.
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+
+replace_result $engine_type ENGINE_TYPE;
+eval create table t1 (a int) engine = $engine_type;
+insert into t1 values (1);
+insert into t1 values (2), (3);
+
+sync_slave_with_master;
+
+select * from t1;
+
+connection master;
+
+echo [ master semi-sync status should be ON ];
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+--echo #
+--echo # Start semi-sync replication without SUPER privilege
+--echo #
+connection slave;
+source include/stop_slave.inc;
+--source include/reset_slave.inc
+connection master;
+reset master;
+
+# Kill the dump thread on master for previous slave connection and wait for it to exit
+--source include/kill_binlog_dump_threads.inc
+
+# Do not binlog the following statement because it will generate
+# different events for ROW and STATEMENT format
+set sql_log_bin=0;
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
+flush privileges;
+set sql_log_bin=1;
+connection slave;
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
+flush privileges;
+change master to master_user='rpl',master_password='rpl_password';
+source include/start_slave.inc;
+show status like 'Rpl_semi_sync_slave_status';
+connection master;
+
+# Wait for the semi-sync binlog dump thread to start
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+echo [ master semi-sync should be ON ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+insert into t1 values (4);
+insert into t1 values (5);
+echo [ master semi-sync should be ON ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+show status like 'Rpl_semi_sync_master_no_tx';
+show status like 'Rpl_semi_sync_master_yes_tx';
+
+--echo #
+--echo # Test semi-sync slave connect to non-semi-sync master
+--echo #
+
+# Disable semi-sync on master
+connection slave;
+source include/stop_slave.inc;
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+
+connection master;
+
+# Kill the dump thread on master for previous slave connection and wait for it to exit
+--source include/kill_binlog_dump_threads.inc
+
+echo [ Semi-sync status on master should be ON ];
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 0;
+source include/wait_for_status_var.inc;
+show status like 'Rpl_semi_sync_master_status';
+let $status_var= Rpl_semi_sync_master_status;
+let $status_var_value= ON;
+source include/wait_for_status_var.inc;
+set global rpl_semi_sync_master_enabled= 0;
+
+connection slave;
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+source include/start_slave.inc;
+connection master;
+insert into t1 values (8);
+let $status_var= Rpl_semi_sync_master_clients;
+let $status_var_value= 1;
+source include/wait_for_status_var.inc;
+echo [ master semi-sync clients should be 1, status should be OFF ];
+show status like 'Rpl_semi_sync_master_clients';
+show status like 'Rpl_semi_sync_master_status';
+sync_slave_with_master;
+show status like 'Rpl_semi_sync_slave_status';
+
+# Uninstall semi-sync plugin on master
+connection slave;
+source include/stop_slave.inc;
+connection master;
+set global rpl_semi_sync_master_enabled= 0;
+
+connection slave;
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+source include/start_slave.inc;
+
+connection master;
+insert into t1 values (10);
+sync_slave_with_master;
+
+--echo #
+--echo # Test non-semi-sync slave connect to semi-sync master
+--echo #
+
+connection master;
+set global rpl_semi_sync_master_timeout= 5000; # 5s
+set global rpl_semi_sync_master_enabled= 1;
+
+connection slave;
+source include/stop_slave.inc;
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+
+echo [ uninstall semi-sync slave plugin ];
+set global rpl_semi_sync_slave_enabled= 0;
+
+echo [ reinstall semi-sync slave plugin and disable semi-sync ];
+SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+source include/start_slave.inc;
+SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
+
+--echo #
+--echo # Clean up
+--echo #
+
+connection slave;
+source include/stop_slave.inc;
+set global rpl_semi_sync_slave_enabled= 0;
+
+connection master;
+set global rpl_semi_sync_master_enabled= 0;
+
+connection slave;
+change master to master_user='root',master_password='';
+source include/start_slave.inc;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+connection master;
+drop user rpl@127.0.0.1;
+flush privileges;
+set global rpl_semi_sync_master_timeout= default;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
index 7a7e1c1e074..d4df9b4041b 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
@@ -1,7 +1,7 @@
+source include/no_valgrind_without_big.inc;
source include/not_embedded.inc;
source include/have_innodb.inc;
source include/master-slave.inc;
-source include/no_valgrind_without_big.inc;
let $engine_type= InnoDB;
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test b/mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test
index dcff4030fdb..5eae91a55f2 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test
@@ -23,8 +23,6 @@ SET @@global.rpl_semi_sync_master_wait_no_slave = 1;
--echo # It's okay to see "Killed" but we should not see "Timeout" in the log.
call mtr.add_suppression("Killed waiting for reply of binlog");
-call mtr.add_suppression("Run function 'after_commit' in plugin 'rpl_semi_sync_master' failed");
-call mtr.add_suppression("Run function 'after_sync' in plugin 'rpl_semi_sync_master' failed");
--echo #
--echo # Test wait point = AFTER_COMMIT
diff --git a/mysql-test/suite/rpl/t/rpl_skip_replication.test b/mysql-test/suite/rpl/t/rpl_skip_replication.test
index 66fdbb8915a..d1044c4bf51 100644
--- a/mysql-test/suite/rpl/t/rpl_skip_replication.test
+++ b/mysql-test/suite/rpl/t/rpl_skip_replication.test
@@ -1 +1,408 @@
---source include/rpl_skip_replication.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it.
+#
+# Usage:
+#
+# --let $use_remote_mysqlbinlog= 1 # optional
+# --source suite/rpl/include/rpl_skip_replication.inc
+#
+# The script uses MYSQLBINLOG to verify certain results.
+# By default, it uses binary logs directly. If it is undesirable,
+# this behavior can be overridden by setting $use_remote_binlog
+# as shown above.
+# The value will be unset after every execution of the script,
+# so if it is needed, it should be set explicitly before each call.
+#
+
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+--connection slave
+--source include/stop_slave.inc
+CHANGE MASTER TO MASTER_USE_GTID=NO;
+--source include/start_slave.inc
+--connection master
+
+connection slave;
+# Test that SUPER is required to change @@replicate_events_marked_for_skip.
+CREATE USER 'nonsuperuser'@'127.0.0.1';
+GRANT ALTER,CREATE,DELETE,DROP,EVENT,INSERT,PROCESS,REPLICATION SLAVE,
+ SELECT,UPDATE ON *.* TO 'nonsuperuser'@'127.0.0.1';
+connect(nonpriv, 127.0.0.1, nonsuperuser,, test, $SLAVE_MYPORT,);
+connection nonpriv;
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+disconnect nonpriv;
+connection slave;
+DROP USER'nonsuperuser'@'127.0.0.1';
+
+SELECT @@global.replicate_events_marked_for_skip;
+--error ER_SLAVE_MUST_STOP
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
+SELECT @@global.replicate_events_marked_for_skip;
+STOP SLAVE;
+--error ER_GLOBAL_VARIABLE
+SET SESSION replicate_events_marked_for_skip=FILTER_ON_MASTER;
+SELECT @@global.replicate_events_marked_for_skip;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+SELECT @@global.replicate_events_marked_for_skip;
+START SLAVE;
+
+connection master;
+SELECT @@skip_replication;
+--error ER_LOCAL_VARIABLE
+SET GLOBAL skip_replication=1;
+SELECT @@skip_replication;
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=innodb;
+INSERT INTO t1(a) VALUES (1);
+INSERT INTO t2(a) VALUES (1);
+
+
+# Test that master-side filtering works.
+SET skip_replication=1;
+
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+INSERT INTO t1(a) VALUES (2);
+INSERT INTO t2(a) VALUES (2);
+
+# Inject a rotate event in the binlog stream sent to slave (otherwise we will
+# fail sync_slave_with_master as the last event on the master is not present
+# on the slave).
+FLUSH NO_WRITE_TO_BINLOG LOGS;
+
+sync_slave_with_master;
+connection slave;
+SHOW TABLES;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+connection master;
+DROP TABLE t3;
+
+FLUSH NO_WRITE_TO_BINLOG LOGS;
+sync_slave_with_master;
+
+
+# Test that slave-side filtering works.
+connection slave;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
+START SLAVE;
+
+connection master;
+SET skip_replication=1;
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+INSERT INTO t1(a) VALUES (3);
+INSERT INTO t2(a) VALUES (3);
+
+# Inject a rotate event in the binlog stream sent to slave (otherwise we will
+# fail sync_slave_with_master as the last event on the master is not present
+# on the slave).
+FLUSH NO_WRITE_TO_BINLOG LOGS;
+
+sync_slave_with_master;
+connection slave;
+SHOW TABLES;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+connection master;
+DROP TABLE t3;
+
+FLUSH NO_WRITE_TO_BINLOG LOGS;
+sync_slave_with_master;
+connection slave;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
+START SLAVE;
+
+
+# Test that events with @@skip_replication=1 are not filtered when filtering is
+# not set on slave.
+connection master;
+SET skip_replication=1;
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+INSERT INTO t3(a) VALUES(2);
+sync_slave_with_master;
+connection slave;
+SELECT * FROM t3;
+connection master;
+DROP TABLE t3;
+
+#
+# Test that the slave will preserve the @@skip_replication flag in its
+# own binlog.
+#
+
+TRUNCATE t1;
+sync_slave_with_master;
+connection slave;
+RESET MASTER;
+
+connection master;
+SET skip_replication=0;
+INSERT INTO t1 VALUES (1,0);
+SET skip_replication=1;
+INSERT INTO t1 VALUES (2,0);
+SET skip_replication=0;
+INSERT INTO t1 VALUES (3,0);
+
+sync_slave_with_master;
+connection slave;
+# Since slave has @@replicate_events_marked_for_skip=REPLICATE, it should have
+# applied all events.
+SELECT * FROM t1 ORDER by a;
+
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+let $SLAVE_DATADIR= `select @@datadir`;
+
+connection master;
+TRUNCATE t1;
+
+# Now apply the slave binlog to the master, to check that both the slave
+# and mysqlbinlog will preserve the @@skip_replication flag.
+
+--let $mysqlbinlog_args= $SLAVE_DATADIR/slave-bin.000001
+if ($use_remote_mysqlbinlog)
+{
+ --let $mysqlbinlog_args= --read-from-remote-server --protocol=tcp --host=127.0.0.1 --port=$SLAVE_MYPORT -uroot slave-bin.000001
+ --let $use_remote_mysqlbinlog= 0
+}
+--exec $MYSQL_BINLOG $mysqlbinlog_args > $MYSQLTEST_VARDIR/tmp/rpl_skip_replication.binlog
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/rpl_skip_replication.binlog
+
+# The master should have all three events.
+SELECT * FROM t1 ORDER by a;
+
+# The slave should be missing event 2, which is marked with the
+# @@skip_replication flag.
+
+connection slave;
+START SLAVE;
+
+connection master;
+sync_slave_with_master;
+
+connection slave;
+SELECT * FROM t1 ORDER by a;
+
+#
+# Test that @@sql_slave_skip_counter does not count skipped @@skip_replication
+# events.
+#
+
+connection master;
+TRUNCATE t1;
+
+sync_slave_with_master;
+connection slave;
+STOP SLAVE;
+# We will skip two INSERTs (in addition to any skipped due to
+# @@skip_replication). Since from 5.5 every statement is wrapped in
+# BEGIN ... END, we need to skip 6 events for this.
+SET GLOBAL sql_slave_skip_counter=6;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
+START SLAVE;
+
+connection master;
+# Need to fix @@binlog_format to get consistent event count.
+SET @old_binlog_format= @@binlog_format;
+SET binlog_format= statement;
+SET skip_replication=0;
+INSERT INTO t1 VALUES (1,5);
+SET skip_replication=1;
+INSERT INTO t1 VALUES (2,5);
+SET skip_replication=0;
+INSERT INTO t1 VALUES (3,5);
+INSERT INTO t1 VALUES (4,5);
+SET binlog_format= @old_binlog_format;
+
+sync_slave_with_master;
+connection slave;
+
+# The slave should have skipped the first three inserts (number 1 and 3 due
+# to @@sql_slave_skip_counter=2, number 2 due to
+# @@replicate_events_marked_for_skip=FILTER_ON_SLAVE). So only number 4
+# should be left.
+SELECT * FROM t1;
+
+
+#
+# Check that BINLOG statement preserves the @@skip_replication flag.
+#
+connection slave;
+# Need row @@binlog_format for BINLOG statements containing row events.
+--source include/stop_slave.inc
+SET @old_slave_binlog_format= @@global.binlog_format;
+SET GLOBAL binlog_format= row;
+--source include/start_slave.inc
+
+connection master;
+TRUNCATE t1;
+
+SET @old_binlog_format= @@binlog_format;
+SET binlog_format= row;
+# Format description log event.
+BINLOG 'wlZOTw8BAAAA8QAAAPUAAAAAAAQANS41LjIxLU1hcmlhREItZGVidWctbG9nAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAA2QAEGggAAAAICAgCAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAA371saA==';
+# INSERT INTO t1 VALUES (1,8) # with @@skip_replication=1
+BINLOG 'wlZOTxMBAAAAKgAAAGMBAAAAgCkAAAAAAAEABHRlc3QAAnQxAAIDAwAC
+wlZOTxcBAAAAJgAAAIkBAAAAgCkAAAAAAAEAAv/8AQAAAAgAAAA=';
+# INSERT INTO t1 VALUES (2,8) # with @@skip_replication=0
+BINLOG 'wlZOTxMBAAAAKgAAADwCAAAAACkAAAAAAAEABHRlc3QAAnQxAAIDAwAC
+wlZOTxcBAAAAJgAAAGICAAAAACkAAAAAAAEAAv/8AgAAAAgAAAA=';
+SET binlog_format= @old_binlog_format;
+
+SELECT * FROM t1 ORDER BY a;
+sync_slave_with_master;
+connection slave;
+# Slave should have only the second insert, the first should be ignored due to
+# the @@skip_replication flag.
+SELECT * FROM t1 ORDER by a;
+
+--source include/stop_slave.inc
+SET GLOBAL binlog_format= @old_slave_binlog_format;
+--source include/start_slave.inc
+
+
+# Test that it is not possible to change @@skip_replication inside a
+# transaction or statement, thereby replicating only parts of statements
+# or transactions.
+connection master;
+SET skip_replication=0;
+
+BEGIN;
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET skip_replication=0;
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET skip_replication=1;
+ROLLBACK;
+SET skip_replication=1;
+BEGIN;
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET skip_replication=0;
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET skip_replication=1;
+COMMIT;
+SET autocommit=0;
+INSERT INTO t2(a) VALUES(100);
+--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET skip_replication=1;
+ROLLBACK;
+SET autocommit=1;
+
+SET skip_replication=1;
+--delimiter |
+CREATE FUNCTION foo (x INT) RETURNS INT BEGIN SET SESSION skip_replication=x; RETURN x; END|
+CREATE PROCEDURE bar(x INT) BEGIN SET SESSION skip_replication=x; END|
+CREATE FUNCTION baz (x INT) RETURNS INT BEGIN CALL bar(x); RETURN x; END|
+--delimiter ;
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SELECT foo(0);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SELECT baz(0);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET @a= foo(1);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+SET @a= baz(1);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+UPDATE t2 SET b=foo(0);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+UPDATE t2 SET b=baz(0);
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+INSERT INTO t1 VALUES (101, foo(1));
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
+INSERT INTO t1 VALUES (101, baz(0));
+SELECT @@skip_replication;
+CALL bar(0);
+SELECT @@skip_replication;
+CALL bar(1);
+SELECT @@skip_replication;
+DROP FUNCTION foo;
+DROP PROCEDURE bar;
+DROP FUNCTION baz;
+
+
+# Test that master-side filtering happens on the master side, and that
+# slave-side filtering happens on the slave.
+
+# First test that events do not reach the slave when master-side filtering
+# is configured. Do this by replicating first with only the IO thread running
+# and master-side filtering; then change to no filtering and start the SQL
+# thread. This should still skip the events, as master-side filtering
+# means the events never reached the slave.
+connection master;
+SET skip_replication= 0;
+TRUNCATE t1;
+sync_slave_with_master;
+connection slave;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+START SLAVE IO_THREAD;
+connection master;
+SET skip_replication= 1;
+INSERT INTO t1(a) VALUES (1);
+SET skip_replication= 0;
+INSERT INTO t1(a) VALUES (2);
+--source include/save_master_pos.inc
+connection slave;
+--source include/sync_io_with_master.inc
+STOP SLAVE IO_THREAD;
+SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
+START SLAVE;
+connection master;
+sync_slave_with_master;
+connection slave;
+# Now only the second insert of (2) should be visible, as the first was
+# filtered on the master, so even though the SQL thread ran without skipping
+# events, it will never see the event in the first place.
+SELECT * FROM t1;
+
+# Now tests that when slave-side filtering is configured, events _do_ reach
+# the slave.
+connection master;
+SET skip_replication= 0;
+TRUNCATE t1;
+sync_slave_with_master;
+connection slave;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
+START SLAVE IO_THREAD;
+connection master;
+SET skip_replication= 1;
+INSERT INTO t1(a) VALUES (1);
+SET skip_replication= 0;
+INSERT INTO t1(a) VALUES (2);
+--source include/save_master_pos.inc
+connection slave;
+--source include/sync_io_with_master.inc
+STOP SLAVE IO_THREAD;
+SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
+START SLAVE;
+connection master;
+sync_slave_with_master;
+connection slave;
+# Now both inserts should be visible. Since filtering was configured to be
+# slave-side, the event is in the relay log, and when the SQL thread ran we
+# had disabled filtering again.
+SELECT * FROM t1 ORDER BY a;
+
+
+# Clean up.
+connection master;
+SET skip_replication=0;
+DROP TABLE t1,t2;
+connection slave;
+STOP SLAVE;
+SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
+START SLAVE;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_special_charset.test b/mysql-test/suite/rpl/t/rpl_special_charset.test
index fa19a17b1e4..641aa483d32 100644
--- a/mysql-test/suite/rpl/t/rpl_special_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_special_charset.test
@@ -1 +1,32 @@
---source include/rpl_special_charset.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+################################################################################
+# Bug#19855907 IO THREAD AUTHENTICATION ISSUE WITH SOME CHARACTER SETS
+# Problem: IO thread fails to connect to master if servers are configured with
+# special character sets like utf16, utf32, ucs2.
+#
+# Analysis: MySQL server does not support few special character sets like
+# utf16,utf32 and ucs2 as "client's character set"(eg: utf16,utf32, ucs2).
+# When IO thread is trying to connect to Master, it sets server's character
+# set as client's character set. When Slave server is started with these
+# special character sets, IO thread (a connection to Master) fails because
+# of the above said reason.
+#
+# Fix: If server's character set is not supported as client's character set,
+# then set default's client character set(latin1) as client's character set.
+###############################################################################
+--source include/master-slave.inc
+call mtr.add_suppression("'utf16' can not be used as client character set");
+CREATE TABLE t1(i VARCHAR(20));
+INSERT INTO t1 VALUES (0xFFFF);
+--sync_slave_with_master
+--let diff_tables=master:t1, slave:t1
+--source include/diff_tables.inc
+# Cleanup
+--connection master
+DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sporadic_master.test b/mysql-test/suite/rpl/t/rpl_sporadic_master.test
index 397756af396..ad4c44cbf74 100644
--- a/mysql-test/suite/rpl/t/rpl_sporadic_master.test
+++ b/mysql-test/suite/rpl/t/rpl_sporadic_master.test
@@ -1 +1,32 @@
---source include/rpl_sporadic_master.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+# test to see if replication can continue when master sporadically fails on
+# COM_BINLOG_DUMP and additionally limits the number of events per dump
+
+source include/master-slave.inc;
+
+create table t2(n int);
+create table t1(n int not null auto_increment primary key);
+insert into t1 values (NULL),(NULL);
+truncate table t1;
+# We have to use 4 in the following to make this test work with all table types
+insert into t1 values (4),(NULL);
+sync_slave_with_master;
+--source include/stop_slave.inc
+--source include/start_slave.inc
+connection master;
+insert into t1 values (NULL),(NULL);
+flush logs;
+truncate table t1;
+insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL);
+sync_slave_with_master;
+select * from t1 ORDER BY n;
+connection master;
+drop table t1,t2;
+sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test
index c4a534b9294..0420a6c8c2d 100644
--- a/mysql-test/suite/rpl/t/rpl_ssl.test
+++ b/mysql-test/suite/rpl/t/rpl_ssl.test
@@ -1 +1,116 @@
---source include/rpl_ssl.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+source include/no_valgrind_without_big.inc;
+source include/have_ssl_communication.inc;
+source include/master-slave.inc;
+
+# create a user for replication that requires ssl encryption
+connection master;
+create user replssl@localhost;
+grant replication slave on *.* to replssl@localhost require ssl;
+create table t1 (t int auto_increment, KEY(t));
+
+sync_slave_with_master;
+
+# Set slave to use SSL for connection to master
+stop slave;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+eval change master to
+ master_user='replssl',
+ master_password='',
+ master_ssl=1,
+ master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem',
+ master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem',
+ master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem';
+start slave;
+
+# Switch to master and insert one record, then sync it to slave
+connection master;
+insert into t1 values(1);
+sync_slave_with_master;
+
+# The record should now be on slave
+select * from t1;
+
+# The slave is synced and waiting/reading from master
+# SHOW SLAVE STATUS will show "Waiting for master to send event"
+let $status_items= Master_SSL_Allowed, Master_SSL_CA_Path, Master_SSL_CA_File, Master_SSL_Crl, Master_SSL_Crlpath, Master_SSL_Cert, Master_SSL_Key;
+source include/show_slave_status.inc;
+source include/check_slave_is_running.inc;
+
+# Stop the slave, as reported in bug#21871 it would hang
+STOP SLAVE;
+
+select * from t1;
+
+# Do the same thing a number of times
+disable_query_log;
+disable_result_log;
+# 2007-11-27 mats Bug #32756 Starting and stopping the slave in a loop can lose rows
+# After discussions with Engineering, I'm disabling this part of the test to avoid it causing
+# red trees.
+disable_parsing;
+let $i= 100;
+while ($i)
+{
+ start slave;
+ connection master;
+ insert into t1 values (NULL);
+ select * from t1; # Some variance
+ connection slave;
+ select * from t1; # Some variance
+ stop slave;
+ dec $i;
+}
+enable_parsing;
+START SLAVE;
+enable_query_log;
+enable_result_log;
+connection master;
+# INSERT one more record to make sure
+# the sync has something to do
+insert into t1 values (NULL);
+let $master_count= `select count(*) from t1`;
+
+sync_slave_with_master;
+--source include/wait_for_slave_to_start.inc
+source include/show_slave_status.inc;
+source include/check_slave_is_running.inc;
+
+let $slave_count= `select count(*) from t1`;
+
+if ($slave_count != $master_count)
+{
+ echo master and slave differed in number of rows;
+ echo master: $master_count;
+ echo slave: $slave_count;
+
+ connection master;
+ select count(*) t1;
+ select * from t1;
+ connection slave;
+ select count(*) t1;
+ select * from t1;
+ query_vertical show slave status;
+}
+
+connection master;
+drop user replssl@localhost;
+drop table t1;
+sync_slave_with_master;
+
+--source include/stop_slave.inc
+CHANGE MASTER TO
+ master_user = 'root',
+ master_ssl = 0,
+ master_ssl_ca = '',
+ master_ssl_cert = '',
+ master_ssl_key = '';
+
+--echo End of 5.0 tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test b/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test
index 619b57994c2..3809cd89e4a 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test
@@ -3,10 +3,10 @@
# For details look into extra/rpl_tests/rpl_lower_case_table_names.test
#
+-- source include/not_windows.inc
+-- source include/have_innodb.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/master-slave.inc
--- source include/have_innodb.inc
--- source include/not_windows.inc
-- let $engine=InnoDB
-- source include/rpl_lower_case_table_names.test
diff --git a/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test b/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test
index b4e53358712..654a5d47cb9 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test
@@ -1 +1,107 @@
---source include/rpl_stm_relay_ign_space.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#
+# BUG#12400313 / BUG#64503 test case
+#
+#
+# Description
+# -----------
+#
+# This test case starts the slave server with:
+# --relay-log-space-limit=8192 --relay-log-purge --max-relay-log-size=4096
+#
+# Then it issues some queries that will cause the slave to reach
+# relay-log-space-limit. We lock the table so that the SQL thread is
+# not able to purge the log and then we issue some more statements.
+#
+# The purpose is to show that the IO thread will honor the limits
+# while the SQL thread is not able to purge the relay logs, which did
+# not happen before this patch. In addition we assert that while
+# ignoring the limit (SQL thread needs to rotate before purging), the
+# IO thread does not do it in an uncontrolled manner.
+
+--source include/have_binlog_format_statement.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+--disable_query_log
+CREATE TABLE t1 (c1 TEXT) engine=InnoDB;
+
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+
+--sync_slave_with_master
+
+# wait for the SQL thread to sleep
+--let $show_statement= SHOW PROCESSLIST
+--let $field= State
+--let $condition= = 'Slave has read all relay log; waiting for more updates'
+--source include/wait_show_condition.inc
+
+# now the io thread has set rli->ignore_space_limit
+# lets lock the table so that once the SQL thread awakes
+# it blocks there and does not set rli->ignore_space_limit
+# back to zero
+LOCK TABLE t1 WRITE;
+
+# now issue more statements that will overflow the
+# rli->log_space_limit (in this case ~10K)
+--connection master
+
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
+
+--connection slave
+
+# ASSERT that the IO thread waits for the SQL thread to release some
+# space before continuing
+--let $show_statement= SHOW PROCESSLIST
+--let $field= State
+--let $condition= LIKE 'Waiting for %'
+# before the patch (IO would have transfered everything)
+#--let $condition= = 'Waiting for master to send event'
+# after the patch (now it waits for space to be freed)
+#--let $condition= = 'Waiting for the slave SQL thread to free enough relay log space'
+--source include/wait_show_condition.inc
+
+# without the patch we can uncomment the following two lines and
+# watch the IO thread synchronize with the master, thus writing
+# relay logs way over the space limit
+#--connection master
+#--source include/sync_slave_io_with_master.inc
+
+## ASSERT that the IO thread has honored the limit+few bytes required to be able to purge
+--let $relay_log_space_while_sql_is_executing = query_get_value(SHOW SLAVE STATUS, Relay_Log_Space, 1)
+--let $relay_log_space_limit = query_get_value(SHOW VARIABLES LIKE "relay_log_space_limit", Value, 1)
+--let $assert_text= Assert that relay log space is close to the limit
+--let $assert_cond= $relay_log_space_while_sql_is_executing <= $relay_log_space_limit * 1.15
+--source include/assert.inc
+
+# unlock the table and let SQL thread continue applying events
+UNLOCK TABLES;
+
+--connection master
+--sync_slave_with_master
+--let $diff_tables=master:test.t1,slave:test.t1
+--source include/diff_tables.inc
+
+--connection master
+DROP TABLE t1;
+--enable_query_log
+--sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
index 2625508515b..d814a257711 100644
--- a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
+++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
@@ -1 +1,633 @@
---source include/rpl_switch_stm_row_mixed.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+#
+# rpl_switch_stm_row_mixed tests covers
+#
+# - 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 SYS_GUID(), thereafter to serve as the
+# definition of MIXED binlog format
+# - correctness of execution
+
+
+-- source include/have_binlog_format_mixed_or_row.inc
+-- source include/master-slave.inc
+
+# Since this test generates row-based events in the binary log, the
+# slave SQL thread cannot be in STATEMENT mode to execute this test,
+# so we only execute it for MIXED and ROW as default value of
+# BINLOG_FORMAT.
+
+connection slave;
+
+connection master;
+--disable_warnings
+drop database if exists mysqltest1;
+create database mysqltest1;
+--enable_warnings
+use mysqltest1;
+
+# Save binlog format
+set @my_binlog_format= @@global.binlog_format;
+
+# play with switching
+set session binlog_format=mixed;
+show session variables like "binlog_format%";
+set session binlog_format=statement;
+show session variables like "binlog_format%";
+set session binlog_format=row;
+show session variables like "binlog_format%";
+
+set global binlog_format=DEFAULT;
+show global variables like "binlog_format%";
+set global binlog_format=MIXED;
+show global variables like "binlog_format%";
+set global binlog_format=STATEMENT;
+show global variables like "binlog_format%";
+set global binlog_format=ROW;
+show global variables like "binlog_format%";
+show session variables like "binlog_format%";
+select @@global.binlog_format, @@session.binlog_format;
+
+CREATE TABLE t1 (a varchar(100));
+
+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(SYS_GUID(),"work_3_"));
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+insert into t1 values(concat("for_4_",SYS_GUID()));
+insert into t1 select "yesterday_5_";
+
+# verify that temp tables prevent a switch to SBR
+create temporary table tmp(a char(100));
+insert into tmp values("see_6_");
+--error ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
+set binlog_format=statement;
+insert into t1 select * from tmp;
+drop temporary table tmp;
+
+# Now we go to SBR
+set binlog_format=statement;
+show global variables like "binlog_format%";
+show session variables like "binlog_format%";
+select @@global.binlog_format, @@session.binlog_format;
+set global binlog_format=statement;
+show global variables like "binlog_format%";
+show session variables like "binlog_format%";
+select @@global.binlog_format, @@session.binlog_format;
+
+prepare stmt1 from 'insert into t1 select ?';
+set @string="emergency_7_";
+insert into t1 values("work_8_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values("work_9_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+insert into t1 values("for_10_");
+insert into t1 select "yesterday_11_";
+
+# test statement (is not default after wl#3368)
+set binlog_format=statement;
+select @@global.binlog_format, @@session.binlog_format;
+set global binlog_format=statement;
+select @@global.binlog_format, @@session.binlog_format;
+
+prepare stmt1 from 'insert into t1 select ?';
+set @string="emergency_12_";
+insert into t1 values("work_13_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+prepare stmt1 from 'insert into t1 select ?';
+insert into t1 values("work_14_");
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+insert into t1 values("for_15_");
+insert into t1 select "yesterday_16_";
+
+# and now the mixed mode
+
+set global binlog_format=mixed;
+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(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(SYS_GUID(),"work_19_"));
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+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(SYS_GUID(),"work_22_"));
+execute stmt1 using @string;
+deallocate prepare stmt1;
+
+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(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 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 SYS_GUID() is first:
+--disable_warnings
+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
+
+delimiter |;
+create procedure foo()
+begin
+insert into t1 values("work_25_");
+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_",SYS_GUID()));
+insert into t1 values("work_29_");
+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;
+end|
+create function foo3() returns bigint unsigned
+begin
+ set session binlog_format=row; # rejected for stored funcs
+ insert into t1 values("alarm");
+ return 100;
+end|
+create procedure foo4(x varchar(100))
+begin
+insert into t1 values(concat("work_250_",x));
+insert into t1 select "yesterday_270_";
+end|
+delimiter ;|
+call foo();
+call foo2();
+call foo4("hello");
+call foo4(SYS_GUID());
+call foo4("world");
+
+# test that can't SET in a stored function
+--error ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT
+select foo3();
+select * from t1 where a="alarm";
+
+# Tests of stored functions/triggers/views for BUG#20930 "Mixed
+# binlogging mode does not work with stored functions, triggers,
+# views"
+
+# Function which calls procedure
+drop function foo3;
+delimiter |;
+create function foo3() returns bigint unsigned
+begin
+ insert into t1 values("foo3_32_");
+ call foo();
+ return 100;
+end|
+delimiter ;|
+insert into t2 select foo3();
+
+prepare stmt1 from 'insert into t2 select foo3()';
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+# Test if stored function calls stored function which calls procedure
+# which requires row-based.
+
+delimiter |;
+create function foo4() returns bigint unsigned
+begin
+ insert into t2 select foo3();
+ return 100;
+end|
+delimiter ;|
+select foo4();
+
+prepare stmt1 from 'select foo4()';
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+# A simple stored function
+delimiter |;
+create function foo5() returns bigint unsigned
+begin
+ insert into t2 select SYS_GUID();
+ return 100;
+end|
+delimiter ;|
+select foo5();
+
+prepare stmt1 from 'select foo5()';
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+# A simple stored function where SYS_GUID() is in the argument
+delimiter |;
+create function foo6(x varchar(100)) returns bigint unsigned
+begin
+ insert into t2 select x;
+ return 100;
+end|
+delimiter ;|
+select foo6("foo6_1_");
+select foo6(concat("foo6_2_",SYS_GUID()));
+
+prepare stmt1 from 'select foo6(concat("foo6_3_",SYS_GUID()))';
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+
+# Test of views using SYS_GUID()
+
+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,
+# to verify that it binlogs statement-based (is not polluted by
+# the parsing of the view's body).
+insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11');
+prepare stmt1 from "insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')";
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+# 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,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_",SYS_GUID()));
+insert delayed into t2 values("delay_6_");
+
+# Test for BUG#20633 (INSERT DELAYED RAND()/user_variable does not
+# replicate fine in statement-based ; we test that in mixed mode it
+# works).
+insert delayed into t2 values(rand());
+set @a=2.345;
+insert delayed into t2 values(@a);
+
+# With INSERT DELAYED, rows are written to the binlog after they are
+# written to the table. Therefore, it is not enough to wait until the
+# rows make it to t2 on the master (the rows may not be in the binlog
+# at that time, and may still not be in the binlog when
+# sync_slave_with_master is later called). Instead, we wait until the
+# rows make it to t2 on the slave. We first call
+# sync_slave_with_master, so that we are sure that t2 has been created
+# on the slave.
+sync_slave_with_master;
+let $wait_condition= SELECT COUNT(*) = 19 FROM mysqltest1.t2;
+--source include/wait_condition.inc
+connection master;
+
+# If you want to do manual testing of the mixed mode regarding UDFs (not
+# testable automatically as quite platform- and compiler-dependent),
+# you just need to set the variable below to 1, and to
+# "make udf_example.so" in sql/, and to copy sql/udf_example.so to
+# MYSQL_TEST_DIR/lib/mysql.
+let $you_want_to_test_UDF=0;
+if ($you_want_to_test_UDF)
+{
+ CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so';
+ prepare stmt1 from 'insert into t1 select metaphon(?)';
+ set @string="emergency_133_";
+ insert into t1 values("work_134_");
+ execute stmt1 using @string;
+ deallocate prepare stmt1;
+ prepare stmt1 from 'insert into t1 select ?';
+ insert into t1 values(metaphon("work_135_"));
+ execute stmt1 using @string;
+ deallocate prepare stmt1;
+ insert into t1 values(metaphon("for_136_"));
+ insert into t1 select "yesterday_137_";
+ create table t6 select metaphon("for_138_");
+ create table t7 select 1 union select metaphon("for_139_");
+ create table t8 select * from t1 where 3 in (select 1 union select 2 union select metaphon("for_140_") union select 3);
+ create table t9 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
+}
+
+create table t20 select * from t1; # save for comparing later
+create table t21 select * from t2;
+create table t22 select * from t3;
+drop table t1,t2,t3;
+
+# This tests the fix to
+# BUG#19630 stored function inserting into two auto_increment breaks statement-based binlog
+# We verify that under the mixed binlog mode, a stored function
+# modifying at least two tables having an auto_increment column,
+# is binlogged row-based. Indeed in statement-based binlogging,
+# only the auto_increment value generated for the first table
+# is recorded in the binlog, the value generated for the 2nd table
+# lacking.
+
+create table t1 (a int primary key auto_increment, b varchar(100));
+create table t2 (a int primary key auto_increment, b varchar(100));
+create table t3 (b varchar(100));
+delimiter |;
+create function f (x varchar(100)) returns int deterministic
+begin
+ insert into t1 values(null,x);
+ insert into t2 values(null,x);
+ return 1;
+end|
+delimiter ;|
+select f("try_41_");
+# Two operations which compensate each other except that their net
+# effect is that they advance the auto_increment counter of t2 on slave:
+sync_slave_with_master;
+use mysqltest1;
+insert into t2 values(2,null),(3,null),(4,null);
+delete from t2 where a>=2;
+
+connection master;
+# this is the call which didn't replicate well
+select f("try_42_");
+sync_slave_with_master;
+
+# now use prepared statement and test again, just to see that the RBB
+# mode isn't set at PREPARE but at EXECUTE.
+
+insert into t2 values(3,null),(4,null);
+delete from t2 where a>=3;
+
+connection master;
+prepare stmt1 from 'select f(?)';
+set @string="try_43_";
+insert into t1 values(null,"try_44_"); # should be SBB
+execute stmt1 using @string; # should be RBB
+deallocate prepare stmt1;
+sync_slave_with_master;
+
+# verify that if only one table has auto_inc, it does not trigger RBB
+# (we'll check in binlog further below)
+
+connection master;
+create table t12 select * from t1; # save for comparing later
+drop table t1;
+create table t1 (a int, b varchar(100), key(a));
+select f("try_45_");
+
+# restore table's key
+create table t13 select * from t1;
+drop table t1;
+create table t1 (a int primary key auto_increment, b varchar(100));
+
+# now test if it's two functions, each of them inserts in one table
+
+drop function f;
+# we need a unique key to have sorting of rows by mysqldump
+create table t14 (unique (a)) select * from t2;
+truncate table t2;
+delimiter |;
+create function f1 (x varchar(100)) returns int deterministic
+begin
+ insert into t1 values(null,x);
+ return 1;
+end|
+create function f2 (x varchar(100)) returns int deterministic
+begin
+ insert into t2 values(null,x);
+ return 1;
+end|
+delimiter ;|
+select f1("try_46_"),f2("try_47_");
+
+sync_slave_with_master;
+insert into t2 values(2,null),(3,null),(4,null);
+delete from t2 where a>=2;
+
+connection master;
+# Test with SELECT and INSERT
+select f1("try_48_"),f2("try_49_");
+insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_")));
+sync_slave_with_master;
+
+# verify that if f2 does only read on an auto_inc table, this does not
+# switch to RBB
+connection master;
+drop function f2;
+delimiter |;
+create function f2 (x varchar(100)) returns int deterministic
+begin
+ declare y int;
+ insert into t1 values(null,x);
+ set y = (select count(*) from t2);
+ return y;
+end|
+delimiter ;|
+select f1("try_53_"),f2("try_54_");
+sync_slave_with_master;
+
+# And now, a normal statement with a trigger (no stored functions)
+
+connection master;
+drop function f2;
+delimiter |;
+create trigger t1_bi before insert on t1 for each row
+begin
+ insert into t2 values(null,"try_55_");
+end|
+delimiter ;|
+insert into t1 values(null,"try_56_");
+# and now remove one auto_increment and verify SBB
+alter table t1 modify a int, drop primary key;
+insert into t1 values(null,"try_57_");
+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 SYS_GUID();
+create table t16 like t15;
+INSERT INTO t16 SELECT * FROM t15;
+# we'll verify that this one is done RBB
+insert into t16 values("try_65_");
+drop table t15;
+# we'll verify that this one is done SBB
+insert into t16 values("try_66_");
+sync_slave_with_master;
+
+# and now compare:
+
+connection master;
+
+# first check that data on master is sensible
+select count(*) from t1;
+select count(*) from t2;
+select count(*) from t3;
+select count(*) from t4;
+select count(*) from t5;
+select count(*) from t11;
+select count(*) from t20;
+select count(*) from t21;
+select count(*) from t22;
+select count(*) from t12;
+select count(*) from t13;
+select count(*) from t14;
+select count(*) from t16;
+if ($you_want_to_test_UDF)
+{
+ select count(*) from t6;
+ select count(*) from t7;
+ select count(*) from t8;
+ select count(*) from t9;
+}
+
+sync_slave_with_master;
+
+#
+# Bug#20863 If binlog format is changed between update and unlock of
+# tables, wrong binlog
+#
+
+connection master;
+DROP TABLE IF EXISTS t11;
+SET SESSION BINLOG_FORMAT=STATEMENT;
+CREATE TABLE t11 (song VARCHAR(255));
+LOCK TABLES t11 WRITE;
+SET SESSION BINLOG_FORMAT=ROW;
+INSERT INTO t11 VALUES('Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict');
+SET SESSION BINLOG_FORMAT=STATEMENT;
+INSERT INTO t11 VALUES('Careful With That Axe, Eugene');
+UNLOCK TABLES;
+
+--query_vertical SELECT * FROM t11
+sync_slave_with_master;
+USE mysqltest1;
+--query_vertical SELECT * FROM t11
+
+connection master;
+DROP TABLE IF EXISTS t12;
+SET SESSION BINLOG_FORMAT=MIXED;
+CREATE TABLE t12 (data LONG);
+LOCK TABLES t12 WRITE;
+INSERT INTO t12 VALUES(SYS_GUID());
+UNLOCK TABLES;
+sync_slave_with_master;
+
+#
+# BUG#28086: SBR of USER() becomes corrupted on slave
+#
+
+connection master;
+
+# Just to get something that is non-trivial, albeit still simple, we
+# stuff the result of USER() and CURRENT_USER() into a variable.
+--delimiter $$
+CREATE FUNCTION my_user()
+ RETURNS CHAR(64)
+BEGIN
+ DECLARE user CHAR(64);
+ SELECT USER() INTO user;
+ RETURN user;
+END $$
+--delimiter ;
+
+--delimiter $$
+CREATE FUNCTION my_current_user()
+ RETURNS CHAR(64)
+BEGIN
+ DECLARE user CHAR(64);
+ SELECT CURRENT_USER() INTO user;
+ RETURN user;
+END $$
+--delimiter ;
+
+DROP TABLE IF EXISTS t13;
+CREATE TABLE t13 (data CHAR(64));
+INSERT INTO t13 VALUES (USER());
+INSERT INTO t13 VALUES (my_user());
+INSERT INTO t13 VALUES (CURRENT_USER());
+INSERT INTO t13 VALUES (my_current_user());
+
+sync_slave_with_master;
+
+# 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
+
+# Let's compare. Note: If they match test will pass, if they do not match
+# the test will show that the diff statement failed and not reject file
+# will be created. You will need to go to the mysql-test dir and diff
+# the files your self to see what is not matching
+
+diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
+
+connection master;
+
+# Now test that mysqlbinlog works fine on a binlog generated by the
+# mixed mode
+
+# BUG#11312 "DELIMITER is not written to the binary log that causes
+# syntax error" makes that mysqlbinlog will fail if we pass it the
+# text of queries; this forces us to use --base64-output here.
+
+# BUG#20929 "BINLOG command causes invalid free plus assertion
+# failure" makes mysqld segfault when receiving --base64-output
+
+# So I can't enable this piece of test
+# SIGH
+
+if ($enable_when_11312_or_20929_fixed)
+{
+--exec $MYSQL_BINLOG --base64-output $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql
+drop database mysqltest1;
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
+# the old mysqldump output on slave is the same as what it was on
+# master before restoring on master.
+diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
+}
+
+drop database mysqltest1;
+sync_slave_with_master;
+
+connection master;
+# Restore binlog format setting
+set global binlog_format =@my_binlog_format;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sync.test b/mysql-test/suite/rpl/t/rpl_sync.test
index bdb0d8ec4cc..1e2ec2ca83b 100644
--- a/mysql-test/suite/rpl/t/rpl_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_sync.test
@@ -1,2 +1,159 @@
---source include/rpl_sync_test.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+########################################################################################
+# This test verifies the options --sync-relay-log-info and --relay-log-recovery by
+# crashing the slave in two different situations:
+# (case-1) - Corrupt the relay log with changes which were not processed by
+# the SQL Thread and crashes it.
+# (case-2) - Corrupt the master.info with wrong coordinates and crashes it.
+#
+# Case 1:
+# 1 - Stops the SQL Thread
+# 2 - Inserts new records into the master.
+# 3 - Corrupts the relay-log.bin* which most likely has such changes.
+# 4 - Crashes the slave
+# 5 - Verifies if the slave is sync with the master which means that the information
+# loss was circumvented by the recovery process.
+#
+# Case 2:
+# 1 - Stops the SQL/IO Threads
+# 2 - Inserts new records into the master.
+# 3 - Corrupts the master.info with wrong coordinates.
+# 4 - Crashes the slave
+# 5 - Verifies if the slave is sync with the master which means that the information
+# loss was circumvented by the recovery process.
+########################################################################################
+
+########################################################################################
+# Configuring the environment
+########################################################################################
+--echo =====Configuring the enviroment=======;
+--source include/not_embedded.inc
+--source include/not_valgrind.inc
+--source include/have_debug.inc
+--source include/have_innodb.inc
+--source include/not_crashrep.inc
+--source include/master-slave.inc
+
+call mtr.add_suppression('Attempting backtrace');
+call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
+# Use innodb so we do not get "table should be repaired" issues.
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+flush tables;
+CREATE TABLE t1(a INT, PRIMARY KEY(a)) engine=innodb;
+
+insert into t1(a) values(1);
+insert into t1(a) values(2);
+insert into t1(a) values(3);
+
+########################################################################################
+# Case 1: Corrupt a relay-log.bin*
+########################################################################################
+--echo =====Inserting data on the master but without the SQL Thread being running=======;
+sync_slave_with_master;
+
+connection slave;
+let $MYSQLD_SLAVE_DATADIR= `select @@datadir`;
+--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
+--copy_file $MYSQLD_SLAVE_DATADIR/master.info $MYSQLD_SLAVE_DATADIR/master.backup
+--source include/stop_slave_sql.inc
+
+connection master;
+insert into t1(a) values(4);
+insert into t1(a) values(5);
+insert into t1(a) values(6);
+
+--echo =====Removing relay log files and crashing/recoverying the slave=======;
+connection slave;
+--source include/stop_slave_io.inc
+
+let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1);
+
+--let FILE_TO_CORRUPT= $MYSQLD_SLAVE_DATADIR/$file
+perl;
+$file= $ENV{'FILE_TO_CORRUPT'};
+open(FILE, ">$file") || die "Unable to open $file.";
+truncate(FILE,0);
+print FILE "failure";
+close ($file);
+EOF
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
+--error 2013
+FLUSH LOGS;
+
+--let $rpl_server_number= 2
+--source include/rpl_reconnect.inc
+
+--echo =====Dumping and comparing tables=======;
+--source include/start_slave.inc
+
+connection master;
+sync_slave_with_master;
+
+let $diff_tables=master:t1,slave:t1;
+source include/diff_tables.inc;
+
+########################################################################################
+# Case 2: Corrupt a master.info
+########################################################################################
+--echo =====Corrupting the master.info=======;
+connection slave;
+--source include/stop_slave.inc
+
+connection master;
+FLUSH LOGS;
+
+insert into t1(a) values(7);
+insert into t1(a) values(8);
+insert into t1(a) values(9);
+
+connection slave;
+let MYSQLD_SLAVE_DATADIR=`select @@datadir`;
+
+--perl
+use strict;
+use warnings;
+my $src= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.backup";
+my $dst= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.info";
+open(FILE, "<", $src) or die;
+my @content= <FILE>;
+close FILE;
+open(FILE, ">", $dst) or die;
+binmode FILE;
+print FILE @content;
+close FILE;
+EOF
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
+--error 2013
+FLUSH LOGS;
+
+--let $rpl_server_number= 2
+--source include/rpl_reconnect.inc
+
+--echo =====Dumping and comparing tables=======;
+--source include/start_slave.inc
+
+connection master;
+sync_slave_with_master;
+
+let $diff_tables=master:t1,slave:t1;
+source include/diff_tables.inc;
+
+########################################################################################
+# Clean up
+########################################################################################
+--echo =====Clean up=======;
+connection master;
+drop table t1;
+
+--remove_file $MYSQLD_SLAVE_DATADIR/master.backup
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_temporal_format_default_to_default.test b/mysql-test/suite/rpl/t/rpl_temporal_format_default_to_default.test
index d976ae3757b..6728ff55d6f 100644
--- a/mysql-test/suite/rpl/t/rpl_temporal_format_default_to_default.test
+++ b/mysql-test/suite/rpl/t/rpl_temporal_format_default_to_default.test
@@ -1 +1,82 @@
---source include/rpl_temporal_format_default_to_default.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption).
+# Please check all dependent tests after modifying it
+#
+
+--source include/master-slave.inc
+
+if ($force_master_mysql56_temporal_format)
+{
+ connection master;
+ eval SET @@global.mysql56_temporal_format=$force_master_mysql56_temporal_format;
+}
+
+if ($force_slave_mysql56_temporal_format)
+{
+ connection slave;
+ eval SET @@global.mysql56_temporal_format=$force_slave_mysql56_temporal_format;
+}
+
+connection master;
+SELECT @@global.mysql56_temporal_format AS on_master;
+connection slave;
+SELECT @@global.mysql56_temporal_format AS on_slave;
+connection master;
+
+CREATE TABLE t1
+(
+ c0 TIME(0),
+ c1 TIME(1),
+ c2 TIME(2),
+ c3 TIME(3),
+ c4 TIME(4),
+ c5 TIME(5),
+ c6 TIME(6)
+);
+CREATE TABLE t2
+(
+ c0 TIMESTAMP(0),
+ c1 TIMESTAMP(1),
+ c2 TIMESTAMP(2),
+ c3 TIMESTAMP(3),
+ c4 TIMESTAMP(4),
+ c5 TIMESTAMP(5),
+ c6 TIMESTAMP(6)
+);
+
+CREATE TABLE t3
+(
+ c0 DATETIME(0),
+ c1 DATETIME(1),
+ c2 DATETIME(2),
+ c3 DATETIME(3),
+ c4 DATETIME(4),
+ c5 DATETIME(5),
+ c6 DATETIME(6)
+);
+INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
+INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+sync_slave_with_master;
+
+connection slave;
+--query_vertical SELECT * FROM t1;
+--query_vertical SELECT * FROM t2;
+--query_vertical SELECT * FROM t3;
+SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
+WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME;
+
+connection master;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+connection slave;
+SET @@global.mysql56_temporal_format=DEFAULT;
+connection master;
+SET @@global.mysql56_temporal_format=DEFAULT;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_typeconv.test b/mysql-test/suite/rpl/t/rpl_typeconv.test
index c2517086258..9e566258882 100644
--- a/mysql-test/suite/rpl/t/rpl_typeconv.test
+++ b/mysql-test/suite/rpl/t/rpl_typeconv.test
@@ -1 +1,78 @@
---source include/rpl_typeconv.inc
+#
+# This include file is used by more than one test suite
+# (currently rpl and binlog_encryption suite).
+# Please check all dependent tests after modifying it
+#
+
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+connection slave;
+set @saved_slave_type_conversions = @@global.slave_type_conversions;
+CREATE TABLE type_conversions (
+ TestNo INT AUTO_INCREMENT PRIMARY KEY,
+ Source TEXT,
+ Target TEXT,
+ Flags TEXT,
+ On_Master LONGTEXT,
+ On_Slave LONGTEXT,
+ Expected LONGTEXT,
+ Compare INT,
+ Error TEXT);
+
+SELECT @@global.slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
+SELECT @@global.slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
+SELECT @@global.slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
+SELECT @@global.slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
+SELECT @@global.slave_type_conversions;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY,NONEXISTING_BIT';
+SELECT @@global.slave_type_conversions;
+
+# Checking strict interpretation of type conversions
+connection slave;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
+source suite/rpl/include/type_conversions.test;
+
+# Checking lossy integer type conversions
+connection slave;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
+source suite/rpl/include/type_conversions.test;
+
+# Checking non-lossy integer type conversions
+connection slave;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
+source suite/rpl/include/type_conversions.test;
+
+# Checking all type conversions
+connection slave;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
+source suite/rpl/include/type_conversions.test;
+
+connection slave;
+--echo **** Result of conversions ****
+disable_query_log;
+SELECT RPAD(Source, 15, ' ') AS Source_Type,
+ RPAD(Target, 15, ' ') AS Target_Type,
+ RPAD(Flags, 25, ' ') AS All_Type_Conversion_Flags,
+ IF(Compare IS NULL AND Error IS NOT NULL, '<Correct error>',
+ IF(Compare, '<Correct value>',
+ CONCAT("'", On_Slave, "' != '", Expected, "'")))
+ AS Value_On_Slave
+ FROM type_conversions;
+enable_query_log;
+DROP TABLE type_conversions;
+
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677");
+
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+
+set global slave_type_conversions = @saved_slave_type_conversions;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_xa_prepare_gtid_fail.test b/mysql-test/suite/rpl/t/rpl_xa_prepare_gtid_fail.test
new file mode 100644
index 00000000000..8042b355754
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_xa_prepare_gtid_fail.test
@@ -0,0 +1,106 @@
+#
+# When handling the replication of an XA PREPARE, the commit phase is
+# bifurcated. First, the prepare is handled by the relevant storage engines.
+# Then second,the GTID slave state is updated as a separate autocommit
+# transaction. If the second stage fails, i.e. we are unable to update the
+# GTID slave state, then the slave should immediately quit in error, without
+# retry.
+#
+# This tests validates the above behavior by simulating a deadlock on the
+# GTID slave state table during the second part of XA PREPARE's commit, to
+# ensure that the appropriate error is reported and the transaction was never
+# retried.
+#
+#
+# References
+# MDEV-31038: Parallel Replication Breaks if XA PREPARE Fails Updating Slave
+# GTID State
+#
+source include/master-slave.inc;
+source include/have_binlog_format_row.inc;
+source include/have_innodb.inc;
+
+--connection slave
+--source include/stop_slave.inc
+
+--let $save_par_thds= `SELECT @@global.slave_parallel_threads`
+--let $save_strict_mode= `SELECT @@global.gtid_strict_mode`
+--let $save_innodb_lock_wait_timeout= `SELECT @@global.innodb_lock_wait_timeout`
+
+change master to master_use_gtid=slave_pos;
+set @@global.slave_parallel_threads= 4;
+set @@global.slave_parallel_mode= optimistic;
+set @@global.gtid_strict_mode=ON;
+
+set sql_log_bin= 0;
+alter table mysql.gtid_slave_pos engine=innodb;
+call mtr.add_suppression("Deadlock found.*");
+set sql_log_bin= 1;
+--source include/start_slave.inc
+
+--connection master
+let $datadir= `select @@datadir`;
+create table t1 (a int primary key, b int) engine=innodb;
+insert t1 values (1,1);
+--source include/save_master_gtid.inc
+
+--connection slave
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+set @@global.innodb_lock_wait_timeout= 1;
+
+--let $retried_tx_initial= query_get_value(SHOW ALL SLAVES STATUS, Retried_transactions, 1)
+
+--connection master
+--let $gtid_domain_id=`SELECT @@GLOBAL.gtid_domain_id`
+--let $gtid_server_id=`SELECT @@GLOBAL.server_id`
+--let $xap_seq_no=100
+--eval set @@session.gtid_seq_no=$xap_seq_no
+xa start '1';
+update t1 set b=b+10 where a=1;
+xa end '1';
+xa prepare '1';
+--let $new_gtid= `SELECT @@global.gtid_binlog_pos`
+xa commit '1';
+--source include/save_master_gtid.inc
+
+
+--connection slave
+
+#--eval set statement sql_log_bin=0 for insert into mysql.gtid_slave_pos values ($gtid_domain_id, 5, $gtid_server_id, $xap_seq_no)
+
+--connection slave1
+BEGIN;
+--eval SELECT * FROM mysql.gtid_slave_pos WHERE seq_no=$xap_seq_no FOR UPDATE
+
+--connection slave
+--source include/start_slave.inc
+
+--let $slave_sql_errno= 1942,1213
+--source include/wait_for_slave_sql_error.inc
+
+--let $retried_tx_test= query_get_value(SHOW ALL SLAVES STATUS, Retried_transactions, 1)
+if ($retried_tx_initial != $retried_tx_test)
+{
+ --echo Transaction was retried when a failed XA PREPARE slave GTID update should lead to immediate slave stop without retry
+ --die Transaction was retried when a failed XA PREPARE slave GTID update should lead to immediate slave stop without retry
+}
+
+--connection slave1
+ROLLBACK;
+
+--echo # Cleanup
+
+--connection master
+drop table t1;
+
+--connection slave
+--source include/stop_slave.inc
+--eval set @@global.gtid_slave_pos= "$new_gtid"
+--eval set @@global.slave_parallel_threads= $save_par_thds
+--eval set @@global.gtid_strict_mode= $save_strict_mode
+--eval set @@global.innodb_lock_wait_timeout= $save_innodb_lock_wait_timeout
+--source include/start_slave.inc
+
+--source include/rpl_end.inc
+--echo # End of rpl_xa_prepare_gtid_fail.test
diff --git a/mysql-test/suite/sys_vars/r/aria_log_dir_path_basic.result b/mysql-test/suite/sys_vars/r/aria_log_dir_path_basic.result
new file mode 100644
index 00000000000..8563b024a75
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_log_dir_path_basic.result
@@ -0,0 +1,36 @@
+SELECT COUNT(@@GLOBAL.aria_log_dir_path);
+COUNT(@@GLOBAL.aria_log_dir_path)
+1
+SET @@GLOBAL.aria_log_dir_path=1;
+ERROR HY000: Variable 'aria_log_dir_path' is a read only variable
+SELECT COUNT(@@GLOBAL.aria_log_dir_path);
+COUNT(@@GLOBAL.aria_log_dir_path)
+1
+SELECT @@GLOBAL.aria_log_dir_path = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='aria_log_dir_path';
+@@GLOBAL.aria_log_dir_path = VARIABLE_VALUE
+1
+SELECT COUNT(@@GLOBAL.aria_log_dir_path);
+COUNT(@@GLOBAL.aria_log_dir_path)
+1
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='aria_log_dir_path';
+COUNT(VARIABLE_VALUE)
+1
+SELECT @@aria_log_dir_path = @@GLOBAL.aria_log_dir_path;
+@@aria_log_dir_path = @@GLOBAL.aria_log_dir_path
+1
+SELECT COUNT(@@aria_log_dir_path);
+COUNT(@@aria_log_dir_path)
+1
+SELECT COUNT(@@local.aria_log_dir_path);
+ERROR HY000: Variable 'aria_log_dir_path' is a GLOBAL variable
+SELECT COUNT(@@SESSION.aria_log_dir_path);
+ERROR HY000: Variable 'aria_log_dir_path' is a GLOBAL variable
+SELECT COUNT(@@GLOBAL.aria_log_dir_path);
+COUNT(@@GLOBAL.aria_log_dir_path)
+1
+SELECT aria_log_dir_path = @@SESSION.aria_log_dir_path;
+ERROR 42S22: Unknown column 'aria_log_dir_path' in 'field list'
diff --git a/mysql-test/suite/sys_vars/r/character_set_client_basic.result b/mysql-test/suite/sys_vars/r/character_set_client_basic.result
index d62d88027c7..14c8bcfd058 100644
--- a/mysql-test/suite/sys_vars/r/character_set_client_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_client_basic.result
@@ -500,5 +500,16 @@ res
#
SET GLOBAL character_set_client=2;
ERROR 42000: Unknown character set: '2'
+#
+# MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
+#
+SET @@pseudo_slave_mode=1;
+SET character_set_client=2/*latin2_czech_cs*/;
+SHOW VARIABLES LIKE 'character_set_client';
+Variable_name Value
+character_set_client latin2
+SET @@pseudo_slave_mode=0;
+Warnings:
+Warning 1231 Slave applier execution mode not active, statement ineffective.
SET @@global.character_set_client = @global_start_value;
SET @@session.character_set_client = @session_start_value;
diff --git a/mysql-test/suite/sys_vars/r/character_set_connection_basic.result b/mysql-test/suite/sys_vars/r/character_set_connection_basic.result
index e356d62ed2b..bbb4f4e5f75 100644
--- a/mysql-test/suite/sys_vars/r/character_set_connection_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_connection_basic.result
@@ -494,5 +494,21 @@ SELECT @@session.character_set_connection =
WHERE VARIABLE_NAME='character_set_connection') AS res;
res
1
+#
+# MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
+#
+SET character_set_connection=2/*latin2_czech_cs*/;
+ERROR 42000: Unknown character set: '2'
+SET @@pseudo_slave_mode=1;
+SET character_set_connection=2/*latin2_czech_cs*/;
+SHOW VARIABLES LIKE 'character_set_connection';
+Variable_name Value
+character_set_connection latin2
+SHOW VARIABLES LIKE 'collation_connection';
+Variable_name Value
+collation_connection latin2_general_ci
+SET @@pseudo_slave_mode=0;
+Warnings:
+Warning 1231 Slave applier execution mode not active, statement ineffective.
SET @@global.character_set_connection = @global_start_value;
SET @@global.character_set_client = @save_character_set_client;
diff --git a/mysql-test/suite/sys_vars/r/character_set_results_basic.result b/mysql-test/suite/sys_vars/r/character_set_results_basic.result
index d1c6a52ba17..1346c8b42ca 100644
--- a/mysql-test/suite/sys_vars/r/character_set_results_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_results_basic.result
Binary files differ
diff --git a/mysql-test/suite/sys_vars/r/character_set_server_basic.result b/mysql-test/suite/sys_vars/r/character_set_server_basic.result
index e0a13c729fe..7445be6aef1 100644
--- a/mysql-test/suite/sys_vars/r/character_set_server_basic.result
+++ b/mysql-test/suite/sys_vars/r/character_set_server_basic.result
@@ -486,5 +486,21 @@ SELECT @@session.character_set_server =
WHERE VARIABLE_NAME='character_set_server') AS res;
res
1
+#
+# MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
+#
+SET character_set_server=2/*latin2_czech_cs*/;
+ERROR 42000: Unknown character set: '2'
+SET @@pseudo_slave_mode=1;
+SET character_set_server=2/*latin2_czech_cs*/;
+SHOW VARIABLES LIKE 'character_set_server';
+Variable_name Value
+character_set_server latin2
+SHOW VARIABLES LIKE 'collation_server';
+Variable_name Value
+collation_server latin2_general_ci
+SET @@pseudo_slave_mode=0;
+Warnings:
+Warning 1231 Slave applier execution mode not active, statement ineffective.
SET @@global.character_set_server = @global_start_value;
SET @@session.character_set_server = @session_start_value;
diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
index 80bd2d7af5f..66399f61535 100644
--- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
+++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
@@ -1,60 +1,60 @@
set @@global.optimizer_switch=@@optimizer_switch;
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on
show global variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off
+optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on
show session variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off
+optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on
select * from information_schema.global_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on
select * from information_schema.session_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on
set global optimizer_switch=4101;
set session optimizer_switch=2058;
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
+index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
+index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off
set global optimizer_switch="index_merge_sort_union=on";
set session optimizer_switch="index_merge=off";
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
+index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
+index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off
show global variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
+optimizer_switch index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off
show session variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
+optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off
select * from information_schema.global_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off
select * from information_schema.session_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
+OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off
set session optimizer_switch="default";
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off
+index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off
set optimizer_switch = replace(@@optimizer_switch, '=off', '=on');
Warnings:
Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release
select @@optimizer_switch;
@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=on,hash_join_cardinality=on
set global optimizer_switch=1.1;
ERROR 42000: Incorrect argument type to variable 'optimizer_switch'
set global optimizer_switch=1e1;
diff --git a/mysql-test/suite/sys_vars/r/sysvars_aria.result b/mysql-test/suite/sys_vars/r/sysvars_aria.result
index 8cec099d28c..181c0de74df 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_aria.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_aria.result
@@ -85,6 +85,18 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_LOG_DIR_PATH
+SESSION_VALUE NULL
+DEFAULT_VALUE DATADIR
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Path to the directory where to store transactional log
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_LOG_FILE_SIZE
SESSION_VALUE NULL
DEFAULT_VALUE 1073741824
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
index e6518f060f1..a2bf4415ba1 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -149,7 +149,7 @@ NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
-READ_ONLY NO
+READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_BUFFER_POOL_LOAD_ABORT
SESSION_VALUE NULL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
index 02658d1b365..88d3bb1789e 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
@@ -112,6 +112,16 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_LOG_DIR_PATH
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Path to the directory where to store transactional log
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_LOG_FILE_SIZE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
@@ -665,13 +675,13 @@ COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME CORE_FILE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT write a core-file on crashes
+VARIABLE_COMMENT Write core on crashes
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
-COMMAND_LINE_ARGUMENT NULL
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME DATADIR
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
@@ -2479,7 +2489,7 @@ VARIABLE_COMMENT Fine-tune the optimizer behavior
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,condition_pushdown_for_subquery,rowid_filter,condition_pushdown_from_having,not_null_range_scan,default
+ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,condition_pushdown_for_subquery,rowid_filter,condition_pushdown_from_having,not_null_range_scan,hash_join_cardinality,default
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_TRACE
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
index d0deace1cce..a37735fa769 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -112,6 +112,16 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_LOG_DIR_PATH
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Path to the directory where to store transactional log
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_LOG_FILE_SIZE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
@@ -675,13 +685,13 @@ COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME CORE_FILE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT write a core-file on crashes
+VARIABLE_COMMENT Write core on crashes
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
-COMMAND_LINE_ARGUMENT NULL
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME DATADIR
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
@@ -2649,7 +2659,7 @@ VARIABLE_COMMENT Fine-tune the optimizer behavior
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,condition_pushdown_for_subquery,rowid_filter,condition_pushdown_from_having,not_null_range_scan,default
+ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,condition_pushdown_for_subquery,rowid_filter,condition_pushdown_from_having,not_null_range_scan,hash_join_cardinality,default
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_TRACE
diff --git a/mysql-test/suite/sys_vars/t/all_vars.test b/mysql-test/suite/sys_vars/t/all_vars.test
index 06edc04d25c..41c89a4bed9 100644
--- a/mysql-test/suite/sys_vars/t/all_vars.test
+++ b/mysql-test/suite/sys_vars/t/all_vars.test
@@ -12,8 +12,6 @@ eval INSTALL PLUGIN federated SONAME "$HA_FEDERATEDX_SO";
eval INSTALL PLUGIN oqgraph SONAME "$HA_OQGRAPH_SO";
eval INSTALL PLUGIN sphinx SONAME "$HA_SPHINX_SO";
eval INSTALL PLUGIN innodb SONAME "$HA_INNODB_SO";
-eval INSTALL PLUGIN rpl_semi_sync_master SONAME "$SEMISYNC_MASTER_SO";
-eval INSTALL PLUGIN rpl_semi_sync_slave SONAME "$SEMISYNC_SLAVE_SO";
--enable_abort_on_error
--enable_result_log
--enable_query_log
diff --git a/mysql-test/suite/sys_vars/t/aria_log_dir_path_basic.test b/mysql-test/suite/sys_vars/t/aria_log_dir_path_basic.test
new file mode 100644
index 00000000000..f09705e6f0d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_log_dir_path_basic.test
@@ -0,0 +1,35 @@
+--source include/have_maria.inc
+
+SELECT COUNT(@@GLOBAL.aria_log_dir_path);
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.aria_log_dir_path=1;
+
+SELECT COUNT(@@GLOBAL.aria_log_dir_path);
+
+
+SELECT @@GLOBAL.aria_log_dir_path = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='aria_log_dir_path';
+
+SELECT COUNT(@@GLOBAL.aria_log_dir_path);
+
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='aria_log_dir_path';
+
+
+SELECT @@aria_log_dir_path = @@GLOBAL.aria_log_dir_path;
+
+
+SELECT COUNT(@@aria_log_dir_path);
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.aria_log_dir_path);
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.aria_log_dir_path);
+
+SELECT COUNT(@@GLOBAL.aria_log_dir_path);
+
+--Error ER_BAD_FIELD_ERROR
+SELECT aria_log_dir_path = @@SESSION.aria_log_dir_path;
diff --git a/mysql-test/suite/sys_vars/t/character_set_client_basic.test b/mysql-test/suite/sys_vars/t/character_set_client_basic.test
index 09f758a0316..44c0d240a9d 100644
--- a/mysql-test/suite/sys_vars/t/character_set_client_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_client_basic.test
@@ -350,6 +350,15 @@ SELECT @@session.character_set_client =
--error ER_UNKNOWN_CHARACTER_SET
SET GLOBAL character_set_client=2;
+--echo #
+--echo # MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
+--echo #
+
+SET @@pseudo_slave_mode=1;
+SET character_set_client=2/*latin2_czech_cs*/;
+SHOW VARIABLES LIKE 'character_set_client';
+SET @@pseudo_slave_mode=0;
+
####################################
# Restore initial value #
####################################
diff --git a/mysql-test/suite/sys_vars/t/character_set_connection_basic.test b/mysql-test/suite/sys_vars/t/character_set_connection_basic.test
index 3d9094fca04..46bdfcb52e2 100644
--- a/mysql-test/suite/sys_vars/t/character_set_connection_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_connection_basic.test
@@ -275,6 +275,19 @@ SELECT @@session.character_set_connection =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_connection') AS res;
+--echo #
+--echo # MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
+--echo #
+
+--error ER_UNKNOWN_CHARACTER_SET
+SET character_set_connection=2/*latin2_czech_cs*/;
+SET @@pseudo_slave_mode=1;
+SET character_set_connection=2/*latin2_czech_cs*/;
+SHOW VARIABLES LIKE 'character_set_connection';
+SHOW VARIABLES LIKE 'collation_connection';
+SET @@pseudo_slave_mode=0;
+
+
####################################
# Restore initial value #
####################################
diff --git a/mysql-test/suite/sys_vars/t/character_set_results_basic.test b/mysql-test/suite/sys_vars/t/character_set_results_basic.test
index 617332b9780..41090be6657 100644
--- a/mysql-test/suite/sys_vars/t/character_set_results_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_results_basic.test
@@ -272,6 +272,18 @@ SELECT @@session.character_set_results =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_results') AS res;
+--echo #
+--echo # MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
+--echo #
+
+--error ER_UNKNOWN_CHARACTER_SET
+SET character_set_results=2/*latin2_czech_cs*/;
+SET @@pseudo_slave_mode=1;
+SET character_set_results=2;
+SHOW VARIABLES LIKE 'character_set_results';
+SET @@pseudo_slave_mode=0;
+
+
####################################
# Restore initial value #
####################################
diff --git a/mysql-test/suite/sys_vars/t/character_set_server_basic.test b/mysql-test/suite/sys_vars/t/character_set_server_basic.test
index b2f4788fdae..929dbfaf143 100644
--- a/mysql-test/suite/sys_vars/t/character_set_server_basic.test
+++ b/mysql-test/suite/sys_vars/t/character_set_server_basic.test
@@ -266,6 +266,18 @@ SELECT @@session.character_set_server =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_server') AS res;
+--echo #
+--echo # MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset
+--echo #
+
+--error ER_UNKNOWN_CHARACTER_SET
+SET character_set_server=2/*latin2_czech_cs*/;
+SET @@pseudo_slave_mode=1;
+SET character_set_server=2/*latin2_czech_cs*/;
+SHOW VARIABLES LIKE 'character_set_server';
+SHOW VARIABLES LIKE 'collation_server';
+SET @@pseudo_slave_mode=0;
+
####################################
# Restore initial value #
####################################
diff --git a/mysql-test/suite/sys_vars/t/sysvars_aria.test b/mysql-test/suite/sys_vars/t/sysvars_aria.test
index b01e39eebf5..b042f1010f4 100644
--- a/mysql-test/suite/sys_vars/t/sysvars_aria.test
+++ b/mysql-test/suite/sys_vars/t/sysvars_aria.test
@@ -2,7 +2,11 @@
--source include/have_aria_used_for_temp_tables.inc
--source include/word_size.inc
+let datadir=`select @@datadir`;
+
--vertical_results
+
+--replace_result $datadir DATADIR
select VARIABLE_NAME, SESSION_VALUE, DEFAULT_VALUE, VARIABLE_SCOPE, VARIABLE_TYPE, VARIABLE_COMMENT, NUMERIC_MIN_VALUE, NUMERIC_MAX_VALUE, NUMERIC_BLOCK_SIZE, ENUM_VALUE_LIST, READ_ONLY, COMMAND_LINE_ARGUMENT from information_schema.system_variables
where variable_name like 'aria%'
order by variable_name;
diff --git a/mysql-test/suite/sysschema/r/optimizer_switch.result b/mysql-test/suite/sysschema/r/optimizer_switch.result
index 017276fc4b8..4193bf0739e 100644
--- a/mysql-test/suite/sysschema/r/optimizer_switch.result
+++ b/mysql-test/suite/sysschema/r/optimizer_switch.result
@@ -8,6 +8,7 @@ derived_with_keys on
exists_to_in on
extended_keys on
firstmatch on
+hash_join_cardinality on
index_condition_pushdown on
index_merge on
index_merge_intersection on
diff --git a/mysql-test/suite/versioning/r/delete_history.result b/mysql-test/suite/versioning/r/delete_history.result
index 3681b25f592..a49ec025dff 100644
--- a/mysql-test/suite/versioning/r/delete_history.result
+++ b/mysql-test/suite/versioning/r/delete_history.result
@@ -168,6 +168,8 @@ x
explain extended delete history from t1 before system_time '2039-01-01 23:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using where
+Warnings:
+Note 1003 delete from `test`.`t1` FOR SYSTEM_TIME BEFORE TIMESTAMP '2039-01-01 23:00' using dual where `test`.`t1`.`row_end` < '2039-01-01 23:00' and is_history(`test`.`t1`.`row_end`)
create or replace procedure p() delete history from t1 before system_time '2039-01-01 23:00';
call p;
select * from t1;
diff --git a/mysql-test/suite/versioning/r/rpl.result b/mysql-test/suite/versioning/r/rpl.result
index a6ac9aad3ca..542e52f8606 100644
--- a/mysql-test/suite/versioning/r/rpl.result
+++ b/mysql-test/suite/versioning/r/rpl.result
@@ -165,6 +165,30 @@ update t1 set i = 0;
connection slave;
connection master;
drop table t1;
+# check versioned -> versioned replication without any keys on duplicate records
+connection master;
+create table t1 (a INT) with system versioning;
+insert into t1 values (1);
+insert into t1 values (1);
+delete from t1;
+connection slave;
+include/diff_tables.inc [master:test.t1,slave:test.t1]
+connection master;
+drop table t1;
+connection slave;
+# check unversioned -> versioned replication with non-unique keys on duplicate records
+connection master;
+set statement sql_log_bin=0 for create table t1 (a INT NOT NULL, b INT, INDEX(a,b));
+connection slave;
+set statement sql_log_bin=0 for create table t1 (a INT NOT NULL, b INT, INDEX(a,b)) with system versioning;
+connection master;
+insert into t1 values (1,1);
+insert into t1 values (1,1);
+delete from t1;
+connection slave;
+include/diff_tables.inc [master:test.t1,slave:test.t1]
+connection master;
+drop table t1;
#
# MDEV-17554 Auto-create new partition for system versioned tables
# with history partitioned by INTERVAL/LIMIT
diff --git a/mysql-test/suite/versioning/t/rpl.test b/mysql-test/suite/versioning/t/rpl.test
index 16e6af75dba..765d444f638 100644
--- a/mysql-test/suite/versioning/t/rpl.test
+++ b/mysql-test/suite/versioning/t/rpl.test
@@ -135,6 +135,40 @@ sync_slave_with_master;
connection master;
drop table t1;
+
+#
+# MDEV-30430: Enabling system versioning on tables without primary key breaks replication
+# Note that bugs are only present with row binlog format
+#
+--echo # check versioned -> versioned replication without any keys on duplicate records
+connection master;
+create table t1 (a INT) with system versioning;
+insert into t1 values (1);
+insert into t1 values (1);
+delete from t1;
+sync_slave_with_master;
+--let $diff_tables= master:test.t1,slave:test.t1
+--source include/diff_tables.inc
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+--echo # check unversioned -> versioned replication with non-unique keys on duplicate records
+connection master;
+set statement sql_log_bin=0 for create table t1 (a INT NOT NULL, b INT, INDEX(a,b));
+connection slave;
+set statement sql_log_bin=0 for create table t1 (a INT NOT NULL, b INT, INDEX(a,b)) with system versioning;
+connection master;
+insert into t1 values (1,1);
+insert into t1 values (1,1);
+delete from t1;
+sync_slave_with_master;
+--let $diff_tables= master:test.t1,slave:test.t1
+--source include/diff_tables.inc
+
+connection master;
+drop table t1;
+
--echo #
--echo # MDEV-17554 Auto-create new partition for system versioned tables
--echo # with history partitioned by INTERVAL/LIMIT
diff --git a/mysys/my_addr_resolve.c b/mysys/my_addr_resolve.c
index 2d4385f4684..376e73686e2 100644
--- a/mysys/my_addr_resolve.c
+++ b/mysys/my_addr_resolve.c
@@ -239,10 +239,10 @@ static int addr_resolve(void *ptr, my_addr_loc *loc)
}
- /* 500 ms should be plenty of time for addr2line to issue a response. */
+ /* 5000 ms should be plenty of time for addr2line to issue a response. */
/* Read in a loop till all the output from addr2line is complete. */
while (parsed == total_bytes_read &&
- (ret= poll(&poll_fds, 1, 500)))
+ (ret= poll(&poll_fds, 1, 5000)))
{
/* error during poll */
if (ret < 0)
@@ -286,7 +286,8 @@ static int addr_resolve(void *ptr, my_addr_loc *loc)
loc->line= atoi(output + line_number_start);
/* Addr2line was unable to extract any meaningful information. */
- if (strcmp(loc->file, "??") == 0 && loc->func[0] == '?')
+ if ((strcmp(loc->file, "??") == 0 || strcmp(loc->file, "") == 0) &&
+ (loc->func[0] == '?' || loc->line == 0))
return 6;
loc->file= strip_path(loc->file);
diff --git a/mysys/my_atomic_writes.c b/mysys/my_atomic_writes.c
index 42ee4e690cd..90d0f1d0261 100644
--- a/mysys/my_atomic_writes.c
+++ b/mysys/my_atomic_writes.c
@@ -118,7 +118,7 @@ static my_bool test_if_shannon_card_exists()
char path[32];
struct stat stat_buff;
- sprintf(path, "/dev/df%c", dev_part);
+ snprintf(path, sizeof(path), "/dev/df%c", dev_part);
#ifdef TEST_SHANNON
if (stat(path, &stat_buff) < 0)
{
@@ -127,8 +127,10 @@ static my_bool test_if_shannon_card_exists()
}
#endif
shannon_devices[shannon_found_devices].st_dev= stat_buff.st_rdev;
- sprintf(shannon_devices[shannon_found_devices].dev_name, "/dev/sct%c",
- dev_part);
+ snprintf(shannon_devices[shannon_found_devices].dev_name,
+ sizeof(shannon_devices[shannon_found_devices].dev_name),
+ "/dev/sct%c",
+ dev_part);
#ifdef TEST_SHANNON
printf("%s(): i=%d, stat_buff.st_dev=0x%lx, stat_buff.st_rdev=0x%lx, st_rdev=0x%lx, dev_name=%s\n",
@@ -151,13 +153,15 @@ static my_bool test_if_shannon_card_exists()
for (dev_no= 1 ; dev_no < 9 ; dev_no++)
{
- sprintf(path, "/dev/df%c%d", dev_part, dev_no);
+ snprintf(path, sizeof(path), "/dev/df%c%d", dev_part, dev_no);
if (stat(path, &stat_buff) < 0)
break;
shannon_devices[shannon_found_devices].st_dev= stat_buff.st_rdev;
- sprintf(shannon_devices[shannon_found_devices].dev_name, "/dev/sct%c%d",
- dev_part, dev_no);
+ snprintf(shannon_devices[shannon_found_devices].dev_name,
+ sizeof(shannon_devices[shannon_found_devices].dev_name),
+ "/dev/sct%c%d",
+ dev_part, dev_no);
#ifdef TEST_SHANNON
printf("%s(): i=%d, st_dev=0x%lx, st_rdev=0x%lx, dev_name=%s\n",
diff --git a/mysys/my_likely.c b/mysys/my_likely.c
index 2ae587be18d..d52074f01e4 100644
--- a/mysys/my_likely.c
+++ b/mysys/my_likely.c
@@ -76,7 +76,7 @@ void end_my_likely(FILE *out)
if (!(likely_file= out))
{
char name[80];
- sprintf(name, "/tmp/unlikely-%lu.out", (ulong) getpid());
+ snprintf(name, sizeof(name), "/tmp/unlikely-%lu.out", (ulong) getpid());
if ((likely_file= my_fopen(name, O_TRUNC | O_WRONLY, MYF(MY_WME))))
do_close= 1;
else
diff --git a/mysys/my_rdtsc.c b/mysys/my_rdtsc.c
index ffd816024e5..e16825cedd2 100644
--- a/mysys/my_rdtsc.c
+++ b/mysys/my_rdtsc.c
@@ -368,29 +368,7 @@ void my_timer_init(MY_TIMER_INFO *mti)
/* cycles */
mti->cycles.frequency= 1000000000;
-#if defined _WIN32 || defined __i386__ || defined __x86_64__
- mti->cycles.routine= MY_TIMER_ROUTINE_RDTSC;
-#elif defined(__INTEL_COMPILER) && defined(__ia64__) && defined(HAVE_IA64INTRIN_H)
- mti->cycles.routine= MY_TIMER_ROUTINE_ASM_IA64;
-#elif defined(__GNUC__) && defined(__ia64__)
- mti->cycles.routine= MY_TIMER_ROUTINE_ASM_IA64;
-#elif defined __GNUC__ && defined __powerpc__
- mti->cycles.routine= MY_TIMER_ROUTINE_PPC_GET_TIMEBASE;
-#elif defined(__GNUC__) && defined(__sparcv9) && defined(_LP64) && (__GNUC__>2)
- mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC64;
-#elif defined(__GNUC__) && defined(__sparc__) && !defined(_LP64) && (__GNUC__>2)
- mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC32;
-#elif defined(__GNUC__) && defined(__s390__)
- mti->cycles.routine= MY_TIMER_ROUTINE_ASM_S390;
-#elif defined(__GNUC__) && defined (__aarch64__)
- mti->cycles.routine= MY_TIMER_ROUTINE_AARCH64;
-#elif defined(__GNUC__) && defined (__riscv)
- mti->cycles.routine= MY_TIMER_ROUTINE_RISCV;
-#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
- mti->cycles.routine= MY_TIMER_ROUTINE_GETHRTIME;
-#else
- mti->cycles.routine= 0;
-#endif
+ mti->cycles.routine= MY_TIMER_ROUTINE_CYCLES;
if (!mti->cycles.routine || !my_timer_cycles())
{
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index cde34e5bdb9..fd8a99c2196 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -421,7 +421,7 @@ const char *my_thread_name(void)
if (!tmp->name[0])
{
my_thread_id id= my_thread_dbug_id();
- sprintf(name_buff,"T@%lu", (ulong) id);
+ snprintf(name_buff, sizeof(name_buff), "T@%lu", (ulong) id);
strmake_buf(tmp->name, name_buff);
}
return tmp->name;
diff --git a/plugin/auth_pam/testing/pam_mariadb_mtr.c b/plugin/auth_pam/testing/pam_mariadb_mtr.c
index f61a8da7682..108aeb941ac 100644
--- a/plugin/auth_pam/testing/pam_mariadb_mtr.c
+++ b/plugin/auth_pam/testing/pam_mariadb_mtr.c
@@ -45,6 +45,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags __attribute__((unused)),
else
{
free(resp);
+ resp= NULL;
msg[0].msg_style = PAM_PROMPT_ECHO_ON;
msg[0].msg = (char*)"PIN:";
pam_err = (*conv->conv)(1, msgp, &resp, conv->appdata_ptr);
diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc
index cb254d69ec3..ba4850f4cba 100644
--- a/plugin/feedback/feedback.cc
+++ b/plugin/feedback/feedback.cc
@@ -366,7 +366,7 @@ static MYSQL_SYSVAR_STR(user_info, user_info,
NULL, NULL, "");
static MYSQL_SYSVAR_STR(url, url, PLUGIN_VAR_READONLY | PLUGIN_VAR_RQCMDARG,
"Space separated URLs to send the feedback report to.", NULL, NULL,
- DEFAULT_PROTO "mariadb.org/feedback_plugin/post");
+ DEFAULT_PROTO "feedback.mariadb.org/rest/v1/post");
static MYSQL_SYSVAR_ULONG(send_timeout, send_timeout, PLUGIN_VAR_RQCMDARG,
"Timeout (in seconds) for the sending the report.",
NULL, NULL, 60, 1, 60*60*24, 1);
diff --git a/scripts/mariadb_system_tables_fix.sql b/scripts/mariadb_system_tables_fix.sql
index a46c49c88b0..7d8fcd9aa0f 100644
--- a/scripts/mariadb_system_tables_fix.sql
+++ b/scripts/mariadb_system_tables_fix.sql
@@ -288,7 +288,6 @@ SET GLOBAL general_log = 'OFF';
ALTER TABLE general_log
MODIFY event_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
MODIFY user_host MEDIUMTEXT NOT NULL,
- MODIFY thread_id INTEGER NOT NULL,
MODIFY server_id INTEGER UNSIGNED NOT NULL,
MODIFY command_type VARCHAR(64) NOT NULL,
MODIFY argument MEDIUMTEXT NOT NULL,
@@ -850,3 +849,8 @@ IF 1 = (SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def
END IF//
DELIMITER ;
+
+# MDEV-22683 - upgrade Host and Owner of servers
+ALTER TABLE servers
+ MODIFY Host varchar(2048) NOT NULL DEFAULT '',
+ MODIFY Owner varchar(512) NOT NULL DEFAULT '';
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh
index a6934f3881f..45205204c93 100644
--- a/scripts/wsrep_sst_mariabackup.sh
+++ b/scripts/wsrep_sst_mariabackup.sh
@@ -95,9 +95,9 @@ sst_ver=1
declare -a RC
-BACKUP_BIN=$(commandex 'mariabackup')
+BACKUP_BIN=$(commandex 'mariadb-backup')
if [ -z "$BACKUP_BIN" ]; then
- wsrep_log_error 'mariabackup binary not found in path'
+ wsrep_log_error 'mariadb-backup binary not found in path'
exit 42
fi
@@ -340,6 +340,9 @@ get_transfer()
"Use workaround for socat $SOCAT_VERSION bug"
fi
fi
+ if check_for_version "$SOCAT_VERSION" '1.7.4'; then
+ tcmd="$tcmd,no-sni=1"
+ fi
fi
if [ "${sockopt#*,dhparam=}" = "$sockopt" ]; then
@@ -685,7 +688,7 @@ cleanup_at_exit()
if [ -n "$BACKUP_PID" ]; then
if check_pid "$BACKUP_PID" 1; then
wsrep_log_error \
- "mariabackup process is still running. Killing..."
+ "mariadb-backup process is still running. Killing..."
cleanup_pid $CHECK_PID "$BACKUP_PID"
fi
fi
@@ -761,7 +764,7 @@ check_extra()
if [ "$thread_handling" = 'pool-of-threads' ]; then
local eport=$(parse_cnf '--mysqld' 'extra-port')
if [ -n "$eport" ]; then
- # mariabackup works only locally.
+ # mariadb-backup works only locally.
# Hence, setting host to 127.0.0.1 unconditionally:
wsrep_log_info "SST through extra_port $eport"
INNOEXTRA="$INNOEXTRA --host=127.0.0.1 --port=$eport"
@@ -930,7 +933,7 @@ cd "$OLD_PWD"
if [ $ssyslog -eq 1 ]; then
if [ -n "$(commandex logger)" ]; then
- wsrep_log_info "Logging all stderr of SST/mariabackup to syslog"
+ wsrep_log_info "Logging all stderr of SST/mariadb-backup to syslog"
exec 2> >(logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE)
@@ -1053,11 +1056,11 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
xtmpdir=$(TMPDIR="$tmpdir"; mktemp '-d')
fi
- wsrep_log_info "Using '$xtmpdir' as mariabackup temporary directory"
+ wsrep_log_info "Using '$xtmpdir' as mariadb-backup temporary directory"
tmpopts=" --tmpdir='$xtmpdir'"
itmpdir="$(mktemp -d)"
- wsrep_log_info "Using '$itmpdir' as mariabackup working directory"
+ wsrep_log_info "Using '$itmpdir' as mariadb-abackup working directory"
usrst=0
if [ -n "$WSREP_SST_OPT_USER" ]; then
@@ -1148,7 +1151,7 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
fi
# if compression is enabled for backup files, then add the
- # appropriate options to the mariabackup command line:
+ # appropriate options to the mariadb-backup command line:
if [ "$compress" != 'none' ]; then
iopts="--compress${compress:+=$compress}${iopts:+ }$iopts"
if [ -n "$compress_threads" ]; then
@@ -1170,7 +1173,7 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
set -e
if [ ${RC[0]} -ne 0 ]; then
- wsrep_log_error "mariabackup finished with error: ${RC[0]}." \
+ wsrep_log_error "mariadb-backup finished with error: ${RC[0]}." \
"Check syslog or '$INNOBACKUPLOG' for details"
exit 22
elif [ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]; then
@@ -1178,7 +1181,7 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
exit 22
fi
- # mariabackup implicitly writes PID to fixed location in $xtmpdir
+ # mariadb-backup implicitly writes PID to fixed location in $xtmpdir
BACKUP_PID="$xtmpdir/xtrabackup_pid"
else # BYPASS FOR IST
@@ -1450,14 +1453,14 @@ else # joiner
if [ ! -s "$DATA/mariadb_backup_checkpoints" ]; then
wsrep_log_error "mariadb_backup_checkpoints missing," \
- "failed mariabackup/SST on donor"
+ "failed mariadb-backup/SST on donor"
exit 2
fi
- # Compact backups are not supported by mariabackup
+ # Compact backups are not supported by mariadb-backup
if grep -qw -F 'compact = 1' "$DATA/mariadb_backup_checkpoints"; then
wsrep_log_info "Index compaction detected"
- wsrel_log_error "Compact backups are not supported by mariabackup"
+ wsrel_log_error "Compact backups are not supported by mariadb-backup"
exit 2
fi
@@ -1509,9 +1512,9 @@ else # joiner
wsrep_log_info "Preparing the backup at $DATA"
setup_commands
- timeit 'mariabackup prepare stage' "$INNOAPPLY"
+ timeit 'mariadb-backup prepare stage' "$INNOAPPLY"
if [ $? -ne 0 ]; then
- wsrep_log_error "mariabackup apply finished with errors." \
+ wsrep_log_error "mariadb-backup apply finished with errors." \
"Check syslog or '$INNOAPPLYLOG' for details."
exit 22
fi
@@ -1556,7 +1559,7 @@ else # joiner
MAGIC_FILE="$TDATA/$INFO_FILE"
wsrep_log_info "Moving the backup to $TDATA"
- timeit 'mariabackup move stage' "$INNOMOVE"
+ timeit 'mariadb-backup move stage' "$INNOMOVE"
if [ $? -eq 0 ]; then
wsrep_log_info "Move successful, removing $DATA"
rm -rf "$DATA"
diff --git a/sql-common/client.c b/sql-common/client.c
index f58601055f0..58989a3d63e 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -4098,7 +4098,7 @@ int STDCALL mysql_set_character_set(MYSQL *mysql, const char *cs_name)
/* Skip execution of "SET NAMES" for pre-4.1 servers */
if (mysql_get_server_version(mysql) < 40100)
return 0;
- sprintf(buff, "SET NAMES %s", cs_name);
+ snprintf(buff, sizeof(buff), "SET NAMES %s", cs_name);
if (!mysql_real_query(mysql, buff, (uint) strlen(buff)))
{
mysql->charset= cs;
diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc
index eac111d32d7..f363816fe49 100644
--- a/sql/debug_sync.cc
+++ b/sql/debug_sync.cc
@@ -1451,7 +1451,7 @@ uchar *debug_sync_value_ptr(THD *thd)
if (opt_debug_sync_timeout)
{
- static char on[]= "ON - current signals: '";
+ static const char on[]= "ON - current signals: '";
// Ensure exclusive access to debug_sync_global.ds_signal
mysql_mutex_lock(&debug_sync_global.ds_mutex);
diff --git a/sql/field.cc b/sql/field.cc
index 5a618a5a2a9..2418d692c72 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -2557,6 +2557,7 @@ Field *Field::make_new_field(MEM_ROOT *root, TABLE *new_table,
tmp->key_start.init(0);
tmp->part_of_key.init(0);
tmp->part_of_sortkey.init(0);
+ tmp->read_stats= NULL;
/*
TODO: it is not clear why this method needs to reset unireg_check.
Try not to reset it, or explain why it needs to be reset.
@@ -7622,7 +7623,8 @@ int Field_string::cmp(const uchar *a_ptr, const uchar *b_ptr) const
return field_charset()->coll->strnncollsp_nchars(field_charset(),
a_ptr, field_length,
b_ptr, field_length,
- Field_string::char_length());
+ Field_string::char_length(),
+ MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES);
}
@@ -8002,10 +8004,11 @@ int Field_varstring::cmp(const uchar *a_ptr, const uchar *b_ptr) const
int Field_varstring::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr,
- size_t prefix_len) const
+ size_t prefix_char_len) const
{
- /* avoid expensive well_formed_char_length if possible */
- if (prefix_len == table->field[field_index]->field_length)
+ /* avoid more expensive strnncollsp_nchars() if possible */
+ if (prefix_char_len * field_charset()->mbmaxlen ==
+ table->field[field_index]->field_length)
return Field_varstring::cmp(a_ptr, b_ptr);
size_t a_length, b_length;
@@ -8025,8 +8028,8 @@ int Field_varstring::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr,
a_length,
b_ptr + length_bytes,
b_length,
- prefix_len /
- field_charset()->mbmaxlen);
+ prefix_char_len,
+ 0);
}
@@ -8813,7 +8816,7 @@ int Field_blob::cmp(const uchar *a_ptr, const uchar *b_ptr) const
int Field_blob::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr,
- size_t prefix_len) const
+ size_t prefix_char_len) const
{
uchar *blob1,*blob2;
memcpy(&blob1, a_ptr+packlength, sizeof(char*));
@@ -8822,8 +8825,8 @@ int Field_blob::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr,
return field_charset()->coll->strnncollsp_nchars(field_charset(),
blob1, a_len,
blob2, b_len,
- prefix_len /
- field_charset()->mbmaxlen);
+ prefix_char_len,
+ 0);
}
@@ -10008,7 +10011,7 @@ my_decimal *Field_bit::val_decimal(my_decimal *deciaml_value)
(not the table->record[0] necessarily)
*/
int Field_bit::cmp_prefix(const uchar *a, const uchar *b,
- size_t prefix_len) const
+ size_t prefix_char_len) const
{
my_ptrdiff_t a_diff= a - ptr;
my_ptrdiff_t b_diff= b - ptr;
diff --git a/sql/field.h b/sql/field.h
index d4b59a88f59..642456b9774 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1301,7 +1301,7 @@ public:
Currently it's only used in partitioning.
*/
virtual int cmp_prefix(const uchar *a, const uchar *b,
- size_t prefix_len) const
+ size_t prefix_char_len) const
{ return cmp(a, b); }
virtual int cmp(const uchar *,const uchar *) const=0;
virtual int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0U) const
@@ -4201,7 +4201,7 @@ public:
my_decimal *val_decimal(my_decimal *) override;
bool send(Protocol *protocol) override;
int cmp(const uchar *a,const uchar *b) const override;
- int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len) const
+ int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_char_len) const
override;
void sort_string(uchar *buff,uint length) override;
uint get_key_image(uchar *buff, uint length,
@@ -4494,7 +4494,7 @@ public:
String *val_str(String *, String *) override;
my_decimal *val_decimal(my_decimal *) override;
int cmp(const uchar *a, const uchar *b) const override;
- int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len) const
+ int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_char_len) const
override;
int cmp(const uchar *a, uint32 a_length, const uchar *b, uint32 b_length)
const;
@@ -4973,7 +4973,7 @@ public:
int cmp_binary_offset(uint row_offset) override
{ return cmp_offset(row_offset); }
int cmp_prefix(const uchar *a, const uchar *b,
- size_t max_length) const override;
+ size_t prefix_char_length) const override;
int key_cmp(const uchar *a, const uchar *b) const override
{ return cmp_binary((uchar *) a, (uchar *) b); }
int key_cmp(const uchar *str, uint length) const override;
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 96eabfdab89..026c9d0d670 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -242,7 +242,7 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort,
MYSQL_FILESORT_START(table->s->db.str, table->s->table_name.str);
DEBUG_SYNC(thd, "filesort_start");
- if (!(sort= new SORT_INFO))
+ if (!(sort= new SORT_INFO)) // Note that this is not automatically freed!
return 0;
if (subselect && subselect->filesort_buffer.is_allocated())
@@ -490,6 +490,7 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort,
error= 0;
err:
+ param.tmp_buffer.free();
if (!subselect || !subselect->is_uncacheable())
{
if (!param.using_addon_fields())
@@ -1169,7 +1170,7 @@ void store_length(uchar *to, uint length, uint pack_length)
void
Type_handler_string_result::make_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const
+ String *tmp_buffer) const
{
CHARSET_INFO *cs= item->collation.collation;
bool maybe_null= item->maybe_null();
@@ -1177,7 +1178,7 @@ Type_handler_string_result::make_sort_key_part(uchar *to, Item *item,
if (maybe_null)
*to++= 1;
- String *res= item->str_result(&param->tmp_buffer);
+ Binary_string *res= item->str_result(tmp_buffer);
if (!res)
{
if (maybe_null)
@@ -1239,7 +1240,7 @@ Type_handler_string_result::make_sort_key_part(uchar *to, Item *item,
void
Type_handler_int_result::make_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const
+ String *tmp_buffer) const
{
longlong value= item->val_int_result();
make_sort_key_longlong(to, item->maybe_null(), item->null_value,
@@ -1250,7 +1251,7 @@ Type_handler_int_result::make_sort_key_part(uchar *to, Item *item,
void
Type_handler_temporal_result::make_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const
+ String *tmp_buffer) const
{
MYSQL_TIME buf;
// This is a temporal type. No nanoseconds. Rounding mode is not important.
@@ -1272,7 +1273,7 @@ Type_handler_temporal_result::make_sort_key_part(uchar *to, Item *item,
void
Type_handler_timestamp_common::make_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const
+ String *tmp_buffer) const
{
THD *thd= current_thd;
uint binlen= my_timestamp_binary_length(item->decimals);
@@ -1365,7 +1366,7 @@ Type_handler::make_packed_sort_key_longlong(uchar *to, bool maybe_null,
void
Type_handler_decimal_result::make_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const
+ String *tmp_buffer) const
{
my_decimal dec_buf, *dec_val= item->val_decimal_result(&dec_buf);
if (item->maybe_null())
@@ -1385,7 +1386,7 @@ Type_handler_decimal_result::make_sort_key_part(uchar *to, Item *item,
void
Type_handler_real_result::make_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const
+ String *tmp_buffer) const
{
double value= item->val_result();
if (item->maybe_null())
@@ -2492,7 +2493,7 @@ void Sort_param::try_to_pack_sortkeys()
uint
Type_handler_string_result::make_packed_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const
+ String *tmp) const
{
CHARSET_INFO *cs= item->collation.collation;
bool maybe_null= item->maybe_null();
@@ -2500,7 +2501,7 @@ Type_handler_string_result::make_packed_sort_key_part(uchar *to, Item *item,
if (maybe_null)
*to++= 1;
- Binary_string *res= item->str_result(&param->tmp_buffer);
+ Binary_string *res= item->str_result(tmp);
if (!res)
{
if (maybe_null)
@@ -2531,7 +2532,7 @@ Type_handler_string_result::make_packed_sort_key_part(uchar *to, Item *item,
uint
Type_handler_int_result::make_packed_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const
+ String *tmp) const
{
longlong value= item->val_int_result();
return make_packed_sort_key_longlong(to, item->maybe_null(),
@@ -2543,7 +2544,7 @@ Type_handler_int_result::make_packed_sort_key_part(uchar *to, Item *item,
uint
Type_handler_decimal_result::make_packed_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const
+ String *tmp) const
{
my_decimal dec_buf, *dec_val= item->val_decimal_result(&dec_buf);
if (item->maybe_null())
@@ -2565,7 +2566,7 @@ Type_handler_decimal_result::make_packed_sort_key_part(uchar *to, Item *item,
uint
Type_handler_real_result::make_packed_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const
+ String *tmp) const
{
double value= item->val_result();
if (item->maybe_null())
@@ -2586,7 +2587,7 @@ Type_handler_real_result::make_packed_sort_key_part(uchar *to, Item *item,
uint
Type_handler_temporal_result::make_packed_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const
+ String *tmp) const
{
MYSQL_TIME buf;
// This is a temporal type. No nanoseconds. Rounding mode is not important.
@@ -2608,7 +2609,7 @@ Type_handler_temporal_result::make_packed_sort_key_part(uchar *to, Item *item,
uint
Type_handler_timestamp_common::make_packed_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const
+ String *tmp) const
{
THD *thd= current_thd;
uint binlen= my_timestamp_binary_length(item->decimals);
@@ -2952,7 +2953,8 @@ static uint make_sortkey(Sort_param *param, uchar *to)
{ // Item
sort_field->item->type_handler()->make_sort_key_part(to,
sort_field->item,
- sort_field, param);
+ sort_field,
+ &param->tmp_buffer);
if ((maybe_null= sort_field->item->maybe_null()))
to++;
}
@@ -3005,7 +3007,7 @@ static uint make_packed_sortkey(Sort_param *param, uchar *to)
Item *item= sort_field->item;
length= item->type_handler()->make_packed_sort_key_part(to, item,
sort_field,
- param);
+ &param->tmp_buffer);
if ((maybe_null= sort_field->item->maybe_null()))
to++;
}
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index 86d8cdb7cee..bb8cd2b2db1 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -1302,7 +1302,18 @@ public:
The following code is not safe if you are using different
storage engines or different index types per partition.
*/
- return m_file[0]->index_flags(inx, part, all_parts);
+ ulong part_flags= m_file[0]->index_flags(inx, part, all_parts);
+
+ /*
+ The underlying storage engine might support Rowid Filtering. But
+ ha_partition does not forward the needed SE API calls, so the feature
+ will not be used.
+
+ Note: It's the same with IndexConditionPushdown, except for its variant
+ of IndexConditionPushdown+BatchedKeyAccess (that one works). Because of
+ that, we do not clear HA_DO_INDEX_COND_PUSHDOWN here.
+ */
+ return part_flags & ~HA_DO_RANGE_FILTER_PUSHDOWN;
}
/**
diff --git a/sql/ha_sequence.cc b/sql/ha_sequence.cc
index b348e6e7025..bab0614706d 100644
--- a/sql/ha_sequence.cc
+++ b/sql/ha_sequence.cc
@@ -250,6 +250,8 @@ int ha_sequence::write_row(const uchar *buf)
on master and slaves
- Check that the new row is an accurate SEQUENCE object
*/
+ /* mark a full binlog image insert to force non-parallel slave */
+ thd->transaction->stmt.mark_trans_did_ddl();
if (table->s->tmp_table == NO_TMP_TABLE &&
thd->mdl_context.upgrade_shared_lock(table->mdl_ticket,
MDL_EXCLUSIVE,
diff --git a/sql/handler.cc b/sql/handler.cc
index 595e76c708b..a50cdeaf9dd 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1863,7 +1863,19 @@ int ha_commit_trans(THD *thd, bool all)
ordering is normally done. Commit ordering must be done here.
*/
if (run_wsrep_hooks)
- error= wsrep_before_commit(thd, all);
+ {
+ // This commit involves more than one storage engine and requires
+ // two phases, but some engines don't support it.
+ // Issue a message to the client and roll back the transaction.
+ if (trans->no_2pc && rw_ha_count > 1)
+ {
+ my_message(ER_ERROR_DURING_COMMIT, "Transactional commit not supported "
+ "by involved engine(s)", MYF(0));
+ error= 1;
+ }
+ else
+ error= wsrep_before_commit(thd, all);
+ }
if (error)
{
ha_rollback_trans(thd, FALSE);
@@ -2201,8 +2213,11 @@ int ha_rollback_trans(THD *thd, bool all)
rollback without signalling following transactions. And in release
builds, we explicitly do the signalling before rolling back.
*/
- DBUG_ASSERT(!(thd->rgi_slave && thd->rgi_slave->did_mark_start_commit) ||
- thd->transaction->xid_state.is_explicit_XA());
+ DBUG_ASSERT(
+ !(thd->rgi_slave && thd->rgi_slave->did_mark_start_commit) ||
+ (thd->transaction->xid_state.is_explicit_XA() ||
+ (thd->rgi_slave->gtid_ev_flags2 & Gtid_log_event::FL_PREPARED_XA)));
+
if (thd->rgi_slave && thd->rgi_slave->did_mark_start_commit)
thd->rgi_slave->unmark_start_commit();
}
@@ -4823,7 +4838,7 @@ int handler::check_collation_compatibility()
{
ulong mysql_version= table->s->mysql_version;
- if (mysql_version < 50124)
+ if (mysql_version < Charset::latest_mariadb_version_with_collation_change())
{
KEY *key= table->key_info;
KEY *key_end= key + table->s->keys;
@@ -4837,18 +4852,7 @@ int handler::check_collation_compatibility()
continue;
Field *field= table->field[key_part->fieldnr - 1];
uint cs_number= field->charset()->number;
- if ((mysql_version < 50048 &&
- (cs_number == 11 || /* ascii_general_ci - bug #29499, bug #27562 */
- cs_number == 41 || /* latin7_general_ci - bug #29461 */
- cs_number == 42 || /* latin7_general_cs - bug #29461 */
- cs_number == 20 || /* latin7_estonian_cs - bug #29461 */
- cs_number == 21 || /* latin2_hungarian_ci - bug #29461 */
- cs_number == 22 || /* koi8u_general_ci - bug #29461 */
- cs_number == 23 || /* cp1251_ukrainian_ci - bug #29461 */
- cs_number == 26)) || /* cp1250_general_ci - bug #29461 */
- (mysql_version < 50124 &&
- (cs_number == 33 || /* utf8mb3_general_ci - bug #27877 */
- cs_number == 35))) /* ucs2_general_ci - bug #27877 */
+ if (Charset::collation_changed_order(mysql_version, cs_number))
return HA_ADMIN_NEEDS_UPGRADE;
}
}
@@ -7381,7 +7385,13 @@ static int wsrep_after_row(THD *thd)
thd->wsrep_affected_rows > wsrep_max_ws_rows &&
wsrep_thd_is_local(thd))
{
- trans_rollback_stmt(thd) || trans_rollback(thd);
+ /*
+ If we are inside stored function or trigger we should not commit or
+ rollback current statement transaction. See comment in ha_commit_trans()
+ call for more information.
+ */
+ if (!thd->in_sub_stmt)
+ trans_rollback_stmt(thd) || trans_rollback(thd);
my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0));
DBUG_RETURN(ER_ERROR_DURING_COMMIT);
}
@@ -8171,11 +8181,13 @@ static
int del_global_index_stats_for_table(THD *thd, uchar* cache_key, size_t cache_key_length)
{
int res = 0;
+ uint to_delete_counter= 0;
+ INDEX_STATS *index_stats_to_delete[MAX_INDEXES];
DBUG_ENTER("del_global_index_stats_for_table");
mysql_mutex_lock(&LOCK_global_index_stats);
- for (uint i= 0; i < global_index_stats.records;)
+ for (uint i= 0; i < global_index_stats.records; i++)
{
INDEX_STATS *index_stats =
(INDEX_STATS*) my_hash_element(&global_index_stats, i);
@@ -8185,19 +8197,13 @@ int del_global_index_stats_for_table(THD *thd, uchar* cache_key, size_t cache_ke
index_stats->index_name_length >= cache_key_length &&
!memcmp(index_stats->index, cache_key, cache_key_length))
{
- res= my_hash_delete(&global_index_stats, (uchar*)index_stats);
- /*
- In our HASH implementation on deletion one elements
- is moved into a place where a deleted element was,
- and the last element is moved into the empty space.
- Thus we need to re-examine the current element, but
- we don't have to restart the search from the beginning.
- */
+ index_stats_to_delete[to_delete_counter++]= index_stats;
}
- else
- i++;
}
+ for (uint i= 0; i < to_delete_counter; i++)
+ res= my_hash_delete(&global_index_stats, (uchar*)index_stats_to_delete[i]);
+
mysql_mutex_unlock(&LOCK_global_index_stats);
DBUG_RETURN(res);
}
diff --git a/sql/item.cc b/sql/item.cc
index 499d23aa0f2..c55348bcdf3 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -5770,7 +5770,8 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
max_arg_level for the function if it's needed.
*/
if (thd->lex->in_sum_func &&
- thd->lex == context->select_lex->parent_lex &&
+ last_checked_context->select_lex->parent_lex ==
+ context->select_lex->parent_lex &&
thd->lex->in_sum_func->nest_level >= select->nest_level)
{
Item::Type ref_type= (*reference)->type();
@@ -5796,7 +5797,8 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
(Item_ident*) (*reference) :
0), false);
if (thd->lex->in_sum_func &&
- thd->lex == context->select_lex->parent_lex &&
+ last_checked_context->select_lex->parent_lex ==
+ context->select_lex->parent_lex &&
thd->lex->in_sum_func->nest_level >= select->nest_level)
{
set_if_bigger(thd->lex->in_sum_func->max_arg_level,
@@ -6145,10 +6147,8 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
goto mark_non_agg_field;
}
- if (!thd->lex->current_select->no_wrap_view_item &&
+ if (select && !thd->lex->current_select->no_wrap_view_item &&
thd->lex->in_sum_func &&
- select &&
- thd->lex == select->parent_lex &&
thd->lex->in_sum_func->nest_level ==
select->nest_level)
set_if_bigger(thd->lex->in_sum_func->max_arg_level,
@@ -8215,7 +8215,8 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
max_arg_level for the function if it's needed.
*/
if (thd->lex->in_sum_func &&
- thd->lex == context->select_lex->parent_lex &&
+ last_checked_context->select_lex->parent_lex ==
+ context->select_lex->parent_lex &&
thd->lex->in_sum_func->nest_level >=
last_checked_context->select_lex->nest_level)
set_if_bigger(thd->lex->in_sum_func->max_arg_level,
@@ -8239,7 +8240,8 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
max_arg_level for the function if it's needed.
*/
if (thd->lex->in_sum_func &&
- thd->lex == context->select_lex->parent_lex &&
+ last_checked_context->select_lex->parent_lex ==
+ context->select_lex->parent_lex &&
thd->lex->in_sum_func->nest_level >=
last_checked_context->select_lex->nest_level)
set_if_bigger(thd->lex->in_sum_func->max_arg_level,
@@ -8254,7 +8256,8 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
1. outer reference (will be fixed later by the fix_inner_refs function);
2. an unnamed reference inside an aggregate function.
*/
- if (!((*ref)->type() == REF_ITEM &&
+ if (!set_properties_only &&
+ !((*ref)->type() == REF_ITEM &&
((Item_ref *)(*ref))->ref_type() == OUTER_REF) &&
(((*ref)->with_sum_func() && name.str &&
!(current_sel->get_linkage() != GLOBAL_OPTIONS_TYPE &&
@@ -10591,7 +10594,8 @@ int Item_cache_str::save_in_field(Field *field, bool no_conversions)
bool Item_cache_row::allocate(THD *thd, uint num)
{
item_count= num;
- return (!(values=
+ return (!values &&
+ !(values=
(Item_cache **) thd->calloc(sizeof(Item_cache *)*item_count)));
}
@@ -10627,11 +10631,12 @@ bool Item_cache_row::setup(THD *thd, Item *item)
return 1;
for (uint i= 0; i < item_count; i++)
{
- Item_cache *tmp;
Item *el= item->element_index(i);
- if (!(tmp= values[i]= el->get_cache(thd)))
+
+ if ((!values[i]) && !(values[i]= el->get_cache(thd)))
return 1;
- tmp->setup(thd, el);
+
+ values[i]->setup(thd, el);
}
return 0;
}
diff --git a/sql/item.h b/sql/item.h
index 5b8b858c13c..ae503636116 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -7107,6 +7107,9 @@ public:
}
virtual void keep_array() {}
+#ifndef DBUG_OFF
+ bool is_array_kept() { return TRUE; }
+#endif
void print(String *str, enum_query_type query_type) override;
bool eq_def(const Field *field)
{
@@ -7595,13 +7598,14 @@ public:
bool null_inside() override;
void bring_value() override;
void keep_array() override { save_array= 1; }
+#ifndef DBUG_OFF
+ bool is_array_kept() { return save_array; }
+#endif
void cleanup() override
{
DBUG_ENTER("Item_cache_row::cleanup");
Item_cache::cleanup();
- if (save_array)
- bzero(values, item_count*sizeof(Item**));
- else
+ if (!save_array)
values= 0;
DBUG_VOID_RETURN;
}
@@ -7832,7 +7836,7 @@ public:
Item *get_tmp_table_item(THD *thd)
{ return m_item->get_tmp_table_item(thd); }
Item *get_copy(THD *thd)
- { return m_item->get_copy(thd); }
+ { return get_item_copy<Item_direct_ref_to_item>(thd, this); }
COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
bool link_item_fields,
COND_EQUAL **cond_equal_ref)
@@ -7900,7 +7904,20 @@ public:
bool excl_dep_on_grouping_fields(st_select_lex *sel)
{ return m_item->excl_dep_on_grouping_fields(sel); }
bool is_expensive() { return m_item->is_expensive(); }
- Item* build_clone(THD *thd) { return get_copy(thd); }
+ void set_item(Item *item) { m_item= item; }
+ Item *build_clone(THD *thd)
+ {
+ Item *clone_item= m_item->build_clone(thd);
+ if (clone_item)
+ {
+ Item_direct_ref_to_item *copy= (Item_direct_ref_to_item *) get_copy(thd);
+ if (!copy)
+ return 0;
+ copy->set_item(clone_item);
+ return copy;
+ }
+ return 0;
+ }
void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
List<Item> &fields, uint flags)
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index b5f747219a5..8577bc4fb6b 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1292,9 +1292,22 @@ bool Item_in_optimizer::fix_left(THD *thd)
ref0= args[1]->get_IN_subquery()->left_exp_ptr();
args[0]= (*ref0);
}
- if ((*ref0)->fix_fields_if_needed(thd, ref0) ||
- (!cache && !(cache= (*ref0)->get_cache(thd))))
+ if ((*ref0)->fix_fields_if_needed(thd, ref0))
DBUG_RETURN(1);
+ if (!cache)
+ {
+ Query_arena *arena, backup;
+ arena= thd->activate_stmt_arena_if_needed(&backup);
+
+ bool rc= !(cache= (*ref0)->get_cache(thd));
+
+ if (arena)
+ thd->restore_active_arena(arena, &backup);
+
+ if (rc)
+ DBUG_RETURN(1);
+ cache->keep_array();
+ }
/*
During fix_field() expression could be substituted.
So we copy changes before use
@@ -1654,19 +1667,10 @@ longlong Item_in_optimizer::val_int()
}
-void Item_in_optimizer::keep_top_level_cache()
-{
- cache->keep_array();
- save_cache= 1;
-}
-
-
void Item_in_optimizer::cleanup()
{
DBUG_ENTER("Item_in_optimizer::cleanup");
Item_bool_func::cleanup();
- if (!save_cache)
- cache= 0;
expr_cache= 0;
DBUG_VOID_RETURN;
}
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index d34bad95a57..556374eff6a 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -375,8 +375,7 @@ class Item_in_optimizer: public Item_bool_func
protected:
Item_cache *cache;
Item *expr_cache;
- bool save_cache;
- /*
+ /*
Stores the value of "NULL IN (SELECT ...)" for uncorrelated subqueries:
UNKNOWN - "NULL in (SELECT ...)" has not yet been evaluated
FALSE - result is FALSE
@@ -386,7 +385,7 @@ protected:
public:
Item_in_optimizer(THD *thd, Item *a, Item *b):
Item_bool_func(thd, a, b), cache(0), expr_cache(0),
- save_cache(0), result_for_null_param(UNKNOWN)
+ result_for_null_param(UNKNOWN)
{
with_flags|= item_with_t::SUBQUERY;
}
@@ -403,7 +402,6 @@ public:
return name;
}
Item_cache **get_cache() { return &cache; }
- void keep_top_level_cache();
Item *transform(THD *thd, Item_transformer transformer, uchar *arg) override;
Item *expr_cache_insert_transformer(THD *thd, uchar *unused) override;
bool is_expensive_processor(void *arg) override;
diff --git a/sql/item_jsonfunc.h b/sql/item_jsonfunc.h
index b352391c083..17ffe943938 100644
--- a/sql/item_jsonfunc.h
+++ b/sql/item_jsonfunc.h
@@ -493,9 +493,14 @@ class Item_func_json_length: public Item_long_func
{
bool check_arguments() const override
{
- return args[0]->check_type_can_return_text(func_name_cstring()) ||
- (arg_count > 1 &&
- args[1]->check_type_general_purpose_string(func_name_cstring()));
+ const LEX_CSTRING name= func_name_cstring();
+ if (arg_count == 0 || arg_count > 2)
+ {
+ my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str);
+ return true;
+ }
+ return args[0]->check_type_can_return_text(name) ||
+ (arg_count > 1 && args[1]->check_type_general_purpose_string(name));
}
protected:
json_path_with_flags path;
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 4b2f1aecf45..53c5ecde103 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -3970,6 +3970,7 @@ String *Item_func_weight_string::val_str(String *str)
weigth_flags);
DBUG_ASSERT(frm_length <= tmp_length);
+ str->set_charset(&my_charset_bin);
str->length(frm_length);
null_value= 0;
return str;
@@ -4049,6 +4050,7 @@ String *Item_func_unhex::val_str(String *str)
from= res->ptr();
null_value= 0;
+ str->set_charset(&my_charset_bin);
str->length(length);
to= (char*) str->ptr();
if (res->length() % 2)
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 9e6c205ca76..e614421030a 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -407,11 +407,11 @@ bool Item_subselect::mark_as_dependent(THD *thd, st_select_lex *select,
{
is_correlated= TRUE;
Ref_to_outside *upper;
- if (!(upper= new (thd->stmt_arena->mem_root) Ref_to_outside()))
+ if (!(upper= new (thd->mem_root) Ref_to_outside()))
return TRUE;
upper->select= select;
upper->item= item;
- if (upper_refs.push_back(upper, thd->stmt_arena->mem_root))
+ if (upper_refs.push_back(upper, thd->mem_root))
return TRUE;
}
return FALSE;
@@ -2117,7 +2117,7 @@ Item_in_subselect::single_value_transformer(JOIN *join)
thd->lex->current_select= current;
/* We will refer to upper level cache array => we have to save it for SP */
- optimizer->keep_top_level_cache();
+ DBUG_ASSERT(optimizer->get_cache()[0]->is_array_kept());
/*
As far as Item_in_optimizer does not substitute itself on fix_fields
@@ -2517,7 +2517,7 @@ Item_in_subselect::row_value_transformer(JOIN *join)
}
// we will refer to upper level cache array => we have to save it in PS
- optimizer->keep_top_level_cache();
+ DBUG_ASSERT(optimizer->get_cache()[0]->is_array_kept());
thd->lex->current_select= current;
/*
@@ -4680,6 +4680,12 @@ void subselect_uniquesubquery_engine::print(String *str,
{
str->append(STRING_WITH_LEN("<primary_index_lookup>("));
tab->ref.items[0]->print(str, query_type);
+ if (!tab->table)
+ {
+ // table is not opened so unknown
+ str->append(')');
+ return;
+ }
str->append(STRING_WITH_LEN(" in "));
if (tab->table->s->table_category == TABLE_CATEGORY_TEMPORARY)
{
@@ -5268,7 +5274,7 @@ bool subselect_hash_sj_engine::init(List<Item> *tmp_columns, uint subquery_id)
//fprintf(stderr, "Q: %s\n", current_thd->query());
DBUG_ASSERT(0);
DBUG_ASSERT(
- tmp_table->s->uniques ||
+ (tmp_table->key_info->flags & HA_UNIQUE_HASH) ||
tmp_table->key_info->key_length >= tmp_table->file->max_key_length() ||
tmp_table->key_info->user_defined_key_parts >
tmp_table->file->max_key_parts());
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 72de21ee483..ffac6dbb912 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -428,7 +428,8 @@ bool Item_sum::register_sum_func(THD *thd, Item **ref)
sl= sl->master_unit()->outer_select() )
sl->master_unit()->item->with_flags|= item_with_t::SUM_FUNC;
}
- thd->lex->current_select->mark_as_dependent(thd, aggr_sel, NULL);
+ if (aggr_sel)
+ thd->lex->current_select->mark_as_dependent(thd, aggr_sel, NULL);
if ((thd->lex->describe & DESCRIBE_EXTENDED) && aggr_sel)
{
diff --git a/sql/key.cc b/sql/key.cc
index b65851cf7c1..4e40a3354ce 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -615,7 +615,8 @@ int key_rec_cmp(void *key_p, uchar *first_rec, uchar *second_rec)
that take the max length into account.
*/
if ((result= field->cmp_prefix(field->ptr+first_diff, field->ptr+sec_diff,
- key_part->length)))
+ key_part->length /
+ field->charset()->mbmaxlen)))
DBUG_RETURN(result * GREATER);
next_loop:
key_part++;
diff --git a/sql/log.cc b/sql/log.cc
index 48e5145210c..7545d5baed5 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -418,7 +418,7 @@ private:
Rows_log_event *m_pending;
/*
- Bit flags for what has been writting to cache. Used to
+ Bit flags for what has been writing to cache. Used to
discard logs without any data changes.
see enum_logged_status;
*/
@@ -11980,7 +11980,10 @@ get_gtid_list_event(IO_CACHE *cache, Gtid_list_log_event **out_gtid_list)
if (typ == START_ENCRYPTION_EVENT)
{
if (fdle->start_decryption((Start_encryption_log_event*) ev))
+ {
errormsg= "Could not set up decryption for binlog.";
+ break;
+ }
}
delete ev;
if (typ == ROTATE_EVENT || typ == STOP_EVENT ||
diff --git a/sql/log_event.h b/sql/log_event.h
index 6b8853493be..41989192b53 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -721,7 +721,7 @@ enum Log_event_type
/*
- Bit flags for what has been writting to cache. Used to
+ Bit flags for what has been writing to cache. Used to
discard logs with table map events but not row events and
nothing else important. This is stored by cache.
*/
@@ -2716,7 +2716,7 @@ private:
virtual int do_commit()= 0;
virtual int do_apply_event(rpl_group_info *rgi);
int do_record_gtid(THD *thd, rpl_group_info *rgi, bool in_trans,
- void **out_hton);
+ void **out_hton, bool force_err= false);
enum_skip_reason do_shall_skip(rpl_group_info *rgi);
virtual const char* get_query()= 0;
#endif
diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc
index 3910d910da1..6c71381a1fb 100644
--- a/sql/log_event_server.cc
+++ b/sql/log_event_server.cc
@@ -153,6 +153,30 @@ is_parallel_retry_error(rpl_group_info *rgi, int err)
return has_temporary_error(rgi->thd);
}
+/**
+ Accumulate a Diagnostics_area's errors and warnings into an output buffer
+
+ @param errbuf The output buffer to write error messages
+ @param errbuf_size The size of the output buffer
+ @param da The Diagnostics_area to check for errors
+*/
+static void inline aggregate_da_errors(char *errbuf, size_t errbuf_size,
+ Diagnostics_area *da)
+{
+ const char *errbuf_end= errbuf + errbuf_size;
+ char *slider;
+ Diagnostics_area::Sql_condition_iterator it= da->sql_conditions();
+ const Sql_condition *err;
+ size_t len;
+ for (err= it++, slider= errbuf; err && slider < errbuf_end - 1;
+ slider += len, err= it++)
+ {
+ len= my_snprintf(slider, errbuf_end - slider,
+ " %s, Error_code: %d;", err->get_message_text(),
+ err->get_sql_errno());
+ }
+}
+
/**
Error reporting facility for Rows_log_event::do_apply_event
@@ -173,13 +197,8 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error,
const char *log_name, my_off_t pos)
{
const char *handler_error= (ha_error ? HA_ERR(ha_error) : NULL);
- char buff[MAX_SLAVE_ERRMSG], *slider;
- const char *buff_end= buff + sizeof(buff);
- size_t len;
- Diagnostics_area::Sql_condition_iterator it=
- thd->get_stmt_da()->sql_conditions();
+ char buff[MAX_SLAVE_ERRMSG];
Relay_log_info const *rli= rgi->rli;
- const Sql_condition *err;
buff[0]= 0;
int errcode= thd->is_error() ? thd->get_stmt_da()->sql_errno() : 0;
@@ -192,13 +211,7 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error,
if (is_parallel_retry_error(rgi, errcode))
return;
- for (err= it++, slider= buff; err && slider < buff_end - 1;
- slider += len, err= it++)
- {
- len= my_snprintf(slider, buff_end - slider,
- " %s, Error_code: %d;", err->get_message_text(),
- err->get_sql_errno());
- }
+ aggregate_da_errors(buff, sizeof(buff), thd->get_stmt_da());
if (ha_error != 0 && !thd->killed)
rli->report(level, errcode, rgi->gtid_info(),
@@ -3571,7 +3584,8 @@ bool slave_execute_deferred_events(THD *thd)
#if defined(HAVE_REPLICATION)
int Xid_apply_log_event::do_record_gtid(THD *thd, rpl_group_info *rgi,
- bool in_trans, void **out_hton)
+ bool in_trans, void **out_hton,
+ bool force_err)
{
int err= 0;
Relay_log_info const *rli= rgi->rli;
@@ -3586,14 +3600,26 @@ int Xid_apply_log_event::do_record_gtid(THD *thd, rpl_group_info *rgi,
int ec= thd->get_stmt_da()->sql_errno();
/*
Do not report an error if this is really a kill due to a deadlock.
- In this case, the transaction will be re-tried instead.
+ In this case, the transaction will be re-tried instead. Unless force_err
+ is set, as in the case of XA PREPARE, as the GTID state is updated as a
+ separate transaction, and if that fails, we should not retry but exit in
+ error immediately.
*/
- if (!is_parallel_retry_error(rgi, ec))
+ if (!is_parallel_retry_error(rgi, ec) || force_err)
+ {
+ char buff[MAX_SLAVE_ERRMSG];
+ buff[0]= 0;
+ aggregate_da_errors(buff, sizeof(buff), thd->get_stmt_da());
+
+ if (force_err)
+ thd->clear_error();
+
rli->report(ERROR_LEVEL, ER_CANNOT_UPDATE_GTID_STATE, rgi->gtid_info(),
"Error during XID COMMIT: failed to update GTID state in "
- "%s.%s: %d: %s",
+ "%s.%s: %d: %s the event's master log %s, end_log_pos %llu",
"mysql", rpl_gtid_slave_state_table_name.str, ec,
- thd->get_stmt_da()->message());
+ buff, RPL_LOG_NAME, log_pos);
+ }
thd->is_slave_error= 1;
}
@@ -3667,7 +3693,7 @@ int Xid_apply_log_event::do_apply_event(rpl_group_info *rgi)
{
DBUG_ASSERT(!thd->transaction->xid_state.is_explicit_XA());
- if ((err= do_record_gtid(thd, rgi, false, &hton)))
+ if ((err= do_record_gtid(thd, rgi, false, &hton, true)))
return err;
}
@@ -4988,7 +5014,8 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
to avoid query cache being polluted with stale entries,
*/
# ifdef WITH_WSREP
- if (!WSREP(thd) && !wsrep_thd_is_applying(thd))
+ /* Query cache is not invalidated on wsrep applier here */
+ if (!(WSREP(thd) && wsrep_thd_is_applying(thd)))
# endif /* WITH_WSREP */
query_cache.invalidate_locked_for_write(thd, rgi->tables_to_lock);
#endif /* HAVE_QUERY_CACHE */
@@ -6871,8 +6898,18 @@ Rows_log_event::write_row(rpl_group_info *rgi,
int Rows_log_event::update_sequence()
{
TABLE *table= m_table; // pointer to event's table
+ bool old_master= false;
+ int err= 0;
- if (!bitmap_is_set(table->rpl_write_set, MIN_VALUE_FIELD_NO))
+ if (!bitmap_is_set(table->rpl_write_set, MIN_VALUE_FIELD_NO) ||
+ (
+#if defined(WITH_WSREP)
+ ! WSREP(thd) &&
+#endif
+ !(table->in_use->rgi_slave->gtid_ev_flags2 & Gtid_log_event::FL_DDL) &&
+ !(old_master=
+ rpl_master_has_bug(thd->rgi_slave->rli,
+ 29621, FALSE, FALSE, FALSE, TRUE))))
{
/* This event come from a setval function executed on the master.
Update the sequence next_number and round, like we do with setval()
@@ -6885,12 +6922,27 @@ int Rows_log_event::update_sequence()
return table->s->sequence->set_value(table, nextval, round, 0) > 0;
}
-
+ if (old_master && !WSREP(thd) && thd->rgi_slave->is_parallel_exec)
+ {
+ DBUG_ASSERT(thd->rgi_slave->parallel_entry);
+ /*
+ With parallel replication enabled, we can't execute alongside any other
+ transaction in which we may depend, so we force retry to release
+ the server layer table lock for possible prior in binlog order
+ same table transactions.
+ */
+ if (thd->rgi_slave->parallel_entry->last_committed_sub_id <
+ thd->rgi_slave->wait_commit_sub_id)
+ {
+ err= ER_LOCK_DEADLOCK;
+ my_error(err, MYF(0));
+ }
+ }
/*
Update all fields in table and update the active sequence, like with
ALTER SEQUENCE
*/
- return table->file->ha_write_row(table->record[0]);
+ return err == 0 ? table->file->ha_write_row(table->record[0]) : err;
}
@@ -6906,19 +6958,21 @@ Write_rows_log_event::do_exec_row(rpl_group_info *rgi)
const char *tmp= thd->get_proc_info();
LEX_CSTRING tmp_db= thd->db;
char *message, msg[128];
- const char *table_name= m_table->s->table_name.str;
- char quote_char= get_quote_char_for_identifier(thd, STRING_WITH_LEN(table_name));
- my_snprintf(msg, sizeof(msg),"Write_rows_log_event::write_row() on table %c%s%c",
- quote_char, table_name, quote_char);
+ const LEX_CSTRING &table_name= m_table->s->table_name;
+ const char quote_char=
+ get_quote_char_for_identifier(thd, table_name.str, table_name.length);
+ my_snprintf(msg, sizeof msg,
+ "Write_rows_log_event::write_row() on table %c%.*s%c",
+ quote_char, int(table_name.length), table_name.str, quote_char);
thd->reset_db(&m_table->s->db);
message= msg;
int error;
#ifdef WSREP_PROC_INFO
my_snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1,
- "Write_rows_log_event::write_row(%lld) on table %c%s%c",
- (long long) wsrep_thd_trx_seqno(thd), quote_char, table_name,
- quote_char);
+ "Write_rows_log_event::write_row(%lld) on table %c%.*s%c",
+ (long long) wsrep_thd_trx_seqno(thd), quote_char,
+ int(table_name.length), table_name.str, quote_char);
message= thd->wsrep_info;
#endif /* WSREP_PROC_INFO */
@@ -6957,7 +7011,7 @@ uint8 Write_rows_log_event::get_trg_event_map()
Returns TRUE if different.
*/
-static bool record_compare(TABLE *table)
+static bool record_compare(TABLE *table, bool vers_from_plain= false)
{
bool result= FALSE;
/**
@@ -6990,10 +7044,19 @@ static bool record_compare(TABLE *table)
/* Compare fields */
for (Field **ptr=table->field ; *ptr ; ptr++)
{
- if (table->versioned() && (*ptr)->vers_sys_field())
- {
+ /*
+ If the table is versioned, don't compare using the version if there is a
+ primary key. If there isn't a primary key, we need the version to
+ identify the correct record if there are duplicate rows in the data set.
+ However, if the primary server is unversioned (vers_from_plain is true),
+ then we implicitly use row_end as the primary key on our side. This is
+ because the implicit row_end value will be set to the maximum value for
+ the latest row update (which is what we care about).
+ */
+ if (table->versioned() && (*ptr)->vers_sys_field() &&
+ (table->s->primary_key < MAX_KEY ||
+ (vers_from_plain && table->vers_start_field() == (*ptr))))
continue;
- }
/**
We only compare field contents that are not null.
NULL fields (i.e., their null bits) were compared
@@ -7387,7 +7450,7 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
/* We use this to test that the correct key is used in test cases. */
DBUG_EXECUTE_IF("slave_crash_if_index_scan", abort(););
- while (record_compare(table))
+ while (record_compare(table, m_vers_from_plain))
{
while ((error= table->file->ha_index_next(table->record[0])))
{
@@ -7440,7 +7503,7 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
goto end;
}
}
- while (record_compare(table));
+ while (record_compare(table, m_vers_from_plain));
/*
Note: above record_compare will take into accout all record fields
@@ -7528,10 +7591,12 @@ int Delete_rows_log_event::do_exec_row(rpl_group_info *rgi)
const char *tmp= thd->get_proc_info();
LEX_CSTRING tmp_db= thd->db;
char *message, msg[128];
- const char *table_name= m_table->s->table_name.str;
- char quote_char= get_quote_char_for_identifier(thd, STRING_WITH_LEN(table_name));
- my_snprintf(msg, sizeof(msg),"Delete_rows_log_event::find_row() on table %c%s%c",
- quote_char, table_name, quote_char);
+ const LEX_CSTRING &table_name= m_table->s->table_name;
+ const char quote_char=
+ get_quote_char_for_identifier(thd, table_name.str, table_name.length);
+ my_snprintf(msg, sizeof msg,
+ "Delete_rows_log_event::find_row() on table %c%.*s%c",
+ quote_char, int(table_name.length), table_name.str, quote_char);
thd->reset_db(&m_table->s->db);
message= msg;
const bool invoke_triggers= (m_table->triggers && do_invoke_trigger());
@@ -7539,26 +7604,29 @@ int Delete_rows_log_event::do_exec_row(rpl_group_info *rgi)
#ifdef WSREP_PROC_INFO
my_snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1,
- "Delete_rows_log_event::find_row(%lld) on table %c%s%c",
- (long long) wsrep_thd_trx_seqno(thd), quote_char, table_name,
+ "Delete_rows_log_event::find_row(%lld) on table %c%.*s%c",
+ (long long) wsrep_thd_trx_seqno(thd), quote_char,
+ int(table_name.length), table_name.str,
quote_char);
message= thd->wsrep_info;
#endif /* WSREP_PROC_INFO */
thd_proc_info(thd, message);
if (likely(!(error= find_row(rgi))))
- {
+ {
/*
Delete the record found, located in record[0]
*/
- my_snprintf(msg, sizeof(msg),"Delete_rows_log_event::ha_delete_row() on table %c%s%c",
- quote_char, table_name, quote_char);
+ my_snprintf(msg, sizeof msg,
+ "Delete_rows_log_event::ha_delete_row() on table %c%.*s%c",
+ quote_char, int(table_name.length), table_name.str,
+ quote_char);
message= msg;
#ifdef WSREP_PROC_INFO
snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1,
- "Delete_rows_log_event::ha_delete_row(%lld) on table %c%s%c",
- (long long) wsrep_thd_trx_seqno(thd), quote_char, table_name,
- quote_char);
+ "Delete_rows_log_event::ha_delete_row(%lld) on table %c%.*s%c",
+ (long long) wsrep_thd_trx_seqno(thd), quote_char,
+ int(table_name.length), table_name.str, quote_char);
message= thd->wsrep_info;
#endif
thd_proc_info(thd, message);
@@ -7690,17 +7758,20 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
DBUG_ASSERT(m_table != NULL);
LEX_CSTRING tmp_db= thd->db;
char *message, msg[128];
- const char *table_name= m_table->s->table_name.str;
- char quote_char= get_quote_char_for_identifier(thd, STRING_WITH_LEN(table_name));
- my_snprintf(msg, sizeof(msg),"Update_rows_log_event::find_row() on table %c%s%c",
- quote_char, table_name, quote_char);
+ const LEX_CSTRING &table_name= m_table->s->table_name;
+ const char quote_char=
+ get_quote_char_for_identifier(thd, table_name.str, table_name.length);
+ my_snprintf(msg, sizeof msg,
+ "Update_rows_log_event::find_row() on table %c%.*s%c",
+ quote_char, int(table_name.length), table_name.str, quote_char);
thd->reset_db(&m_table->s->db);
message= msg;
#ifdef WSREP_PROC_INFO
my_snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1,
- "Update_rows_log_event::find_row(%lld) on table %c%s%c",
- (long long) wsrep_thd_trx_seqno(thd), quote_char, table_name,
+ "Update_rows_log_event::find_row(%lld) on table %c%.*s%c",
+ (long long) wsrep_thd_trx_seqno(thd), quote_char,
+ int(table_name.length), table_name.str,
quote_char);
message= thd->wsrep_info;
#endif /* WSREP_PROC_INFO */
@@ -7740,14 +7811,15 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
store_record(m_table,record[1]);
m_curr_row= m_curr_row_end;
- my_snprintf(msg, sizeof(msg),"Update_rows_log_event::unpack_current_row() on table %c%s%c",
- quote_char, table_name, quote_char);
+ my_snprintf(msg, sizeof msg,
+ "Update_rows_log_event::unpack_current_row() on table %c%.*s%c",
+ quote_char, int(table_name.length), table_name.str, quote_char);
message= msg;
#ifdef WSREP_PROC_INFO
my_snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1,
- "Update_rows_log_event::unpack_current_row(%lld) on table %c%s%c",
- (long long) wsrep_thd_trx_seqno(thd), quote_char, table_name,
- quote_char);
+ "Update_rows_log_event::unpack_current_row(%lld) on table %c%.*s%c",
+ (long long) wsrep_thd_trx_seqno(thd), quote_char,
+ int(table_name.length), table_name.str, quote_char);
message= thd->wsrep_info;
#endif /* WSREP_PROC_INFO */
@@ -7770,13 +7842,15 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
DBUG_DUMP("new values", m_table->record[0], m_table->s->reclength);
#endif
- my_snprintf(msg, sizeof(msg),"Update_rows_log_event::ha_update_row() on table %c%s%c",
- quote_char, table_name, quote_char);
+ my_snprintf(msg, sizeof msg,
+ "Update_rows_log_event::ha_update_row() on table %c%.*s%c",
+ quote_char, int(table_name.length), table_name.str, quote_char);
message= msg;
#ifdef WSREP_PROC_INFO
my_snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1,
- "Update_rows_log_event::ha_update_row(%lld) on table %c%s%c",
- (long long) wsrep_thd_trx_seqno(thd), quote_char, table_name, quote_char);
+ "Update_rows_log_event::ha_update_row(%lld) on table %c%.*s%c",
+ (long long) wsrep_thd_trx_seqno(thd), quote_char,
+ int(table_name.length), table_name.str, quote_char);
message= thd->wsrep_info;
#endif /* WSREP_PROC_INFO */
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 8ec9ad4ea17..8ee4b0408ef 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -332,6 +332,7 @@ static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0;
static my_bool opt_short_log_format= 0, opt_silent_startup= 0;
ulong max_used_connections;
+time_t max_used_connections_time;
static const char *mysqld_user, *mysqld_chroot;
static char *default_character_set_name;
static char *character_set_filesystem_name;
@@ -4704,7 +4705,10 @@ static void init_ssl()
{
sql_print_error("Failed to setup SSL");
sql_print_error("SSL error: %s", sslGetErrString(error));
- unireg_abort(1);
+ if (!opt_bootstrap)
+ unireg_abort(1);
+ opt_use_ssl = 0;
+ have_ssl= SHOW_OPTION_DISABLED;
}
else
ssl_acceptor_stats.init();
@@ -6182,7 +6186,10 @@ void create_new_thread(CONNECT *connect)
uint sum= connection_count + extra_connection_count;
if (sum > max_used_connections)
+ {
max_used_connections= sum;
+ max_used_connections_time= time(nullptr);
+ }
/*
The initialization of thread_id is done in create_embedded_thd() for
@@ -6514,8 +6521,6 @@ struct my_option my_long_options[]=
{"console", OPT_CONSOLE, "Write error output on screen; don't remove the console window on windows.",
&opt_console, &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
- {"core-file", OPT_WANT_CORE, "Write core on errors.", 0, 0, 0, GET_NO_ARG,
- NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF
{"debug", '#', "Built in DBUG debugger. Disabled in this build.",
&current_dbug_option, &current_dbug_option, 0, GET_STR, OPT_ARG,
@@ -7015,9 +7020,20 @@ static int show_heartbeat_period(THD *thd, SHOW_VAR *var, char *buff,
return 0;
}
-
#endif /* HAVE_REPLICATION */
+
+static int show_max_used_connections_time(THD *thd, SHOW_VAR *var, char *buff,
+ enum enum_var_type scope)
+{
+ var->type= SHOW_CHAR;
+ var->value= buff;
+
+ get_date(buff, GETDATE_DATE_TIME | GETDATE_FIXEDLENGTH, max_used_connections_time);
+ return 0;
+}
+
+
static int show_open_tables(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
{
@@ -7493,6 +7509,7 @@ SHOW_VAR status_vars[]= {
{"Master_gtid_wait_timeouts", (char*) offsetof(STATUS_VAR, master_gtid_wait_timeouts), SHOW_LONG_STATUS},
{"Master_gtid_wait_time", (char*) offsetof(STATUS_VAR, master_gtid_wait_time), SHOW_LONG_STATUS},
{"Max_used_connections", (char*) &max_used_connections, SHOW_LONG},
+ {"Max_used_connections_time",(char*) &show_max_used_connections_time, SHOW_SIMPLE_FUNC},
{"Memory_used", (char*) &show_memory_used, SHOW_SIMPLE_FUNC},
{"Memory_used_initial", (char*) &start_memory_used, SHOW_LONGLONG},
{"Resultset_metadata_skipped", (char *) offsetof(STATUS_VAR, skip_metadata_count),SHOW_LONG_STATUS},
@@ -7831,6 +7848,7 @@ static int mysql_init_variables(void)
specialflag= 0;
binlog_cache_use= binlog_cache_disk_use= 0;
max_used_connections= slow_launch_threads = 0;
+ max_used_connections_time= 0;
mysqld_user= mysqld_chroot= opt_init_file= opt_bin_logname = 0;
prepared_stmt_count= 0;
mysqld_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS;
@@ -8269,9 +8287,6 @@ mysqld_get_one_option(const struct my_option *opt, const char *argument,
case (int) OPT_SKIP_HOST_CACHE:
opt_specialflag|= SPECIAL_NO_HOST_CACHE;
break;
- case (int) OPT_WANT_CORE:
- test_flags |= TEST_CORE_ON_SIGNAL;
- break;
case OPT_CONSOLE:
if (opt_console)
opt_error_log= 0; // Force logs to stdout
@@ -9209,6 +9224,7 @@ void refresh_status(THD *thd)
connections. This is not perfect, but status data is not exact anyway.
*/
max_used_connections= connection_count + extra_connection_count;
+ max_used_connections_time= time(nullptr);
}
#ifdef HAVE_PSI_INTERFACE
diff --git a/sql/mysqld.h b/sql/mysqld.h
index 54cafdcde15..43194dec639 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -917,10 +917,12 @@ enum enum_query_type
// it evaluates to. Should be used for error messages, so that they
// don't reveal values.
QT_NO_DATA_EXPANSION= (1 << 9),
+ // Remove wrappers added for TVC when creating or showing view
+ QT_NO_WRAPPERS_FOR_TVC_IN_VIEW= (1 << 12),
// The temporary tables used by the query might be freed by the time
// this print() call is made.
- QT_DONT_ACCESS_TMP_TABLES= (1 << 12)
+ QT_DONT_ACCESS_TMP_TABLES= (1 << 13)
};
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 242ddb9af19..1bf9c84bae2 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -464,7 +464,7 @@ void print_range_for_non_indexed_field(String *out, Field *field,
static void print_min_range_operator(String *out, const ha_rkey_function flag);
static void print_max_range_operator(String *out, const ha_rkey_function flag);
-static bool is_field_an_unique_index(RANGE_OPT_PARAM *param, Field *field);
+static bool is_field_an_unique_index(Field *field);
/*
SEL_IMERGE is a list of possible ways to do index merge, i.e. it is
@@ -3690,7 +3690,10 @@ end_of_range_loop:
}
else
{
+ enum_check_fields save_count_cuted_fields= thd->count_cuted_fields;
+ thd->count_cuted_fields= CHECK_FIELD_IGNORE;
rows= records_in_column_ranges(&param, idx, key);
+ thd->count_cuted_fields= save_count_cuted_fields;
if (rows != DBL_MAX)
{
key->field->cond_selectivity= rows/table_records;
@@ -8039,8 +8042,13 @@ SEL_TREE *Item_func_ne::get_func_mm_tree(RANGE_OPT_PARAM *param,
If this condition is a "col1<>...", where there is a UNIQUE KEY(col1),
do not construct a SEL_TREE from it. A condition that excludes just one
row in the table is not selective (unless there are only a few rows)
+
+ Note: this logic must be in sync with code in
+ check_group_min_max_predicates(). That function walks an Item* condition
+ and checks if the range optimizer would produce an equivalent range for
+ it.
*/
- if (is_field_an_unique_index(param, field))
+ if (param->using_real_indexes && is_field_an_unique_index(field))
DBUG_RETURN(NULL);
DBUG_RETURN(get_ne_mm_tree(param, field, value, value));
}
@@ -8152,7 +8160,7 @@ SEL_TREE *Item_func_in::get_func_mm_tree(RANGE_OPT_PARAM *param,
- if there are a lot of constants, the overhead of building and
processing enormous range list is not worth it.
*/
- if (is_field_an_unique_index(param, field))
+ if (param->using_real_indexes && is_field_an_unique_index(field))
DBUG_RETURN(0);
/* Get a SEL_TREE for "(-inf|NULL) < X < c_0" interval. */
@@ -8861,24 +8869,18 @@ SEL_TREE *Item_equal::get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr)
In the future we could also add "almost unique" indexes where any value is
present only in a few rows (but necessarily exactly one row)
*/
-static bool is_field_an_unique_index(RANGE_OPT_PARAM *param, Field *field)
+static bool is_field_an_unique_index(Field *field)
{
DBUG_ENTER("is_field_an_unique_index");
-
- // The check for using_real_indexes is there because of the heuristics
- // this function is used for.
- if (param->using_real_indexes)
+ key_map::Iterator it(field->key_start);
+ uint key_no;
+ while ((key_no= it++) != key_map::Iterator::BITMAP_END)
{
- key_map::Iterator it(field->key_start);
- uint key_no;
- while ((key_no= it++) != key_map::Iterator::BITMAP_END)
+ KEY *key_info= &field->table->key_info[key_no];
+ if (key_info->user_defined_key_parts == 1 &&
+ (key_info->flags & HA_NOSAME))
{
- KEY *key_info= &field->table->key_info[key_no];
- if (key_info->user_defined_key_parts == 1 &&
- (key_info->flags & HA_NOSAME))
- {
- DBUG_RETURN(true);
- }
+ DBUG_RETURN(true);
}
}
DBUG_RETURN(false);
@@ -13894,7 +13896,7 @@ cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
- (C between const_i and const_j)
- C IS NULL
- C IS NOT NULL
- - C != const
+ - C != const (unless C is the primary key)
SA4. If Q has a GROUP BY clause, there are no other aggregate functions
except MIN and MAX. For queries with DISTINCT, aggregate functions
are allowed.
@@ -14846,6 +14848,17 @@ check_group_min_max_predicates(Item *cond, Item_field *min_max_arg_item,
if (!simple_pred(pred, args, &inv))
DBUG_RETURN(FALSE);
+ /*
+ Follow the logic in Item_func_ne::get_func_mm_tree(): condition
+ in form "tbl.primary_key <> const" is not used to produce intervals.
+
+ If the condition doesn't have an equivalent interval, this means we
+ fail LooseScan's condition SA3. Return FALSE to indicate this.
+ */
+ if (pred_type == Item_func::NE_FUNC &&
+ is_field_an_unique_index(min_max_arg_item->field))
+ DBUG_RETURN(FALSE);
+
if (args[0] && args[1]) // this is a binary function or BETWEEN
{
DBUG_ASSERT(pred->fixed_type_handler());
diff --git a/sql/opt_split.cc b/sql/opt_split.cc
index f2d536cd47b..fa304f816dd 100644
--- a/sql/opt_split.cc
+++ b/sql/opt_split.cc
@@ -65,7 +65,7 @@
If we have only one equi-join condition then we either push it as
for Q1R or we don't. In a general case we may have much more options.
Consider the query (Q3)
- SELECT
+ SELECT *
FROM t1,t2 (SELECT t3.a, t3.b, MIN(t3.c) as min
FROM t3 GROUP BY a,b) t
WHERE t.a = t1.a AND t.b = t2.b
@@ -102,6 +102,47 @@
If we just drop the index on t3(a,b) the chances that the splitting
will be used becomes much lower but they still exists providing that
the fanout of the partial join of t1 and t2 is small enough.
+
+ The lateral derived table LT formed as a result of SM optimization applied
+ to a materialized derived table DT must be joined after all parameters
+ of splitting has been evaluated, i.e. after all expressions used in the
+ equalities pushed into DT that make the employed splitting effective
+ could be evaluated. With the chosen join order all the parameters can be
+ evaluated after the last table LPT that contains any columns referenced in
+ the parameters has been joined and the table APT following LPT in the chosen
+ join order is accessed.
+ Usually the formed lateral derived table LT is accessed right after the table
+ LPT. As in such cases table LT must be refilled for each combination of
+ splitting parameters this table must be populated before each access to LT
+ and the estimate of the expected number of refills that could be suggested in
+ such cases is the number of rows in the partial join ending with table LPT.
+ However in other cases the chosen join order may contain tables between LPT
+ and LT.
+ Consider the query (Q4)
+ SELECT *
+ FROM t1 JOIN t2 ON t1.b = t2.b
+ LEFT JOIN (SELECT t3.a, t3.b, MIN(t3.c) as min
+ FROM t3 GROUP BY a,b) t
+ ON t.a = t1.a AND t.c > 0
+ [WHERE P(t1,t2)];
+ Let's assume that the join order t1,t2,t was chosen for this query and
+ SP optimization was applied to t with splitting over t3.a using the index
+ on column t3.a. Here the table t1 serves as LPT, t2 as APT while t with
+ pushed condition t.a = t1.a serves as LT. Note that here LT is accessed
+ after t2, not right after t1. Here the number of refills of the lateral
+ derived is not more that the number of key values of t1.a that might be
+ less than the cardinality of the partial join (t1,t2). That's why it makes
+ sense to signal that t3 has to be refilled just before t2 is accessed.
+ However if the cardinality of the partial join (t1,t2) happens to be less
+ than the cardinality of the partial join (t1) due to additional selective
+ condition P(t1,t2) then the flag informing about necessity of a new refill
+ can be set either when accessing t2 or right after it has been joined.
+ The current code sets such flag right after generating a record of the
+ partial join with minimal cardinality for all those partial joins that
+ end between APT and LT. It allows sometimes to push extra conditions
+ into the lateral derived without any increase of the number of refills.
+ However this flag can be set only after the last join table between
+ APT and LT using join buffer has been joined.
*/
/*
@@ -250,6 +291,7 @@ public:
double unsplit_oper_cost;
/* Cardinality of T when nothing is pushed */
double unsplit_card;
+ double last_refills;
SplM_plan_info *find_plan(TABLE *table, uint key, uint parts);
};
@@ -347,6 +389,9 @@ bool JOIN::check_for_splittable_materialized()
if (!partition_list)
return false;
+ Json_writer_object trace_wrapper(thd);
+ Json_writer_object trace_split(thd, "check_split_materialized");
+
ORDER *ord;
Dynamic_array<SplM_field_ext_info> candidates(PSI_INSTRUMENT_MEM);
@@ -392,7 +437,10 @@ bool JOIN::check_for_splittable_materialized()
}
}
if (candidates.elements() == 0) // no candidates satisfying (8.1) && (8.2)
+ {
+ trace_split.add("not_applicable", "group list has no candidates");
return false;
+ }
/*
For each table from this join find the keys that can be used for ref access
@@ -451,7 +499,11 @@ bool JOIN::check_for_splittable_materialized()
}
if (!spl_field_cnt) // No candidate field can be accessed by ref => !(9)
+ {
+ trace_split.add("not_applicable",
+ "no candidate field can be accessed through ref");
return false;
+ }
/*
Create a structure of the type SplM_opt_info and fill it with
@@ -469,16 +521,22 @@ bool JOIN::check_for_splittable_materialized()
spl_opt_info->tables_usable_for_splitting= 0;
spl_opt_info->spl_field_cnt= spl_field_cnt;
spl_opt_info->spl_fields= spl_field;
- for (cand= cand_start; cand < cand_end; cand++)
+
{
- if (!cand->is_usable_for_ref_access)
- continue;
- spl_field->producing_item= cand->producing_item;
- spl_field->underlying_field= cand->underlying_field;
- spl_field->mat_field= cand->mat_field;
- spl_opt_info->tables_usable_for_splitting|=
- cand->underlying_field->table->map;
- spl_field++;
+ Json_writer_array trace_range(thd, "split_candidates");
+ for (cand= cand_start; cand < cand_end; cand++)
+ {
+ if (!cand->is_usable_for_ref_access)
+ continue;
+ trace_range.add(cand->producing_item);
+
+ spl_field->producing_item= cand->producing_item;
+ spl_field->underlying_field= cand->underlying_field;
+ spl_field->mat_field= cand->mat_field;
+ spl_opt_info->tables_usable_for_splitting|=
+ cand->underlying_field->table->map;
+ spl_field++;
+ }
}
/* Attach this info to the table T */
@@ -740,7 +798,7 @@ void JOIN::add_keyuses_for_splitting()
bzero((char*) &keyuse_ext_end, sizeof(keyuse_ext_end));
if (ext_keyuses_for_splitting->push(keyuse_ext_end))
goto err;
-
+ // psergey-todo: trace anything here?
/*
Use the number of rows that was computed by
TABLE_LIST::fetch_number_of_rows():
@@ -844,13 +902,13 @@ SplM_plan_info *SplM_opt_info::find_plan(TABLE *table, uint key, uint parts)
static
void reset_validity_vars_for_keyuses(KEYUSE_EXT *key_keyuse_ext_start,
TABLE *table, uint key,
- table_map remaining_tables,
+ table_map excluded_tables,
bool validity_val)
{
KEYUSE_EXT *keyuse_ext= key_keyuse_ext_start;
do
{
- if (!(keyuse_ext->needed_in_prefix & remaining_tables))
+ if (!(keyuse_ext->needed_in_prefix & excluded_tables))
{
/*
The enabling/disabling flags are set just in KEYUSE_EXT structures.
@@ -870,8 +928,11 @@ void reset_validity_vars_for_keyuses(KEYUSE_EXT *key_keyuse_ext_start,
Choose the best splitting to extend the evaluated partial join
@param
- record_count estimated cardinality of the extended partial join
+ idx index for joined table T in current partial join P
remaining_tables tables not joined yet
+ spl_pd_boundary OUT bitmap of the table from P extended by T that
+ starts the sub-sequence of tables S from which
+ no conditions are allowed to be pushed into T.
@details
This function is called during the search for the best execution
@@ -893,10 +954,12 @@ void reset_validity_vars_for_keyuses(KEYUSE_EXT *key_keyuse_ext_start,
@retval
Pointer to the info on the found plan that employs the pushed equalities
if the plan has been chosen, NULL - otherwise.
+ If the function returns NULL the value of spl_param_tables is set to 0.
*/
-SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count,
- table_map remaining_tables)
+SplM_plan_info * JOIN_TAB::choose_best_splitting(uint idx,
+ table_map remaining_tables,
+ table_map *spl_pd_boundary)
{
SplM_opt_info *spl_opt_info= table->spl_opt_info;
DBUG_ASSERT(spl_opt_info != NULL);
@@ -911,8 +974,10 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count,
SplM_plan_info *spl_plan= 0;
uint best_key= 0;
uint best_key_parts= 0;
+ table_map best_param_tables;
bool chosen, already_printed;
-
+ Json_writer_object trace_obj(thd, "choose_best_splitting");
+ Json_writer_array trace_arr(thd, "considered_keys");
/*
Check whether there are keys that can be used to join T employing splitting
and if so, select the best out of such keys
@@ -930,6 +995,7 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count,
uint key= keyuse_ext->key;
KEYUSE_EXT *key_keyuse_ext_start= keyuse_ext;
key_part_map found_parts= 0;
+ table_map needed_in_prefix= 0;
do
{
if (keyuse_ext->needed_in_prefix & remaining_tables)
@@ -955,6 +1021,7 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count,
KEY *key_info= table->key_info + key;
double rec_per_key=
key_info->actual_rec_per_key(keyuse_ext->keypart);
+ needed_in_prefix|= keyuse_ext->needed_in_prefix;
if (rec_per_key < best_rec_per_key)
{
best_table= keyuse_ext->table;
@@ -962,6 +1029,14 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count,
best_key_parts= keyuse_ext->keypart + 1;
best_rec_per_key= rec_per_key;
best_key_keyuse_ext_start= key_keyuse_ext_start;
+ best_param_tables= needed_in_prefix;
+ // trace table, key_name, parts, needed_tables.
+ Json_writer_object cur_index(thd);
+ cur_index.
+ add("table_name", best_table->alias.ptr()).
+ add("index", best_table->key_info[best_key].name).
+ add("rec_per_key", best_rec_per_key).
+ add("param_tables", best_param_tables);
}
keyuse_ext++;
}
@@ -969,14 +1044,41 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count,
}
while (keyuse_ext->table == table);
}
+ trace_arr.end();
chosen= 0;
+
+ double refills= DBL_MAX;
+ table_map excluded_tables= remaining_tables | this->join->sjm_lookup_tables;
if (best_table)
{
+ *spl_pd_boundary= this->table->map;
+ if (!best_param_tables)
+ refills= 1;
+ else
+ {
+ table_map last_found= this->table->map;
+ for (POSITION *pos= &this->join->positions[idx - 1]; ; pos--)
+ {
+ if (pos->table->table->map & excluded_tables)
+ continue;
+ if (pos->partial_join_cardinality < refills)
+ {
+ *spl_pd_boundary= last_found;
+ refills= pos->partial_join_cardinality;
+ }
+ last_found= pos->table->table->map;
+ if ((last_found & best_param_tables) || pos->use_join_buffer)
+ break;
+ }
+ }
+
+ trace_obj.add("refills", refills).
+ add("spl_pd_boundary", *spl_pd_boundary);
+
/*
The key for splitting was chosen, look for the plan for this key
in the cache
*/
- Json_writer_array spl_trace(thd, "choose_best_splitting");
spl_plan= spl_opt_info->find_plan(best_table, best_key, best_key_parts);
if (!spl_plan)
{
@@ -984,11 +1086,13 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count,
The plan for the chosen key has not been found in the cache.
Build a new plan and save info on it in the cache
*/
+ Json_writer_array wrapper(thd, "split_plan_search");
table_map all_table_map= (((table_map) 1) << join->table_count) - 1;
reset_validity_vars_for_keyuses(best_key_keyuse_ext_start, best_table,
- best_key, remaining_tables, true);
+ best_key, excluded_tables, true);
choose_plan(join, all_table_map & ~join->const_table_map, 0);
+ wrapper.end();
/*
Check that the chosen plan is really a splitting plan.
If not or if there is not enough memory to save the plan in the cache
@@ -1005,7 +1109,8 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count,
spl_opt_info->plan_cache.push_back(spl_plan))
{
reset_validity_vars_for_keyuses(best_key_keyuse_ext_start, best_table,
- best_key, remaining_tables, false);
+ best_key, excluded_tables, false);
+ trace_obj.add("split_plan_discarded", "constructed unapplicable query plan");
return 0;
}
@@ -1024,12 +1129,12 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count,
spl_plan->cost= (join->best_positions[join->table_count-1].read_time +
oper_cost);
- chosen= (record_count * spl_plan->cost + COST_EPS <
+ chosen= (refills * spl_plan->cost + COST_EPS <
spl_opt_info->unsplit_cost);
if (unlikely(thd->trace_started()))
{
- Json_writer_object wrapper(thd);
+ //psergey-merge:Json_writer_object wrapper(thd);
Json_writer_object find_trace(thd, "split_materialized");
find_trace.
add("table", best_table->alias.c_ptr()).
@@ -1040,24 +1145,26 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count,
add("unsplit_postjoin_cost", spl_opt_info->unsplit_oper_cost).
add("unsplit_cost", spl_opt_info->unsplit_cost).
add("rows", split_card).
- add("outer_rows", record_count).
- add("total_splitting_cost", record_count * spl_plan->cost).
+ add("refills", refills).
+ add("total_splitting_cost", refills * spl_plan->cost).
add("chosen", chosen);
}
memcpy((char *) spl_plan->best_positions,
(char *) join->best_positions,
sizeof(POSITION) * join->table_count);
reset_validity_vars_for_keyuses(best_key_keyuse_ext_start, best_table,
- best_key, remaining_tables, false);
+ best_key, excluded_tables, false);
already_printed= 1;
}
else
{
- chosen= (record_count * spl_plan->cost + COST_EPS <
+ trace_obj.add("cached_plan_found", 1);
+ chosen= (refills * spl_plan->cost + COST_EPS <
spl_opt_info->unsplit_cost);
already_printed= 0;
}
- }
+ }
+
/* Set the cost of the preferred materialization for this partial join */
if (chosen)
@@ -1066,10 +1173,8 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count,
The best plan that employs splitting is cheaper than
the plan without splitting
*/
-
- startup_cost= record_count * spl_plan->cost;
+ startup_cost= spl_opt_info->last_refills * spl_plan->cost;
records= (ha_rows) (spl_opt_info->unsplit_card * spl_plan->split_sel);
-
if (unlikely(thd->trace_started()) && ! already_printed)
{
Json_writer_object trace(thd, "split_materialized");
@@ -1086,6 +1191,7 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count,
records= (ha_rows) spl_opt_info->unsplit_card;
spl_plan= 0;
}
+
return spl_plan;
}
@@ -1095,13 +1201,13 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count,
Inject equalities for splitting used by the materialization join
@param
- excluded_tables used to filter out the equalities that cannot
- be pushed.
+ excluded_tables used to filter out the equalities that are not
+ to be pushed.
@details
This function injects equalities pushed into a derived table T for which
the split optimization has been chosen by the optimizer. The function
- is called by JOIN::inject_splitting_cond_for_all_tables_with_split_op().
+ is called by JOIN::inject_splitting_cond_for_all_tables_with_split_opt().
All equalities usable for splitting T whose right parts do not depend on
any of the 'excluded_tables' can be pushed into the where clause of the
derived table T.
@@ -1189,7 +1295,7 @@ bool is_eq_cond_injected_for_split_opt(Item_func_eq *eq_item)
@param
spl_plan info on the splitting plan chosen for the splittable table T
- remaining_tables the table T is joined just before these tables
+ excluded_tables tables that cannot be used in equalities pushed into T
is_const_table the table T is a constant table
@details
@@ -1204,7 +1310,7 @@ bool is_eq_cond_injected_for_split_opt(Item_func_eq *eq_item)
*/
bool JOIN_TAB::fix_splitting(SplM_plan_info *spl_plan,
- table_map remaining_tables,
+ table_map excluded_tables,
bool is_const_table)
{
SplM_opt_info *spl_opt_info= table->spl_opt_info;
@@ -1212,6 +1318,7 @@ bool JOIN_TAB::fix_splitting(SplM_plan_info *spl_plan,
JOIN *md_join= spl_opt_info->join;
if (spl_plan && !is_const_table)
{
+ is_split_derived= true;
memcpy((char *) md_join->best_positions,
(char *) spl_plan->best_positions,
sizeof(POSITION) * md_join->table_count);
@@ -1222,7 +1329,7 @@ bool JOIN_TAB::fix_splitting(SplM_plan_info *spl_plan,
reset_validity_vars_for_keyuses(spl_plan->keyuse_ext_start,
spl_plan->table,
spl_plan->key,
- remaining_tables,
+ excluded_tables,
true);
}
else if (md_join->save_qep)
@@ -1258,8 +1365,21 @@ bool JOIN::fix_all_splittings_in_plan()
if (tab->table->is_splittable())
{
SplM_plan_info *spl_plan= cur_pos->spl_plan;
+ table_map excluded_tables= (all_tables & ~prev_tables) |
+ sjm_lookup_tables;
+ ;
+ if (spl_plan)
+ {
+ POSITION *pos= cur_pos;
+ table_map spl_pd_boundary= pos->spl_pd_boundary;
+ do
+ {
+ excluded_tables|= pos->table->table->map;
+ }
+ while (!((pos--)->table->table->map & spl_pd_boundary));
+ }
if (tab->fix_splitting(spl_plan,
- all_tables & ~prev_tables,
+ excluded_tables,
tablenr < const_tables ))
return true;
}
@@ -1298,13 +1418,21 @@ bool JOIN::inject_splitting_cond_for_all_tables_with_split_opt()
continue;
SplM_opt_info *spl_opt_info= tab->table->spl_opt_info;
JOIN *join= spl_opt_info->join;
- /*
- Currently the equalities referencing columns of SJM tables with
- look-up access cannot be pushed into materialized derived.
- */
- if (join->inject_best_splitting_cond((all_tables & ~prev_tables) |
- sjm_lookup_tables))
- return true;
+ table_map excluded_tables= (all_tables & ~prev_tables) | sjm_lookup_tables;
+ table_map spl_pd_boundary= cur_pos->spl_pd_boundary;
+ for (POSITION *pos= cur_pos; ; pos--)
+ {
+ excluded_tables|= pos->table->table->map;
+ pos->table->no_forced_join_cache= true;
+ if (pos->table->table->map & spl_pd_boundary)
+ {
+ pos->table->split_derived_to_update|= tab->table->map;
+ break;
+ }
+ }
+
+ if (join->inject_best_splitting_cond(excluded_tables))
+ return true;
}
return false;
}
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index 9c8fc6dc0b3..1bdbcf0deb9 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -4148,6 +4148,7 @@ void fix_semijoin_strategies_for_picked_join_order(JOIN *join)
*/
join->cur_sj_inner_tables= 0;
Json_writer_object semijoin_strategy(thd);
+ double inner_fanout= 1.0;
semijoin_strategy.add("semi_join_strategy","FirstMatch");
Json_writer_array semijoin_plan(thd, "join_order");
for (idx= first; idx <= tablenr; idx++)
@@ -4165,10 +4166,22 @@ void fix_semijoin_strategies_for_picked_join_order(JOIN *join)
TRUE /* no jbuf */,
record_count, join->best_positions + idx, &dummy);
}
+ /*
+ TODO: We should also compute the selectivity here, as well as adjust
+ the records_out according to the fraction of records removed by
+ the semi-join.
+ */
+ double rec_out= join->best_positions[idx].records_out;
+ if (join->best_positions[idx].table->emb_sj_nest)
+ inner_fanout *= rec_out;
+
record_count *= join->best_positions[idx].records_out;
rem_tables &= ~join->best_positions[idx].table->table->map;
}
+ if (inner_fanout > 1.0)
+ join->best_positions[tablenr].records_out /= inner_fanout;
}
+
if (pos->sj_strategy == SJ_OPT_LOOSE_SCAN)
{
@@ -4947,11 +4960,13 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd)
{
DBUG_PRINT("info",("Creating group key in temporary table"));
share->keys=1;
- share->uniques= MY_TEST(using_unique_constraint);
table->key_info= share->key_info= keyinfo;
keyinfo->key_part=key_part_info;
- keyinfo->flags=HA_NOSAME;
+ keyinfo->flags= HA_NOSAME | (using_unique_constraint ? HA_UNIQUE_HASH : 0);
+ keyinfo->ext_key_flags= keyinfo->flags;
keyinfo->usable_key_parts= keyinfo->user_defined_key_parts= 1;
+ keyinfo->ext_key_parts= 1;
+ share->key_parts= 1;
keyinfo->key_length=0;
keyinfo->rec_per_key=0;
keyinfo->algorithm= HA_KEY_ALG_UNDEF;
diff --git a/sql/opt_subselect.h b/sql/opt_subselect.h
index c0398fc8539..8140a01974d 100644
--- a/sql/opt_subselect.h
+++ b/sql/opt_subselect.h
@@ -316,6 +316,7 @@ public:
pos->loosescan_picker.loosescan_key= best_loose_scan_key;
pos->loosescan_picker.loosescan_parts= best_max_loose_keypart + 1;
pos->use_join_buffer= FALSE;
+ pos->firstmatch_with_join_buf= FALSE;
pos->table= tab;
pos->range_rowid_filter_info= tab->range_rowid_filter_info;
pos->ref_depend_map= best_ref_depend_map;
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc
index b3917942874..1e07ca582da 100644
--- a/sql/rpl_parallel.cc
+++ b/sql/rpl_parallel.cc
@@ -264,6 +264,12 @@ finish_event_group(rpl_parallel_thread *rpt, uint64 sub_id,
STRING_WITH_LEN("now WAIT_FOR proceed_by_1000"));
}
});
+ DBUG_EXECUTE_IF("hold_worker2_favor_worker3", {
+ if (rgi->current_gtid.seq_no == 2001) {
+ DBUG_ASSERT(!rgi->worker_error || entry->stop_on_error_sub_id == sub_id);
+ debug_sync_set_action(thd, STRING_WITH_LEN("now SIGNAL cont_worker3"));
+ }
+ });
#endif
if (rgi->killed_for_retry == rpl_group_info::RETRY_KILL_PENDING)
@@ -289,6 +295,11 @@ signal_error_to_sql_driver_thread(THD *thd, rpl_group_info *rgi, int err)
In case we get an error during commit, inform following transactions that
we aborted our commit.
*/
+ DBUG_EXECUTE_IF("hold_worker2_favor_worker3", {
+ if (rgi->current_gtid.seq_no == 2002) {
+ debug_sync_set_action(thd, STRING_WITH_LEN("now WAIT_FOR cont_worker2"));
+ }});
+
rgi->unmark_start_commit();
rgi->cleanup_context(thd, true);
rgi->rli->abort_slave= true;
@@ -823,7 +834,14 @@ do_retry:
thd->reset_killed();
thd->clear_error();
rgi->killed_for_retry = rpl_group_info::RETRY_KILL_NONE;
-
+#ifdef ENABLED_DEBUG_SYNC
+ DBUG_EXECUTE_IF("hold_worker2_favor_worker3", {
+ if (rgi->current_gtid.seq_no == 2003) {
+ debug_sync_set_action(thd,
+ STRING_WITH_LEN("now WAIT_FOR cont_worker3"));
+ }
+ });
+#endif
/*
If we retry due to a deadlock kill that occurred during the commit step, we
might have already updated (but not committed) an update of table
@@ -842,13 +860,10 @@ do_retry:
for (;;)
{
mysql_mutex_lock(&entry->LOCK_parallel_entry);
- if (entry->stop_on_error_sub_id == (uint64) ULONGLONG_MAX ||
- DBUG_IF("simulate_mdev_12746") ||
- rgi->gtid_sub_id < entry->stop_on_error_sub_id)
- {
- register_wait_for_prior_event_group_commit(rgi, entry);
- }
- else
+ register_wait_for_prior_event_group_commit(rgi, entry);
+ if (entry->stop_on_error_sub_id != (uint64) ULONGLONG_MAX &&
+ !DBUG_IF("simulate_mdev_12746") &&
+ rgi->gtid_sub_id >= entry->stop_on_error_sub_id)
{
/*
A failure of a preceding "parent" transaction may not be
@@ -2073,6 +2088,9 @@ rpl_parallel_thread::get_gco(uint64 wait_count, group_commit_orderer *prev,
gco->prior_sub_id= prior_sub_id;
gco->installed= false;
gco->flags= 0;
+#ifndef DBUG_OFF
+ gco->gc_done= false;
+#endif
return gco;
}
@@ -2080,6 +2098,10 @@ rpl_parallel_thread::get_gco(uint64 wait_count, group_commit_orderer *prev,
void
rpl_parallel_thread::loc_free_gco(group_commit_orderer *gco)
{
+#ifndef DBUG_OFF
+ DBUG_ASSERT(!gco->gc_done);
+ gco->gc_done= true;
+#endif
if (!loc_gco_list)
loc_gco_last_ptr_ptr= &gco->next_gco;
else
@@ -2561,14 +2583,16 @@ rpl_parallel::find(uint32 domain_id, Relay_log_info *rli)
e->pause_sub_id= (uint64)ULONGLONG_MAX;
e->pending_start_alters= 0;
e->rli= rli;
+ mysql_mutex_init(key_LOCK_parallel_entry, &e->LOCK_parallel_entry,
+ MY_MUTEX_INIT_FAST);
+ mysql_cond_init(key_COND_parallel_entry, &e->COND_parallel_entry, NULL);
if (my_hash_insert(&domain_hash, (uchar *)e))
{
+ mysql_cond_destroy(&e->COND_parallel_entry);
+ mysql_mutex_destroy(&e->LOCK_parallel_entry);
my_free(e);
return NULL;
}
- mysql_mutex_init(key_LOCK_parallel_entry, &e->LOCK_parallel_entry,
- MY_MUTEX_INIT_FAST);
- mysql_cond_init(key_COND_parallel_entry, &e->COND_parallel_entry, NULL);
}
else
{
@@ -3149,7 +3173,12 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev,
if (mode <= SLAVE_PARALLEL_MINIMAL ||
!(gtid_flags & Gtid_log_event::FL_GROUP_COMMIT_ID) ||
- e->last_commit_id != gtid_ev->commit_id)
+ e->last_commit_id != gtid_ev->commit_id ||
+ /*
+ MULTI_BATCH is also set when the current gtid even being a member
+ of a commit group is flagged as DDL which disallows parallel.
+ */
+ (gtid_flags & Gtid_log_event::FL_DDL))
flags|= group_commit_orderer::MULTI_BATCH;
/* Make sure we do not attempt to run DDL in parallel speculatively. */
if (gtid_flags & Gtid_log_event::FL_DDL)
diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h
index 9a8dfc7e386..f2bf36aa4a1 100644
--- a/sql/rpl_parallel.h
+++ b/sql/rpl_parallel.h
@@ -91,6 +91,9 @@ struct group_commit_orderer {
FORCE_SWITCH= 2
};
uint8 flags;
+#ifndef DBUG_OFF
+ bool gc_done;
+#endif
};
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index a8af950fa08..bd55c14e447 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -2423,8 +2423,13 @@ mark_start_commit_inner(rpl_parallel_entry *e, group_commit_orderer *gco,
uint64 count= ++e->count_committing_event_groups;
/* Signal any following GCO whose wait_count has been reached now. */
tmp= gco;
+
+ DBUG_ASSERT(!tmp->gc_done);
+
while ((tmp= tmp->next_gco))
{
+ DBUG_ASSERT(!tmp->gc_done);
+
uint64 wait_count= tmp->wait_count;
if (wait_count > count)
break;
diff --git a/sql/semisync_master.cc b/sql/semisync_master.cc
index b57fc199826..17adeed86e7 100644
--- a/sql/semisync_master.cc
+++ b/sql/semisync_master.cc
@@ -317,8 +317,8 @@ void Active_tranx::clear_active_tranx_nodes(const char *log_file_name,
/*******************************************************************************
*
- * <Repl_semi_sync_master> class: the basic code layer for syncsync master.
- * <Repl_semi_sync_slave> class: the basic code layer for syncsync slave.
+ * <Repl_semi_sync_master> class: the basic code layer for semisync master.
+ * <Repl_semi_sync_slave> class: the basic code layer for semisync slave.
*
* The most important functions during semi-syn replication listed:
*
@@ -809,8 +809,6 @@ void Repl_semi_sync_master::dump_end(THD* thd)
remove_slave();
ack_receiver.remove_slave(thd);
-
- return;
}
int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name,
diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc
index 9991f261202..fb3f94d019e 100644
--- a/sql/signal_handler.cc
+++ b/sql/signal_handler.cc
@@ -27,6 +27,7 @@
#ifdef _WIN32
#include <crtdbg.h>
+#include <direct.h>
#define SIGNAL_FMT "exception 0x%x"
#else
#define SIGNAL_FMT "signal %d"
@@ -66,9 +67,9 @@ static inline void output_core_info()
(int) len, buff);
}
#ifdef __FreeBSD__
- if ((fd= my_open("/proc/curproc/rlimit", O_RDONLY, MYF(MY_NO_REGISTER))) >= 0)
+ if ((fd= open("/proc/curproc/rlimit", O_RDONLY)) >= 0)
#else
- if ((fd= my_open("/proc/self/limits", O_RDONLY, MYF(MY_NO_REGISTER))) >= 0)
+ if ((fd= open("/proc/self/limits", O_RDONLY)) >= 0)
#endif
{
my_safe_printf_stderr("Resource Limits:\n");
@@ -76,21 +77,20 @@ static inline void output_core_info()
{
my_write_stderr(buff, len);
}
- my_close(fd, MYF(0));
+ close(fd);
}
#ifdef __linux__
- if ((fd= my_open("/proc/sys/kernel/core_pattern", O_RDONLY,
- MYF(MY_NO_REGISTER))) >= 0)
+ if ((fd= open("/proc/sys/kernel/core_pattern", O_RDONLY)) >= 0)
{
len= read(fd, (uchar*)buff, sizeof(buff));
my_safe_printf_stderr("Core pattern: %.*s\n", (int) len, buff);
- my_close(fd, MYF(0));
+ close(fd);
}
- if ((fd= my_open("/proc/version", O_RDONLY, MYF(0))) >= 0)
+ if ((fd= open("/proc/version", O_RDONLY)) >= 0)
{
- len= my_read(fd, (uchar*)buff, sizeof(buff), MYF(0));
+ len= read(fd, (uchar*)buff, sizeof(buff));
my_safe_printf_stderr("Kernel version: %.*s\n", (int) len, buff);
- my_close(fd, MYF(0));
+ close(fd);
}
#endif
#elif defined(__APPLE__) || defined(__FreeBSD__)
@@ -104,11 +104,14 @@ static inline void output_core_info()
{
my_safe_printf_stderr("Kernel version: %.*s\n", (int) len, buff);
}
-#else
+#elif defined(HAVE_GETCWD)
char buff[80];
- my_getwd(buff, sizeof(buff), 0);
- my_safe_printf_stderr("Writing a core file at %s\n", buff);
- fflush(stderr);
+
+ if (getcwd(buff, sizeof(buff)))
+ {
+ my_safe_printf_stderr("Writing a core file at %.*s\n", (int) sizeof(buff), buff);
+ fflush(stderr);
+ }
#endif
}
diff --git a/sql/slave.cc b/sql/slave.cc
index d24e5ab50e4..7bc61d33b11 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -7900,14 +7900,15 @@ end:
@return TRUE if master has the bug, FALSE if it does not.
*/
bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report,
- bool (*pred)(const void *), const void *param)
+ bool (*pred)(const void *), const void *param,
+ bool maria_master)
{
struct st_version_range_for_one_bug {
uint bug_id;
Version introduced_in; // first version with bug
Version fixed_in; // first version with fix
};
- static struct st_version_range_for_one_bug versions_for_all_bugs[]=
+ static struct st_version_range_for_one_bug versions_for_their_bugs[]=
{
{24432, { 5, 0, 24 }, { 5, 0, 38 } },
{24432, { 5, 1, 12 }, { 5, 1, 17 } },
@@ -7915,11 +7916,27 @@ bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report,
{33029, { 5, 1, 0 }, { 5, 1, 12 } },
{37426, { 5, 1, 0 }, { 5, 1, 26 } },
};
+ static struct st_version_range_for_one_bug versions_for_our_bugs[]=
+ {
+ {29621, { 10, 3, 36 }, { 10, 3, 39 } },
+ {29621, { 10, 4, 26 }, { 10, 4, 29 } },
+ {29621, { 10, 5, 17 }, { 10, 5, 20 } },
+ {29621, { 10, 6, 9 }, { 10, 6, 13 } },
+ {29621, { 10, 7, 5 }, { 10, 7, 9 } },
+ {29621, { 10, 8, 4 }, { 10, 8, 8 } },
+ {29621, { 10, 9, 2 }, { 10, 9, 6 } },
+ {29621, { 10, 10,1 }, { 10, 10,4 } },
+ {29621, { 10, 11,1 }, { 10, 11,3 } },
+ };
const Version &master_ver=
rli->relay_log.description_event_for_exec->server_version_split;
+ struct st_version_range_for_one_bug* versions_for_all_bugs= maria_master ?
+ versions_for_our_bugs : versions_for_their_bugs;
+ uint all_size= maria_master ?
+ sizeof(versions_for_our_bugs)/sizeof(*versions_for_our_bugs) :
+ sizeof(versions_for_their_bugs)/sizeof(*versions_for_their_bugs);
- for (uint i= 0;
- i < sizeof(versions_for_all_bugs)/sizeof(*versions_for_all_bugs);i++)
+ for (uint i= 0; i < all_size; i++)
{
const Version &introduced_in= versions_for_all_bugs[i].introduced_in;
const Version &fixed_in= versions_for_all_bugs[i].fixed_in;
@@ -7928,18 +7945,21 @@ bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report,
fixed_in > master_ver &&
(pred == NULL || (*pred)(param)))
{
+ const char *bug_source= maria_master ?
+ "https://jira.mariadb.org/browse/MDEV-" :
+ "http://bugs.mysql.com/bug.php?id=";
if (!report)
return TRUE;
// a short message for SHOW SLAVE STATUS (message length constraints)
my_printf_error(ER_UNKNOWN_ERROR, "master may suffer from"
- " http://bugs.mysql.com/bug.php?id=%u"
+ " %s%u"
" so slave stops; check error log on slave"
- " for more info", MYF(0), bug_id);
+ " for more info", MYF(0), bug_source, bug_id);
// a verbose message for the error log
rli->report(ERROR_LEVEL, ER_UNKNOWN_ERROR, NULL,
"According to the master's version ('%s'),"
" it is probable that master suffers from this bug:"
- " http://bugs.mysql.com/bug.php?id=%u"
+ " %s%u"
" and thus replicating the current binary log event"
" may make the slave's data become different from the"
" master's data."
@@ -7953,6 +7973,7 @@ bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report,
" equal to '%d.%d.%d'. Then replication can be"
" restarted.",
rli->relay_log.description_event_for_exec->server_version,
+ bug_source,
bug_id,
fixed_in[0], fixed_in[1], fixed_in[2]);
return TRUE;
diff --git a/sql/slave.h b/sql/slave.h
index e2bd5cec1b9..02de9135c2a 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -231,7 +231,8 @@ bool show_all_master_info(THD* thd);
void show_binlog_info_get_fields(THD *thd, List<Item> *field_list);
bool show_binlog_info(THD* thd);
bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report,
- bool (*pred)(const void *), const void *param);
+ bool (*pred)(const void *), const void *param,
+ bool maria_master= false);
bool rpl_master_erroneous_autoinc(THD* thd);
const char *print_slave_db_safe(const char *db);
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 6f2fa9bf672..d2ca8717f40 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -2597,6 +2597,8 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
"possible to remove this privilege using REVOKE.",
host.host.hostname, host.db);
}
+ else if (!host.db)
+ host.db= const_cast<char*>(host_not_specified.str);
host.access= host_table.get_access();
host.access= fix_rights_for_db(host.access);
host.sort= get_magic_sort("hd", host.host.hostname, host.db);
@@ -2605,8 +2607,7 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
{
sql_print_warning("'host' entry '%s|%s' "
"ignored in --skip-name-resolve mode.",
- safe_str(host.host.hostname),
- safe_str(host.db));
+ host.host.hostname, host.db);
continue;
}
#ifndef TO_BE_REMOVED
@@ -3728,7 +3729,7 @@ privilege_t acl_get(const char *host, const char *ip,
ACL_HOST *acl_host=dynamic_element(&acl_hosts,i,ACL_HOST*);
if (compare_hostname(&acl_host->host,host,ip))
{
- if (!acl_host->db || !wild_compare(db,acl_host->db,db_is_pattern))
+ if (!wild_compare(db, acl_host->db, db_is_pattern))
{
host_access=acl_host->access; // Fully specified. Take it
break;
@@ -6773,6 +6774,7 @@ static int update_role_columns(GRANT_TABLE *merged,
}
}
+restart:
for (uint i=0 ; i < mh->records ; i++)
{
GRANT_COLUMN *col = (GRANT_COLUMN *)my_hash_element(mh, i);
@@ -6781,6 +6783,7 @@ static int update_role_columns(GRANT_TABLE *merged,
{
changed= 1;
my_hash_delete(mh, (uchar*)col);
+ goto restart;
}
}
DBUG_ASSERT(rights == merged->cols);
diff --git a/sql/sql_analyze_stmt.h b/sql/sql_analyze_stmt.h
index 8f60d4b523a..7fad2ad9cb9 100644
--- a/sql/sql_analyze_stmt.h
+++ b/sql/sql_analyze_stmt.h
@@ -38,6 +38,16 @@ $stmt").
*/
+/* fake microseconds as cycles if cycles isn't available */
+static inline double timer_tracker_frequency()
+{
+#if (MY_TIMER_ROUTINE_CYCLES)
+ return static_cast<double>(sys_timer_info.cycles.frequency);
+#else
+ return static_cast<double>(sys_timer_info.microseconds.frequency);
+#endif
+}
+
class Gap_time_tracker;
void attach_gap_time_tracker(THD *thd, Gap_time_tracker *gap_tracker, ulonglong timeval);
void process_gap_time_tracker(THD *thd, ulonglong timeval);
@@ -52,9 +62,18 @@ protected:
ulonglong cycles;
ulonglong last_start;
+ ulonglong measure() const
+ {
+#if (MY_TIMER_ROUTINE_CYCLES)
+ return my_timer_cycles();
+#else
+ return my_timer_microseconds();
+#endif
+ }
+
void cycles_stop_tracking(THD *thd)
{
- ulonglong end= my_timer_cycles();
+ ulonglong end= measure();
cycles += end - last_start;
if (unlikely(end < last_start))
cycles += ULONGLONG_MAX;
@@ -63,19 +82,24 @@ protected:
if (my_gap_tracker)
attach_gap_time_tracker(thd, my_gap_tracker, end);
}
-public:
- Exec_time_tracker() : count(0), cycles(0), my_gap_tracker(NULL) {}
/*
- The time spent between stop_tracking() call on this object and any
- other time measurement will be billed to this tracker.
+ The time spent after stop_tracking() call on this object and any
+ subsequent time tracking call will be billed to this tracker.
*/
Gap_time_tracker *my_gap_tracker;
+public:
+ Exec_time_tracker() : count(0), cycles(0), my_gap_tracker(NULL) {}
+
+ void set_gap_tracker(Gap_time_tracker *gap_tracker)
+ {
+ my_gap_tracker= gap_tracker;
+ }
// interface for collecting time
void start_tracking(THD *thd)
{
- last_start= my_timer_cycles();
+ last_start= measure();
process_gap_time_tracker(thd, last_start);
}
@@ -91,7 +115,7 @@ public:
{
// convert 'cycles' to milliseconds.
return 1000.0 * static_cast<double>(cycles) /
- static_cast<double>(sys_timer_info.cycles.frequency);
+ timer_tracker_frequency();
}
bool has_timed_statistics() const { return cycles > 0; }
@@ -117,13 +141,11 @@ public:
double get_time_ms() const
{
// convert 'cycles' to milliseconds.
- return 1000.0 * static_cast<double>(cycles) /
- static_cast<double>(sys_timer_info.cycles.frequency);
+ return 1000.0 * static_cast<double>(cycles) / timer_tracker_frequency();
}
};
-
/*
A class for counting certain actions (in all queries), and optionally
collecting the timings (in ANALYZE queries).
@@ -160,6 +182,25 @@ public:
if (unlikely((tracker)->timed)) \
{ (tracker)->stop_tracking(thd); }
+
+/*
+ Just a counter to increment one value. Wrapped in a class to be uniform
+ with other counters used by ANALYZE.
+*/
+
+class Counter_tracker
+{
+public:
+ Counter_tracker() : r_scans(0) {}
+ ha_rows r_scans;
+
+ inline void on_scan_init() { r_scans++; }
+
+ bool has_scans() const { return (r_scans != 0); }
+ ha_rows get_loops() const { return r_scans; }
+};
+
+
/*
A class for collecting read statistics.
@@ -170,20 +211,16 @@ public:
It can be used to track reading from files, buffers, etc).
*/
-class Table_access_tracker
+class Table_access_tracker
{
public:
- Table_access_tracker() :
- r_scans(0), r_rows(0), /*r_rows_after_table_cond(0),*/
- r_rows_after_where(0)
+ Table_access_tracker() : r_scans(0), r_rows(0), r_rows_after_where(0)
{}
- ha_rows r_scans; /* How many scans were ran on this join_tab */
+ ha_rows r_scans; /* how many scans were ran on this join_tab */
ha_rows r_rows; /* How many rows we've got after that */
ha_rows r_rows_after_where; /* Rows after applying attached part of WHERE */
- bool has_scans() const { return (r_scans != 0); }
- ha_rows get_loops() const { return r_scans; }
double get_avg_rows() const
{
return r_scans
@@ -202,6 +239,9 @@ public:
inline void on_scan_init() { r_scans++; }
inline void on_record_read() { r_rows++; }
inline void on_record_after_where() { r_rows_after_where++; }
+
+ bool has_scans() const { return (r_scans != 0); }
+ ha_rows get_loops() const { return r_scans; }
};
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index bae35cd3264..8acee122e07 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -6347,7 +6347,10 @@ find_field_in_table(THD *thd, TABLE *table, const char *name, size_t length,
if (cached_field_index < table->s->fields &&
!my_strcasecmp(system_charset_info,
table->field[cached_field_index]->field_name.str, name))
+ {
field= table->field[cached_field_index];
+ DEBUG_SYNC(thd, "table_field_cached");
+ }
else
{
LEX_CSTRING fname= {name, length};
@@ -6809,6 +6812,13 @@ find_field_in_tables(THD *thd, Item_ident *item,
if (last_table)
last_table= last_table->next_name_resolution_table;
+ field_index_t fake_index_for_duplicate_search= NO_CACHED_FIELD_INDEX;
+ /*
+ For the field search it will point to field cache, but for duplicate
+ search it will point to fake_index_for_duplicate_search (no cache
+ present).
+ */
+ field_index_t *current_cache= &(item->cached_field_index);
for (; cur_table != last_table ;
cur_table= cur_table->next_name_resolution_table)
{
@@ -6823,7 +6833,7 @@ find_field_in_tables(THD *thd, Item_ident *item,
SQLCOM_SHOW_FIELDS)
? false : check_privileges,
allow_rowid,
- &(item->cached_field_index),
+ current_cache,
register_tree_change,
&actual_table);
if (cur_field)
@@ -6838,7 +6848,7 @@ find_field_in_tables(THD *thd, Item_ident *item,
item->name.str, db, table_name,
ignored_tables, ref, false,
allow_rowid,
- &(item->cached_field_index),
+ current_cache,
register_tree_change,
&actual_table);
if (cur_field)
@@ -6855,8 +6865,19 @@ find_field_in_tables(THD *thd, Item_ident *item,
Store the original table of the field, which may be different from
cur_table in the case of NATURAL/USING join.
*/
- item->cached_table= (!actual_table->cacheable_table || found) ?
- 0 : actual_table;
+ if (actual_table->cacheable_table /*(1)*/ && !found /*(2)*/)
+ {
+ /*
+ We have just found a field allowed to cache (1) and
+ it is not dublicate search (2).
+ */
+ item->cached_table= actual_table;
+ }
+ else
+ {
+ item->cached_table= NULL;
+ item->cached_field_index= NO_CACHED_FIELD_INDEX;
+ }
DBUG_ASSERT(thd->where);
/*
@@ -6875,6 +6896,7 @@ find_field_in_tables(THD *thd, Item_ident *item,
return (Field*) 0;
}
found= cur_field;
+ current_cache= &fake_index_for_duplicate_search;
}
}
@@ -8332,9 +8354,8 @@ bool setup_tables(THD *thd, Name_resolution_context *context,
table_list;
table_list= table_list->next_local)
{
- if (table_list->merge_underlying_list)
+ if (table_list->is_merged_derived() && table_list->merge_underlying_list)
{
- DBUG_ASSERT(table_list->is_merged_derived());
Query_arena *arena, backup;
arena= thd->activate_stmt_arena_if_needed(&backup);
bool res;
diff --git a/sql/sql_class.h b/sql/sql_class.h
index bc94d583398..0661eb9014e 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1897,7 +1897,7 @@ show_system_thread(enum_thread_type thread)
RETURN_NAME_AS_STRING(SYSTEM_THREAD_SLAVE_BACKGROUND);
RETURN_NAME_AS_STRING(SYSTEM_THREAD_SEMISYNC_MASTER_BACKGROUND);
default:
- sprintf(buf, "<UNKNOWN SYSTEM THREAD: %d>", thread);
+ snprintf(buf, sizeof(buf), "<UNKNOWN SYSTEM THREAD: %d>", thread);
return buf;
}
#undef RETURN_NAME_AS_STRING
@@ -7772,7 +7772,7 @@ public:
if (unlikely(!(dst->str= tmp= (char*) alloc_root(mem_root,
dst->length + 1))))
return true;
- sprintf(tmp, "%.*s%.*s%.*s",
+ snprintf(tmp, dst->length + 1, "%.*s%.*s%.*s",
(int) m_db.length, (m_db.length ? m_db.str : ""),
dot, ".",
(int) m_name.length, m_name.str);
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index dcf61e9b085..9598a1c58f1 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -1805,7 +1805,10 @@ bool Sql_cmd_delete::execute_inner(THD *thd)
else
{
if (thd->lex->describe || thd->lex->analyze_stmt)
- res= thd->lex->explain->send_explain(thd);
+ {
+ bool extended= thd->lex->describe & DESCRIBE_EXTENDED;
+ res= thd->lex->explain->send_explain(thd, extended);
+ }
}
}
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 22dd7734aea..4ceebcc1978 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -351,24 +351,6 @@ bool mysql_derived_merge(THD *thd, LEX *lex, TABLE_LIST *derived)
DBUG_RETURN(FALSE);
}
- if (dt_select->uncacheable & UNCACHEABLE_RAND)
- {
- /* There is random function => fall back to materialization. */
- cause= "Random function in the select";
- if (unlikely(thd->trace_started()))
- {
- OPT_TRACE_VIEWS_TRANSFORM(thd, trace_wrapper, trace_derived,
- derived->is_derived() ? "derived" : "view",
- derived->alias.str ? derived->alias.str : "<NULL>",
- derived->get_unit()->first_select()->select_number,
- "materialized");
- trace_derived.add("cause", cause);
- }
- derived->change_refs_to_fields();
- derived->set_materialized_derived();
- DBUG_RETURN(FALSE);
- }
-
if (derived->dt_handler)
{
derived->change_refs_to_fields();
@@ -821,6 +803,9 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
cursor->outer_join|= JOIN_TYPE_OUTER;
}
}
+ // Prevent it for possible ORDER BY clause
+ if (unit->fake_select_lex)
+ unit->fake_select_lex->context.outer_context= 0;
if (unlikely(thd->trace_started()))
{
diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc
index e98728eb443..639a45bf848 100644
--- a/sql/sql_explain.cc
+++ b/sql/sql_explain.cc
@@ -188,7 +188,7 @@ void Explain_query::notify_tables_are_closed()
Send EXPLAIN output to the client.
*/
-int Explain_query::send_explain(THD *thd)
+int Explain_query::send_explain(THD *thd, bool extended)
{
select_result *result;
LEX *lex= thd->lex;
@@ -201,8 +201,22 @@ int Explain_query::send_explain(THD *thd)
if (thd->lex->explain_json)
print_explain_json(result, thd->lex->analyze_stmt, false /*is_show_cmd*/);
else
+ {
res= print_explain(result, lex->describe, thd->lex->analyze_stmt);
-
+ if (extended)
+ {
+ char buff[1024];
+ String str(buff,(uint32) sizeof(buff), system_charset_info);
+ str.length(0);
+ /*
+ The warnings system requires input in utf8, @see
+ mysqld_show_warnings().
+ */
+ lex->unit.print(&str, QT_EXPLAIN_EXTENDED);
+ push_warning(thd, Sql_condition::WARN_LEVEL_NOTE,
+ ER_YES, str.c_ptr_safe());
+ }
+ }
if (res)
result->abort_result_set();
else
@@ -212,6 +226,7 @@ int Explain_query::send_explain(THD *thd)
}
+
/*
The main entry point to print EXPLAIN of the entire query
*/
@@ -2027,7 +2042,8 @@ void Explain_table_access::print_explain_json(Explain_query *query,
if (is_analyze)
{
- //writer->add_member("r_loops").add_ll(jbuf_tracker.get_loops());
+ writer->add_member("r_loops").add_ll(jbuf_loops_tracker.get_loops());
+
writer->add_member("r_filtered");
if (jbuf_tracker.has_scans())
writer->add_double(jbuf_tracker.get_filtered_after_where()*100.0);
@@ -2036,6 +2052,26 @@ void Explain_table_access::print_explain_json(Explain_query *query,
writer->add_member("r_unpack_time_ms");
writer->add_double(jbuf_unpack_tracker.get_time_ms());
+
+ writer->add_member("r_other_time_ms").
+ add_double(jbuf_extra_time_tracker.get_time_ms());
+ /*
+ effective_rows is average number of matches we got for an incoming
+ row. The row is stored in the join buffer and then is read
+ from there, possibly multiple times. We can't count this number
+ directly. Infer it as:
+ total_number_of_row_combinations_considered / r_loops.
+ */
+ writer->add_member("r_effective_rows");
+ if (jbuf_loops_tracker.has_scans())
+ {
+ double loops= (double)jbuf_loops_tracker.get_loops();
+ double row_combinations= (double)jbuf_tracker.r_rows;
+ writer->add_double(row_combinations / loops);
+ }
+ else
+ writer->add_null();
+
}
}
diff --git a/sql/sql_explain.h b/sql/sql_explain.h
index 03eb8821a34..2ab2775820b 100644
--- a/sql/sql_explain.h
+++ b/sql/sql_explain.h
@@ -495,7 +495,7 @@ public:
bool is_analyze);
/* Send tabular EXPLAIN to the client */
- int send_explain(THD *thd);
+ int send_explain(THD *thd, bool extended);
/* Return tabular EXPLAIN output as a text string */
bool print_explain_str(THD *thd, String *out_str, bool is_analyze);
@@ -882,9 +882,22 @@ public:
Exec_time_tracker op_tracker;
Gap_time_tracker extra_time_tracker;
+ /* When using join buffer: Track the reads from join buffer */
Table_access_tracker jbuf_tracker;
+
+ /* When using join buffer: time spent unpacking rows from the join buffer */
Time_and_counter_tracker jbuf_unpack_tracker;
-
+
+ /*
+ When using join buffer: time spent after unpacking rows from the join
+ buffer. This will capture the time spent checking the Join Condition:
+ the condition that depends on this table and preceding tables.
+ */
+ Gap_time_tracker jbuf_extra_time_tracker;
+
+ /* When using join buffer: Track the number of incoming record combinations */
+ Counter_tracker jbuf_loops_tracker;
+
Explain_rowid_filter *rowid_filter;
int print_explain(select_result_sink *output, uint8 explain_flags,
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 6e042d25805..475bca62f02 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -879,7 +879,8 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list,
save_insert_query_plan(thd, table_list);
if (thd->lex->describe)
{
- retval= thd->lex->explain->send_explain(thd);
+ bool extended= thd->lex->describe & DESCRIBE_EXTENDED;
+ retval= thd->lex->explain->send_explain(thd, extended);
goto abort;
}
@@ -2269,6 +2270,7 @@ int check_that_all_fields_are_given_values(THD *thd, TABLE *entry, TABLE_LIST *t
for (Field **field=entry->field ; *field ; field++)
{
if (!bitmap_is_set(write_set, (*field)->field_index) &&
+ !(*field)->vcol_info &&
has_no_default_value(thd, *field, table_list))
err=1;
}
@@ -4221,6 +4223,7 @@ bool select_insert::store_values(List<Item> &values)
DBUG_ENTER("select_insert::store_values");
bool error;
+ table->reset_default_fields();
if (fields->elements)
error= fill_record_n_invoke_before_triggers(thd, table, *fields, values,
true, TRG_EVENT_INSERT);
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc
index 3c19674ff96..413849db6b2 100644
--- a/sql/sql_join_cache.cc
+++ b/sql/sql_join_cache.cc
@@ -1620,7 +1620,7 @@ bool JOIN_CACHE::get_record()
pos+= referenced_fields*size_of_fld_ofs;
if (prev_cache)
prev_cache->get_record_by_pos(prev_rec_ptr);
- }
+ }
ANALYZE_STOP_TRACKING(thd(), join_tab->jbuf_unpack_tracker);
return res;
}
@@ -2397,7 +2397,9 @@ enum_nested_loop_state JOIN_CACHE::join_matching_records(bool skip_last)
(join_tab->first_inner && !not_exists_opt_is_applicable) ||
!skip_next_candidate_for_match(rec_ptr))
{
- read_next_candidate_for_match(rec_ptr);
+ ANALYZE_START_TRACKING(join->thd, join_tab->jbuf_unpack_tracker);
+ read_next_candidate_for_match(rec_ptr);
+ ANALYZE_STOP_TRACKING(join->thd, join_tab->jbuf_unpack_tracker);
rc= generate_full_extensions(rec_ptr);
if (rc != NESTED_LOOP_OK && rc != NESTED_LOOP_NO_MORE_ROWS)
goto finish;
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 2b175823ad5..5206a43f5eb 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -40,8 +40,6 @@
#ifdef WITH_WSREP
#include "mysql/service_wsrep.h"
#endif
-#include "sql_update.h" // class Sql_cmd_update
-#include "sql_delete.h" // class Sql_cmd_delete
void LEX::parse_error(uint err_number)
{
@@ -862,7 +860,7 @@ void Lex_input_stream::body_utf8_start(THD *thd, const char *begin_ptr)
}
-size_t Lex_input_stream::get_body_utf8_maximum_length(THD *thd)
+size_t Lex_input_stream::get_body_utf8_maximum_length(THD *thd) const
{
/*
String literals can grow during escaping:
@@ -1299,6 +1297,8 @@ void LEX::start(THD *thd_arg)
frame_bottom_bound= NULL;
win_spec= NULL;
+ upd_del_where= NULL;
+
vers_conditions.empty();
period_conditions.empty();
@@ -1367,7 +1367,7 @@ Yacc_state::~Yacc_state()
}
int Lex_input_stream::find_keyword(Lex_ident_cli_st *kwd,
- uint len, bool function)
+ uint len, bool function) const
{
const char *tok= m_tok_start;
@@ -3034,6 +3034,7 @@ void st_select_lex::init_select()
in_funcs.empty();
curr_tvc_name= 0;
versioned_tables= 0;
+ is_tvc_wrapper= false;
nest_flags= 0;
item_list_usage= MARK_COLUMNS_READ;
}
@@ -3931,57 +3932,54 @@ LEX::LEX()
}
+bool LEX::can_be_merged()
+{
+ return unit.can_be_merged();
+}
+
+
/*
- Check whether the merging algorithm can be used on this VIEW
+ Check whether the merging algorithm can be used for this unit
SYNOPSIS
- LEX::can_be_merged()
+ st_select_lex_unit::can_be_merged()
DESCRIPTION
- We can apply merge algorithm if it is single SELECT view with
- subqueries only in WHERE clause (we do not count SELECTs of underlying
- views, and second level subqueries) and we have not grpouping, ordering,
- HAVING clause, aggregate functions, DISTINCT clause, LIMIT clause and
- several underlying tables.
+ We can apply merge algorithm for a unit if it is single SELECT with
+ subqueries only in WHERE clauses or in ON conditions or in select list
+ (we do not count SELECTs of underlying views/derived tables/CTEs and
+ second level subqueries) and we have no grouping, ordering, HAVING
+ clause, aggregate functions, DISTINCT clause, LIMIT clause.
RETURN
FALSE - only temporary table algorithm can be used
TRUE - merge algorithm can be used
*/
-bool LEX::can_be_merged()
+bool st_select_lex_unit::can_be_merged()
{
// TODO: do not forget implement case when select_lex.table_list.elements==0
/* find non VIEW subqueries/unions */
- bool selects_allow_merge= (first_select_lex()->next_select() == 0 &&
- !(first_select_lex()->uncacheable &
- UNCACHEABLE_RAND));
- if (selects_allow_merge)
- {
- for (SELECT_LEX_UNIT *tmp_unit= first_select_lex()->first_inner_unit();
- tmp_unit;
- tmp_unit= tmp_unit->next_unit())
- {
- if (tmp_unit->first_select()->parent_lex == this &&
- (tmp_unit->item != 0 &&
- (tmp_unit->item->place() != IN_WHERE &&
- tmp_unit->item->place() != IN_ON &&
- tmp_unit->item->place() != SELECT_LIST)))
- {
- selects_allow_merge= 0;
- break;
- }
- }
- }
-
- return (selects_allow_merge &&
- first_select_lex()->group_list.elements == 0 &&
- first_select_lex()->having == 0 &&
- first_select_lex()->with_sum_func == 0 &&
- first_select_lex()->table_list.elements >= 1 &&
- !(first_select_lex()->options & SELECT_DISTINCT) &&
- first_select_lex()->limit_params.select_limit == 0);
+ st_select_lex *fs= first_select();
+
+ if (fs->next_select() ||
+ (fs->uncacheable & UNCACHEABLE_RAND) ||
+ (fs->options & SELECT_DISTINCT) ||
+ fs->group_list.elements || fs->having ||
+ fs->with_sum_func ||
+ fs->table_list.elements < 1 ||
+ fs->limit_params.select_limit)
+ return false;
+ for (SELECT_LEX_UNIT *tmp_unit= fs->first_inner_unit();
+ tmp_unit;
+ tmp_unit= tmp_unit->next_unit())
+ if ((tmp_unit->item != 0 &&
+ (tmp_unit->item->place() != IN_WHERE &&
+ tmp_unit->item->place() != IN_ON &&
+ tmp_unit->item->place() != SELECT_LIST)))
+ return false;
+ return true;
}
@@ -4028,9 +4026,6 @@ bool LEX::can_use_merged()
SYNOPSIS
LEX::can_not_use_merged()
- @param forced_no_merge_for_update_delete Set to 1 if we can't use merge with
- multiple-table updates/deletes
-
DESCRIPTION
Temporary table algorithm will be used on all SELECT levels for queries
listed here (see also LEX::can_use_merged()).
@@ -4040,7 +4035,7 @@ bool LEX::can_use_merged()
TRUE - VIEWs with MERGE algorithms can be used
*/
-bool LEX::can_not_use_merged(bool forced_no_merge_for_update_delete)
+bool LEX::can_not_use_merged()
{
switch (sql_command) {
case SQLCOM_CREATE_VIEW:
@@ -4053,30 +4048,6 @@ bool LEX::can_not_use_merged(bool forced_no_merge_for_update_delete)
case SQLCOM_SHOW_FIELDS:
return TRUE;
- case SQLCOM_UPDATE_MULTI:
- if (forced_no_merge_for_update_delete)
- return TRUE;
- /* Fall through */
-
- case SQLCOM_UPDATE:
- if (forced_no_merge_for_update_delete &&
- (((Sql_cmd_update *) m_sql_cmd)->is_multitable() ||
- query_tables->is_multitable()))
- return TRUE;
- return FALSE;
-
- case SQLCOM_DELETE_MULTI:
- if (forced_no_merge_for_update_delete)
- return TRUE;
- /* Fall through */
-
- case SQLCOM_DELETE:
- if (forced_no_merge_for_update_delete &&
- (((Sql_cmd_delete *) m_sql_cmd)->is_multitable() ||
- query_tables->is_multitable()))
- return TRUE;
- return FALSE;
-
default:
return FALSE;
}
@@ -9390,22 +9361,6 @@ bool LEX::add_grant_command(THD *thd, const List<LEX_COLUMN> &columns)
}
-Item *LEX::make_item_func_substr(THD *thd, Item *a, Item *b, Item *c)
-{
- return (thd->variables.sql_mode & MODE_ORACLE) ?
- new (thd->mem_root) Item_func_substr_oracle(thd, a, b, c) :
- new (thd->mem_root) Item_func_substr(thd, a, b, c);
-}
-
-
-Item *LEX::make_item_func_substr(THD *thd, Item *a, Item *b)
-{
- return (thd->variables.sql_mode & MODE_ORACLE) ?
- new (thd->mem_root) Item_func_substr_oracle(thd, a, b) :
- new (thd->mem_root) Item_func_substr(thd, a, b);
-}
-
-
Item *LEX::make_item_func_sysdate(THD *thd, uint fsp)
{
/*
@@ -9426,17 +9381,6 @@ Item *LEX::make_item_func_sysdate(THD *thd, uint fsp)
}
-Item *LEX::make_item_func_replace(THD *thd,
- Item *org,
- Item *find,
- Item *replace)
-{
- return (thd->variables.sql_mode & MODE_ORACLE) ?
- new (thd->mem_root) Item_func_replace_oracle(thd, org, find, replace) :
- new (thd->mem_root) Item_func_replace(thd, org, find, replace);
-}
-
-
bool SELECT_LEX::vers_push_field(THD *thd, TABLE_LIST *table,
const LEX_CSTRING field_name)
{
@@ -11918,6 +11862,13 @@ bool SELECT_LEX_UNIT::explainable() const
false;
}
+
+bool st_select_lex::is_query_topmost(THD *thd)
+{
+ return get_master() == &thd->lex->unit;
+}
+
+
/*
Determines whether the derived table was eliminated during
the call of eliminate_tables(JOIN *) made at the optimization stage
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index acf23d5ffa2..adb887be380 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -1044,6 +1044,8 @@ public:
bool set_lock_to_the_last_select(Lex_select_lock l);
+ bool can_be_merged();
+
friend class st_select_lex;
private:
@@ -1306,6 +1308,8 @@ public:
st_select_lex.
*/
uint curr_tvc_name;
+ /* true <=> select has been created a TVC wrapper */
+ bool is_tvc_wrapper;
uint fields_in_window_functions;
uint insert_tables;
enum_parsing_place parsing_place; /* where we are parsing expression */
@@ -1390,6 +1394,7 @@ public:
return (st_select_lex_unit*) slave;
}
st_select_lex* outer_select();
+ bool is_query_topmost(THD *thd);
st_select_lex* next_select() { return (st_select_lex*) next; }
st_select_lex* next_select_in_list()
{
@@ -1476,6 +1481,10 @@ public:
}
bool setup_ref_array(THD *thd, uint order_group_num);
void print(THD *thd, String *str, enum_query_type query_type);
+ void print_item_list(THD *thd, String *str, enum_query_type query_type);
+ void print_set_clause(THD *thd, String *str, enum_query_type query_type);
+ void print_on_duplicate_key_clause(THD *thd, String *str,
+ enum_query_type query_type);
static void print_order(String *str,
ORDER *order,
enum_query_type query_type);
@@ -2548,7 +2557,7 @@ private:
Get the last character accepted.
@return the last character accepted.
*/
- unsigned char yyGetLast()
+ unsigned char yyGetLast() const
{
return m_ptr[-1];
}
@@ -2556,7 +2565,7 @@ private:
/**
Look at the next character to parse, but do not accept it.
*/
- unsigned char yyPeek()
+ unsigned char yyPeek() const
{
return m_ptr[0];
}
@@ -2565,7 +2574,7 @@ private:
Look ahead at some character to parse.
@param n offset of the character to look up
*/
- unsigned char yyPeekn(int n)
+ unsigned char yyPeekn(int n) const
{
return m_ptr[n];
}
@@ -2626,7 +2635,7 @@ private:
@param n number of characters expected
@return true if there are less than n characters to parse
*/
- bool eof(int n)
+ bool eof(int n) const
{
return ((m_ptr + n) >= m_end_of_query);
}
@@ -2657,10 +2666,10 @@ private:
Get the maximum length of the utf8-body buffer.
The utf8 body can grow because of the character set conversion and escaping.
*/
- size_t get_body_utf8_maximum_length(THD *thd);
+ size_t get_body_utf8_maximum_length(THD *thd) const;
/** Get the length of the current token, in the raw buffer. */
- uint yyLength()
+ uint yyLength() const
{
/*
The assumption is that the lexical analyser is always 1 character ahead,
@@ -2685,31 +2694,31 @@ public:
End of file indicator for the query text to parse.
@return true if there are no more characters to parse
*/
- bool eof()
+ bool eof() const
{
return (m_ptr >= m_end_of_query);
}
/** Get the raw query buffer. */
- const char *get_buf()
+ const char *get_buf() const
{
return m_buf;
}
/** Get the pre-processed query buffer. */
- const char *get_cpp_buf()
+ const char *get_cpp_buf() const
{
return m_cpp_buf;
}
/** Get the end of the raw query buffer. */
- const char *get_end_of_query()
+ const char *get_end_of_query() const
{
return m_end_of_query;
}
/** Get the token start position, in the raw buffer. */
- const char *get_tok_start()
+ const char *get_tok_start() const
{
return has_lookahead() ? m_tok_start_prev : m_tok_start;
}
@@ -2720,25 +2729,25 @@ public:
}
/** Get the token end position, in the raw buffer. */
- const char *get_tok_end()
+ const char *get_tok_end() const
{
return m_tok_end;
}
/** Get the current stream pointer, in the raw buffer. */
- const char *get_ptr()
+ const char *get_ptr() const
{
return m_ptr;
}
/** Get the token start position, in the pre-processed buffer. */
- const char *get_cpp_tok_start()
+ const char *get_cpp_tok_start() const
{
return has_lookahead() ? m_cpp_tok_start_prev : m_cpp_tok_start;
}
/** Get the token end position, in the pre-processed buffer. */
- const char *get_cpp_tok_end()
+ const char *get_cpp_tok_end() const
{
return m_cpp_tok_end;
}
@@ -2747,7 +2756,7 @@ public:
Get the token end position in the pre-processed buffer,
with trailing spaces removed.
*/
- const char *get_cpp_tok_end_rtrim()
+ const char *get_cpp_tok_end_rtrim() const
{
const char *p;
for (p= m_cpp_tok_end;
@@ -2758,7 +2767,7 @@ public:
}
/** Get the current stream pointer, in the pre-processed buffer. */
- const char *get_cpp_ptr()
+ const char *get_cpp_ptr() const
{
return m_cpp_ptr;
}
@@ -2767,7 +2776,7 @@ public:
Get the current stream pointer, in the pre-processed buffer,
with traling spaces removed.
*/
- const char *get_cpp_ptr_rtrim()
+ const char *get_cpp_ptr_rtrim() const
{
const char *p;
for (p= m_cpp_ptr;
@@ -2777,13 +2786,13 @@ public:
return p;
}
/** Get the utf8-body string. */
- const char *get_body_utf8_str()
+ const char *get_body_utf8_str() const
{
return m_body_utf8;
}
/** Get the utf8-body length. */
- size_t get_body_utf8_length()
+ size_t get_body_utf8_length() const
{
return (size_t) (m_body_utf8_ptr - m_body_utf8);
}
@@ -2819,7 +2828,7 @@ private:
bool consume_comment(int remaining_recursions_permitted);
int lex_one_token(union YYSTYPE *yylval, THD *thd);
- int find_keyword(Lex_ident_cli_st *str, uint len, bool function);
+ int find_keyword(Lex_ident_cli_st *str, uint len, bool function) const;
LEX_CSTRING get_token(uint skip, uint length);
int scan_ident_sysvar(THD *thd, Lex_ident_cli_st *str);
int scan_ident_start(THD *thd, Lex_ident_cli_st *str);
@@ -3610,6 +3619,8 @@ public:
Window_frame_bound *frame_bottom_bound;
Window_spec *win_spec;
+ Item *upd_del_where;
+
/* System Versioning */
vers_select_conds_t vers_conditions;
vers_select_conds_t period_conditions;
@@ -3691,7 +3702,7 @@ public:
bool can_be_merged();
bool can_use_merged();
- bool can_not_use_merged(bool no_update_or_delete);
+ bool can_not_use_merged();
bool only_view_structure();
bool need_correct_ident();
uint8 get_effective_with_check(TABLE_LIST *view);
@@ -4167,9 +4178,6 @@ public:
Item *create_item_query_expression(THD *thd, st_select_lex_unit *unit);
- Item *make_item_func_replace(THD *thd, Item *org, Item *find, Item *replace);
- Item *make_item_func_substr(THD *thd, Item *a, Item *b, Item *c);
- Item *make_item_func_substr(THD *thd, Item *a, Item *b);
Item *make_item_func_sysdate(THD *thd, uint fsp);
Item *make_item_func_call_generic(THD *thd, Lex_ident_cli_st *db,
Lex_ident_cli_st *name, List<Item> *args);
diff --git a/sql/sql_locale.cc b/sql/sql_locale.cc
index eb5e3fbbc5a..713ee1fe476 100644
--- a/sql/sql_locale.cc
+++ b/sql/sql_locale.cc
@@ -29,7 +29,7 @@
enum err_msgs_index
{
- en_US= 0, cs_CZ, da_DK, nl_NL, et_EE, fr_FR, de_DE, el_GR, hu_HU, it_IT,
+ en_US= 0, zh_CN, cs_CZ, da_DK, nl_NL, et_EE, fr_FR, de_DE, el_GR, hu_HU, it_IT,
ja_JP, ko_KR, no_NO, nn_NO, pl_PL, pt_PT, ro_RO, ru_RU, sr_RS, sk_SK,
es_ES, sv_SE, uk_UA, hi_IN, ka_GE
} ERR_MSGS_INDEX;
@@ -38,6 +38,7 @@ enum err_msgs_index
MY_LOCALE_ERRMSGS global_errmsgs[]=
{
{"english", NULL},
+ {"chinese", NULL},
{"czech", NULL},
{"danish", NULL},
{"dutch", NULL},
@@ -2096,7 +2097,7 @@ MY_LOCALE my_locale_zh_CN
'.', /* decimal point zh_CN */
',', /* thousands_sep zh_CN */
"\x03", /* grouping zh_CN */
- &global_errmsgs[en_US]
+ &global_errmsgs[zh_CN]
);
/***** LOCALE END zh_CN *****/
@@ -3320,7 +3321,21 @@ MY_LOCALE my_locale_rm_CH
/***** LOCALE BEGIN ka_GE: Georgian - Georgia *****/
static const char *my_locale_month_names_ka_GE[13] =
- {"იანვარი","თებერვალი","მარტი","აპრილი","მაისი","ივნისი","ივლისი","სექტემბერი","ოქტომბერი","ნოემბერი","დეკემბერი", NullS };
+{
+ "იანვარი", // January
+ "თებერვალი", // February
+ "მარტი", // March
+ "აპრილი", // April
+ "მაისი", // May
+ "ივნისი", // June
+ "ივლისი", // July
+ "აგვისტო", // August
+ "სექტემბერი", // September
+ "ოქტომბერი", // October
+ "ნოემბერი", // November
+ "დეკემბერი", // December
+ NullS
+};
static const char *my_locale_ab_month_names_ka_GE[13] =
{"იან","თებ","მარ","აპრ","მაი","ივნ","ივლ","აგვ","სექტ","ოქტ","ნოე","დეკ", NullS };
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 67353a1f082..5dccd3c12ae 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1334,7 +1334,7 @@ dispatch_command_return do_command(THD *thd, bool blocking)
in wsrep_before_command().
*/
WSREP_LOG_THD(thd, "enter found BF aborted");
- DBUG_ASSERT(!thd->mdl_context.has_locks());
+ DBUG_ASSERT(!thd->mdl_context.has_transactional_locks());
DBUG_ASSERT(!thd->get_stmt_da()->is_set());
/* We let COM_QUIT and COM_STMT_CLOSE to execute even if wsrep aborted. */
if (command == COM_STMT_EXECUTE)
@@ -4455,7 +4455,10 @@ mysql_execute_command(THD *thd, bool is_called_from_prepared_stmt)
thd->protocol= save_protocol;
}
if (!res && thd->lex->analyze_stmt)
- res= thd->lex->explain->send_explain(thd);
+ {
+ bool extended= thd->lex->describe & DESCRIBE_EXTENDED;
+ res= thd->lex->explain->send_explain(thd, extended);
+ }
delete sel_result;
MYSQL_INSERT_DONE(res, (ulong) thd->get_row_count_func());
/*
@@ -4635,7 +4638,10 @@ mysql_execute_command(THD *thd, bool is_called_from_prepared_stmt)
thd->protocol= save_protocol;
}
if (!res && (explain || lex->analyze_stmt))
- res= thd->lex->explain->send_explain(thd);
+ {
+ bool extended= thd->lex->describe & DESCRIBE_EXTENDED;
+ res= thd->lex->explain->send_explain(thd, extended);
+ }
/* revert changes for SP */
MYSQL_INSERT_SELECT_DONE(res, (ulong) thd->get_row_count_func());
@@ -6033,7 +6039,10 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
thd->protocol= save_protocol;
}
if (!res)
- res= thd->lex->explain->send_explain(thd);
+ {
+ bool extended= thd->lex->describe & DESCRIBE_EXTENDED;
+ res= thd->lex->explain->send_explain(thd, extended);
+ }
}
}
}
@@ -9039,7 +9048,9 @@ static my_bool kill_threads_callback(THD *thd, kill_threads_callback_arg *arg)
if (!(arg->thd->security_ctx->master_access &
PRIV_KILL_OTHER_USER_PROCESS) &&
!arg->thd->security_ctx->user_matches(thd->security_ctx))
- return 1;
+ {
+ return MY_TEST(arg->thd->security_ctx->master_access & PROCESS_ACL);
+ }
if (!arg->threads_to_kill.push_back(thd, arg->thd->mem_root))
{
mysql_mutex_lock(&thd->LOCK_thd_kill); // Lock from delete
@@ -9159,7 +9170,10 @@ sql_kill_user(THD *thd, LEX_USER *user, killed_state state)
my_ok(thd, rows);
break;
case ER_KILL_DENIED_ERROR:
- my_error(error, MYF(0), (long long) thd->thread_id);
+ char buf[DEFINER_LENGTH+1];
+ strxnmov(buf, sizeof(buf), user->user.str, "@", user->host.str, NULL);
+ my_printf_error(ER_KILL_DENIED_ERROR, ER_THD(thd, ER_CANNOT_USER), MYF(0),
+ "KILL USER", buf);
break;
case ER_OUT_OF_RESOURCES:
default:
diff --git a/sql/sql_priv.h b/sql/sql_priv.h
index 6f4eff4880c..5f2074851e1 100644
--- a/sql/sql_priv.h
+++ b/sql/sql_priv.h
@@ -238,38 +238,39 @@
#define OPTIMIZER_SWITCH_USE_ROWID_FILTER (1ULL << 33)
#define OPTIMIZER_SWITCH_COND_PUSHDOWN_FROM_HAVING (1ULL << 34)
#define OPTIMIZER_SWITCH_NOT_NULL_RANGE_SCAN (1ULL << 35)
-
-#define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \
- OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \
- OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION | \
- OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT | \
- OPTIMIZER_SWITCH_INDEX_COND_PUSHDOWN | \
- OPTIMIZER_SWITCH_DERIVED_MERGE | \
- OPTIMIZER_SWITCH_DERIVED_WITH_KEYS | \
- OPTIMIZER_SWITCH_TABLE_ELIMINATION | \
- OPTIMIZER_SWITCH_EXTENDED_KEYS | \
- OPTIMIZER_SWITCH_IN_TO_EXISTS | \
- OPTIMIZER_SWITCH_MATERIALIZATION | \
- OPTIMIZER_SWITCH_PARTIAL_MATCH_ROWID_MERGE|\
- OPTIMIZER_SWITCH_PARTIAL_MATCH_TABLE_SCAN|\
- OPTIMIZER_SWITCH_OUTER_JOIN_WITH_CACHE | \
- OPTIMIZER_SWITCH_SEMIJOIN_WITH_CACHE | \
- OPTIMIZER_SWITCH_JOIN_CACHE_INCREMENTAL | \
- OPTIMIZER_SWITCH_JOIN_CACHE_HASHED | \
- OPTIMIZER_SWITCH_JOIN_CACHE_BKA | \
- OPTIMIZER_SWITCH_SUBQUERY_CACHE | \
- OPTIMIZER_SWITCH_SEMIJOIN | \
- OPTIMIZER_SWITCH_FIRSTMATCH | \
- OPTIMIZER_SWITCH_LOOSE_SCAN | \
- OPTIMIZER_SWITCH_EXISTS_TO_IN | \
- OPTIMIZER_SWITCH_ORDERBY_EQ_PROP | \
- OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_DERIVED | \
- OPTIMIZER_SWITCH_SPLIT_MATERIALIZED | \
- OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_SUBQUERY | \
- OPTIMIZER_SWITCH_USE_ROWID_FILTER | \
- OPTIMIZER_SWITCH_COND_PUSHDOWN_FROM_HAVING | \
- OPTIMIZER_SWITCH_OPTIMIZE_JOIN_BUFFER_SIZE)
-
+#define OPTIMIZER_SWITCH_HASH_JOIN_CARDINALITY (1ULL << 36)
+
+#define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \
+ OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \
+ OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION | \
+ OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT | \
+ OPTIMIZER_SWITCH_INDEX_COND_PUSHDOWN | \
+ OPTIMIZER_SWITCH_DERIVED_MERGE | \
+ OPTIMIZER_SWITCH_DERIVED_WITH_KEYS | \
+ OPTIMIZER_SWITCH_TABLE_ELIMINATION | \
+ OPTIMIZER_SWITCH_EXTENDED_KEYS | \
+ OPTIMIZER_SWITCH_IN_TO_EXISTS | \
+ OPTIMIZER_SWITCH_MATERIALIZATION | \
+ OPTIMIZER_SWITCH_PARTIAL_MATCH_ROWID_MERGE|\
+ OPTIMIZER_SWITCH_PARTIAL_MATCH_TABLE_SCAN|\
+ OPTIMIZER_SWITCH_OUTER_JOIN_WITH_CACHE | \
+ OPTIMIZER_SWITCH_SEMIJOIN_WITH_CACHE | \
+ OPTIMIZER_SWITCH_JOIN_CACHE_INCREMENTAL | \
+ OPTIMIZER_SWITCH_JOIN_CACHE_HASHED | \
+ OPTIMIZER_SWITCH_JOIN_CACHE_BKA | \
+ OPTIMIZER_SWITCH_SUBQUERY_CACHE | \
+ OPTIMIZER_SWITCH_SEMIJOIN | \
+ OPTIMIZER_SWITCH_FIRSTMATCH | \
+ OPTIMIZER_SWITCH_LOOSE_SCAN | \
+ OPTIMIZER_SWITCH_EXISTS_TO_IN | \
+ OPTIMIZER_SWITCH_ORDERBY_EQ_PROP | \
+ OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_DERIVED | \
+ OPTIMIZER_SWITCH_SPLIT_MATERIALIZED | \
+ OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_SUBQUERY |\
+ OPTIMIZER_SWITCH_USE_ROWID_FILTER | \
+ OPTIMIZER_SWITCH_COND_PUSHDOWN_FROM_HAVING | \
+ OPTIMIZER_SWITCH_OPTIMIZE_JOIN_BUFFER_SIZE |\
+ OPTIMIZER_SWITCH_HASH_JOIN_CARDINALITY)
/*
Replication uses 8 bytes to store SQL_MODE in the binary log. The day you
use strictly more than 64 bits by adding one more define above, you should
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 80a746f32b7..dc27ab9ff8b 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -432,7 +432,7 @@ static int send_file(THD *thd)
/**
Internal to mysql_binlog_send() routine that recalculates checksum for
- 1. FD event (asserted) that needs additional arranment prior sending to slave.
+ 1. FD event (asserted) that needs additional arrangement prior sending to slave.
2. Start_encryption_log_event whose Ignored flag is set
TODO DBUG_ASSERT can be removed if this function is used for more general cases
*/
diff --git a/sql/sql_schema.cc b/sql/sql_schema.cc
index 0bf4a63c2f8..f08204d272d 100644
--- a/sql/sql_schema.cc
+++ b/sql/sql_schema.cc
@@ -32,6 +32,14 @@ public:
return thd->type_handler_for_datetime();
return src;
}
+
+ Item *make_item_func_replace(THD *thd,
+ Item *subj,
+ Item *find,
+ Item *replace) const;
+ Item *make_item_func_substr(THD *thd,
+ const Lex_substring_spec_st &spec) const;
+ Item *make_item_func_trim(THD *thd, const Lex_trim_st &spec) const;
};
@@ -78,3 +86,56 @@ Schema *Schema::find_implied(THD *thd)
return &maxdb_schema;
return &mariadb_schema;
}
+
+
+Item *Schema::make_item_func_replace(THD *thd,
+ Item *subj,
+ Item *find,
+ Item *replace) const
+{
+ return new (thd->mem_root) Item_func_replace(thd, subj, find, replace);
+}
+
+
+Item *Schema::make_item_func_substr(THD *thd,
+ const Lex_substring_spec_st &spec) const
+{
+ return spec.m_for ?
+ new (thd->mem_root) Item_func_substr(thd, spec.m_subject, spec.m_from,
+ spec.m_for) :
+ new (thd->mem_root) Item_func_substr(thd, spec.m_subject, spec.m_from);
+}
+
+
+Item *Schema::make_item_func_trim(THD *thd, const Lex_trim_st &spec) const
+{
+ return spec.make_item_func_trim_std(thd);
+}
+
+
+Item *Schema_oracle::make_item_func_replace(THD *thd,
+ Item *subj,
+ Item *find,
+ Item *replace) const
+{
+ return new (thd->mem_root) Item_func_replace_oracle(thd, subj, find, replace);
+}
+
+
+Item *Schema_oracle::make_item_func_substr(THD *thd,
+ const Lex_substring_spec_st &spec) const
+{
+ return spec.m_for ?
+ new (thd->mem_root) Item_func_substr_oracle(thd, spec.m_subject,
+ spec.m_from,
+ spec.m_for) :
+ new (thd->mem_root) Item_func_substr_oracle(thd, spec.m_subject,
+ spec.m_from);
+}
+
+
+Item *Schema_oracle::make_item_func_trim(THD *thd,
+ const Lex_trim_st &spec) const
+{
+ return spec.make_item_func_trim_oracle(thd);
+}
diff --git a/sql/sql_schema.h b/sql/sql_schema.h
index 37f8ceb7250..0258ff2dc97 100644
--- a/sql/sql_schema.h
+++ b/sql/sql_schema.h
@@ -33,6 +33,17 @@ public:
{
return src;
}
+
+ // Builders for native SQL function with a special syntax in sql_yacc.yy
+ virtual Item *make_item_func_replace(THD *thd,
+ Item *subj,
+ Item *find,
+ Item *replace) const;
+ virtual Item *make_item_func_substr(THD *thd,
+ const Lex_substring_spec_st &spec) const;
+
+ virtual Item *make_item_func_trim(THD *thd, const Lex_trim_st &spec) const;
+
/*
For now we have *hard-coded* compatibility schemas:
schema_mariadb, schema_oracle, schema_maxdb.
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index e98121231a7..4501168ec72 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -276,10 +276,12 @@ static bool find_field_in_item_list (Field *field, void *data);
static bool find_field_in_order_list (Field *field, void *data);
int create_sort_index(THD *thd, JOIN *join, JOIN_TAB *tab, Filesort *fsort);
static int remove_dup_with_compare(THD *thd, TABLE *entry, Field **field,
- Item *having);
+ SORT_FIELD *sortorder, ulong keylength,
+ Item *having);
static int remove_dup_with_hash_index(THD *thd,TABLE *table,
- uint field_count, Field **first_field,
- ulong key_length,Item *having);
+ uint field_count, Field **first_field,
+ SORT_FIELD *sortorder,
+ ulong key_length,Item *having);
static bool cmp_buffer_with_ref(THD *thd, TABLE *table, TABLE_REF *tab_ref);
static bool setup_new_fields(THD *thd, List<Item> &fields,
List<Item> &all_fields, ORDER *new_order);
@@ -339,6 +341,9 @@ static Item **get_sargable_cond(JOIN *join, TABLE *table);
bool is_eq_cond_injected_for_split_opt(Item_func_eq *eq_item);
+void print_list_item(String *str, List_item *list,
+ enum_query_type query_type);
+
static
bool build_notnull_conds_for_range_scans(JOIN *join, COND *cond,
table_map allowed);
@@ -442,6 +447,7 @@ POSITION::POSITION()
key= 0;
forced_index= 0;
use_join_buffer= 0;
+ firstmatch_with_join_buf= false;
sj_strategy= SJ_OPT_NONE;
n_sj_tables= 0;
spl_plan= 0;
@@ -5932,7 +5938,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
/*
Perform range analysis if there are keys it could use (1).
Don't do range analysis for materialized subqueries (2).
- Don't do range analysis for materialized derived tables (3)
+ Don't do range analysis for materialized derived tables/views (3)
*/
if ((!s->const_keys.is_clear_all() ||
!bitmap_is_clear_all(&s->table->cond_set)) && // (1)
@@ -7764,6 +7770,7 @@ void set_position(JOIN *join,uint idx,JOIN_TAB *table,KEYUSE *key)
join->positions[idx].records_init=1.0; /* This is a const table */
join->positions[idx].cond_selectivity= 1.0;
join->positions[idx].ref_depend_map= 0;
+ join->positions[idx].partial_join_cardinality= 1;
// join->positions[idx].loosescan_key= MAX_KEY; /* Not a LooseScan */
join->positions[idx].sj_strategy= SJ_OPT_NONE;
@@ -7781,6 +7788,7 @@ void set_position(JOIN *join,uint idx,JOIN_TAB *table,KEYUSE *key)
}
join->best_ref[idx]=table;
join->positions[idx].spl_plan= 0;
+ join->positions[idx].spl_pd_boundary= 0;
}
@@ -7795,7 +7803,6 @@ void set_position(JOIN *join,uint idx,JOIN_TAB *table,KEYUSE *key)
@return 0.0 No matching rows
@return >= 1.0 Number of expected matching rows
- @details
Estimate how many records we will get if we
- read the given table with its "independent" access method (either quick
select or full table/index scan),
@@ -7808,7 +7815,7 @@ void set_position(JOIN *join,uint idx,JOIN_TAB *table,KEYUSE *key)
*/
static double apply_selectivity_for_table(JOIN_TAB *s,
- uint use_cond_selectivity)
+ uint use_cond_selectivity)
{
double dbl_records;
@@ -7869,8 +7876,7 @@ static double apply_selectivity_for_table(JOIN_TAB *s,
This heuristic is supposed to force tables used in exprZ to be before
this table in join order.
*/
-
-static double use_found_constraint(double records)
+inline double use_found_constraint(double records)
{
records-= records/4;
return records ? MY_MAX(records, MIN_ROWS_AFTER_FILTERING) : 0.0;
@@ -8060,6 +8066,155 @@ apply_filter(THD *thd, TABLE *table, ALL_READ_COST *cost,
}
+/*
+ @brief
+ Compute the fanout of hash join operation using EITS data
+
+ @param join JOIN structure
+ @param tab JOIN_TAB for the current table
+ @param remaining_tables Map of tables not yet accessable
+ @param rnd_records Number of accepted rows in the table, after taking
+ selectivity into account.
+ @param hj_start_key Pointer to hash key
+ @param stats_found Is set to 1 if we found any usable hash key part
+ with statistics from analyze.
+*/
+
+double hash_join_fanout(JOIN *join, JOIN_TAB *tab, table_map remaining_tables,
+ double rnd_records, KEYUSE *hj_start_key,
+ bool *stats_found)
+{
+ THD *thd= join->thd;
+ /*
+ Before doing the hash join, we will scan the table and apply the local part
+ of the WHERE condition. This will produce rnd_records.
+
+ The EITS statistics describes the entire table. Calling
+
+ table->field[N]->get_avg_frequency()
+
+ produces average #rows in the table with some value.
+
+ What happens if we filter out rows so that rnd_records rows are left?
+ Something between the two outcomes:
+ A. filtering removes a fraction of rows for each value:
+ avg_frequency=avg_frequency * condition_selectivity
+
+ B. filtering removes entire groups of rows with the same value, but
+ the remaining groups remain of the same size.
+
+ We make pessimistic assumption and assume B.
+ We also handle an edge case: if rnd_records is less than avg_frequency,
+ assume we'll get rnd_records rows with the same value, and return
+ rnd_records as the fanout estimate.
+ */
+ double min_freq= (double) tab->table->stat_records();
+ bool found_not_usable_field= 0;
+ bool found_usable_field __attribute__((unused))= 0;
+ DBUG_ENTER("hash_join_cardinality");
+
+ Json_writer_object trace_obj(thd, "hash_join_cardinality");
+
+ /*
+ There can be multiple KEYUSE referring to same or different columns
+
+ KEYUSE(tbl.col1 = ...)
+ KEYUSE(tbl.col1 = ...)
+ KEYUSE(tbl.col2 = ...)
+
+ Hash join code can use multiple columns: (col1, col2) for joining.
+ We need n_distinct({col1, col2}).
+
+ EITS only has statistics on individual columns: n_distinct(col1),
+ n_distinct(col2).
+
+ Our current solution is to be very conservative and use selectivity
+ of one column with the lowest avg_frequency.
+
+ In the future, we should an approach that cautiosly takes into account
+ multiple KEYUSEs either multiply by number of equalities or by sqrt
+ of the second most selective equality.
+ */
+ Json_writer_array trace_arr(thd, "hash_join_columns");
+ for (KEYUSE *keyuse= hj_start_key;
+ keyuse->table == tab->table && is_hash_join_key_no(keyuse->key);
+ keyuse++)
+ {
+ if (!(remaining_tables & keyuse->used_tables) &&
+ (!keyuse->validity_ref || *keyuse->validity_ref) &&
+ tab->access_from_tables_is_allowed(keyuse->used_tables,
+ join->sjm_lookup_tables))
+ {
+ Field *field= tab->table->field[keyuse->keypart];
+ found_usable_field= 1;
+ if (is_eits_usable(field))
+ {
+ double freq= field->read_stats->get_avg_frequency();
+
+ Json_writer_object trace_field(thd);
+ trace_field.add("field",field->field_name.str).
+ add("avg_frequency", freq);
+ if (freq < min_freq)
+ min_freq= freq;
+ *stats_found= 1;
+ continue;
+ }
+ }
+ if (!keyuse->validity_ref || *keyuse->validity_ref)
+ found_not_usable_field= 1;
+ }
+ /* Ensure that some part of hash_key is usable */
+ DBUG_ASSERT(found_usable_field);
+
+ trace_arr.end();
+ if (found_not_usable_field)
+ {
+ /*
+ We did not't have data for all key fields. Assume that the hash
+ will at least limit the number of matched rows to HASH_FANOUT.
+ This makes the cost same as when 'hash_join_cardinality=off'
+ in the case when no analyze of the tables have been made.
+
+ However, it may cause problems when min_freq is higher than
+ HASH_FANOUT as the optimizer will then assume it is better to
+ put the table earlier in the plan when all key parts are not
+ usable.
+ Note that min_freq can become less than 1.0. This is intentional
+ as it matches what happens if OPTIMIZER_SWITCH_HASH_JOIN_CARDINALITY
+ is not used.
+ */
+ double max_expected_records= rnd_records * HASH_FANOUT;
+ set_if_smaller(min_freq, max_expected_records);
+ trace_obj.add("using_default_hash_fanout", HASH_FANOUT);
+ }
+ else
+ {
+ /*
+ Before joining the table with the contents of join buffer, we will
+ use the quick select and/or apply the table condition.
+
+ This will reduce the number of rows joined to rnd_records.
+ How will this affect n_distinct?
+ Depending on which rows are removed, this can either leave n_distinct as
+ is (for some value X, some rows are removed but some are left, leaving the
+ number of distinct values the same), or reduce n_distinct in proportion
+ with the fraction of rows removed (for some values of X, either all or
+ none of the rows with that value are removed).
+
+ We assume the latter: n_distinct is reduced in proportion the condition
+ and quick select's selectivity.
+ This is in effect same as applying apply_selectivity_for_table() on
+ min_freq as we have already done on rnd_records
+ */
+ min_freq*= rnd_records / tab->table->stat_records();
+ set_if_bigger(min_freq, HASH_FANOUT);
+ }
+
+ trace_obj.add("rows", min_freq);
+ DBUG_RETURN(min_freq);
+}
+
+
/**
Find the best access path for an extension of a partial execution
plan and add this path to the plan.
@@ -8138,6 +8293,7 @@ best_access_path(JOIN *join,
ha_rows rec;
MY_BITMAP *eq_join_set= &s->table->eq_join_set;
KEYUSE *hj_start_key= 0;
+ table_map spl_pd_boundary= 0;
Loose_scan_opt loose_scan_opt;
struct best_plan best;
Json_writer_object trace_wrapper(thd, "best_access_path");
@@ -8179,15 +8335,17 @@ best_access_path(JOIN *join,
loose_scan_opt.init(join, s, remaining_tables);
if (table->is_splittable())
- best.spl_plan= s->choose_best_splitting(record_count, remaining_tables);
+ best.spl_plan= s->choose_best_splitting(idx,
+ remaining_tables,
+ &spl_pd_boundary);
if (unlikely(thd->trace_started()))
{
Json_writer_object info(thd, "plan_details");
info.add("record_count", record_count);
}
- Json_writer_array trace_paths(thd, "considered_access_paths");
+ Json_writer_array trace_paths(thd, "considered_access_paths");
if (s->keyuse)
{ /* Use key if possible */
KEYUSE *keyuse, *start_key= 0;
@@ -8762,26 +8920,34 @@ best_access_path(JOIN *join,
Here we have:
cost_of_fetching_1_row = tmp/rows
cost_of_fetching_1_key_tuple = keyread_tmp/rows
- access_cost_factor is the gain we expect for using rowid filter.
- An access_cost_factor of 1.0 means that keyread_tmp is 0
- (using key read is infinitely fast) and the gain for each row when
- using filter is great.
- An access_cost_factor if 0.0 means that using keyread has the
- same cost as reading rows, so there is no gain to get with
- filter.
- access_cost_factor should never be bigger than 1.0 (if all
- calculations are correct) as the cost of keyread should always be
- smaller than the cost of fetching the same number of keys + rows.
- access_cost_factor should also never be smaller than 0.0.
- The one exception is if number of records is 1 (eq_ref), then
- because we are comparing rows to cost of keyread_tmp, keyread_tmp
- is higher by 1.0. This is a big that will be fixed in a later
- version.
-
- If we have limited the cost (=tmp) of reading rows with 'worst_seek'
- we cannot use filters as the cost calculation below would cause
- tmp to become negative. The future resultion is to not limit
- cost with worst_seek.
+ Here's a more detailed explanation that uses the formulas behind
+ the function the call filter->get_adjusted_gain(). The function
+ takes as a parameter the number of probes/look-ups into the filter
+ that is equal to the number of fetched key entries that is equal to
+ the number of row fetches when no filter is used (assuming no
+ index condition pushdown is employed for the used key access).
+ Let this number be N. Then the total gain from using the filter is
+ N*a_adj - b where b is the cost of building the filter and
+ a_adj is calcilated as follows:
+ a - (1-access_cost_factor)*(1-s) =
+ (1+1_cond_eval_cost)*(1-s)-1_probe_cost - (1-access_cost_factor)*(1-s)
+ = (1-s)*(1_cond_eval_cost+access_cost_factor) - 1_probe_cost.
+ Here ((1-s)*(1_cond_eval_cost) * N is the gain from checking less
+ conditions pushed into the table, 1_probe_cost*N is the cost of the
+ probes and (1*s) * access_cost_factor * N must be the gain from
+ accessing less rows.
+ It does not matter how we calculate the cost of N full row fetches
+ cost_of_fetching_N_rows or
+ how we calculate the cost of fetching N key entries
+ cost_of_fetching_N_key_entries
+ the gain from less row fetches will be
+ (cost_of_fetching_N_rows - cost_of_fetching_N_key_entries) * (1-s)
+ and this should be equal to (1*s) * access_cost_factor * N.
+ Thus access_cost_factor must be calculated as
+ (cost_of_fetching_N_rows - cost_of_fetching_N_key_entries) / N.
+
+ For safety we clip cost_of_fetching_N_key_entries by the value
+ of cost_of_fetching_N_row though formally it's not necessary.
We cannot use filter with JT_EQ_REF as in this case 'tmp' is
number of rows from prev_record_read() and keyread_tmp is 0. These
@@ -8794,6 +8960,7 @@ best_access_path(JOIN *join,
prev_record_count,
&records_best_filter);
set_if_smaller(best.records_out, records_best_filter);
+
if (filter)
filter= filter->apply_filter(thd, table, &tmp,
&records_after_filter,
@@ -8912,15 +9079,49 @@ best_access_path(JOIN *join,
(!(table->map & join->outer_join) ||
join->allowed_outer_join_with_cache)) // (2)
{
- double refills, row_copy_cost, cmp_time, cur_cost, records_table_filter;
+ Json_writer_object trace_access_hash(thd);
+ double refills, row_copy_cost, copy_cost, cur_cost, where_cost;
+ double matching_combinations, fanout, join_sel;
+ trace_access_hash.add("type", "hash");
+ trace_access_hash.add("index", "hj-key");
/* Estimate the cost of the hash join access to the table */
- double rnd_records= apply_selectivity_for_table(s, use_cond_selectivity);
- records_table_filter= ((found_constraint) ?
- use_found_constraint(rnd_records) :
- rnd_records);
+ double rnd_records;
+ bool stats_found= 0;
+ rnd_records= apply_selectivity_for_table(s, use_cond_selectivity);
DBUG_ASSERT(rnd_records <= rows2double(s->found_records) + 0.5);
- set_if_smaller(best.records_out, records_table_filter);
+ DBUG_ASSERT(hj_start_key);
+
+ fanout= rnd_records;
+ if (optimizer_flag(thd, OPTIMIZER_SWITCH_HASH_JOIN_CARDINALITY))
+ {
+ /*
+ Starting from this point, rnd_records should not be used anymore.
+ Use "fanout" for an estimate of # matching records.
+ */
+ fanout= hash_join_fanout(join, s, remaining_tables, rnd_records,
+ hj_start_key, &stats_found);
+ set_if_smaller(best.records_out, fanout);
+ join_sel= 1.0;
+ }
+ if (!stats_found)
+ {
+ /*
+ No OPTIMIZER_SWITCH_HASH_JOIN_CARDINALITY or no field statistics
+ found.
+
+ Take into account if there is non constant constraints used with
+ earlier tables in the where expression.
+ If yes, this will set fanout to rnd_records/4.
+ We estimate that there will be HASH_FANOUT (10%)
+ hash matches / row.
+ */
+ fanout= ((found_constraint) ?
+ use_found_constraint(rnd_records) :
+ rnd_records);
+ set_if_smaller(best.records_out, fanout * HASH_FANOUT);
+ join_sel= HASH_FANOUT;
+ }
/*
The following cost calculation is identical to the cost calculation for
@@ -8943,40 +9144,39 @@ best_access_path(JOIN *join,
(double) thd->variables.join_buff_size));
cur_cost= COST_MULT(cur_cost, refills);
+
/*
Cost of doing the hash lookup and check all matching rows with the
WHERE clause.
We assume here that, thanks to the hash, we don't have to compare all
- row combinations, only a HASH_FANOUT (10%) rows in the cache.
+ row combinations, only a fanout or HASH_FANOUT (10%) rows in the cache.
*/
row_copy_cost= (ROW_COPY_COST_THD(thd) *
JOIN_CACHE_ROW_COPY_COST_FACTOR(thd));
- cmp_time= (record_count * row_copy_cost +
- rnd_records * record_count * HASH_FANOUT *
- ((idx - join->const_tables) * row_copy_cost +
- WHERE_COST_THD(thd)));
- cur_cost= COST_ADD(cur_cost, cmp_time);
+ matching_combinations= fanout * join_sel * record_count;
+ copy_cost= (record_count * row_copy_cost +
+ matching_combinations *
+ ((idx - join->const_tables) * row_copy_cost));
+ where_cost= matching_combinations * WHERE_COST_THD(thd);
+ cur_cost= COST_ADD(cur_cost, copy_cost + where_cost);
best.cost= cur_cost;
best.records_read= best.records_after_filter= rows2double(s->records);
- best.records= rnd_records;
-#ifdef NOT_YET
- set_if_smaller(best.records_out, rnd_records * HASH_FANOUT);
-#endif
+ best.records= rnd_records; // Records after where (Legacy value)
best.key= hj_start_key;
best.ref_depends_map= 0;
best.use_join_buffer= TRUE;
best.filter= 0;
best.type= JT_HASH;
best.refills= (ulonglong) ceil(refills);
- Json_writer_object trace_access_hash(thd);
if (unlikely(trace_access_hash.trace_started()))
trace_access_hash.
- add("type", "hash").
- add("index", "hj-key").
add("rows", rnd_records).
+ add("rows_after_hash", fanout * join_sel).
add("refills", refills).
- add("cost", best.cost).
+ add("jbuf_use_cost", copy_cost).
+ add("extra_cond_check_cost", where_cost).
+ add("total_cost", best.cost).
add("chosen", true);
}
@@ -9037,7 +9237,6 @@ best_access_path(JOIN *join,
uint forced_index= MAX_KEY;
bool force_plan= 0, use_join_buffer= 0;
ulonglong refills= 1;
-
/*
Range optimizer never proposes a RANGE if it isn't better
than FULL: so if RANGE is present, it's always preferred to FULL.
@@ -9208,8 +9407,13 @@ best_access_path(JOIN *join,
s->cached_forced_index_cost= cur_cost;
s->cached_forced_index= forced_index;
}
-
- if (disable_jbuf || (table->map & join->outer_join))
+
+ /*
+ Note: the condition checked here is very out of date and incorrect.
+ Below, we use a more accurate check when assigning the value of
+ best.use_join_buffer.
+ */
+ if ((s->table->map & join->outer_join) || disable_jbuf)
{
/*
Simple scan
@@ -9320,7 +9524,10 @@ best_access_path(JOIN *join,
best.filter= filter;
/* range/index_merge/ALL/index access method are "independent", so: */
best.ref_depends_map= 0;
- best.use_join_buffer= use_join_buffer;
+ best.use_join_buffer= use_join_buffer ||
+ MY_TEST(!disable_jbuf &&
+ (join->allowed_outer_join_with_cache ||
+ !(s->table->map & join->outer_join)));
best.refills= (ulonglong) ceil(refills);
best.spl_plan= 0;
best.type= type;
@@ -9359,6 +9566,7 @@ best_access_path(JOIN *join,
pos->use_join_buffer= best.use_join_buffer;
pos->firstmatch_with_join_buf= 0;
pos->spl_plan= best.spl_plan;
+ pos->spl_pd_boundary= best.spl_plan ? spl_pd_boundary: 0;
pos->range_rowid_filter_info= best.filter;
pos->key_dependent= (best.type == JT_EQ_REF ? (table_map) 0 :
key_dependent & remaining_tables);
@@ -9922,10 +10130,12 @@ optimize_straight_join(JOIN *join, table_map remaining_tables)
}
position->cond_selectivity= pushdown_cond_selectivity;
position->records_out= records_out;
- current_record_count= COST_MULT(record_count, records_out);
+ current_record_count= COST_MULT(record_count, records_out);
}
else
position->cond_selectivity= 1.0;
+
+ position->partial_join_cardinality= current_record_count;
++idx;
record_count= current_record_count;
}
@@ -11318,6 +11528,7 @@ best_extension_by_limited_search(JOIN *join,
join->positions[idx].cond_selectivity= pushdown_cond_selectivity;
partial_join_cardinality= record_count * position->records_out;
+ join->positions[idx].partial_join_cardinality= partial_join_cardinality;
if (unlikely(thd->trace_started()) && pushdown_cond_selectivity < 1.0 &&
partial_join_cardinality < current_record_count)
@@ -11325,9 +11536,9 @@ best_extension_by_limited_search(JOIN *join,
.add("selectivity", pushdown_cond_selectivity)
.add("estimated_join_cardinality", partial_join_cardinality);
- if (search_depth > 1 &&
- ((remaining_tables & ~real_table_bit) & join->allowed_tables))
+ if ((search_depth > 1) && (remaining_tables & ~real_table_bit) &
+ allowed_tables)
{
/* Recursively expand the current partial plan */
Json_writer_array trace_rest(thd, "rest_of_plan");
@@ -14627,6 +14838,9 @@ uint check_join_cache_usage(JOIN_TAB *tab,
join->return_tab= 0;
+ if (tab->no_forced_join_cache)
+ goto no_join_cache;
+
/*
Don't use join cache if @@join_cache_level==0 or this table is the first
one join suborder (either at top level or inside a bush)
@@ -15673,7 +15887,8 @@ bool JOIN_TAB::preread_init()
DBUG_RETURN(TRUE);
if (!(derived->get_unit()->uncacheable & UNCACHEABLE_DEPENDENT) ||
- derived->is_nonrecursive_derived_with_rec_ref())
+ derived->is_nonrecursive_derived_with_rec_ref() ||
+ is_split_derived)
preread_init_done= TRUE;
if (select && select->quick)
select->quick->replace_handler(table->file);
@@ -19284,9 +19499,14 @@ void optimize_wo_join_buffering(JOIN *join, uint first_tab, uint last_tab,
table_after_join_selectivity(join, i, rs,
reopt_remaining_tables &
~real_table_bit, &records_out);
+ join->positions[i].partial_join_cardinality= rec_count * pushdown_cond_selectivity;
}
+ else
+ join->positions[i].partial_join_cardinality= COST_MULT(rec_count, records_out);
+
rec_count= COST_MULT(rec_count, records_out);
*outer_rec_count= COST_MULT(*outer_rec_count, records_out);
+
if (rs->emb_sj_nest)
inner_fanout= COST_MULT(inner_fanout, records_out);
@@ -21218,12 +21438,13 @@ bool Create_tmp_table::finalize(THD *thd,
table->group= m_group; /* Table is grouped by key */
param->group_buff= m_group_buff;
share->keys=1;
- share->uniques= MY_TEST(m_using_unique_constraint);
table->key_info= table->s->key_info= keyinfo;
table->keys_in_use_for_query.set_bit(0);
share->keys_in_use.set_bit(0);
keyinfo->key_part= m_key_part_info;
keyinfo->flags=HA_NOSAME | HA_BINARY_PACK_KEY | HA_PACK_KEY;
+ if (m_using_unique_constraint)
+ keyinfo->flags|= HA_UNIQUE_HASH;
keyinfo->ext_key_flags= keyinfo->flags;
keyinfo->usable_key_parts=keyinfo->user_defined_key_parts=
param->group_parts;
@@ -21322,6 +21543,7 @@ bool Create_tmp_table::finalize(THD *thd,
*/
DBUG_PRINT("info",("hidden_field_count: %d", param->hidden_field_count));
+ keyinfo->flags= 0;
if (m_blobs_count[distinct])
{
/*
@@ -21329,10 +21551,11 @@ bool Create_tmp_table::finalize(THD *thd,
indexes on blobs with arbitrary length. Such indexes cannot be
used for lookups.
*/
- share->uniques= 1;
+ keyinfo->flags|= HA_UNIQUE_HASH;
}
keyinfo->user_defined_key_parts= m_field_count[distinct] +
- (share->uniques ? MY_TEST(null_pack_length[distinct]) : 0);
+ ((keyinfo->flags & HA_UNIQUE_HASH) ?
+ MY_TEST(null_pack_length[distinct]) : 0);
keyinfo->ext_key_parts= keyinfo->user_defined_key_parts;
keyinfo->usable_key_parts= keyinfo->user_defined_key_parts;
table->distinct= 1;
@@ -21347,7 +21570,8 @@ bool Create_tmp_table::finalize(THD *thd,
share->keys_in_use.set_bit(0);
table->key_info= table->s->key_info= keyinfo;
keyinfo->key_part= m_key_part_info;
- keyinfo->flags=HA_NOSAME | HA_NULL_ARE_EQUAL | HA_BINARY_PACK_KEY | HA_PACK_KEY;
+ keyinfo->flags|= (HA_NOSAME | HA_NULL_ARE_EQUAL | HA_BINARY_PACK_KEY |
+ HA_PACK_KEY);
keyinfo->ext_key_flags= keyinfo->flags;
keyinfo->key_length= 0; // Will compute the sum of the parts below.
keyinfo->name= distinct_key;
@@ -21376,7 +21600,7 @@ bool Create_tmp_table::finalize(THD *thd,
blobs can distinguish NULL from 0. This extra field is not needed
when we do not use UNIQUE indexes for blobs.
*/
- if (null_pack_length[distinct] && share->uniques)
+ if (null_pack_length[distinct] && (keyinfo->flags & HA_UNIQUE_HASH))
{
m_key_part_info->null_bit=0;
m_key_part_info->offset= null_pack_base[distinct];
@@ -21794,113 +22018,125 @@ bool open_tmp_table(TABLE *table)
*/
-bool create_internal_tmp_table(TABLE *table, KEY *keyinfo,
+bool create_internal_tmp_table(TABLE *table, KEY *org_keyinfo,
TMP_ENGINE_COLUMNDEF *start_recinfo,
TMP_ENGINE_COLUMNDEF **recinfo,
ulonglong options)
{
int error;
- MARIA_KEYDEF keydef;
+ MARIA_KEYDEF *keydefs= 0, *keydef;
MARIA_UNIQUEDEF uniquedef;
TABLE_SHARE *share= table->s;
MARIA_CREATE_INFO create_info;
+ bool use_unique= false;
DBUG_ENTER("create_internal_tmp_table");
if (share->keys)
{ // Get keys for ni_create
- bool using_unique_constraint=0;
- HA_KEYSEG *seg= (HA_KEYSEG*) alloc_root(&table->mem_root,
- sizeof(*seg) * keyinfo->user_defined_key_parts);
- if (!seg)
- goto err;
-
- bzero(seg, sizeof(*seg) * keyinfo->user_defined_key_parts);
- /*
- Note that a similar check is performed during
- subquery_types_allow_materialization. See MDEV-7122 for more details as
- to why. Whenever this changes, it must be updated there as well, for
- all tmp_table engines.
- */
- if (keyinfo->key_length > table->file->max_key_length() ||
- keyinfo->user_defined_key_parts > table->file->max_key_parts() ||
- share->uniques)
- {
- if (!share->uniques && !(keyinfo->flags & HA_NOSAME))
- {
- my_error(ER_INTERNAL_ERROR, MYF(0),
- "Using too big key for internal temp tables");
- DBUG_RETURN(1);
- }
+ HA_KEYSEG *seg;
+ DBUG_ASSERT(share->key_parts);
- /* Can't create a key; Make a unique constraint instead of a key */
- share->keys= 0;
- share->key_parts= share->ext_key_parts= 0;
- share->uniques= 1;
- using_unique_constraint=1;
- bzero((char*) &uniquedef,sizeof(uniquedef));
- uniquedef.keysegs=keyinfo->user_defined_key_parts;
- uniquedef.seg=seg;
- uniquedef.null_are_equal=1;
+ if (!(multi_alloc_root(&table->mem_root,
+ &seg, sizeof(*seg) * share->key_parts,
+ &keydefs, sizeof(*keydefs) * share->keys,
+ NullS)))
+ goto err;
+ keydef= keydefs;
- /* Create extra column for hash value */
- bzero((uchar*) *recinfo,sizeof(**recinfo));
- (*recinfo)->type= FIELD_CHECK;
- (*recinfo)->length= MARIA_UNIQUE_HASH_LENGTH;
- (*recinfo)++;
+ bzero(seg, sizeof(*seg) * share->key_parts);
- /* Avoid warnings from valgrind */
- bzero(table->record[0]+ share->reclength, MARIA_UNIQUE_HASH_LENGTH);
- bzero(share->default_values+ share->reclength, MARIA_UNIQUE_HASH_LENGTH);
- share->reclength+= MARIA_UNIQUE_HASH_LENGTH;
- }
- else
- {
- /* Create a key */
- bzero((char*) &keydef,sizeof(keydef));
- keydef.flag= keyinfo->flags & HA_NOSAME;
- keydef.keysegs= keyinfo->user_defined_key_parts;
- keydef.seg= seg;
- }
- for (uint i=0; i < keyinfo->user_defined_key_parts ; i++,seg++)
+ /* Note that share->keys may change in the loop ! */
+ for (KEY *keyinfo= org_keyinfo, *end_keyinfo= keyinfo + share->keys;
+ keyinfo < end_keyinfo ;
+ keyinfo++)
{
- Field *field=keyinfo->key_part[i].field;
- seg->flag= 0;
- seg->language= field->charset()->number;
- seg->length= keyinfo->key_part[i].length;
- seg->start= keyinfo->key_part[i].offset;
- if (field->flags & BLOB_FLAG)
+ /*
+ Note that a similar check is performed during
+ subquery_types_allow_materialization. See MDEV-7122 for more details as
+ to why. Whenever this changes, it must be updated there as well, for
+ all tmp_table engines.
+ */
+ if (keyinfo->key_length > table->file->max_key_length() ||
+ keyinfo->user_defined_key_parts > table->file->max_key_parts() ||
+ (keyinfo->flags & HA_UNIQUE_HASH))
{
- seg->type=
- ((keyinfo->key_part[i].key_type & FIELDFLAG_BINARY) ?
- HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2);
- seg->bit_start= (uint8)(field->pack_length() -
- portable_sizeof_char_ptr);
- seg->flag= HA_BLOB_PART;
- seg->length=0; // Whole blob in unique constraint
+ if (!(keyinfo->flags & (HA_NOSAME | HA_UNIQUE_HASH)))
+ {
+ my_error(ER_INTERNAL_ERROR, MYF(0),
+ "Using too big key for internal temp tables");
+ DBUG_RETURN(1);
+ }
+ /* Can't create a key; Make a unique constraint instead of a key */
+ share->keys--;
+ share->key_parts-= keyinfo->user_defined_key_parts;
+ share->ext_key_parts-= keyinfo->ext_key_parts;
+ use_unique= true;
+ bzero((char*) &uniquedef,sizeof(uniquedef));
+ uniquedef.keysegs= keyinfo->user_defined_key_parts;
+ uniquedef.seg=seg;
+ uniquedef.null_are_equal=1;
+ keyinfo->flags|= HA_UNIQUE_HASH;
+ keyinfo->algorithm= HA_KEY_ALG_UNIQUE_HASH;
+
+ /* Create extra column for hash value */
+ bzero((uchar*) *recinfo,sizeof(**recinfo));
+ (*recinfo)->type= FIELD_CHECK;
+ (*recinfo)->length= MARIA_UNIQUE_HASH_LENGTH;
+ (*recinfo)++;
+
+ /* Avoid warnings from valgrind */
+ bzero(table->record[0]+ share->reclength, MARIA_UNIQUE_HASH_LENGTH);
+ bzero(share->default_values+ share->reclength,
+ MARIA_UNIQUE_HASH_LENGTH);
+ share->reclength+= MARIA_UNIQUE_HASH_LENGTH;
}
else
{
- seg->type= keyinfo->key_part[i].type;
- /* Tell handler if it can do suffic space compression */
- if (field->real_type() == MYSQL_TYPE_STRING &&
- keyinfo->key_part[i].length > 32)
- seg->flag|= HA_SPACE_PACK;
- }
- if (!(field->flags & NOT_NULL_FLAG))
- {
- seg->null_bit= field->null_bit;
- seg->null_pos= (uint) (field->null_ptr - (uchar*) table->record[0]);
- /*
- We are using a GROUP BY on something that contains NULL
- In this case we have to tell Aria that two NULL should
- on INSERT be regarded at the same value
- */
- if (!using_unique_constraint)
- keydef.flag|= HA_NULL_ARE_EQUAL;
+ /* Create a key */
+ bzero((char*) keydef,sizeof(*keydef));
+ /*
+ We are using a GROUP BY on something that contains NULL
+ In this case we have to tell Aria that two NULL should
+ on INSERT be regarded at the same value.
+ */
+ keydef->flag= (keyinfo->flags & HA_NOSAME) | HA_NULL_ARE_EQUAL;
+ keydef->keysegs= keyinfo->user_defined_key_parts;
+ keydef->seg= seg;
+ keydef++;
+ }
+ for (uint i=0; i < keyinfo->user_defined_key_parts ; i++,seg++)
+ {
+ Field *field=keyinfo->key_part[i].field;
+ seg->flag= 0;
+ seg->language= field->charset()->number;
+ seg->length= keyinfo->key_part[i].length;
+ seg->start= keyinfo->key_part[i].offset;
+ if (field->flags & BLOB_FLAG)
+ {
+ seg->type=
+ ((keyinfo->key_part[i].key_type & FIELDFLAG_BINARY) ?
+ HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2);
+ seg->bit_start= (uint8)(field->pack_length() -
+ portable_sizeof_char_ptr);
+ seg->flag= HA_BLOB_PART;
+ seg->length=0; // Whole blob in unique constraint
+ }
+ else
+ {
+ seg->type= keyinfo->key_part[i].type;
+ /* Tell handler if it can do suffic space compression */
+ if (field->real_type() == MYSQL_TYPE_STRING &&
+ keyinfo->key_part[i].length > 32)
+ seg->flag|= HA_SPACE_PACK;
+ }
+ if (!(field->flags & NOT_NULL_FLAG))
+ {
+ seg->null_bit= field->null_bit;
+ seg->null_pos= (uint) (field->null_ptr - (uchar*) table->record[0]);
+ }
}
- }
- if (share->keys)
keyinfo->index_flags= table->file->index_flags(0, 0, 1);
+ }
}
bzero((char*) &create_info,sizeof(create_info));
create_info.data_file_length= table->in_use->variables.tmp_disk_table_size;
@@ -21946,8 +22182,8 @@ bool create_internal_tmp_table(TABLE *table, KEY *keyinfo,
}
if (unlikely((error= maria_create(share->path.str, file_type, share->keys,
- &keydef, (uint) (*recinfo-start_recinfo),
- start_recinfo, share->uniques, &uniquedef,
+ keydefs, (uint) (*recinfo-start_recinfo),
+ start_recinfo, use_unique, &uniquedef,
&create_info, create_flags))))
{
table->file->print_error(error,MYF(0)); /* purecov: inspected */
@@ -21999,7 +22235,7 @@ bool create_internal_tmp_table(TABLE *table, KEY *keyinfo,
/* Create internal MyISAM temporary table */
-bool create_internal_tmp_table(TABLE *table, KEY *keyinfo,
+bool create_internal_tmp_table(TABLE *table, KEY *org_keyinfo,
TMP_ENGINE_COLUMNDEF *start_recinfo,
TMP_ENGINE_COLUMNDEF **recinfo,
ulonglong options)
@@ -22014,11 +22250,12 @@ bool create_internal_tmp_table(TABLE *table, KEY *keyinfo,
{ // Get keys for ni_create
bool using_unique_constraint=0;
HA_KEYSEG *seg= (HA_KEYSEG*) alloc_root(&table->mem_root,
- sizeof(*seg) * keyinfo->user_defined_key_parts);
+ sizeof(*seg) *
+ share->user_defined_key_parts);
if (!seg)
goto err;
- bzero(seg, sizeof(*seg) * keyinfo->user_defined_key_parts);
+ bzero(seg, sizeof(*seg) * share->user_defined_key_parts);
/*
Note that a similar check is performed during
subquery_types_allow_materialization. See MDEV-7122 for more details as
@@ -22354,7 +22591,7 @@ void set_postjoin_aggr_write_func(JOIN_TAB *tab)
Note for MyISAM tmp tables: if uniques is true keys won't be
created.
*/
- if (table->s->keys && !table->s->uniques)
+ if (table->s->keys && !table->s->have_unique_constraint())
{
DBUG_PRINT("info",("Using end_update"));
aggr->set_write_func(end_update);
@@ -22664,6 +22901,8 @@ bool instantiate_tmp_table(TABLE *table, KEY *keyinfo,
TMP_ENGINE_COLUMNDEF **recinfo,
ulonglong options)
{
+ DBUG_ASSERT(table->s->keys == 0 || table->key_info == keyinfo);
+ DBUG_ASSERT(table->s->keys <= 1);
if (table->s->db_type() == TMP_ENGINE_HTON)
{
/*
@@ -22808,6 +23047,8 @@ sub_select_cache(JOIN *join, JOIN_TAB *join_tab, bool end_of_records)
/* The user has aborted the execution of the query */
DBUG_RETURN(NESTED_LOOP_KILLED);
}
+ join_tab->jbuf_loops_tracker->on_scan_init();
+
if (!test_if_use_dynamic_range_scan(join_tab))
{
if (!cache->put_record())
@@ -22958,6 +23199,16 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
enum_nested_loop_state rc;
DBUG_ENTER("sub_select");
+ if (join_tab->split_derived_to_update && !end_of_records)
+ {
+ table_map tab_map= join_tab->split_derived_to_update;
+ for (uint i= 0; tab_map; i++, tab_map>>= 1)
+ {
+ if (tab_map & 1)
+ join->map2table[i]->preread_init_done= false;
+ }
+ }
+
if (join_tab->last_inner)
{
JOIN_TAB *last_inner_tab= join_tab->last_inner;
@@ -24574,7 +24825,6 @@ end_write(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
DBUG_RETURN(NESTED_LOOP_ERROR); // Not a table_is_full error
if (is_duplicate)
goto end;
- table->s->uniques=0; // To ensure rows are the same
}
if (++join_tab->send_records >=
join_tab->tmp_table_param->end_write_records &&
@@ -26511,39 +26761,70 @@ JOIN_TAB::remove_duplicates()
{
bool error;
- ulong keylength= 0;
- uint field_count;
+ ulong keylength= 0, sort_field_keylength= 0;
+ uint field_count, item_count;
List<Item> *fields= (this-1)->fields;
+ Item *item;
THD *thd= join->thd;
-
+ SORT_FIELD *sortorder, *sorder;
DBUG_ENTER("remove_duplicates");
DBUG_ASSERT(join->aggr_tables > 0 && table->s->tmp_table != NO_TMP_TABLE);
THD_STAGE_INFO(join->thd, stage_removing_duplicates);
- //join->explain->ops_tracker.report_duplicate_removal();
-
- table->reginfo.lock_type=TL_WRITE;
+ if (!(sortorder= (SORT_FIELD*) my_malloc(PSI_INSTRUMENT_ME,
+ (fields->elements+1) *
+ sizeof(SORT_FIELD),
+ MYF(MY_WME | MY_ZEROFILL))))
+ DBUG_RETURN(TRUE);
/* Calculate how many saved fields there is in list */
- field_count=0;
+ field_count= item_count= 0;
+
List_iterator<Item> it(*fields);
- Item *item;
- while ((item=it++))
+ for (sorder= sortorder ; (item=it++) ;)
{
- if (item->get_tmp_table_field() && ! item->const_item())
- field_count++;
+ if (!item->const_item())
+ {
+ if (item->get_tmp_table_field())
+ {
+ /* Field is stored in temporary table, skipp */
+ field_count++;
+ }
+ else
+ {
+ /* Item is not stored in temporary table, remember it */
+ sorder->item= item;
+ /* Calculate sorder->length */
+ item->type_handler()->sort_length(thd, item, sorder);
+ sorder++;
+ item_count++;
+ }
+ }
}
+ sorder->item= 0; // End marker
- if (!field_count && !(join->select_options & OPTION_FOUND_ROWS) && !having)
- { // only const items with no OPTION_FOUND_ROWS
+ if ((field_count + item_count == 0) && ! having &&
+ !(join->select_options & OPTION_FOUND_ROWS))
+ {
+ // only const items with no OPTION_FOUND_ROWS
join->unit->lim.set_single_row(); // Only send first row
+ my_free(sortorder);
DBUG_RETURN(false);
}
+ /*
+ The table contains first fields that will be in the output, then
+ temporary results pointed to by the fields list.
+ Example: SELECT DISTINCT sum(a), sum(d) > 2 FROM ...
+ In this case the temporary table contains sum(a), sum(d).
+ */
+
Field **first_field=table->field+table->s->fields - field_count;
for (Field **ptr=first_field; *ptr; ptr++)
keylength+= (*ptr)->sort_length() + (*ptr)->maybe_null();
+ for (SORT_FIELD *ptr= sortorder ; ptr->item ; ptr++)
+ sort_field_keylength+= ptr->length + (ptr->item->maybe_null() ? 1 : 0);
/*
Disable LIMIT ROWS EXAMINED in order to avoid interrupting prematurely
@@ -26554,30 +26835,80 @@ JOIN_TAB::remove_duplicates()
thd->reset_killed();
table->file->info(HA_STATUS_VARIABLE);
+ table->reginfo.lock_type=TL_WRITE;
+
if (table->s->db_type() == heap_hton ||
(!table->s->blob_fields &&
((ALIGN_SIZE(keylength) + HASH_OVERHEAD) * table->file->stats.records <
thd->variables.sortbuff_size)))
- error=remove_dup_with_hash_index(join->thd, table, field_count, first_field,
- keylength, having);
+ error= remove_dup_with_hash_index(join->thd, table, field_count,
+ first_field, sortorder,
+ keylength + sort_field_keylength, having);
else
- error=remove_dup_with_compare(join->thd, table, first_field, having);
+ error=remove_dup_with_compare(join->thd, table, first_field, sortorder,
+ sort_field_keylength, having);
if (join->select_lex != join->select_lex->master_unit()->fake_select_lex)
thd->lex->set_limit_rows_examined();
free_blobs(first_field);
+ my_free(sortorder);
DBUG_RETURN(error);
}
+/*
+ Create a sort/compare key from items
+
+ Key is of fixed length and binary comparable
+*/
+
+static uchar *make_sort_key(SORT_FIELD *sortorder, uchar *key_buffer,
+ String *tmp_value)
+{
+ for (SORT_FIELD *ptr= sortorder ; ptr->item ; ptr++)
+ {
+ ptr->item->type_handler()->make_sort_key_part(key_buffer,
+ ptr->item,
+ ptr, tmp_value);
+ key_buffer+= (ptr->item->maybe_null() ? 1 : 0) + ptr->length;
+ }
+ return key_buffer;
+}
+
+
+/*
+ Remove duplicates by comparing all rows with all other rows
+
+ @param thd THD
+ @param table Temporary table
+ @param first_field Pointer to fields in temporary table that are part of
+ distinct, ends with null pointer
+ @param sortorder An array of Items part of distsinct. Terminated with an
+ element N with sortorder[N]->item=NULL.
+ @param keylength Length of key produced by sortorder
+ @param having Having expression (NULL if no having)
+*/
+
static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field,
+ SORT_FIELD *sortorder, ulong keylength,
Item *having)
{
handler *file=table->file;
- uchar *record=table->record[0];
+ uchar *record=table->record[0], *key_buffer, *key_buffer2;
+ char *tmp_buffer;
int error;
+ String tmp_value;
DBUG_ENTER("remove_dup_with_compare");
+ if (unlikely(!my_multi_malloc(PSI_INSTRUMENT_ME,
+ MYF(MY_WME),
+ &key_buffer, keylength,
+ &key_buffer2, keylength,
+ &tmp_buffer, keylength+1,
+ NullS)))
+ DBUG_RETURN(1);
+ tmp_value.set(tmp_buffer, keylength, &my_charset_bin);
+
if (unlikely(file->ha_rnd_init_with_error(1)))
DBUG_RETURN(1);
@@ -26586,8 +26917,8 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field,
{
if (unlikely(thd->check_killed()))
{
- error=0;
- goto err;
+ error= 1;
+ goto end;
}
if (unlikely(error))
{
@@ -26606,9 +26937,10 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field,
{
my_message(ER_OUTOFMEMORY, ER_THD(thd,ER_OUTOFMEMORY),
MYF(ME_FATAL));
- error=0;
- goto err;
+ error= 1;
+ goto end;
}
+ make_sort_key(sortorder, key_buffer, &tmp_value);
store_record(table,record[1]);
/* Read through rest of file and mark duplicated rows deleted */
@@ -26621,7 +26953,10 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field,
break;
goto err;
}
- if (compare_record(table, first_field) == 0)
+ make_sort_key(sortorder, key_buffer2, &tmp_value);
+ if (compare_record(table, first_field) == 0 &&
+ (!keylength ||
+ memcmp(key_buffer, key_buffer2, keylength) == 0))
{
if (unlikely((error= file->ha_delete_row(record))))
goto err;
@@ -26640,38 +26975,52 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field,
goto err;
}
+ error= 0;
+end:
+ my_free(key_buffer);
file->extra(HA_EXTRA_NO_CACHE);
(void) file->ha_rnd_end();
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
+
err:
- file->extra(HA_EXTRA_NO_CACHE);
- (void) file->ha_rnd_end();
- if (error)
- file->print_error(error,MYF(0));
- DBUG_RETURN(1);
+ DBUG_ASSERT(error);
+ file->print_error(error,MYF(0));
+ goto end;
}
/**
- Generate a hash index for each row to quickly find duplicate rows.
+ Generate a hash index for each row to quickly find duplicate rows.
+
+ @param thd THD
+ @param table Temporary table
+ @param field_count Number of fields part of distinct
+ @param first_field Pointer to fields in temporary table that are part of
+ distinct, ends with null pointer
+ @param sortorder An array of Items part of distsinct. Terminated with an
+ element N with sortorder[N]->item=NULL.
+ @param keylength Length of hash key
+ @param having Having expression (NULL if no having)
- @note
- Note that this will not work on tables with blobs!
+ @note
+ Note that this will not work on tables with blobs!
*/
static int remove_dup_with_hash_index(THD *thd, TABLE *table,
uint field_count,
Field **first_field,
+ SORT_FIELD *sortorder,
ulong key_length,
Item *having)
{
uchar *key_buffer, *key_pos, *record=table->record[0];
+ char *tmp_buffer;
int error;
handler *file= table->file;
ulong extra_length= ALIGN_SIZE(key_length)-key_length;
uint *field_lengths, *field_length;
HASH hash;
- Field **ptr;
+ String tmp_value;
DBUG_ENTER("remove_dup_with_hash_index");
if (!my_multi_malloc(key_memory_hash_index_key_buffer, MYF(MY_WME),
@@ -26680,10 +27029,13 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
(long) file->stats.records),
&field_lengths,
(uint) (field_count*sizeof(*field_lengths)),
+ &tmp_buffer, key_length+1,
NullS))
DBUG_RETURN(1);
- for (ptr= first_field, field_length=field_lengths ; *ptr ; ptr++)
+ tmp_value.set(tmp_buffer, key_length, &my_charset_bin);
+ field_length= field_lengths;
+ for (Field **ptr= first_field ; *ptr ; ptr++)
(*field_length++)= (*ptr)->sort_length();
if (my_hash_init(key_memory_hash_index_key_buffer, &hash, &my_charset_bin,
@@ -26697,7 +27049,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
if (unlikely((error= file->ha_rnd_init(1))))
goto err;
- key_pos=key_buffer;
+ key_pos= key_buffer;
for (;;)
{
uchar *org_key_pos;
@@ -26722,11 +27074,14 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
/* copy fields to key buffer */
org_key_pos= key_pos;
field_length=field_lengths;
- for (ptr= first_field ; *ptr ; ptr++)
+ for (Field **ptr= first_field ; *ptr ; ptr++)
{
(*ptr)->make_sort_key_part(key_pos, *field_length);
key_pos+= (*ptr)->maybe_null() + *field_length++;
}
+ /* Copy result fields not stored in table to key buffer */
+ key_pos= make_sort_key(sortorder, key_pos, &tmp_value);
+
/* Check if it exists before */
if (my_hash_search(&hash, org_key_pos, key_length))
{
@@ -29038,13 +29393,16 @@ bool JOIN_TAB::save_explain_data(Explain_table_access *eta,
// psergey-todo: data for filtering!
tracker= &eta->tracker;
jbuf_tracker= &eta->jbuf_tracker;
+ jbuf_loops_tracker= &eta->jbuf_loops_tracker;
jbuf_unpack_tracker= &eta->jbuf_unpack_tracker;
/* Enable the table access time tracker only for "ANALYZE stmt" */
if (thd->lex->analyze_stmt)
{
table->file->set_time_tracker(&eta->op_tracker);
- eta->op_tracker.my_gap_tracker = &eta->extra_time_tracker;
+ eta->op_tracker.set_gap_tracker(&eta->extra_time_tracker);
+
+ eta->jbuf_unpack_tracker.set_gap_tracker(&eta->jbuf_extra_time_tracker);
}
/* No need to save id and select_type here, they are kept in Explain_select */
@@ -30211,6 +30569,162 @@ void TABLE_LIST::print(THD *thd, table_map eliminated_tables, String *str,
}
}
+enum explainable_cmd_type
+{
+ SELECT_CMD, INSERT_CMD, REPLACE_CMD, UPDATE_CMD, DELETE_CMD, NO_CMD
+};
+
+static
+const LEX_CSTRING explainable_cmd_name []=
+{
+ {STRING_WITH_LEN("select ")},
+ {STRING_WITH_LEN("insert ")},
+ {STRING_WITH_LEN("replace ")},
+ {STRING_WITH_LEN("update ")},
+ {STRING_WITH_LEN("delete ")},
+};
+
+static
+const LEX_CSTRING* get_explainable_cmd_name(enum explainable_cmd_type cmd)
+{
+ return explainable_cmd_name + cmd;
+}
+
+static
+enum explainable_cmd_type get_explainable_cmd_type(THD *thd)
+{
+ switch (thd->lex->sql_command) {
+ case SQLCOM_SELECT:
+ return SELECT_CMD;
+ case SQLCOM_INSERT:
+ case SQLCOM_INSERT_SELECT:
+ return INSERT_CMD;
+ case SQLCOM_REPLACE:
+ case SQLCOM_REPLACE_SELECT:
+ return REPLACE_CMD;
+ case SQLCOM_UPDATE:
+ case SQLCOM_UPDATE_MULTI:
+ return UPDATE_CMD;
+ case SQLCOM_DELETE:
+ case SQLCOM_DELETE_MULTI:
+ return DELETE_CMD;
+ default:
+ return SELECT_CMD;
+ }
+}
+
+
+void TABLE_LIST::print_leaf_tables(THD *thd, String *str,
+ enum_query_type query_type)
+{
+ if (merge_underlying_list)
+ {
+ for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
+ tbl->print_leaf_tables(thd, str, query_type);
+ }
+ else
+ print(thd, 0, str, query_type);
+}
+
+
+void st_select_lex::print_item_list(THD *thd, String *str,
+ enum_query_type query_type)
+{
+ bool first= 1;
+ /*
+ outer_select() can not be used here because it is for name resolution
+ and will return NULL at any end of name resolution chain (view/derived)
+ */
+ bool top_level= is_query_topmost(thd);
+ List_iterator_fast<Item> it(item_list);
+ Item *item;
+ while ((item= it++))
+ {
+ if (first)
+ first= 0;
+ else
+ str->append(',');
+
+ if ((is_subquery_function() && !item->is_explicit_name()) ||
+ !item->name.str)
+ {
+ /*
+ Do not print auto-generated aliases in subqueries. It has no purpose
+ in a view definition or other contexts where the query is printed.
+ */
+ item->print(str, query_type);
+ }
+ else
+ {
+ /*
+ Do not print illegal names (if it is not top level SELECT).
+ Top level view checked (and correct name are assigned),
+ other cases of top level SELECT are not important, because
+ it is not "table field".
+ */
+ if (top_level ||
+ item->is_explicit_name() ||
+ !check_column_name(item->name.str))
+ item->print_item_w_name(str, query_type);
+ else
+ item->print(str, query_type);
+ }
+ }
+}
+
+
+void st_select_lex::print_set_clause(THD *thd, String *str,
+ enum_query_type query_type)
+{
+ bool first= 1;
+ /*
+ outer_select() can not be used here because it is for name resolution
+ and will return NULL at any end of name resolution chain (view/derived)
+ */
+ List_iterator_fast<Item> it(item_list);
+ List_iterator_fast<Item> vt(thd->lex->value_list);
+ Item *item;
+ Item *val;
+ while ((item= it++, val= vt++ ))
+ {
+ if (first)
+ {
+ str->append(STRING_WITH_LEN(" set "));
+ first= 0;
+ }
+ else
+ str->append(',');
+
+ item->print(str, query_type);
+ str->append(STRING_WITH_LEN(" = "));
+ val->print(str, query_type);
+ }
+}
+
+
+void st_select_lex::print_on_duplicate_key_clause(THD *thd, String *str,
+ enum_query_type query_type)
+{
+ bool first= 1;
+ List_iterator_fast<Item> it(thd->lex->update_list);
+ List_iterator_fast<Item> vt(thd->lex->value_list);
+ Item *item;
+ Item *val;
+ while ((item= it++, val= vt++ ))
+ {
+ if (first)
+ {
+ str->append(STRING_WITH_LEN(" on duplicate key update "));
+ first= 0;
+ }
+ else
+ str->append(',');
+
+ item->print(str, query_type);
+ str->append(STRING_WITH_LEN(" = "));
+ val->print(str, query_type);
+ }
+}
void st_select_lex::print(THD *thd, String *str, enum_query_type query_type)
{
@@ -30222,6 +30736,67 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type)
return;
}
+ if (is_tvc_wrapper && (query_type & QT_NO_WRAPPERS_FOR_TVC_IN_VIEW))
+ {
+ first_inner_unit()->first_select()->print(thd, str, query_type);
+ return;
+ }
+
+ bool top_level= is_query_topmost(thd);
+ enum explainable_cmd_type sel_type= SELECT_CMD;
+ if (top_level)
+ sel_type= get_explainable_cmd_type(thd);
+
+ if (sel_type == INSERT_CMD || sel_type == REPLACE_CMD)
+ {
+ str->append(get_explainable_cmd_name(sel_type));
+ str->append(STRING_WITH_LEN("into "));
+ TABLE_LIST *tbl= thd->lex->query_tables;
+ while (tbl->merge_underlying_list)
+ tbl= tbl->merge_underlying_list;
+ tbl->print(thd, 0, str, query_type);
+ if (thd->lex->field_list.elements)
+ {
+ str->append ('(');
+ List_iterator_fast<Item> it(thd->lex->field_list);
+ Item *item;
+ bool first= true;
+ while ((item= it++))
+ {
+ if (first)
+ first= false;
+ else
+ str->append(',');
+ str->append(item->name);
+ }
+ str->append(')');
+ }
+
+ str->append(' ');
+
+ if (thd->lex->sql_command == SQLCOM_INSERT ||
+ thd->lex->sql_command == SQLCOM_REPLACE)
+ {
+ str->append(STRING_WITH_LEN("values "));
+ bool is_first_elem= true;
+ List_iterator_fast<List_item> li(thd->lex->many_values);
+ List_item *list;
+
+ while ((list= li++))
+ {
+ if (is_first_elem)
+ is_first_elem= false;
+ else
+ str->append(',');
+
+ print_list_item(str, list, query_type);
+ }
+ if (thd->lex->update_list.elements)
+ print_on_duplicate_key_clause(thd, str, query_type);
+ return;
+ }
+ }
+
if ((query_type & QT_SHOW_SELECT_NUMBER) &&
thd->lex->all_selects_list &&
thd->lex->all_selects_list->link_next &&
@@ -30244,7 +30819,10 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type)
str->append(STRING_WITH_LEN(" */ "));
}
- str->append(STRING_WITH_LEN("select "));
+ if (sel_type == SELECT_CMD ||
+ sel_type == INSERT_CMD ||
+ sel_type == REPLACE_CMD)
+ str->append(STRING_WITH_LEN("select "));
if (join && join->cleaned)
{
@@ -30290,57 +30868,66 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type)
}
//Item List
- bool first= 1;
+ if (sel_type == SELECT_CMD ||
+ sel_type == INSERT_CMD ||
+ sel_type == REPLACE_CMD)
+ print_item_list(thd, str, query_type);
/*
- outer_select() can not be used here because it is for name resolution
- and will return NULL at any end of name resolution chain (view/derived)
+ from clause
+ TODO: support USING/FORCE/IGNORE index
*/
- bool top_level= (get_master()->get_master() == 0);
- List_iterator_fast<Item> it(item_list);
- Item *item;
- while ((item= it++))
+ if (table_list.elements)
{
- if (first)
- first= 0;
- else
- str->append(',');
-
- if ((is_subquery_function() && !item->is_explicit_name()) ||
- !item->name.str)
+ if (sel_type == SELECT_CMD ||
+ sel_type == INSERT_CMD ||
+ sel_type == REPLACE_CMD)
{
- /*
- Do not print auto-generated aliases in subqueries. It has no purpose
- in a view definition or other contexts where the query is printed.
- */
- item->print(str, query_type);
+ str->append(STRING_WITH_LEN(" from "));
+ /* go through join tree */
+ print_join(thd, join? join->eliminated_tables: 0, str, &top_join_list,
+ query_type);
}
- else
+ if (sel_type == UPDATE_CMD || sel_type == DELETE_CMD)
+ str->append(get_explainable_cmd_name(sel_type));
+ if (sel_type == DELETE_CMD)
{
- /*
- Do not print illegal names (if it is not top level SELECT).
- Top level view checked (and correct name are assigned),
- other cases of top level SELECT are not important, because
- it is not "table field".
- */
- if (top_level ||
- item->is_explicit_name() ||
- !check_column_name(item->name.str))
- item->print_item_w_name(str, query_type);
+ str->append(STRING_WITH_LEN(" from "));
+ bool first= true;
+ for (TABLE_LIST *target_tbl= thd->lex->auxiliary_table_list.first;
+ target_tbl;
+ target_tbl= target_tbl->next_local)
+ {
+ if (first)
+ first= false;
+ else
+ str->append(',');
+ target_tbl->correspondent_table->print_leaf_tables(thd, str,
+ query_type);
+ }
+
+ if (!first)
+ str->append(STRING_WITH_LEN(" using "));
+ }
+ if (sel_type == UPDATE_CMD || sel_type == DELETE_CMD)
+ {
+ if (join)
+ print_join(thd, 0, str, &top_join_list, query_type);
else
- item->print(str, query_type);
+ {
+ bool first= true;
+ List_iterator_fast<TABLE_LIST> li(leaf_tables);
+ TABLE_LIST *tbl;
+ while ((tbl= li++))
+ {
+ if (first)
+ first= false;
+ else
+ str->append(',');
+ tbl->print(thd, 0, str, query_type);
+ }
+ }
}
}
-
- /*
- from clause
- TODO: support USING/FORCE/IGNORE index
- */
- if (table_list.elements)
- {
- str->append(STRING_WITH_LEN(" from "));
- /* go through join tree */
- print_join(thd, join? join->eliminated_tables: 0, str, &top_join_list, query_type);
- }
else if (where)
{
/*
@@ -30350,10 +30937,15 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type)
str->append(STRING_WITH_LEN(" from DUAL "));
}
+ if (sel_type == UPDATE_CMD)
+ print_set_clause(thd, str, query_type);
+
// Where
Item *cur_where= where;
if (join)
cur_where= join->conds;
+ else if (sel_type == UPDATE_CMD || sel_type == DELETE_CMD)
+ cur_where= thd->lex->upd_del_where;
if (cur_where || cond_value != Item::COND_UNDEF)
{
str->append(STRING_WITH_LEN(" where "));
@@ -30412,6 +31004,15 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type)
if (unlikely(skip_locked))
str->append(STRING_WITH_LEN(" skip locked"));
+ if ((sel_type == INSERT_CMD || sel_type == REPLACE_CMD) &&
+ thd->lex->update_list.elements)
+ print_on_duplicate_key_clause(thd, str, query_type);
+
+ // returning clause
+ if (sel_type == DELETE_CMD && !item_list.elements)
+ {
+ print_item_list(thd, str, query_type);
+ }
// PROCEDURE unsupported here
}
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 0d53d4c9798..ed8f459fd6c 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -310,6 +310,7 @@ typedef struct st_join_table {
Table_access_tracker *jbuf_tracker;
Time_and_counter_tracker *jbuf_unpack_tracker;
+ Counter_tracker *jbuf_loops_tracker;
// READ_RECORD::Setup_func materialize_table;
READ_RECORD::Setup_func read_first_record;
@@ -440,6 +441,8 @@ typedef struct st_join_table {
*/
bool idx_cond_fact_out;
bool use_join_cache;
+ /* TRUE <=> it is prohibited to join this table using join buffer */
+ bool no_forced_join_cache;
uint used_join_cache_level;
ulong join_buffer_size_limit;
JOIN_CACHE *cache;
@@ -566,6 +569,16 @@ typedef struct st_join_table {
bool preread_init_done;
+ /* true <=> split optimization has been applied to this materialized table */
+ bool is_split_derived;
+
+ /*
+ Bitmap of split materialized derived tables that can be filled just before
+ this join table is to be joined. All parameters of the split derived tables
+ belong to tables preceding this join table.
+ */
+ table_map split_derived_to_update;
+
/*
Cost info to the range filter used when joining this join table
(Defined when the best join order has been already chosen)
@@ -729,9 +742,10 @@ typedef struct st_join_table {
void partial_cleanup();
void add_keyuses_for_splitting();
- SplM_plan_info *choose_best_splitting(double record_count,
- table_map remaining_tables);
- bool fix_splitting(SplM_plan_info *spl_plan, table_map remaining_tables,
+ SplM_plan_info *choose_best_splitting(uint idx,
+ table_map remaining_tables,
+ table_map *spl_pd_boundary);
+ bool fix_splitting(SplM_plan_info *spl_plan, table_map excluded_tables,
bool is_const_table);
} JOIN_TAB;
@@ -1039,9 +1053,21 @@ public:
*/
KEYUSE *key;
+ /* Cardinality of current partial join ending with this position */
+ double partial_join_cardinality;
+
/* Info on splitting plan used at this position */
SplM_plan_info *spl_plan;
+ /*
+ If spl_plan is NULL the value of spl_pd_boundary is 0. Otherwise
+ spl_pd_boundary contains the bitmap of the table from the current
+ partial join ending at this position that starts the sub-sequence of
+ tables S from which no conditions are allowed to be used in the plan
+ spl_plan for the split table joined at this position.
+ */
+ table_map spl_pd_boundary;
+
/* Cost info for the range filter used at this position */
Range_rowid_filter_cost_info *range_rowid_filter_info;
diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc
index 60da595afd0..fdb9c647727 100644
--- a/sql/sql_sequence.cc
+++ b/sql/sql_sequence.cc
@@ -1011,10 +1011,19 @@ bool Sql_cmd_alter_sequence::execute(THD *thd)
else
table->file->print_error(error, MYF(0));
seq->write_unlock(table);
- if (trans_commit_stmt(thd))
- error= 1;
- if (trans_commit_implicit(thd))
- error= 1;
+ {
+ wait_for_commit* suspended_wfc= thd->suspend_subsequent_commits();
+ if (trans_commit_stmt(thd))
+ error= 1;
+ if (trans_commit_implicit(thd))
+ error= 1;
+ thd->resume_subsequent_commits(suspended_wfc);
+ DBUG_EXECUTE_IF("hold_worker_on_schedule",
+ {
+ /* delay binlogging of a parent trx in rpl_parallel_seq */
+ my_sleep(100000);
+ });
+ }
if (likely(!error))
error= write_bin_log(thd, 1, thd->query(), thd->query_length());
if (likely(!error))
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 8879d5f61c1..fa95aa66b0f 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2659,7 +2659,8 @@ static int show_create_view(THD *thd, TABLE_LIST *table, String *buff)
a different syntax, like when ANSI_QUOTES is defined.
*/
table->view->unit.print(buff, enum_query_type(QT_VIEW_INTERNAL |
- QT_ITEM_ORIGINAL_FUNC_NULLIF));
+ QT_ITEM_ORIGINAL_FUNC_NULLIF |
+ QT_NO_WRAPPERS_FOR_TVC_IN_VIEW));
if (table->with_check != VIEW_CHECK_NONE)
{
@@ -8840,7 +8841,6 @@ bool optimize_schema_tables_memory_usage(List<TABLE_LIST> &tables)
TMP_TABLE_PARAM *p= table_list->schema_table_param;
TMP_ENGINE_COLUMNDEF *from_recinfo, *to_recinfo;
DBUG_ASSERT(table->s->keys == 0);
- DBUG_ASSERT(table->s->uniques == 0);
uchar *cur= table->field[0]->ptr;
/* first recinfo could be a NULL bitmap, not an actual Field */
diff --git a/sql/sql_sort.h b/sql/sql_sort.h
index 88f719b3593..2b2c08b59cd 100644
--- a/sql/sql_sort.h
+++ b/sql/sql_sort.h
@@ -20,6 +20,7 @@
#include "my_base.h" /* ha_rows */
#include <my_sys.h> /* qsort2_cmp */
#include "queues.h"
+#include "sql_string.h"
#include "sql_class.h"
class Field;
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc
index ecde847c8d4..ccf1ebb9ef9 100644
--- a/sql/sql_statistics.cc
+++ b/sql/sql_statistics.cc
@@ -4029,50 +4029,16 @@ double Histogram_binary::point_selectivity(Field *field, key_range *endpoint,
}
else
{
- /*
+ /*
The value 'pos' fits within one single histogram bucket.
- Histogram_binary buckets have the same numbers of rows, but they cover
- different ranges of values.
-
- We assume that values are uniformly distributed across the [0..1] value
- range.
- */
-
- /*
- If all buckets covered value ranges of the same size, the width of
- value range would be:
+ We also have avg_sel which is per-table average selectivity of col=const.
+ If there are popular values, this may be larger than one bucket, so
+ cap the returned number by the selectivity of one bucket.
*/
double avg_bucket_width= 1.0 / (get_width() + 1);
-
- /*
- Let's see what is the width of value range that our bucket is covering.
- (min==max currently. they are kept in the formula just in case we
- will want to extend it to handle multi-bucket case)
- */
- double inv_prec_factor= (double) 1.0 / prec_factor();
- double current_bucket_width=
- (max + 1 == get_width() ? 1.0 : (get_value(max) * inv_prec_factor)) -
- (min == 0 ? 0.0 : (get_value(min-1) * inv_prec_factor));
-
- DBUG_ASSERT(current_bucket_width); /* We shouldn't get a one zero-width bucket */
-
- /*
- So:
- - each bucket has the same #rows
- - values are unformly distributed across the [min_value,max_value] domain.
- If a bucket has value range that's N times bigger then average, than
- each value will have to have N times fewer rows than average.
- */
- sel= avg_sel * avg_bucket_width / current_bucket_width;
-
- /*
- (Q: if we just follow this proportion we may end up in a situation
- where number of different values we expect to find in this bucket
- exceeds the number of rows that this histogram has in a bucket. Are
- we ok with this or we would want to have certain caps?)
- */
+ sel= MY_MIN(avg_bucket_width, avg_sel);
}
return sel;
}
@@ -4147,7 +4113,7 @@ bool is_eits_usable(Field *field)
if (!col_stats)
return false;
- DBUG_ASSERT(field->table->stats_is_read);
+ DBUG_ASSERT(field->orig_table->stats_is_read);
/*
(1): checks if we have EITS statistics for a particular column
@@ -4160,8 +4126,8 @@ bool is_eits_usable(Field *field)
return !col_stats->no_stat_values_provided() && //(1)
field->type() != MYSQL_TYPE_GEOMETRY && //(2)
#ifdef WITH_PARTITION_STORAGE_ENGINE
- (!field->table->part_info ||
- !field->table->part_info->field_in_partition_expr(field)) && //(3)
+ (!field->orig_table->part_info ||
+ !field->orig_table->part_info->field_in_partition_expr(field)) && //(3)
#endif
true;
}
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 14db5ad7c7d..679cbdfc2b5 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -563,7 +563,7 @@ bool String::append(const char *s,size_t size)
}
/*
- For an ASCII compatinble string we can just append.
+ For an ASCII compatible string we can just append.
*/
return Binary_string::append(s, arg_length);
}
diff --git a/sql/sql_string.h b/sql/sql_string.h
index 9729d9e85fd..dbb4760ab34 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -203,6 +203,83 @@ public:
{
return m_charset != &my_charset_bin;
}
+
+ /*
+ The MariaDB version when the last collation change happened,
+ e.g. due to a bug fix. See functions below.
+ */
+ static ulong latest_mariadb_version_with_collation_change()
+ {
+ return 110002;
+ }
+
+ /*
+ Check if the collation with the given ID changed its order
+ since the given MariaDB version.
+ */
+ static bool collation_changed_order(ulong mysql_version, uint cs_number)
+ {
+ if ((mysql_version < 50048 &&
+ (cs_number == 11 || /* ascii_general_ci - bug #29499, bug #27562 */
+ cs_number == 41 || /* latin7_general_ci - bug #29461 */
+ cs_number == 42 || /* latin7_general_cs - bug #29461 */
+ cs_number == 20 || /* latin7_estonian_cs - bug #29461 */
+ cs_number == 21 || /* latin2_hungarian_ci - bug #29461 */
+ cs_number == 22 || /* koi8u_general_ci - bug #29461 */
+ cs_number == 23 || /* cp1251_ukrainian_ci - bug #29461 */
+ cs_number == 26)) || /* cp1250_general_ci - bug #29461 */
+ (mysql_version < 50124 &&
+ (cs_number == 33 || /* utf8mb3_general_ci - bug #27877 */
+ cs_number == 35))) /* ucs2_general_ci - bug #27877 */
+ return true;
+
+ if (cs_number == 159 && /* ucs2_general_mysql500_ci - MDEV-30746 */
+ ((mysql_version >= 100400 && mysql_version < 100429) ||
+ (mysql_version >= 100500 && mysql_version < 100520) ||
+ (mysql_version >= 100600 && mysql_version < 100613) ||
+ (mysql_version >= 100700 && mysql_version < 100708) ||
+ (mysql_version >= 100800 && mysql_version < 100808) ||
+ (mysql_version >= 100900 && mysql_version < 100906) ||
+ (mysql_version >= 101000 && mysql_version < 101004) ||
+ (mysql_version >= 101100 && mysql_version < 101103) ||
+ (mysql_version >= 110000 && mysql_version < 110002)))
+ return true;
+ return false;
+ }
+
+ /**
+ Check if a collation has changed ID since the given version.
+ Return the new ID.
+
+ @param mysql_version
+ @param cs_number - collation ID
+
+ @retval the new collation ID (or cs_number, if no change)
+ */
+
+ static uint upgrade_collation_id(ulong mysql_version, uint cs_number)
+ {
+ if (mysql_version >= 50300 && mysql_version <= 50399)
+ {
+ switch (cs_number) {
+ case 149: return MY_PAGE2_COLLATION_ID_UCS2; // ucs2_crotian_ci
+ case 213: return MY_PAGE2_COLLATION_ID_UTF8; // utf8_crotian_ci
+ }
+ }
+ if ((mysql_version >= 50500 && mysql_version <= 50599) ||
+ (mysql_version >= 100000 && mysql_version <= 100005))
+ {
+ switch (cs_number) {
+ case 149: return MY_PAGE2_COLLATION_ID_UCS2; // ucs2_crotian_ci
+ case 213: return MY_PAGE2_COLLATION_ID_UTF8; // utf8_crotian_ci
+ case 214: return MY_PAGE2_COLLATION_ID_UTF32; // utf32_croatian_ci
+ case 215: return MY_PAGE2_COLLATION_ID_UTF16; // utf16_croatian_ci
+ case 245: return MY_PAGE2_COLLATION_ID_UTF8MB4;// utf8mb4_croatian_ci
+ }
+ }
+ return cs_number;
+ }
+
};
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 26a58e66ffe..8e951bc48de 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -12299,6 +12299,19 @@ bool Sql_cmd_create_table_like::execute(THD *thd)
}
#endif
+#ifdef WITH_WSREP
+ if (select_lex->item_list.elements && // With SELECT
+ WSREP(thd) && thd->variables.wsrep_trx_fragment_size > 0)
+ {
+ my_message(
+ ER_NOT_ALLOWED_COMMAND,
+ "CREATE TABLE AS SELECT is not supported with streaming replication",
+ MYF(0));
+ res= 1;
+ goto end_with_restore_list;
+ }
+#endif /* WITH_WSREP */
+
if (select_lex->item_list.elements || select_lex->tvc) // With select or TVC
{
select_result *result;
diff --git a/sql/sql_tvc.cc b/sql/sql_tvc.cc
index b4a7a0d5091..cb1971a1746 100644
--- a/sql/sql_tvc.cc
+++ b/sql/sql_tvc.cc
@@ -706,6 +706,7 @@ st_select_lex *wrap_tvc(THD *thd, st_select_lex *tvc_sl,
wrapper_sl->select_number= ++thd->lex->stmt_lex->current_select_number;
wrapper_sl->parent_lex= lex; /* Used in init_query. */
wrapper_sl->make_empty_select();
+ wrapper_sl->is_tvc_wrapper= true;
wrapper_sl->nest_level= tvc_sl->nest_level;
wrapper_sl->parsing_place= tvc_sl->parsing_place;
diff --git a/sql/sql_type.cc b/sql/sql_type.cc
index 213de62705f..269532e2390 100644
--- a/sql/sql_type.cc
+++ b/sql/sql_type.cc
@@ -9035,13 +9035,13 @@ Type_handler_timestamp_common::Item_val_native_with_conversion(THD *thd,
Item *item,
Native *to) const
{
- MYSQL_TIME ltime;
if (item->type_handler()->type_handler_for_native_format() ==
&type_handler_timestamp2)
return item->val_native(thd, to);
+ Datetime dt(thd, item, Datetime::Options(TIME_NO_ZERO_IN_DATE, thd));
return
- item->get_date(thd, &ltime, Datetime::Options(TIME_NO_ZERO_IN_DATE, thd)) ||
- TIME_to_native(thd, &ltime, to, item->datetime_precision(thd));
+ !dt.is_valid_datetime() ||
+ TIME_to_native(thd, dt.get_mysql_time(), to, item->datetime_precision(thd));
}
bool Type_handler_null::union_element_finalize(Item_type_holder *item) const
diff --git a/sql/sql_type.h b/sql/sql_type.h
index d931c7ffb6d..52c17d61d2e 100644
--- a/sql/sql_type.h
+++ b/sql/sql_type.h
@@ -4060,14 +4060,14 @@ public:
*/
virtual void make_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const= 0;
+ String *tmp) const= 0;
/*
create a compact size key part for a sort key
*/
virtual uint make_packed_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const=0;
+ String *tmp) const=0;
virtual void sort_length(THD *thd,
const Type_std_attributes *item,
@@ -4473,12 +4473,12 @@ public:
uint32 flags) const override;
void make_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const override
+ String *tmp) const override
{
MY_ASSERT_UNREACHABLE();
}
uint make_packed_sort_key_part(uchar *, Item *, const SORT_FIELD_ATTR *,
- Sort_param *) const override
+ String *) const override
{
MY_ASSERT_UNREACHABLE();
return 0;
@@ -4818,10 +4818,10 @@ public:
const override;
void make_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const override;
+ String *tmp) const override;
uint make_packed_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const override;
+ String *tmp) const override;
void sort_length(THD *thd,
const Type_std_attributes *item,
SORT_FIELD_ATTR *attr) const override;
@@ -4930,10 +4930,10 @@ public:
const override;
void make_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const override;
+ String *tmp) const override;
uint make_packed_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const override;
+ String *tmp) const override;
void
Column_definition_attributes_frm_pack(const Column_definition_attributes *at,
uchar *buff) const override;
@@ -5186,10 +5186,10 @@ public:
TABLE_SHARE *share) const override;
void make_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const override;
+ String *tmp) const override;
uint make_packed_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const override;
+ String *tmp) const override;
void
Column_definition_attributes_frm_pack(const Column_definition_attributes *at,
uchar *buff) const override;
@@ -5297,10 +5297,10 @@ public:
uchar *buff) const override;
void make_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const override;
+ String *tmp) const override;
uint make_packed_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const override;
+ String *tmp) const override;
void sort_length(THD *thd,
const Type_std_attributes *item,
SORT_FIELD_ATTR *attr) const override;
@@ -5397,10 +5397,10 @@ public:
CHARSET_INFO *cs) const override;
void make_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const override;
+ String *tmp) const override;
uint make_packed_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const override;
+ String *tmp) const override;
void sort_length(THD *thd,
const Type_std_attributes *item,
SORT_FIELD_ATTR *attr) const override;
@@ -6620,10 +6620,10 @@ public:
const override;
void make_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const override;
+ String *tmp) const override;
uint make_packed_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const override;
+ String *tmp) const override;
void sort_length(THD *thd,
const Type_std_attributes *item,
SORT_FIELD_ATTR *attr) const override;
diff --git a/sql/sql_type_fixedbin.h b/sql/sql_type_fixedbin.h
index c1be1c9ccba..852ec1269eb 100644
--- a/sql/sql_type_fixedbin.h
+++ b/sql/sql_type_fixedbin.h
@@ -468,7 +468,7 @@ public:
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
+ String *) const override
{
DBUG_ASSERT(item->type_handler() == this);
NativeBuffer<FbtImpl::binary_length()+1> tmp;
@@ -489,7 +489,7 @@ public:
}
uint make_packed_sort_key_part(uchar *to, Item *item,
const SORT_FIELD_ATTR *sort_field,
- Sort_param *param) const override
+ String *) const override
{
DBUG_ASSERT(item->type_handler() == this);
NativeBuffer<FbtImpl::binary_length()+1> tmp;
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 2be2a85b889..3b2a690860b 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1279,7 +1279,8 @@ produce_explain_and_leave:
goto err;
emit_explain_and_leave:
- int err2= thd->lex->explain->send_explain(thd);
+ bool extended= thd->lex->describe & DESCRIBE_EXTENDED;
+ int err2= thd->lex->explain->send_explain(thd, extended);
delete select;
free_underlaid_joins(thd, select_lex);
@@ -3070,7 +3071,10 @@ bool Sql_cmd_update::execute_inner(THD *thd)
else
{
if (thd->lex->describe || thd->lex->analyze_stmt)
- res= thd->lex->explain->send_explain(thd);
+ {
+ bool extended= thd->lex->describe & DESCRIBE_EXTENDED;
+ res= thd->lex->explain->send_explain(thd, extended);
+ }
}
}
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 89251e33f7f..9eb4bf382b6 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -1006,10 +1006,12 @@ static int mysql_register_view(THD *thd, DDL_LOG_STATE *ddl_log_state,
Sql_mode_instant_remove sms(thd, MODE_ANSI_QUOTES);
lex->unit.print(&view_query, enum_query_type(QT_VIEW_INTERNAL |
- QT_ITEM_ORIGINAL_FUNC_NULLIF));
+ QT_ITEM_ORIGINAL_FUNC_NULLIF |
+ QT_NO_WRAPPERS_FOR_TVC_IN_VIEW));
lex->unit.print(&is_query, enum_query_type(QT_TO_SYSTEM_CHARSET |
QT_WITHOUT_INTRODUCERS |
- QT_ITEM_ORIGINAL_FUNC_NULLIF));
+ QT_ITEM_ORIGINAL_FUNC_NULLIF |
+ QT_NO_WRAPPERS_FOR_TVC_IN_VIEW));
}
DBUG_PRINT("info", ("View: %.*s", view_query.length(), view_query.ptr()));
@@ -1806,7 +1808,7 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table,
if (view_is_mergeable &&
(table->select_lex->master_unit() != &old_lex->unit ||
old_lex->can_use_merged()) &&
- !old_lex->can_not_use_merged(0))
+ !old_lex->can_not_use_merged())
{
/* lex should contain at least one table */
DBUG_ASSERT(view_main_select_tables != 0);
@@ -1839,8 +1841,11 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table,
*/
if (!table->select_lex->master_unit()->is_unit_op() &&
table->select_lex->order_list.elements == 0)
+ {
table->select_lex->order_list.
push_back(&lex->first_select_lex()->order_list);
+ lex->first_select_lex()->order_list.empty();
+ }
else
{
if (old_lex->sql_command == SQLCOM_SELECT &&
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index c8a9ec0cb41..24284402e84 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -223,6 +223,7 @@ void _CONCAT_UNDERSCORED(turn_parser_debug_on,yyparse)()
Lex_for_loop_bounds_st for_loop_bounds;
Lex_trim_st trim;
Json_table_column::On_response json_on_response;
+ Lex_substring_spec_st substring_spec;
vers_history_point_t vers_history_point;
struct
{
@@ -347,9 +348,9 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
*/
%ifdef MARIADB
-%expect 82
+%expect 64
%else
-%expect 83
+%expect 65
%endif
/*
@@ -634,7 +635,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> RELEASE_SYM /* SQL-2003-R */
%token <kwd> RENAME
%token <kwd> REPEAT_SYM /* MYSQL-FUNC */
-%token <kwd> REPLACE /* MYSQL-FUNC */
%token <kwd> REQUIRE_SYM
%token <kwd> RESIGNAL_SYM /* SQL-2003-R */
%token <kwd> RESTRICT
@@ -671,7 +671,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> STDDEV_SAMP_SYM /* SQL-2003-N */
%token <kwd> STD_SYM
%token <kwd> STRAIGHT_JOIN
-%token <kwd> SUBSTRING /* SQL-2003-N */
%token <kwd> SUM_SYM /* SQL-2003-N */
%token <kwd> SYSDATE
%token <kwd> TABLE_REF_PRIORITY
@@ -684,7 +683,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> TO_SYM /* SQL-2003-R */
%token <kwd> TRAILING /* SQL-2003-R */
%token <kwd> TRIGGER_SYM /* SQL-2003-R */
-%token <kwd> TRIM /* SQL-2003-N */
%token <kwd> TRUE_SYM /* SQL-2003-R */
%token <kwd> UNDO_SYM /* FUTURE-USE */
%token <kwd> UNION_SYM /* SQL-2003-R */
@@ -730,6 +728,14 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> ROWNUM_SYM /* Oracle-R */
/*
+ SQL functions with a special syntax
+*/
+%token <kwd> REPLACE /* MYSQL-FUNC */
+%token <kwd> SUBSTRING /* SQL-2003-N */
+%token <kwd> TRIM /* SQL-2003-N */
+
+
+/*
Non-reserved keywords
*/
@@ -1180,7 +1186,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%left PREC_BELOW_NOT
-%nonassoc LOW_PRIORITY_NOT
+/* The precendence of boolean NOT is in fact here. See the comment below. */
+
%left '=' EQUAL_SYM GE '>' LE '<' NE
%nonassoc IS
%right BETWEEN_SYM
@@ -1192,6 +1199,24 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%left '*' '/' '%' DIV_SYM MOD_SYM
%left '^'
%left MYSQL_CONCAT_SYM
+/*
+ Boolean negation has a special branch in "expr" starting with NOT_SYM.
+ The precedence of logical negation is determined by the grammar itself
+ (without using Bison terminal symbol precedence) in this order
+ - Boolean factor (i.e. logical AND)
+ - Boolean NOT
+ - Boolean test (such as '=', IS NULL, IS TRUE)
+
+ But we also need a precedence for NOT_SYM in other contexts,
+ to shift (without reduce) in these cases:
+ predicate <here> NOT IN ...
+ predicate <here> NOT BETWEEN ...
+ predicate <here> NOT LIKE ...
+ predicate <here> NOT REGEXP ...
+ If the precedence of NOT_SYM was low, it would reduce immediately
+ after scanning "predicate" and then produce a syntax error on "NOT".
+*/
+%nonassoc NOT_SYM
%nonassoc NEG '~' NOT2_SYM BINARY
%nonassoc COLLATE_SYM
%nonassoc SUBQUERY_AS_EXPR
@@ -1480,6 +1505,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
literal insert_ident order_ident temporal_literal
simple_ident expr sum_expr in_sum_expr
variable variable_aux
+ boolean_test
predicate bit_expr parenthesized_expr
table_wild simple_expr column_default_non_parenthesized_expr udf_expr
primary_expr string_factor_expr mysql_concatenation_expr
@@ -1755,6 +1781,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%type <for_loop> sp_for_loop_index_and_bounds
%type <for_loop_bounds> sp_for_loop_bounds
%type <trim> trim_operands
+%type <substring_spec> substring_operands
%type <num> opt_sp_for_loop_direction
%type <spvar_mode> sp_parameter_type
%type <index_hint> index_hint_type
@@ -9139,79 +9166,83 @@ expr:
MYSQL_YYABORT;
}
}
- | NOT_SYM expr %prec LOW_PRIORITY_NOT
+ | NOT_SYM expr
{
$$= negate_expression(thd, $2);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | expr IS TRUE_SYM %prec IS
+ | boolean_test %prec PREC_BELOW_NOT
+ ;
+
+boolean_test:
+ boolean_test IS TRUE_SYM %prec IS
{
$$= new (thd->mem_root) Item_func_istrue(thd, $1);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | expr IS not TRUE_SYM %prec IS
+ | boolean_test IS not TRUE_SYM %prec IS
{
$$= new (thd->mem_root) Item_func_isnottrue(thd, $1);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | expr IS FALSE_SYM %prec IS
+ | boolean_test IS FALSE_SYM %prec IS
{
$$= new (thd->mem_root) Item_func_isfalse(thd, $1);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | expr IS not FALSE_SYM %prec IS
+ | boolean_test IS not FALSE_SYM %prec IS
{
$$= new (thd->mem_root) Item_func_isnotfalse(thd, $1);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | expr IS UNKNOWN_SYM %prec IS
+ | boolean_test IS UNKNOWN_SYM %prec IS
{
$$= new (thd->mem_root) Item_func_isnull(thd, $1);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | expr IS not UNKNOWN_SYM %prec IS
+ | boolean_test IS not UNKNOWN_SYM %prec IS
{
$$= new (thd->mem_root) Item_func_isnotnull(thd, $1);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | expr IS NULL_SYM %prec PREC_BELOW_NOT
+ | boolean_test IS NULL_SYM %prec IS
{
$$= new (thd->mem_root) Item_func_isnull(thd, $1);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | expr IS not NULL_SYM %prec IS
+ | boolean_test IS not NULL_SYM %prec IS
{
$$= new (thd->mem_root) Item_func_isnotnull(thd, $1);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | expr EQUAL_SYM predicate %prec EQUAL_SYM
+ | boolean_test EQUAL_SYM predicate %prec EQUAL_SYM
{
$$= new (thd->mem_root) Item_func_equal(thd, $1, $3);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | expr comp_op predicate %prec '='
+ | boolean_test comp_op predicate %prec '='
{
$$= (*$2)(0)->create(thd, $1, $3);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | expr comp_op all_or_any '(' subselect ')' %prec '='
+ | boolean_test comp_op all_or_any '(' subselect ')' %prec '='
{
$$= all_any_subquery_creator(thd, $1, $2, $3, $5);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | predicate
+ | predicate %prec BETWEEN_SYM
;
predicate:
@@ -9965,7 +9996,8 @@ function_call_keyword:
}
| TRIM '(' trim_operands ')'
{
- if (unlikely(!($$= $3.make_item_func_trim(thd))))
+ if (unlikely(!($$= Schema::find_implied(thd)->
+ make_item_func_trim(thd, $3))))
MYSQL_YYABORT;
}
| USER_SYM '(' ')'
@@ -9985,6 +10017,26 @@ function_call_keyword:
}
;
+substring_operands:
+ expr ',' expr ',' expr
+ {
+ $$= Lex_substring_spec_st::init($1, $3, $5);
+ }
+ | expr ',' expr
+ {
+ $$= Lex_substring_spec_st::init($1, $3);
+ }
+ | expr FROM expr FOR_SYM expr
+ {
+ $$= Lex_substring_spec_st::init($1, $3, $5);
+ }
+ | expr FROM expr
+ {
+ $$= Lex_substring_spec_st::init($1, $3);
+ }
+ ;
+
+
/*
Function calls using non reserved keywords, with special syntaxic forms.
Dedicated grammar rules are needed because of the syntax,
@@ -10117,24 +10169,10 @@ function_call_nonkeyword:
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | SUBSTRING '(' expr ',' expr ',' expr ')'
- {
- if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5, $7))))
- MYSQL_YYABORT;
- }
- | SUBSTRING '(' expr ',' expr ')'
- {
- if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5))))
- MYSQL_YYABORT;
- }
- | SUBSTRING '(' expr FROM expr FOR_SYM expr ')'
- {
- if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5, $7))))
- MYSQL_YYABORT;
- }
- | SUBSTRING '(' expr FROM expr ')'
+ | SUBSTRING '(' substring_operands ')'
{
- if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5))))
+ if (unlikely(!($$= Schema::find_implied(thd)->
+ make_item_func_substr(thd, $3))))
MYSQL_YYABORT;
}
%ifdef ORACLE
@@ -10347,7 +10385,8 @@ function_call_conflict:
}
| REPLACE '(' expr ',' expr ',' expr ')'
{
- if (unlikely(!($$= Lex->make_item_func_replace(thd, $3, $5, $7))))
+ if (unlikely(!($$= Schema::find_implied(thd)->
+ make_item_func_replace(thd, $3, $5, $7))))
MYSQL_YYABORT;
}
| REVERSE_SYM '(' expr ')'
diff --git a/sql/structs.h b/sql/structs.h
index 214fcb242ff..5b43948a563 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -903,6 +903,11 @@ public:
}
Item *make_item_func_trim_std(THD *thd) const;
Item *make_item_func_trim_oracle(THD *thd) const;
+ /*
+ This method is still used to handle LTRIM and RTRIM,
+ while the special syntax TRIM(... BOTH|LEADING|TRAILING)
+ is now handled by Schema::make_item_func_trim().
+ */
Item *make_item_func_trim(THD *thd) const;
};
@@ -914,6 +919,25 @@ public:
};
+class Lex_substring_spec_st
+{
+public:
+ Item *m_subject;
+ Item *m_from;
+ Item *m_for;
+ static Lex_substring_spec_st init(Item *subject,
+ Item *from,
+ Item *xfor= NULL)
+ {
+ Lex_substring_spec_st res;
+ res.m_subject= subject;
+ res.m_from= from;
+ res.m_for= xfor;
+ return res;
+ }
+};
+
+
class st_select_lex;
class Lex_select_lock
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 541a3658d99..c98a8b60746 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -604,10 +604,9 @@ bool check_has_super(sys_var *self, THD *thd, set_var *var)
return false;
}
-static Sys_var_bit Sys_core_file("core_file", "write a core-file on crashes",
- READ_ONLY GLOBAL_VAR(test_flags), NO_CMD_LINE,
- TEST_CORE_ON_SIGNAL, DEFAULT(IF_WIN(TRUE,FALSE)), NO_MUTEX_GUARD, NOT_IN_BINLOG,
- 0,0,0);
+static Sys_var_bit Sys_core_file("core_file", "Write core on crashes",
+ READ_ONLY GLOBAL_VAR(test_flags), CMD_LINE(OPT_ARG),
+ TEST_CORE_ON_SIGNAL, DEFAULT(IF_WIN(TRUE,FALSE)));
static bool binlog_format_check(sys_var *self, THD *thd, set_var *var)
{
@@ -804,12 +803,26 @@ static bool check_charset(sys_var *self, THD *thd, set_var *var)
{
int csno= (int)var->value->val_int();
CHARSET_INFO *cs;
- if (!(var->save_result.ptr= cs= get_charset(csno, MYF(0))) ||
- !(cs->state & MY_CS_PRIMARY))
+ if ((var->save_result.ptr= cs= get_charset(csno, MYF(0))))
{
- my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), llstr(csno, buff));
- return true;
+ /*
+ Backward compatibility: pre MDEV-30824 servers
+ can write non-default collation IDs to binary log:
+ SET character_set_client=83; -- utf8mb3_bin
+ Convert a non-default collation to the compiled default collation,
+ e.g. utf8mb3_bin to utf8mb3_general_ci, but only if
+ - THD is a slave thread or
+ - is processing a mysqlbinlog output.
+ */
+ if ((cs->state & MY_CS_PRIMARY) ||
+ ((thd->variables.pseudo_slave_mode || thd->slave_thread) &&
+ (var->save_result.ptr=
+ Lex_exact_charset_opt_extended_collate(cs, true).
+ find_default_collation())))
+ return false;
}
+ my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), llstr(csno, buff));
+ return true;
}
return false;
}
@@ -2878,6 +2891,7 @@ export const char *optimizer_switch_names[]=
"rowid_filter",
"condition_pushdown_from_having",
"not_null_range_scan",
+ "hash_join_cardinality",
"default",
NullS
};
diff --git a/sql/table.cc b/sql/table.cc
index a8eeeb53d72..b8ed7a99156 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -46,6 +46,10 @@
#include "sql_show.h"
#include "opt_trace.h"
#include "sql_db.h" // get_default_db_collation
+#include "sql_update.h" // class Sql_cmd_update
+#include "sql_delete.h" // class Sql_cmd_delete
+
+
/* For MySQL 5.7 virtual fields */
#define MYSQL57_GENERATED_FIELD 128
@@ -942,39 +946,6 @@ static uint enum_value_with_check(THD *thd, TABLE_SHARE *share,
}
-/**
- Check if a collation has changed number
-
- @param mysql_version
- @param current collation number
-
- @retval new collation number (same as current collation number of no change)
-*/
-
-static uint upgrade_collation(ulong mysql_version, uint cs_number)
-{
- if (mysql_version >= 50300 && mysql_version <= 50399)
- {
- switch (cs_number) {
- case 149: return MY_PAGE2_COLLATION_ID_UCS2; // ucs2_crotian_ci
- case 213: return MY_PAGE2_COLLATION_ID_UTF8; // utf8_crotian_ci
- }
- }
- if ((mysql_version >= 50500 && mysql_version <= 50599) ||
- (mysql_version >= 100000 && mysql_version <= 100005))
- {
- switch (cs_number) {
- case 149: return MY_PAGE2_COLLATION_ID_UCS2; // ucs2_crotian_ci
- case 213: return MY_PAGE2_COLLATION_ID_UTF8; // utf8_crotian_ci
- case 214: return MY_PAGE2_COLLATION_ID_UTF32; // utf32_croatian_ci
- case 215: return MY_PAGE2_COLLATION_ID_UTF16; // utf16_croatian_ci
- case 245: return MY_PAGE2_COLLATION_ID_UTF8MB4;// utf8mb4_croatian_ci
- }
- }
- return cs_number;
-}
-
-
void Column_definition_attributes::frm_pack_basic(uchar *buff) const
{
int2store(buff + 3, length);
@@ -1034,7 +1005,7 @@ bool Column_definition_attributes::frm_unpack_charset(TABLE_SHARE *share,
const uchar *buff)
{
uint cs_org= buff[14] + (((uint) buff[11]) << 8);
- uint cs_new= upgrade_collation(share->mysql_version, cs_org);
+ uint cs_new= Charset::upgrade_collation_id(share->mysql_version, cs_org);
if (cs_org != cs_new)
share->incompatible_version|= HA_CREATE_USED_CHARSET;
if (cs_new && !(charset= get_charset(cs_new, MYF(0))))
@@ -1894,7 +1865,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
if (!frm_image[32]) // New frm file in 3.23
{
uint cs_org= (((uint) frm_image[41]) << 8) + (uint) frm_image[38];
- uint cs_new= upgrade_collation(share->mysql_version, cs_org);
+ uint cs_new= Charset::upgrade_collation_id(share->mysql_version, cs_org);
if (cs_org != cs_new)
share->incompatible_version|= HA_CREATE_USED_CHARSET;
@@ -3110,6 +3081,9 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
goto err;
field= key_part->field= share->field[key_part->fieldnr-1];
+ if (Charset::collation_changed_order(share->mysql_version,
+ field->charset()->number))
+ share->incompatible_version|= HA_CREATE_USED_CHARSET;
key_part->type= field->key_type();
if (field->invisible > INVISIBLE_USER && !field->vers_sys_field())
@@ -3572,7 +3546,6 @@ int TABLE_SHARE::init_from_sql_statement_string(THD *thd, bool write,
char *sql_copy;
handler *file;
LEX *old_lex;
- Query_arena *arena, backup;
LEX tmp_lex;
KEY *unused1;
uint unused2;
@@ -3599,11 +3572,6 @@ int TABLE_SHARE::init_from_sql_statement_string(THD *thd, bool write,
old_lex= thd->lex;
thd->lex= &tmp_lex;
- arena= thd->stmt_arena;
- if (arena->is_conventional())
- arena= 0;
- else
- thd->set_n_backup_active_arena(arena, &backup);
/*
THD::reset_db() does not set THD::db_charset,
@@ -3655,8 +3623,6 @@ ret:
lex_end(thd->lex);
thd->reset_db(&db_backup);
thd->lex= old_lex;
- if (arena)
- thd->restore_active_arena(arena, &backup);
reenable_binlog(thd);
thd->variables.character_set_client= old_cs;
if (unlikely(thd->is_error() || error))
@@ -6886,6 +6852,9 @@ bool TABLE_LIST::prepare_security(THD *thd)
#ifndef DBUG_OFF
void TABLE_LIST::set_check_merged()
{
+ if (is_view())
+ return;
+
DBUG_ASSERT(derived);
/*
It is not simple to check all, but at least this should be checked:
@@ -6903,7 +6872,7 @@ void TABLE_LIST::set_check_materialized()
DBUG_ENTER("TABLE_LIST::set_check_materialized");
SELECT_LEX_UNIT *derived= this->derived;
if (view)
- derived= &view->unit;
+ derived= this->derived= &view->unit;
DBUG_ASSERT(derived);
DBUG_ASSERT(!derived->is_excluded());
if (!derived->first_select()->exclude_from_table_unique_test)
@@ -7213,10 +7182,9 @@ void Field_iterator_table_ref::set_field_iterator()
table_ref->alias.str));
}
/* This is a merge view, so use field_translation. */
- else if (table_ref->field_translation &&
- !table_ref->is_materialized_derived())
+ else if (!table_ref->is_materialized_derived() &&
+ table_ref->is_merged_derived() && table_ref->field_translation)
{
- DBUG_ASSERT(table_ref->is_merged_derived());
field_it= &view_field_it;
DBUG_PRINT("info", ("field_it for '%s' is Field_iterator_view",
table_ref->alias.str));
@@ -9303,7 +9271,7 @@ bool TABLE::check_period_overlaps(const KEY &key,
return false;
uint kp_len= key.key_part[part_nr].length;
if (f->cmp_prefix(f->ptr_in_record(lhs), f->ptr_in_record(rhs),
- kp_len) != 0)
+ kp_len / f->charset()->mbmaxlen) != 0)
return false;
}
@@ -9722,8 +9690,13 @@ void TABLE_LIST::wrap_into_nested_join(List<TABLE_LIST> &join_list)
static inline bool derived_table_optimization_done(TABLE_LIST *table)
{
- return table->derived &&
- (table->derived->is_excluded() ||
+ SELECT_LEX_UNIT *derived= (table->derived ?
+ table->derived :
+ (table->view ?
+ &table->view->unit:
+ NULL));
+ return derived &&
+ (derived->is_excluded() ||
table->is_materialized_derived());
}
@@ -9785,20 +9758,36 @@ bool TABLE_LIST::init_derived(THD *thd, bool init_view)
set_derived();
}
- if (!is_view() &&
- !derived_table_optimization_done(this))
+ if (!derived_table_optimization_done(this))
{
/* A subquery might be forced to be materialized due to a side-effect. */
- bool forced_no_merge_for_update_delete=
- belong_to_view ? belong_to_view->updating :
- !unit->outer_select()->outer_select();
- if (!is_materialized_derived() && first_select->is_mergeable() &&
- (unit->outer_select() && !unit->outer_select()->with_rownum) &&
+ if (!is_materialized_derived() && unit->can_be_merged() &&
+ /*
+ Following is special case of
+ SELECT * FROM (<limited-select>) WHERE ROWNUM() <= nnn
+ */
+ (unit->outer_select() &&
+ !(unit->outer_select()->with_rownum &&
+ unit->outer_select()->table_list.elements == 1 &&
+ (thd->lex->sql_command == SQLCOM_SELECT ||
+ !unit->outer_select()->is_query_topmost(thd)) &&
+ !is_view())) &&
+
(!thd->lex->with_rownum ||
(!first_select->group_list.elements &&
!first_select->order_list.elements)) &&
- optimizer_flag(thd, OPTIMIZER_SWITCH_DERIVED_MERGE) &&
- !thd->lex->can_not_use_merged(forced_no_merge_for_update_delete) &&
+ (is_view() ||
+ optimizer_flag(thd, OPTIMIZER_SWITCH_DERIVED_MERGE)) &&
+ !thd->lex->can_not_use_merged() &&
+ !(!is_view() &&
+ (thd->lex->sql_command == SQLCOM_UPDATE_MULTI ||
+ thd->lex->sql_command == SQLCOM_DELETE_MULTI ||
+ (thd->lex->sql_command == SQLCOM_UPDATE &&
+ (((Sql_cmd_update *) thd->lex->m_sql_cmd)->is_multitable() ||
+ thd->lex->query_tables->is_multitable())) ||
+ (thd->lex->sql_command == SQLCOM_DELETE &&
+ (((Sql_cmd_delete *) thd->lex->m_sql_cmd)->is_multitable() ||
+ thd->lex->query_tables->is_multitable())))) &&
!is_recursive_with_table())
set_merged_derived();
else
diff --git a/sql/table.h b/sql/table.h
index cad6720570d..d0d6f1e178b 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -853,7 +853,18 @@ struct TABLE_SHARE
uint keys, key_parts;
uint ext_key_parts; /* Total number of key parts in extended keys */
uint max_key_length, max_unique_length;
- uint uniques; /* Number of UNIQUE index */
+
+ /*
+ Older versions had TABLE_SHARE::uniques but now it is replaced with
+ per-index HA_UNIQUE_HASH flag
+ */
+ bool have_unique_constraint() const
+ {
+ for (uint i=0; i < keys; i++)
+ if (key_info[i].flags & HA_UNIQUE_HASH)
+ return true;
+ return false;
+ }
uint db_create_options; /* Create options from database */
uint db_options_in_use; /* Options in use */
uint db_record_offset; /* if HA_REC_IN_SEQ */
@@ -2817,6 +2828,8 @@ struct TABLE_LIST
}
void print(THD *thd, table_map eliminated_tables, String *str,
enum_query_type query_type);
+ void print_leaf_tables(THD *thd, String *str,
+ enum_query_type query_type);
bool check_single_table(TABLE_LIST **table, table_map map,
TABLE_LIST *view);
bool set_insert_values(MEM_ROOT *mem_root);
@@ -2957,8 +2970,7 @@ struct TABLE_LIST
DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
(alias.str ? alias.str : "<NULL>"),
get_unit()));
- derived_type= static_cast<uint8>((derived_type & DTYPE_MASK) |
- DTYPE_TABLE | DTYPE_MERGE);
+ derived_type= static_cast<uint8>((derived_type & DTYPE_MASK) | DTYPE_MERGE);
set_check_merged();
DBUG_VOID_RETURN;
}
@@ -2972,10 +2984,9 @@ struct TABLE_LIST
DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
(alias.str ? alias.str : "<NULL>"),
get_unit()));
- derived= get_unit();
derived_type= static_cast<uint8>((derived_type &
(derived ? DTYPE_MASK : DTYPE_VIEW)) |
- DTYPE_TABLE | DTYPE_MATERIALIZE);
+ DTYPE_MATERIALIZE);
set_check_materialized();
DBUG_VOID_RETURN;
}
diff --git a/sql/tztime.cc b/sql/tztime.cc
index a2add055deb..e77a7529332 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -2435,9 +2435,9 @@ print_tz_as_sql(const char* tz_name, const TIME_ZONE_INFO *sp)
#define SAVE_ENGINE(e) \
- "\"select ENGINE into @" e "_engine" \
+ "'select ENGINE into @" e "_engine" \
" from information_schema.TABLES" \
- " where TABLE_SCHEMA=DATABASE() and TABLE_NAME='" e "'\""
+ " where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''" e "'''"
/*
Print info about leap seconds in time zone as SQL statements
diff --git a/sql/wsrep_client_service.cc b/sql/wsrep_client_service.cc
index 628a408b49b..d3b4a18195b 100644
--- a/sql/wsrep_client_service.cc
+++ b/sql/wsrep_client_service.cc
@@ -374,8 +374,6 @@ int Wsrep_client_service::bf_rollback()
m_thd->global_read_lock.unlock_global_read_lock(m_thd);
}
m_thd->release_transactional_locks();
- mysql_ull_cleanup(m_thd);
- m_thd->mdl_context.release_explicit_locks();
}
DBUG_RETURN(ret);
diff --git a/sql/wsrep_high_priority_service.cc b/sql/wsrep_high_priority_service.cc
index 7d8296a75a1..53ef20f3e78 100644
--- a/sql/wsrep_high_priority_service.cc
+++ b/sql/wsrep_high_priority_service.cc
@@ -391,8 +391,6 @@ int Wsrep_high_priority_service::rollback(const wsrep::ws_handle& ws_handle,
m_thd->killed);
m_thd->release_transactional_locks();
- mysql_ull_cleanup(m_thd);
- m_thd->mdl_context.release_explicit_locks();
free_root(m_thd->mem_root, MYF(MY_KEEP_PREALLOC));
@@ -502,7 +500,13 @@ int Wsrep_high_priority_service::log_dummy_write_set(const wsrep::ws_handle& ws_
if (!WSREP_EMULATE_BINLOG(m_thd))
{
wsrep_register_for_group_commit(m_thd);
- ret = ret || cs.provider().commit_order_leave(ws_handle, ws_meta, err);
+ /* wait_for_prior_commit() ensures that all preceding transactions
+ have been committed and seqno has been synced into
+ storage engine. We don't release commit order here yet to
+ avoid following transactions to sync seqno before
+ wsrep_set_SE_checkpoint() below returns. This effectively pauses
+ group commit for the checkpoint operation, but is the only way to
+ ensure proper ordering. */
m_thd->wait_for_prior_commit();
}
@@ -512,10 +516,7 @@ int Wsrep_high_priority_service::log_dummy_write_set(const wsrep::ws_handle& ws_
{
wsrep_unregister_from_group_commit(m_thd);
}
- else
- {
- ret= ret || cs.provider().commit_order_leave(ws_handle, ws_meta, err);
- }
+ ret= ret || cs.provider().commit_order_leave(ws_handle, ws_meta, err);
cs.after_applying();
}
DBUG_RETURN(ret);
diff --git a/sql/wsrep_schema.cc b/sql/wsrep_schema.cc
index 3634d636e7c..443f3c4fcd2 100644
--- a/sql/wsrep_schema.cc
+++ b/sql/wsrep_schema.cc
@@ -1038,10 +1038,9 @@ int Wsrep_schema::append_fragment(THD* thd,
Wsrep_schema_impl::store(frag_table, 3, flags);
Wsrep_schema_impl::store(frag_table, 4, data.data(), data.size());
- int error;
- if ((error= Wsrep_schema_impl::insert(frag_table))) {
- WSREP_ERROR("Failed to write to frag table: %d", error);
+ if (Wsrep_schema_impl::insert(frag_table)) {
trans_rollback_stmt(thd);
+ close_thread_tables(thd);
thd->lex->restore_backup_query_tables_list(&query_tables_list_backup);
DBUG_RETURN(1);
}
diff --git a/sql/wsrep_thd.h b/sql/wsrep_thd.h
index 3d1bf3733a8..0ce612d6097 100644
--- a/sql/wsrep_thd.h
+++ b/sql/wsrep_thd.h
@@ -228,7 +228,14 @@ static inline void wsrep_override_error(THD* thd,
break;
case wsrep::e_append_fragment_error:
/* TODO: Figure out better error number */
- wsrep_override_error(thd, ER_ERROR_DURING_COMMIT, 0, status);
+ if (status)
+ wsrep_override_error(thd, ER_ERROR_DURING_COMMIT,
+ "Error while appending streaming replication fragment"
+ "(provider status: %s)",
+ wsrep::provider::to_string(status).c_str());
+ else
+ wsrep_override_error(thd, ER_ERROR_DURING_COMMIT,
+ "Error while appending streaming replication fragment");
break;
case wsrep::e_not_supported_error:
wsrep_override_error(thd, ER_NOT_SUPPORTED_YET);
diff --git a/sql/wsrep_trans_observer.h b/sql/wsrep_trans_observer.h
index 6ba14f96dd8..812452f451a 100644
--- a/sql/wsrep_trans_observer.h
+++ b/sql/wsrep_trans_observer.h
@@ -1,4 +1,4 @@
-/* Copyright 2016-2022 Codership Oy <http://www.codership.com>
+/* Copyright 2016-2023 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
@@ -217,6 +217,19 @@ static inline bool wsrep_run_commit_hook(THD* thd, bool all)
}
mysql_mutex_unlock(&thd->LOCK_thd_data);
}
+
+ mysql_mutex_lock(&thd->LOCK_thd_data);
+ /* Transaction creating sequence is TOI or RSU,
+ CREATE [TEMPORARY] SEQUENCE = CREATE + INSERT (initial value)
+ and replicated using statement based replication, thus
+ the commit hooks will be skipped */
+ if (ret &&
+ (thd->wsrep_cs().mode() == wsrep::client_state::m_toi ||
+ thd->wsrep_cs().mode() == wsrep::client_state::m_rsu) &&
+ thd->lex->sql_command == SQLCOM_CREATE_SEQUENCE)
+ ret= false;
+ mysql_mutex_unlock(&thd->LOCK_thd_data);
+
DBUG_PRINT("wsrep", ("return: %d", ret));
DBUG_RETURN(ret);
}
diff --git a/storage/connect/catalog.h b/storage/connect/catalog.h
index 2649a50cf76..a46615f5d6e 100644
--- a/storage/connect/catalog.h
+++ b/storage/connect/catalog.h
@@ -39,9 +39,9 @@ typedef struct _colinfo {
PCSZ Name;
int Type;
int Offset;
- int Length;
+ unsigned Length;
int Key;
- int Precision;
+ unsigned Precision;
int Scale;
int Opt;
int Freq;
diff --git a/storage/connect/mysql-test/connect/r/mysql.result b/storage/connect/mysql-test/connect/r/mysql.result
index d3c244b277a..1dcbca88a7b 100644
--- a/storage/connect/mysql-test/connect/r/mysql.result
+++ b/storage/connect/mysql-test/connect/r/mysql.result
@@ -364,5 +364,16 @@ hex(col)
DROP TABLE t2;
DROP TABLE t1;
#
+# MDEV-29782 CONNECT engine converted YEAR to DATETIME, causing INSERT to fail
+#
+CREATE TABLE t1 (id year);
+CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL DBNAME='test' TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT';
+INSERT INTO t2 VALUES (1999);
+SELECT * FROM t2;
+id
+1999
+DROP TABLE t2;
+DROP TABLE t1;
+#
# End of 10.3 tests
#
diff --git a/storage/connect/mysql-test/connect/t/mysql.test b/storage/connect/mysql-test/connect/t/mysql.test
index a50db4a6457..cd52f78fb30 100644
--- a/storage/connect/mysql-test/connect/t/mysql.test
+++ b/storage/connect/mysql-test/connect/t/mysql.test
@@ -534,5 +534,20 @@ DROP TABLE t1;
--echo #
+--echo # MDEV-29782 CONNECT engine converted YEAR to DATETIME, causing INSERT to fail
+--echo #
+
+CREATE TABLE t1 (id year);
+
+--replace_result $PORT PORT
+--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL DBNAME='test' TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
+
+INSERT INTO t2 VALUES (1999);
+SELECT * FROM t2;
+
+DROP TABLE t2;
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.3 tests
--echo #
diff --git a/storage/connect/myutil.cpp b/storage/connect/myutil.cpp
index c49db48bfb3..45b2c46e217 100644
--- a/storage/connect/myutil.cpp
+++ b/storage/connect/myutil.cpp
@@ -183,6 +183,7 @@ int MYSQLtoPLG(int mytype, char *var)
switch (mytype) {
case MYSQL_TYPE_SHORT:
+ case MYSQL_TYPE_YEAR:
type = TYPE_SHORT;
break;
case MYSQL_TYPE_LONG:
@@ -209,7 +210,6 @@ int MYSQLtoPLG(int mytype, char *var)
case MYSQL_TYPE_TIMESTAMP:
case MYSQL_TYPE_DATE:
case MYSQL_TYPE_DATETIME:
- case MYSQL_TYPE_YEAR:
case MYSQL_TYPE_TIME:
type = TYPE_DATE;
break;
diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp
index 114071b35fb..9af9faa333a 100644
--- a/storage/connect/reldef.cpp
+++ b/storage/connect/reldef.cpp
@@ -91,11 +91,11 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char* tab, char* db, bool info)
/* directories are used (to make this even remotely secure). */
/*********************************************************************/
if (check_valid_path(module, strlen(module))) {
- strcpy(g->Message, "Module cannot contain a path");
+ safe_strcpy(g->Message, sizeof(g->Message), "Module cannot contain a path");
return NULL;
}
else if (strlen(subtype)+1+3 >= sizeof(getname)) {
- strcpy(g->Message, "Subtype string too long");
+ safe_strcpy(g->Message, sizeof(g->Message), "Subtype string too long");
return NULL;
}
else
@@ -118,7 +118,8 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char* tab, char* db, bool info)
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0,
(LPTSTR)buf, sizeof(buf), NULL);
- strcat(strcat(g->Message, ": "), buf);
+ safe_strcat(g->Message, sizeof(g->Message), ": ");
+ safe_strcat(g->Message, sizeof(g->Message), buf);
return NULL;
} // endif hDll
@@ -281,7 +282,7 @@ char *RELDEF::GetStringCatInfo(PGLOBAL g, PCSZ what, PCSZ sdef)
if (IsFileType(GetTypeID(ftype))) {
name= Hc->GetPartName();
sval= (char*)PlugSubAlloc(g, NULL, strlen(name) + 12);
- strcat(strcpy(sval, name), ".");
+ snprintf(sval, strlen(name) + 12, "%s.", name);
n= strlen(sval);
// Fold ftype to lower case
@@ -623,12 +624,11 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g)
/* directories are used (to make this even remotely secure). */
/*********************************************************************/
if (check_valid_path(Module, strlen(Module))) {
- strcpy(g->Message, "Module cannot contain a path");
+ safe_strcpy(g->Message, sizeof(g->Message), "Module cannot contain a path");
return NULL;
} else
// PlugSetPath(soname, Module, GetPluginDir()); // Crashes on Fedora
- strncat(strcpy(soname, GetPluginDir()), Module,
- sizeof(soname) - strlen(soname) - 1);
+ snprintf(soname, sizeof(soname), "%s%s", GetPluginDir(), Module);
#if defined(_WIN32)
// Is the DLL already loaded?
@@ -642,7 +642,8 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g)
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0,
(LPTSTR)buf, sizeof(buf), NULL);
- strcat(strcat(g->Message, ": "), buf);
+ safe_strcat(g->Message, sizeof(g->Message), ": ");
+ safe_strcat(g->Message, sizeof(g->Message), buf);
return NULL;
} // endif hDll
@@ -662,7 +663,8 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g)
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0,
(LPTSTR)buf, sizeof(buf), NULL);
- strcat(strcat(g->Message, ": "), buf);
+ safe_strcat(g->Message, sizeof(g->Message), ": ");
+ safe_strcat(g->Message, sizeof(g->Message), buf);
FreeLibrary((HMODULE)Hdll);
return NULL;
} // endif getdef
@@ -811,7 +813,7 @@ PTDB OEMDEF::GetTable(PGLOBAL g, MODE mode)
else
txfp = new(g) ZLBFAM(defp);
#else // !GZ_SUPPORT
- strcpy(g->Message, "Compress not supported");
+ safe_strcpy(g->Message, sizeof(g->Message), "Compress not supported");
return NULL;
#endif // !GZ_SUPPORT
} else if (rfm == RECFM_VAR) {
@@ -834,7 +836,7 @@ PTDB OEMDEF::GetTable(PGLOBAL g, MODE mode)
else
txfp = new(g) VCTFAM((PVCTDEF)defp);
#else // !VCT_SUPPORT
- strcpy(g->Message, "VCT no more supported");
+ safe_strcpy(g->Message, sizeof(g->Message), "VCT no more supported");
return NULL;
#endif // !VCT_SUPPORT
} // endif's
@@ -925,7 +927,7 @@ int COLDEF::Define(PGLOBAL g, void *, PCOLINFO cfp, int poff)
return -1;
} // endswitch
- strcpy(F.Type, GetFormatType(Buf_Type));
+ safe_strcpy(F.Type, sizeof(F.Type), GetFormatType(Buf_Type));
F.Length = cfp->Length;
F.Prec = cfp->Scale;
Offset = (cfp->Offset < 0) ? poff : cfp->Offset;
diff --git a/storage/connect/tabbson.cpp b/storage/connect/tabbson.cpp
index 4cbb0e44e19..dfaf2284a72 100644
--- a/storage/connect/tabbson.cpp
+++ b/storage/connect/tabbson.cpp
@@ -39,6 +39,7 @@
#include "checklvl.h"
#include "resource.h"
#include "mycat.h" // for FNC_COL
+#include "m_string.h"
/***********************************************************************/
/* This should be an option. */
@@ -80,7 +81,7 @@ PQRYRES BSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info)
} // endif info
if (GetIntegerTableOption(g, topt, "Multiple", 0)) {
- strcpy(g->Message, "Cannot find column definition for multiple table");
+ safe_strcpy(g->Message, sizeof(g->Message), "Cannot find column definition for multiple table");
return NULL;
} // endif Multiple
@@ -206,7 +207,7 @@ int BSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
tdp->Uri = (dsn && *dsn ? dsn : NULL);
if (!tdp->Fn && !tdp->Uri) {
- strcpy(g->Message, MSG(MISSING_FNAME));
+ safe_strcpy(g->Message, sizeof(g->Message), MSG(MISSING_FNAME));
return 0;
} else
topt->subtype = NULL;
@@ -318,7 +319,7 @@ int BSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
switch (tjnp->ReadDB(g)) {
case RC_EF:
- strcpy(g->Message, "Void json table");
+ safe_strcpy(g->Message, sizeof(g->Message), "Void json table");
case RC_FX:
goto err;
default:
@@ -328,7 +329,7 @@ int BSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
} // endif pretty
if (!(row = (jsp) ? bp->GetObject(jsp) : NULL)) {
- strcpy(g->Message, "Can only retrieve columns from object rows");
+ safe_strcpy(g->Message, sizeof(g->Message), "Can only retrieve columns from object rows");
goto err;
} // endif row
@@ -405,7 +406,7 @@ bool BSONDISC::Find(PGLOBAL g, PBVAL jvp, PCSZ key, int j)
if (jvp && !bp->IsJson(jvp)) {
if (JsonAllPath() && !fmt[bf])
- strcat(fmt, colname);
+ safe_strcat(fmt, sizeof(fmt), colname);
jcol.Type = (JTYP)jvp->Type;
@@ -439,7 +440,7 @@ bool BSONDISC::Find(PGLOBAL g, PBVAL jvp, PCSZ key, int j)
jcol.Cbn = true;
} else if (j < lvl && !Stringified(strfy, colname)) {
if (!fmt[bf])
- strcat(fmt, colname);
+ safe_strcat(fmt, sizeof(fmt), colname);
p = fmt + strlen(fmt);
jsp = jvp;
@@ -510,11 +511,11 @@ bool BSONDISC::Find(PGLOBAL g, PBVAL jvp, PCSZ key, int j)
} else if (lvl >= 0) {
if (Stringified(strfy, colname)) {
if (!fmt[bf])
- strcat(fmt, colname);
+ safe_strcat(fmt, sizeof(fmt), colname);
- strcat(fmt, ".*");
+ safe_strcat(fmt, sizeof(fmt), ".*");
} else if (JsonAllPath() && !fmt[bf])
- strcat(fmt, colname);
+ safe_strcat(fmt, sizeof(fmt), colname);
jcol.Type = TYPE_STRG;
jcol.Len = sz;
@@ -961,7 +962,7 @@ PVAL BCUTIL::ExpandArray(PGLOBAL g, PBVAL arp, int n)
} // endif ars
if (!(bvp = GetArrayValue(arp, (nodes[n].Rx = nodes[n].Nx)))) {
- strcpy(g->Message, "Logical error expanding array");
+ safe_strcpy(g->Message, sizeof(g->Message), "Logical error expanding array");
throw 666;
} // endif jvp
@@ -1146,7 +1147,7 @@ PBVAL BCUTIL::GetRow(PGLOBAL g)
} else if (row->Type == TYPE_JAR) {
AddArrayValue(row, (nwr = NewVal(type)));
} else {
- strcpy(g->Message, "Wrong type when writing new row");
+ safe_strcpy(g->Message, sizeof(g->Message), "Wrong type when writing new row");
nwr = NULL;
} // endif's
@@ -1255,7 +1256,7 @@ PTDB BSONDEF::GetTable(PGLOBAL g, MODE m)
// Allocate the parse work memory
G = PlugInit(NULL, (size_t)Lrecl * (Pretty < 0 ? 3 : 5));
} else {
- strcpy(g->Message, "LRECL is not defined");
+ safe_strcpy(g->Message, sizeof(g->Message), "LRECL is not defined");
return NULL;
} // endif Lrecl
@@ -1295,7 +1296,7 @@ PTDB BSONDEF::GetTable(PGLOBAL g, MODE m)
} else if (m == MODE_INSERT) {
txfp = new(g) ZIPFAM(this);
} else {
- strcpy(g->Message, "UPDATE/DELETE not supported for ZIP");
+ safe_strcpy(g->Message, sizeof(g->Message), "UPDATE/DELETE not supported for ZIP");
return NULL;
} // endif's m
#else // !ZIP_SUPPORT
@@ -1325,10 +1326,10 @@ PTDB BSONDEF::GetTable(PGLOBAL g, MODE m)
if (m == MODE_READ || m == MODE_ANY || m == MODE_ALTER) {
txfp = new(g) UNZFAM(this);
} else if (m == MODE_INSERT) {
- strcpy(g->Message, "INSERT supported only for zipped JSON when pretty=0");
+ safe_strcpy(g->Message, sizeof(g->Message), "INSERT supported only for zipped JSON when pretty=0");
return NULL;
} else {
- strcpy(g->Message, "UPDATE/DELETE not supported for ZIP");
+ safe_strcpy(g->Message, sizeof(g->Message), "UPDATE/DELETE not supported for ZIP");
return NULL;
} // endif's m
#else // !ZIP_SUPPORT
@@ -1661,7 +1662,7 @@ bool TDBBSN::PrepareWriting(PGLOBAL g)
strcat(s, ",");
if ((signed)strlen(s) > Lrecl) {
- strncpy(To_Line, s, Lrecl);
+ safe_strcpy(To_Line, Lrecl, s);
snprintf(g->Message, sizeof(g->Message), "Line truncated (lrecl=%d)", Lrecl);
return PushWarning(g, this);
} else
@@ -1764,7 +1765,7 @@ bool BSONCOL::CheckExpand(PGLOBAL g, int i, PSZ nm, bool b)
Xpd = true; // Expandable object
Nodes[i].Op = OP_EXP;
} else if (b) {
- strcpy(g->Message, "Cannot expand more than one branch");
+ safe_strcpy(g->Message, sizeof(g->Message), "Cannot expand more than one branch");
return true;
} // endif Xcol
@@ -1975,7 +1976,7 @@ bool BSONCOL::ParseJpath(PGLOBAL g)
if (SetArrayOptions(g, p, i, Nodes[i - 1].Key))
return true;
else if (Xpd && Tbp->Mode == MODE_DELETE) {
- strcpy(g->Message, "Cannot delete expanded columns");
+ safe_strcpy(g->Message, sizeof(g->Message), "Cannot delete expanded columns");
return true;
} // endif Xpd
@@ -2098,7 +2099,7 @@ void BSONCOL::ReadColumn(PGLOBAL g)
void BSONCOL::WriteColumn(PGLOBAL g)
{
if (Xpd && Tbp->Pretty < 2) {
- strcpy(g->Message, "Cannot write expanded column when Pretty is not 2");
+ safe_strcpy(g->Message, sizeof(g->Message), "Cannot write expanded column when Pretty is not 2");
throw 666;
} // endif Xpd
@@ -2128,7 +2129,7 @@ void BSONCOL::WriteColumn(PGLOBAL g)
char *s = Value->GetCharValue();
if (!(jsp = Cp->ParseJson(g, s, strlen(s)))) {
- strcpy(g->Message, s);
+ safe_strcpy(g->Message, sizeof(g->Message), s);
throw 666;
} // endif jsp
@@ -2314,7 +2315,7 @@ int TDBBSON::MakeDocument(PGLOBAL g)
if (!a && *p && *p != '[' && !IsNum(p)) {
// obj is a key
if (jsp->Type != TYPE_JOB) {
- strcpy(g->Message, "Table path does not match the json file");
+ safe_strcpy(g->Message, sizeof(g->Message), "Table path does not match the json file");
return RC_FX;
} // endif Type
@@ -2340,7 +2341,7 @@ int TDBBSON::MakeDocument(PGLOBAL g)
} // endif p
if (jsp->Type != TYPE_JAR) {
- strcpy(g->Message, "Table path does not match the json file");
+ safe_strcpy(g->Message, sizeof(g->Message), "Table path does not match the json file");
return RC_FX;
} // endif Type
@@ -2434,7 +2435,7 @@ void TDBBSON::ResetSize(void)
int TDBBSON::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool)
{
if (pxdf) {
- strcpy(g->Message, "JSON not indexable when pretty = 2");
+ safe_strcpy(g->Message, sizeof(g->Message), "JSON not indexable when pretty = 2");
return RC_FX;
} else
return RC_OK;
diff --git a/storage/connect/tabdos.cpp b/storage/connect/tabdos.cpp
index 62eecb5e69e..0fdc182f6df 100644
--- a/storage/connect/tabdos.cpp
+++ b/storage/connect/tabdos.cpp
@@ -62,6 +62,7 @@
#include "tabmul.h"
#include "array.h"
#include "blkfil.h"
+#include "m_string.h"
/***********************************************************************/
/* DB static variables. */
@@ -258,7 +259,7 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf)
sep = GetBoolCatInfo("SepIndex", false);
if (!sep && pxdf) {
- strcpy(g->Message, MSG(NO_RECOV_SPACE));
+ safe_strcpy(g->Message, sizeof(g->Message), MSG(NO_RECOV_SPACE));
return true;
} // endif sep
@@ -293,7 +294,8 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf)
for (; pxdf; pxdf = pxdf->GetNext()) {
_splitpath(Ofn, drive, direc, fname, NULL);
- strcat(strcat(fname, "_"), pxdf->GetName());
+ safe_strcat(fname, sizeof(fname), "_");
+ safe_strcat(fname, sizeof(fname), pxdf->GetName());
_makepath(filename, drive, direc, fname, ftype);
PlugSetPath(filename, filename, GetPath());
#if defined(_WIN32)
@@ -312,7 +314,7 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf)
} else { // !sep
// Drop all indexes, delete the common file
PlugSetPath(filename, Ofn, GetPath());
- strcat(PlugRemoveType(filename, filename), ftype);
+ safe_strcat(PlugRemoveType(filename, filename), sizeof(filename), ftype);
#if defined(_WIN32)
if (!DeleteFile(filename))
rc = (GetLastError() != ERROR_FILE_NOT_FOUND);
@@ -365,7 +367,7 @@ PTDB DOSDEF::GetTable(PGLOBAL g, MODE mode)
if (mode == MODE_READ || mode == MODE_ANY || mode == MODE_ALTER) {
txfp = new(g) UZDFAM(this);
} else {
- strcpy(g->Message, "Zipped DBF tables are read only");
+ safe_strcpy(g->Message, sizeof(g->Message), "Zipped DBF tables are read only");
return NULL;
} // endif's mode
@@ -386,7 +388,7 @@ PTDB DOSDEF::GetTable(PGLOBAL g, MODE mode)
} else if (mode == MODE_INSERT) {
txfp = new(g) ZIPFAM(this);
} else {
- strcpy(g->Message, "UPDATE/DELETE not supported for ZIP");
+ safe_strcpy(g->Message, sizeof(g->Message), "UPDATE/DELETE not supported for ZIP");
return NULL;
} // endif's mode
@@ -397,7 +399,7 @@ PTDB DOSDEF::GetTable(PGLOBAL g, MODE mode)
} else if (mode == MODE_INSERT) {
txfp = new(g) ZPXFAM(this);
} else {
- strcpy(g->Message, "UPDATE/DELETE not supported for ZIP");
+ safe_strcpy(g->Message, sizeof(g->Message), "UPDATE/DELETE not supported for ZIP");
return NULL;
} // endif's mode
@@ -655,7 +657,7 @@ int TDBDOS::MakeBlockValues(PGLOBAL g)
if ((nrec = defp->GetElemt()) < 2) {
if (!To_Def->Partitioned()) {
// This may be wrong to do in some cases
- strcpy(g->Message, MSG(TABLE_NOT_OPT));
+ safe_strcpy(g->Message, sizeof(g->Message), MSG(TABLE_NOT_OPT));
return RC_INFO; // Not to be optimized
} else
return RC_OK;
@@ -675,7 +677,7 @@ int TDBDOS::MakeBlockValues(PGLOBAL g)
if ((block = (int)((MaxSize + (int)nrec - 1) / (int)nrec)) < 2) {
// This may be wrong to do in some cases
defp->RemoveOptValues(g);
- strcpy(g->Message, MSG(TABLE_NOT_OPT));
+ safe_strcpy(g->Message, sizeof(g->Message), MSG(TABLE_NOT_OPT));
return RC_INFO; // Not to be optimized
} // endif block
@@ -758,7 +760,7 @@ int TDBDOS::MakeBlockValues(PGLOBAL g)
// No optimised columns. Still useful for blocked variable tables.
if (!colp && defp->Recfm != RECFM_VAR) {
- strcpy(g->Message, "No optimised columns");
+ safe_strcpy(g->Message, sizeof(g->Message), "No optimised columns");
return RC_INFO;
} // endif colp
@@ -788,7 +790,8 @@ int TDBDOS::MakeBlockValues(PGLOBAL g)
/*********************************************************************/
char *p = (char *)PlugSubAlloc(g, NULL, 24 + strlen(Name));
- dup->Step = strcat(strcpy(p, MSG(OPTIMIZING)), Name);
+ snprintf(p, 24 + strlen(Name), "%s%s", MSG(OPTIMIZING), Name);
+ dup->Step = p;
dup->ProgMax = GetProgMax(g);
dup->ProgCur = 0;
#endif // SOCKET_MODE || THREAD
@@ -805,7 +808,7 @@ int TDBDOS::MakeBlockValues(PGLOBAL g)
} else {
if (++curnum >= nrec) {
if (++curblk >= block) {
- strcpy(g->Message, MSG(BAD_BLK_ESTIM));
+ safe_strcpy(g->Message, sizeof(g->Message), MSG(BAD_BLK_ESTIM));
goto err;
} else
curnum = 0;
@@ -833,7 +836,7 @@ int TDBDOS::MakeBlockValues(PGLOBAL g)
#if defined(PROG_INFO)
if (!dup->Step) {
- strcpy(g->Message, MSG(OPT_CANCELLED));
+ safe_strcpy(g->Message, sizeof(g->Message), MSG(OPT_CANCELLED));
goto err;
} else
dup->ProgCur = GetProgCur();
@@ -913,7 +916,8 @@ bool TDBDOS::SaveBlockValues(PGLOBAL g)
if (!(opfile = fopen(filename, "wb"))) {
snprintf(g->Message, sizeof(g->Message), MSG(OPEN_MODE_ERROR),
"wb", (int)errno, filename);
- strcat(strcat(g->Message, ": "), strerror(errno));
+ safe_strcat(g->Message, sizeof(g->Message), ": ");
+ safe_strcat(g->Message, sizeof(g->Message), strerror(errno));
if (trace(1))
htrc("%s\n", g->Message);
@@ -1230,7 +1234,8 @@ bool TDBDOS::GetDistinctColumnValues(PGLOBAL g, int nrec)
/* Initialize progress information */
/*********************************************************************/
p = (char *)PlugSubAlloc(g, NULL, 48 + strlen(Name));
- dup->Step = strcat(strcpy(p, MSG(GET_DIST_VALS)), Name);
+ snprintf(p, 48 + strlen(Name), "%s%s", MSG(GET_DIST_VALS), Name);
+ dup->Step = p;
dup->ProgMax = GetProgMax(g);
dup->ProgCur = 0;
@@ -1242,12 +1247,12 @@ bool TDBDOS::GetDistinctColumnValues(PGLOBAL g, int nrec)
#if defined(SOCKET_MODE)
if (SendProgress(dup)) {
- strcpy(g->Message, MSG(OPT_CANCELLED));
+ safe_strcpy(g->Message, sizeof(g->Message), MSG(OPT_CANCELLED));
return true;
} else
#elif defined(THREAD)
if (!dup->Step) {
- strcpy(g->Message, MSG(OPT_CANCELLED));
+ safe_strcpy(g->Message, sizeof(g->Message), MSG(OPT_CANCELLED));
return true;
} else
#endif // THREAD
@@ -1528,7 +1533,7 @@ PBF TDBDOS::CheckBlockFilari(PGLOBAL g, PXOB *arg, int op, bool *cnv)
} else if (n == 8 || n == 14) {
if (n == 8 && ctype != TYPE_LIST) {
// Should never happen
- strcpy(g->Message, "Block opt: bad constant");
+ safe_strcpy(g->Message, sizeof(g->Message), "Block opt: bad constant");
throw 99;
} // endif Conv
@@ -1686,7 +1691,7 @@ int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add)
// Are we are called from CreateTable or CreateIndex?
if (pxdf) {
if (!add && dfp->GetIndx()) {
- strcpy(g->Message, MSG(INDX_EXIST_YET));
+ safe_strcpy(g->Message, sizeof(g->Message), MSG(INDX_EXIST_YET));
return RC_FX;
} // endif To_Indx
@@ -1798,7 +1803,7 @@ int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add)
htrc("Exception %d: %s\n", n, g->Message);
rc = RC_FX;
} catch (const char *msg) {
- strcpy(g->Message, msg);
+ safe_strcpy(g->Message, sizeof(g->Message), msg);
rc = RC_FX;
} // end catch
@@ -1832,7 +1837,7 @@ bool TDBDOS::InitialyzeIndex(PGLOBAL g, volatile PIXDEF xdp, bool sorted)
PKPDEF kdp;
if (!xdp && !(xdp = To_Xdp)) {
- strcpy(g->Message, "NULL dynamic index");
+ safe_strcpy(g->Message, sizeof(g->Message), "NULL dynamic index");
return true;
} else
dynamic = To_Filter && xdp->IsUnique() && xdp->IsDynamic();
@@ -1921,7 +1926,7 @@ bool TDBDOS::InitialyzeIndex(PGLOBAL g, volatile PIXDEF xdp, bool sorted)
htrc("Exception %d: %s\n", n, g->Message);
brc = true;
} catch (const char *msg) {
- strcpy(g->Message, msg);
+ safe_strcpy(g->Message, sizeof(g->Message), msg);
brc = true;
} // end catch
@@ -2682,38 +2687,38 @@ void DOSCOL::WriteColumn(PGLOBAL g)
if (Ldz || Nod || Dcm >= 0) {
switch (Buf_Type) {
case TYPE_SHORT:
- strcpy(fmt, (Ldz) ? "%0*hd" : "%*.hd");
+ safe_strcpy(fmt, sizeof(fmt), (Ldz) ? "%0*hd" : "%*.hd");
i = 0;
if (Nod)
for (; i < Dcm; i++)
- strcat(fmt, "0");
+ safe_strcat(fmt, sizeof(fmt), "0");
len = sprintf(Buf, fmt, field - i, Value->GetShortValue());
break;
case TYPE_INT:
- strcpy(fmt, (Ldz) ? "%0*d" : "%*.d");
+ safe_strcpy(fmt, sizeof(fmt), (Ldz) ? "%0*d" : "%*.d");
i = 0;
if (Nod)
for (; i < Dcm; i++)
- strcat(fmt, "0");
+ safe_strcat(fmt,sizeof(fmt), "0");
len = sprintf(Buf, fmt, field - i, Value->GetIntValue());
break;
case TYPE_TINY:
- strcpy(fmt, (Ldz) ? "%0*d" : "%*.d");
+ safe_strcpy(fmt, sizeof(fmt), (Ldz) ? "%0*d" : "%*.d");
i = 0;
if (Nod)
for (; i < Dcm; i++)
- strcat(fmt, "0");
+ safe_strcat(fmt, sizeof(fmt), "0");
len = sprintf(Buf, fmt, field - i, Value->GetTinyValue());
break;
case TYPE_DOUBLE:
case TYPE_DECIM:
- strcpy(fmt, (Ldz) ? "%0*.*lf" : "%*.*lf");
+ safe_strcpy(fmt, sizeof(fmt), (Ldz) ? "%0*.*lf" : "%*.*lf");
len = field + ((Nod && Dcm) ? 1 : 0);
snprintf(Buf, len + 1, fmt, len, Dcm, Value->GetFloatValue());
len = strlen(Buf);
diff --git a/storage/connect/tabext.cpp b/storage/connect/tabext.cpp
index 6ece7115ea5..f558cb04f4d 100644
--- a/storage/connect/tabext.cpp
+++ b/storage/connect/tabext.cpp
@@ -65,7 +65,7 @@ int CONDFIL::Init(PGLOBAL g, PHC hc)
while (alt) {
if (!(p = strchr(alt, '='))) {
- strcpy(g->Message, "Invalid alias list");
+ safe_strcpy(g->Message, sizeof(g->Message), "Invalid alias list");
rc = RC_FX;
break;
} // endif !p
@@ -126,7 +126,7 @@ EXTDEF::EXTDEF(void)
bool EXTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
{
if (g->Createas) {
- strcpy(g->Message,
+ safe_strcpy(g->Message, sizeof(g->Message),
"Multiple-table UPDATE/DELETE commands are not supported");
return true;
} // endif multi
@@ -349,7 +349,7 @@ bool TDBEXT::MakeSrcdef(PGLOBAL g)
int n_placeholders = count_placeholders(Srcdef);
if (n_placeholders < 0)
{
- strcpy(g->Message, "MakeSQL: Wrong place holders specification");
+ safe_strcpy(g->Message, sizeof(g->Message), "MakeSQL: Wrong place holders specification");
return true;
}
@@ -372,7 +372,7 @@ bool TDBEXT::MakeSrcdef(PGLOBAL g)
Query = new(g)STRING(g, strlen(Srcdef) + strlen(fil1) + strlen(fil2));
Query->SetLength(sprintf(Query->GetStr(), Srcdef, fil2, fil1));
} else {
- strcpy(g->Message, "MakeSQL: Wrong place holders specification");
+ safe_strcpy(g->Message, sizeof(g->Message), "MakeSQL: Wrong place holders specification");
return true;
} // endif's ph
@@ -466,7 +466,7 @@ bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt)
if (Quote) {
// Tabname can have both database and table identifiers, we need to parse
- if ((res= strstr(buf, ".")))
+ if ((res= strstr(buf, ".")))
{
// Parse schema
my_len= res - buf + 1;
@@ -513,7 +513,7 @@ bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt)
len += ((Mode == MODE_READX) ? 256 : 1);
if (Query->IsTruncated()) {
- strcpy(g->Message, "MakeSQL: Out of memory");
+ safe_strcpy(g->Message, sizeof(g->Message), "MakeSQL: Out of memory");
return true;
} else
Query->Resize(len);
@@ -574,6 +574,7 @@ bool TDBEXT::MakeCommand(PGLOBAL g)
bool qtd = Quoted > 0;
char q = qtd ? *Quote : ' ';
int i = 0, k = 0;
+ size_t stmt_sz = 0;
// Make a lower case copy of the originale query and change
// back ticks to the data source identifier quoting character
@@ -585,26 +586,30 @@ bool TDBEXT::MakeCommand(PGLOBAL g)
p[7] = 0; // Remove where clause
Qrystr[(p - qrystr) + 7] = 0;
body = To_CondFil->Body;
- stmt = (char*)PlugSubAlloc(g, NULL, strlen(qrystr)
- + strlen(body) + 64);
+ stmt_sz = strlen(qrystr) + strlen(body) + 64;
} else
- stmt = (char*)PlugSubAlloc(g, NULL, strlen(Qrystr) + 64);
+ stmt_sz = strlen(Qrystr) + 64;
+ stmt = (char*)PlugSubAlloc(g, NULL, stmt_sz);
// Check whether the table name is equal to a keyword
// If so, it must be quoted in the original query
- strlwr(strcat(strcat(strcpy(name, " "), Name), " "));
+ snprintf(name, sizeof(name), " %s ", Name);
+ strlwr(name);
if (strstr(" update delete low_priority ignore quick from ", name)) {
if (Quote) {
- strlwr(strcat(strcat(strcpy(name, Quote), Name), Quote));
+ snprintf(name, sizeof(name), "%s%s%s", Quote, Name, Quote);
+ strlwr(name);
k += 2;
} else {
- strcpy(g->Message, "Quoted must be specified");
+ safe_strcpy(g->Message, sizeof(g->Message), "Quoted must be specified");
return true;
} // endif Quote
- } else
- strlwr(strcpy(name, Name)); // Not a keyword
+ } else {
+ safe_strcpy(name, sizeof(name), Name); // Not a keyword
+ strlwr(name);
+ }
if ((p = strstr(qrystr, name))) {
for (i = 0; i < p - qrystr; i++)
@@ -618,21 +623,29 @@ bool TDBEXT::MakeCommand(PGLOBAL g)
schmp = Schema;
if (qtd && *(p - 1) == ' ') {
- if (schmp)
- strcat(strcat(stmt, schmp), ".");
+ if (schmp) {
+ safe_strcat(stmt, stmt_sz, schmp);
+ safe_strcat(stmt, stmt_sz, ".");
+ }
- strcat(strcat(strcat(stmt, Quote), TableName), Quote);
+ safe_strcat(stmt, stmt_sz, Quote);
+ safe_strcat(stmt, stmt_sz, TableName);
+ safe_strcat(stmt, stmt_sz, Quote);
} else {
if (schmp) {
if (qtd && *(p - 1) != ' ') {
stmt[i - 1] = 0;
- strcat(strcat(strcat(stmt, schmp), "."), Quote);
- } else
- strcat(strcat(stmt, schmp), ".");
+ safe_strcat(stmt, stmt_sz, schmp);
+ safe_strcat(stmt, stmt_sz, ".");
+ safe_strcat(stmt, stmt_sz, Quote);
+ } else {
+ safe_strcat(stmt, stmt_sz, schmp);
+ safe_strcat(stmt, stmt_sz, ".");
+ }
} // endif schmp
- strcat(stmt, TableName);
+ safe_strcat(stmt, stmt_sz, TableName);
} // endif's
i = (int)strlen(stmt);
@@ -644,7 +657,7 @@ bool TDBEXT::MakeCommand(PGLOBAL g)
RemoveConst(g, stmt);
if (body)
- strcat(stmt, body);
+ safe_strcat(stmt, stmt_sz, body);
} else {
snprintf(g->Message, sizeof(g->Message), "Cannot use this %s command",
diff --git a/storage/connect/tabfmt.cpp b/storage/connect/tabfmt.cpp
index 7edffc638fa..037a465af13 100644
--- a/storage/connect/tabfmt.cpp
+++ b/storage/connect/tabfmt.cpp
@@ -62,6 +62,7 @@
#define NO_FUNC
#include "plgcnx.h" // For DB types
#include "resource.h"
+#include "m_string.h"
/***********************************************************************/
/* This should be an option. */
@@ -137,7 +138,7 @@ PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, bool info)
? strchr(tdp->Entry, '*') || strchr(tdp->Entry, '?')
: GetBooleanTableOption(g, topt, "Mulentries", false);
#else // !ZIP_SUPPORT
- strcpy(g->Message, "ZIP not supported by this version");
+ safe_strcpy(g->Message, sizeof(g->Message), "ZIP not supported by this version");
return NULL;
#endif // !ZIP_SUPPORT
} // endif // Zipped
@@ -145,7 +146,7 @@ PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, bool info)
fn = tdp->Fn = GetStringTableOption(g, topt, "Filename", NULL);
if (!tdp->Fn) {
- strcpy(g->Message, MSG(MISSING_FNAME));
+ safe_strcpy(g->Message, sizeof(g->Message), MSG(MISSING_FNAME));
return NULL;
} // endif Fn
@@ -472,7 +473,7 @@ bool CSVDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
if (Catfunc == FNC_NO)
for (PCOLDEF cdp = To_Cols; cdp; cdp = cdp->GetNext())
if (cdp->GetOffset() < 1 && !cdp->IsSpecial()) {
- strcpy(g->Message, MSG(BAD_OFFSET_VAL));
+ safe_strcpy(g->Message, sizeof(g->Message), MSG(BAD_OFFSET_VAL));
return true;
} // endif Offset
@@ -528,11 +529,11 @@ PTDB CSVDEF::GetTable(PGLOBAL g, MODE mode)
} else if (mode == MODE_INSERT) {
txfp = new(g) ZIPFAM(this);
} else {
- strcpy(g->Message, "UPDATE/DELETE not supported for ZIP");
+ safe_strcpy(g->Message, sizeof(g->Message), "UPDATE/DELETE not supported for ZIP");
return NULL;
} // endif's mode
#else // !ZIP_SUPPORT
- strcpy(g->Message, "ZIP not supported");
+ safe_strcpy(g->Message, sizeof(g->Message), "ZIP not supported");
return NULL;
#endif // !ZIP_SUPPORT
} else if (map) {
@@ -546,7 +547,7 @@ PTDB CSVDEF::GetTable(PGLOBAL g, MODE mode)
txfp = new(g) ZLBFAM(this);
#else // !GZ_SUPPORT
- strcpy(g->Message, "Compress not supported");
+ safe_strcpy(g->Message, sizeof(g->Message), "Compress not supported");
return NULL;
#endif // !GZ_SUPPORT
} else
@@ -878,7 +879,7 @@ bool TDBCSV::SkipHeader(PGLOBAL g)
if (q)
To_Line[strlen(To_Line)] = Qot;
- strcat(To_Line, cdp->GetName());
+ safe_strcat(To_Line, Lrecl, cdp->GetName());
if (q)
To_Line[strlen(To_Line)] = Qot;
@@ -1048,14 +1049,16 @@ bool TDBCSV::PrepareWriting(PGLOBAL g)
for (i = 0; i < Fields; i++) {
if (i)
- strcat(To_Line, sep);
+ safe_strcat(To_Line, Lrecl, sep);
if (Field[i]) {
if (!strlen(Field[i])) {
// Generally null fields are not quoted
- if (Quoted > 2)
+ if (Quoted > 2) {
// Except if explicitly required
- strcat(strcat(To_Line, qot), qot);
+ safe_strcat(To_Line, Lrecl, qot);
+ safe_strcat(To_Line, Lrecl, qot);
+ }
} else if (Qot && (strchr(Field[i], Sep) || *Field[i] == Qot
|| Quoted > 1 || (Quoted == 1 && !Fldtyp[i]))) {
@@ -1074,12 +1077,15 @@ bool TDBCSV::PrepareWriting(PGLOBAL g)
To_Line[k++] = Qot;
To_Line[k] = '\0';
- } else
- strcat(strcat(strcat(To_Line, qot), Field[i]), qot);
+ } else {
+ safe_strcat(To_Line, Lrecl, qot);
+ safe_strcat(To_Line, Lrecl, Field[i]);
+ safe_strcat(To_Line, Lrecl, qot);
+ }
}
else
- strcat(To_Line, Field[i]);
+ safe_strcat(To_Line, Lrecl, Field[i]);
}
} // endfor i
@@ -1156,7 +1162,7 @@ int TDBCSV::CheckWrite(PGLOBAL g)
} // endif
}
if ((nlen += n) > maxlen) {
- strcpy(g->Message, MSG(LINE_TOO_LONG));
+ safe_strcpy(g->Message, sizeof(g->Message), MSG(LINE_TOO_LONG));
return -1;
} // endif nlen
@@ -1266,7 +1272,7 @@ bool TDBFMT::OpenDB(PGLOBAL g)
} // endif n
FldFormat[i] = (PSZ)PlugSubAlloc(g, NULL, n + 5);
- strcpy(FldFormat[i], pfm);
+ safe_strcpy(FldFormat[i], n + 5, pfm);
if (!strcmp(pfm + n, "%m")) {
// This is a field that can be missing. Flag it so it can
@@ -1276,7 +1282,7 @@ bool TDBFMT::OpenDB(PGLOBAL g)
} else if (i+1 < Fields && strcmp(pfm + n, "%n")) {
// There are trailing characters after the field contents
// add a marker for the next field start position.
- strcat(FldFormat[i], "%n");
+ safe_strcat(FldFormat[i], n + 5, "%n");
FmtTest[i] = 1;
} // endif's
diff --git a/storage/connect/tabjdbc.cpp b/storage/connect/tabjdbc.cpp
index 46fb7695a51..0242832b02f 100644
--- a/storage/connect/tabjdbc.cpp
+++ b/storage/connect/tabjdbc.cpp
@@ -277,7 +277,7 @@ PTDB JDBCDEF::GetTable(PGLOBAL g, MODE m)
if (Multiple == 1)
tdbp = new(g)TDBMUL(tdbp);
else if (Multiple == 2)
- strcpy(g->Message, "NO_JDBC_MUL");
+ safe_strcpy(g->Message, sizeof(g->Message), "NO_JDBC_MUL");
} // endswitch Catfunc
@@ -386,7 +386,7 @@ bool TDBJDBC::MakeInsert(PGLOBAL g)
for (colp = Columns; colp; colp = colp->GetNext())
if (colp->IsSpecial()) {
- strcpy(g->Message, "No JDBC special columns");
+ safe_strcpy(g->Message, sizeof(g->Message), "No JDBC special columns");
return true;
} else {
// Column name can be encoded in UTF-8
@@ -460,7 +460,7 @@ bool TDBJDBC::MakeInsert(PGLOBAL g)
} // endfor colp
if ((Query->Append(") VALUES ("))) {
- strcpy(g->Message, "MakeInsert: Out of memory");
+ safe_strcpy(g->Message, sizeof(g->Message), "MakeInsert: Out of memory");
return true;
} else // in case prepared statement fails
pos = Query->GetLength();
@@ -470,7 +470,7 @@ bool TDBJDBC::MakeInsert(PGLOBAL g)
Query->Append("?,");
if (Query->IsTruncated()) {
- strcpy(g->Message, "MakeInsert: Out of memory");
+ safe_strcpy(g->Message, sizeof(g->Message), "MakeInsert: Out of memory");
return true;
} else
Query->RepLast(')');
@@ -532,12 +532,15 @@ int TDBJDBC::Cardinality(PGLOBAL g)
// Table name can be encoded in UTF-8
Decode(TableName, tbn, sizeof(tbn));
- strcpy(qry, "SELECT COUNT(*) FROM ");
+ safe_strcpy(qry, sizeof(qry), "SELECT COUNT(*) FROM ");
- if (Quote)
- strcat(strcat(strcat(qry, Quote), tbn), Quote);
+ if (Quote) {
+ safe_strcat(qry, sizeof(qry), Quote);
+ safe_strcat(qry, sizeof(qry), tbn);
+ safe_strcat(qry, sizeof(qry), Quote);
+ }
else
- strcat(qry, tbn);
+ safe_strcat(qry, sizeof(qry), tbn);
// Allocate a Count(*) column (must not use the default constructor)
Cnp = new(g)JDBCCOL;
@@ -656,7 +659,7 @@ bool TDBJDBC::OpenDB(PGLOBAL g)
if ((Qrp = Jcp->AllocateResult(g, this)))
Memory = 2; // Must be filled
else {
- strcpy(g->Message, "Result set memory allocation failed");
+ safe_strcpy(g->Message, sizeof(g->Message), "Result set memory allocation failed");
return true;
} // endif n
@@ -683,7 +686,7 @@ bool TDBJDBC::OpenDB(PGLOBAL g)
#if 0
if (!(rc = MakeInsert(g))) {
if (Nparm != Jcp->PrepareSQL(Query->GetStr())) {
- strcpy(g->Message, MSG(PARM_CNT_MISS));
+ safe_strcpy(g->Message, sizeof(g->Message), MSG(PARM_CNT_MISS));
rc = true;
} else
rc = BindParameters(g);
@@ -735,12 +738,12 @@ bool TDBJDBC::SetRecpos(PGLOBAL g, int recpos)
CurNum = recpos;
Fpos = recpos;
} else {
- strcpy(g->Message, "Scrolling out of row set NIY");
+ safe_strcpy(g->Message, sizeof(g->Message), "Scrolling out of row set NIY");
return true;
} // endif recpos
} else {
- strcpy(g->Message, "This action requires a scrollable cursor");
+ safe_strcpy(g->Message, sizeof(g->Message), "This action requires a scrollable cursor");
return true;
} // endif's
@@ -786,7 +789,7 @@ bool TDBJDBC::ReadKey(PGLOBAL g, OPVAL op, const key_range *kr)
if (To_CondFil)
if (Query->Append(" AND ") || Query->Append(To_CondFil->Body)) {
- strcpy(g->Message, "Readkey: Out of memory");
+ safe_strcpy(g->Message, sizeof(g->Message), "Readkey: Out of memory");
return true;
} // endif Append
@@ -919,7 +922,7 @@ int TDBJDBC::WriteDB(PGLOBAL g)
} // endfor colp
if (unlikely(Query->IsTruncated())) {
- strcpy(g->Message, "WriteDB: Out of memory");
+ safe_strcpy(g->Message, sizeof(g->Message), "WriteDB: Out of memory");
return RC_FX;
} // endif Query
@@ -1112,13 +1115,13 @@ PCMD TDBXJDC::MakeCMD(PGLOBAL g)
(To_CondFil->Op == OP_EQ || To_CondFil->Op == OP_IN)) {
xcmd = To_CondFil->Cmds;
} else
- strcpy(g->Message, "Invalid command specification filter");
+ safe_strcpy(g->Message, sizeof(g->Message), "Invalid command specification filter");
} else
- strcpy(g->Message, "No command column in select list");
+ safe_strcpy(g->Message, sizeof(g->Message), "No command column in select list");
} else if (!Srcdef)
- strcpy(g->Message, "No Srcdef default command");
+ safe_strcpy(g->Message, sizeof(g->Message), "No Srcdef default command");
else
xcmd = new(g) CMD(g, Srcdef);
@@ -1149,7 +1152,7 @@ bool TDBXJDC::OpenDB(PGLOBAL g)
this, Tdb_No, Use, Mode);
if (Use == USE_OPEN) {
- strcpy(g->Message, "Multiple execution is not allowed");
+ safe_strcpy(g->Message, sizeof(g->Message), "Multiple execution is not allowed");
return true;
} // endif use
@@ -1171,7 +1174,7 @@ bool TDBXJDC::OpenDB(PGLOBAL g)
Use = USE_OPEN; // Do it now in case we are recursively called
if (Mode != MODE_READ && Mode != MODE_READX) {
- strcpy(g->Message, "No INSERT/DELETE/UPDATE of XJDBC tables");
+ safe_strcpy(g->Message, sizeof(g->Message), "No INSERT/DELETE/UPDATE of XJDBC tables");
return true;
} // endif Mode
@@ -1224,7 +1227,7 @@ int TDBXJDC::ReadDB(PGLOBAL g)
/***********************************************************************/
int TDBXJDC::WriteDB(PGLOBAL g)
{
- strcpy(g->Message, "Execsrc tables are read only");
+ safe_strcpy(g->Message, sizeof(g->Message), "Execsrc tables are read only");
return RC_FX;
} // end of DeleteDB
@@ -1233,7 +1236,7 @@ int TDBXJDC::WriteDB(PGLOBAL g)
/***********************************************************************/
int TDBXJDC::DeleteDB(PGLOBAL g, int irc)
{
- strcpy(g->Message, "NO_XJDBC_DELETE");
+ safe_strcpy(g->Message, sizeof(g->Message), "NO_XJDBC_DELETE");
return RC_FX;
} // end of DeleteDB
diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp
index 968253ec8d1..27bdfee5f35 100644
--- a/storage/connect/tabjson.cpp
+++ b/storage/connect/tabjson.cpp
@@ -85,7 +85,7 @@ PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info)
} // endif info
if (GetIntegerTableOption(g, topt, "Multiple", 0)) {
- strcpy(g->Message, "Cannot find column definition for multiple table");
+ safe_strcpy(g->Message, sizeof(g->Message), "Cannot find column definition for multiple table");
return NULL;
} // endif Multiple
@@ -212,7 +212,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
tdp->Uri = (dsn && *dsn ? dsn : NULL);
if (!tdp->Fn && !tdp->Uri) {
- strcpy(g->Message, MSG(MISSING_FNAME));
+ safe_strcpy(g->Message, sizeof(g->Message), MSG(MISSING_FNAME));
return 0;
} else
topt->subtype = NULL;
@@ -320,7 +320,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
switch (tjnp->ReadDB(g)) {
case RC_EF:
- strcpy(g->Message, "Void json table");
+ safe_strcpy(g->Message, sizeof(g->Message), "Void json table");
case RC_FX:
goto err;
default:
@@ -333,7 +333,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
} // endif pretty
if (!(row = (jsp) ? jsp->GetObject() : NULL)) {
- strcpy(g->Message, "Can only retrieve columns from object rows");
+ safe_strcpy(g->Message, sizeof(g->Message), "Can only retrieve columns from object rows");
goto err;
} // endif row
@@ -417,7 +417,7 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j)
if (jvp && jvp->DataType != TYPE_JSON) {
if (JsonAllPath() && !fmt[bf])
- strcat(fmt, colname);
+ safe_strcat(fmt, sizeof(fmt), colname);
jcol.Type = jvp->DataType;
@@ -450,7 +450,7 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j)
jcol.Cbn = true;
} else if (j < lvl && !Stringified(strfy, colname)) {
if (!fmt[bf])
- strcat(fmt, colname);
+ safe_strcat(fmt, sizeof(fmt), colname);
p = fmt + strlen(fmt);
jsp = jvp->GetJson();
@@ -520,11 +520,11 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j)
} else if (lvl >= 0) {
if (Stringified(strfy, colname)) {
if (!fmt[bf])
- strcat(fmt, colname);
+ safe_strcat(fmt, sizeof(fmt), colname);
- strcat(fmt, ".*");
+ safe_strcat(fmt, sizeof(fmt), ".*");
} else if (JsonAllPath() && !fmt[bf])
- strcat(fmt, colname);
+ safe_strcat(fmt, sizeof(fmt), colname);
jcol.Type = TYPE_STRG;
jcol.Len = sz;
@@ -735,7 +735,7 @@ PTDB JSONDEF::GetTable(PGLOBAL g, MODE m)
} else if (m == MODE_INSERT) {
txfp = new(g) ZIPFAM(this);
} else {
- strcpy(g->Message, "UPDATE/DELETE not supported for ZIP");
+ safe_strcpy(g->Message, sizeof(g->Message), "UPDATE/DELETE not supported for ZIP");
return NULL;
} // endif's m
#else // !ZIP_SUPPORT
@@ -775,7 +775,7 @@ PTDB JSONDEF::GetTable(PGLOBAL g, MODE m)
#endif // 0
((TDBJSN*)tdbp)->G = PlugInit(NULL, (size_t)Lrecl * (Pretty >= 0 ? 12 : 4));
} else {
- strcpy(g->Message, "LRECL is not defined");
+ safe_strcpy(g->Message, sizeof(g->Message), "LRECL is not defined");
return NULL;
} // endif Lrecl
@@ -785,10 +785,10 @@ PTDB JSONDEF::GetTable(PGLOBAL g, MODE m)
if (m == MODE_READ || m == MODE_ANY || m == MODE_ALTER) {
txfp = new(g) UNZFAM(this);
} else if (m == MODE_INSERT) {
- strcpy(g->Message, "INSERT supported only for zipped JSON when pretty=0");
+ safe_strcpy(g->Message, sizeof(g->Message), "INSERT supported only for zipped JSON when pretty=0");
return NULL;
} else {
- strcpy(g->Message, "UPDATE/DELETE not supported for ZIP");
+ safe_strcpy(g->Message, sizeof(g->Message), "UPDATE/DELETE not supported for ZIP");
return NULL;
} // endif's m
#else // !ZIP_SUPPORT
@@ -1144,7 +1144,7 @@ int TDBJSN::ReadDB(PGLOBAL g) {
M = 1;
rc = RC_OK;
} else if (Pretty != 1 || strcmp(To_Line, "]")) {
- strcpy(g->Message, G->Message);
+ safe_strcpy(g->Message, sizeof(g->Message), G->Message);
rc = RC_FX;
} else
rc = RC_EF;
@@ -1257,7 +1257,7 @@ bool TDBJSN::PrepareWriting(PGLOBAL g)
strcat(s, ",");
if ((signed)strlen(s) > Lrecl) {
- strncpy(To_Line, s, Lrecl);
+ safe_strcpy(To_Line, Lrecl, s);
snprintf(g->Message, sizeof(g->Message), "Line truncated (lrecl=%d)", Lrecl);
return PushWarning(g, this);
} else
@@ -1359,7 +1359,7 @@ bool JSONCOL::CheckExpand(PGLOBAL g, int i, PSZ nm, bool b)
Xpd = true; // Expandable object
Nodes[i].Op = OP_EXP;
} else if (b) {
- strcpy(g->Message, "Cannot expand more than one branch");
+ safe_strcpy(g->Message, sizeof(g->Message), "Cannot expand more than one branch");
return true;
} // endif Xcol
@@ -1570,7 +1570,7 @@ bool JSONCOL::ParseJpath(PGLOBAL g)
if (SetArrayOptions(g, p, i, Nodes[i - 1].Key))
return true;
else if (Xpd && Tjp->Mode == MODE_DELETE) {
- strcpy(g->Message, "Cannot delete expanded columns");
+ safe_strcpy(g->Message, sizeof(g->Message), "Cannot delete expanded columns");
return true;
} // endif Xpd
@@ -1674,7 +1674,7 @@ PSZ JSONCOL::GetJpath(PGLOBAL g, bool proj)
PVAL JSONCOL::MakeJson(PGLOBAL g, PJSON jsp, int n)
{
if (Value->IsTypeNum()) {
- strcpy(g->Message, "Cannot make Json for a numeric column");
+ safe_strcpy(g->Message, sizeof(g->Message), "Cannot make Json for a numeric column");
if (!Warned) {
PushWarning(g, Tjp);
@@ -1689,10 +1689,10 @@ PVAL JSONCOL::MakeJson(PGLOBAL g, PJSON jsp, int n)
ulong len = Tjp->Lrecl ? Tjp->Lrecl : 500;
PBSON bsp = JbinAlloc(g, NULL, len, jsp);
- strcat(bsp->Msg, " column");
+ safe_strcat(bsp->Msg, sizeof(bsp->Msg), " column");
((BINVAL*)Value)->SetBinValue(bsp, sizeof(BSON));
} else {
- strcpy(g->Message, "Column size too small");
+ safe_strcpy(g->Message, sizeof(g->Message), "Column size too small");
Value->SetValue_char(NULL, 0);
} // endif Clen
#endif // 0
@@ -1934,7 +1934,7 @@ PVAL JSONCOL::ExpandArray(PGLOBAL g, PJAR arp, int n)
} // endif ars
if (!(jvp = arp->GetArrayValue((Nodes[n].Rx = Nodes[n].Nx)))) {
- strcpy(g->Message, "Logical error expanding array");
+ safe_strcpy(g->Message, sizeof(g->Message), "Logical error expanding array");
throw 666;
} // endif jvp
@@ -2122,7 +2122,7 @@ PJSON JSONCOL::GetRow(PGLOBAL g)
((PJAR)row)->AddArrayValue(G, new(G) JVALUE(nwr));
((PJAR)row)->InitArray(G);
} else {
- strcpy(g->Message, "Wrong type when writing new row");
+ safe_strcpy(g->Message, sizeof(g->Message), "Wrong type when writing new row");
nwr = NULL;
} // endif's
@@ -2143,7 +2143,7 @@ PJSON JSONCOL::GetRow(PGLOBAL g)
void JSONCOL::WriteColumn(PGLOBAL g)
{
if (Xpd && Tjp->Pretty < 2) {
- strcpy(g->Message, "Cannot write expanded column when Pretty is not 2");
+ safe_strcpy(g->Message, sizeof(g->Message), "Cannot write expanded column when Pretty is not 2");
throw 666;
} // endif Xpd
@@ -2179,7 +2179,7 @@ void JSONCOL::WriteColumn(PGLOBAL g)
if (s && *s) {
if (!(jsp = ParseJson(G, s, strlen(s)))) {
- strcpy(g->Message, s);
+ safe_strcpy(g->Message, sizeof(g->Message), s);
throw 666;
} // endif jsp
@@ -2362,7 +2362,7 @@ int TDBJSON::MakeDocument(PGLOBAL g)
if (!a && *p && *p != '[' && !IsNum(p)) {
// obj is a key
if (jsp->GetType() != TYPE_JOB) {
- strcpy(g->Message, "Table path does not match the json file");
+ safe_strcpy(g->Message, sizeof(g->Message), "Table path does not match the json file");
return RC_FX;
} // endif Type
@@ -2388,7 +2388,7 @@ int TDBJSON::MakeDocument(PGLOBAL g)
} // endif p
if (jsp->GetType() != TYPE_JAR) {
- strcpy(g->Message, "Table path does not match the json file");
+ safe_strcpy(g->Message, sizeof(g->Message), "Table path does not match the json file");
return RC_FX;
} // endif Type
@@ -2483,7 +2483,7 @@ void TDBJSON::ResetSize(void)
int TDBJSON::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool)
{
if (pxdf) {
- strcpy(g->Message, "JSON not indexable when pretty = 2");
+ safe_strcpy(g->Message, sizeof(g->Message), "JSON not indexable when pretty = 2");
return RC_FX;
} else
return RC_OK;
diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp
index 498ec71a87f..7265b2ed0ca 100644
--- a/storage/connect/value.cpp
+++ b/storage/connect/value.cpp
@@ -163,9 +163,9 @@ PCSZ GetTypeName(int type)
/***********************************************************************/
/* GetTypeSize: returns the PlugDB internal type size. */
/***********************************************************************/
-int GetTypeSize(int type, int len)
- {
- switch (type) {
+unsigned GetTypeSize(int type, unsigned len)
+{
+ switch (type) {
case TYPE_DECIM:
case TYPE_BIN:
case TYPE_STRING: len = len * sizeof(char); break;
@@ -176,7 +176,7 @@ int GetTypeSize(int type, int len)
case TYPE_DOUBLE: len = sizeof(double); break;
case TYPE_TINY: len = sizeof(char); break;
case TYPE_PCHAR: len = sizeof(char*); break;
- default: len = -1;
+ default: len = 0;
} // endswitch type
return len;
diff --git a/storage/connect/value.h b/storage/connect/value.h
index a0d947347c3..7eb0dec29f2 100644
--- a/storage/connect/value.h
+++ b/storage/connect/value.h
@@ -41,7 +41,7 @@ typedef struct _datpar *PDTP; // For DTVAL
/***********************************************************************/
// Exported functions
DllExport PCSZ GetTypeName(int);
-DllExport int GetTypeSize(int, int);
+DllExport unsigned GetTypeSize(int, unsigned);
#ifdef ODBC_SUPPORT
/* This function is exported for use in OEM table type DLLs */
DllExport int TranslateSQLType(int stp, int prec,
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index 491e987cac6..06b785b8b39 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -4463,7 +4463,7 @@ n_field_mismatch:
len -= BTR_EXTERN_FIELD_REF_SIZE;
ulint extern_len = mach_read_from_4(
data + len + BTR_EXTERN_LEN + 4);
- if (fixed_size == extern_len) {
+ if (fixed_size == extern_len + len) {
goto next_field;
}
}
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 7ecbe165a1e..f72915bce88 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -1017,7 +1017,7 @@ dberr_t btr_cur_t::search_leaf(const dtuple_t *tuple, page_cur_mode_t mode,
if (lock_intention == BTR_INTENTION_DELETE)
{
compress_limit= BTR_CUR_PAGE_COMPRESS_LIMIT(index());
- if (buf_pool.n_pend_reads &&
+ if (os_aio_pending_reads_approx() &&
trx_sys.history_size_approx() > BTR_CUR_FINE_HISTORY_LENGTH)
{
/* Most delete-intended operations are due to the purge of history.
@@ -1723,7 +1723,7 @@ dberr_t btr_cur_t::open_leaf(bool first, dict_index_t *index,
{
compress_limit= BTR_CUR_PAGE_COMPRESS_LIMIT(index);
- if (buf_pool.n_pend_reads &&
+ if (os_aio_pending_reads_approx() &&
trx_sys.history_size_approx() > BTR_CUR_FINE_HISTORY_LENGTH)
{
mtr_x_lock_index(index, mtr);
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 4de8b4fd175..6a5221cb2c6 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -1311,11 +1311,11 @@ buf_tmp_buffer_t *buf_pool_t::io_buf_t::reserve()
for (buf_tmp_buffer_t *s= slots, *e= slots + n_slots; s != e; s++)
if (s->acquire())
return s;
- os_aio_wait_until_no_pending_writes();
+ os_aio_wait_until_no_pending_writes(true);
for (buf_tmp_buffer_t *s= slots, *e= slots + n_slots; s != e; s++)
if (s->acquire())
return s;
- os_aio_wait_until_no_pending_reads();
+ os_aio_wait_until_no_pending_reads(true);
}
}
@@ -3185,9 +3185,6 @@ dberr_t buf_page_t::read_complete(const fil_node_t &node)
ut_ad(zip_size() == node.space->zip_size());
ut_ad(!!zip.ssize == !!zip.data);
- ut_d(auto n=) buf_pool.n_pend_reads--;
- ut_ad(n > 0);
-
const byte *read_frame= zip.data ? zip.data : frame;
ut_ad(read_frame);
@@ -3476,9 +3473,8 @@ void buf_pool_t::print()
<< ", modified database pages="
<< UT_LIST_GET_LEN(flush_list)
<< ", n pending decompressions=" << n_pend_unzip
- << ", n pending reads=" << n_pend_reads
<< ", n pending flush LRU=" << n_flush()
- << " list=" << buf_dblwr.pending_writes()
+ << " list=" << os_aio_pending_writes()
<< ", pages made young=" << stat.n_pages_made_young
<< ", not young=" << stat.n_pages_not_made_young
<< ", pages read=" << stat.n_pages_read
@@ -3591,11 +3587,11 @@ void buf_stats_get_pool_info(buf_pool_info_t *pool_info)
pool_info->n_pend_unzip = UT_LIST_GET_LEN(buf_pool.unzip_LRU);
- pool_info->n_pend_reads = buf_pool.n_pend_reads;
+ pool_info->n_pend_reads = os_aio_pending_reads_approx();
pool_info->n_pending_flush_lru = buf_pool.n_flush();
- pool_info->n_pending_flush_list = buf_dblwr.pending_writes();
+ pool_info->n_pending_flush_list = os_aio_pending_writes();
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
current_time = time(NULL);
diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc
index 8d8b92ae560..1260145ed1c 100644
--- a/storage/innobase/buf/buf0dblwr.cc
+++ b/storage/innobase/buf/buf0dblwr.cc
@@ -53,7 +53,6 @@ void buf_dblwr_t::init()
active_slot= &slots[0];
mysql_mutex_init(buf_dblwr_mutex_key, &mutex, nullptr);
pthread_cond_init(&cond, nullptr);
- pthread_cond_init(&write_cond, nullptr);
}
}
@@ -467,7 +466,6 @@ void buf_dblwr_t::close()
ut_ad(!batch_running);
pthread_cond_destroy(&cond);
- pthread_cond_destroy(&write_cond);
for (int i= 0; i < 2; i++)
{
aligned_free(slots[i].write_buf);
@@ -479,38 +477,31 @@ void buf_dblwr_t::close()
}
/** Update the doublewrite buffer on write completion. */
-void buf_dblwr_t::write_completed(bool with_doublewrite)
+void buf_dblwr_t::write_completed()
{
ut_ad(this == &buf_dblwr);
ut_ad(!srv_read_only_mode);
mysql_mutex_lock(&mutex);
- ut_ad(writes_pending);
- if (!--writes_pending)
- pthread_cond_broadcast(&write_cond);
+ ut_ad(is_created());
+ ut_ad(srv_use_doublewrite_buf);
+ ut_ad(batch_running);
+ slot *flush_slot= active_slot == &slots[0] ? &slots[1] : &slots[0];
+ ut_ad(flush_slot->reserved);
+ ut_ad(flush_slot->reserved <= flush_slot->first_free);
- if (with_doublewrite)
+ if (!--flush_slot->reserved)
{
- ut_ad(is_created());
- ut_ad(srv_use_doublewrite_buf);
- ut_ad(batch_running);
- slot *flush_slot= active_slot == &slots[0] ? &slots[1] : &slots[0];
- ut_ad(flush_slot->reserved);
- ut_ad(flush_slot->reserved <= flush_slot->first_free);
-
- if (!--flush_slot->reserved)
- {
- mysql_mutex_unlock(&mutex);
- /* This will finish the batch. Sync data files to the disk. */
- fil_flush_file_spaces();
- mysql_mutex_lock(&mutex);
+ mysql_mutex_unlock(&mutex);
+ /* This will finish the batch. Sync data files to the disk. */
+ fil_flush_file_spaces();
+ mysql_mutex_lock(&mutex);
- /* We can now reuse the doublewrite memory buffer: */
- flush_slot->first_free= 0;
- batch_running= false;
- pthread_cond_broadcast(&cond);
- }
+ /* We can now reuse the doublewrite memory buffer: */
+ flush_slot->first_free= 0;
+ batch_running= false;
+ pthread_cond_broadcast(&cond);
}
mysql_mutex_unlock(&mutex);
@@ -605,7 +596,6 @@ bool buf_dblwr_t::flush_buffered_writes(const ulint size)
const bool multi_batch= block1 + static_cast<uint32_t>(size) != block2 &&
old_first_free > size;
flushing_buffered_writes= 1 + multi_batch;
- pages_submitted+= old_first_free;
/* Now safe to release the mutex. */
mysql_mutex_unlock(&mutex);
#ifdef UNIV_DEBUG
@@ -754,7 +744,6 @@ void buf_dblwr_t::add_to_batch(const IORequest &request, size_t size)
const ulint buf_size= 2 * block_size();
mysql_mutex_lock(&mutex);
- writes_pending++;
for (;;)
{
diff --git a/storage/innobase/buf/buf0dump.cc b/storage/innobase/buf/buf0dump.cc
index 63a28aa1a37..bb705ec5651 100644
--- a/storage/innobase/buf/buf0dump.cc
+++ b/storage/innobase/buf/buf0dump.cc
@@ -651,7 +651,7 @@ buf_load()
ut_free(dump);
if (i == dump_n) {
- os_aio_wait_until_no_pending_reads();
+ os_aio_wait_until_no_pending_reads(true);
}
ut_sprintf_timestamp(now);
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
index 0072d0c22b8..57245cbb95e 100644
--- a/storage/innobase/buf/buf0flu.cc
+++ b/storage/innobase/buf/buf0flu.cc
@@ -113,7 +113,12 @@ void buf_pool_t::page_cleaner_wakeup(bool for_LRU)
{
ut_d(buf_flush_validate_skip());
if (!page_cleaner_idle())
+ {
+ if (for_LRU)
+ /* Ensure that the page cleaner is not in a timed wait. */
+ pthread_cond_signal(&do_flush_list);
return;
+ }
double dirty_pct= double(UT_LIST_GET_LEN(buf_pool.flush_list)) * 100.0 /
double(UT_LIST_GET_LEN(buf_pool.LRU) + UT_LIST_GET_LEN(buf_pool.free));
double pct_lwm= srv_max_dirty_pages_pct_lwm;
@@ -209,7 +214,7 @@ void buf_flush_remove_pages(uint32_t id)
if (!deferred)
break;
- buf_dblwr.wait_for_page_writes();
+ os_aio_wait_until_no_pending_writes(true);
}
}
@@ -339,9 +344,9 @@ void buf_page_write_complete(const IORequest &request)
if (request.is_LRU())
{
const bool temp= bpage->oldest_modification() == 2;
- if (!temp)
- buf_dblwr.write_completed(state < buf_page_t::WRITE_FIX_REINIT &&
- request.node->space->use_doublewrite());
+ if (!temp && state < buf_page_t::WRITE_FIX_REINIT &&
+ request.node->space->use_doublewrite())
+ buf_dblwr.write_completed();
/* We must hold buf_pool.mutex while releasing the block, so that
no other thread can access it before we have freed it. */
mysql_mutex_lock(&buf_pool.mutex);
@@ -353,8 +358,9 @@ void buf_page_write_complete(const IORequest &request)
}
else
{
- buf_dblwr.write_completed(state < buf_page_t::WRITE_FIX_REINIT &&
- request.node->space->use_doublewrite());
+ if (state < buf_page_t::WRITE_FIX_REINIT &&
+ request.node->space->use_doublewrite())
+ buf_dblwr.write_completed();
bpage->write_complete(false);
}
}
@@ -847,8 +853,6 @@ bool buf_page_t::flush(bool evict, fil_space_t *space)
ut_ad(lsn >= oldest_modification());
log_write_up_to(lsn, true);
}
- if (UNIV_LIKELY(space->purpose != FIL_TYPE_TEMPORARY))
- buf_dblwr.add_unbuffered();
space->io(IORequest{type, this, slot}, physical_offset(), size,
write_frame, this);
}
@@ -1082,13 +1086,11 @@ static ulint buf_flush_try_neighbors(fil_space_t *space,
mysql_mutex_unlock(&buf_pool.mutex);
}
- ut_ad(!bpage);
-
- if (auto n= count - 1)
+ if (count > 1)
{
MONITOR_INC_VALUE_CUMULATIVE(MONITOR_FLUSH_NEIGHBOR_TOTAL_PAGE,
MONITOR_FLUSH_NEIGHBOR_COUNT,
- MONITOR_FLUSH_NEIGHBOR_PAGES, n);
+ MONITOR_FLUSH_NEIGHBOR_PAGES, count - 1);
}
return count;
@@ -1218,6 +1220,11 @@ static void buf_flush_LRU_list_batch(ulint max, bool evict,
++n->evicted;
/* fall through */
case 1:
+ if (UNIV_LIKELY(scanned & 31))
+ continue;
+ mysql_mutex_unlock(&buf_pool.mutex);
+ reacquire_mutex:
+ mysql_mutex_lock(&buf_pool.mutex);
continue;
}
@@ -1253,32 +1260,37 @@ static void buf_flush_LRU_list_batch(ulint max, bool evict,
auto p= buf_flush_space(space_id);
space= p.first;
last_space_id= space_id;
+ if (!space)
+ {
+ mysql_mutex_lock(&buf_pool.mutex);
+ goto no_space;
+ }
mysql_mutex_lock(&buf_pool.mutex);
- if (p.second)
- buf_pool.stat.n_pages_written+= p.second;
+ buf_pool.stat.n_pages_written+= p.second;
}
else
+ {
ut_ad(!space);
+ goto no_space;
+ }
}
else if (space->is_stopping())
{
space->release();
space= nullptr;
- }
-
- if (!space)
- {
+ no_space:
mysql_mutex_lock(&buf_pool.flush_list_mutex);
buf_flush_discard_page(bpage);
+ continue;
}
- else if (neighbors && space->is_rotational())
+
+ if (neighbors && space->is_rotational())
{
mysql_mutex_unlock(&buf_pool.mutex);
n->flushed+= buf_flush_try_neighbors(space, page_id, bpage,
neighbors == 1,
do_evict, n->flushed, max);
-reacquire_mutex:
- mysql_mutex_lock(&buf_pool.mutex);
+ goto reacquire_mutex;
}
else if (n->flushed >= max && !recv_recovery_is_on())
{
@@ -1645,7 +1657,7 @@ done:
space->release();
if (space->purpose == FIL_TYPE_IMPORT)
- os_aio_wait_until_no_pending_writes();
+ os_aio_wait_until_no_pending_writes(true);
else
buf_dblwr.flush_buffered_writes();
@@ -1957,7 +1969,7 @@ static void buf_flush_wait(lsn_t lsn)
break;
}
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
- buf_dblwr.wait_for_page_writes();
+ os_aio_wait_until_no_pending_writes(false);
mysql_mutex_lock(&buf_pool.flush_list_mutex);
}
}
@@ -1978,8 +1990,6 @@ ATTRIBUTE_COLD void buf_flush_wait_flushed(lsn_t sync_lsn)
if (buf_pool.get_oldest_modification(sync_lsn) < sync_lsn)
{
MONITOR_INC(MONITOR_FLUSH_SYNC_WAITS);
- thd_wait_begin(nullptr, THD_WAIT_DISKIO);
- tpool::tpool_wait_begin();
#if 1 /* FIXME: remove this, and guarantee that the page cleaner serves us */
if (UNIV_UNLIKELY(!buf_page_cleaner_is_active))
@@ -1994,17 +2004,20 @@ ATTRIBUTE_COLD void buf_flush_wait_flushed(lsn_t sync_lsn)
MONITOR_FLUSH_SYNC_COUNT,
MONITOR_FLUSH_SYNC_PAGES, n_pages);
}
- buf_dblwr.wait_for_page_writes();
+ os_aio_wait_until_no_pending_writes(false);
mysql_mutex_lock(&buf_pool.flush_list_mutex);
}
while (buf_pool.get_oldest_modification(sync_lsn) < sync_lsn);
}
else
#endif
+ {
+ thd_wait_begin(nullptr, THD_WAIT_DISKIO);
+ tpool::tpool_wait_begin();
buf_flush_wait(sync_lsn);
-
- tpool::tpool_wait_end();
- thd_wait_end(nullptr);
+ tpool::tpool_wait_end();
+ thd_wait_end(nullptr);
+ }
}
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
@@ -2157,10 +2170,12 @@ Based on various factors it decides if there is a need to do flushing.
@return number of pages recommended to be flushed
@param last_pages_in number of pages flushed in previous batch
@param oldest_lsn buf_pool.get_oldest_modification(0)
+@param pct_lwm innodb_max_dirty_pages_pct_lwm, or 0 to ignore it
@param dirty_blocks UT_LIST_GET_LEN(buf_pool.flush_list)
@param dirty_pct 100*flush_list.count / (LRU.count + free.count) */
static ulint page_cleaner_flush_pages_recommendation(ulint last_pages_in,
lsn_t oldest_lsn,
+ double pct_lwm,
ulint dirty_blocks,
double dirty_pct)
{
@@ -2230,11 +2245,17 @@ func_exit:
sum_pages = 0;
}
- const ulint pct_for_dirty = srv_max_dirty_pages_pct_lwm == 0
- ? (dirty_pct >= max_pct ? 100 : 0)
- : static_cast<ulint>
- (max_pct > 0.0 ? dirty_pct / max_pct : dirty_pct);
- ulint pct_total = std::max(pct_for_dirty, pct_for_lsn);
+ MONITOR_SET(MONITOR_FLUSH_PCT_FOR_LSN, pct_for_lsn);
+
+ double total_ratio;
+ if (pct_lwm == 0.0 || max_pct == 0.0) {
+ total_ratio = 1;
+ } else {
+ total_ratio = std::max(double(pct_for_lsn) / 100,
+ (dirty_pct / max_pct));
+ }
+
+ MONITOR_SET(MONITOR_FLUSH_PCT_FOR_DIRTY, ulint(total_ratio * 100));
/* Estimate pages to be flushed for the lsn progress */
lsn_t target_lsn = oldest_lsn
@@ -2260,7 +2281,7 @@ func_exit:
pages_for_lsn = 1;
}
- n_pages = (ulint(double(srv_io_capacity) * double(pct_total) / 100.0)
+ n_pages = (ulint(double(srv_io_capacity) * total_ratio)
+ avg_page_rate + pages_for_lsn) / 3;
if (n_pages > srv_max_io_capacity) {
@@ -2273,8 +2294,6 @@ func_exit:
MONITOR_SET(MONITOR_FLUSH_AVG_PAGE_RATE, avg_page_rate);
MONITOR_SET(MONITOR_FLUSH_LSN_AVG_RATE, lsn_avg_rate);
- MONITOR_SET(MONITOR_FLUSH_PCT_FOR_DIRTY, pct_for_dirty);
- MONITOR_SET(MONITOR_FLUSH_PCT_FOR_LSN, pct_for_lsn);
goto func_exit;
}
@@ -2362,7 +2381,7 @@ static void buf_flush_page_cleaner()
if (!recv_recovery_is_on() &&
!srv_startup_is_before_trx_rollback_phase &&
- srv_operation == SRV_OPERATION_NORMAL)
+ srv_operation <= SRV_OPERATION_EXPORT_RESTORED)
log_checkpoint();
}
while (false);
@@ -2387,7 +2406,7 @@ static void buf_flush_page_cleaner()
soft_lsn_limit= lsn_limit;
}
- bool idle_flush= false;
+ double pct_lwm= 0.0;
ulint n_flushed= 0, n;
if (UNIV_UNLIKELY(soft_lsn_limit != 0))
@@ -2406,7 +2425,7 @@ static void buf_flush_page_cleaner()
mysql_mutex_unlock(&buf_pool.mutex);
last_pages+= n;
- if (!idle_flush)
+ if (pct_lwm == 0.0)
goto end_of_batch;
/* when idle flushing kicks in page_cleaner is marked active.
@@ -2424,7 +2443,8 @@ static void buf_flush_page_cleaner()
guaranteed to be nonempty, and it is a subset of buf_pool.LRU. */
const double dirty_pct= double(dirty_blocks) * 100.0 /
double(UT_LIST_GET_LEN(buf_pool.LRU) + UT_LIST_GET_LEN(buf_pool.free));
- if (srv_max_dirty_pages_pct_lwm != 0.0)
+ pct_lwm= srv_max_dirty_pages_pct_lwm;
+ if (pct_lwm != 0.0)
{
const ulint activity_count= srv_get_activity_count();
if (activity_count != last_activity_count)
@@ -2432,7 +2452,7 @@ static void buf_flush_page_cleaner()
last_activity_count= activity_count;
goto maybe_unemployed;
}
- else if (buf_pool.page_cleaner_idle() && buf_pool.n_pend_reads == 0)
+ else if (buf_pool.page_cleaner_idle() && !os_aio_pending_reads())
{
/* reaching here means 3 things:
- last_activity_count == activity_count: suggesting server is idle
@@ -2441,13 +2461,16 @@ static void buf_flush_page_cleaner()
- there are no pending reads but there are dirty pages to flush */
buf_pool.update_last_activity_count(activity_count);
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
- idle_flush= true;
goto idle_flush;
}
else
+ {
maybe_unemployed:
- if (dirty_pct < srv_max_dirty_pages_pct_lwm)
+ const bool below{dirty_pct < pct_lwm};
+ pct_lwm= 0.0;
+ if (below)
goto possibly_unemployed;
+ }
}
else if (dirty_pct < srv_max_buf_pool_modified_pct)
possibly_unemployed:
@@ -2478,6 +2501,7 @@ static void buf_flush_page_cleaner()
}
else if ((n= page_cleaner_flush_pages_recommendation(last_pages,
oldest_lsn,
+ pct_lwm,
dirty_blocks,
dirty_pct)) != 0)
{
@@ -2508,7 +2532,7 @@ static void buf_flush_page_cleaner()
mysql_mutex_lock(&buf_pool.flush_list_mutex);
buf_flush_wait_LRU_batch_end();
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
- buf_dblwr.wait_for_page_writes();
+ os_aio_wait_until_no_pending_writes(false);
}
mysql_mutex_lock(&buf_pool.flush_list_mutex);
@@ -2534,7 +2558,7 @@ static void buf_flush_page_cleaner()
ATTRIBUTE_COLD void buf_flush_page_cleaner_init()
{
ut_ad(!buf_page_cleaner_is_active);
- ut_ad(srv_operation == SRV_OPERATION_NORMAL ||
+ ut_ad(srv_operation <= SRV_OPERATION_EXPORT_RESTORED ||
srv_operation == SRV_OPERATION_RESTORE ||
srv_operation == SRV_OPERATION_RESTORE_EXPORT);
buf_flush_async_lsn= 0;
@@ -2558,15 +2582,7 @@ ATTRIBUTE_COLD void buf_flush_buffer_pool()
{
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
buf_flush_list(srv_max_io_capacity);
- if (const size_t pending= buf_dblwr.pending_writes())
- {
- timespec abstime;
- service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
- "Waiting to write %zu pages", pending);
- set_timespec(abstime, INNODB_EXTEND_TIMEOUT_INTERVAL / 2);
- buf_dblwr.wait_for_page_writes(abstime);
- }
-
+ os_aio_wait_until_no_pending_writes(false);
mysql_mutex_lock(&buf_pool.flush_list_mutex);
service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL,
"Waiting to flush " ULINTPF " pages",
@@ -2574,20 +2590,17 @@ ATTRIBUTE_COLD void buf_flush_buffer_pool()
}
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
- ut_ad(!buf_pool.any_io_pending());
+ ut_ad(!os_aio_pending_reads());
}
/** Synchronously flush dirty blocks during recv_sys_t::apply().
NOTE: The calling thread is not allowed to hold any buffer page latches! */
void buf_flush_sync_batch(lsn_t lsn)
{
- thd_wait_begin(nullptr, THD_WAIT_DISKIO);
- tpool::tpool_wait_begin();
+ lsn= std::max(lsn, log_sys.get_lsn());
mysql_mutex_lock(&buf_pool.flush_list_mutex);
buf_flush_wait(lsn);
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
- tpool::tpool_wait_end();
- thd_wait_end(nullptr);
}
/** Synchronously flush dirty blocks.
diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc
index e4e20e8335f..4c42d3eab54 100644
--- a/storage/innobase/buf/buf0lru.cc
+++ b/storage/innobase/buf/buf0lru.cc
@@ -455,15 +455,15 @@ got_block:
mysql_mutex_unlock(&buf_pool.mutex);
mysql_mutex_lock(&buf_pool.flush_list_mutex);
const auto n_flush = buf_pool.n_flush();
+ if (!buf_pool.try_LRU_scan) {
+ buf_pool.page_cleaner_wakeup(true);
+ }
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
mysql_mutex_lock(&buf_pool.mutex);
if (!n_flush) {
goto not_found;
}
if (!buf_pool.try_LRU_scan) {
- mysql_mutex_lock(&buf_pool.flush_list_mutex);
- buf_pool.page_cleaner_wakeup(true);
- mysql_mutex_unlock(&buf_pool.flush_list_mutex);
my_cond_wait(&buf_pool.done_free,
&buf_pool.mutex.m_mutex);
}
@@ -1112,17 +1112,8 @@ static bool buf_LRU_block_remove_hashed(buf_page_t *bpage, const page_id_t id,
break;
case FIL_PAGE_TYPE_ZBLOB:
case FIL_PAGE_TYPE_ZBLOB2:
- break;
case FIL_PAGE_INDEX:
case FIL_PAGE_RTREE:
-#if defined UNIV_ZIP_DEBUG && defined BTR_CUR_HASH_ADAPT
- /* During recovery, we only update the
- compressed page, not the uncompressed one. */
- ut_a(recv_recovery_is_on()
- || page_zip_validate(
- &bpage->zip, page,
- ((buf_block_t*) bpage)->index));
-#endif /* UNIV_ZIP_DEBUG && BTR_CUR_HASH_ADAPT */
break;
default:
ib::error() << "The compressed page to be"
diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc
index 7dab411dabb..1f7f9bfba0a 100644
--- a/storage/innobase/buf/buf0rea.cc
+++ b/storage/innobase/buf/buf0rea.cc
@@ -187,9 +187,6 @@ page_exists:
}
buf_pool.stat.n_pages_read++;
- mysql_mutex_unlock(&buf_pool.mutex);
- buf_pool.n_pend_reads++;
- return bpage;
func_exit:
mysql_mutex_unlock(&buf_pool.mutex);
ut_ad(!bpage || bpage->in_file());
@@ -252,8 +249,6 @@ buf_read_page_low(
page_id.page_no() * len, len, dst, bpage);
if (UNIV_UNLIKELY(fio.err != DB_SUCCESS)) {
- ut_d(auto n=) buf_pool.n_pend_reads--;
- ut_ad(n > 0);
buf_pool.corrupted_evict(bpage, buf_page_t::READ_FIX);
} else if (sync) {
thd_wait_end(NULL);
@@ -305,7 +300,8 @@ ulint buf_read_ahead_random(const page_id_t page_id, ulint zip_size)
/* No read-ahead to avoid thread deadlocks */
return 0;
- if (buf_pool.n_pend_reads > buf_pool.curr_size / BUF_READ_AHEAD_PEND_LIMIT)
+ if (os_aio_pending_reads_approx() >
+ buf_pool.curr_size / BUF_READ_AHEAD_PEND_LIMIT)
return 0;
fil_space_t* space= fil_space_t::get(page_id.space());
@@ -511,7 +507,8 @@ ulint buf_read_ahead_linear(const page_id_t page_id, ulint zip_size)
/* No read-ahead to avoid thread deadlocks */
return 0;
- if (buf_pool.n_pend_reads > buf_pool.curr_size / BUF_READ_AHEAD_PEND_LIMIT)
+ if (os_aio_pending_reads_approx() >
+ buf_pool.curr_size / BUF_READ_AHEAD_PEND_LIMIT)
return 0;
const uint32_t buf_read_ahead_area= buf_pool.read_ahead_area;
@@ -693,18 +690,8 @@ void buf_read_recv_pages(uint32_t space_id, st_::span<uint32_t> page_nos)
limit += buf_pool.chunks[j].size / 2;
}
- for (ulint count = 0; buf_pool.n_pend_reads >= limit; ) {
- std::this_thread::sleep_for(
- std::chrono::milliseconds(10));
-
- if (!(++count % 1000)) {
-
- ib::error()
- << "Waited for " << count / 100
- << " seconds for "
- << buf_pool.n_pend_reads
- << " pending reads";
- }
+ if (os_aio_pending_reads() >= limit) {
+ os_aio_wait_until_no_pending_reads(false);
}
buf_pool_t::hash_chain& chain =
diff --git a/storage/innobase/dict/drop.cc b/storage/innobase/dict/drop.cc
index 4ea4f98640a..d92c2e12409 100644
--- a/storage/innobase/dict/drop.cc
+++ b/storage/innobase/dict/drop.cc
@@ -66,6 +66,7 @@ before transaction commit and must be rolled back explicitly are as follows:
#include "dict0stats.h"
#include "dict0stats_bg.h"
+#include "ibuf0ibuf.h"
#include "lock0lock.h"
#include "que0que.h"
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index c1fd916be55..53ea91529ec 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -96,7 +96,13 @@ bool fil_space_t::try_to_close(bool print_info)
if (!node->is_open())
continue;
- if (const auto n= space.set_closing())
+ /* Other thread is trying to do fil_delete_tablespace()
+ concurrently for the same tablespace. So ignore this
+ tablespace and try to close the other one */
+ const auto n= space.set_closing();
+ if (n & STOPPING)
+ continue;
+ if (n & (PENDING | NEEDS_FSYNC))
{
if (!print_info)
continue;
@@ -288,6 +294,8 @@ fil_node_t* fil_space_t::add(const char* name, pfs_os_file_t handle,
uint32_t size, bool is_raw, bool atomic_write,
uint32_t max_pages)
{
+ mysql_mutex_assert_owner(&fil_system.mutex);
+
fil_node_t* node;
ut_ad(name != NULL);
@@ -312,7 +320,6 @@ fil_node_t* fil_space_t::add(const char* name, pfs_os_file_t handle,
node->atomic_write = atomic_write;
- mysql_mutex_lock(&fil_system.mutex);
this->size += size;
UT_LIST_ADD_LAST(chain, node);
if (node->is_open()) {
@@ -323,7 +330,6 @@ fil_node_t* fil_space_t::add(const char* name, pfs_os_file_t handle,
release();
}
}
- mysql_mutex_unlock(&fil_system.mutex);
return node;
}
@@ -799,8 +805,17 @@ pfs_os_file_t fil_system_t::detach(fil_space_t *space, bool detach_handle)
space_list_t::iterator s= space_list_t::iterator(space);
if (space_list_last_opened == space)
{
- space_list_t::iterator prev= s;
- space_list_last_opened= &*--prev;
+ if (s == space_list.begin())
+ {
+ ut_ad(srv_operation > SRV_OPERATION_EXPORT_RESTORED ||
+ srv_shutdown_state > SRV_SHUTDOWN_NONE);
+ space_list_last_opened= nullptr;
+ }
+ else
+ {
+ space_list_t::iterator prev= s;
+ space_list_last_opened= &*--prev;
+ }
}
space_list.erase(s);
}
@@ -934,6 +949,7 @@ fil_space_t *fil_space_t::create(uint32_t id, uint32_t flags,
{
fil_space_t* space;
+ mysql_mutex_assert_owner(&fil_system.mutex);
ut_ad(fil_system.is_initialised());
ut_ad(fil_space_t::is_valid_flags(flags & ~FSP_FLAGS_MEM_MASK, id));
ut_ad(srv_page_size == UNIV_PAGE_SIZE_ORIG || flags != 0);
@@ -966,8 +982,6 @@ fil_space_t *fil_space_t::create(uint32_t id, uint32_t flags,
space->latch.SRW_LOCK_INIT(fil_space_latch_key);
- mysql_mutex_lock(&fil_system.mutex);
-
if (const fil_space_t *old_space = fil_space_get_by_id(id)) {
ib::error() << "Trying to add tablespace with id " << id
<< " to the cache, but tablespace '"
@@ -975,7 +989,6 @@ fil_space_t *fil_space_t::create(uint32_t id, uint32_t flags,
? old_space->chain.start->name
: "")
<< "' already exists in the cache!";
- mysql_mutex_unlock(&fil_system.mutex);
space->~fil_space_t();
ut_free(space);
return(NULL);
@@ -1022,12 +1035,12 @@ fil_space_t *fil_space_t::create(uint32_t id, uint32_t flags,
if (rotate) {
fil_system.default_encrypt_tables.push_back(*space);
space->is_in_default_encrypt = true;
- }
-
- mysql_mutex_unlock(&fil_system.mutex);
- if (rotate && srv_n_fil_crypt_threads_started) {
- fil_crypt_threads_signal();
+ if (srv_n_fil_crypt_threads_started) {
+ mysql_mutex_unlock(&fil_system.mutex);
+ fil_crypt_threads_signal();
+ mysql_mutex_lock(&fil_system.mutex);
+ }
}
return(space);
@@ -1310,9 +1323,9 @@ void fil_system_t::close()
void fil_system_t::add_opened_last_to_space_list(fil_space_t *space)
{
if (UNIV_LIKELY(space_list_last_opened != nullptr))
- space_list.insert(space_list_t::iterator(space_list_last_opened), *space);
+ space_list.insert(++space_list_t::iterator(space_list_last_opened), *space);
else
- space_list.push_back(*space);
+ space_list.push_front(*space);
space_list_last_opened= space;
}
@@ -1482,7 +1495,10 @@ void fil_space_t::close_all()
for (ulint count= 10000; count--;)
{
- if (!space.set_closing())
+ const auto n= space.set_closing();
+ if (n & STOPPING)
+ goto next;
+ if (!(n & (PENDING | NEEDS_FSYNC)))
{
node->close();
goto next;
@@ -1732,9 +1748,7 @@ pfs_os_file_t fil_delete_tablespace(uint32_t id)
mtr_t mtr;
mtr.start();
mtr.log_file_op(FILE_DELETE, id, space->chain.start->name);
- handle= space->chain.start->handle;
- mtr.commit_file(*space, nullptr);
-
+ mtr.commit_file(*space, nullptr, &handle);
fil_space_free_low(space);
}
@@ -2047,16 +2061,20 @@ err_exit:
DBUG_EXECUTE_IF("checkpoint_after_file_create",
log_make_checkpoint(););
+ mysql_mutex_lock(&fil_system.mutex);
if (fil_space_t* space = fil_space_t::create(space_id, flags,
FIL_TYPE_TABLESPACE,
crypt_data, mode, true)) {
fil_node_t* node = space->add(path, file, size, false, true);
+ mysql_mutex_unlock(&fil_system.mutex);
IF_WIN(node->find_metadata(), node->find_metadata(file, true));
mtr.start();
mtr.set_named_space(space);
ut_a(fsp_header_init(space, size, &mtr) == DB_SUCCESS);
mtr.commit();
return space;
+ } else {
+ mysql_mutex_unlock(&fil_system.mutex);
}
if (space_name.data()) {
@@ -2171,6 +2189,10 @@ func_exit:
must_validate = true;
}
+ const bool operation_not_for_export =
+ srv_operation != SRV_OPERATION_RESTORE_EXPORT
+ && srv_operation != SRV_OPERATION_EXPORT_RESTORED;
+
/* Always look for a file at the default location. But don't log
an error if the tablespace is already open in remote or dict. */
ut_a(df_default.filepath());
@@ -2181,6 +2203,7 @@ func_exit:
drop_garbage_tables_after_restore() a little later. */
const bool strict = validate && !tablespaces_found
+ && operation_not_for_export
&& !(srv_operation == SRV_OPERATION_NORMAL
&& srv_start_after_restore
&& srv_force_recovery < SRV_FORCE_NO_BACKGROUND
@@ -2229,7 +2252,11 @@ func_exit:
goto corrupted;
}
- os_file_get_last_error(true);
+ os_file_get_last_error(operation_not_for_export,
+ !operation_not_for_export);
+ if (!operation_not_for_export) {
+ goto corrupted;
+ }
sql_print_error("InnoDB: Could not find a valid tablespace"
" file for %.*s. %s",
static_cast<int>(name.size()), name.data(),
@@ -2307,8 +2334,10 @@ skip_validate:
first_page)
: NULL;
+ mysql_mutex_lock(&fil_system.mutex);
space = fil_space_t::create(id, flags, purpose, crypt_data);
if (!space) {
+ mysql_mutex_unlock(&fil_system.mutex);
goto error;
}
@@ -2318,6 +2347,7 @@ skip_validate:
space->add(
df_remote.is_open() ? df_remote.filepath() :
df_default.filepath(), OS_FILE_CLOSED, 0, false, true);
+ mysql_mutex_unlock(&fil_system.mutex);
if (must_validate && !srv_read_only_mode) {
df_remote.close();
@@ -2396,6 +2426,7 @@ fil_ibd_discover(
case SRV_OPERATION_RESTORE:
break;
case SRV_OPERATION_NORMAL:
+ case SRV_OPERATION_EXPORT_RESTORED:
size_t len= strlen(db);
if (len <= 4 || strcmp(db + len - 4, dot_ext[IBD])) {
break;
@@ -2602,10 +2633,13 @@ tablespace_check:
return FIL_LOAD_INVALID;
}
+ mysql_mutex_lock(&fil_system.mutex);
+
space = fil_space_t::create(
space_id, flags, FIL_TYPE_TABLESPACE, crypt_data);
if (space == NULL) {
+ mysql_mutex_unlock(&fil_system.mutex);
return(FIL_LOAD_INVALID);
}
@@ -2617,6 +2651,7 @@ tablespace_check:
let fil_node_open() do that task. */
space->add(file.filepath(), OS_FILE_CLOSED, 0, false, false);
+ mysql_mutex_unlock(&fil_system.mutex);
return(FIL_LOAD_OK);
}
diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc
index 0a4119587f8..e93ca4bc177 100644
--- a/storage/innobase/fsp/fsp0file.cc
+++ b/storage/innobase/fsp/fsp0file.cc
@@ -756,7 +756,7 @@ the double write buffer.
bool
Datafile::restore_from_doublewrite()
{
- if (srv_operation != SRV_OPERATION_NORMAL) {
+ if (srv_operation > SRV_OPERATION_EXPORT_RESTORED) {
return true;
}
diff --git a/storage/innobase/fsp/fsp0space.cc b/storage/innobase/fsp/fsp0space.cc
index 6bdf9fcc4d8..c2152b08590 100644
--- a/storage/innobase/fsp/fsp0space.cc
+++ b/storage/innobase/fsp/fsp0space.cc
@@ -88,25 +88,25 @@ Tablespace::open_or_create(bool is_temp)
ut_ad(!m_files.empty());
for (iterator it = begin(); it != end(); ++it) {
-
if (it->m_exists) {
err = it->open_or_create(
m_ignore_read_only
? false : srv_read_only_mode);
+ if (err != DB_SUCCESS) {
+ return err;
+ }
} else {
err = it->open_or_create(
m_ignore_read_only
? false : srv_read_only_mode);
- /* Set the correct open flags now that we have
- successfully created the file. */
- if (err == DB_SUCCESS) {
- file_found(*it);
+ if (err != DB_SUCCESS) {
+ return err;
}
- }
- if (err != DB_SUCCESS) {
- break;
+ /* Set the correct open flags now that we have
+ successfully created the file. */
+ file_found(*it);
}
/* We can close the handle now and open the tablespace
@@ -130,20 +130,22 @@ Tablespace::open_or_create(bool is_temp)
fsp_flags = FSP_FLAGS_PAGE_SSIZE();
}
+ mysql_mutex_lock(&fil_system.mutex);
space = fil_space_t::create(
m_space_id, fsp_flags,
is_temp
? FIL_TYPE_TEMPORARY : FIL_TYPE_TABLESPACE,
NULL);
if (!space) {
+ mysql_mutex_unlock(&fil_system.mutex);
return DB_ERROR;
}
+ } else {
+ mysql_mutex_lock(&fil_system.mutex);
}
-
- ut_a(fil_validate());
-
space->add(it->m_filepath, OS_FILE_CLOSED, it->m_size,
false, true);
+ mysql_mutex_unlock(&fil_system.mutex);
}
return(err);
diff --git a/storage/innobase/fsp/fsp0sysspace.cc b/storage/innobase/fsp/fsp0sysspace.cc
index ef650436907..9aef6f389ef 100644
--- a/storage/innobase/fsp/fsp0sysspace.cc
+++ b/storage/innobase/fsp/fsp0sysspace.cc
@@ -576,7 +576,7 @@ inline dberr_t SysTablespace::read_lsn_and_check_flags()
ut_a(it->order() == 0);
- if (srv_operation == SRV_OPERATION_NORMAL) {
+ if (srv_operation <= SRV_OPERATION_EXPORT_RESTORED) {
buf_dblwr.init_or_load_pages(it->handle(), it->filepath());
}
@@ -920,6 +920,7 @@ SysTablespace::open_or_create(
/* Close the curent handles, add space and file info to the
fil_system cache and the Data Dictionary, and re-open them
in file_system cache so that they stay open until shutdown. */
+ mysql_mutex_lock(&fil_system.mutex);
ulint node_counter = 0;
for (files_t::iterator it = begin; it != end; ++it) {
it->close();
@@ -933,7 +934,8 @@ SysTablespace::open_or_create(
FIL_TYPE_TEMPORARY, NULL);
ut_ad(space == fil_system.temp_space);
if (!space) {
- return DB_ERROR;
+ err = DB_ERROR;
+ break;
}
ut_ad(!space->is_compressed());
ut_ad(space->full_crc32());
@@ -944,12 +946,11 @@ SysTablespace::open_or_create(
FIL_TYPE_TABLESPACE, NULL);
ut_ad(space == fil_system.sys_space);
if (!space) {
- return DB_ERROR;
+ err = DB_ERROR;
+ break;
}
}
- ut_a(fil_validate());
-
uint32_t max_size = (++node_counter == m_files.size()
? (m_last_file_size_max == 0
? UINT32_MAX
@@ -960,6 +961,7 @@ SysTablespace::open_or_create(
it->m_type != SRV_NOT_RAW, true, max_size);
}
+ mysql_mutex_unlock(&fil_system.mutex);
return(err);
}
diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc
index 8623e653991..d2b90542ec6 100644
--- a/storage/innobase/fts/fts0fts.cc
+++ b/storage/innobase/fts/fts0fts.cc
@@ -38,22 +38,6 @@ Full Text Search interface
#include "dict0stats.h"
#include "btr0pcur.h"
-/** The SYNC state of the cache. There is one instance of this struct
-associated with each ADD thread. */
-struct fts_sync_t {
- /** Transaction used for SYNCing the cache to disk */
- trx_t *trx;
- /** Table with FTS index(es) */
- dict_table_t *table;
- /** Max size in bytes of the cache */
- ulint max_cache_size;
- /** The doc id at which the cache was noted as being
- full, we use this to set the upper_limit field */
- doc_id_t max_doc_id;
- /** SYNC start time; only used if fts_enable_diag_print */
- time_t start_time;
-};
-
static const ulint FTS_MAX_ID_LEN = 32;
/** Column name from the FTS config table */
@@ -201,8 +185,15 @@ struct fts_tokenize_param_t {
/** Run SYNC on the table, i.e., write out data from the cache to the
FTS auxiliary INDEX table and clear the cache at the end.
@param[in,out] sync sync state
+@param[in] unlock_cache whether unlock cache lock when write node
+@param[in] wait whether wait when a sync is in progress
@return DB_SUCCESS if all OK */
-static dberr_t fts_sync(fts_sync_t *sync);
+static
+dberr_t
+fts_sync(
+ fts_sync_t* sync,
+ bool unlock_cache,
+ bool wait);
/****************************************************************//**
Release all resources help by the words rb tree e.g., the node ilist. */
@@ -275,6 +266,7 @@ fts_cache_destroy(fts_cache_t* cache)
mysql_mutex_destroy(&cache->init_lock);
mysql_mutex_destroy(&cache->deleted_lock);
mysql_mutex_destroy(&cache->doc_id_lock);
+ pthread_cond_destroy(&cache->sync->cond);
if (cache->stopword_info.cached_stopword) {
rbt_free(cache->stopword_info.cached_stopword);
@@ -574,6 +566,7 @@ fts_index_cache_init(
for (i = 0; i < FTS_NUM_AUX_INDEX; ++i) {
ut_a(index_cache->ins_graph[i] == NULL);
+ ut_a(index_cache->sel_graph[i] == NULL);
}
}
@@ -643,6 +636,7 @@ fts_cache_create(
mem_heap_zalloc(heap, sizeof(fts_sync_t)));
cache->sync->table = table;
+ pthread_cond_init(&cache->sync->cond, nullptr);
/* Create the index cache vector that will hold the inverted indexes. */
cache->indexes = ib_vector_create(
@@ -968,6 +962,10 @@ fts_cache_index_cache_create(
mem_heap_zalloc(static_cast<mem_heap_t*>(
cache->self_heap->arg), n_bytes));
+ index_cache->sel_graph = static_cast<que_t**>(
+ mem_heap_zalloc(static_cast<mem_heap_t*>(
+ cache->self_heap->arg), n_bytes));
+
fts_index_cache_init(cache->sync_heap, index_cache);
if (cache->get_docs) {
@@ -1041,6 +1039,13 @@ fts_cache_clear(
index_cache->ins_graph[j] = NULL;
}
+
+ if (index_cache->sel_graph[j] != NULL) {
+
+ que_graph_free(index_cache->sel_graph[j]);
+
+ index_cache->sel_graph[j] = NULL;
+ }
}
index_cache->doc_stats = NULL;
@@ -1333,7 +1338,8 @@ fts_cache_add_doc(
ib_vector_last(word->nodes));
}
- if (!fts_node || fts_node->ilist_size > FTS_ILIST_MAX_SIZE
+ if (fts_node == NULL || fts_node->synced
+ || fts_node->ilist_size > FTS_ILIST_MAX_SIZE
|| doc_id < fts_node->last_doc_id) {
fts_node = static_cast<fts_node_t*>(
@@ -3320,7 +3326,7 @@ fts_add_doc_from_tuple(
if (cache->total_size > fts_max_cache_size / 5
|| fts_need_sync) {
- fts_sync(cache->sync);
+ fts_sync(cache->sync, true, false);
}
mtr_start(&mtr);
@@ -3356,7 +3362,7 @@ fts_add_doc_by_id(
dict_index_t* fts_id_index;
ibool is_id_cluster;
fts_cache_t* cache = ftt->table->fts->cache;
- bool need_sync= false;
+
ut_ad(cache->get_docs);
/* If Doc ID has been supplied by the user, then the table
@@ -3496,32 +3502,44 @@ fts_add_doc_by_id(
get_doc->index_cache,
doc_id, doc.tokens);
- /** FTS cache sync should happen
- frequently. Because user thread
- shouldn't hold the cache lock for
- longer time. So cache should sync
- whenever cache size exceeds 512 KB */
- need_sync =
- cache->total_size > 512*1024;
+ bool need_sync = !cache->sync->in_progress
+ && (fts_need_sync
+ || (cache->total_size
+ - cache->total_size_at_sync)
+ > fts_max_cache_size / 10);
+ if (need_sync) {
+ cache->total_size_at_sync =
+ cache->total_size;
+ }
mysql_mutex_unlock(&table->fts->cache->lock);
DBUG_EXECUTE_IF(
"fts_instrument_sync",
- fts_sync_table(table);
+ fts_optimize_request_sync_table(table);
+ mysql_mutex_lock(&cache->lock);
+ if (cache->sync->in_progress)
+ my_cond_wait(
+ &cache->sync->cond,
+ &cache->lock.m_mutex);
+ mysql_mutex_unlock(&cache->lock);
);
DBUG_EXECUTE_IF(
"fts_instrument_sync_debug",
- fts_sync(cache->sync);
+ fts_sync(cache->sync, true, true);
);
DEBUG_SYNC_C("fts_instrument_sync_request");
DBUG_EXECUTE_IF(
"fts_instrument_sync_request",
- need_sync= true;
+ fts_optimize_request_sync_table(table);
);
+ if (need_sync) {
+ fts_optimize_request_sync_table(table);
+ }
+
mtr_start(&mtr);
if (i < num_idx - 1) {
@@ -3547,10 +3565,6 @@ func_exit:
ut_free(pcur.old_rec_buf);
mem_heap_free(heap);
-
- if (need_sync) {
- fts_sync_table(table);
- }
}
@@ -3910,13 +3924,15 @@ static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_sync_write_words(
trx_t* trx,
- fts_index_cache_t* index_cache)
+ fts_index_cache_t* index_cache,
+ bool unlock_cache)
{
fts_table_t fts_table;
ulint n_nodes = 0;
ulint n_words = 0;
const ib_rbt_node_t* rbt_node;
dberr_t error = DB_SUCCESS;
+ ibool print_error = FALSE;
dict_table_t* table = index_cache->index->table;
FTS_INIT_INDEX_TABLE(
@@ -3947,36 +3963,53 @@ fts_sync_write_words(
fts_table.suffix = fts_get_suffix(selected);
+ /* We iterate over all the nodes even if there was an error */
for (i = 0; i < ib_vector_size(word->nodes); ++i) {
fts_node_t* fts_node = static_cast<fts_node_t*>(
ib_vector_get(word->nodes, i));
- error = fts_write_node(
- trx, &index_cache->ins_graph[selected],
- &fts_table, &word->text, fts_node);
+ if (fts_node->synced) {
+ continue;
+ } else {
+ fts_node->synced = true;
+ }
+
+ /*FIXME: we need to handle the error properly. */
+ if (error == DB_SUCCESS) {
+ if (unlock_cache) {
+ mysql_mutex_unlock(
+ &table->fts->cache->lock);
+ }
+
+ error = fts_write_node(
+ trx,
+ &index_cache->ins_graph[selected],
+ &fts_table, &word->text, fts_node);
- DEBUG_SYNC_C("fts_write_node");
- DBUG_EXECUTE_IF("fts_write_node_crash",
+ DEBUG_SYNC_C("fts_write_node");
+ DBUG_EXECUTE_IF("fts_write_node_crash",
DBUG_SUICIDE(););
- DBUG_EXECUTE_IF("fts_instrument_sync_sleep",
+ DBUG_EXECUTE_IF(
+ "fts_instrument_sync_sleep",
std::this_thread::sleep_for(
std::chrono::seconds(1)););
- if (error != DB_SUCCESS) {
- goto err_exit;
+ if (unlock_cache) {
+ mysql_mutex_lock(
+ &table->fts->cache->lock);
+ }
}
}
n_nodes += ib_vector_size(word->nodes);
- if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
-err_exit:
+ if (UNIV_UNLIKELY(error != DB_SUCCESS) && !print_error) {
ib::error() << "(" << error << ") writing"
" word node to FTS auxiliary index table "
<< table->name;
- break;
+ print_error = TRUE;
}
}
@@ -4035,44 +4068,58 @@ fts_sync_index(
ut_ad(rbt_validate(index_cache->words));
- return(fts_sync_write_words(trx, index_cache));
+ return(fts_sync_write_words(trx, index_cache, sync->unlock_cache));
}
-/** Rollback a sync operation
-@param[in,out] sync sync state */
+/** Check if index cache has been synced completely
+@param[in,out] index_cache index cache
+@return true if index is synced, otherwise false. */
static
-void
-fts_sync_rollback(
- fts_sync_t* sync)
+bool
+fts_sync_index_check(
+ fts_index_cache_t* index_cache)
{
- trx_t* trx = sync->trx;
- fts_cache_t* cache = sync->table->fts->cache;
-
- for (ulint i = 0; i < ib_vector_size(cache->indexes); ++i) {
- ulint j;
- fts_index_cache_t* index_cache;
-
- index_cache = static_cast<fts_index_cache_t*>(
- ib_vector_get(cache->indexes, i));
+ const ib_rbt_node_t* rbt_node;
- for (j = 0; fts_index_selector[j].value; ++j) {
+ for (rbt_node = rbt_first(index_cache->words);
+ rbt_node != NULL;
+ rbt_node = rbt_next(index_cache->words, rbt_node)) {
- if (index_cache->ins_graph[j] != NULL) {
+ fts_tokenizer_word_t* word;
+ word = rbt_value(fts_tokenizer_word_t, rbt_node);
- que_graph_free(index_cache->ins_graph[j]);
+ fts_node_t* fts_node;
+ fts_node = static_cast<fts_node_t*>(ib_vector_last(word->nodes));
- index_cache->ins_graph[j] = NULL;
- }
+ if (!fts_node->synced) {
+ return(false);
}
}
- mysql_mutex_unlock(&cache->lock);
+ return(true);
+}
- fts_sql_rollback(trx);
+/** Reset synced flag in index cache when rollback
+@param[in,out] index_cache index cache */
+static
+void
+fts_sync_index_reset(
+ fts_index_cache_t* index_cache)
+{
+ const ib_rbt_node_t* rbt_node;
- /* Avoid assertion in trx_t::free(). */
- trx->dict_operation_lock_mode = false;
- trx->free();
+ for (rbt_node = rbt_first(index_cache->words);
+ rbt_node != NULL;
+ rbt_node = rbt_next(index_cache->words, rbt_node)) {
+
+ fts_tokenizer_word_t* word;
+ word = rbt_value(fts_tokenizer_word_t, rbt_node);
+
+ fts_node_t* fts_node;
+ fts_node = static_cast<fts_node_t*>(ib_vector_last(word->nodes));
+
+ fts_node->synced = false;
+ }
}
/** Commit the SYNC, change state of processed doc ids etc.
@@ -4105,20 +4152,19 @@ fts_sync_commit(
sync, cache->deleted_doc_ids);
}
+ /* We need to do this within the deleted lock since fts_delete() can
+ attempt to add a deleted doc id to the cache deleted id array. */
+ fts_cache_clear(cache);
+ DEBUG_SYNC_C("fts_deleted_doc_ids_clear");
+ fts_cache_init(cache);
+ mysql_mutex_unlock(&cache->lock);
+
if (UNIV_LIKELY(error == DB_SUCCESS)) {
- /* We need to do this within the deleted lock
- since fts_delete() can attempt to add a deleted
- doc id to the cache deleted id array. */
- fts_cache_clear(cache);
- DEBUG_SYNC_C("fts_deleted_doc_ids_clear");
- fts_cache_init(cache);
- mysql_mutex_unlock(&cache->lock);
fts_sql_commit(trx);
} else {
+ fts_sql_rollback(trx);
ib::error() << "(" << error << ") during SYNC of "
"table " << sync->table->name;
- fts_sync_rollback(sync);
- return error;
}
if (UNIV_UNLIKELY(fts_enable_diag_print) && elapsed_time) {
@@ -4138,13 +4184,66 @@ fts_sync_commit(
return(error);
}
+/** Rollback a sync operation
+@param[in,out] sync sync state */
+static
+void
+fts_sync_rollback(
+ fts_sync_t* sync)
+{
+ trx_t* trx = sync->trx;
+ fts_cache_t* cache = sync->table->fts->cache;
+
+ for (ulint i = 0; i < ib_vector_size(cache->indexes); ++i) {
+ ulint j;
+ fts_index_cache_t* index_cache;
+
+ index_cache = static_cast<fts_index_cache_t*>(
+ ib_vector_get(cache->indexes, i));
+
+ /* Reset synced flag so nodes will not be skipped
+ in the next sync, see fts_sync_write_words(). */
+ fts_sync_index_reset(index_cache);
+
+ for (j = 0; fts_index_selector[j].value; ++j) {
+
+ if (index_cache->ins_graph[j] != NULL) {
+
+ que_graph_free(index_cache->ins_graph[j]);
+
+ index_cache->ins_graph[j] = NULL;
+ }
+
+ if (index_cache->sel_graph[j] != NULL) {
+
+ que_graph_free(index_cache->sel_graph[j]);
+
+ index_cache->sel_graph[j] = NULL;
+ }
+ }
+ }
+
+ mysql_mutex_unlock(&cache->lock);
+
+ fts_sql_rollback(trx);
+
+ /* Avoid assertion in trx_t::free(). */
+ trx->dict_operation_lock_mode = false;
+ trx->free();
+}
+
/** Run SYNC on the table, i.e., write out data from the cache to the
FTS auxiliary INDEX table and clear the cache at the end.
@param[in,out] sync sync state
@param[in] unlock_cache whether unlock cache lock when write node
@param[in] wait whether wait when a sync is in progress
@return DB_SUCCESS if all OK */
-static dberr_t fts_sync(fts_sync_t *sync)
+static
+dberr_t
+fts_sync(
+ fts_sync_t* sync,
+ bool unlock_cache,
+ bool wait)
{
if (srv_read_only_mode) {
return DB_READ_ONLY;
@@ -4155,13 +4254,33 @@ static dberr_t fts_sync(fts_sync_t *sync)
fts_cache_t* cache = sync->table->fts->cache;
mysql_mutex_lock(&cache->lock);
+
+ /* Check if cache is being synced.
+ Note: we release cache lock in fts_sync_write_words() to
+ avoid long wait for the lock by other threads. */
+ if (sync->in_progress) {
+ if (!wait) {
+ mysql_mutex_unlock(&cache->lock);
+ return(DB_SUCCESS);
+ }
+ do {
+ my_cond_wait(&sync->cond, &cache->lock.m_mutex);
+ } while (sync->in_progress);
+ }
+
+ sync->unlock_cache = unlock_cache;
+ sync->in_progress = true;
+
DEBUG_SYNC_C("fts_sync_begin");
fts_sync_begin(sync);
+begin_sync:
const size_t fts_cache_size= fts_max_cache_size;
if (cache->total_size > fts_cache_size) {
/* Avoid the case: sync never finish when
insert/update keeps comming. */
+ ut_ad(sync->unlock_cache);
+ sync->unlock_cache = false;
ib::warn() << "Total InnoDB FTS size "
<< cache->total_size << " for the table "
<< cache->sync->table->name
@@ -4185,23 +4304,52 @@ static dberr_t fts_sync(fts_sync_t *sync)
error = fts_sync_index(sync, index_cache);
if (error != DB_SUCCESS) {
- goto err_exit;
+ goto end_sync;
+ }
+
+ if (!sync->unlock_cache
+ && cache->total_size < fts_max_cache_size) {
+ /* Reset the unlock cache if the value
+ is less than innodb_ft_cache_size */
+ sync->unlock_cache = true;
}
}
DBUG_EXECUTE_IF("fts_instrument_sync_interrupted",
+ sync->interrupted = true;
error = DB_INTERRUPTED;
- goto err_exit;
+ goto end_sync;
);
- if (error == DB_SUCCESS) {
+ /* Make sure all the caches are synced. */
+ for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
+ fts_index_cache_t* index_cache;
+
+ index_cache = static_cast<fts_index_cache_t*>(
+ ib_vector_get(cache->indexes, i));
+
+ if (index_cache->index->to_be_dropped
+ || fts_sync_index_check(index_cache)) {
+ continue;
+ }
+
+ goto begin_sync;
+ }
+
+end_sync:
+ if (error == DB_SUCCESS && !sync->interrupted) {
error = fts_sync_commit(sync);
} else {
-err_exit:
fts_sync_rollback(sync);
- return error;
}
+ mysql_mutex_lock(&cache->lock);
+ ut_ad(sync->in_progress);
+ sync->interrupted = false;
+ sync->in_progress = false;
+ pthread_cond_broadcast(&sync->cond);
+ mysql_mutex_unlock(&cache->lock);
+
/* We need to check whether an optimize is required, for that
we make copies of the two variables that control the trigger. These
variables can change behind our back and we don't want to hold the
@@ -4213,7 +4361,6 @@ err_exit:
mysql_mutex_unlock(&cache->deleted_lock);
- DEBUG_SYNC_C("fts_sync_end");
return(error);
}
@@ -4222,12 +4369,12 @@ FTS auxiliary INDEX table and clear the cache at the end.
@param[in,out] table fts table
@param[in] wait whether wait for existing sync to finish
@return DB_SUCCESS on success, error code on failure. */
-dberr_t fts_sync_table(dict_table_t* table)
+dberr_t fts_sync_table(dict_table_t* table, bool wait)
{
ut_ad(table->fts);
return table->space && !table->corrupted && table->fts->cache
- ? fts_sync(table->fts->cache->sync)
+ ? fts_sync(table->fts->cache->sync, !wait, wait)
: DB_SUCCESS;
}
diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc
index 7c40a25e6e7..fe31767d901 100644
--- a/storage/innobase/fts/fts0opt.cc
+++ b/storage/innobase/fts/fts0opt.cc
@@ -83,8 +83,9 @@ enum fts_msg_type_t {
FTS_MSG_ADD_TABLE, /*!< Add table to the optimize thread's
work queue */
- FTS_MSG_DEL_TABLE /*!< Remove a table from the optimize
+ FTS_MSG_DEL_TABLE, /*!< Remove a table from the optimize
threads work queue */
+ FTS_MSG_SYNC_TABLE /*!< Sync fts cache of a table */
};
/** Compressed list of words that have been read from FTS INDEX
@@ -2624,6 +2625,36 @@ fts_optimize_remove_table(
mysql_mutex_unlock(&fts_optimize_wq->mutex);
}
+/** Send sync fts cache for the table.
+@param[in] table table to sync */
+void
+fts_optimize_request_sync_table(
+ dict_table_t* table)
+{
+ /* if the optimize system not yet initialized, return */
+ if (!fts_optimize_wq) {
+ return;
+ }
+
+ mysql_mutex_lock(&fts_optimize_wq->mutex);
+
+ /* FTS optimizer thread is already exited */
+ if (fts_opt_start_shutdown) {
+ ib::info() << "Try to sync table " << table->name
+ << " after FTS optimize thread exiting.";
+ } else if (table->fts->sync_message) {
+ /* If the table already has SYNC message in
+ fts_optimize_wq queue then ignore it */
+ } else {
+ add_msg(fts_optimize_create_msg(FTS_MSG_SYNC_TABLE, table));
+ table->fts->sync_message = true;
+ DBUG_EXECUTE_IF("fts_optimize_wq_count_check",
+ DBUG_ASSERT(fts_optimize_wq->length <= 1000););
+ }
+
+ mysql_mutex_unlock(&fts_optimize_wq->mutex);
+}
+
/** Add a table to fts_slots if it doesn't already exist. */
static bool fts_optimize_new_table(dict_table_t* table)
{
@@ -2765,8 +2796,7 @@ static void fts_optimize_sync_table(dict_table_t *table,
if (sync_table->fts && sync_table->fts->cache && sync_table->is_accessible())
{
- fts_sync_table(sync_table);
-
+ fts_sync_table(sync_table, false);
if (process_message)
{
mysql_mutex_lock(&fts_optimize_wq->mutex);
@@ -2866,6 +2896,24 @@ retry_later:
--n_tables;
}
break;
+
+ case FTS_MSG_SYNC_TABLE:
+ if (UNIV_UNLIKELY(wsrep_sst_disable_writes)) {
+ add_msg(msg);
+ goto retry_later;
+ }
+
+ DBUG_EXECUTE_IF(
+ "fts_instrument_msg_sync_sleep",
+ std::this_thread::sleep_for(
+ std::chrono::milliseconds(
+ 300)););
+
+ fts_optimize_sync_table(
+ static_cast<dict_table_t*>(msg->ptr),
+ true);
+ break;
+
default:
ut_error;
}
@@ -2998,7 +3046,7 @@ void fts_sync_during_ddl(dict_table_t* table)
if (!sync_message)
return;
- fts_sync_table(table);
+ fts_sync_table(table, false);
mysql_mutex_lock(&fts_optimize_wq->mutex);
table->fts->sync_message = false;
diff --git a/storage/innobase/gis/gis0rtree.cc b/storage/innobase/gis/gis0rtree.cc
index 60218a132c9..f75eab07cf3 100644
--- a/storage/innobase/gis/gis0rtree.cc
+++ b/storage/innobase/gis/gis0rtree.cc
@@ -1468,7 +1468,8 @@ rtr_ins_enlarge_mbr(
/* Check path info is not empty. */
ut_ad(!btr_cur->rtr_info->parent_path->empty());
- ut_ad(btr_cur->rtr_info->thr || !btr_cur->index()->is_committed());
+ ut_ad(btr_cur->rtr_info->thr || !btr_cur->index()->is_committed()
+ || btr_cur->index()->table->name.is_temporary());
/* Create a memory heap. */
heap = mem_heap_create(1024);
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 211126765f8..6345435af97 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -526,6 +526,7 @@ mysql_pfs_key_t trx_pool_manager_mutex_key;
mysql_pfs_key_t lock_wait_mutex_key;
mysql_pfs_key_t trx_sys_mutex_key;
mysql_pfs_key_t srv_threads_mutex_key;
+mysql_pfs_key_t tpool_cache_mutex_key;
/* all_innodb_mutexes array contains mutexes that are
performance schema instrumented if "UNIV_PFS_MUTEX"
@@ -557,6 +558,7 @@ static PSI_mutex_info all_innodb_mutexes[] = {
PSI_KEY(rtr_match_mutex),
PSI_KEY(rtr_path_mutex),
PSI_KEY(trx_sys_mutex),
+ PSI_KEY(tpool_cache_mutex),
};
# endif /* UNIV_PFS_MUTEX */
@@ -1527,6 +1529,7 @@ static void innodb_drop_database(handlerton*, char *path)
mtr.commit();
for (pfs_os_file_t detached : to_close)
os_file_close(detached);
+
/* Any changes must be persisted before we return. */
log_write_up_to(mtr.commit_lsn(), true);
}
@@ -2036,7 +2039,7 @@ static void innodb_ddl_recovery_done(handlerton*)
{
ut_ad(!ddl_recovery_done);
ut_d(ddl_recovery_done= true);
- if (!srv_read_only_mode && srv_operation == SRV_OPERATION_NORMAL &&
+ if (!srv_read_only_mode && srv_operation <= SRV_OPERATION_EXPORT_RESTORED &&
srv_force_recovery < SRV_FORCE_NO_BACKGROUND)
{
if (srv_start_after_restore && !high_level_read_only)
@@ -8439,6 +8442,37 @@ wsrep_calc_row_hash(
return(0);
}
+
+/** Append table-level exclusive key.
+@param thd MySQL thread handle
+@param table table
+@retval false on success
+@retval true on failure */
+ATTRIBUTE_COLD bool wsrep_append_table_key(MYSQL_THD thd, const dict_table_t &table)
+{
+ char db_buf[NAME_LEN + 1];
+ char tbl_buf[NAME_LEN + 1];
+ ulint db_buf_len, tbl_buf_len;
+
+ if (!table.parse_name(db_buf, tbl_buf, &db_buf_len, &tbl_buf_len))
+ {
+ WSREP_ERROR("Parse_name for table key append failed: %s",
+ wsrep_thd_query(thd));
+ return true;
+ }
+
+ /* Append table-level exclusive key */
+ const int rcode = wsrep_thd_append_table_key(thd, db_buf,
+ tbl_buf, WSREP_SERVICE_KEY_EXCLUSIVE);
+ if (rcode)
+ {
+ WSREP_ERROR("Appending table key failed: %s, %d",
+ wsrep_thd_query(thd), rcode);
+ return true;
+ }
+
+ return false;
+}
#endif /* WITH_WSREP */
/**
@@ -8609,11 +8643,16 @@ func_exit:
&& !wsrep_thd_ignore_table(m_user_thd)) {
DBUG_PRINT("wsrep", ("update row key"));
- if (wsrep_append_keys(m_user_thd,
- wsrep_protocol_version >= 4
- ? WSREP_SERVICE_KEY_UPDATE
- : WSREP_SERVICE_KEY_EXCLUSIVE,
- old_row, new_row)){
+ /* We use table-level exclusive key for SEQUENCES
+ and normal key append for others. */
+ if (table->s->table_type == TABLE_TYPE_SEQUENCE) {
+ if (wsrep_append_table_key(m_user_thd, *m_prebuilt->table))
+ DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
+ } else if (wsrep_append_keys(m_user_thd,
+ wsrep_protocol_version >= 4
+ ? WSREP_SERVICE_KEY_UPDATE
+ : WSREP_SERVICE_KEY_EXCLUSIVE,
+ old_row, new_row)) {
WSREP_DEBUG("WSREP: UPDATE_ROW_KEY FAILED");
DBUG_PRINT("wsrep", ("row key failed"));
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
@@ -17821,44 +17860,6 @@ exit:
return;
}
-/** Validate SET GLOBAL innodb_buffer_pool_filename.
-On Windows, file names with colon (:) are not allowed.
-@param thd connection
-@param save &srv_buf_dump_filename
-@param value new value to be validated
-@return 0 for valid name */
-static int innodb_srv_buf_dump_filename_validate(THD *thd, st_mysql_sys_var*,
- void *save,
- st_mysql_value *value)
-{
- char buff[OS_FILE_MAX_PATH];
- int len= sizeof buff;
-
- if (const char *buf_name= value->val_str(value, buff, &len))
- {
-#ifdef _WIN32
- if (!is_filename_allowed(buf_name, len, FALSE))
- {
- push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
- ER_WRONG_ARGUMENTS,
- "InnoDB: innodb_buffer_pool_filename "
- "cannot have colon (:) in the file name.");
- return 1;
- }
-#endif /* _WIN32 */
- if (buf_name == buff)
- {
- ut_ad(static_cast<size_t>(len) < sizeof buff);
- buf_name= thd_strmake(thd, buf_name, len);
- }
-
- *static_cast<const char**>(save)= buf_name;
- return 0;
- }
-
- return 1;
-}
-
#ifdef UNIV_DEBUG
static char* srv_buffer_pool_evict;
@@ -18975,9 +18976,9 @@ static MYSQL_SYSVAR_SIZE_T(buffer_pool_chunk_size, srv_buf_pool_chunk_unit,
0, 0, SIZE_T_MAX, 1024 * 1024);
static MYSQL_SYSVAR_STR(buffer_pool_filename, srv_buf_dump_filename,
- PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Filename to/from which to dump/load the InnoDB buffer pool",
- innodb_srv_buf_dump_filename_validate, NULL, SRV_BUF_DUMP_FILENAME_DEFAULT);
+ NULL, NULL, SRV_BUF_DUMP_FILENAME_DEFAULT);
static MYSQL_SYSVAR_BOOL(buffer_pool_dump_now, innodb_buffer_pool_dump_now,
PLUGIN_VAR_RQCMDARG,
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 5ce41a9857c..406baf3e662 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -11604,8 +11604,12 @@ foreign_fail:
ut_d(dict_table_check_for_dup_indexes(
ctx->new_table, CHECK_ABORTED_OK));
- ut_ad(!ctx->new_table->fts
- || fts_check_cached_index(ctx->new_table));
+#ifdef UNIV_DEBUG
+ if (!(ctx->new_table->fts != NULL
+ && ctx->new_table->fts->cache->sync->in_progress)) {
+ ut_a(fts_check_cached_index(ctx->new_table));
+ }
+#endif
}
unlock_and_close_files(deleted, trx);
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
index 589182b73ba..2786c26271d 100644
--- a/storage/innobase/handler/i_s.cc
+++ b/storage/innobase/handler/i_s.cc
@@ -4923,10 +4923,10 @@ static ST_FIELD_INFO innodb_sysindex_fields_info[]=
Column("N_FIELDS", SLong(), NOT_NULL),
#define SYS_INDEX_PAGE_NO 5
- Column("PAGE_NO", SLong(), NOT_NULL),
+ Column("PAGE_NO", SLong(), NULLABLE),
#define SYS_INDEX_SPACE 6
- Column("SPACE", SLong(), NOT_NULL),
+ Column("SPACE", SLong(), NULLABLE),
#define SYS_INDEX_MERGE_THRESHOLD 7
Column("MERGE_THRESHOLD", SLong(), NOT_NULL),
@@ -4978,12 +4978,14 @@ i_s_dict_fill_sys_indexes(
if (index->page == FIL_NULL) {
fields[SYS_INDEX_PAGE_NO]->set_null();
} else {
+ fields[SYS_INDEX_PAGE_NO]->set_notnull();
OK(fields[SYS_INDEX_PAGE_NO]->store(index->page, true));
}
- if (space_id == ULINT_UNDEFINED) {
+ if (space_id == FIL_NULL) {
fields[SYS_INDEX_SPACE]->set_null();
} else {
+ fields[SYS_INDEX_SPACE]->set_notnull();
OK(fields[SYS_INDEX_SPACE]->store(space_id, true));
}
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index 420d4a388e8..9ff65ce7c9c 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -1592,8 +1592,6 @@ public:
/** map of block->frame to buf_block_t blocks that belong
to buf_buddy_alloc(); protected by buf_pool.mutex */
hash_table_t zip_hash;
- /** number of pending read operations */
- Atomic_counter<ulint> n_pend_reads;
Atomic_counter<ulint>
n_pend_unzip; /*!< number of pending decompressions */
@@ -1620,7 +1618,7 @@ public:
/** flush_list size in bytes; protected by flush_list_mutex */
ulint flush_list_bytes;
/** possibly modified persistent pages (a subset of LRU);
- buf_dblwr.pending_writes() is approximately COUNT(is_write_fixed()) */
+ os_aio_pending_writes() is approximately COUNT(is_write_fixed()) */
UT_LIST_BASE_NODE_T(buf_page_t) flush_list;
/** number of blocks ever added to flush_list;
sometimes protected by flush_list_mutex */
@@ -1776,18 +1774,6 @@ public:
/** Reserve a buffer. */
buf_tmp_buffer_t *io_buf_reserve() { return io_buf.reserve(); }
- /** @return whether any I/O is pending */
- bool any_io_pending()
- {
- if (n_pend_reads)
- return true;
- mysql_mutex_lock(&flush_list_mutex);
- const bool any_pending= page_cleaner_status > PAGE_CLEANER_IDLE ||
- buf_dblwr.pending_writes();
- mysql_mutex_unlock(&flush_list_mutex);
- return any_pending;
- }
-
/** Remove a block from flush_list.
@param bpage buffer pool page */
void delete_from_flush_list(buf_page_t *bpage) noexcept;
diff --git a/storage/innobase/include/buf0dblwr.h b/storage/innobase/include/buf0dblwr.h
index d9c9239c0b4..9932b0e521f 100644
--- a/storage/innobase/include/buf0dblwr.h
+++ b/storage/innobase/include/buf0dblwr.h
@@ -66,16 +66,10 @@ class buf_dblwr_t
bool batch_running;
/** number of expected flush_buffered_writes_completed() calls */
unsigned flushing_buffered_writes;
- /** pages submitted to flush_buffered_writes() */
- ulint pages_submitted;
/** number of flush_buffered_writes_completed() calls */
ulint writes_completed;
/** number of pages written by flush_buffered_writes_completed() */
ulint pages_written;
- /** condition variable for !writes_pending */
- pthread_cond_t write_cond;
- /** number of pending page writes */
- size_t writes_pending;
slot slots[2];
slot *active_slot;
@@ -98,9 +92,6 @@ public:
/** Acquire the mutex */
void lock() { mysql_mutex_lock(&mutex); }
- /** @return the number of submitted page writes */
- ulint submitted() const
- { mysql_mutex_assert_owner(&mutex); return pages_submitted; }
/** @return the number of completed batches */
ulint batches() const
{ mysql_mutex_assert_owner(&mutex); return writes_completed; }
@@ -124,7 +115,7 @@ public:
void recover();
/** Update the doublewrite buffer on data page write completion. */
- void write_completed(bool with_doublewrite);
+ void write_completed();
/** Flush possible buffered writes to persistent storage.
It is very important to call this function after a batch of writes has been
posted, and also when we may have to wait for a page latch!
@@ -167,40 +158,6 @@ public:
my_cond_wait(&cond, &mutex.m_mutex);
mysql_mutex_unlock(&mutex);
}
-
- /** Register an unbuffered page write */
- void add_unbuffered()
- {
- mysql_mutex_lock(&mutex);
- writes_pending++;
- mysql_mutex_unlock(&mutex);
- }
-
- size_t pending_writes()
- {
- mysql_mutex_lock(&mutex);
- const size_t pending{writes_pending};
- mysql_mutex_unlock(&mutex);
- return pending;
- }
-
- /** Wait for writes_pending to reach 0 */
- void wait_for_page_writes()
- {
- mysql_mutex_lock(&mutex);
- while (writes_pending)
- my_cond_wait(&write_cond, &mutex.m_mutex);
- mysql_mutex_unlock(&mutex);
- }
-
- /** Wait for writes_pending to reach 0 */
- void wait_for_page_writes(const timespec &abstime)
- {
- mysql_mutex_lock(&mutex);
- while (writes_pending)
- my_cond_timedwait(&write_cond, &mutex.m_mutex, &abstime);
- mysql_mutex_unlock(&mutex);
- }
};
/** The doublewrite buffer */
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
index f53279ecb88..e4e0b2c9c74 100644
--- a/storage/innobase/include/fil0fil.h
+++ b/storage/innobase/include/fil0fil.h
@@ -597,8 +597,7 @@ private:
@return number of pending operations, possibly with NEEDS_FSYNC flag */
uint32_t set_closing()
{
- return n_pending.fetch_or(CLOSING, std::memory_order_acquire) &
- (PENDING | NEEDS_FSYNC);
+ return n_pending.fetch_or(CLOSING, std::memory_order_acquire);
}
public:
@@ -1470,6 +1469,7 @@ public:
if (space_list_last_opened == space)
{
+ ut_ad(s != space_list.begin());
space_list_t::iterator prev= s;
space_list_last_opened= &*--prev;
}
diff --git a/storage/innobase/include/fts0fts.h b/storage/innobase/include/fts0fts.h
index 720fe7f25b9..c0151b44063 100644
--- a/storage/innobase/include/fts0fts.h
+++ b/storage/innobase/include/fts0fts.h
@@ -648,6 +648,12 @@ fts_optimize_remove_table(
void
fts_optimize_shutdown();
+/** Send sync fts cache for the table.
+@param[in] table table to sync */
+void
+fts_optimize_request_sync_table(
+ dict_table_t* table);
+
/**********************************************************************//**
Take a FTS savepoint. */
void
@@ -702,8 +708,9 @@ fts_savepoint_rollback_last_stmt(
/** Run SYNC on the table, i.e., write out data from the cache to the
FTS auxiliary INDEX table and clear the cache at the end.
@param[in,out] table fts table
+@param[in] wait whether to wait for existing sync to finish
@return DB_SUCCESS on success, error code on failure. */
-dberr_t fts_sync_table(dict_table_t* table);
+dberr_t fts_sync_table(dict_table_t* table, bool wait = true);
/****************************************************************//**
Create an FTS index cache. */
diff --git a/storage/innobase/include/fts0types.h b/storage/innobase/include/fts0types.h
index 04e99d595c5..fb278d543c4 100644
--- a/storage/innobase/include/fts0types.h
+++ b/storage/innobase/include/fts0types.h
@@ -75,6 +75,7 @@ struct fts_index_cache_t {
que_t** ins_graph; /*!< Insert query graphs */
+ que_t** sel_graph; /*!< Select query graphs */
CHARSET_INFO* charset; /*!< charset */
};
@@ -86,7 +87,35 @@ struct fts_stopword_t {
CHARSET_INFO* charset; /*!< charset for stopword */
};
-struct fts_sync_t;
+/** The SYNC state of the cache. There is one instance of this struct
+associated with each ADD thread. */
+struct fts_sync_t {
+ trx_t* trx; /*!< The transaction used for SYNCing
+ the cache to disk */
+ dict_table_t* table; /*!< Table with FTS index(es) */
+ ulint max_cache_size; /*!< Max size in bytes of the cache */
+ ibool cache_full; /*!< flag, when true it indicates that
+ we need to sync the cache to disk */
+ ulint lower_index; /*!< the start index of the doc id
+ vector from where to start adding
+ documents to the FTS cache */
+ ulint upper_index; /*!< max index of the doc id vector to
+ add to the FTS cache */
+ ibool interrupted; /*!< TRUE if SYNC was interrupted */
+ doc_id_t min_doc_id; /*!< The smallest doc id added to the
+ cache. It should equal to
+ doc_ids[lower_index] */
+ doc_id_t max_doc_id; /*!< The doc id at which the cache was
+ noted as being full, we use this to
+ set the upper_limit field */
+ time_t start_time; /*!< SYNC start time; only used if
+ fts_enable_diag_print */
+ bool in_progress; /*!< flag whether sync is in progress.*/
+ bool unlock_cache; /*!< flag whether unlock cache when
+ write fts node */
+ /** condition variable for in_progress; used with table->fts->cache->lock */
+ pthread_cond_t cond;
+};
/** The cache for the FTS system. It is a memory-based inverted index
that new entries are added to, until it grows over the configured maximum
@@ -175,6 +204,7 @@ struct fts_node_t {
ulint ilist_size_alloc;
/*!< Allocated size of ilist in
bytes */
+ bool synced; /*!< flag whether the node is synced */
};
/** A tokenizer word. Contains information about one word. */
diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h
index da9dec05827..d5239ec3f9a 100644
--- a/storage/innobase/include/ha_prototypes.h
+++ b/storage/innobase/include/ha_prototypes.h
@@ -462,5 +462,15 @@ void destroy_background_thd(MYSQL_THD thd);
void
innobase_reset_background_thd(MYSQL_THD);
+#ifdef WITH_WSREP
+/** Append table-level exclusive key.
+@param thd MySQL thread handle
+@param table table
+@retval false on success
+@retval true on failure */
+struct dict_table_t;
+bool wsrep_append_table_key(MYSQL_THD thd, const dict_table_t &table);
+#endif /* WITH_WSREP */
+
#endif /* !UNIV_INNOCHECKSUM */
#endif /* HA_INNODB_PROTOTYPES_H */
diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h
index 8afa92abc93..cd596b4db46 100644
--- a/storage/innobase/include/log0log.h
+++ b/storage/innobase/include/log0log.h
@@ -382,7 +382,6 @@ public:
lsn_t get_lsn(std::memory_order order= std::memory_order_relaxed) const
{ return lsn.load(order); }
- void set_lsn(lsn_t lsn) { this->lsn.store(lsn, std::memory_order_release); }
lsn_t get_flushed_lsn(std::memory_order order= std::memory_order_acquire)
const noexcept
@@ -519,11 +518,10 @@ public:
/** Redo log system */
extern log_t log_sys;
-inline void log_free_check()
-{
- if (log_sys.check_flush_or_checkpoint())
- log_check_margins();
-}
+/** Wait for a log checkpoint if needed.
+NOTE that this function may only be called while not holding
+any synchronization objects except dict_sys.latch. */
+void log_free_check();
/** Release the latches that protect log resizing. */
void log_resize_release();
diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h
index 5576560dca8..81f1f2b0dc9 100644
--- a/storage/innobase/include/mtr0mtr.h
+++ b/storage/innobase/include/mtr0mtr.h
@@ -93,10 +93,16 @@ struct mtr_t {
ATTRIBUTE_COLD void commit_shrink(fil_space_t &space);
/** Commit a mini-transaction that is deleting or renaming a file.
- @param space tablespace that is being renamed or deleted
- @param name new file name (nullptr=the file will be deleted)
+ @param space tablespace that is being renamed or deleted
+ @param name new file name (nullptr=the file will be deleted)
+ @param detached_handle if detached_handle != nullptr and if space is detached
+ during the function execution the file handle if its
+ node will be set to OS_FILE_CLOSED, and the previous
+ value of the file handle will be assigned to the
+ address, pointed by detached_handle.
@return whether the operation succeeded */
- ATTRIBUTE_COLD bool commit_file(fil_space_t &space, const char *name);
+ ATTRIBUTE_COLD bool commit_file(fil_space_t &space, const char *name,
+ pfs_os_file_t *detached_handle= nullptr);
/** Commit a mini-transaction that did not modify any pages,
but generated some redo log on a higher level, such as
@@ -326,7 +332,7 @@ public:
{
mtr_memo_slot_t &slot= m_memo[savepoint];
ut_ad(slot.type <= MTR_MEMO_BUF_FIX);
- ut_ad(type <= MTR_MEMO_BUF_FIX);
+ ut_ad(type < MTR_MEMO_S_LOCK);
slot.type= type;
}
diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h
index c0e5f7683a9..13f9d3de3f8 100644
--- a/storage/innobase/include/os0file.h
+++ b/storage/innobase/include/os0file.h
@@ -933,13 +933,14 @@ os_file_flush_func(
/** Retrieves the last error number if an error occurs in a file io function.
The number should be retrieved before any other OS calls (because they may
overwrite the error number). If the number is not known to this program,
-the OS error number + 100 is returned.
-@param[in] report true if we want an error message printed
- for all errors
-@return error number, or OS error number + 100 */
-ulint
-os_file_get_last_error(
- bool report);
+the OS error number + OS_FILE_ERROR_MAX is returned.
+@param[in] report_all_errors true if we want an error message
+ printed of all errors
+@param[in] on_error_silent true then don't print any diagnostic
+ to the log
+@return error number, or OS error number + OS_FILE_ERROR_MAX */
+ulint os_file_get_last_error(bool report_all_errors,
+ bool on_error_silent= false);
/** NOTE! Use the corresponding macro os_file_read(), not directly this
function!
@@ -1048,11 +1049,20 @@ void os_aio_free();
@retval DB_IO_ERROR on I/O error */
dberr_t os_aio(const IORequest &type, void *buf, os_offset_t offset, size_t n);
-/** Wait until there are no pending asynchronous writes. */
-void os_aio_wait_until_no_pending_writes();
+/** @return number of pending reads */
+size_t os_aio_pending_reads();
+/** @return approximate number of pending reads */
+size_t os_aio_pending_reads_approx();
+/** @return number of pending writes */
+size_t os_aio_pending_writes();
-/** Wait until all pending asynchronous reads have completed. */
-void os_aio_wait_until_no_pending_reads();
+/** Wait until there are no pending asynchronous writes.
+@param declare whether the wait will be declared in tpool */
+void os_aio_wait_until_no_pending_writes(bool declare);
+
+/** Wait until all pending asynchronous reads have completed.
+@param declare whether the wait will be declared in tpool */
+void os_aio_wait_until_no_pending_reads(bool declare);
/** Prints info of the aio arrays.
@param[in/out] file file where to print */
diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
index 0c6aa8a94bb..6f0acbde975 100644
--- a/storage/innobase/include/srv0srv.h
+++ b/storage/innobase/include/srv0srv.h
@@ -317,6 +317,9 @@ extern my_bool srv_immediate_scrub_data_uncompressed;
enum srv_operation_mode {
/** Normal mode (MariaDB Server) */
SRV_OPERATION_NORMAL,
+ /** Mariabackup is executing server to export already restored
+ tablespaces */
+ SRV_OPERATION_EXPORT_RESTORED,
/** Mariabackup taking a backup */
SRV_OPERATION_BACKUP,
/** Mariabackup restoring a backup for subsequent --copy-back */
diff --git a/storage/innobase/include/trx0purge.h b/storage/innobase/include/trx0purge.h
index ac39d3ec45b..bf6f6eb8eff 100644
--- a/storage/innobase/include/trx0purge.h
+++ b/storage/innobase/include/trx0purge.h
@@ -41,10 +41,11 @@ void
trx_purge_add_undo_to_history(const trx_t* trx, trx_undo_t*& undo, mtr_t* mtr);
/**
Run a purge batch.
-@param n_tasks number of purge tasks to submit to the queue
-@param truncate whether to truncate the history at the end of the batch
+@param n_tasks number of purge tasks to submit to the queue
+@param history_size trx_sys.history_size()
+@param truncate whether to truncate the history at the end of the batch
@return number of undo log pages handled in the batch */
-ulint trx_purge(ulint n_tasks, bool truncate);
+ulint trx_purge(ulint n_tasks, ulint history_size, bool truncate);
/** Rollback segements from a given transaction with trx-no
scheduled for purge. */
diff --git a/storage/innobase/include/trx0rseg.h b/storage/innobase/include/trx0rseg.h
index 6e0eb547eb8..43e0c290d63 100644
--- a/storage/innobase/include/trx0rseg.h
+++ b/storage/innobase/include/trx0rseg.h
@@ -129,7 +129,8 @@ public:
#endif
}
/** @return whether the segment is marked for undo truncation */
- bool skip_allocation() const { return ref_load() & SKIP; }
+ bool skip_allocation() const
+ { return ref.load(std::memory_order_acquire) & SKIP; }
/** Increment the reference count */
void acquire()
{ ut_d(auto r=) ref.fetch_add(REF); ut_ad(!(r & SKIP)); }
diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h
index 4728e7ef2bf..8adff09a3df 100644
--- a/storage/innobase/include/trx0undo.h
+++ b/storage/innobase/include/trx0undo.h
@@ -203,16 +203,18 @@ trx_undo_assign(trx_t* trx, dberr_t* err, mtr_t* mtr)
MY_ATTRIBUTE((nonnull));
/** Assign an undo log for a transaction.
A new undo log is created or a cached undo log reused.
+@tparam is_temp whether this is temporary undo log
@param[in,out] trx transaction
@param[in] rseg rollback segment
@param[out] undo the undo log
-@param[out] err error code
@param[in,out] mtr mini-transaction
+@param[out] err error code
@return the undo log block
-@retval NULL on error */
+@retval nullptr on error */
+template<bool is_temp>
buf_block_t*
-trx_undo_assign_low(trx_t* trx, trx_rseg_t* rseg, trx_undo_t** undo,
- dberr_t* err, mtr_t* mtr)
+trx_undo_assign_low(trx_t *trx, trx_rseg_t *rseg, trx_undo_t **undo,
+ mtr_t *mtr, dberr_t *err)
MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Sets the state of the undo log segment at a transaction finish.
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index 209e1e60e2a..d763ef10734 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -1060,6 +1060,16 @@ ATTRIBUTE_COLD void log_check_margins()
while (log_sys.check_flush_or_checkpoint());
}
+/** Wait for a log checkpoint if needed.
+NOTE that this function may only be called while not holding
+any synchronization objects except dict_sys.latch. */
+void log_free_check()
+{
+ ut_ad(!lock_sys.is_writer());
+ if (log_sys.check_flush_or_checkpoint())
+ log_check_margins();
+}
+
extern void buf_resize_shutdown();
/** Make a checkpoint at the latest lsn on shutdown. */
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 3443369af6c..2d1c2a9419f 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -763,9 +763,10 @@ retry:
if (!os_file_status(name->c_str(), &exists, &ftype) || !exists)
goto processed;
}
- create(it, *name, static_cast<uint32_t>
- (1U << FSP_FLAGS_FCRC32_POS_MARKER |
- FSP_FLAGS_FCRC32_PAGE_SSIZE()), nullptr, 0);
+ if (create(it, *name, static_cast<uint32_t>
+ (1U << FSP_FLAGS_FCRC32_POS_MARKER |
+ FSP_FLAGS_FCRC32_PAGE_SSIZE()), nullptr, 0))
+ mysql_mutex_unlock(&fil_system.mutex);
}
}
else
@@ -794,7 +795,7 @@ processed:
@param flags FSP_SPACE_FLAGS
@param crypt_data encryption metadata
@param size tablespace size in pages
- @return tablespace
+ @return tablespace; the caller must release fil_system.mutex
@retval nullptr if crypt_data is invalid */
static fil_space_t *create(const recv_spaces_t::const_iterator &it,
const std::string &name, uint32_t flags,
@@ -806,6 +807,7 @@ processed:
ut_free(crypt_data);
return nullptr;
}
+ mysql_mutex_lock(&fil_system.mutex);
fil_space_t *space= fil_space_t::create(it->first, flags,
FIL_TYPE_TABLESPACE, crypt_data);
ut_ad(space);
@@ -866,12 +868,13 @@ processed:
space->free_limit= fsp_header_get_field(page, FSP_FREE_LIMIT);
space->free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page);
fil_node_t *node= UT_LIST_GET_FIRST(space->chain);
+ mysql_mutex_unlock(&fil_system.mutex);
if (!space->acquire())
- {
+ {
free_space:
fil_space_free(it->first, false);
goto next_item;
- }
+ }
if (os_file_write(IORequestWrite, node->name, node->handle,
page, 0, fil_space_t::physical_size(flags)) !=
DB_SUCCESS)
@@ -941,6 +944,7 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p,
space->free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page);
fil_node_t *node= UT_LIST_GET_FIRST(space->chain);
node->deferred= true;
+ mysql_mutex_unlock(&fil_system.mutex);
if (!space->acquire())
goto release_and_fail;
fil_names_dirty(space);
@@ -964,8 +968,10 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p,
uint32_t(file_size / fil_space_t::physical_size(flags));
if (n_pages > size)
{
+ mysql_mutex_lock(&fil_system.mutex);
space->size= node->size= n_pages;
space->set_committed_size();
+ mysql_mutex_unlock(&fil_system.mutex);
goto size_set;
}
}
@@ -1120,7 +1126,7 @@ static void fil_name_process(const char *name, ulint len, uint32_t space_id,
return;
}
- ut_ad(srv_operation == SRV_OPERATION_NORMAL
+ ut_ad(srv_operation <= SRV_OPERATION_EXPORT_RESTORED
|| srv_operation == SRV_OPERATION_RESTORE
|| srv_operation == SRV_OPERATION_RESTORE_EXPORT);
@@ -1239,8 +1245,9 @@ same_space:
ut_ad(space == NULL);
if (srv_force_recovery == 0) {
sql_print_error("InnoDB: Recovery cannot access"
- " file %s (tablespace "
- UINT32PF ")", name, space_id);
+ " file %.*s (tablespace "
+ UINT32PF ")", int(len), name,
+ space_id);
sql_print_information("InnoDB: You may set "
"innodb_force_recovery=1"
" to ignore this and"
@@ -1251,9 +1258,10 @@ same_space:
}
sql_print_warning("InnoDB: Ignoring changes to"
- " file %s (tablespace " UINT32PF ")"
+ " file %.*s (tablespace "
+ UINT32PF ")"
" due to innodb_force_recovery",
- name, space_id);
+ int(len), name, space_id);
}
}
}
@@ -3324,7 +3332,7 @@ static void log_sort_flush_list()
@param last_batch whether it is possible to write more redo log */
void recv_sys_t::apply(bool last_batch)
{
- ut_ad(srv_operation == SRV_OPERATION_NORMAL ||
+ ut_ad(srv_operation <= SRV_OPERATION_EXPORT_RESTORED ||
srv_operation == SRV_OPERATION_RESTORE ||
srv_operation == SRV_OPERATION_RESTORE_EXPORT);
@@ -3475,7 +3483,7 @@ next_free_block:
for (;;)
{
const bool empty= pages.empty();
- if (empty && !buf_pool.n_pend_reads)
+ if (empty && !os_aio_pending_reads())
break;
if (!is_corrupt_fs() && !is_corrupt_log())
@@ -3487,8 +3495,7 @@ next_free_block:
else
{
mysql_mutex_unlock(&mutex);
- os_aio_wait_until_no_pending_reads();
- ut_ad(!buf_pool.n_pend_reads);
+ os_aio_wait_until_no_pending_reads(false);
mysql_mutex_lock(&mutex);
ut_ad(pages.empty());
}
@@ -4040,7 +4047,7 @@ dberr_t recv_recovery_from_checkpoint_start()
{
bool rescan = false;
- ut_ad(srv_operation == SRV_OPERATION_NORMAL
+ ut_ad(srv_operation <= SRV_OPERATION_EXPORT_RESTORED
|| srv_operation == SRV_OPERATION_RESTORE
|| srv_operation == SRV_OPERATION_RESTORE_EXPORT);
ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex));
@@ -4157,7 +4164,7 @@ read_only_recovery:
rescan = true;
}
- if (srv_operation == SRV_OPERATION_NORMAL) {
+ if (srv_operation <= SRV_OPERATION_EXPORT_RESTORED) {
deferred_spaces.deferred_dblwr();
buf_dblwr.recover();
}
@@ -4220,7 +4227,7 @@ err_exit:
}
log_sys.buf_free = recv_sys.offset;
if (recv_needed_recovery
- && srv_operation == SRV_OPERATION_NORMAL) {
+ && srv_operation <= SRV_OPERATION_EXPORT_RESTORED) {
/* Write a FILE_CHECKPOINT marker as the first thing,
before generating any other redo log. This ensures
that subsequent crash recovery will be possible even
diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc
index 6d31a55e8ed..fe90487ebec 100644
--- a/storage/innobase/mtr/mtr0mtr.cc
+++ b/storage/innobase/mtr/mtr0mtr.cc
@@ -594,8 +594,14 @@ void mtr_t::commit_shrink(fil_space_t &space)
/** Commit a mini-transaction that is deleting or renaming a file.
@param space tablespace that is being renamed or deleted
@param name new file name (nullptr=the file will be deleted)
+@param detached_handle if detached_handle != nullptr and if space is detached
+ during the function execution the file handle if its
+ node will be set to OS_FILE_CLOSED, and the previous
+ value of the file handle will be assigned to the
+ address, pointed by detached_handle.
@return whether the operation succeeded */
-bool mtr_t::commit_file(fil_space_t &space, const char *name)
+bool mtr_t::commit_file(fil_space_t &space, const char *name,
+ pfs_os_file_t *detached_handle)
{
ut_ad(is_active());
ut_ad(!high_level_read_only);
@@ -683,7 +689,9 @@ bool mtr_t::commit_file(fil_space_t &space, const char *name)
ut_ad(!space.referenced());
ut_ad(space.is_stopping());
- fil_system.detach(&space, true);
+ pfs_os_file_t handle = fil_system.detach(&space, true);
+ if (detached_handle)
+ *detached_handle = handle;
mysql_mutex_unlock(&fil_system.mutex);
success= true;
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index 98bf4fdb8ca..08f525be314 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -106,9 +106,9 @@ public:
}
/* Wait for completions of all AIO operations */
- void wait(std::unique_lock<std::mutex> &lk)
+ void wait(mysql_mutex_t &m)
{
- m_cache.wait(lk);
+ m_cache.wait(m);
}
void wait()
@@ -131,14 +131,13 @@ public:
wait();
}
- std::mutex& mutex()
+ mysql_mutex_t& mutex()
{
return m_cache.mutex();
}
- void resize(int max_submitted_io, int max_callback_concurrency, std::unique_lock<std::mutex> &lk)
+ void resize(int max_submitted_io, int max_callback_concurrency)
{
- ut_a(lk.owns_lock());
m_cache.resize(max_submitted_io);
m_group.set_max_tasks(max_callback_concurrency);
m_max_aio = max_submitted_io;
@@ -751,22 +750,16 @@ os_file_punch_hole_posix(
return(DB_IO_NO_PUNCH_HOLE);
}
-
-
/** Retrieves the last error number if an error occurs in a file io function.
The number should be retrieved before any other OS calls (because they may
overwrite the error number). If the number is not known to this program,
the OS error number + 100 is returned.
@param[in] report_all_errors true if we want an error message
- printed of all errors
+ printed of all errors
@param[in] on_error_silent true then don't print any diagnostic
to the log
@return error number, or OS error number + 100 */
-static
-ulint
-os_file_get_last_error_low(
- bool report_all_errors,
- bool on_error_silent)
+ulint os_file_get_last_error(bool report_all_errors, bool on_error_silent)
{
int err = errno;
@@ -1801,16 +1794,13 @@ bool os_file_flush_func(os_file_t file)
The number should be retrieved before any other OS calls (because they may
overwrite the error number). If the number is not known to this program,
then OS error number + OS_FILE_ERROR_MAX is returned.
-@param[in] report_all_errors true if we want an error message printed
- of all errors
+@param[in] report_all_errors true if we want an error message
+printed of all errors
@param[in] on_error_silent true then don't print any diagnostic
to the log
@return error number, or OS error number + OS_FILE_ERROR_MAX */
-static
-ulint
-os_file_get_last_error_low(
- bool report_all_errors,
- bool on_error_silent)
+ulint os_file_get_last_error(bool report_all_errors, bool on_error_silent)
+
{
ulint err = (ulint) GetLastError();
@@ -2928,20 +2918,6 @@ os_file_read_func(
return err ? err : DB_IO_ERROR;
}
-/** Retrieves the last error number if an error occurs in a file io function.
-The number should be retrieved before any other OS calls (because they may
-overwrite the error number). If the number is not known to this program,
-the OS error number + 100 is returned.
-@param[in] report_all_errors true if we want an error printed
- for all errors
-@return error number, or OS error number + 100 */
-ulint
-os_file_get_last_error(
- bool report_all_errors)
-{
- return(os_file_get_last_error_low(report_all_errors, false));
-}
-
/** Handle errors for file operations.
@param[in] name name of a file or NULL
@param[in] operation operation
@@ -2958,7 +2934,7 @@ os_file_handle_error_cond_exit(
{
ulint err;
- err = os_file_get_last_error_low(false, on_error_silent);
+ err = os_file_get_last_error(false, on_error_silent);
switch (err) {
case OS_FILE_DISK_FULL:
@@ -3447,9 +3423,8 @@ static void io_callback(tpool::aiocb *cb)
else
{
ut_ad(write_slots->contains(cb));
- const IORequest req{request};
+ fil_aio_callback(request);
write_slots->release(cb);
- fil_aio_callback(req);
}
}
@@ -3647,8 +3622,9 @@ more concurrent threads via thread_group setting.
int os_aio_resize(ulint n_reader_threads, ulint n_writer_threads)
{
/* Lock the slots, and wait until all current IOs finish.*/
- std::unique_lock<std::mutex> lk_read(read_slots->mutex());
- std::unique_lock<std::mutex> lk_write(write_slots->mutex());
+ auto &lk_read= read_slots->mutex(), &lk_write= write_slots->mutex();
+ mysql_mutex_lock(&lk_read);
+ mysql_mutex_lock(&lk_write);
read_slots->wait(lk_read);
write_slots->wait(lk_write);
@@ -3661,20 +3637,25 @@ int os_aio_resize(ulint n_reader_threads, ulint n_writer_threads)
/** Do the Linux AIO dance (this will try to create a new
io context with changed max_events ,etc*/
- if (int ret= srv_thread_pool->reconfigure_aio(srv_use_native_aio, events))
+ int ret= srv_thread_pool->reconfigure_aio(srv_use_native_aio, events);
+
+ if (ret)
{
/** Do the best effort. We can't change the parallel io number,
but we still can adjust the number of concurrent completion handlers.*/
read_slots->task_group().set_max_tasks(static_cast<int>(n_reader_threads));
write_slots->task_group().set_max_tasks(static_cast<int>(n_writer_threads));
- return ret;
+ }
+ else
+ {
+ /* Allocation succeeded, resize the slots*/
+ read_slots->resize(max_read_events, static_cast<int>(n_reader_threads));
+ write_slots->resize(max_write_events, static_cast<int>(n_writer_threads));
}
- /* Allocation succeeded, resize the slots*/
- read_slots->resize(max_read_events, static_cast<int>(n_reader_threads), lk_read);
- write_slots->resize(max_write_events, static_cast<int>(n_writer_threads), lk_write);
-
- return 0;
+ mysql_mutex_unlock(&lk_read);
+ mysql_mutex_unlock(&lk_write);
+ return ret;
}
void os_aio_free()
@@ -3687,9 +3668,9 @@ void os_aio_free()
}
/** Wait until there are no pending asynchronous writes. */
-static void os_aio_wait_until_no_pending_writes_low()
+static void os_aio_wait_until_no_pending_writes_low(bool declare)
{
- bool notify_wait = write_slots->pending_io_count() > 0;
+ const bool notify_wait= declare && write_slots->pending_io_count();
if (notify_wait)
tpool::tpool_wait_begin();
@@ -3700,17 +3681,43 @@ static void os_aio_wait_until_no_pending_writes_low()
tpool::tpool_wait_end();
}
-/** Wait until there are no pending asynchronous writes. */
-void os_aio_wait_until_no_pending_writes()
+/** Wait until there are no pending asynchronous writes.
+@param declare whether the wait will be declared in tpool */
+void os_aio_wait_until_no_pending_writes(bool declare)
{
- os_aio_wait_until_no_pending_writes_low();
+ os_aio_wait_until_no_pending_writes_low(declare);
buf_dblwr.wait_flush_buffered_writes();
}
-/** Wait until all pending asynchronous reads have completed. */
-void os_aio_wait_until_no_pending_reads()
+/** @return number of pending reads */
+size_t os_aio_pending_reads()
+{
+ mysql_mutex_lock(&read_slots->mutex());
+ size_t pending= read_slots->pending_io_count();
+ mysql_mutex_unlock(&read_slots->mutex());
+ return pending;
+}
+
+/** @return approximate number of pending reads */
+size_t os_aio_pending_reads_approx()
+{
+ return read_slots->pending_io_count();
+}
+
+/** @return number of pending writes */
+size_t os_aio_pending_writes()
+{
+ mysql_mutex_lock(&write_slots->mutex());
+ size_t pending= write_slots->pending_io_count();
+ mysql_mutex_unlock(&write_slots->mutex());
+ return pending;
+}
+
+/** Wait until all pending asynchronous reads have completed.
+@param declare whether the wait will be declared in tpool */
+void os_aio_wait_until_no_pending_reads(bool declare)
{
- const auto notify_wait= read_slots->pending_io_count();
+ const bool notify_wait= declare && read_slots->pending_io_count();
if (notify_wait)
tpool::tpool_wait_begin();
diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc
index c7ad8399304..830a4bef9d9 100644
--- a/storage/innobase/page/page0zip.cc
+++ b/storage/innobase/page/page0zip.cc
@@ -3367,7 +3367,7 @@ page_zip_validate_low(
differed. Let us ignore it. */
page_zip_fail(("page_zip_validate:"
" min_rec_flag"
- " (%s" ULINTPF "," ULINTPF
+ " (%s" UINT32PF "," UINT32PF
",0x%02x)\n",
sloppy ? "ignored, " : "",
page_get_space_id(page),
@@ -3412,7 +3412,8 @@ page_zip_validate_low(
page + PAGE_NEW_INFIMUM, TRUE);
trec = page_rec_get_next_low(
temp_page + PAGE_NEW_INFIMUM, TRUE);
- const ulint n_core = page_is_leaf(page) ? index->n_fields : 0;
+ const ulint n_core = (index && page_is_leaf(page))
+ ? index->n_fields : 0;
do {
if (page_offset(rec) != page_offset(trec)) {
diff --git a/storage/innobase/rem/rem0cmp.cc b/storage/innobase/rem/rem0cmp.cc
index e48cad01530..3620363ff2e 100644
--- a/storage/innobase/rem/rem0cmp.cc
+++ b/storage/innobase/rem/rem0cmp.cc
@@ -300,8 +300,9 @@ int cmp_data(ulint mtype, ulint prtype, bool descending,
DBUG_ASSERT(is_strnncoll_compatible(prtype & DATA_MYSQL_TYPE_MASK));
if (CHARSET_INFO *cs= all_charsets[dtype_get_charset_coll(prtype)])
{
- cmp= cs->coll->strnncollsp_nchars(cs, data1, len1, data2, len2,
- std::max(len1, len2));
+ cmp= cs->coll->
+ strnncollsp_nchars(cs, data1, len1, data2, len2, std::max(len1, len2),
+ MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES);
goto func_exit;
}
goto no_collation;
diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc
index f489669b408..3f8e48763ea 100644
--- a/storage/innobase/rem/rem0rec.cc
+++ b/storage/innobase/rem/rem0rec.cc
@@ -242,9 +242,9 @@ enum rec_leaf_format {
REC_LEAF_INSTANT
};
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 11
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 12
# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wconversion" /* GCC 5 to 10 need this */
+# pragma GCC diagnostic ignored "-Wconversion" /* GCC 5 to 11 need this */
#endif
/** Determine the offset to each field in a leaf-page record
in ROW_FORMAT=COMPACT,DYNAMIC,COMPRESSED.
@@ -291,7 +291,9 @@ rec_init_offsets_comp_ordinary(
!= n_core)
? UT_BITS_IN_BYTES(unsigned(index->get_n_nullable(n_core)))
: (redundant_temp
- ? UT_BITS_IN_BYTES(index->n_nullable)
+ ? (index->is_instant()
+ ? UT_BITS_IN_BYTES(index->get_n_nullable(n_core))
+ : UT_BITS_IN_BYTES(index->n_nullable))
: index->n_core_null_bytes);
if (mblob) {
@@ -448,7 +450,7 @@ start:
continue;
}
- len = offs += len;
+ len = offs += static_cast<rec_offs>(len);
} else {
len = offs += field->fixed_len;
}
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index 5d7ea475d43..eaf987d115d 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -3853,6 +3853,7 @@ page_corrupted:
block->page.zip.data = src;
frame_changed = true;
} else if (!page_compressed
+ && type != FIL_PAGE_TYPE_XDES
&& !block->page.zip.data) {
block->page.frame = src;
frame_changed = true;
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index 24fb6eb39ce..eca839fa7be 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -48,6 +48,7 @@ Created 4/20/1996 Heikki Tuuri
#ifdef WITH_WSREP
#include <wsrep.h>
#include <mysql/service_wsrep.h>
+#include "ha_prototypes.h"
#endif /* WITH_WSREP */
/*************************************************************************
@@ -2580,42 +2581,6 @@ but GCC 4.8.5 does not support pop_options. */
# pragma GCC optimize ("O0")
#endif
-#ifdef WITH_WSREP
-/** Start bulk insert operation for Galera by appending
-table-level exclusive key for bulk insert.
-@param trx transaction
-@param index index
-@retval false on success
-@retval true on failure */
-ATTRIBUTE_COLD static bool row_ins_wsrep_start_bulk(trx_t *trx, const dict_index_t &index)
-{
- char db_buf[NAME_LEN + 1];
- char tbl_buf[NAME_LEN + 1];
- ulint db_buf_len, tbl_buf_len;
-
- if (!index.table->parse_name(db_buf, tbl_buf, &db_buf_len, &tbl_buf_len))
- {
- WSREP_ERROR("Parse_name for bulk insert failed: %s",
- wsrep_thd_query(trx->mysql_thd));
- trx->error_state = DB_ROLLBACK;
- return true;
- }
-
- /* Append table-level exclusive key for bulk insert. */
- const int rcode = wsrep_thd_append_table_key(trx->mysql_thd, db_buf,
- tbl_buf, WSREP_SERVICE_KEY_EXCLUSIVE);
- if (rcode)
- {
- WSREP_ERROR("Appending table key for bulk insert failed: %s, %d",
- wsrep_thd_query(trx->mysql_thd), rcode);
- trx->error_state = DB_ROLLBACK;
- return true;
- }
-
- return false;
-}
-#endif
-
/***************************************************************//**
Tries to insert an entry into a clustered index, ignoring foreign key
constraints. If a record with the same unique key is found, the other
@@ -2780,10 +2745,13 @@ avoid_bulk:
#ifdef WITH_WSREP
if (trx->is_wsrep())
{
- if (!wsrep_thd_is_local_transaction(trx->mysql_thd))
- goto skip_bulk_insert;
- if (row_ins_wsrep_start_bulk(trx, *index))
- goto err_exit;
+ if (!wsrep_thd_is_local_transaction(trx->mysql_thd))
+ goto skip_bulk_insert;
+ if (wsrep_append_table_key(trx->mysql_thd, *index->table))
+ {
+ trx->error_state = DB_ROLLBACK;
+ goto err_exit;
+ }
}
#endif /* WITH_WSREP */
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index a82bbc7cde6..b35783f1a92 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -758,11 +758,6 @@ error:
row_field, field, col->len,
old_table->space->zip_size(),
conv_heap);
- } else {
- /* Field length mismatch should not
- happen when rebuilding redundant row
- format table. */
- ut_ad(index->table->not_redundant());
}
}
}
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index 81879431096..27f48c1a4de 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -66,17 +66,23 @@ Created 9/17/2000 Heikki Tuuri
#include <thread>
-/*******************************************************************//**
-Delays an INSERT, DELETE or UPDATE operation if the purge is lagging. */
-static
-void
-row_mysql_delay_if_needed(void)
-/*===========================*/
+/** Delay an INSERT, DELETE or UPDATE operation if the purge is lagging. */
+static void row_mysql_delay_if_needed()
{
- if (srv_dml_needed_delay) {
- std::this_thread::sleep_for(
- std::chrono::microseconds(srv_dml_needed_delay));
- }
+ const auto delay= srv_dml_needed_delay;
+ if (UNIV_UNLIKELY(delay != 0))
+ {
+ /* Adjust for purge_coordinator_state::refresh() */
+ log_sys.latch.rd_lock(SRW_LOCK_CALL);
+ const lsn_t last= log_sys.last_checkpoint_lsn,
+ max_age= log_sys.max_checkpoint_age;
+ log_sys.latch.rd_unlock();
+ const lsn_t lsn= log_sys.get_lsn();
+ if ((lsn - last) / 4 >= max_age / 5)
+ buf_flush_ahead(last + max_age / 5, false);
+ srv_wake_purge_thread_if_not_active();
+ std::this_thread::sleep_for(std::chrono::microseconds(delay));
+ }
}
/*******************************************************************//**
diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc
index 0a2647e8d6d..f716625ea59 100644
--- a/storage/innobase/row/row0purge.cc
+++ b/storage/innobase/row/row0purge.cc
@@ -162,8 +162,9 @@ close_and_exit:
ut_ad("corrupted SYS_INDEXES record" == 0);
}
- if (const uint32_t space_id = dict_drop_index_tree(
- &node->pcur, nullptr, &mtr)) {
+ const uint32_t space_id = dict_drop_index_tree(
+ &node->pcur, nullptr, &mtr);
+ if (space_id) {
if (table) {
if (table->get_ref_count() == 0) {
dict_sys.remove(table);
diff --git a/storage/innobase/row/row0quiesce.cc b/storage/innobase/row/row0quiesce.cc
index 059aee6f140..5b0676a3e0d 100644
--- a/storage/innobase/row/row0quiesce.cc
+++ b/storage/innobase/row/row0quiesce.cc
@@ -540,7 +540,7 @@ row_quiesce_table_start(
if (!trx_is_interrupted(trx)) {
/* Ensure that all asynchronous IO is completed. */
- os_aio_wait_until_no_pending_writes();
+ os_aio_wait_until_no_pending_writes(true);
table->space->flush<false>();
if (row_quiesce_write_cfg(table, trx->mysql_thd)
diff --git a/storage/innobase/row/row0uins.cc b/storage/innobase/row/row0uins.cc
index 6b4393d4113..f0f1ba74f26 100644
--- a/storage/innobase/row/row0uins.cc
+++ b/storage/innobase/row/row0uins.cc
@@ -146,8 +146,9 @@ restart:
pfs_os_file_t d = OS_FILE_CLOSED;
- if (const uint32_t space_id = dict_drop_index_tree(
- &node->pcur, node->trx, &mtr)) {
+ const uint32_t space_id = dict_drop_index_tree(
+ &node->pcur, node->trx, &mtr);
+ if (space_id) {
if (table) {
lock_release_on_rollback(node->trx,
table);
diff --git a/storage/innobase/row/row0vers.cc b/storage/innobase/row/row0vers.cc
index a4b52fd2a2f..9b11b7fbc3f 100644
--- a/storage/innobase/row/row0vers.cc
+++ b/storage/innobase/row/row0vers.cc
@@ -859,6 +859,30 @@ static bool dtuple_coll_eq(const dtuple_t &tuple1, const dtuple_t &tuple2)
return true;
}
+/** Find out whether data tuple has missing data type
+for indexed virtual column.
+@param tuple data tuple
+@param index virtual index
+@return true if tuple has missing column type */
+static bool dtuple_vcol_data_missing(const dtuple_t &tuple,
+ dict_index_t *index)
+{
+ for (ulint i= 0; i < index->n_uniq; i++)
+ {
+ dict_col_t *col= index->fields[i].col;
+ if (!col->is_virtual())
+ continue;
+ dict_v_col_t *vcol= reinterpret_cast<dict_v_col_t*>(col);
+ for (ulint j= 0; j < index->table->n_v_cols; j++)
+ {
+ if (vcol == &index->table->v_cols[j]
+ && tuple.v_fields[j].type.mtype == DATA_MISSING)
+ return true;
+ }
+ }
+ return false;
+}
+
/** Finds out if a version of the record, where the version >= the current
purge_sys.view, should have ientry as its secondary index entry. We check
if there is any not delete marked version of the record where the trx
@@ -1068,6 +1092,9 @@ unsafe_to_purge:
if (dict_index_has_virtual(index)) {
if (vrow) {
+ if (dtuple_vcol_data_missing(*vrow, index)) {
+ goto nochange_index;
+ }
/* Keep the virtual row info for the next
version, unless it is changed */
mem_heap_empty(v_heap);
@@ -1078,6 +1105,7 @@ unsafe_to_purge:
if (!cur_vrow) {
/* Nothing for this index has changed,
continue */
+nochange_index:
version = prev_version;
continue;
}
diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc
index 987d3d185d9..d4761a080b0 100644
--- a/storage/innobase/srv/srv0mon.cc
+++ b/storage/innobase/srv/srv0mon.cc
@@ -647,16 +647,18 @@ static monitor_info_t innodb_counter_info[] =
{"trx_rseg_history_len", "transaction",
"Length of the TRX_RSEG_HISTORY list",
static_cast<monitor_type_t>(
- MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT | MONITOR_DEFAULT_ON),
+ MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_RSEG_HISTORY_LEN},
{"trx_undo_slots_used", "transaction", "Number of undo slots used",
- MONITOR_NONE,
+ static_cast<monitor_type_t>(
+ MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_NUM_UNDO_SLOT_USED},
{"trx_undo_slots_cached", "transaction",
"Number of undo slots cached",
- MONITOR_NONE,
+ static_cast<monitor_type_t>(
+ MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_NUM_UNDO_SLOT_CACHED},
{"trx_rseg_current_size", "transaction",
@@ -693,7 +695,8 @@ static monitor_info_t innodb_counter_info[] =
{"purge_dml_delay_usec", "purge",
"Microseconds DML to be delayed due to purge lagging",
- MONITOR_DISPLAY_CURRENT,
+ static_cast<monitor_type_t>(
+ MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_DML_PURGE_DELAY},
{"purge_stop_count", "purge",
@@ -1211,6 +1214,24 @@ TPOOL_SUPPRESS_TSAN static ulint srv_mon_get_rseg_size()
return size;
}
+/** @return number of used undo log slots */
+TPOOL_SUPPRESS_TSAN static ulint srv_mon_get_rseg_used()
+{
+ ulint size= 0;
+ for (const auto &rseg : trx_sys.rseg_array)
+ size+= UT_LIST_GET_LEN(rseg.undo_list);
+ return size;
+}
+
+/** @return number of cached undo log slots */
+TPOOL_SUPPRESS_TSAN static ulint srv_mon_get_rseg_cached()
+{
+ ulint size= 0;
+ for (const auto &rseg : trx_sys.rseg_array)
+ size+= UT_LIST_GET_LEN(rseg.undo_cached);
+ return size;
+}
+
/****************************************************************//**
This function consolidates some existing server counters used
by "system status variables". These existing system variables do not have
@@ -1448,7 +1469,15 @@ srv_mon_process_existing_counter(
case MONITOR_RSEG_CUR_SIZE:
value = srv_mon_get_rseg_size();
break;
-
+ case MONITOR_DML_PURGE_DELAY:
+ value = srv_max_purge_lag_delay;
+ break;
+ case MONITOR_NUM_UNDO_SLOT_USED:
+ value = srv_mon_get_rseg_used();
+ break;
+ case MONITOR_NUM_UNDO_SLOT_CACHED:
+ value = srv_mon_get_rseg_cached();
+ break;
case MONITOR_OVLD_N_FILE_OPENED:
value = fil_system.n_open;
break;
@@ -1527,7 +1556,6 @@ srv_mon_process_existing_counter(
case MONITOR_TIMEOUT:
value = lock_sys.timeouts;
break;
-
default:
ut_error;
}
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index edc19126558..a86a2337813 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -882,12 +882,13 @@ srv_export_innodb_status(void)
export_vars.innodb_data_writes = os_n_file_writes;
buf_dblwr.lock();
- ulint dblwr = buf_dblwr.submitted();
- export_vars.innodb_dblwr_pages_written = buf_dblwr.written();
+ ulint dblwr = buf_dblwr.written();
+ export_vars.innodb_dblwr_pages_written = dblwr;
export_vars.innodb_dblwr_writes = buf_dblwr.batches();
buf_dblwr.unlock();
- export_vars.innodb_data_written = srv_stats.data_written + dblwr;
+ export_vars.innodb_data_written = srv_stats.data_written
+ + (dblwr << srv_page_size_shift);
export_vars.innodb_buffer_pool_bytes_data =
buf_pool.stat.LRU_bytes
@@ -1468,27 +1469,32 @@ fewer_threads:
m_history_length= history_size;
- if (history_size &&
- trx_purge(n_use_threads,
- !(++count % srv_purge_rseg_truncate_frequency) ||
- purge_sys.truncate.current ||
- (srv_shutdown_state != SRV_SHUTDOWN_NONE &&
- srv_fast_shutdown == 0)))
+ if (!history_size)
+ srv_dml_needed_delay= 0;
+ else if (trx_purge(n_use_threads, history_size,
+ !(++count % srv_purge_rseg_truncate_frequency) ||
+ purge_sys.truncate.current ||
+ (srv_shutdown_state != SRV_SHUTDOWN_NONE &&
+ srv_fast_shutdown == 0)))
continue;
- if (m_running == sigcount)
+ if (srv_dml_needed_delay);
+ else if (m_running == sigcount)
{
/* Purge was not woken up by srv_wake_purge_thread_if_not_active() */
/* The magic number 5000 is an approximation for the case where we have
cached undo log records which prevent truncate of rollback segments. */
- wakeup= history_size &&
- (history_size >= 5000 ||
- history_size != trx_sys.history_size_approx());
+ wakeup= history_size >= 5000 ||
+ (history_size && history_size != trx_sys.history_size_approx());
break;
}
- else if (!trx_sys.history_exists())
+
+ if (!trx_sys.history_exists())
+ {
+ srv_dml_needed_delay= 0;
break;
+ }
if (!srv_purge_should_exit())
goto loop;
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index 0a96a4fbaab..12643dd1768 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -188,7 +188,11 @@ static dberr_t create_log_file(bool create_new_db, lsn_t lsn)
ib_logfile0 in log_t::rename_resized(). */
delete_log_files();
- DBUG_ASSERT(!buf_pool.any_io_pending());
+ ut_ad(!os_aio_pending_reads());
+ ut_ad(!os_aio_pending_writes());
+ ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex));
+ ut_ad(!buf_pool.get_oldest_modification(0));
+ ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex));
log_sys.latch.wr_lock(SRW_LOCK_CALL);
log_sys.set_capacity();
@@ -687,14 +691,12 @@ err_exit:
fil_set_max_space_id_if_bigger(space_id);
+ mysql_mutex_lock(&fil_system.mutex);
fil_space_t *space= fil_space_t::create(space_id, fsp_flags,
FIL_TYPE_TABLESPACE, nullptr,
FIL_ENCRYPTION_DEFAULT, true);
- ut_a(fil_validate());
- ut_a(space);
-
+ ut_ad(space);
fil_node_t *file= space->add(name, fh, 0, false, true);
- mysql_mutex_lock(&fil_system.mutex);
if (create)
{
@@ -838,7 +840,7 @@ dberr_t srv_undo_tablespaces_init(bool create_new_undo, mtr_t *mtr)
ut_ad(!create_new_undo || mtr);
ut_a(srv_undo_tablespaces <= TRX_SYS_N_RSEGS);
- ut_a(!create_new_undo || srv_operation == SRV_OPERATION_NORMAL);
+ ut_a(!create_new_undo || srv_operation <= SRV_OPERATION_EXPORT_RESTORED);
if (srv_undo_tablespaces == 1)
srv_undo_tablespaces= 0;
@@ -1092,7 +1094,11 @@ same_size:
log_write_up_to(flushed_lsn, false);
ut_ad(flushed_lsn == log_sys.get_lsn());
- ut_ad(!buf_pool.any_io_pending());
+ ut_ad(!os_aio_pending_reads());
+ ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex));
+ ut_ad(!buf_pool.get_oldest_modification(0));
+ ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex));
+ ut_d(os_aio_wait_until_no_pending_writes(false));
DBUG_RETURN(flushed_lsn);
}
@@ -1108,7 +1114,11 @@ ATTRIBUTE_COLD static dberr_t srv_log_rebuild()
/* Prohibit redo log writes from any other threads until creating a
log checkpoint at the end of create_log_file(). */
ut_d(recv_no_log_write= true);
- DBUG_ASSERT(!buf_pool.any_io_pending());
+ ut_ad(!os_aio_pending_reads());
+ ut_ad(!os_aio_pending_writes());
+ ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex));
+ ut_ad(!buf_pool.get_oldest_modification(0));
+ ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex));
/* Close the redo log file, so that we can replace it */
log_sys.close_file();
@@ -1171,7 +1181,7 @@ dberr_t srv_start(bool create_new_db)
dberr_t err = DB_SUCCESS;
mtr_t mtr;
- ut_ad(srv_operation == SRV_OPERATION_NORMAL
+ ut_ad(srv_operation <= SRV_OPERATION_RESTORE_EXPORT
|| srv_operation == SRV_OPERATION_RESTORE
|| srv_operation == SRV_OPERATION_RESTORE_EXPORT);
@@ -1507,7 +1517,8 @@ dberr_t srv_start(bool create_new_db)
bool must_upgrade_ibuf = false;
switch (srv_operation) {
- case SRV_OPERATION_NORMAL:
+ case SRV_OPERATION_NORMAL:
+ case SRV_OPERATION_EXPORT_RESTORED:
case SRV_OPERATION_RESTORE_EXPORT:
if (err != DB_SUCCESS) {
break;
@@ -1664,7 +1675,7 @@ dberr_t srv_start(bool create_new_db)
}
}
- if (srv_operation != SRV_OPERATION_NORMAL) {
+ if (srv_operation > SRV_OPERATION_EXPORT_RESTORED) {
ut_ad(srv_operation == SRV_OPERATION_RESTORE_EXPORT
|| srv_operation == SRV_OPERATION_RESTORE);
return(err);
@@ -1839,7 +1850,8 @@ skip_monitors:
return(srv_init_abort(err));
}
- if (!srv_read_only_mode && srv_operation == SRV_OPERATION_NORMAL) {
+ if (!srv_read_only_mode
+ && srv_operation <= SRV_OPERATION_EXPORT_RESTORED) {
/* Initialize the innodb_temporary tablespace and keep
it open until shutdown. */
err = srv_open_tmp_tablespace(create_new_db);
@@ -1919,7 +1931,7 @@ void innodb_preshutdown()
if (srv_read_only_mode)
return;
- if (!srv_fast_shutdown && srv_operation == SRV_OPERATION_NORMAL)
+ if (!srv_fast_shutdown && srv_operation <= SRV_OPERATION_EXPORT_RESTORED)
{
if (trx_sys.is_initialised())
while (trx_sys.any_active_transactions())
@@ -1955,6 +1967,7 @@ void innodb_shutdown()
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
break;
case SRV_OPERATION_NORMAL:
+ case SRV_OPERATION_EXPORT_RESTORED:
/* Shut down the persistent files. */
logs_empty_and_mark_files_at_shutdown();
}
diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc
index 841b014019b..f5795c9c128 100644
--- a/storage/innobase/trx/trx0purge.cc
+++ b/storage/innobase/trx/trx0purge.cc
@@ -274,13 +274,11 @@ trx_purge_add_undo_to_history(const trx_t* trx, trx_undo_t*& undo, mtr_t* mtr)
if (undo->state != TRX_UNDO_CACHED) {
/* The undo log segment will not be reused */
ut_a(undo->id < TRX_RSEG_N_SLOTS);
- compile_time_assert(FIL_NULL == 0xffffffff);
+ static_assert(FIL_NULL == 0xffffffff, "");
mtr->memset(rseg_header,
TRX_RSEG + TRX_RSEG_UNDO_SLOTS
+ undo->id * TRX_RSEG_SLOT_SIZE, 4, 0xff);
- MONITOR_DEC(MONITOR_NUM_UNDO_SLOT_USED);
-
uint32_t hist_size = mach_read_from_4(
TRX_RSEG_HISTORY_SIZE + TRX_RSEG
+ rseg_header->page.frame);
@@ -362,7 +360,6 @@ trx_purge_add_undo_to_history(const trx_t* trx, trx_undo_t*& undo, mtr_t* mtr)
if (undo->state == TRX_UNDO_CACHED) {
UT_LIST_ADD_FIRST(rseg->undo_cached, undo);
- MONITOR_INC(MONITOR_NUM_UNDO_SLOT_CACHED);
} else {
ut_ad(undo->state == TRX_UNDO_TO_PURGE);
ut_free(undo);
@@ -384,161 +381,168 @@ static dberr_t trx_purge_remove_log_hdr(buf_block_t *rseg, buf_block_t* log,
uint16_t(offset + TRX_UNDO_HISTORY_NODE), mtr);
}
-MY_ATTRIBUTE((nonnull, warn_unused_result))
-/** Free an undo log segment, and remove the header from the history list.
-@param[in,out] mtr mini-transaction
-@param[in,out] rseg rollback segment
-@param[in] hdr_addr file address of log_hdr
-@return error code */
-static dberr_t
-trx_purge_free_segment(mtr_t &mtr, trx_rseg_t* rseg, fil_addr_t hdr_addr)
+/** Free an undo log segment.
+@param block rollback segment header page
+@param mtr mini-transaction */
+static void trx_purge_free_segment(buf_block_t *block, mtr_t &mtr)
{
- mtr.commit();
- log_free_check();
- mtr.start();
-
- const page_id_t hdr_page_id{rseg->space->id, hdr_addr.page};
- dberr_t err;
- buf_block_t *rseg_hdr= rseg->get(&mtr, &err);
- if (!rseg_hdr)
- return err;
- buf_block_t *block= buf_page_get_gen(hdr_page_id, 0, RW_X_LATCH,
- nullptr, BUF_GET_POSSIBLY_FREED,
- &mtr, &err);
- if (!block)
- return err;
-
- const uint32_t seg_size=
- flst_get_len(TRX_UNDO_SEG_HDR + TRX_UNDO_PAGE_LIST + block->page.frame);
-
- err= trx_purge_remove_log_hdr(rseg_hdr, block, hdr_addr.boffset, &mtr);
- if (UNIV_UNLIKELY(err != DB_SUCCESS))
- return err;
-
- ut_ad(rseg->curr_size >= seg_size);
- rseg->curr_size-= seg_size;
- rseg->history_size--;
-
- byte *hist= TRX_RSEG + TRX_RSEG_HISTORY_SIZE + rseg_hdr->page.frame;
- ut_ad(mach_read_from_4(hist) >= seg_size);
- mtr.write<4>(*rseg_hdr, hist, mach_read_from_4(hist) - seg_size);
-
while (!fseg_free_step_not_header(TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER +
block->page.frame, &mtr))
{
block->fix();
+ const page_id_t id{block->page.id()};
mtr.commit();
/* NOTE: If the server is killed after the log that was produced
up to this point was written, and before the log from the mtr.commit()
in our caller is written, then the pages belonging to the
undo log will become unaccessible garbage.
- This does not matters when using multiple innodb_undo_tablespaces;
+ This does not matter when using multiple innodb_undo_tablespaces;
innodb_undo_log_truncate=ON will be able to reclaim the space. */
log_free_check();
mtr.start();
block->page.lock.x_lock();
- mtr.memo_push(block, MTR_MEMO_PAGE_X_MODIFY);
+ if (UNIV_UNLIKELY(block->page.id() != id))
+ {
+ block->unfix();
+ block->page.lock.x_unlock();
+ block= buf_page_get_gen(id, 0, RW_X_LATCH, nullptr, BUF_GET, &mtr);
+ if (!block)
+ return;
+ }
+ else
+ mtr.memo_push(block, MTR_MEMO_PAGE_X_MODIFY);
}
while (!fseg_free_step(TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER +
block->page.frame, &mtr));
- return DB_SUCCESS;
}
/** Remove unnecessary history data from a rollback segment.
@param[in,out] rseg rollback segment
@param[in] limit truncate anything before this
@return error code */
-static
-dberr_t
-trx_purge_truncate_rseg_history(
- trx_rseg_t& rseg,
- const purge_sys_t::iterator& limit)
+static dberr_t
+trx_purge_truncate_rseg_history(trx_rseg_t& rseg,
+ const purge_sys_t::iterator& limit)
{
- fil_addr_t hdr_addr;
- mtr_t mtr;
+ fil_addr_t hdr_addr;
+ mtr_t mtr;
- mtr.start();
+ log_free_check();
+ mtr.start();
- dberr_t err;
- buf_block_t* rseg_hdr = rseg.get(&mtr, &err);
- if (!rseg_hdr) {
- goto func_exit;
- }
+ dberr_t err;
+reget:
+ buf_block_t *rseg_hdr= rseg.get(&mtr, &err);
+ if (!rseg_hdr)
+ {
+func_exit:
+ mtr.commit();
+ return err;
+ }
- hdr_addr = flst_get_last(TRX_RSEG + TRX_RSEG_HISTORY
- + rseg_hdr->page.frame);
- hdr_addr.boffset = static_cast<uint16_t>(hdr_addr.boffset
- - TRX_UNDO_HISTORY_NODE);
+ hdr_addr= flst_get_last(TRX_RSEG + TRX_RSEG_HISTORY + rseg_hdr->page.frame);
+ hdr_addr.boffset= static_cast<uint16_t>(hdr_addr.boffset -
+ TRX_UNDO_HISTORY_NODE);
loop:
- if (hdr_addr.page == FIL_NULL) {
-func_exit:
- mtr.commit();
- return err;
- }
+ if (hdr_addr.page == FIL_NULL)
+ goto func_exit;
- buf_block_t* block = buf_page_get_gen(page_id_t(rseg.space->id,
- hdr_addr.page),
- 0, RW_X_LATCH, nullptr,
- BUF_GET_POSSIBLY_FREED,
- &mtr, &err);
- if (!block) {
- goto func_exit;
- }
+ buf_block_t *b=
+ buf_page_get_gen(page_id_t(rseg.space->id, hdr_addr.page),
+ 0, RW_X_LATCH, nullptr, BUF_GET_POSSIBLY_FREED,
+ &mtr, &err);
+ if (!b)
+ goto func_exit;
- const trx_id_t undo_trx_no = mach_read_from_8(
- block->page.frame + hdr_addr.boffset + TRX_UNDO_TRX_NO);
+ const trx_id_t undo_trx_no=
+ mach_read_from_8(b->page.frame + hdr_addr.boffset + TRX_UNDO_TRX_NO);
- if (undo_trx_no >= limit.trx_no) {
- if (undo_trx_no == limit.trx_no) {
- err = trx_undo_truncate_start(
- &rseg, hdr_addr.page,
- hdr_addr.boffset, limit.undo_no);
- }
+ if (undo_trx_no >= limit.trx_no)
+ {
+ if (undo_trx_no == limit.trx_no)
+ err = trx_undo_truncate_start(&rseg, hdr_addr.page,
+ hdr_addr.boffset, limit.undo_no);
+ goto func_exit;
+ }
- goto func_exit;
- }
+ fil_addr_t prev_hdr_addr=
+ flst_get_prev_addr(b->page.frame + hdr_addr.boffset +
+ TRX_UNDO_HISTORY_NODE);
+ prev_hdr_addr.boffset= static_cast<uint16_t>(prev_hdr_addr.boffset -
+ TRX_UNDO_HISTORY_NODE);
+ err= trx_purge_remove_log_hdr(rseg_hdr, b, hdr_addr.boffset, &mtr);
+ if (UNIV_UNLIKELY(err != DB_SUCCESS))
+ goto func_exit;
- fil_addr_t prev_hdr_addr = flst_get_prev_addr(
- block->page.frame + hdr_addr.boffset + TRX_UNDO_HISTORY_NODE);
- prev_hdr_addr.boffset = static_cast<uint16_t>(prev_hdr_addr.boffset
- - TRX_UNDO_HISTORY_NODE);
-
- if (!rseg.is_referenced()
- && rseg.needs_purge <= (purge_sys.head.trx_no
- ? purge_sys.head.trx_no
- : purge_sys.tail.trx_no)
- && mach_read_from_2(TRX_UNDO_SEG_HDR + TRX_UNDO_STATE
- + block->page.frame)
- == TRX_UNDO_TO_PURGE
- && !mach_read_from_2(block->page.frame + hdr_addr.boffset
- + TRX_UNDO_NEXT_LOG)) {
- /* We can free the whole log segment.
- This will call trx_purge_remove_log_hdr(). */
- err = trx_purge_free_segment(mtr, &rseg, hdr_addr);
- } else {
- /* Remove the log hdr from the rseg history. */
- rseg.history_size--;
- err = trx_purge_remove_log_hdr(rseg_hdr, block,
- hdr_addr.boffset, &mtr);
- }
+ rseg_hdr->fix();
- mtr.commit();
- if (err != DB_SUCCESS) {
- return err;
- }
- mtr.start();
+ if (mach_read_from_2(b->page.frame + hdr_addr.boffset + TRX_UNDO_NEXT_LOG) ||
+ rseg.is_referenced() ||
+ rseg.needs_purge > (purge_sys.head.trx_no
+ ? purge_sys.head.trx_no
+ : purge_sys.tail.trx_no))
+ /* We cannot free the entire undo page. */;
+ else
+ {
+ const uint32_t seg_size=
+ flst_get_len(TRX_UNDO_SEG_HDR + TRX_UNDO_PAGE_LIST + b->page.frame);
+ switch (mach_read_from_2(TRX_UNDO_SEG_HDR + TRX_UNDO_STATE +
+ b->page.frame)) {
+ case TRX_UNDO_TO_PURGE:
+ {
+ byte *hist= TRX_RSEG + TRX_RSEG_HISTORY_SIZE + rseg_hdr->page.frame;
+ ut_ad(mach_read_from_4(hist) >= seg_size);
+ mtr.write<4>(*rseg_hdr, hist, mach_read_from_4(hist) - seg_size);
+ }
+ free_segment:
+ ut_ad(rseg.curr_size >= seg_size);
+ rseg.curr_size-= seg_size;
+ trx_purge_free_segment(b, mtr);
+ break;
+ case TRX_UNDO_CACHED:
+ /* rseg.undo_cached must point to this page */
+ trx_undo_t *undo= UT_LIST_GET_FIRST(rseg.undo_cached);
+ for (; undo; undo= UT_LIST_GET_NEXT(undo_list, undo))
+ if (undo->hdr_page_no == hdr_addr.page)
+ goto found_cached;
+ ut_ad("inconsistent undo logs" == 0);
+ break;
+ found_cached:
+ UT_LIST_REMOVE(rseg.undo_cached, undo);
+ static_assert(FIL_NULL == 0xffffffff, "");
+ if (UNIV_UNLIKELY(mach_read_from_4(TRX_RSEG + TRX_RSEG_FORMAT +
+ rseg_hdr->page.frame)))
+ trx_rseg_format_upgrade(rseg_hdr, &mtr);
+ mtr.memset(rseg_hdr, TRX_RSEG + TRX_RSEG_UNDO_SLOTS +
+ undo->id * TRX_RSEG_SLOT_SIZE, 4, 0xff);
+ ut_free(undo);
+ mtr.write<8,mtr_t::MAYBE_NOP>(*rseg_hdr, TRX_RSEG + TRX_RSEG_MAX_TRX_ID +
+ rseg_hdr->page.frame,
+ trx_sys.get_max_trx_id() - 1);
+ goto free_segment;
+ }
+ }
- hdr_addr = prev_hdr_addr;
+ hdr_addr= prev_hdr_addr;
- rseg_hdr = rseg.get(&mtr, &err);
- if (!rseg_hdr) {
- goto func_exit;
- }
+ mtr.commit();
+ ut_ad(rseg.history_size > 0);
+ rseg.history_size--;
+ log_free_check();
+ mtr.start();
+ rseg_hdr->page.lock.x_lock();
+ if (UNIV_UNLIKELY(rseg_hdr->page.id() != rseg.page_id()))
+ {
+ rseg_hdr->unfix();
+ rseg_hdr->page.lock.x_unlock();
+ goto reget;
+ }
+ mtr.memo_push(rseg_hdr, MTR_MEMO_PAGE_X_MODIFY);
- goto loop;
+ goto loop;
}
/** Cleanse purge queue to remove the rseg that reside in undo-tablespace
@@ -1234,43 +1238,6 @@ trx_purge_attach_undo_recs(ulint n_purge_threads)
return(n_pages_handled);
}
-/*******************************************************************//**
-Calculate the DML delay required.
-@return delay in microseconds or ULINT_MAX */
-static
-ulint
-trx_purge_dml_delay(void)
-/*=====================*/
-{
- /* Determine how much data manipulation language (DML) statements
- need to be delayed in order to reduce the lagging of the purge
- thread. */
- ulint delay = 0; /* in microseconds; default: no delay */
-
- /* If purge lag is set then calculate the new DML delay. */
-
- if (srv_max_purge_lag > 0) {
- double ratio = static_cast<double>(trx_sys.history_size()) /
- static_cast<double>(srv_max_purge_lag);
-
- if (ratio > 1.0) {
- /* If the history list length exceeds the
- srv_max_purge_lag, the data manipulation
- statements are delayed by at least 5000
- microseconds. */
- delay = (ulint) ((ratio - .5) * 10000);
- }
-
- if (delay > srv_max_purge_lag_delay) {
- delay = srv_max_purge_lag_delay;
- }
-
- MONITOR_SET(MONITOR_DML_PURGE_DELAY, delay);
- }
-
- return(delay);
-}
-
extern tpool::waitable_task purge_worker_task;
/** Wait for pending purge jobs to complete. */
@@ -1314,18 +1281,18 @@ TRANSACTIONAL_INLINE void purge_sys_t::clone_end_view()
/**
Run a purge batch.
-@param n_tasks number of purge tasks to submit to the queue
-@param truncate whether to truncate the history at the end of the batch
+@param n_tasks number of purge tasks to submit to the queue
+@param history_size trx_sys.history_size()
+@param truncate whether to truncate the history at the end of the batch
@return number of undo log pages handled in the batch */
-TRANSACTIONAL_TARGET ulint trx_purge(ulint n_tasks, bool truncate)
+TRANSACTIONAL_TARGET
+ulint trx_purge(ulint n_tasks, ulint history_size, bool truncate)
{
que_thr_t* thr = NULL;
ulint n_pages_handled;
ut_ad(n_tasks > 0);
- srv_dml_needed_delay = trx_purge_dml_delay();
-
purge_sys.clone_oldest_view();
#ifdef UNIV_DEBUG
@@ -1337,6 +1304,24 @@ TRANSACTIONAL_TARGET ulint trx_purge(ulint n_tasks, bool truncate)
/* Fetch the UNDO recs that need to be purged. */
n_pages_handled = trx_purge_attach_undo_recs(n_tasks);
+ {
+ ulint delay = n_pages_handled ? srv_max_purge_lag : 0;
+ if (UNIV_UNLIKELY(delay)) {
+ if (delay >= history_size) {
+ no_throttle:
+ delay = 0;
+ } else if (const ulint max_delay =
+ srv_max_purge_lag_delay) {
+ delay = std::min(max_delay,
+ 10000 * history_size / delay
+ - 5000);
+ } else {
+ goto no_throttle;
+ }
+ }
+ srv_dml_needed_delay = delay;
+ }
+
/* Submit tasks to workers queue if using multi-threaded purge. */
for (ulint i = n_tasks; --i; ) {
thr = que_fork_scheduler_round_robin(purge_sys.query, thr);
diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc
index e70516a2d2d..c1a7b08b717 100644
--- a/storage/innobase/trx/trx0rec.cc
+++ b/storage/innobase/trx/trx0rec.cc
@@ -1875,26 +1875,28 @@ trx_undo_report_row_operation(
}
mtr_t mtr;
+ dberr_t err;
mtr.start();
trx_undo_t** pundo;
trx_rseg_t* rseg;
const bool is_temp = index->table->is_temporary();
+ buf_block_t* undo_block;
if (is_temp) {
mtr.set_log_mode(MTR_LOG_NO_REDO);
-
rseg = trx->get_temp_rseg();
pundo = &trx->rsegs.m_noredo.undo;
+ undo_block = trx_undo_assign_low<true>(trx, rseg, pundo,
+ &mtr, &err);
} else {
ut_ad(!trx->read_only);
ut_ad(trx->id);
pundo = &trx->rsegs.m_redo.undo;
rseg = trx->rsegs.m_redo.rseg;
+ undo_block = trx_undo_assign_low<false>(trx, rseg, pundo,
+ &mtr, &err);
}
- dberr_t err;
- buf_block_t* undo_block = trx_undo_assign_low(trx, rseg, pundo,
- &err, &mtr);
trx_undo_t* undo = *pundo;
ut_ad((err == DB_SUCCESS) == (undo_block != NULL));
if (UNIV_UNLIKELY(undo_block == NULL)) {
diff --git a/storage/innobase/trx/trx0rseg.cc b/storage/innobase/trx/trx0rseg.cc
index 1dc3c18fc09..e730530adb2 100644
--- a/storage/innobase/trx/trx0rseg.cc
+++ b/storage/innobase/trx/trx0rseg.cc
@@ -395,7 +395,6 @@ void trx_rseg_t::reinit(uint32_t page)
{
next= UT_LIST_GET_NEXT(undo_list, undo);
UT_LIST_REMOVE(undo_cached, undo);
- MONITOR_DEC(MONITOR_NUM_UNDO_SLOT_CACHED);
ut_free(undo);
}
@@ -404,6 +403,7 @@ void trx_rseg_t::reinit(uint32_t page)
last_commit_and_offset= 0;
last_page_no= FIL_NULL;
curr_size= 1;
+ ref.store(0, std::memory_order_release);
}
/** Read the undo log lists.
@@ -428,7 +428,6 @@ static dberr_t trx_undo_lists_init(trx_rseg_t *rseg,
if (is_undo_empty)
is_undo_empty= !undo->size || undo->state == TRX_UNDO_CACHED;
rseg->curr_size+= undo->size;
- MONITOR_INC(MONITOR_NUM_UNDO_SLOT_USED);
}
}
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index e88f7824ba6..0f85aec540f 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -816,28 +816,17 @@ static void trx_assign_rseg_low(trx_t *trx)
static Atomic_counter<unsigned> rseg_slot;
unsigned slot = rseg_slot++ % TRX_SYS_N_RSEGS;
ut_d(if (trx_rseg_n_slots_debug) slot = 0);
+ ut_d(const auto start_scan_slot = slot);
+ ut_d(bool look_for_rollover = false);
trx_rseg_t* rseg;
-#ifdef UNIV_DEBUG
- ulint start_scan_slot = slot;
- bool look_for_rollover = false;
-#endif /* UNIV_DEBUG */
-
bool allocated;
do {
for (;;) {
rseg = &trx_sys.rseg_array[slot];
-
-#ifdef UNIV_DEBUG
- /* Ensure that we are not revisiting the same
- slot that we have already inspected. */
- if (look_for_rollover) {
- ut_ad(start_scan_slot != slot);
- }
- look_for_rollover = true;
-#endif /* UNIV_DEBUG */
-
+ ut_ad(!look_for_rollover || start_scan_slot != slot);
+ ut_d(look_for_rollover = true);
ut_d(if (!trx_rseg_n_slots_debug))
slot = (slot + 1) % TRX_SYS_N_RSEGS;
@@ -1038,7 +1027,13 @@ trx_write_serialisation_history(
mtr_t temp_mtr;
temp_mtr.start();
temp_mtr.set_log_mode(MTR_LOG_NO_REDO);
- trx_undo_set_state_at_finish(undo, &temp_mtr);
+ buf_block_t* block= buf_page_get(page_id_t(SRV_TMP_SPACE_ID,
+ undo->hdr_page_no),
+ 0, RW_X_LATCH, mtr);
+ ut_a(block);
+ temp_mtr.write<2>(*block, TRX_UNDO_SEG_HDR + TRX_UNDO_STATE
+ + block->page.frame, TRX_UNDO_TO_PURGE);
+ undo->state = TRX_UNDO_TO_PURGE;
temp_mtr.commit();
}
diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc
index 3b9c598e745..cbbf316fe69 100644
--- a/storage/innobase/trx/trx0undo.cc
+++ b/storage/innobase/trx/trx0undo.cc
@@ -535,8 +535,6 @@ trx_undo_seg_create(fil_space_t *space, buf_block_t *rseg_hdr, ulint *id,
+ slot_no * TRX_RSEG_SLOT_SIZE + rseg_hdr->page.frame,
block->page.id().page_no());
- MONITOR_INC(MONITOR_NUM_UNDO_SLOT_USED);
-
*err = DB_SUCCESS;
return block;
}
@@ -991,7 +989,6 @@ static void trx_undo_seg_free(const trx_undo_t *undo)
static_assert(FIL_NULL == 0xffffffff, "compatibility");
mtr.memset(rseg_header, TRX_RSEG + TRX_RSEG_UNDO_SLOTS +
undo->id * TRX_RSEG_SLOT_SIZE, 4, 0xff);
- MONITOR_DEC(MONITOR_NUM_UNDO_SLOT_USED);
}
}
@@ -1150,7 +1147,6 @@ corrupted_type:
UT_LIST_ADD_LAST(rseg->undo_list, undo);
} else {
UT_LIST_ADD_LAST(rseg->undo_cached, undo);
- MONITOR_INC(MONITOR_NUM_UNDO_SLOT_CACHED);
}
mtr.commit();
@@ -1289,27 +1285,25 @@ trx_undo_create(trx_t* trx, trx_rseg_t* rseg, trx_undo_t** undo,
@param[in,out] rseg rollback segment
@param[out] pundo the undo log memory object
@param[in,out] mtr mini-transaction
+@param[out] err error code
@return the undo log block
@retval NULL if none cached */
static
buf_block_t*
trx_undo_reuse_cached(trx_t* trx, trx_rseg_t* rseg, trx_undo_t** pundo,
- mtr_t* mtr)
+ mtr_t* mtr, dberr_t *err)
{
- if (rseg->is_persistent()) {
- ut_ad(rseg->is_referenced());
- if (rseg->needs_purge <= trx->id) {
- /* trx_purge_truncate_history() compares
- rseg->needs_purge <= head.trx_no
- so we need to compensate for that.
- The rseg->needs_purge after crash
- recovery would be at least trx->id + 1,
- because that is the minimum possible value
- assigned by trx_serialise() on commit. */
- rseg->needs_purge = trx->id + 1;
- }
- } else {
- ut_ad(!rseg->is_referenced());
+ ut_ad(rseg->is_persistent());
+ ut_ad(rseg->is_referenced());
+ if (rseg->needs_purge <= trx->id) {
+ /* trx_purge_truncate_history() compares
+ rseg->needs_purge <= head.trx_no
+ so we need to compensate for that.
+ The rseg->needs_purge after crash
+ recovery would be at least trx->id + 1,
+ because that is the minimum possible value
+ assigned by trx_serialise() on commit. */
+ rseg->needs_purge = trx->id + 1;
}
trx_undo_t* undo = UT_LIST_GET_FIRST(rseg->undo_cached);
@@ -1320,15 +1314,15 @@ trx_undo_reuse_cached(trx_t* trx, trx_rseg_t* rseg, trx_undo_t** pundo,
ut_ad(undo->size == 1);
ut_ad(undo->id < TRX_RSEG_N_SLOTS);
- buf_block_t* block = buf_page_get(page_id_t(undo->rseg->space->id,
- undo->hdr_page_no),
- 0, RW_X_LATCH, mtr);
+ buf_block_t* block = buf_page_get_gen(page_id_t(undo->rseg->space->id,
+ undo->hdr_page_no),
+ 0, RW_X_LATCH, nullptr, BUF_GET,
+ mtr, err);
if (!block) {
return NULL;
}
UT_LIST_REMOVE(rseg->undo_cached, undo);
- MONITOR_DEC(MONITOR_NUM_UNDO_SLOT_CACHED);
*pundo = undo;
@@ -1374,11 +1368,12 @@ trx_undo_assign(trx_t* trx, dberr_t* err, mtr_t* mtr)
BUF_GET, mtr, err);
}
+ *err = DB_SUCCESS;
trx_rseg_t* rseg = trx->rsegs.m_redo.rseg;
rseg->latch.wr_lock(SRW_LOCK_CALL);
buf_block_t* block = trx_undo_reuse_cached(
- trx, rseg, &trx->rsegs.m_redo.undo, mtr);
+ trx, rseg, &trx->rsegs.m_redo.undo, mtr, err);
if (!block) {
block = trx_undo_create(trx, rseg, &trx->rsegs.m_redo.undo,
@@ -1387,8 +1382,6 @@ trx_undo_assign(trx_t* trx, dberr_t* err, mtr_t* mtr)
if (!block) {
goto func_exit;
}
- } else {
- *err = DB_SUCCESS;
}
UT_LIST_ADD_FIRST(rseg->undo_list, trx->rsegs.m_redo.undo);
@@ -1400,18 +1393,20 @@ func_exit:
/** Assign an undo log for a transaction.
A new undo log is created or a cached undo log reused.
+@tparam is_temp whether this is temporary undo log
@param[in,out] trx transaction
@param[in] rseg rollback segment
@param[out] undo the undo log
-@param[out] err error code
@param[in,out] mtr mini-transaction
+@param[out] err error code
@return the undo log block
-@retval NULL on error */
+@retval nullptr on error */
+template<bool is_temp>
buf_block_t*
-trx_undo_assign_low(trx_t* trx, trx_rseg_t* rseg, trx_undo_t** undo,
- dberr_t* err, mtr_t* mtr)
+trx_undo_assign_low(trx_t *trx, trx_rseg_t *rseg, trx_undo_t **undo,
+ mtr_t *mtr, dberr_t *err)
{
- ut_d(const bool is_temp = rseg == trx->rsegs.m_noredo.rseg);
+ ut_ad(is_temp == (rseg == trx->rsegs.m_noredo.rseg));
ut_ad(is_temp || rseg == trx->rsegs.m_redo.rseg);
ut_ad(undo == (is_temp
? &trx->rsegs.m_noredo.undo
@@ -1431,19 +1426,24 @@ trx_undo_assign_low(trx_t* trx, trx_rseg_t* rseg, trx_undo_t** undo,
*err = DB_TOO_MANY_CONCURRENT_TRXS; return NULL;
);
+ *err = DB_SUCCESS;
rseg->latch.wr_lock(SRW_LOCK_CALL);
- buf_block_t* block = trx_undo_reuse_cached(trx, rseg, undo, mtr);
-
- if (!block) {
- block = trx_undo_create(trx, rseg, undo, err, mtr);
- ut_ad(!block == (*err != DB_SUCCESS));
- if (!block) {
- goto func_exit;
- }
+ buf_block_t* block;
+ if (is_temp) {
+ ut_ad(!UT_LIST_GET_LEN(rseg->undo_cached));
} else {
- *err = DB_SUCCESS;
+ block = trx_undo_reuse_cached(trx, rseg, undo, mtr, err);
+ if (block) {
+ goto got_block;
+ }
+ }
+ block = trx_undo_create(trx, rseg, undo, err, mtr);
+ ut_ad(!block == (*err != DB_SUCCESS));
+ if (!block) {
+ goto func_exit;
}
+got_block:
UT_LIST_ADD_FIRST(rseg->undo_list, *undo);
func_exit:
@@ -1451,6 +1451,13 @@ func_exit:
return block;
}
+template buf_block_t*
+trx_undo_assign_low<false>(trx_t *trx, trx_rseg_t *rseg, trx_undo_t **undo,
+ mtr_t *mtr, dberr_t *err);
+template buf_block_t*
+trx_undo_assign_low<true>(trx_t *trx, trx_rseg_t *rseg, trx_undo_t **undo,
+ mtr_t *mtr, dberr_t *err);
+
/******************************************************************//**
Sets the state of the undo log segment at a transaction finish.
@return undo log segment header page, x-latched */
@@ -1461,6 +1468,7 @@ trx_undo_set_state_at_finish(
mtr_t* mtr) /*!< in: mtr */
{
ut_ad(undo->id < TRX_RSEG_N_SLOTS);
+ ut_ad(undo->rseg->is_persistent());
buf_block_t *block=
buf_page_get(page_id_t(undo->rseg->space->id, undo->hdr_page_no), 0,
@@ -1532,29 +1540,19 @@ the data can be discarded.
@param undo temporary undo log */
void trx_undo_commit_cleanup(trx_undo_t *undo)
{
- trx_rseg_t* rseg = undo->rseg;
- ut_ad(rseg->space == fil_system.temp_space);
-
- rseg->latch.wr_lock(SRW_LOCK_CALL);
-
- UT_LIST_REMOVE(rseg->undo_list, undo);
-
- if (undo->state == TRX_UNDO_CACHED) {
- UT_LIST_ADD_FIRST(rseg->undo_cached, undo);
- MONITOR_INC(MONITOR_NUM_UNDO_SLOT_CACHED);
- undo = nullptr;
- } else {
- ut_ad(undo->state == TRX_UNDO_TO_PURGE);
-
- /* Delete first the undo log segment in the file */
- trx_undo_seg_free(undo);
+ trx_rseg_t *rseg= undo->rseg;
+ ut_ad(rseg->space == fil_system.temp_space);
+ rseg->latch.wr_lock(SRW_LOCK_CALL);
- ut_ad(rseg->curr_size > undo->size);
- rseg->curr_size -= undo->size;
- }
+ UT_LIST_REMOVE(rseg->undo_list, undo);
+ ut_ad(undo->state == TRX_UNDO_TO_PURGE);
+ /* Delete first the undo log segment in the file */
+ trx_undo_seg_free(undo);
+ ut_ad(rseg->curr_size > undo->size);
+ rseg->curr_size-= undo->size;
- rseg->latch.wr_unlock();
- ut_free(undo);
+ rseg->latch.wr_unlock();
+ ut_free(undo);
}
/** At shutdown, frees the undo logs of a transaction. */
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index f82823dba2b..2f58110cb91 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -188,7 +188,7 @@ static MYSQL_SYSVAR_BOOL(page_checksum, maria_page_checksums, 0,
/* It is only command line argument */
static MYSQL_SYSVAR_CONST_STR(log_dir_path, maria_data_root,
- PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Path to the directory where to store transactional log",
NULL, NULL, mysql_real_data_home);
@@ -1082,7 +1082,8 @@ const char *ha_maria::index_type(uint key_number)
ulong ha_maria::index_flags(uint inx, uint part, bool all_parts) const
{
ulong flags;
- if (table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT)
+ if (table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT ||
+ table_share->key_info[inx].algorithm == HA_KEY_ALG_UNIQUE_HASH)
flags= 0;
else
if ((table_share->key_info[inx].flags & HA_SPATIAL ||
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index ee5d44b5d26..8d03320ea58 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -343,7 +343,7 @@ IO_AND_CPU_COST ha_myisammrg::rnd_pos_time(ha_rows rows)
{
IO_AND_CPU_COST cost= handler::rnd_pos_time(rows);
/*
- Row data is notcached. costs.row_lookup_cost includes the cost of
+ Row data is not cached. costs.row_lookup_cost includes the cost of
the reading the row from system (probably cached by the OS).
*/
cost.io= 0;
@@ -1300,26 +1300,17 @@ int ha_myisammrg::info(uint flag)
table->s->keys_in_use.set_prefix(table->s->keys);
stats.mean_rec_length= mrg_info.reclength;
- /*
+ /*
The handler::block_size is used all over the code in index scan cost
calculations. It is used to get number of disk seeks required to
retrieve a number of index tuples.
- If the merge table has N underlying tables, then (assuming underlying
- tables have equal size, the only "simple" approach we can use)
- retrieving X index records from a merge table will require N times more
- disk seeks compared to doing the same on a MyISAM table with equal
- number of records.
- In the edge case (file_tables > myisam_block_size) we'll get
- block_size==0, and index calculation code will act as if we need one
- disk seek to retrieve one index tuple.
-
- TODO: In 5.2 index scan cost calculation will be factored out into a
- virtual function in class handler and we'll be able to remove this hack.
+ If the merge table has N underlying tables, there will be
+ N more disk seeks compared to a scanning a normal MyISAM table.
+ The number of bytes read is the rougly the same for a normal MyISAM
+ and a MyISAM merge tables.
*/
- stats.block_size= 0;
- if (file->tables)
- stats.block_size= myisam_block_size / file->tables;
-
+ stats.block_size= myisam_block_size;
+
stats.update_time= 0;
#if SIZEOF_OFF_T > 4
ref_length=6; // Should be big enough
diff --git a/storage/perfschema/CMakeLists.txt b/storage/perfschema/CMakeLists.txt
index 56ea79755a3..b4f5e96b607 100644
--- a/storage/perfschema/CMakeLists.txt
+++ b/storage/perfschema/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2022, Oracle and/or its affiliates.
+# Copyright (c) 2009, 2023, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_account.cc b/storage/perfschema/cursor_by_account.cc
index 25e3ed662d1..2fa224d3526 100644
--- a/storage/perfschema/cursor_by_account.cc
+++ b/storage/perfschema/cursor_by_account.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_account.h b/storage/perfschema/cursor_by_account.h
index 59adf2e0fc8..44175ceb3a2 100644
--- a/storage/perfschema/cursor_by_account.h
+++ b/storage/perfschema/cursor_by_account.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_host.cc b/storage/perfschema/cursor_by_host.cc
index 956644cfce2..aa22e8c0431 100644
--- a/storage/perfschema/cursor_by_host.cc
+++ b/storage/perfschema/cursor_by_host.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_host.h b/storage/perfschema/cursor_by_host.h
index a2ddae4b644..c8a83a47ec6 100644
--- a/storage/perfschema/cursor_by_host.h
+++ b/storage/perfschema/cursor_by_host.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_thread.cc b/storage/perfschema/cursor_by_thread.cc
index ff90c77e47d..307cb32943a 100644
--- a/storage/perfschema/cursor_by_thread.cc
+++ b/storage/perfschema/cursor_by_thread.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_thread.h b/storage/perfschema/cursor_by_thread.h
index 89d97997a41..50e162294cf 100644
--- a/storage/perfschema/cursor_by_thread.h
+++ b/storage/perfschema/cursor_by_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_thread_connect_attr.cc b/storage/perfschema/cursor_by_thread_connect_attr.cc
index 877056074f6..1db97f72b16 100644
--- a/storage/perfschema/cursor_by_thread_connect_attr.cc
+++ b/storage/perfschema/cursor_by_thread_connect_attr.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_thread_connect_attr.h b/storage/perfschema/cursor_by_thread_connect_attr.h
index 3c273708e39..4f48b40c870 100644
--- a/storage/perfschema/cursor_by_thread_connect_attr.h
+++ b/storage/perfschema/cursor_by_thread_connect_attr.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_user.cc b/storage/perfschema/cursor_by_user.cc
index 9778e240b8c..f1c9969f783 100644
--- a/storage/perfschema/cursor_by_user.cc
+++ b/storage/perfschema/cursor_by_user.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_user.h b/storage/perfschema/cursor_by_user.h
index f5b6800d9b1..6438515cf1e 100644
--- a/storage/perfschema/cursor_by_user.h
+++ b/storage/perfschema/cursor_by_user.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc
index 57aa40c7e86..c6d2f23d653 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h
index 20ed7448a1e..f1929d2334b 100644
--- a/storage/perfschema/ha_perfschema.h
+++ b/storage/perfschema/ha_perfschema.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc
index 244b11a30fc..8b3a159f7a2 100644
--- a/storage/perfschema/pfs.cc
+++ b/storage/perfschema/pfs.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -3068,7 +3068,8 @@ pfs_start_table_io_wait_v1(PSI_table_locker_state *state,
PFS_table_share *share= pfs_table->m_share;
wait->m_thread_internal_id= pfs_thread->m_thread_internal_id;
- wait->m_class= &global_table_io_class;
+ if (wait->m_class == NULL || wait->m_class->m_type != PFS_CLASS_TABLE_LOCK)
+ wait->m_class= &global_table_io_class;
wait->m_timer_start= timer_start;
wait->m_timer_end= 0;
wait->m_object_instance_addr= pfs_table->m_identity;
diff --git a/storage/perfschema/pfs.h b/storage/perfschema/pfs.h
index 94d349a5fd2..6e0cf258c91 100644
--- a/storage/perfschema/pfs.h
+++ b/storage/perfschema/pfs.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_account.cc b/storage/perfschema/pfs_account.cc
index 53a45bcfd9b..ecf26cd77ea 100644
--- a/storage/perfschema/pfs_account.cc
+++ b/storage/perfschema/pfs_account.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_account.h b/storage/perfschema/pfs_account.h
index 196f3595082..0aa36204e12 100644
--- a/storage/perfschema/pfs_account.h
+++ b/storage/perfschema/pfs_account.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_atomic.h b/storage/perfschema/pfs_atomic.h
index 54c4cba163c..8543cdabc88 100644
--- a/storage/perfschema/pfs_atomic.h
+++ b/storage/perfschema/pfs_atomic.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2009, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_autosize.cc b/storage/perfschema/pfs_autosize.cc
index d418ea594e2..36087d0cd3c 100644
--- a/storage/perfschema/pfs_autosize.cc
+++ b/storage/perfschema/pfs_autosize.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_buffer_container.cc b/storage/perfschema/pfs_buffer_container.cc
index dfae6e0ad2e..04f6f5219a3 100644
--- a/storage/perfschema/pfs_buffer_container.cc
+++ b/storage/perfschema/pfs_buffer_container.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_buffer_container.h b/storage/perfschema/pfs_buffer_container.h
index 0f856ceee86..d5745e76249 100644
--- a/storage/perfschema/pfs_buffer_container.h
+++ b/storage/perfschema/pfs_buffer_container.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_builtin_memory.cc b/storage/perfschema/pfs_builtin_memory.cc
index 60e97451852..c8b9e62f528 100644
--- a/storage/perfschema/pfs_builtin_memory.cc
+++ b/storage/perfschema/pfs_builtin_memory.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_builtin_memory.h b/storage/perfschema/pfs_builtin_memory.h
index c0f0aa86c45..956b31c5dcf 100644
--- a/storage/perfschema/pfs_builtin_memory.h
+++ b/storage/perfschema/pfs_builtin_memory.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_column_types.h b/storage/perfschema/pfs_column_types.h
index 1985c6ea719..862916fa4fc 100644
--- a/storage/perfschema/pfs_column_types.h
+++ b/storage/perfschema/pfs_column_types.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_column_values.cc b/storage/perfschema/pfs_column_values.cc
index fe3d16df21c..88da190ba3d 100644
--- a/storage/perfschema/pfs_column_values.cc
+++ b/storage/perfschema/pfs_column_values.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_column_values.h b/storage/perfschema/pfs_column_values.h
index e3f36512ef5..75fd7b1de8d 100644
--- a/storage/perfschema/pfs_column_values.h
+++ b/storage/perfschema/pfs_column_values.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_con_slice.cc b/storage/perfschema/pfs_con_slice.cc
index 9a3e2a60929..4c99a32f429 100644
--- a/storage/perfschema/pfs_con_slice.cc
+++ b/storage/perfschema/pfs_con_slice.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_con_slice.h b/storage/perfschema/pfs_con_slice.h
index d71e9f5a90a..f0a89c8fcd0 100644
--- a/storage/perfschema/pfs_con_slice.h
+++ b/storage/perfschema/pfs_con_slice.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_defaults.cc b/storage/perfschema/pfs_defaults.cc
index d5c415a5f77..23599c9ed87 100644
--- a/storage/perfschema/pfs_defaults.cc
+++ b/storage/perfschema/pfs_defaults.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_defaults.h b/storage/perfschema/pfs_defaults.h
index 0225010f8b3..23e8755f265 100644
--- a/storage/perfschema/pfs_defaults.h
+++ b/storage/perfschema/pfs_defaults.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_digest.cc b/storage/perfschema/pfs_digest.cc
index 0cb1b023a3e..fd5fdc5f8ff 100644
--- a/storage/perfschema/pfs_digest.cc
+++ b/storage/perfschema/pfs_digest.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_digest.h b/storage/perfschema/pfs_digest.h
index 6611cfbfd76..bec2c28ef59 100644
--- a/storage/perfschema/pfs_digest.h
+++ b/storage/perfschema/pfs_digest.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc
index 6a9351b9d91..76095b5311b 100644
--- a/storage/perfschema/pfs_engine_table.cc
+++ b/storage/perfschema/pfs_engine_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_engine_table.h b/storage/perfschema/pfs_engine_table.h
index 1f31c4fcdf6..02ef9b07010 100644
--- a/storage/perfschema/pfs_engine_table.h
+++ b/storage/perfschema/pfs_engine_table.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events.h b/storage/perfschema/pfs_events.h
index 41175596cf6..0f5022fee9c 100644
--- a/storage/perfschema/pfs_events.h
+++ b/storage/perfschema/pfs_events.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_stages.cc b/storage/perfschema/pfs_events_stages.cc
index 2e3ad4af786..aa1bdf4f7a0 100644
--- a/storage/perfschema/pfs_events_stages.cc
+++ b/storage/perfschema/pfs_events_stages.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_stages.h b/storage/perfschema/pfs_events_stages.h
index ff85f568c0f..f0b669cf846 100644
--- a/storage/perfschema/pfs_events_stages.h
+++ b/storage/perfschema/pfs_events_stages.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_events_statements.cc b/storage/perfschema/pfs_events_statements.cc
index c0f1809a2f3..05bdc83fc5c 100644
--- a/storage/perfschema/pfs_events_statements.cc
+++ b/storage/perfschema/pfs_events_statements.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_transactions.cc b/storage/perfschema/pfs_events_transactions.cc
index 6f6b1a4cbc6..5ccdb0345d7 100644
--- a/storage/perfschema/pfs_events_transactions.cc
+++ b/storage/perfschema/pfs_events_transactions.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_transactions.h b/storage/perfschema/pfs_events_transactions.h
index 46d42b1e121..b649f7f820a 100644
--- a/storage/perfschema/pfs_events_transactions.h
+++ b/storage/perfschema/pfs_events_transactions.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_waits.cc b/storage/perfschema/pfs_events_waits.cc
index 0462c2cf9ef..3ec6a671913 100644
--- a/storage/perfschema/pfs_events_waits.cc
+++ b/storage/perfschema/pfs_events_waits.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_waits.h b/storage/perfschema/pfs_events_waits.h
index 034d0f5c740..93dcb136834 100644
--- a/storage/perfschema/pfs_events_waits.h
+++ b/storage/perfschema/pfs_events_waits.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates..
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates..
Copyright (c) 2017, 2012, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_global.cc b/storage/perfschema/pfs_global.cc
index ccb43369907..8860be797be 100644
--- a/storage/perfschema/pfs_global.cc
+++ b/storage/perfschema/pfs_global.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights
reserved.
Copyright (c) 2022, MariaDB Corporation.
diff --git a/storage/perfschema/pfs_global.h b/storage/perfschema/pfs_global.h
index 243d67bbb86..6b73fd9f8a5 100644
--- a/storage/perfschema/pfs_global.h
+++ b/storage/perfschema/pfs_global.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_host.cc b/storage/perfschema/pfs_host.cc
index ca049054133..d54725fe9a8 100644
--- a/storage/perfschema/pfs_host.cc
+++ b/storage/perfschema/pfs_host.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_host.h b/storage/perfschema/pfs_host.h
index d05c37bfd01..56bcccb94ac 100644
--- a/storage/perfschema/pfs_host.h
+++ b/storage/perfschema/pfs_host.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc
index 0a7c8f8ffc9..f08d1a25174 100644
--- a/storage/perfschema/pfs_instr.cc
+++ b/storage/perfschema/pfs_instr.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_instr.h b/storage/perfschema/pfs_instr.h
index b9f31e63636..868f772267c 100644
--- a/storage/perfschema/pfs_instr.h
+++ b/storage/perfschema/pfs_instr.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_instr_class.cc b/storage/perfschema/pfs_instr_class.cc
index 2a6be8be6d4..2b1a80d3e11 100644
--- a/storage/perfschema/pfs_instr_class.cc
+++ b/storage/perfschema/pfs_instr_class.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
Copyright (c) 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_instr_class.h b/storage/perfschema/pfs_instr_class.h
index c3f83c45b7e..f353c410d4c 100644
--- a/storage/perfschema/pfs_instr_class.h
+++ b/storage/perfschema/pfs_instr_class.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_lock.h b/storage/perfschema/pfs_lock.h
index ae90ebd0784..0f4bcb6de8f 100644
--- a/storage/perfschema/pfs_lock.h
+++ b/storage/perfschema/pfs_lock.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2009, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_memory.cc b/storage/perfschema/pfs_memory.cc
index 4b4b14fc186..0ee8e3dd7df 100644
--- a/storage/perfschema/pfs_memory.cc
+++ b/storage/perfschema/pfs_memory.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_memory.h b/storage/perfschema/pfs_memory.h
index 085f8af8bad..ee90b7d90e9 100644
--- a/storage/perfschema/pfs_memory.h
+++ b/storage/perfschema/pfs_memory.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_prepared_stmt.cc b/storage/perfschema/pfs_prepared_stmt.cc
index e0e10553680..50e4e27bb1e 100644
--- a/storage/perfschema/pfs_prepared_stmt.cc
+++ b/storage/perfschema/pfs_prepared_stmt.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_prepared_stmt.h b/storage/perfschema/pfs_prepared_stmt.h
index d89ad80cbd8..1a06122382c 100644
--- a/storage/perfschema/pfs_prepared_stmt.h
+++ b/storage/perfschema/pfs_prepared_stmt.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_program.cc b/storage/perfschema/pfs_program.cc
index 9bd9f06b22c..de456610519 100644
--- a/storage/perfschema/pfs_program.cc
+++ b/storage/perfschema/pfs_program.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_program.h b/storage/perfschema/pfs_program.h
index 56abcee97f7..a5a6245c1cc 100644
--- a/storage/perfschema/pfs_program.h
+++ b/storage/perfschema/pfs_program.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_server.cc b/storage/perfschema/pfs_server.cc
index f5b1bf9c03f..258c2153d24 100644
--- a/storage/perfschema/pfs_server.cc
+++ b/storage/perfschema/pfs_server.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_server.h b/storage/perfschema/pfs_server.h
index d87d48ac19b..7c22812fca8 100644
--- a/storage/perfschema/pfs_server.h
+++ b/storage/perfschema/pfs_server.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_setup_actor.cc b/storage/perfschema/pfs_setup_actor.cc
index ca45547d6ee..efe19b3c8b3 100644
--- a/storage/perfschema/pfs_setup_actor.cc
+++ b/storage/perfschema/pfs_setup_actor.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_setup_actor.h b/storage/perfschema/pfs_setup_actor.h
index ede8f6c4b4e..8e401dcd42a 100644
--- a/storage/perfschema/pfs_setup_actor.h
+++ b/storage/perfschema/pfs_setup_actor.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_setup_object.cc b/storage/perfschema/pfs_setup_object.cc
index 64a54e9369a..78617d1b2c6 100644
--- a/storage/perfschema/pfs_setup_object.cc
+++ b/storage/perfschema/pfs_setup_object.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_setup_object.h b/storage/perfschema/pfs_setup_object.h
index 259c3dc8340..e934e01eccc 100644
--- a/storage/perfschema/pfs_setup_object.h
+++ b/storage/perfschema/pfs_setup_object.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_stat.h b/storage/perfschema/pfs_stat.h
index 1349b7ba4df..af0be085431 100644
--- a/storage/perfschema/pfs_stat.h
+++ b/storage/perfschema/pfs_stat.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_status.cc b/storage/perfschema/pfs_status.cc
index 62aed2e8de9..2596c53c4ad 100644
--- a/storage/perfschema/pfs_status.cc
+++ b/storage/perfschema/pfs_status.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_status.h b/storage/perfschema/pfs_status.h
index a415fcc4704..42329ffb492 100644
--- a/storage/perfschema/pfs_status.h
+++ b/storage/perfschema/pfs_status.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_timer.cc b/storage/perfschema/pfs_timer.cc
index 36cd0df141d..15e1a188bb0 100644
--- a/storage/perfschema/pfs_timer.cc
+++ b/storage/perfschema/pfs_timer.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_timer.h b/storage/perfschema/pfs_timer.h
index 6218bc603d8..e5393a4a8a4 100644
--- a/storage/perfschema/pfs_timer.h
+++ b/storage/perfschema/pfs_timer.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_user.cc b/storage/perfschema/pfs_user.cc
index bd5fc3eadce..1f299d9b9b6 100644
--- a/storage/perfschema/pfs_user.cc
+++ b/storage/perfschema/pfs_user.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_user.h b/storage/perfschema/pfs_user.h
index acffaf9a724..e15e733e5ac 100644
--- a/storage/perfschema/pfs_user.h
+++ b/storage/perfschema/pfs_user.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_variable.cc b/storage/perfschema/pfs_variable.cc
index 982409baf82..239c55b623c 100644
--- a/storage/perfschema/pfs_variable.cc
+++ b/storage/perfschema/pfs_variable.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
Copyright (c) 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_variable.h b/storage/perfschema/pfs_variable.h
index 948baf4e3b8..d3ad4c7f900 100644
--- a/storage/perfschema/pfs_variable.h
+++ b/storage/perfschema/pfs_variable.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_visitor.cc b/storage/perfschema/pfs_visitor.cc
index 17ef39448f9..92a5c99e13b 100644
--- a/storage/perfschema/pfs_visitor.cc
+++ b/storage/perfschema/pfs_visitor.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_visitor.h b/storage/perfschema/pfs_visitor.h
index c5e5f826b7c..03684ba9ca6 100644
--- a/storage/perfschema/pfs_visitor.h
+++ b/storage/perfschema/pfs_visitor.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_accounts.cc b/storage/perfschema/table_accounts.cc
index fcf636b8e3e..654a4400eef 100644
--- a/storage/perfschema/table_accounts.cc
+++ b/storage/perfschema/table_accounts.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_accounts.h b/storage/perfschema/table_accounts.h
index 239f278051d..28348190e69 100644
--- a/storage/perfschema/table_accounts.h
+++ b/storage/perfschema/table_accounts.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_all_instr.cc b/storage/perfschema/table_all_instr.cc
index c4d05cf13f0..1ca0525acd7 100644
--- a/storage/perfschema/table_all_instr.cc
+++ b/storage/perfschema/table_all_instr.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_all_instr.h b/storage/perfschema/table_all_instr.h
index 6895b0b2c47..d7f3fe6aa1a 100644
--- a/storage/perfschema/table_all_instr.h
+++ b/storage/perfschema/table_all_instr.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.cc b/storage/perfschema/table_esgs_by_account_by_event_name.cc
index cfc325f352e..42d3592ad10 100644
--- a/storage/perfschema/table_esgs_by_account_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.h b/storage/perfschema/table_esgs_by_account_by_event_name.h
index 98bf82e2b96..fa0c7d8ec2d 100644
--- a/storage/perfschema/table_esgs_by_account_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.cc b/storage/perfschema/table_esgs_by_host_by_event_name.cc
index 2a3e72353b6..e5982164824 100644
--- a/storage/perfschema/table_esgs_by_host_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.h b/storage/perfschema/table_esgs_by_host_by_event_name.h
index 64349ecc7d9..f71a479c8fa 100644
--- a/storage/perfschema/table_esgs_by_host_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esgs_by_thread_by_event_name.cc b/storage/perfschema/table_esgs_by_thread_by_event_name.cc
index 69111680704..c393eae902e 100644
--- a/storage/perfschema/table_esgs_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_thread_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esgs_by_thread_by_event_name.h b/storage/perfschema/table_esgs_by_thread_by_event_name.h
index 4f32d76e256..f9a52ebe189 100644
--- a/storage/perfschema/table_esgs_by_thread_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_thread_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.cc b/storage/perfschema/table_esgs_by_user_by_event_name.cc
index d8b6af382a3..fee2efe3786 100644
--- a/storage/perfschema/table_esgs_by_user_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.h b/storage/perfschema/table_esgs_by_user_by_event_name.h
index 3a211d19ad4..e8b421089c8 100644
--- a/storage/perfschema/table_esgs_by_user_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esgs_global_by_event_name.cc b/storage/perfschema/table_esgs_global_by_event_name.cc
index 288891861c9..37d134db1dc 100644
--- a/storage/perfschema/table_esgs_global_by_event_name.cc
+++ b/storage/perfschema/table_esgs_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esgs_global_by_event_name.h b/storage/perfschema/table_esgs_global_by_event_name.h
index 013e04308eb..bfcd70174ec 100644
--- a/storage/perfschema/table_esgs_global_by_event_name.h
+++ b/storage/perfschema/table_esgs_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esms_by_account_by_event_name.cc b/storage/perfschema/table_esms_by_account_by_event_name.cc
index a1805170332..cb27e9dbfc0 100644
--- a/storage/perfschema/table_esms_by_account_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esms_by_account_by_event_name.h b/storage/perfschema/table_esms_by_account_by_event_name.h
index 3ea7620204b..638cc28ed7b 100644
--- a/storage/perfschema/table_esms_by_account_by_event_name.h
+++ b/storage/perfschema/table_esms_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esms_by_digest.cc b/storage/perfschema/table_esms_by_digest.cc
index 6a3f2bf3c3c..0dccaf1aca5 100644
--- a/storage/perfschema/table_esms_by_digest.cc
+++ b/storage/perfschema/table_esms_by_digest.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esms_by_digest.h b/storage/perfschema/table_esms_by_digest.h
index d231d3388f8..4711ffc56bf 100644
--- a/storage/perfschema/table_esms_by_digest.h
+++ b/storage/perfschema/table_esms_by_digest.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esms_by_host_by_event_name.cc b/storage/perfschema/table_esms_by_host_by_event_name.cc
index 3e7355fef80..bd7a9f575c0 100644
--- a/storage/perfschema/table_esms_by_host_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esms_by_host_by_event_name.h b/storage/perfschema/table_esms_by_host_by_event_name.h
index 7c8c0e777e8..65a7256b9cb 100644
--- a/storage/perfschema/table_esms_by_host_by_event_name.h
+++ b/storage/perfschema/table_esms_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esms_by_program.cc b/storage/perfschema/table_esms_by_program.cc
index ab3e1a440b8..e898d8abe1c 100644
--- a/storage/perfschema/table_esms_by_program.cc
+++ b/storage/perfschema/table_esms_by_program.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esms_by_program.h b/storage/perfschema/table_esms_by_program.h
index a9aa47c2300..f9e686efc6f 100644
--- a/storage/perfschema/table_esms_by_program.h
+++ b/storage/perfschema/table_esms_by_program.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esms_by_thread_by_event_name.cc b/storage/perfschema/table_esms_by_thread_by_event_name.cc
index ad22fa3c63f..08d244362a1 100644
--- a/storage/perfschema/table_esms_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_thread_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esms_by_thread_by_event_name.h b/storage/perfschema/table_esms_by_thread_by_event_name.h
index e4b1ba63eb8..87a4e3c3ed4 100644
--- a/storage/perfschema/table_esms_by_thread_by_event_name.h
+++ b/storage/perfschema/table_esms_by_thread_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esms_by_user_by_event_name.cc b/storage/perfschema/table_esms_by_user_by_event_name.cc
index 82479d329b3..4be0f09fccf 100644
--- a/storage/perfschema/table_esms_by_user_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esms_by_user_by_event_name.h b/storage/perfschema/table_esms_by_user_by_event_name.h
index 18516dfdb48..cbd388ef606 100644
--- a/storage/perfschema/table_esms_by_user_by_event_name.h
+++ b/storage/perfschema/table_esms_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esms_global_by_event_name.cc b/storage/perfschema/table_esms_global_by_event_name.cc
index cde0ef5deee..0fe61e2cc8e 100644
--- a/storage/perfschema/table_esms_global_by_event_name.cc
+++ b/storage/perfschema/table_esms_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esms_global_by_event_name.h b/storage/perfschema/table_esms_global_by_event_name.h
index 67dd631c71c..21a6b1a18b9 100644
--- a/storage/perfschema/table_esms_global_by_event_name.h
+++ b/storage/perfschema/table_esms_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ets_by_account_by_event_name.cc b/storage/perfschema/table_ets_by_account_by_event_name.cc
index 95746b57e5a..f2eef2efb6e 100644
--- a/storage/perfschema/table_ets_by_account_by_event_name.cc
+++ b/storage/perfschema/table_ets_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ets_by_account_by_event_name.h b/storage/perfschema/table_ets_by_account_by_event_name.h
index e227db2e08e..a5202b299e0 100644
--- a/storage/perfschema/table_ets_by_account_by_event_name.h
+++ b/storage/perfschema/table_ets_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ets_by_host_by_event_name.cc b/storage/perfschema/table_ets_by_host_by_event_name.cc
index 5b89e9cbfd2..cbdddbaa330 100644
--- a/storage/perfschema/table_ets_by_host_by_event_name.cc
+++ b/storage/perfschema/table_ets_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ets_by_host_by_event_name.h b/storage/perfschema/table_ets_by_host_by_event_name.h
index add2d1a32a6..00b4dbd02f8 100644
--- a/storage/perfschema/table_ets_by_host_by_event_name.h
+++ b/storage/perfschema/table_ets_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ets_by_thread_by_event_name.cc b/storage/perfschema/table_ets_by_thread_by_event_name.cc
index 1dc876bd293..aff08f7f9b2 100644
--- a/storage/perfschema/table_ets_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_ets_by_thread_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ets_by_thread_by_event_name.h b/storage/perfschema/table_ets_by_thread_by_event_name.h
index a69e19653ee..1fa62f84e51 100644
--- a/storage/perfschema/table_ets_by_thread_by_event_name.h
+++ b/storage/perfschema/table_ets_by_thread_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ets_by_user_by_event_name.cc b/storage/perfschema/table_ets_by_user_by_event_name.cc
index 3883e8c7e69..6aff6838f8c 100644
--- a/storage/perfschema/table_ets_by_user_by_event_name.cc
+++ b/storage/perfschema/table_ets_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ets_by_user_by_event_name.h b/storage/perfschema/table_ets_by_user_by_event_name.h
index fc18a3e94e6..9bd5b859ef9 100644
--- a/storage/perfschema/table_ets_by_user_by_event_name.h
+++ b/storage/perfschema/table_ets_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ets_global_by_event_name.cc b/storage/perfschema/table_ets_global_by_event_name.cc
index 209ecf47aac..b44d11511c2 100644
--- a/storage/perfschema/table_ets_global_by_event_name.cc
+++ b/storage/perfschema/table_ets_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ets_global_by_event_name.h b/storage/perfschema/table_ets_global_by_event_name.h
index a2136a23210..d5a67f43505 100644
--- a/storage/perfschema/table_ets_global_by_event_name.h
+++ b/storage/perfschema/table_ets_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_events_stages.cc b/storage/perfschema/table_events_stages.cc
index e2689ad0ad9..7b9b59a19f9 100644
--- a/storage/perfschema/table_events_stages.cc
+++ b/storage/perfschema/table_events_stages.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_events_stages.h b/storage/perfschema/table_events_stages.h
index b4941db54eb..d8b973acc8b 100644
--- a/storage/perfschema/table_events_stages.h
+++ b/storage/perfschema/table_events_stages.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_events_statements.cc b/storage/perfschema/table_events_statements.cc
index 4b27db19ca2..7801dab5086 100644
--- a/storage/perfschema/table_events_statements.cc
+++ b/storage/perfschema/table_events_statements.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_events_statements.h b/storage/perfschema/table_events_statements.h
index ca8bc804b01..6acad7bb90d 100644
--- a/storage/perfschema/table_events_statements.h
+++ b/storage/perfschema/table_events_statements.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_events_transactions.cc b/storage/perfschema/table_events_transactions.cc
index e9fe172d8cf..0dea61cbd47 100644
--- a/storage/perfschema/table_events_transactions.cc
+++ b/storage/perfschema/table_events_transactions.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_events_transactions.h b/storage/perfschema/table_events_transactions.h
index 940546093c8..f6024c63766 100644
--- a/storage/perfschema/table_events_transactions.h
+++ b/storage/perfschema/table_events_transactions.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_events_waits.cc b/storage/perfschema/table_events_waits.cc
index e0052b8f656..59b99dabc0f 100644
--- a/storage/perfschema/table_events_waits.cc
+++ b/storage/perfschema/table_events_waits.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_events_waits.h b/storage/perfschema/table_events_waits.h
index dcd0ea6231b..62df9ae2521 100644
--- a/storage/perfschema/table_events_waits.h
+++ b/storage/perfschema/table_events_waits.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_events_waits_summary.cc b/storage/perfschema/table_events_waits_summary.cc
index 3ee14e9a3e8..c848ebf4418 100644
--- a/storage/perfschema/table_events_waits_summary.cc
+++ b/storage/perfschema/table_events_waits_summary.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_events_waits_summary.h b/storage/perfschema/table_events_waits_summary.h
index a2b45c41fae..d84a79effc1 100644
--- a/storage/perfschema/table_events_waits_summary.h
+++ b/storage/perfschema/table_events_waits_summary.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ews_by_account_by_event_name.cc b/storage/perfschema/table_ews_by_account_by_event_name.cc
index 661fff768a8..bec37022517 100644
--- a/storage/perfschema/table_ews_by_account_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ews_by_account_by_event_name.h b/storage/perfschema/table_ews_by_account_by_event_name.h
index b50704e788b..df72f25809b 100644
--- a/storage/perfschema/table_ews_by_account_by_event_name.h
+++ b/storage/perfschema/table_ews_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ews_by_host_by_event_name.cc b/storage/perfschema/table_ews_by_host_by_event_name.cc
index 6fb54deb4b2..d6b702e04a7 100644
--- a/storage/perfschema/table_ews_by_host_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ews_by_host_by_event_name.h b/storage/perfschema/table_ews_by_host_by_event_name.h
index 0a554385511..c88b3d77a3f 100644
--- a/storage/perfschema/table_ews_by_host_by_event_name.h
+++ b/storage/perfschema/table_ews_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ews_by_thread_by_event_name.cc b/storage/perfschema/table_ews_by_thread_by_event_name.cc
index 35d82378717..7d84bda74e3 100644
--- a/storage/perfschema/table_ews_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_thread_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ews_by_thread_by_event_name.h b/storage/perfschema/table_ews_by_thread_by_event_name.h
index 9c526182bc8..7ac6638a1cd 100644
--- a/storage/perfschema/table_ews_by_thread_by_event_name.h
+++ b/storage/perfschema/table_ews_by_thread_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ews_by_user_by_event_name.cc b/storage/perfschema/table_ews_by_user_by_event_name.cc
index 62ea8aaa7be..e299ed04360 100644
--- a/storage/perfschema/table_ews_by_user_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ews_by_user_by_event_name.h b/storage/perfschema/table_ews_by_user_by_event_name.h
index 3a61c8bcd54..82c7319c19a 100644
--- a/storage/perfschema/table_ews_by_user_by_event_name.h
+++ b/storage/perfschema/table_ews_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ews_global_by_event_name.cc b/storage/perfschema/table_ews_global_by_event_name.cc
index 777112da092..c5d134c98e8 100644
--- a/storage/perfschema/table_ews_global_by_event_name.cc
+++ b/storage/perfschema/table_ews_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_ews_global_by_event_name.h b/storage/perfschema/table_ews_global_by_event_name.h
index 46aad715c22..84d8a742b3c 100644
--- a/storage/perfschema/table_ews_global_by_event_name.h
+++ b/storage/perfschema/table_ews_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_file_instances.cc b/storage/perfschema/table_file_instances.cc
index c5fd7db2c23..5af6f0551b6 100644
--- a/storage/perfschema/table_file_instances.cc
+++ b/storage/perfschema/table_file_instances.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_file_instances.h b/storage/perfschema/table_file_instances.h
index 6b8ffaeb591..5b1b9016f41 100644
--- a/storage/perfschema/table_file_instances.h
+++ b/storage/perfschema/table_file_instances.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_file_summary_by_event_name.cc b/storage/perfschema/table_file_summary_by_event_name.cc
index d91fb02fe06..fc9006c29fa 100644
--- a/storage/perfschema/table_file_summary_by_event_name.cc
+++ b/storage/perfschema/table_file_summary_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_file_summary_by_event_name.h b/storage/perfschema/table_file_summary_by_event_name.h
index 0c2b592ab60..80b08773b55 100644
--- a/storage/perfschema/table_file_summary_by_event_name.h
+++ b/storage/perfschema/table_file_summary_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_file_summary_by_instance.cc b/storage/perfschema/table_file_summary_by_instance.cc
index 5cd98955d62..89e08d49161 100644
--- a/storage/perfschema/table_file_summary_by_instance.cc
+++ b/storage/perfschema/table_file_summary_by_instance.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_file_summary_by_instance.h b/storage/perfschema/table_file_summary_by_instance.h
index b8b2115aeed..750ba904484 100644
--- a/storage/perfschema/table_file_summary_by_instance.h
+++ b/storage/perfschema/table_file_summary_by_instance.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_global_status.cc b/storage/perfschema/table_global_status.cc
index d9a20dc7e24..08531b555f7 100644
--- a/storage/perfschema/table_global_status.cc
+++ b/storage/perfschema/table_global_status.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_global_status.h b/storage/perfschema/table_global_status.h
index 45c57fb6900..5b5f6e60c37 100644
--- a/storage/perfschema/table_global_status.h
+++ b/storage/perfschema/table_global_status.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_global_variables.cc b/storage/perfschema/table_global_variables.cc
index fbe6b977cd1..39bf22438e4 100644
--- a/storage/perfschema/table_global_variables.cc
+++ b/storage/perfschema/table_global_variables.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_global_variables.h b/storage/perfschema/table_global_variables.h
index f5429c671a2..49083e63292 100644
--- a/storage/perfschema/table_global_variables.h
+++ b/storage/perfschema/table_global_variables.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_helper.cc b/storage/perfschema/table_helper.cc
index 477a1cd6006..dd5a765f4bf 100644
--- a/storage/perfschema/table_helper.cc
+++ b/storage/perfschema/table_helper.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_helper.h b/storage/perfschema/table_helper.h
index 0e39b80875f..ddea4c08b36 100644
--- a/storage/perfschema/table_helper.h
+++ b/storage/perfschema/table_helper.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_host_cache.cc b/storage/perfschema/table_host_cache.cc
index 79318223e21..03bfc151e37 100644
--- a/storage/perfschema/table_host_cache.cc
+++ b/storage/perfschema/table_host_cache.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_host_cache.h b/storage/perfschema/table_host_cache.h
index 482b8a2d66a..59e3a973421 100644
--- a/storage/perfschema/table_host_cache.h
+++ b/storage/perfschema/table_host_cache.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_hosts.cc b/storage/perfschema/table_hosts.cc
index 443cb12e6e0..bfb3ecad492 100644
--- a/storage/perfschema/table_hosts.cc
+++ b/storage/perfschema/table_hosts.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_hosts.h b/storage/perfschema/table_hosts.h
index cf94bdcbf79..1f82cc5c60b 100644
--- a/storage/perfschema/table_hosts.h
+++ b/storage/perfschema/table_hosts.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_md_locks.cc b/storage/perfschema/table_md_locks.cc
index 2b69e385a79..e7b76c12764 100644
--- a/storage/perfschema/table_md_locks.cc
+++ b/storage/perfschema/table_md_locks.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_md_locks.h b/storage/perfschema/table_md_locks.h
index ddb133ea7ff..5c9ad9b5638 100644
--- a/storage/perfschema/table_md_locks.h
+++ b/storage/perfschema/table_md_locks.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_mems_by_account_by_event_name.cc b/storage/perfschema/table_mems_by_account_by_event_name.cc
index ec074872733..4168d83eadd 100644
--- a/storage/perfschema/table_mems_by_account_by_event_name.cc
+++ b/storage/perfschema/table_mems_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_mems_by_account_by_event_name.h b/storage/perfschema/table_mems_by_account_by_event_name.h
index 626190461d5..e242bc40ac6 100644
--- a/storage/perfschema/table_mems_by_account_by_event_name.h
+++ b/storage/perfschema/table_mems_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_mems_by_host_by_event_name.cc b/storage/perfschema/table_mems_by_host_by_event_name.cc
index d08444c311d..cbe71d079ec 100644
--- a/storage/perfschema/table_mems_by_host_by_event_name.cc
+++ b/storage/perfschema/table_mems_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_mems_by_host_by_event_name.h b/storage/perfschema/table_mems_by_host_by_event_name.h
index f46f3c889e0..7920b362b5e 100644
--- a/storage/perfschema/table_mems_by_host_by_event_name.h
+++ b/storage/perfschema/table_mems_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_mems_by_thread_by_event_name.cc b/storage/perfschema/table_mems_by_thread_by_event_name.cc
index eb76a016030..2335688af03 100644
--- a/storage/perfschema/table_mems_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_mems_by_thread_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_mems_by_thread_by_event_name.h b/storage/perfschema/table_mems_by_thread_by_event_name.h
index 17196e0fd80..0f698990b47 100644
--- a/storage/perfschema/table_mems_by_thread_by_event_name.h
+++ b/storage/perfschema/table_mems_by_thread_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_mems_by_user_by_event_name.cc b/storage/perfschema/table_mems_by_user_by_event_name.cc
index 708c5681c3c..4a142cc9f5c 100644
--- a/storage/perfschema/table_mems_by_user_by_event_name.cc
+++ b/storage/perfschema/table_mems_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_mems_by_user_by_event_name.h b/storage/perfschema/table_mems_by_user_by_event_name.h
index c2ad8bd7462..c17f5d3302b 100644
--- a/storage/perfschema/table_mems_by_user_by_event_name.h
+++ b/storage/perfschema/table_mems_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_mems_global_by_event_name.cc b/storage/perfschema/table_mems_global_by_event_name.cc
index c84fa1a1529..69112a3bb51 100644
--- a/storage/perfschema/table_mems_global_by_event_name.cc
+++ b/storage/perfschema/table_mems_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_mems_global_by_event_name.h b/storage/perfschema/table_mems_global_by_event_name.h
index eaff095f8d7..ae3cd0435d6 100644
--- a/storage/perfschema/table_mems_global_by_event_name.h
+++ b/storage/perfschema/table_mems_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_os_global_by_type.cc b/storage/perfschema/table_os_global_by_type.cc
index ac1c123e5f4..19629d449eb 100644
--- a/storage/perfschema/table_os_global_by_type.cc
+++ b/storage/perfschema/table_os_global_by_type.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_os_global_by_type.h b/storage/perfschema/table_os_global_by_type.h
index 632bed522ed..7d0ed58ce5b 100644
--- a/storage/perfschema/table_os_global_by_type.h
+++ b/storage/perfschema/table_os_global_by_type.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_performance_timers.cc b/storage/perfschema/table_performance_timers.cc
index c89ad8d9021..da5f38c9076 100644
--- a/storage/perfschema/table_performance_timers.cc
+++ b/storage/perfschema/table_performance_timers.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_performance_timers.h b/storage/perfschema/table_performance_timers.h
index 15bdb5bfa93..a28b4d3f2c9 100644
--- a/storage/perfschema/table_performance_timers.h
+++ b/storage/perfschema/table_performance_timers.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_prepared_stmt_instances.cc b/storage/perfschema/table_prepared_stmt_instances.cc
index 8ff699eb03c..f064d8f03ae 100644
--- a/storage/perfschema/table_prepared_stmt_instances.cc
+++ b/storage/perfschema/table_prepared_stmt_instances.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_prepared_stmt_instances.h b/storage/perfschema/table_prepared_stmt_instances.h
index e7afe5d48b0..8bd9acafce5 100644
--- a/storage/perfschema/table_prepared_stmt_instances.h
+++ b/storage/perfschema/table_prepared_stmt_instances.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_processlist.cc b/storage/perfschema/table_processlist.cc
index 25d9ca7129c..8c91a5230e9 100644
--- a/storage/perfschema/table_processlist.cc
+++ b/storage/perfschema/table_processlist.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_processlist.h b/storage/perfschema/table_processlist.h
index 0944b5619fe..2cf55e1ed0f 100644
--- a/storage/perfschema/table_processlist.h
+++ b/storage/perfschema/table_processlist.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_replication_applier_configuration.cc b/storage/perfschema/table_replication_applier_configuration.cc
index ce66fa9fecd..601e2b49878 100644
--- a/storage/perfschema/table_replication_applier_configuration.cc
+++ b/storage/perfschema/table_replication_applier_configuration.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_replication_applier_configuration.h b/storage/perfschema/table_replication_applier_configuration.h
index 917778a5a03..580b78cfb3b 100644
--- a/storage/perfschema/table_replication_applier_configuration.h
+++ b/storage/perfschema/table_replication_applier_configuration.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_replication_applier_status.cc b/storage/perfschema/table_replication_applier_status.cc
index 053ed997760..fda3c9274d9 100644
--- a/storage/perfschema/table_replication_applier_status.cc
+++ b/storage/perfschema/table_replication_applier_status.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_replication_applier_status.h b/storage/perfschema/table_replication_applier_status.h
index 11dbbc43105..4da2087a32a 100644
--- a/storage/perfschema/table_replication_applier_status.h
+++ b/storage/perfschema/table_replication_applier_status.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_replication_applier_status_by_coordinator.cc b/storage/perfschema/table_replication_applier_status_by_coordinator.cc
index c795cdb6624..02419fd3e89 100644
--- a/storage/perfschema/table_replication_applier_status_by_coordinator.cc
+++ b/storage/perfschema/table_replication_applier_status_by_coordinator.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_replication_applier_status_by_coordinator.h b/storage/perfschema/table_replication_applier_status_by_coordinator.h
index 2424304be72..991e46afe50 100644
--- a/storage/perfschema/table_replication_applier_status_by_coordinator.h
+++ b/storage/perfschema/table_replication_applier_status_by_coordinator.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_replication_applier_status_by_worker.cc b/storage/perfschema/table_replication_applier_status_by_worker.cc
index e982b5203ec..94aa305af02 100644
--- a/storage/perfschema/table_replication_applier_status_by_worker.cc
+++ b/storage/perfschema/table_replication_applier_status_by_worker.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_replication_applier_status_by_worker.h b/storage/perfschema/table_replication_applier_status_by_worker.h
index 14689f83f57..2e400783c61 100644
--- a/storage/perfschema/table_replication_applier_status_by_worker.h
+++ b/storage/perfschema/table_replication_applier_status_by_worker.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_replication_connection_configuration.cc b/storage/perfschema/table_replication_connection_configuration.cc
index ce79cc73362..81135074754 100644
--- a/storage/perfschema/table_replication_connection_configuration.cc
+++ b/storage/perfschema/table_replication_connection_configuration.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_replication_connection_configuration.h b/storage/perfschema/table_replication_connection_configuration.h
index 3949975e397..5390c51e596 100644
--- a/storage/perfschema/table_replication_connection_configuration.h
+++ b/storage/perfschema/table_replication_connection_configuration.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_replication_connection_status.cc b/storage/perfschema/table_replication_connection_status.cc
index 71c02e314ed..315392ef080 100644
--- a/storage/perfschema/table_replication_connection_status.cc
+++ b/storage/perfschema/table_replication_connection_status.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_replication_connection_status.h b/storage/perfschema/table_replication_connection_status.h
index a40ae408dea..57cc9a944df 100644
--- a/storage/perfschema/table_replication_connection_status.h
+++ b/storage/perfschema/table_replication_connection_status.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_replication_group_member_stats.cc b/storage/perfschema/table_replication_group_member_stats.cc
index e4a38bac44f..245b4ffbe20 100644
--- a/storage/perfschema/table_replication_group_member_stats.cc
+++ b/storage/perfschema/table_replication_group_member_stats.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2014, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2014, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_replication_group_member_stats.h b/storage/perfschema/table_replication_group_member_stats.h
index 628e87e891d..d3d00a7a5f2 100644
--- a/storage/perfschema/table_replication_group_member_stats.h
+++ b/storage/perfschema/table_replication_group_member_stats.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2014, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2014, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_replication_group_members.cc b/storage/perfschema/table_replication_group_members.cc
index 850191373b0..80f67ccca88 100644
--- a/storage/perfschema/table_replication_group_members.cc
+++ b/storage/perfschema/table_replication_group_members.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_replication_group_members.h b/storage/perfschema/table_replication_group_members.h
index 454f58de048..3ea5787877a 100644
--- a/storage/perfschema/table_replication_group_members.h
+++ b/storage/perfschema/table_replication_group_members.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_session_account_connect_attrs.cc b/storage/perfschema/table_session_account_connect_attrs.cc
index 075d66dd5cb..3caa43bfca8 100644
--- a/storage/perfschema/table_session_account_connect_attrs.cc
+++ b/storage/perfschema/table_session_account_connect_attrs.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_session_account_connect_attrs.h b/storage/perfschema/table_session_account_connect_attrs.h
index d556394515c..6a405db6cef 100644
--- a/storage/perfschema/table_session_account_connect_attrs.h
+++ b/storage/perfschema/table_session_account_connect_attrs.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_session_connect.cc b/storage/perfschema/table_session_connect.cc
index 9d9b1eafc13..54511e1bac2 100644
--- a/storage/perfschema/table_session_connect.cc
+++ b/storage/perfschema/table_session_connect.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_session_connect.h b/storage/perfschema/table_session_connect.h
index 89ae4f221d3..bcc42beb574 100644
--- a/storage/perfschema/table_session_connect.h
+++ b/storage/perfschema/table_session_connect.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_session_connect_attrs.cc b/storage/perfschema/table_session_connect_attrs.cc
index 5983f3f18a2..8265a0f59e9 100644
--- a/storage/perfschema/table_session_connect_attrs.cc
+++ b/storage/perfschema/table_session_connect_attrs.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_session_connect_attrs.h b/storage/perfschema/table_session_connect_attrs.h
index f115ea1b168..43c929ea599 100644
--- a/storage/perfschema/table_session_connect_attrs.h
+++ b/storage/perfschema/table_session_connect_attrs.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_session_status.cc b/storage/perfschema/table_session_status.cc
index 403b2acabfe..3baad528f66 100644
--- a/storage/perfschema/table_session_status.cc
+++ b/storage/perfschema/table_session_status.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_session_status.h b/storage/perfschema/table_session_status.h
index d338ccafa8a..0b3e16c6011 100644
--- a/storage/perfschema/table_session_status.h
+++ b/storage/perfschema/table_session_status.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_session_variables.cc b/storage/perfschema/table_session_variables.cc
index 2a37686f6d9..b3b751c9515 100644
--- a/storage/perfschema/table_session_variables.cc
+++ b/storage/perfschema/table_session_variables.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_session_variables.h b/storage/perfschema/table_session_variables.h
index 0223438824a..f46d9967e5c 100644
--- a/storage/perfschema/table_session_variables.h
+++ b/storage/perfschema/table_session_variables.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_setup_actors.cc b/storage/perfschema/table_setup_actors.cc
index e2733a94fcc..38a7de43d81 100644
--- a/storage/perfschema/table_setup_actors.cc
+++ b/storage/perfschema/table_setup_actors.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_setup_actors.h b/storage/perfschema/table_setup_actors.h
index da5fdc37950..1909d41e24b 100644
--- a/storage/perfschema/table_setup_actors.h
+++ b/storage/perfschema/table_setup_actors.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_setup_consumers.cc b/storage/perfschema/table_setup_consumers.cc
index ab2fb030468..3fc4004e5cf 100644
--- a/storage/perfschema/table_setup_consumers.cc
+++ b/storage/perfschema/table_setup_consumers.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_setup_consumers.h b/storage/perfschema/table_setup_consumers.h
index c72108beb46..c7386d7a050 100644
--- a/storage/perfschema/table_setup_consumers.h
+++ b/storage/perfschema/table_setup_consumers.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_setup_instruments.cc b/storage/perfschema/table_setup_instruments.cc
index 40a17bc1deb..1e3cd964165 100644
--- a/storage/perfschema/table_setup_instruments.cc
+++ b/storage/perfschema/table_setup_instruments.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_setup_instruments.h b/storage/perfschema/table_setup_instruments.h
index ce979c40e48..9ea142857ce 100644
--- a/storage/perfschema/table_setup_instruments.h
+++ b/storage/perfschema/table_setup_instruments.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_setup_objects.cc b/storage/perfschema/table_setup_objects.cc
index d43ac4ae5e5..dbe953614fb 100644
--- a/storage/perfschema/table_setup_objects.cc
+++ b/storage/perfschema/table_setup_objects.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_setup_objects.h b/storage/perfschema/table_setup_objects.h
index d6cb9bc30c3..32853b36497 100644
--- a/storage/perfschema/table_setup_objects.h
+++ b/storage/perfschema/table_setup_objects.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_setup_timers.cc b/storage/perfschema/table_setup_timers.cc
index 4109f4fc5e6..3c6f8451030 100644
--- a/storage/perfschema/table_setup_timers.cc
+++ b/storage/perfschema/table_setup_timers.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_setup_timers.h b/storage/perfschema/table_setup_timers.h
index 9fff43c33a3..e606fcbfa8b 100644
--- a/storage/perfschema/table_setup_timers.h
+++ b/storage/perfschema/table_setup_timers.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_socket_instances.cc b/storage/perfschema/table_socket_instances.cc
index 7d2e06955f4..2435d19df3c 100644
--- a/storage/perfschema/table_socket_instances.cc
+++ b/storage/perfschema/table_socket_instances.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_socket_instances.h b/storage/perfschema/table_socket_instances.h
index fdd978b5c3a..c8a4a5b6a5d 100644
--- a/storage/perfschema/table_socket_instances.h
+++ b/storage/perfschema/table_socket_instances.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_socket_summary_by_event_name.cc b/storage/perfschema/table_socket_summary_by_event_name.cc
index 77461ea3ede..222294cf8d7 100644
--- a/storage/perfschema/table_socket_summary_by_event_name.cc
+++ b/storage/perfschema/table_socket_summary_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_socket_summary_by_event_name.h b/storage/perfschema/table_socket_summary_by_event_name.h
index 3a243572979..726d16abb0a 100644
--- a/storage/perfschema/table_socket_summary_by_event_name.h
+++ b/storage/perfschema/table_socket_summary_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_socket_summary_by_instance.cc b/storage/perfschema/table_socket_summary_by_instance.cc
index 17ea3d1abe6..eb0568c05c2 100644
--- a/storage/perfschema/table_socket_summary_by_instance.cc
+++ b/storage/perfschema/table_socket_summary_by_instance.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_socket_summary_by_instance.h b/storage/perfschema/table_socket_summary_by_instance.h
index b8a08db3e36..21e811baabf 100644
--- a/storage/perfschema/table_socket_summary_by_instance.h
+++ b/storage/perfschema/table_socket_summary_by_instance.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_status_by_account.cc b/storage/perfschema/table_status_by_account.cc
index 7ee8c116f70..55a6fc10158 100644
--- a/storage/perfschema/table_status_by_account.cc
+++ b/storage/perfschema/table_status_by_account.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_status_by_account.h b/storage/perfschema/table_status_by_account.h
index 3da5077ebc6..c8d270c5926 100644
--- a/storage/perfschema/table_status_by_account.h
+++ b/storage/perfschema/table_status_by_account.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_status_by_host.cc b/storage/perfschema/table_status_by_host.cc
index 3837df5cb34..52d723dca4e 100644
--- a/storage/perfschema/table_status_by_host.cc
+++ b/storage/perfschema/table_status_by_host.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_status_by_host.h b/storage/perfschema/table_status_by_host.h
index c697638bacf..4e28966c016 100644
--- a/storage/perfschema/table_status_by_host.h
+++ b/storage/perfschema/table_status_by_host.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_status_by_thread.cc b/storage/perfschema/table_status_by_thread.cc
index 8b1d945609b..ea1218a04ec 100644
--- a/storage/perfschema/table_status_by_thread.cc
+++ b/storage/perfschema/table_status_by_thread.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_status_by_thread.h b/storage/perfschema/table_status_by_thread.h
index c3f50941597..770490438f1 100644
--- a/storage/perfschema/table_status_by_thread.h
+++ b/storage/perfschema/table_status_by_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_status_by_user.cc b/storage/perfschema/table_status_by_user.cc
index 8ea45205ae4..dcafa3a8b76 100644
--- a/storage/perfschema/table_status_by_user.cc
+++ b/storage/perfschema/table_status_by_user.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_status_by_user.h b/storage/perfschema/table_status_by_user.h
index 4cf348fdec7..1954b15d820 100644
--- a/storage/perfschema/table_status_by_user.h
+++ b/storage/perfschema/table_status_by_user.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_sync_instances.cc b/storage/perfschema/table_sync_instances.cc
index 5f2c709170f..497f7fa1854 100644
--- a/storage/perfschema/table_sync_instances.cc
+++ b/storage/perfschema/table_sync_instances.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_sync_instances.h b/storage/perfschema/table_sync_instances.h
index 2682c7c88a8..75424d56540 100644
--- a/storage/perfschema/table_sync_instances.h
+++ b/storage/perfschema/table_sync_instances.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_table_handles.cc b/storage/perfschema/table_table_handles.cc
index d878ce2f7c1..7ea2b0a3316 100644
--- a/storage/perfschema/table_table_handles.cc
+++ b/storage/perfschema/table_table_handles.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_table_handles.h b/storage/perfschema/table_table_handles.h
index 3f2f8c5c1ad..7e184deb9a0 100644
--- a/storage/perfschema/table_table_handles.h
+++ b/storage/perfschema/table_table_handles.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_threads.cc b/storage/perfschema/table_threads.cc
index c98a612eca2..92fcf96d6d8 100644
--- a/storage/perfschema/table_threads.cc
+++ b/storage/perfschema/table_threads.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_threads.h b/storage/perfschema/table_threads.h
index ff9f7ccb2a3..1f981ded4d7 100644
--- a/storage/perfschema/table_threads.h
+++ b/storage/perfschema/table_threads.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_tiws_by_index_usage.cc b/storage/perfschema/table_tiws_by_index_usage.cc
index b8f3bfa4039..80b62bbef22 100644
--- a/storage/perfschema/table_tiws_by_index_usage.cc
+++ b/storage/perfschema/table_tiws_by_index_usage.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_tiws_by_index_usage.h b/storage/perfschema/table_tiws_by_index_usage.h
index 5f0c85874bd..6bc009fcf20 100644
--- a/storage/perfschema/table_tiws_by_index_usage.h
+++ b/storage/perfschema/table_tiws_by_index_usage.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_tiws_by_table.cc b/storage/perfschema/table_tiws_by_table.cc
index 75eaf70cd8a..ee4f54a322a 100644
--- a/storage/perfschema/table_tiws_by_table.cc
+++ b/storage/perfschema/table_tiws_by_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_tiws_by_table.h b/storage/perfschema/table_tiws_by_table.h
index 933a6164de9..2970ee64b06 100644
--- a/storage/perfschema/table_tiws_by_table.h
+++ b/storage/perfschema/table_tiws_by_table.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_tlws_by_table.cc b/storage/perfschema/table_tlws_by_table.cc
index 17bdf6449a6..709f22a1b0a 100644
--- a/storage/perfschema/table_tlws_by_table.cc
+++ b/storage/perfschema/table_tlws_by_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_tlws_by_table.h b/storage/perfschema/table_tlws_by_table.h
index 49188abd905..5755e33f7a7 100644
--- a/storage/perfschema/table_tlws_by_table.h
+++ b/storage/perfschema/table_tlws_by_table.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_users.cc b/storage/perfschema/table_users.cc
index 14fc8bf7db1..b30c36e1c68 100644
--- a/storage/perfschema/table_users.cc
+++ b/storage/perfschema/table_users.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_users.h b/storage/perfschema/table_users.h
index a81c143ae2e..9255ec9546a 100644
--- a/storage/perfschema/table_users.h
+++ b/storage/perfschema/table_users.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_uvar_by_thread.cc b/storage/perfschema/table_uvar_by_thread.cc
index 43b9bf347d3..74b6165d039 100644
--- a/storage/perfschema/table_uvar_by_thread.cc
+++ b/storage/perfschema/table_uvar_by_thread.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_uvar_by_thread.h b/storage/perfschema/table_uvar_by_thread.h
index 82faf1a52ec..61c521069c7 100644
--- a/storage/perfschema/table_uvar_by_thread.h
+++ b/storage/perfschema/table_uvar_by_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_variables_by_thread.cc b/storage/perfschema/table_variables_by_thread.cc
index db9e4c2c9ec..d673fa436c5 100644
--- a/storage/perfschema/table_variables_by_thread.cc
+++ b/storage/perfschema/table_variables_by_thread.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_variables_by_thread.h b/storage/perfschema/table_variables_by_thread.h
index a9e70388366..99adcda4e98 100644
--- a/storage/perfschema/table_variables_by_thread.h
+++ b/storage/perfschema/table_variables_by_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/CMakeLists.txt b/storage/perfschema/unittest/CMakeLists.txt
index ce20006a00e..2a22990f807 100644
--- a/storage/perfschema/unittest/CMakeLists.txt
+++ b/storage/perfschema/unittest/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2022, Oracle and/or its affiliates.
+# Copyright (c) 2009, 2023, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/conf.txt b/storage/perfschema/unittest/conf.txt
index a22d8fd41b2..38d1e3d39a4 100644
--- a/storage/perfschema/unittest/conf.txt
+++ b/storage/perfschema/unittest/conf.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2022, Oracle and/or its affiliates.
+# Copyright (c) 2009, 2023, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs-t.cc b/storage/perfschema/unittest/pfs-t.cc
index 412184ecbed..981792f99e2 100644
--- a/storage/perfschema/unittest/pfs-t.cc
+++ b/storage/perfschema/unittest/pfs-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_account-oom-t.cc b/storage/perfschema/unittest/pfs_account-oom-t.cc
index 68190218b74..97aea4c5aac 100644
--- a/storage/perfschema/unittest/pfs_account-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_account-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_connect_attr-t.cc b/storage/perfschema/unittest/pfs_connect_attr-t.cc
index c09f10fd7de..dee56ebcd51 100644
--- a/storage/perfschema/unittest/pfs_connect_attr-t.cc
+++ b/storage/perfschema/unittest/pfs_connect_attr-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_host-oom-t.cc b/storage/perfschema/unittest/pfs_host-oom-t.cc
index 1e46963fcb8..f903561de82 100644
--- a/storage/perfschema/unittest/pfs_host-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_host-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_instr-oom-t.cc b/storage/perfschema/unittest/pfs_instr-oom-t.cc
index eff2385ef48..579aec6c5ae 100644
--- a/storage/perfschema/unittest/pfs_instr-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_instr-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_instr-t.cc b/storage/perfschema/unittest/pfs_instr-t.cc
index b0d3bd9c36f..9667d7ff2be 100644
--- a/storage/perfschema/unittest/pfs_instr-t.cc
+++ b/storage/perfschema/unittest/pfs_instr-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
index 612cc5adf3f..b7c17d06bae 100644
--- a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_instr_class-t.cc b/storage/perfschema/unittest/pfs_instr_class-t.cc
index b5f08f739ac..7651898d684 100644
--- a/storage/perfschema/unittest/pfs_instr_class-t.cc
+++ b/storage/perfschema/unittest/pfs_instr_class-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_misc-t.cc b/storage/perfschema/unittest/pfs_misc-t.cc
index 6765dca0550..f596434813e 100644
--- a/storage/perfschema/unittest/pfs_misc-t.cc
+++ b/storage/perfschema/unittest/pfs_misc-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_noop-t.cc b/storage/perfschema/unittest/pfs_noop-t.cc
index 896a29d1bd4..57e8cfd8a0a 100644
--- a/storage/perfschema/unittest/pfs_noop-t.cc
+++ b/storage/perfschema/unittest/pfs_noop-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.
Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/unittest/pfs_server_stubs.cc b/storage/perfschema/unittest/pfs_server_stubs.cc
index a873bdcbd10..1ec84c2538e 100644
--- a/storage/perfschema/unittest/pfs_server_stubs.cc
+++ b/storage/perfschema/unittest/pfs_server_stubs.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/unittest/pfs_timer-t.cc b/storage/perfschema/unittest/pfs_timer-t.cc
index 07f61f59fe7..20a5cb9742b 100644
--- a/storage/perfschema/unittest/pfs_timer-t.cc
+++ b/storage/perfschema/unittest/pfs_timer-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_user-oom-t.cc b/storage/perfschema/unittest/pfs_user-oom-t.cc
index 62748648ea1..acc3d8c612f 100644
--- a/storage/perfschema/unittest/pfs_user-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_user-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/stub_global_status_var.h b/storage/perfschema/unittest/stub_global_status_var.h
index e985ad25bbf..70644981b55 100644
--- a/storage/perfschema/unittest/stub_global_status_var.h
+++ b/storage/perfschema/unittest/stub_global_status_var.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/stub_pfs_defaults.h b/storage/perfschema/unittest/stub_pfs_defaults.h
index 354d2291fa3..4b064b57166 100644
--- a/storage/perfschema/unittest/stub_pfs_defaults.h
+++ b/storage/perfschema/unittest/stub_pfs_defaults.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/stub_pfs_global.h b/storage/perfschema/unittest/stub_pfs_global.h
index b43d53a43f4..4b792f9bfef 100644
--- a/storage/perfschema/unittest/stub_pfs_global.h
+++ b/storage/perfschema/unittest/stub_pfs_global.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/unittest/stub_print_error.h b/storage/perfschema/unittest/stub_print_error.h
index 7f6df940515..a02e2478d27 100644
--- a/storage/perfschema/unittest/stub_print_error.h
+++ b/storage/perfschema/unittest/stub_print_error.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt
index 544ae62e6e2..76e9a4ab5a1 100644
--- a/storage/rocksdb/CMakeLists.txt
+++ b/storage/rocksdb/CMakeLists.txt
@@ -30,6 +30,11 @@ IF(WITH_VALGRIND)
ADD_DEFINITIONS(-DROCKSDB_VALGRIND_RUN=1)
ENDIF()
+ADD_DEFINITIONS(-Duint64_t=u_int64_t)
+ADD_DEFINITIONS(-Duint32_t=u_int32_t)
+ADD_DEFINITIONS(-Duint16_t=u_int16_t)
+ADD_DEFINITIONS(-Duint8_t=u_int8_t)
+
# We've had our builders hang during the build process. This prevents MariaRocks
# to be built on 32 bit intel OS kernels.
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i[36]86")
diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake
index 096185af08f..27a8616cfda 100644
--- a/storage/rocksdb/build_rocksdb.cmake
+++ b/storage/rocksdb/build_rocksdb.cmake
@@ -134,8 +134,8 @@ option(WITH_FALLOCATE "build with fallocate" ON)
if(WITH_FALLOCATE AND UNIX)
include(CheckCSourceCompiles)
CHECK_C_SOURCE_COMPILES("
+#define _GNU_SOURCE
#include <fcntl.h>
-#include <linux/falloc.h>
int main() {
int fd = open(\"/dev/null\", 0);
fallocate(fd, FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE, 0, 1024);
diff --git a/storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc b/storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc
index 81cd2200ae0..a87fe01b3a1 100644
--- a/storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc
+++ b/storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc
@@ -9,8 +9,8 @@ if ($rpl_inited)
# Write file to make mysql-test-run.pl expect the "crash", but don't start
# it until it's told to
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" > $_expect_file_name
# Send shutdown to the connected server and give
diff --git a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result
index d2974438ecb..8612b922cab 100644
--- a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result
+++ b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result
@@ -133,8 +133,8 @@ trx_commits_insert_update transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NUL
trx_rollbacks transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of transactions rolled back
trx_rollbacks_savepoint transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of transactions rolled back to savepoint
trx_rseg_history_len transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Length of the TRX_RSEG_HISTORY list
-trx_undo_slots_used transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of undo slots used
-trx_undo_slots_cached transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of undo slots cached
+trx_undo_slots_used transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of undo slots used
+trx_undo_slots_cached transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of undo slots cached
trx_rseg_current_size transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Current rollback segment size in pages
purge_del_mark_records purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of delete-marked rows purged
purge_upd_exist_or_extern_records purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of purges on updates of existing records and updates on delete marked record with externally stored field
diff --git a/storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test b/storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test
index e084b57fbda..88a02c469bb 100644
--- a/storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test
+++ b/storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test
@@ -16,6 +16,7 @@
# restart server to change error log and ignore corruptopn on startup
--let $_mysqld_option=--log-error=$LOG --rocksdb_allow_to_start_after_corruption=1
--source include/restart_mysqld_with_option.inc
+--let $_server_id= `SELECT @@server_id`
--echo #
--echo # Test server crashes on corrupted data and restarts
diff --git a/storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test b/storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test
index 49e5e5c1172..da9d8602c01 100644
--- a/storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test
+++ b/storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test
@@ -4,8 +4,8 @@
DROP TABLE IF EXISTS t1;
--enable_warnings
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--let $_cache_file_name= $MYSQLTEST_VARDIR/tmp/persistent_cache
--exec echo "wait" >$_expect_file_name
diff --git a/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test b/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test
index e7ab37d2658..b2647b38e08 100644
--- a/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test
+++ b/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test
@@ -17,8 +17,8 @@ CREATE TABLE t2 (pk int primary key) ENGINE=ROCKSDB PARTITION BY KEY(pk) PARTITI
# Write file to make mysql-test-run.pl expect the "crash", but don't restart the
# server until it is told to
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--let LOG=$MYSQLTEST_VARDIR/tmp/validate_datadic.err
--exec echo "wait" >$_expect_file_name
diff --git a/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test b/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test
index 743f942af9c..1daa9898c1a 100644
--- a/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test
+++ b/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test
@@ -7,8 +7,8 @@ SET @@global.rocksdb_rate_limiter_bytes_per_sec = 10000;
# Write file to make mysql-test-run.pl expect the "crash", but don't restart the
# server until it is told to
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect
--exec echo "wait" >$_expect_file_name
# Send shutdown to the connected server and give it 10 seconds to die before
diff --git a/storage/rocksdb/ut0counter.h b/storage/rocksdb/ut0counter.h
index 7b1885810c3..5267508faba 100644
--- a/storage/rocksdb/ut0counter.h
+++ b/storage/rocksdb/ut0counter.h
@@ -61,7 +61,7 @@ struct get_sched_indexer_t : public generic_indexer_t<Type, N> {
size_t cpu = sched_getcpu();
if (cpu == (size_t) -1) {
- cpu = get_curr_thread_id();
+ cpu = (size_t) get_curr_thread_id();
}
return(cpu);
diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc
index e5ef9499eda..8af57895b93 100644
--- a/storage/spider/ha_spider.cc
+++ b/storage/spider/ha_spider.cc
@@ -309,10 +309,10 @@ int ha_spider::open(
no_bytes_in_map(table->read_set));
wide_handler_alloc = TRUE;
- if (!share && !spider_get_share(name, table, thd, this, &error_num))
- goto error_get_share;
+ if (!share && !spider_get_share(name, table, thd, this, &error_num))
+ goto error_get_share;
- wide_share = share->wide_share;
+ wide_share = share->wide_share;
DBUG_PRINT("info",("spider create partition_handler"));
DBUG_PRINT("info",("spider table=%p", table));
@@ -6559,13 +6559,6 @@ int ha_spider::info(
auto_inc_temporary = FALSE;
#endif
wide_handler->sql_command = thd_sql_command(thd);
-/*
- if (
- sql_command == SQLCOM_DROP_TABLE ||
- sql_command == SQLCOM_ALTER_TABLE ||
- sql_command == SQLCOM_SHOW_CREATE
- ) {
-*/
if (flag & HA_STATUS_AUTO)
{
if (share->lgtm_tblhnd_share->auto_increment_value)
@@ -6583,9 +6576,6 @@ int ha_spider::info(
wide_handler->sql_command == SQLCOM_ALTER_TABLE
)
DBUG_RETURN(0);
-/*
- }
-*/
if (flag &
(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE | HA_STATUS_AUTO))
diff --git a/storage/spider/ha_spider.h b/storage/spider/ha_spider.h
index ac865e78f2c..50266739b63 100644
--- a/storage/spider/ha_spider.h
+++ b/storage/spider/ha_spider.h
@@ -63,8 +63,10 @@ public:
char *conn_keys_first_ptr;
char **conn_keys;
SPIDER_CONN **conns;
- /* for active-standby mode */
+ /* array of indexes of active servers */
uint *conn_link_idx;
+ /* A bitmap indicating whether each active server have some higher
+ numbered server in the same "group" left to try (can fail over) */
uchar *conn_can_fo;
void **quick_targets;
int *need_mons;
diff --git a/storage/spider/mysql-test/spider/bugfix/disabled.def b/storage/spider/mysql-test/spider/bugfix/disabled.def
index e19ea07b76b..2314e88ea0c 100644
--- a/storage/spider/mysql-test/spider/bugfix/disabled.def
+++ b/storage/spider/mysql-test/spider/bugfix/disabled.def
@@ -1 +1,2 @@
wait_timeout : MDEV-26045
+mdev_29676 : MDEV-31138
diff --git a/storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc b/storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc
deleted file mode 100644
index a5446a6188d..00000000000
--- a/storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc
+++ /dev/null
@@ -1,8 +0,0 @@
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.1.expect
-
---exec echo "wait" > $_expect_file_name
---shutdown_server
---source include/wait_until_disconnected.inc
---exec echo "restart" > $_expect_file_name
---enable_reconnect
---source include/wait_until_connected_again.inc
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result
index 5715edf2bd6..975d3834d42 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result
@@ -9,4 +9,5 @@ CREATE FUNCTION spider_bg_direct_sql RETURNS INT SONAME 'ha_spider.so';
ERROR HY000: Can't execute the query because you have a conflicting read lock
SELECT * FROM t;
c
+# restart
DROP TABLE t;
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29644.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29644.result
new file mode 100644
index 00000000000..b52cecc5bb7
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29644.result
@@ -0,0 +1,41 @@
+#
+# MDEV-29644 a potential bug of null pointer dereference in spider_db_mbase::print_warnings()
+#
+for master_1
+for child2
+child2_1
+child2_2
+child2_3
+for child3
+connection child2_1;
+CREATE DATABASE auto_test_remote;
+USE auto_test_remote;
+CREATE TABLE tbl_a (
+a CHAR(5)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SET GLOBAL sql_mode='';
+connection master_1;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+CREATE TABLE tbl_a (
+a CHAR(255)
+) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
+SET sql_mode='';
+INSERT INTO tbl_a VALUES ("this will be truncated");
+NOT FOUND /\[WARN SPIDER RESULT\].* Warning 1265 Data truncated for column 'a' at row 1.*/ in mysqld.1.1.err
+SET GLOBAL spider_log_result_errors=4;
+INSERT INTO tbl_a VALUES ("this will be truncated");
+FOUND 1 /\[WARN SPIDER RESULT\].* Warning 1265 Data truncated for column 'a' at row 1.*/ in mysqld.1.1.err
+connection master_1;
+SET GLOBAL spider_log_result_errors=DEFAULT;
+SET sql_mode=DEFAULT;
+DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
+SET GLOBAL sql_mode=DEFAULT;
+DROP DATABASE IF EXISTS auto_test_remote;
+for master_1
+for child2
+child2_1
+child2_2
+child2_3
+for child3
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29676.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29676.result
new file mode 100644
index 00000000000..72c624c926b
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29676.result
@@ -0,0 +1,47 @@
+#
+# MDEV-29676 Dual thread hang in 'closing tables' and 'Waiting for table metadata lock' on Spider CREATE OR REPLACE TABLE
+#
+for master_1
+for child2
+for child3
+CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
+
+# length-0 self-reference
+
+CREATE TABLE t (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t"';
+CREATE OR REPLACE TABLE t (c INT);
+Warnings:
+Error 1205 Lock wait timeout exceeded; try restarting transaction
+Error 12722 Table test.t open lock wait timeout. Please check for self-reference.
+SHOW CREATE TABLE t;
+Table Create Table
+t CREATE TABLE `t` (
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+DROP TABLE t;
+
+# length-2 self-reference
+
+CREATE TABLE t2 (c int);
+CREATE TABLE t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+CREATE TABLE t0 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"';
+ALTER TABLE t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t0"';
+CREATE OR REPLACE TABLE t0 (c int);
+Warnings:
+Error 1205 Lock wait timeout exceeded; try restarting transaction
+Error 12722 Table test.t1 open lock wait timeout. Please check for self-reference.
+SHOW CREATE TABLE t0;
+Table Create Table
+t0 CREATE TABLE `t0` (
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+CREATE OR REPLACE TABLE t1 (c int);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+drop TABLE t0, t1, t2;
+for master_1
+for child2
+for child3
diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29904.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29904.result
new file mode 100644
index 00000000000..c89309a514d
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29904.result
@@ -0,0 +1,4 @@
+#
+# MDEV-29904 SPIDER plugin initialization fails upon startup
+#
+# restart: --plugin-load-add=ha_spider
diff --git a/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result b/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result
new file mode 100644
index 00000000000..c4399ddf9d2
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result
@@ -0,0 +1,21 @@
+for master_1
+for child2
+for child3
+
+MDEV-6268 SPIDER table with no COMMENT clause causes queries to wait forever
+
+CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+create table t0 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"';
+alter table t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t0"';
+select * from t0;
+ERROR HY000: An infinite loop is detected when opening table test.t0
+select * from t1;
+ERROR HY000: An infinite loop is detected when opening table test.t0
+select * from t2;
+ERROR HY000: An infinite loop is detected when opening table test.t0
+drop table t0, t1, t2;
+for master_1
+for child2
+for child3
diff --git a/storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result b/storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result
index e84d42bbc8a..ffccf2d5ef1 100644
--- a/storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result
+++ b/storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result
@@ -50,6 +50,10 @@ SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argum
argument
set session time_zone = '+00:00';set @`spider_lc_./auto_test_remote/tbl_a` = '-xxxxxxxxxxxx-xxxxx-./auto_test_local/tbl_a-'
SET NAMES utf8mb3
+set @old_lock_wait_timeout=@@session.lock_wait_timeout;set session lock_wait_timeout=1
+set session lock_wait_timeout=@old_lock_wait_timeout
+set @old_lock_wait_timeout=@@session.lock_wait_timeout;set session lock_wait_timeout=1
+set session lock_wait_timeout=@old_lock_wait_timeout
set session transaction isolation level read committed;set session autocommit = 1;set session wait_timeout = 604800;set session sql_mode = 'strict_trans_tables,error_for_division_by_zero,no_auto_create_user,no_engine_substitution';start transaction
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%set %'
SELECT pkey FROM tbl_a ORDER BY pkey;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test
index 00d8ee73ebc..626364efb99 100644
--- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test
@@ -6,6 +6,6 @@ FLUSH TABLES WITH READ LOCK;
CREATE FUNCTION spider_bg_direct_sql RETURNS INT SONAME 'ha_spider.so';
SELECT * FROM t;
---source include/restart_spider.inc
+--source include/restart_mysqld.inc
DROP TABLE t;
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.cnf
new file mode 100644
index 00000000000..05dfd8a0bce
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.cnf
@@ -0,0 +1,3 @@
+!include include/default_mysqld.cnf
+!include ../my_1_1.cnf
+!include ../my_2_1.cnf
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.test
new file mode 100644
index 00000000000..3a8fbb251e1
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.test
@@ -0,0 +1,56 @@
+--echo #
+--echo # MDEV-29644 a potential bug of null pointer dereference in spider_db_mbase::print_warnings()
+--echo #
+
+# The test case below does not cause the potential null pointer dereference.
+# It is just for checking spider_db_mbase::fetch_and_print_warnings() works.
+
+--disable_query_log
+--disable_result_log
+--source ../../t/test_init.inc
+--enable_result_log
+--enable_query_log
+
+--connection child2_1
+CREATE DATABASE auto_test_remote;
+USE auto_test_remote;
+eval CREATE TABLE tbl_a (
+ a CHAR(5)
+) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
+
+SET GLOBAL sql_mode='';
+
+--connection master_1
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+eval CREATE TABLE tbl_a (
+ a CHAR(255)
+) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_a", srv "s_2_1"';
+
+SET sql_mode='';
+
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.1.err;
+let SEARCH_PATTERN= \[WARN SPIDER RESULT\].* Warning 1265 Data truncated for column 'a' at row 1.*;
+
+INSERT INTO tbl_a VALUES ("this will be truncated");
+--source include/search_pattern_in_file.inc # should not find
+
+SET GLOBAL spider_log_result_errors=4;
+
+INSERT INTO tbl_a VALUES ("this will be truncated");
+--source include/search_pattern_in_file.inc # should find
+
+--connection master_1
+SET GLOBAL spider_log_result_errors=DEFAULT;
+SET sql_mode=DEFAULT;
+DROP DATABASE IF EXISTS auto_test_local;
+
+--connection child2_1
+SET GLOBAL sql_mode=DEFAULT;
+DROP DATABASE IF EXISTS auto_test_remote;
+
+--disable_query_log
+--disable_result_log
+--source ../t/test_deinit.inc
+--enable_query_log
+--enable_result_log
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29676.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29676.test
new file mode 100644
index 00000000000..565d95dfaac
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29676.test
@@ -0,0 +1,41 @@
+--echo #
+--echo # MDEV-29676 Dual thread hang in 'closing tables' and 'Waiting for table metadata lock' on Spider CREATE OR REPLACE TABLE
+--echo #
+
+--disable_query_log
+--disable_result_log
+--source ../../t/test_init.inc
+--enable_result_log
+--enable_query_log
+
+--replace_regex /SOCKET ".*"/SOCKET "$MASTER_1_MYSOCK"/
+eval CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
+
+--echo
+--echo # length-0 self-reference
+--echo
+CREATE TABLE t (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t"';
+CREATE OR REPLACE TABLE t (c INT);
+SHOW CREATE TABLE t;
+DROP TABLE t;
+
+--echo
+--echo # length-2 self-reference
+--echo
+CREATE TABLE t2 (c int);
+CREATE TABLE t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+CREATE TABLE t0 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"';
+ALTER TABLE t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t0"';
+# warnings
+CREATE OR REPLACE TABLE t0 (c int);
+SHOW CREATE TABLE t0;
+# no warnings
+CREATE OR REPLACE TABLE t1 (c int);
+SHOW CREATE TABLE t1;
+drop TABLE t0, t1, t2;
+
+--disable_query_log
+--disable_result_log
+--source ../../t/test_deinit.inc
+--enable_result_log
+--enable_query_log
diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29904.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29904.test
new file mode 100644
index 00000000000..d3dcb363890
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29904.test
@@ -0,0 +1,6 @@
+--echo #
+--echo # MDEV-29904 SPIDER plugin initialization fails upon startup
+--echo #
+
+--let $restart_parameters=--plugin-load-add=ha_spider
+--source include/restart_mysqld.inc
diff --git a/storage/spider/mysql-test/spider/bugfix/t/self_reference_multi.test b/storage/spider/mysql-test/spider/bugfix/t/self_reference_multi.test
new file mode 100644
index 00000000000..8b6f070d167
--- /dev/null
+++ b/storage/spider/mysql-test/spider/bugfix/t/self_reference_multi.test
@@ -0,0 +1,29 @@
+--disable_query_log
+--disable_result_log
+--source ../../t/test_init.inc
+--enable_result_log
+--enable_query_log
+
+--echo
+--echo MDEV-6268 SPIDER table with no COMMENT clause causes queries to wait forever
+--echo
+
+--replace_regex /SOCKET ".*"/SOCKET "$MASTER_1_MYSOCK"/
+eval CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
+create table t2 (c int);
+create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
+create table t0 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"';
+alter table t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t0"';
+--error 12719
+select * from t0;
+--error 12719
+select * from t1;
+--error 12719
+select * from t2;
+drop table t0, t1, t2;
+
+--disable_query_log
+--disable_result_log
+--source ../../t/test_deinit.inc
+--enable_result_log
+--enable_query_log
diff --git a/storage/spider/mysql-test/spider/r/slave_trx_isolation.result b/storage/spider/mysql-test/spider/r/slave_trx_isolation.result
index 28aaf74fa3d..c48d68758bf 100644
--- a/storage/spider/mysql-test/spider/r/slave_trx_isolation.result
+++ b/storage/spider/mysql-test/spider/r/slave_trx_isolation.result
@@ -53,6 +53,10 @@ SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argum
argument
set session time_zone = '+00:00';set @`spider_lc_./auto_test_remote/tbl_a` = '-xxxxxxxxxxxx-xxxxx-./auto_test_local/tbl_a-'
SET NAMES utf8mb3
+set @old_lock_wait_timeout=@@session.lock_wait_timeout;set session lock_wait_timeout=1
+set session lock_wait_timeout=@old_lock_wait_timeout
+set @old_lock_wait_timeout=@@session.lock_wait_timeout;set session lock_wait_timeout=1
+set session lock_wait_timeout=@old_lock_wait_timeout
set session transaction isolation level read committed;set session autocommit = 1;set session wait_timeout = 604800;set session sql_mode = 'strict_trans_tables,error_for_division_by_zero,no_auto_create_user,no_engine_substitution';start transaction
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%set %'
SELECT pkey FROM tbl_a ORDER BY pkey;
diff --git a/storage/spider/spd_conn.cc b/storage/spider/spd_conn.cc
index ca556702c65..1baf6a30e7c 100644
--- a/storage/spider/spd_conn.cc
+++ b/storage/spider/spd_conn.cc
@@ -2992,12 +2992,6 @@ void *spider_bg_sts_action(
if (spider.search_link_idx < 0)
{
spider_trx_set_link_idx_for_all(&spider);
-/*
- spider.search_link_idx = spider_conn_next_link_idx(
- thd, share->link_statuses, share->access_balances,
- spider.conn_link_idx, spider.search_link_idx, share->link_count,
- SPIDER_LINK_STATUS_OK);
-*/
spider.search_link_idx = spider_conn_first_link_idx(thd,
share->link_statuses, share->access_balances, spider.conn_link_idx,
share->link_count, SPIDER_LINK_STATUS_OK);
@@ -3013,32 +3007,6 @@ void *spider_bg_sts_action(
share->conn_keys[spider.search_link_idx], trx,
&spider, FALSE, FALSE, &error_num);
conns[spider.search_link_idx]->error_mode = 0;
-/*
- if (
- error_num &&
- share->monitoring_kind[spider.search_link_idx] &&
- need_mons[spider.search_link_idx]
- ) {
- lex_start(thd);
- error_num = spider_ping_table_mon_from_table(
- trx,
- thd,
- share,
- spider.search_link_idx,
- (uint32) share->monitoring_sid[spider.search_link_idx],
- share->table_name,
- share->table_name_length,
- spider.conn_link_idx[spider.search_link_idx],
- NULL,
- 0,
- share->monitoring_kind[spider.search_link_idx],
- share->monitoring_limit[spider.search_link_idx],
- share->monitoring_flag[spider.search_link_idx],
- TRUE
- );
- lex_end(thd->lex);
- }
-*/
spider.search_link_idx = -1;
}
if (spider.search_link_idx != -1 && conns[spider.search_link_idx])
@@ -3049,31 +3017,6 @@ void *spider_bg_sts_action(
share->bg_sts_sync,
2, HA_STATUS_CONST | HA_STATUS_VARIABLE))
{
-/*
- if (
- share->monitoring_kind[spider.search_link_idx] &&
- need_mons[spider.search_link_idx]
- ) {
- lex_start(thd);
- error_num = spider_ping_table_mon_from_table(
- trx,
- thd,
- share,
- spider.search_link_idx,
- (uint32) share->monitoring_sid[spider.search_link_idx],
- share->table_name,
- share->table_name_length,
- spider.conn_link_idx[spider.search_link_idx],
- NULL,
- 0,
- share->monitoring_kind[spider.search_link_idx],
- share->monitoring_limit[spider.search_link_idx],
- share->monitoring_flag[spider.search_link_idx],
- TRUE
- );
- lex_end(thd->lex);
- }
-*/
spider.search_link_idx = -1;
}
}
@@ -3316,12 +3259,6 @@ void *spider_bg_crd_action(
if (spider.search_link_idx < 0)
{
spider_trx_set_link_idx_for_all(&spider);
-/*
- spider.search_link_idx = spider_conn_next_link_idx(
- thd, share->link_statuses, share->access_balances,
- spider.conn_link_idx, spider.search_link_idx, share->link_count,
- SPIDER_LINK_STATUS_OK);
-*/
spider.search_link_idx = spider_conn_first_link_idx(thd,
share->link_statuses, share->access_balances, spider.conn_link_idx,
share->link_count, SPIDER_LINK_STATUS_OK);
@@ -3747,6 +3684,24 @@ void *spider_bg_mon_action(
}
}
+/**
+ Returns a random (active) server with a maximum required link status
+
+ Calculate the sum of balances of all servers whose link status is at
+ most the specified status ("eligible"), generate a random number
+ less than this balance, then find the first server cumulatively
+ exceeding this balance
+
+ @param thd Connection used for generating a random number
+ @param link_statuses The link statuses of servers
+ @param access_balances The access balances of servers
+ @param conn_link_idx Array of indexes to servers
+ @param link_count Number of servers
+ @param link_status The maximum required link status
+ @retval Index to the found server
+ @retval -1 if no eligible servers
+ @retval -2 if out of memory
+*/
int spider_conn_first_link_idx(
THD *thd,
long *link_statuses,
@@ -3755,35 +3710,35 @@ int spider_conn_first_link_idx(
int link_count,
int link_status
) {
- int roop_count, active_links = 0;
- longlong balance_total = 0, balance_val;
+ int eligible_link_idx, eligible_links = 0;
+ longlong balance_total = 0, balance_threshold;
double rand_val;
- int *link_idxs, link_idx;
- long *balances;
+ int *link_idxs, result;
DBUG_ENTER("spider_conn_first_link_idx");
char *ptr;
- ptr = (char *) my_alloca((sizeof(int) * link_count) + (sizeof(long) * link_count));
+ /* Allocate memory for link_idxs */
+ ptr = (char *) my_alloca((sizeof(int) * link_count));
if (!ptr)
{
DBUG_PRINT("info",("spider out of memory"));
DBUG_RETURN(-2);
}
link_idxs = (int *) ptr;
- ptr += sizeof(int) * link_count;
- balances = (long *) ptr;
- for (roop_count = 0; roop_count < link_count; roop_count++)
+
+ /* Filter for eligible servers, store their indexes and calculate
+ the total balances */
+ for (int link_idx = 0; link_idx < link_count; link_idx++)
{
- DBUG_ASSERT((conn_link_idx[roop_count] - roop_count) % link_count == 0);
- if (link_statuses[conn_link_idx[roop_count]] <= link_status)
+ DBUG_ASSERT((conn_link_idx[link_idx] - link_idx) % link_count == 0);
+ if (link_statuses[conn_link_idx[link_idx]] <= link_status)
{
- link_idxs[active_links] = roop_count;
- balances[active_links] = access_balances[roop_count];
- balance_total += access_balances[roop_count];
- active_links++;
+ link_idxs[eligible_links] = link_idx;
+ balance_total += access_balances[link_idx];
+ eligible_links++;
}
}
- if (active_links == 0)
+ if (eligible_links == 0)
{
DBUG_PRINT("info",("spider all links are failed"));
my_afree(link_idxs);
@@ -3793,21 +3748,25 @@ int spider_conn_first_link_idx(
DBUG_PRINT("info",("spider thread_id=%lu", thd_get_thread_id(thd)));
rand_val = spider_rand(thd->variables.server_id + thd_get_thread_id(thd));
DBUG_PRINT("info",("spider rand_val=%f", rand_val));
- balance_val = (longlong) (rand_val * balance_total);
- DBUG_PRINT("info",("spider balance_val=%lld", balance_val));
- for (roop_count = 0; roop_count < active_links - 1; roop_count++)
- {
+ balance_threshold = (longlong) (rand_val * balance_total);
+ DBUG_PRINT("info",("spider balance_threshold=%lld", balance_threshold));
+ /* Since balance_threshold < total balance, this loop WILL break */
+ for (eligible_link_idx = 0;
+ eligible_link_idx < eligible_links;
+ eligible_link_idx++)
+ {
+ result = link_idxs[eligible_link_idx];
+ const long balance = access_balances[result];
DBUG_PRINT("info",("spider balances[%d]=%ld",
- roop_count, balances[roop_count]));
- if (balance_val < balances[roop_count])
+ link_idxs[eligible_link_idx], balance));
+ if (balance_threshold < balance)
break;
- balance_val -= balances[roop_count];
+ balance_threshold -= balance;
}
- DBUG_PRINT("info",("spider first link_idx=%d", link_idxs[roop_count]));
- link_idx = link_idxs[roop_count];
+ DBUG_PRINT("info",("spider first link_idx=%d", result));
my_afree(link_idxs);
- DBUG_RETURN(link_idx);
+ DBUG_RETURN(result);
}
int spider_conn_next_link_idx(
@@ -3842,6 +3801,17 @@ int spider_conn_next_link_idx(
DBUG_RETURN(tmp_link_idx);
}
+/**
+ Finds the next active server with a maximum required link status
+
+ @param link_statuses The statuses of servers
+ @param conn_link_idx The array of active servers
+ @param link_idx The index of the current active server
+ @param link_count The number of active servers
+ @param link_status The required maximum link status
+ @return The next active server whose link status is
+ at most the required one.
+*/
int spider_conn_link_idx_next(
long *link_statuses,
uint *conn_link_idx,
@@ -3854,6 +3824,8 @@ int spider_conn_link_idx_next(
link_idx++;
if (link_idx >= link_count)
break;
+ /* Asserts that the `link_idx`th active server is in the correct
+ "group" */
DBUG_ASSERT((conn_link_idx[link_idx] - link_idx) % link_count == 0);
} while (link_statuses[conn_link_idx[link_idx]] > link_status);
DBUG_PRINT("info",("spider link_idx=%d", link_idx));
diff --git a/storage/spider/spd_copy_tables.cc b/storage/spider/spd_copy_tables.cc
index 0d6f05dfdbd..64b86722099 100644
--- a/storage/spider/spd_copy_tables.cc
+++ b/storage/spider/spd_copy_tables.cc
@@ -398,7 +398,7 @@ int spider_udf_get_copy_tgt_tables(
(error_num = spider_get_sys_tables_connect_info(
table_tables, tmp_share, 0, mem_root)) ||
(error_num = spider_get_sys_tables_link_status(
- table_tables, tmp_share, 0, mem_root)) ||
+ table_tables, tmp_share->link_statuses, mem_root)) ||
(error_num = spider_get_sys_tables_link_idx(
table_tables, &table_conn->link_idx, mem_root))
) {
diff --git a/storage/spider/spd_db_include.h b/storage/spider/spd_db_include.h
index 3c7b3892c02..46dca8221b2 100644
--- a/storage/spider/spd_db_include.h
+++ b/storage/spider/spd_db_include.h
@@ -19,12 +19,19 @@
#define SPD_INIT_ALLOC_ROOT(A, B, C, D) \
init_alloc_root(PSI_INSTRUMENT_ME, A, B, C, D)
+/** Maximum possible number of `SPIDER_DBTON`s available to use */
#define SPIDER_DBTON_SIZE 15
#ifndef SIZEOF_STORED_DOUBLE
#define SIZEOF_STORED_DOUBLE 8
#endif
+/**
+ Possible wrapper values, e.g. for `SPIDER_DBTON::wrapper` and
+ `SPIDER_SHARE::tgt_wrappers`.
+
+ fixme: change this to enum
+*/
#define SPIDER_DB_WRAPPER_MYSQL "mysql"
#define SPIDER_DB_WRAPPER_MARIADB "mariadb"
@@ -678,6 +685,8 @@ struct st_spider_db_request_key
class spider_db_util
{
public:
+ /** Same as the `SPIDER_DBTON::dbton_id` of the `SPIDER_DBTON`
+ containing this `spider_db_util` */
uint dbton_id;
spider_db_util() = default;
virtual ~spider_db_util() = default;
@@ -1678,7 +1687,10 @@ static const LEX_CSTRING maturity_name[] =
typedef struct st_spider_dbton
{
+ /** The index of this dbton in `spider_dbton` */
uint dbton_id;
+ /** The wrapper of this dbton, same possible values as each element
+ of `SPIDER_SHARE::tgt_wrappers` */
const char *wrapper;
enum spider_db_access_type db_access_type;
int (*init)();
diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc
index 3dd8db9e898..90b8ededd6c 100644
--- a/storage/spider/spd_db_mysql.cc
+++ b/storage/spider/spd_db_mysql.cc
@@ -307,6 +307,7 @@ bool spider_mariadb_support_direct_join(
DBUG_RETURN(TRUE);
}
+/** Available `SPIDER_DBTON`s */
SPIDER_DBTON spider_dbton_mysql = {
0,
SPIDER_DB_WRAPPER_MYSQL,
@@ -803,6 +804,7 @@ SPIDER_DB_ROW *spider_db_mbase_result::fetch_row_from_tmp_table(
DBUG_RETURN((SPIDER_DB_ROW *) &row);
}
+/* Fetches table status into `stat` */
int spider_db_mbase_result::fetch_table_status(
int mode,
ha_statistics &stat
@@ -2141,7 +2143,7 @@ int spider_db_mbase::exec_query(
db_conn->affected_rows, db_conn->insert_id,
db_conn->server_status, db_conn->warning_count);
if (spider_param_log_result_errors() >= 3)
- print_warnings(l_time);
+ fetch_and_print_warnings(l_time);
} else if (log_result_errors >= 4)
{
time_t cur_time = (time_t) time((time_t*) 0);
@@ -2223,76 +2225,63 @@ bool spider_db_mbase::is_xa_nota_error(
DBUG_RETURN(xa_nota);
}
-int spider_db_mbase::print_warnings(
- struct tm *l_time
-) {
+int spider_db_mbase::fetch_and_print_warnings(struct tm *l_time)
+{
int error_num = 0;
- DBUG_ENTER("spider_db_mbase::print_warnings");
+ DBUG_ENTER("spider_db_mbase::fetch_and_print_warnings");
DBUG_PRINT("info",("spider this=%p", this));
- if (db_conn->status == MYSQL_STATUS_READY)
+
+ if (spider_param_dry_access() || db_conn->status != MYSQL_STATUS_READY ||
+ db_conn->server_status & SERVER_MORE_RESULTS_EXISTS ||
+ !db_conn->warning_count)
+ DBUG_RETURN(0);
+
+ if (mysql_real_query(db_conn, SPIDER_SQL_SHOW_WARNINGS_STR,
+ SPIDER_SQL_SHOW_WARNINGS_LEN))
+ DBUG_RETURN(0);
+
+ MYSQL_RES *res= mysql_store_result(db_conn);
+ if (!res)
+ DBUG_RETURN(0);
+
+ uint num_fields= mysql_num_fields(res);
+ if (num_fields != 3)
{
- if (
- !(db_conn->server_status & SERVER_MORE_RESULTS_EXISTS) &&
- db_conn->warning_count
- ) {
- if (
- spider_param_dry_access() ||
- !mysql_real_query(db_conn, SPIDER_SQL_SHOW_WARNINGS_STR,
- SPIDER_SQL_SHOW_WARNINGS_LEN)
- ) {
- MYSQL_RES *res = NULL;
- MYSQL_ROW row = NULL;
- uint num_fields;
- if (
- spider_param_dry_access() ||
- !(res = mysql_store_result(db_conn)) ||
- !(row = mysql_fetch_row(res))
- ) {
- if (mysql_errno(db_conn))
- {
- if (res)
- mysql_free_result(res);
- DBUG_RETURN(0);
- }
- /* no record is ok */
- }
- num_fields = mysql_num_fields(res);
- if (num_fields != 3)
- {
- mysql_free_result(res);
- DBUG_RETURN(0);
- }
- if (l_time)
- {
- while (row)
- {
- fprintf(stderr, "%04d%02d%02d %02d:%02d:%02d [WARN SPIDER RESULT] "
- "from [%s] %ld to %ld: %s %s %s\n",
+ mysql_free_result(res);
+ DBUG_RETURN(0);
+ }
+
+ MYSQL_ROW row= mysql_fetch_row(res);
+ if (l_time)
+ {
+ while (row)
+ {
+ fprintf(stderr,
+ "%04d%02d%02d %02d:%02d:%02d [WARN SPIDER RESULT] from [%s] %ld "
+ "to %ld: %s %s %s\n",
l_time->tm_year + 1900, l_time->tm_mon + 1, l_time->tm_mday,
- l_time->tm_hour, l_time->tm_min, l_time->tm_sec,
- conn->tgt_host, (ulong) db_conn->thread_id,
- (ulong) current_thd->thread_id, row[0], row[1], row[2]);
- row = mysql_fetch_row(res);
- }
- } else {
- while (row)
- {
- DBUG_PRINT("info",("spider row[0]=%s", row[0]));
- DBUG_PRINT("info",("spider row[1]=%s", row[1]));
- DBUG_PRINT("info",("spider row[2]=%s", row[2]));
- longlong res_num =
- (longlong) my_strtoll10(row[1], (char**) NULL, &error_num);
- DBUG_PRINT("info",("spider res_num=%lld", res_num));
- my_printf_error((int) res_num, row[2], MYF(0));
- error_num = (int) res_num;
- row = mysql_fetch_row(res);
- }
- }
- if (res)
- mysql_free_result(res);
- }
+ l_time->tm_hour, l_time->tm_min, l_time->tm_sec, conn->tgt_host,
+ (ulong) db_conn->thread_id, (ulong) current_thd->thread_id, row[0],
+ row[1], row[2]);
+ row= mysql_fetch_row(res);
+ }
+ } else {
+ while (row)
+ {
+ DBUG_PRINT("info",("spider row[0]=%s", row[0]));
+ DBUG_PRINT("info",("spider row[1]=%s", row[1]));
+ DBUG_PRINT("info",("spider row[2]=%s", row[2]));
+ longlong res_num =
+ (longlong) my_strtoll10(row[1], (char**) NULL, &error_num);
+ DBUG_PRINT("info",("spider res_num=%lld", res_num));
+ my_printf_error((int) res_num, row[2], MYF(0));
+ error_num = (int) res_num;
+ row = mysql_fetch_row(res);
}
}
+
+ mysql_free_result(res);
+
DBUG_RETURN(error_num);
}
@@ -5315,6 +5304,7 @@ int spider_db_mbase_util::append_sql_mode(
DBUG_RETURN(0);
}
+/** Append `set session time_zone = ...` to a query string */
int spider_db_mbase_util::append_time_zone(
spider_string *str,
Time_zone *time_zone
@@ -5333,6 +5323,14 @@ int spider_db_mbase_util::append_time_zone(
DBUG_RETURN(0);
}
+/**
+ Append a query for self-referencing check
+
+ The query is setting a user variable `@spider_lc$target_table_path`
+ to the value of `"$spider_unique_id$spider_table_path-"`, where
+ $target_table_path is the path to the data node table ("to"), and
+ $spider_table_path the path to the spider table ("from")
+*/
int spider_db_mbase_util::append_loop_check(
spider_string *str,
SPIDER_CONN *conn
@@ -13388,6 +13386,88 @@ int spider_mbase_handler::sts_mode_exchange(
DBUG_RETURN(sts_mode);
}
+/** Set the session lock wait time out */
+int spider_db_mbase::set_lock_wait_timeout(uint timeout)
+{
+ String query(0);
+ int error_num;
+ DBUG_ENTER("spider_db_set_lock_wait_timeout");
+ query.append(STRING_WITH_LEN(
+ "set @old_lock_wait_timeout=@@session.lock_wait_timeout;"
+ "set session lock_wait_timeout="));
+ query.append_ulonglong(timeout);
+ query.append(STRING_WITH_LEN(";"));
+ if ((error_num = exec_query(query.c_ptr(), query.length(), -1)))
+ DBUG_RETURN(error_num);
+ spider_db_result *result;
+ do {
+ st_spider_db_request_key request_key= {1, 1, NULL, 1, NULL};
+ if ((result = conn->db_conn->store_result(NULL, &request_key,
+ &error_num)))
+ {
+ result->free_result();
+ delete result;
+ } else if ((error_num = conn->db_conn->get_errno()))
+ break;
+ } while (!(error_num = conn->db_conn->next_result()));
+ DBUG_RETURN(0);
+}
+
+/** Reset the session lock wait time out */
+int spider_db_mbase::reset_lock_wait_timeout()
+{
+ const LEX_CSTRING query = {STRING_WITH_LEN(
+ "set session lock_wait_timeout=@old_lock_wait_timeout;")};
+ int error_num;
+ DBUG_ENTER("spider_db_set_lock_wait_timeout");
+ if ((error_num = exec_query(query.str, query.length, -1)))
+ DBUG_RETURN(error_num);
+ spider_db_result *result;
+ do {
+ st_spider_db_request_key request_key= {1, 1, NULL, 1, NULL};
+ if ((result = conn->db_conn->store_result(NULL, &request_key,
+ &error_num)))
+ {
+ result->free_result();
+ delete result;
+ } else if ((error_num = conn->db_conn->get_errno()))
+ break;
+ } while (!(error_num= conn->db_conn->next_result()));
+ DBUG_RETURN(0);
+}
+
+/** FIXME: refactor more functions to use spider_setup_for_query() and
+spider_teardown_after_query(). */
+void spider_setup_for_query(ha_spider *spider, SPIDER_CONN *conn, int link_idx)
+{
+ pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
+ pthread_mutex_lock(&conn->mta_conn_mutex);
+ SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
+ conn->need_mon= &spider->need_mons[link_idx];
+ DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
+ DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
+ conn->mta_conn_mutex_lock_already= TRUE;
+ conn->mta_conn_mutex_unlock_later= TRUE;
+ conn->disable_connect_retry= TRUE;
+}
+
+int spider_teardown_after_query(SPIDER_CONN *conn, int error_num, bool clear)
+{
+ conn->disable_connect_retry= FALSE;
+ DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
+ DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
+ conn->mta_conn_mutex_lock_already= FALSE;
+ conn->mta_conn_mutex_unlock_later= FALSE;
+ if (clear)
+ {
+ SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
+ pthread_mutex_unlock(&conn->mta_conn_mutex);
+ }
+ return error_num;
+}
+/**
+ Executes show table status query and stores results in share->stat
+*/
int spider_mbase_handler::show_table_status(
int link_idx,
int sts_mode,
@@ -13397,329 +13477,136 @@ int spider_mbase_handler::show_table_status(
SPIDER_CONN *conn = spider->conns[link_idx];
SPIDER_DB_RESULT *res;
SPIDER_SHARE *share = spider->share;
- uint pos = (2 * spider->conn_link_idx[link_idx]);
+ const uint pos = 2 * spider->conn_link_idx[link_idx] +
+ (sts_mode == 1 ? 0 : 1);
ulonglong auto_increment_value = 0;
DBUG_ENTER("spider_mbase_handler::show_table_status");
DBUG_PRINT("info",("spider sts_mode=%d", sts_mode));
- if (sts_mode == 1)
+ spider_setup_for_query(spider, conn, link_idx);
+ spider_conn_set_timeout_from_share(
+ conn, link_idx, spider->wide_handler->trx->thd, share);
+ if ((error_num = spider_db_set_names(spider, conn, link_idx)) ||
+ (error_num =
+ ((spider_db_mbase *) conn->db_conn)->set_lock_wait_timeout(1)) ||
+ /* Executes the `show table status` query */
+ (spider_db_query(
+ conn,
+ mysql_share->show_table_status[pos].ptr(),
+ mysql_share->show_table_status[pos].length(),
+ -1,
+ &spider->need_mons[link_idx]) &&
+ (error_num = spider_db_errorno(conn))))
{
- pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
- pthread_mutex_lock(&conn->mta_conn_mutex);
- SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
- conn->need_mon = &spider->need_mons[link_idx];
- DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = TRUE;
- conn->mta_conn_mutex_unlock_later = TRUE;
- conn->disable_connect_retry = TRUE;
- spider_conn_set_timeout_from_share(conn, link_idx,
- spider->wide_handler->trx->thd,
- share);
- if (
- (error_num = spider_db_set_names(spider, conn, link_idx)) ||
- (
- spider_db_query(
- conn,
- mysql_share->show_table_status[0 + pos].ptr(),
- mysql_share->show_table_status[0 + pos].length(),
- -1,
- &spider->need_mons[link_idx]) &&
- (error_num = spider_db_errorno(conn))
- )
- ) {
- if (
- error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM &&
- !conn->disable_reconnect
+ if (error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM &&
+ !conn->disable_reconnect)
+ {
+ /* retry */
+ if ((error_num = spider_db_ping(spider, conn, link_idx)))
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ if ((error_num = spider_db_set_names(spider, conn, link_idx)))
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ spider_conn_set_timeout_from_share(conn, link_idx,
+ spider->wide_handler->trx->thd,
+ share);
+ if ((error_num =
+ ((spider_db_mbase *) conn->db_conn)->set_lock_wait_timeout(1)))
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ if (spider_db_query(
+ conn,
+ mysql_share->show_table_status[pos].ptr(),
+ mysql_share->show_table_status[pos].length(),
+ -1,
+ &spider->need_mons[link_idx])
) {
- /* retry */
- if ((error_num = spider_db_ping(spider, conn, link_idx)))
- {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- if ((error_num = spider_db_set_names(spider, conn, link_idx)))
- {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- spider_conn_set_timeout_from_share(conn, link_idx,
- spider->wide_handler->trx->thd,
- share);
- if (spider_db_query(
- conn,
- mysql_share->show_table_status[0 + pos].ptr(),
- mysql_share->show_table_status[0 + pos].length(),
- -1,
- &spider->need_mons[link_idx])
- ) {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- DBUG_RETURN(spider_db_errorno(conn));
- }
- } else {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
+ spider_teardown_after_query(conn, 0, false);
+ DBUG_RETURN(spider_db_errorno(conn));
}
- }
- st_spider_db_request_key request_key;
- request_key.spider_thread_id = spider->wide_handler->trx->spider_thread_id;
- request_key.query_id = spider->wide_handler->trx->thd->query_id;
- request_key.handler = spider;
- request_key.request_id = 1;
- request_key.next = NULL;
- if (spider_param_dry_access())
- {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(0);
- }
- if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num)))
+ } else
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ }
+ st_spider_db_request_key request_key = {
+ spider->wide_handler->trx->spider_thread_id,
+ spider->wide_handler->trx->thd->query_id, spider, 1, NULL};
+ if (spider_param_dry_access())
+ DBUG_RETURN(spider_teardown_after_query(conn, 0, true));
+ if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num)))
+ {
+ if (sts_mode == 1) /* get from status table */
{
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
if (error_num)
- {
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- else if ((error_num = spider_db_errorno(conn)))
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ spider_teardown_after_query(conn, 0, false);
+ if ((error_num = spider_db_errorno(conn)))
DBUG_RETURN(error_num);
- else {
- my_printf_error(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
+ else
+ {
+ my_printf_error(
+ ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0),
mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
+ mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr());
DBUG_RETURN(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM);
}
- }
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- error_num = res->fetch_table_status(
- sts_mode,
- share->stat
- );
- auto_increment_value = share->stat.auto_increment_value;
- res->free_result();
- delete res;
- if (error_num)
+ } else /* get from information schema */
{
- switch (error_num)
- {
- case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM:
- my_printf_error(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
- ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0),
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
- break;
- case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM:
- my_printf_error(ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM,
- ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0),
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
- break;
- default:
- break;
- }
- DBUG_RETURN(error_num);
- }
- } else {
- pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
- pthread_mutex_lock(&conn->mta_conn_mutex);
- SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
- conn->need_mon = &spider->need_mons[link_idx];
- DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = TRUE;
- conn->mta_conn_mutex_unlock_later = TRUE;
- conn->disable_connect_retry = TRUE;
- spider_conn_set_timeout_from_share(conn, link_idx,
- spider->wide_handler->trx->thd,
- share);
- if (
- (error_num = spider_db_set_names(spider, conn, link_idx)) ||
- (
- spider_db_query(
- conn,
- mysql_share->show_table_status[1 + pos].ptr(),
- mysql_share->show_table_status[1 + pos].length(),
- -1,
- &spider->need_mons[link_idx]) &&
- (error_num = spider_db_errorno(conn))
- )
- ) {
- if (
- error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM &&
- !conn->disable_reconnect
- ) {
- /* retry */
- if ((error_num = spider_db_ping(spider, conn, link_idx)))
- {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- if ((error_num = spider_db_set_names(spider, conn, link_idx)))
- {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- spider_conn_set_timeout_from_share(conn, link_idx,
- spider->wide_handler->trx->thd,
- share);
- if (spider_db_query(
- conn,
- mysql_share->show_table_status[1 + pos].ptr(),
- mysql_share->show_table_status[1 + pos].length(),
- -1,
- &spider->need_mons[link_idx])
- ) {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- DBUG_RETURN(spider_db_errorno(conn));
- }
- } else {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- }
- st_spider_db_request_key request_key;
- request_key.spider_thread_id = spider->wide_handler->trx->spider_thread_id;
- request_key.query_id = spider->wide_handler->trx->thd->query_id;
- request_key.handler = spider;
- request_key.request_id = 1;
- request_key.next = NULL;
- if (spider_param_dry_access())
- {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(0);
- }
- if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num)))
- {
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- if (error_num || (error_num = spider_db_errorno(conn)))
+ spider_teardown_after_query(conn, error_num, false);
+ if (error_num || (error_num= spider_db_errorno(conn)))
DBUG_RETURN(error_num);
else
DBUG_RETURN(ER_QUERY_ON_FOREIGN_DATA_SOURCE);
}
- conn->disable_connect_retry = FALSE;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- error_num = res->fetch_table_status(
- sts_mode,
- share->stat
- );
- auto_increment_value = share->stat.auto_increment_value;
- res->free_result();
- delete res;
- if (error_num)
+ }
+ spider_teardown_after_query(conn, 0, true);
+ /* Fetches query results into share->stat. */
+ error_num = res->fetch_table_status(sts_mode, share->stat);
+ auto_increment_value = share->stat.auto_increment_value;
+ res->free_result();
+ delete res;
+ if (error_num)
+ {
+ switch (error_num)
{
- switch (error_num)
- {
- case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM:
- my_printf_error(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
- ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0),
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
- break;
- case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM:
- my_printf_error(ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM,
- ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0),
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
- break;
- default:
- break;
- }
- DBUG_RETURN(error_num);
+ case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM:
+ my_printf_error(
+ ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
+ ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0),
+ mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
+ mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr());
+ break;
+ case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM:
+ my_printf_error(
+ ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM,
+ ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0),
+ mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
+ mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr());
+ break;
+ default:
+ break;
}
+ DBUG_RETURN(error_num);
}
- if ((error_num = ((spider_db_mbase *) conn->db_conn)->print_warnings(NULL)))
+ if ((error_num = ((spider_db_mbase *) conn->db_conn)->fetch_and_print_warnings(NULL)))
{
+ ((spider_db_mbase *) conn->db_conn)->reset_lock_wait_timeout();
+ if (error_num == ER_LOCK_WAIT_TIMEOUT)
+ {
+ error_num = ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_NUM;
+ my_printf_error(
+ ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_NUM,
+ ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_STR, MYF(0),
+ mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
+ mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr());
+ }
DBUG_RETURN(error_num);
}
+ if ((error_num =
+ ((spider_db_mbase *) conn->db_conn)->reset_lock_wait_timeout()))
+ DBUG_RETURN(error_num);
if (share->static_records_for_status != -1)
- {
share->stat.records = (ha_rows) share->static_records_for_status;
- }
if (share->static_mean_rec_length != -1)
- {
share->stat.mean_rec_length = (ulong) share->static_mean_rec_length;
- }
if (auto_increment_value > share->lgtm_tblhnd_share->auto_increment_value)
{
share->lgtm_tblhnd_share->auto_increment_value = auto_increment_value;
@@ -13746,314 +13633,105 @@ int spider_mbase_handler::show_index(
SPIDER_SHARE *share = spider->share;
TABLE *table = spider->get_table();
SPIDER_DB_RESULT *res;
- int roop_count;
- longlong *tmp_cardinality;
- uint pos = (2 * spider->conn_link_idx[link_idx]);
+ int field;
+ longlong *tmp_crd;
+ const uint pos = 2 * spider->conn_link_idx[link_idx] +
+ (crd_mode == 1 ? 0 : 1);
DBUG_ENTER("spider_mbase_handler::show_index");
DBUG_PRINT("info",("spider crd_mode=%d", crd_mode));
- if (crd_mode == 1)
+ spider_setup_for_query(spider, conn, link_idx);
+ spider_conn_set_timeout_from_share(conn, link_idx,
+ spider->wide_handler->trx->thd, share);
+ if ((error_num = spider_db_set_names(spider, conn, link_idx)) ||
+ (error_num =
+ ((spider_db_mbase *) conn->db_conn)->set_lock_wait_timeout(1)) ||
+ (spider_db_query(
+ conn,
+ mysql_share->show_index[pos].ptr(),
+ mysql_share->show_index[pos].length(),
+ -1,
+ &spider->need_mons[link_idx]) &&
+ (error_num = spider_db_errorno(conn))))
{
- pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
- pthread_mutex_lock(&conn->mta_conn_mutex);
- SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
- conn->need_mon = &spider->need_mons[link_idx];
- DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = TRUE;
- conn->mta_conn_mutex_unlock_later = TRUE;
- spider_conn_set_timeout_from_share(conn, link_idx,
- spider->wide_handler->trx->thd,
- share);
- if (
- (error_num = spider_db_set_names(spider, conn, link_idx)) ||
- (
- spider_db_query(
- conn,
- mysql_share->show_index[0 + pos].ptr(),
- mysql_share->show_index[0 + pos].length(),
- -1,
- &spider->need_mons[link_idx]) &&
- (error_num = spider_db_errorno(conn))
- )
- ) {
- if (
- error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM &&
- !conn->disable_reconnect
- ) {
- /* retry */
- if ((error_num = spider_db_ping(spider, conn, link_idx)))
- {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- if ((error_num = spider_db_set_names(spider, conn, link_idx)))
- {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- spider_conn_set_timeout_from_share(conn, link_idx,
- spider->wide_handler->trx->thd,
- share);
- if (spider_db_query(
- conn,
- mysql_share->show_index[0 + pos].ptr(),
- mysql_share->show_index[0 + pos].length(),
- -1,
- &spider->need_mons[link_idx])
- ) {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- DBUG_RETURN(spider_db_errorno(conn));
- }
- } else {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- }
- st_spider_db_request_key request_key;
- request_key.spider_thread_id = spider->wide_handler->trx->spider_thread_id;
- request_key.query_id = spider->wide_handler->trx->thd->query_id;
- request_key.handler = spider;
- request_key.request_id = 1;
- request_key.next = NULL;
- if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num)))
- {
- if (error_num || (error_num = spider_db_errorno(conn)))
- {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- /* no record is ok */
- }
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- if (res)
- {
- error_num = res->fetch_table_cardinality(
- crd_mode,
- table,
- share->cardinality,
- share->cardinality_upd,
- share->bitmap_size
- );
- }
- for (roop_count = 0, tmp_cardinality = share->cardinality;
- roop_count < (int) table->s->fields;
- roop_count++, tmp_cardinality++)
- {
- if (!spider_bit_is_set(share->cardinality_upd, roop_count))
- {
- DBUG_PRINT("info",
- ("spider uninitialized column cardinality id=%d", roop_count));
- *tmp_cardinality = -1;
- }
- }
- if (res)
- {
- res->free_result();
- delete res;
- }
- if (error_num)
- {
- switch (error_num)
- {
- case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM:
- my_printf_error(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
- ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0),
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
- break;
- case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM:
- my_printf_error(ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM,
- ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0),
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
- break;
- default:
- break;
- }
- DBUG_RETURN(error_num);
- }
- } else {
- pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
- pthread_mutex_lock(&conn->mta_conn_mutex);
- SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
- conn->need_mon = &spider->need_mons[link_idx];
- DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = TRUE;
- conn->mta_conn_mutex_unlock_later = TRUE;
- spider_conn_set_timeout_from_share(conn, link_idx,
- spider->wide_handler->trx->thd,
- share);
- if (
- (error_num = spider_db_set_names(spider, conn, link_idx)) ||
- (
- spider_db_query(
- conn,
- mysql_share->show_index[1 + pos].ptr(),
- mysql_share->show_index[1 + pos].length(),
- -1,
- &spider->need_mons[link_idx]) &&
- (error_num = spider_db_errorno(conn))
- )
- ) {
- if (
- error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM &&
- !conn->disable_reconnect
- ) {
- /* retry */
- if ((error_num = spider_db_ping(spider, conn, link_idx)))
- {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- if ((error_num = spider_db_set_names(spider, conn, link_idx)))
- {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- spider_conn_set_timeout_from_share(conn, link_idx,
- spider->wide_handler->trx->thd,
- share);
- if (spider_db_query(
- conn,
- mysql_share->show_index[1 + pos].ptr(),
- mysql_share->show_index[1 + pos].length(),
- -1,
- &spider->need_mons[link_idx])
- ) {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- DBUG_RETURN(spider_db_errorno(conn));
- }
- } else {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- }
- st_spider_db_request_key request_key;
- request_key.spider_thread_id = spider->wide_handler->trx->spider_thread_id;
- request_key.query_id = spider->wide_handler->trx->thd->query_id;
- request_key.handler = spider;
- request_key.request_id = 1;
- request_key.next = NULL;
- if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num)))
+ if (error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM &&
+ !conn->disable_reconnect)
{
- if (error_num || (error_num = spider_db_errorno(conn)))
- {
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- DBUG_RETURN(error_num);
- }
- /* no record is ok */
- }
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- if (res)
- {
- error_num = res->fetch_table_cardinality(
- crd_mode,
- table,
- share->cardinality,
- share->cardinality_upd,
- share->bitmap_size
- );
- }
- for (roop_count = 0, tmp_cardinality = share->cardinality;
- roop_count < (int) table->s->fields;
- roop_count++, tmp_cardinality++)
- {
- if (!spider_bit_is_set(share->cardinality_upd, roop_count))
+ /* retry */
+ if ((error_num = spider_db_ping(spider, conn, link_idx)))
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ if ((error_num = spider_db_set_names(spider, conn, link_idx)))
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ spider_conn_set_timeout_from_share(conn, link_idx,
+ spider->wide_handler->trx->thd,
+ share);
+ if ((error_num =
+ ((spider_db_mbase *) conn->db_conn)->set_lock_wait_timeout(1)))
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ if (spider_db_query(
+ conn,
+ mysql_share->show_index[pos].ptr(),
+ mysql_share->show_index[pos].length(),
+ -1,
+ &spider->need_mons[link_idx]))
{
- DBUG_PRINT("info",
- ("spider uninitialized column cardinality id=%d", roop_count));
- *tmp_cardinality = -1;
+ spider_teardown_after_query(conn, 0, false);
+ DBUG_RETURN(spider_db_errorno(conn));
}
- }
- if (res)
- {
- res->free_result();
- delete res;
- }
- if (error_num)
+ } else
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ }
+ st_spider_db_request_key request_key = {
+ spider->wide_handler->trx->spider_thread_id,
+ spider->wide_handler->trx->thd->query_id, spider, 1, NULL};
+ /* no record is ok */
+ if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num)) &&
+ (error_num || (error_num = spider_db_errorno(conn))))
+ DBUG_RETURN(spider_teardown_after_query(conn, error_num, true));
+ spider_teardown_after_query(conn, 0, true);
+ if (res)
+ error_num = res->fetch_table_cardinality(
+ crd_mode, table, share->cardinality, share->cardinality_upd,
+ share->bitmap_size);
+ for (field = 0, tmp_crd = share->cardinality;
+ field < (int) table->s->fields;
+ field++, tmp_crd++)
+ {
+ if (!spider_bit_is_set(share->cardinality_upd, field))
{
- switch (error_num)
- {
- case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM:
- my_printf_error(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
- ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0),
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
- break;
- case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM:
- my_printf_error(ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM,
- ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0),
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[
- link_idx]].ptr());
- break;
- default:
- break;
- }
- DBUG_RETURN(error_num);
+ DBUG_PRINT("info",
+ ("spider uninitialized column cardinality id=%d", field));
+ *tmp_crd = -1;
}
}
- DBUG_RETURN(0);
+ if (res)
+ {
+ res->free_result();
+ delete res;
+ }
+ switch (error_num)
+ {
+ case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM:
+ my_printf_error(
+ ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
+ ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0),
+ mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
+ mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr());
+ break;
+ case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM:
+ my_printf_error(
+ ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM,
+ ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0),
+ mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(),
+ mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr());
+ break;
+ default:
+ break;
+ }
+ if (!error_num)
+ error_num = ((spider_db_mbase *) conn->db_conn)->reset_lock_wait_timeout();
+ else
+ ((spider_db_mbase *) conn->db_conn)->reset_lock_wait_timeout();
+ DBUG_RETURN(error_num);
}
int spider_mbase_handler::simple_action(
diff --git a/storage/spider/spd_db_mysql.h b/storage/spider/spd_db_mysql.h
index aa70d28e0ad..ba521a58fb8 100644
--- a/storage/spider/spd_db_mysql.h
+++ b/storage/spider/spd_db_mysql.h
@@ -434,9 +434,7 @@ public:
bool is_xa_nota_error(
int error_num
);
- int print_warnings(
- struct tm *l_time
- );
+ int fetch_and_print_warnings(struct tm *l_time);
spider_db_result *store_result(
spider_db_result_buffer **spider_res_buf,
st_spider_db_request_key *request_key,
@@ -515,6 +513,12 @@ public:
int wait_timeout,
int *need_mon
);
+
+ /** Set the global lock wait time out */
+ int set_lock_wait_timeout(uint timeout);
+ /** Reset the global lock wait time out */
+ int reset_lock_wait_timeout();
+
bool set_sql_mode_in_bulk_sql();
int set_sql_mode(
sql_mode_t sql_mode,
diff --git a/storage/spider/spd_err.h b/storage/spider/spd_err.h
index e9a4a41946e..e2098d4e751 100644
--- a/storage/spider/spd_err.h
+++ b/storage/spider/spd_err.h
@@ -134,6 +134,8 @@
#define ER_SPIDER_SAME_SERVER_LINK_STR2 "Host:%s and Port:%ld aim self server. Please change spider_same_server_link parameter if this link is required."
#define ER_SPIDER_CANT_NUM 12721
#define ER_SPIDER_CANT_STR1 "Can't %s%d"
+#define ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_NUM 12722
+#define ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_STR "Table %s.%s open lock wait timeout. Please check for self-reference."
#define ER_SPIDER_COND_SKIP_NUM 12801
#define ER_SPIDER_UNKNOWN_NUM 12500
diff --git a/storage/spider/spd_include.h b/storage/spider/spd_include.h
index 35f348ca999..10675aee3ef 100644
--- a/storage/spider/spd_include.h
+++ b/storage/spider/spd_include.h
@@ -148,9 +148,14 @@ typedef start_new_trans *SPIDER_Open_tables_backup;
#define spider_bit_is_set(BITMAP, BIT) \
(uint) ((BITMAP)[(BIT) / 8] & (1 << ((BIT) & 7)))
+/* Change status of the remote backend server link. */
+/* 0 Doesn't change status. */
#define SPIDER_LINK_STATUS_NO_CHANGE 0
+/* 1 Changes status to OK. */
#define SPIDER_LINK_STATUS_OK 1
+/* 2 Changes status to RECOVERY. */
#define SPIDER_LINK_STATUS_RECOVERY 2
+/* 3 Changes status to no more in group communication. */
#define SPIDER_LINK_STATUS_NG 3
#define SPIDER_LINK_MON_OK 0
@@ -699,22 +704,30 @@ typedef struct st_spider_share
char *table_name;
uint table_name_length;
uint use_count;
+ /**
+ Probably equals `active_link_count`. See also commit ddff602 of
+ https://github.com/nayuta-yanagisawa/spider-history
+
+ FIXME: consider removing it and using `active_link_count` instead.
+ */
uint link_count;
+ /* Number of all links, i.e. all remote servers for the spider
+ table. */
uint all_link_count;
uint link_bitmap_size;
pthread_mutex_t mutex;
pthread_mutex_t sts_mutex;
pthread_mutex_t crd_mutex;
-/*
- pthread_mutex_t auto_increment_mutex;
-*/
TABLE_SHARE *table_share;
SPIDER_LGTM_TBLHND_SHARE *lgtm_tblhnd_share;
my_hash_value_type table_name_hash_value;
my_hash_value_type table_path_hash_value;
+ /* Whether the share has been initialised */
volatile bool init;
+ /* Whether an error occurred in initialisation of this share */
volatile bool init_error;
+ /* The time of the initialisation error */
volatile time_t init_error_time;
volatile bool link_status_init;
uchar *table_mon_mutex_bitmap;
@@ -770,10 +783,6 @@ typedef struct st_spider_share
MEM_ROOT mem_root;
-/*
- volatile bool auto_increment_init;
- volatile ulonglong auto_increment_lclval;
-*/
ha_statistics stat;
longlong static_records_for_status;
@@ -788,17 +797,27 @@ typedef struct st_spider_share
longlong additional_table_flags;
bool have_recovery_link;
+ /** See `mysql_sysvar_sts_bg_mode` */
int sts_bg_mode;
+ /** See `mysql_sysvar_sts_interval` */
double sts_interval;
+ /** See `mysql_sysvar_sts_mode` */
int sts_mode;
+ /** See `mysql_sysvar_sts_sync` */
int sts_sync;
int store_last_sts;
+ /** See `mysql_sysvar_load_sts_at_startup` */
int load_sts_at_startup;
+ /** See `mysql_sysvar_crd_bg_mode` */
int crd_bg_mode;
+ /** See `mysql_sysvar_crd_interval` */
double crd_interval;
+ /** See `mysql_sysvar_crd_mode` */
int crd_mode;
+ /** See `mysql_sysvar_crd_sync` */
int crd_sync;
int store_last_crd;
+ /** See `mysql_sysvar_load_crd_at_startup` */
int load_crd_at_startup;
int crd_type;
double crd_weight;
@@ -836,6 +855,7 @@ typedef struct st_spider_share
longlong bgs_second_read;
longlong first_read;
longlong second_read;
+ /** See `mysql_sysvar_auto_increment_mode` */
int auto_increment_mode;
int use_table_charset;
int use_pushdown_udf;
@@ -846,6 +866,8 @@ typedef struct st_spider_share
int read_only_mode;
int error_read_mode;
int error_write_mode;
+ /* Number of active remote servers, for use in load balancing read
+ connections */
int active_link_count;
#ifdef HA_CAN_FORCE_BULK_UPDATE
int force_bulk_update;
@@ -868,6 +890,8 @@ typedef struct st_spider_share
char **tgt_usernames;
char **tgt_passwords;
char **tgt_sockets;
+ /** The wrapper of target servers, each element has the same
+ possible values as `SPIDER_DBTON::wrapper` */
char **tgt_wrappers;
char **tgt_ssl_cas;
char **tgt_ssl_capaths;
@@ -885,6 +909,7 @@ typedef struct st_spider_share
char **conn_keys;
long *tgt_ports;
long *tgt_ssl_vscs;
+ /* See SPIDER_LINK_STATUS_* in spd_include.h */
long *link_statuses;
long *monitoring_bg_flag;
long *monitoring_bg_kind;
@@ -897,6 +922,7 @@ typedef struct st_spider_share
long *connect_timeouts;
long *net_read_timeouts;
long *net_write_timeouts;
+ /* Connection load balancing integer weight */
long *access_balances;
long *bka_table_name_types;
long *strict_group_bys;
@@ -988,10 +1014,16 @@ typedef struct st_spider_share
uint bka_table_name_types_length;
uint strict_group_bys_length;
- /* for dbton */
+ /*
+ For dbton. A `SPIDER_SHARE` uses all `SPIDER_DBTON`s with the same
+ wrappers as any its `tgt_wrappers`
+ */
+ /* Specifies which dbtons of the `spider_dbton` to use */
uchar dbton_bitmap[spider_bitmap_size(SPIDER_DBTON_SIZE)];
spider_db_share *dbton_share[SPIDER_DBTON_SIZE];
+ /* Number of `SPIDER_DBTON`s used */
uint use_dbton_count;
+ /* Index of each `SPIDER_DBTON` in `spider_dbton` to use */
uint use_dbton_ids[SPIDER_DBTON_SIZE];
uint dbton_id_to_seq[SPIDER_DBTON_SIZE];
uint use_sql_dbton_count;
@@ -1008,14 +1040,23 @@ typedef struct st_spider_link_pack
int link_idx;
} SPIDER_LINK_PACK;
+/** A struct storing the initialisation error of a table. All
+instances are in `spider_init_error_tables` */
typedef struct st_spider_init_error_table
{
+ /* The associated table name */
char *table_name;
+ /* Length of the associated table name */
uint table_name_length;
+ /* Hash value of the associated table name for lookup */
my_hash_value_type table_name_hash_value;
+ /* Whether the error has a message */
bool init_error_with_message;
+ /* The error message */
char init_error_msg[MYSQL_ERRMSG_SIZE];
+ /* The error code */
volatile int init_error;
+ /* The error time */
volatile time_t init_error_time;
} SPIDER_INIT_ERROR_TABLE;
diff --git a/storage/spider/spd_param.cc b/storage/spider/spd_param.cc
index 0a5d881749c..dfd98b9fbc0 100644
--- a/storage/spider/spd_param.cc
+++ b/storage/spider/spd_param.cc
@@ -1771,7 +1771,7 @@ int spider_param_sts_mode(
/*
-1 :use table parameter
0 :No synchronization.
- 1 :Table state is synchronized when opening a table.
+ 1 :Table stat is synchronized when opening a table.
Then no synchronization.
2 :Synchronization.
*/
diff --git a/storage/spider/spd_param.h b/storage/spider/spd_param.h
index 6abdca43492..a7573a6fb29 100644
--- a/storage/spider/spd_param.h
+++ b/storage/spider/spd_param.h
@@ -316,7 +316,6 @@ my_bool spider_param_index_hint_pushdown(
);
uint spider_param_max_connections();
uint spider_param_conn_wait_timeout();
-uint spider_param_internal_lock_wait_timeout();
uint spider_param_log_result_errors();
uint spider_param_log_result_error_with_sql();
uint spider_param_internal_xa_id_type(
diff --git a/storage/spider/spd_ping_table.cc b/storage/spider/spd_ping_table.cc
index 3de30e6a80b..056c21e07ec 100644
--- a/storage/spider/spd_ping_table.cc
+++ b/storage/spider/spd_ping_table.cc
@@ -505,7 +505,7 @@ SPIDER_TABLE_MON_LIST *spider_get_ping_table_tgt(
(*error_num = spider_get_sys_tables_connect_info(
table_tables, tmp_share, 0, &mem_root)) ||
(*error_num = spider_get_sys_tables_link_status(
- table_tables, tmp_share, 0, &mem_root))
+ table_tables, tmp_share->link_statuses, &mem_root))
) {
table_tables->file->print_error(*error_num, MYF(0));
goto error;
diff --git a/storage/spider/spd_sys_table.cc b/storage/spider/spd_sys_table.cc
index b42215a2da3..7b96c483d5e 100644
--- a/storage/spider/spd_sys_table.cc
+++ b/storage/spider/spd_sys_table.cc
@@ -979,6 +979,16 @@ void spider_store_xa_member_info(
DBUG_VOID_RETURN;
}
+/**
+ Stores the DB and table names in a table
+
+ If `name` starts with "./", separates out db and table names from
+ `name`. Otherwise stores empty strings as names
+
+ @param table The table to store the info
+ @param name The name of the table
+ @param name_length The length of the name
+*/
void spider_store_tables_name(
TABLE *table,
const char *name,
@@ -1443,6 +1453,12 @@ void spider_store_binlog_pos_gtid(
DBUG_VOID_RETURN;
}
+/**
+ Stores sts info in the spider sts table
+
+ Stores all fields except the db name and table name, which are
+ stored in `spider_store_tables_name()`.
+*/
void spider_store_table_sts_info(
TABLE *table,
ha_statistics *stat
@@ -1595,6 +1611,18 @@ int spider_insert_sys_table(
DBUG_RETURN(error_num);
}
+/**
+ Inserts or updates a row in the spider sts system table
+
+ @param table The spider sts system table
+ @param name The name of the spider table whose stat will be
+ inserted / updated in the sts table
+ @param name_length Length of the name
+ @param stat The stat of the spider table that will be
+ inserted / updated in the sts table
+
+ @retval 0 or error
+*/
int spider_insert_or_update_table_sts(
TABLE *table,
const char *name,
@@ -2642,31 +2670,22 @@ int spider_get_sys_tables_monitoring_binlog_pos_at_failing(
DBUG_RETURN(error_num);
}
-int spider_get_sys_tables_link_status(
- TABLE *table,
- SPIDER_SHARE *share,
- int link_idx,
- MEM_ROOT *mem_root
-) {
- char *ptr;
- int error_num = 0;
- DBUG_ENTER("spider_get_sys_tables_link_status");
- if ((ptr = get_field(mem_root, table->field[SPIDER_TABLES_LINK_STATUS_POS])))
- {
- share->link_statuses[link_idx] =
- (long) my_strtoll10(ptr, (char**) NULL, &error_num);
- } else
- share->link_statuses[link_idx] = 1;
- DBUG_PRINT("info",("spider link_statuses[%d]=%ld",
- link_idx, share->link_statuses[link_idx]));
- DBUG_RETURN(error_num);
-}
-
+/**
+ Reads a table field and updates a link_status of a spider share
+
+ @param table The system table (`spider_tables` table) to read the
+ field from
+ @param share The share to update its link status with
+ @param link_idx Which link status to update
+ @param mem_root MEM_ROOT for allocating
+ @reval 0 for success, or error num
+*/
int spider_get_sys_tables_link_status(
TABLE *table,
long *link_status,
MEM_ROOT *mem_root
-) {
+)
+{
char *ptr;
int error_num = 0;
DBUG_ENTER("spider_get_sys_tables_link_status");
@@ -2674,7 +2693,6 @@ int spider_get_sys_tables_link_status(
*link_status = (long) my_strtoll10(ptr, (char**) NULL, &error_num);
else
*link_status = 1;
- DBUG_PRINT("info",("spider link_statuses=%ld", *link_status));
DBUG_RETURN(error_num);
}
@@ -2716,6 +2734,14 @@ int spider_get_sys_tables_static_link_id(
DBUG_RETURN(error_num);
}
+/**
+ Reads the table status from the system sts table
+
+ The result is set into `stat`
+
+ @param table The system sts table
+ @param stat The stat to read the table status into
+*/
void spider_get_sys_table_sts_info(
TABLE *table,
ha_statistics *stat
@@ -3173,6 +3199,15 @@ int spider_get_sys_link_mon_connect_info(
DBUG_RETURN(error_num);
}
+/**
+ Reads link statuses from the spider_tables system table into a
+ spider share
+
+ @param table The table to read from
+ @param share The spider share
+ @param mem_root MEM_ROOT for allocating
+ @reval 0 for success, or error code
+*/
int spider_get_link_statuses(
TABLE *table,
SPIDER_SHARE *share,
@@ -3191,14 +3226,10 @@ int spider_get_link_statuses(
{
if (
(error_num == HA_ERR_KEY_NOT_FOUND || error_num == HA_ERR_END_OF_FILE)
- ) {
-/*
- table->file->print_error(error_num, MYF(0));
-*/
+ )
DBUG_RETURN(error_num);
- }
- } else if ((error_num =
- spider_get_sys_tables_link_status(table, share, roop_count, mem_root)))
+ } else if ((error_num = spider_get_sys_tables_link_status(
+ table, &share->link_statuses[roop_count], mem_root)))
{
table->file->print_error(error_num, MYF(0));
DBUG_RETURN(error_num);
@@ -3207,6 +3238,16 @@ int spider_get_link_statuses(
DBUG_RETURN(0);
}
+/**
+ Inserts or updates status of a table into the system sts table
+
+ @param thd Connection
+ @param name Name of the table whose status will be stored
+ @param name_length Length of `name`
+ @param stat The table status that will be stored into the
+ system sts table
+ @reval 0 for success, or error code
+*/
int spider_sys_insert_or_update_table_sts(
THD *thd,
const char *name,
@@ -3345,6 +3386,14 @@ error:
DBUG_RETURN(error_num);
}
+/**
+ Reads table status of a table from the system sts table.
+
+ @param thd Connection
+ @param name The name of the table for which to read status of
+ @param name_length The length of `name`
+ @param stat The struct to read the status into
+*/
int spider_sys_get_table_sts(
THD *thd,
const char *name,
diff --git a/storage/spider/spd_sys_table.h b/storage/spider/spd_sys_table.h
index 0ad98893322..6cb6c3957a7 100644
--- a/storage/spider/spd_sys_table.h
+++ b/storage/spider/spd_sys_table.h
@@ -439,13 +439,6 @@ int spider_get_sys_tables_monitoring_binlog_pos_at_failing(
int spider_get_sys_tables_link_status(
TABLE *table,
- SPIDER_SHARE *share,
- int link_idx,
- MEM_ROOT *mem_root
-);
-
-int spider_get_sys_tables_link_status(
- TABLE *table,
long *link_status,
MEM_ROOT *mem_root
);
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index f8ebb9618e0..327d4a30a0b 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -122,6 +122,7 @@ static pthread_mutex_t *spd_LOCK_server_started;
static pthread_cond_t *spd_COND_server_started;
extern long spider_conn_mutex_id;
handlerton *spider_hton_ptr;
+/** All `SPIDER_DBTON`s */
SPIDER_DBTON spider_dbton[SPIDER_DBTON_SIZE];
extern SPIDER_DBTON spider_dbton_mysql;
extern SPIDER_DBTON spider_dbton_mariadb;
@@ -267,6 +268,20 @@ ha_create_table_option spider_table_option_list[]= {
HA_TOPTION_STRING("REMOTE_DATABASE", remote_database),
HA_TOPTION_STRING("REMOTE_TABLE", remote_table), HA_TOPTION_END};
+/**
+ Determines how to populate sts (stat) / crd (cardinality) of a
+ spider share
+*/
+enum ha_sts_crd_get_type
+{
+ HA_GET_COPY = 0, /* Get by copying from wide_share */
+ HA_GET_FETCH = 1, /* Get by executing a sql query */
+ HA_GET_AFTER_LOCK = 2, /* Get by executing a sql query after
+ locking wide_share->sts_mutex. */
+ HA_GET_AFTER_TRYLOCK = 3 /* Get by executing a sql query after
+ trylocking wide_share->sts_mutex. */
+};
+
extern HASH spider_open_connections;
extern HASH spider_ipport_conns;
extern uint spider_open_connections_id;
@@ -295,6 +310,7 @@ const char *spider_open_tables_func_name;
const char *spider_open_tables_file_name;
ulong spider_open_tables_line_no;
pthread_mutex_t spider_tbl_mutex;
+/** All the `SPIDER_INIT_ERROR_TABLE`s */
HASH spider_init_error_tables;
uint spider_init_error_tables_id;
const char *spider_init_error_tables_func_name;
@@ -342,6 +358,11 @@ extern ulonglong spider_free_mem_count[SPIDER_MEM_CALC_LIST_NUM];
static char spider_wild_many = '%', spider_wild_one = '_',
spider_wild_prefix='\\';
+/**
+ `spider_unique_id` is used for identifying a spider table. It is set
+ to be a concatenation of the MAC address and the PID, give or take
+ some separators
+*/
static char spider_unique_id_buf[1 + 12 + 1 + (16 * 2) + 1 + 1];
LEX_CSTRING spider_unique_id;
@@ -4094,7 +4115,7 @@ void spider_print_keys(
int spider_create_conn_keys(
SPIDER_SHARE *share
) {
- int roop_count, roop_count2;
+ int roop_count;
char *tmp_name, port_str[6];
uint length_base = sizeof(uint) * share->all_link_count;
uint *conn_keys_lengths;
@@ -4112,70 +4133,79 @@ int spider_create_conn_keys(
sql_dbton_ids = (uint *) ptr;
share->conn_keys_charlen = 0;
- for (roop_count = 0; roop_count < (int) share->all_link_count; roop_count++)
+ for (int all_link_idx = 0; all_link_idx < (int) share->all_link_count; all_link_idx++)
{
bool get_sql_id = FALSE;
- for (roop_count2 = 0; roop_count2 < SPIDER_DBTON_SIZE; roop_count2++)
- {
- DBUG_PRINT("info",("spider share->tgt_wrappers[%d]=%s", roop_count,
- share->tgt_wrappers[roop_count]));
- DBUG_PRINT("info",("spider spider_dbton[%d].wrapper=%s", roop_count2,
- spider_dbton[roop_count2].wrapper ?
- spider_dbton[roop_count2].wrapper : "NULL"));
+ /**
+ Find all `SPIDER_DBTON`s with the same wrapper as the target
+ server and set the bitmap. Stop at the first `SPIDER_DBTON` whose
+ db_access_type is sql
+
+ fixme: the logic may be more complicated than the intended
+ one. For one thing, ALL `SPIDER_DBTON`s have sql access
+ type. Consider removing everything to do with the db access
+ type.
+ */
+ for (int dbton_idx = 0; dbton_idx < SPIDER_DBTON_SIZE; dbton_idx++)
+ {
+ DBUG_PRINT("info",("spider share->tgt_wrappers[%d]=%s", all_link_idx,
+ share->tgt_wrappers[all_link_idx]));
+ DBUG_PRINT("info",("spider spider_dbton[%d].wrapper=%s", dbton_idx,
+ spider_dbton[dbton_idx].wrapper ?
+ spider_dbton[dbton_idx].wrapper : "NULL"));
if (
- spider_dbton[roop_count2].wrapper &&
- !strcmp(share->tgt_wrappers[roop_count],
- spider_dbton[roop_count2].wrapper)
+ spider_dbton[dbton_idx].wrapper &&
+ !strcmp(share->tgt_wrappers[all_link_idx],
+ spider_dbton[dbton_idx].wrapper)
) {
- spider_set_bit(share->dbton_bitmap, roop_count2);
+ spider_set_bit(share->dbton_bitmap, dbton_idx);
if (
!get_sql_id &&
- spider_dbton[roop_count2].db_access_type == SPIDER_DB_ACCESS_TYPE_SQL
+ spider_dbton[dbton_idx].db_access_type == SPIDER_DB_ACCESS_TYPE_SQL
) {
- sql_dbton_ids[roop_count] = roop_count2;
+ sql_dbton_ids[all_link_idx] = dbton_idx;
get_sql_id = TRUE;
break;
}
}
}
if (!get_sql_id)
- sql_dbton_ids[roop_count] = SPIDER_DBTON_SIZE;
+ sql_dbton_ids[all_link_idx] = SPIDER_DBTON_SIZE;
bool tables_on_different_db_are_joinable;
if (get_sql_id)
{
tables_on_different_db_are_joinable =
- spider_dbton[sql_dbton_ids[roop_count]].db_util->
+ spider_dbton[sql_dbton_ids[all_link_idx]].db_util->
tables_on_different_db_are_joinable();
} else {
tables_on_different_db_are_joinable = TRUE;
}
- conn_keys_lengths[roop_count]
+ conn_keys_lengths[all_link_idx]
= 1
- + share->tgt_wrappers_lengths[roop_count] + 1
- + share->tgt_hosts_lengths[roop_count] + 1
+ + share->tgt_wrappers_lengths[all_link_idx] + 1
+ + share->tgt_hosts_lengths[all_link_idx] + 1
+ 5 + 1
- + share->tgt_sockets_lengths[roop_count] + 1
+ + share->tgt_sockets_lengths[all_link_idx] + 1
+ (tables_on_different_db_are_joinable ?
- 0 : share->tgt_dbs_lengths[roop_count] + 1)
- + share->tgt_usernames_lengths[roop_count] + 1
- + share->tgt_passwords_lengths[roop_count] + 1
- + share->tgt_ssl_cas_lengths[roop_count] + 1
- + share->tgt_ssl_capaths_lengths[roop_count] + 1
- + share->tgt_ssl_certs_lengths[roop_count] + 1
- + share->tgt_ssl_ciphers_lengths[roop_count] + 1
- + share->tgt_ssl_keys_lengths[roop_count] + 1
+ 0 : share->tgt_dbs_lengths[all_link_idx] + 1)
+ + share->tgt_usernames_lengths[all_link_idx] + 1
+ + share->tgt_passwords_lengths[all_link_idx] + 1
+ + share->tgt_ssl_cas_lengths[all_link_idx] + 1
+ + share->tgt_ssl_capaths_lengths[all_link_idx] + 1
+ + share->tgt_ssl_certs_lengths[all_link_idx] + 1
+ + share->tgt_ssl_ciphers_lengths[all_link_idx] + 1
+ + share->tgt_ssl_keys_lengths[all_link_idx] + 1
+ 1 + 1
- + share->tgt_default_files_lengths[roop_count] + 1
- + share->tgt_default_groups_lengths[roop_count] + 1
- + share->tgt_dsns_lengths[roop_count] + 1
- + share->tgt_filedsns_lengths[roop_count] + 1
- + share->tgt_drivers_lengths[roop_count];
- share->conn_keys_charlen += conn_keys_lengths[roop_count] + 2;
+ + share->tgt_default_files_lengths[all_link_idx] + 1
+ + share->tgt_default_groups_lengths[all_link_idx] + 1
+ + share->tgt_dsns_lengths[all_link_idx] + 1
+ + share->tgt_filedsns_lengths[all_link_idx] + 1
+ + share->tgt_drivers_lengths[all_link_idx];
+ share->conn_keys_charlen += conn_keys_lengths[all_link_idx] + 2;
}
if (!(share->conn_keys = (char **)
- spider_bulk_alloc_mem(spider_current_trx, 45,
- __func__, __FILE__, __LINE__, MYF(MY_WME | MY_ZEROFILL),
+ spider_bulk_malloc(spider_current_trx, 45, MYF(MY_WME | MY_ZEROFILL),
&share->conn_keys, sizeof(char *) * share->all_link_count,
&share->conn_keys_lengths, length_base,
&share->conn_keys_hash_value,
@@ -4331,15 +4361,15 @@ int spider_create_conn_keys(
&spider_open_connections, (uchar*) share->conn_keys[roop_count],
share->conn_keys_lengths[roop_count]);
}
- for (roop_count2 = 0; roop_count2 < SPIDER_DBTON_SIZE; roop_count2++)
+ for (int dbton_idx = 0; dbton_idx < SPIDER_DBTON_SIZE; dbton_idx++)
{
- if (spider_bit_is_set(share->dbton_bitmap, roop_count2))
+ if (spider_bit_is_set(share->dbton_bitmap, dbton_idx))
{
- share->use_sql_dbton_ids[share->use_dbton_count] = roop_count2;
- share->sql_dbton_id_to_seq[roop_count2] = share->use_dbton_count;
- share->use_sql_dbton_count++;
- share->use_dbton_ids[share->use_dbton_count] = roop_count2;
- share->dbton_id_to_seq[roop_count2] = share->use_dbton_count;
+ share->use_sql_dbton_ids[share->use_dbton_count] = dbton_idx;
+ share->sql_dbton_id_to_seq[dbton_idx] = share->use_dbton_count;
+ share->use_sql_dbton_count++;
+ share->use_dbton_ids[share->use_dbton_count] = dbton_idx;
+ share->dbton_id_to_seq[dbton_idx] = share->use_dbton_count;
share->use_dbton_count++;
}
}
@@ -4539,1002 +4569,619 @@ error_alloc_share:
DBUG_RETURN(NULL);
}
-SPIDER_SHARE *spider_get_share(
- const char *table_name,
- TABLE *table,
- THD *thd,
- ha_spider *spider,
- int *error_num
-) {
- SPIDER_SHARE *share;
- TABLE_SHARE *table_share = table->s;
- SPIDER_RESULT_LIST *result_list = &spider->result_list;
- uint length, tmp_conn_link_idx = 0, buf_sz;
- char *tmp_name;
- int roop_count;
- double sts_interval;
- int sts_mode;
- int sts_sync;
- int auto_increment_mode;
- double crd_interval;
- int crd_mode;
- int crd_sync;
- char first_byte;
- int semi_table_lock_conn;
- int search_link_idx;
- uint sql_command = thd_sql_command(thd);
- SPIDER_Open_tables_backup open_tables_backup;
- MEM_ROOT mem_root;
- TABLE *table_tables = NULL;
- bool init_mem_root = FALSE;
- bool same_server_link;
- int load_sts_at_startup;
- int load_crd_at_startup;
- user_var_entry *loop_check;
- char *loop_check_buf;
- TABLE_SHARE *top_share;
- LEX_CSTRING lex_str;
- DBUG_ENTER("spider_get_share");
- top_share = spider->wide_handler->top_share;
- length = (uint) strlen(table_name);
- my_hash_value_type hash_value = my_calc_hash(&spider_open_tables,
- (uchar*) table_name, length);
- if (top_share)
- {
- lex_str.length = top_share->path.length + SPIDER_SQL_LOP_CHK_PRM_PRF_LEN;
- buf_sz = spider_unique_id.length > SPIDER_SQL_LOP_CHK_PRM_PRF_LEN ?
- top_share->path.length + spider_unique_id.length + 2 :
- lex_str.length + 2;
- loop_check_buf = (char *) my_alloca(buf_sz);
- if (unlikely(!loop_check_buf))
- {
- *error_num = HA_ERR_OUT_OF_MEM;
- DBUG_RETURN(NULL);
- }
- lex_str.str = loop_check_buf + buf_sz - lex_str.length - 2;
- memcpy((void *) lex_str.str,
- SPIDER_SQL_LOP_CHK_PRM_PRF_STR, SPIDER_SQL_LOP_CHK_PRM_PRF_LEN);
- memcpy((void *) (lex_str.str + SPIDER_SQL_LOP_CHK_PRM_PRF_LEN),
- top_share->path.str, top_share->path.length);
- ((char *) lex_str.str)[lex_str.length] = '\0';
- DBUG_PRINT("info",("spider loop check param name=%s", lex_str.str));
- loop_check = get_variable(&thd->user_vars, &lex_str, FALSE);
- if (loop_check && loop_check->type == STRING_RESULT)
- {
- lex_str.length = top_share->path.length + spider_unique_id.length + 1;
- lex_str.str = loop_check_buf + buf_sz - top_share->path.length -
- spider_unique_id.length - 2;
- memcpy((void *) lex_str.str, spider_unique_id.str,
- spider_unique_id.length);
- ((char *) lex_str.str)[lex_str.length - 1] = '-';
- ((char *) lex_str.str)[lex_str.length] = '\0';
- DBUG_PRINT("info",("spider loop check key=%s", lex_str.str));
- DBUG_PRINT("info",("spider loop check param value=%s",
- loop_check->value));
- if (unlikely(strstr(loop_check->value, lex_str.str)))
- {
- *error_num = ER_SPIDER_INFINITE_LOOP_NUM;
- my_printf_error(*error_num, ER_SPIDER_INFINITE_LOOP_STR, MYF(0),
- top_share->db.str, top_share->table_name.str);
- my_afree(loop_check_buf);
- DBUG_RETURN(NULL);
- }
+/**
+ Checks for spider table self-reference
+
+ Get the user variable value (source) and compare it with the user
+ variable name (target). If the target is a substring of the source,
+ then there is a self-reference
+
+ @param thd Connection
+ @param share The table share
+ @retval 0 for success, or else the error number
+*/
+int spider_check_for_self_reference(THD *thd, const TABLE_SHARE *share)
+{
+ String target(0);
+ LEX_CSTRING key;
+ DBUG_ENTER("spider_check_for_self_reference");
+
+ target.append(STRING_WITH_LEN(SPIDER_SQL_LOP_CHK_PRM_PRF_STR));
+ target.append(share->path);
+ DBUG_PRINT("info",("spider loop check param name=%s", target.c_ptr()));
+ key = target.to_lex_cstring();
+ const user_var_entry *loop_check= get_variable(&thd->user_vars, &key, FALSE);
+ if (loop_check && loop_check->type == STRING_RESULT)
+ {
+ String expected(0);
+ expected.append(spider_unique_id);
+ expected.append(share->path);
+ expected.append(STRING_WITH_LEN("-"));
+ DBUG_PRINT("info",("spider loop check expected=%s", expected.c_ptr()));
+ DBUG_PRINT("info",("spider loop check param value=%s",
+ loop_check->value));
+ if (unlikely(strstr(loop_check->value, expected.c_ptr())))
+ {
+ const int error_num = ER_SPIDER_INFINITE_LOOP_NUM;
+ my_printf_error(error_num, ER_SPIDER_INFINITE_LOOP_STR, MYF(0),
+ share->db.str, share->table_name.str);
+ DBUG_RETURN(error_num);
}
- my_afree(loop_check_buf);
}
- pthread_mutex_lock(&spider_tbl_mutex);
- if (!(share = (SPIDER_SHARE*) my_hash_search_using_hash_value(
- &spider_open_tables, hash_value, (uchar*) table_name, length)))
- {
- if (!(share = spider_create_share(
- table_name, table_share,
- table->part_info,
- hash_value,
- error_num
- ))) {
- goto error_alloc_share;
- }
+ DBUG_RETURN(0);
+}
- uint old_elements = spider_open_tables.array.max_element;
- if (my_hash_insert(&spider_open_tables, (uchar*) share))
+/** Populate the init_errors and init of share and/or free it */
+void spider_share_init_error_free(
+ SPIDER_SHARE *share,
+ const bool init,
+ const bool free_share
+)
+{
+ share->init_error= TRUE;
+ share->init_error_time= (time_t) time((time_t *) 0);
+ share->init= TRUE;
+ if (free_share)
+ spider_free_share(share);
+}
+
+void spider_lock_udf_table_mon_mutexes(SPIDER_SHARE *share)
+{
+ pthread_mutex_lock(&share->mutex);
+ for (int roop_count = 0;
+ roop_count < (int) spider_udf_table_mon_mutex_count;
+ roop_count++)
{
- *error_num = HA_ERR_OUT_OF_MEM;
- goto error_hash_insert;
+ if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
+ pthread_mutex_lock(&spider_udf_table_mon_mutexes[roop_count]);
}
- if (spider_open_tables.array.max_element > old_elements)
+}
+
+void spider_unlock_udf_table_mon_mutexes(SPIDER_SHARE *share)
+{
+ for (int roop_count = 0;
+ roop_count < (int) spider_udf_table_mon_mutex_count;
+ roop_count++)
{
- spider_alloc_calc_mem(spider_current_trx,
- spider_open_tables,
- (spider_open_tables.array.max_element - old_elements) *
- spider_open_tables.array.size_of_element);
+ if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
+ pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]);
}
+ pthread_mutex_unlock(&share->mutex);
+}
- spider->share = share;
- spider->conn_link_idx = &tmp_conn_link_idx;
+/**
+ Initialises the link_statuses of a spider share
+
+ Open the spider_tables system table, read the link_statuses and
+ update the spider share, and close the table. Frees share if
+ failure
+
+ @param thd Connection
+ @param share The spider share to populate the link_statuses of
+ @param table_share fixme
+ @param sql_command The sql command of the thread
+ @param error_num The error number
+ @retval true Failure
+ false Success
+*/
+bool spider_share_init_link_statuses(
+ THD *thd,
+ SPIDER_SHARE *share,
+ TABLE_SHARE *table_share,
+ const int sql_command,
+ const bool init_share,
+ int *error_num
+)
+{
+ MEM_ROOT mem_root;
+ bool init_mem_root= FALSE;
+ TABLE *table_tables;
+ SPIDER_Open_tables_backup open_tables_backup;
+ DBUG_ENTER("spider_share_init_link_statuses");
+ /*
+ The link statuses need to be refreshed from the spider_tables table
+ if the operation:
+ - Is not a DROP TABLE on a permanent table; or
+ - Is an ALTER TABLE.
- share->use_count++;
- pthread_mutex_unlock(&spider_tbl_mutex);
+ Note that SHOW CREATE TABLE is not excluded, because the commands
+ that follow it require up-to-date link statuses.
+ */
+ if ((table_share->tmp_table == NO_TMP_TABLE &&
+ sql_command != SQLCOM_DROP_TABLE) ||
+ /* for alter change link status */
+ sql_command == SQLCOM_ALTER_TABLE)
+ {
+ SPD_INIT_ALLOC_ROOT(&mem_root, 4096, 0, MYF(MY_WME));
+ init_mem_root = TRUE;
- if (!share->link_status_init)
+ if (!(table_tables =
+ spider_open_sys_table(thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
+ SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE,
+ &open_tables_backup, error_num)))
{
- pthread_mutex_lock(&share->mutex);
- for (roop_count = 0;
- roop_count < (int) spider_udf_table_mon_mutex_count;
- roop_count++
- ) {
- if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
- pthread_mutex_lock(&spider_udf_table_mon_mutexes[roop_count]);
- }
- if (!share->link_status_init)
+ spider_unlock_udf_table_mon_mutexes(share);
+ spider_share_init_error_free(share, true, true);
+ free_root(&mem_root, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+ if ((*error_num= spider_get_link_statuses(table_tables, share,
+ &mem_root)))
+ {
+ if (*error_num != HA_ERR_KEY_NOT_FOUND &&
+ *error_num != HA_ERR_END_OF_FILE)
{
- /*
- The link statuses need to be refreshed from the spider_tables table
- if the operation:
- - Is not a DROP TABLE on a permanent table; or
- - Is an ALTER TABLE.
-
- Note that SHOW CREATE TABLE is not excluded, because the commands
- that follow it require up-to-date link statuses.
- */
- if ((table_share->tmp_table == NO_TMP_TABLE &&
- sql_command != SQLCOM_DROP_TABLE) ||
- /* for alter change link status */
- sql_command == SQLCOM_ALTER_TABLE)
- {
- SPD_INIT_ALLOC_ROOT(&mem_root, 4096, 0, MYF(MY_WME));
- init_mem_root = TRUE;
-
- if (
- !(table_tables = spider_open_sys_table(
- thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
- SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup,
- error_num))
- ) {
- for (roop_count = 0;
- roop_count < (int) spider_udf_table_mon_mutex_count;
- roop_count++
- ) {
- if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
- pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]);
- }
- pthread_mutex_unlock(&share->mutex);
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- spider_free_share(share);
- goto error_open_sys_table;
- }
- *error_num = spider_get_link_statuses(table_tables, share,
- &mem_root);
- if (*error_num)
- {
- if (
- *error_num != HA_ERR_KEY_NOT_FOUND &&
- *error_num != HA_ERR_END_OF_FILE
- ) {
- for (roop_count = 0;
- roop_count < (int) spider_udf_table_mon_mutex_count;
- roop_count++
- ) {
- if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
- pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]);
- }
- pthread_mutex_unlock(&share->mutex);
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- spider_free_share(share);
- spider_sys_close_table(thd, &open_tables_backup);
- table_tables = NULL;
- goto error_open_sys_table;
- }
- } else {
- memcpy(share->alter_table.tmp_link_statuses, share->link_statuses,
- sizeof(long) * share->all_link_count);
- share->link_status_init = TRUE;
- }
- spider_sys_close_table(thd, &open_tables_backup);
- table_tables = NULL;
- }
- share->have_recovery_link = spider_conn_check_recovery_link(share);
- if (init_mem_root)
- {
- free_root(&mem_root, MYF(0));
- init_mem_root = FALSE;
- }
- }
- for (roop_count = 0;
- roop_count < (int) spider_udf_table_mon_mutex_count;
- roop_count++
- ) {
- if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
- pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]);
+ spider_unlock_udf_table_mon_mutexes(share);
+ spider_share_init_error_free(share, init_share, true);
+ spider_sys_close_table(thd, &open_tables_backup);
+ free_root(&mem_root, MYF(0));
+ DBUG_RETURN(TRUE);
}
- pthread_mutex_unlock(&share->mutex);
- }
-
- semi_table_lock_conn = spider_param_semi_table_lock_connection(thd,
- share->semi_table_lock_conn);
- if (semi_table_lock_conn)
- first_byte = '0' +
- spider_param_semi_table_lock(thd, share->semi_table_lock);
- else
- first_byte = '0';
-
- if (!(spider->wide_handler->trx = spider_get_trx(thd, TRUE, error_num)))
+ } else
{
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- spider_free_share(share);
- goto error_but_no_delete;
+ memcpy(share->alter_table.tmp_link_statuses, share->link_statuses,
+ sizeof(long) * share->all_link_count);
+ share->link_status_init = TRUE;
}
- spider->set_error_mode();
+ spider_sys_close_table(thd, &open_tables_backup);
+ }
+ share->have_recovery_link = spider_conn_check_recovery_link(share);
+
+ if (init_mem_root)
+ free_root(&mem_root, MYF(0));
+ DBUG_RETURN(FALSE);
+}
- if (!share->sts_spider_init)
+/** Creates an `ha_spider` for the sts thread of the spider share. */
+int spider_share_init_sts(
+ const char* table_name,
+ ha_spider *spider,
+ SPIDER_SHARE *share,
+ const bool init_share
+)
+{
+ DBUG_ENTER("spider_share_init_sts");
+ if (int error_num = spider_create_spider_object_for_share(
+ spider->wide_handler->trx, share, &share->sts_spider))
{
- pthread_mutex_lock(&share->mutex);
- if (!share->sts_spider_init)
- {
- if ((*error_num = spider_create_spider_object_for_share(
- spider->wide_handler->trx, share, &share->sts_spider)))
- {
- pthread_mutex_unlock(&share->mutex);
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- spider_free_share(share);
- goto error_sts_spider_init;
- }
- share->sts_thread = &spider_table_sts_threads[
- my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
- spider_param_table_sts_thread_count()];
- share->sts_spider_init = TRUE;
- }
pthread_mutex_unlock(&share->mutex);
+ spider_share_init_error_free(share, init_share, true);
+ DBUG_RETURN(error_num);
}
+ share->sts_thread =
+ &spider_table_sts_threads[my_calc_hash(&spider_open_tables,
+ (uchar *) table_name,
+ (uint) strlen(table_name)) %
+ spider_param_table_sts_thread_count()];
+ share->sts_spider_init = TRUE;
+ DBUG_RETURN(0);
+}
- if (!share->crd_spider_init)
+/** Creates an `ha_spider` for the crd thread of the spider share */
+int spider_share_init_crd(
+ const char* table_name,
+ ha_spider *spider,
+ SPIDER_SHARE *share,
+ const bool init_share
+)
+{
+ DBUG_ENTER("spider_share_init_crd");
+ if (int error_num = spider_create_spider_object_for_share(
+ spider->wide_handler->trx, share, &share->crd_spider))
{
- pthread_mutex_lock(&share->mutex);
- if (!share->crd_spider_init)
- {
- if ((*error_num = spider_create_spider_object_for_share(
- spider->wide_handler->trx, share, &share->crd_spider)))
- {
- pthread_mutex_unlock(&share->mutex);
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- spider_free_share(share);
- goto error_crd_spider_init;
- }
- share->crd_thread = &spider_table_crd_threads[
- my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
- spider_param_table_crd_thread_count()];
- share->crd_spider_init = TRUE;
- }
pthread_mutex_unlock(&share->mutex);
+ spider_share_init_error_free(share, init_share, true);
+ DBUG_RETURN(error_num);
}
+ share->crd_thread =
+ &spider_table_crd_threads[my_calc_hash(&spider_open_tables,
+ (uchar *) table_name,
+ (uint) strlen(table_name)) %
+ spider_param_table_crd_thread_count()];
+ share->crd_spider_init = TRUE;
+ DBUG_RETURN(0);
+}
- if (
- sql_command != SQLCOM_DROP_TABLE &&
- sql_command != SQLCOM_ALTER_TABLE &&
- sql_command != SQLCOM_SHOW_CREATE &&
- (*error_num = spider_create_mon_threads(spider->wide_handler->trx,
- share))
- ) {
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- spider_free_share(share);
- goto error_but_no_delete;
- }
-
- if (!(spider->conn_keys = (char **)
- spider_bulk_alloc_mem(spider_current_trx, 47,
- __func__, __FILE__, __LINE__, MYF(MY_WME | MY_ZEROFILL),
- &spider->conn_keys, sizeof(char *) * share->link_count,
- &tmp_name, sizeof(char) * share->conn_keys_charlen,
- &spider->conns, sizeof(SPIDER_CONN *) * share->link_count,
- &spider->conn_link_idx, sizeof(uint) * share->link_count,
- &spider->conn_can_fo, sizeof(uchar) * share->link_bitmap_size,
- &spider->connection_ids, sizeof(ulonglong) * share->link_count,
- &spider->db_request_id, sizeof(ulonglong) * share->link_count,
- &spider->db_request_phase, sizeof(uchar) * share->link_bitmap_size,
- &spider->need_mons, sizeof(int) * share->link_count,
- &spider->quick_targets, sizeof(void *) * share->link_count,
- &result_list->upd_tmp_tbls, sizeof(TABLE *) * share->link_count,
- &result_list->upd_tmp_tbl_prms,
- sizeof(TMP_TABLE_PARAM) * share->link_count,
- &result_list->tmp_table_join_first,
- sizeof(uchar) * share->link_bitmap_size,
- &result_list->tmp_table_created,
- sizeof(uchar) * share->link_bitmap_size,
- &result_list->casual_read, sizeof(int) * share->link_count,
- &spider->dbton_handler,
- sizeof(spider_db_handler *) * SPIDER_DBTON_SIZE,
- NullS))
- ) {
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- spider_free_share(share);
- goto error_but_no_delete;
- }
- memcpy(tmp_name, share->conn_keys[0], share->conn_keys_charlen);
+void *spider_share_malloc_for_spider(
+ ha_spider *spider,
+ SPIDER_SHARE *share,
+ const uint id,
+ char** tmp_name,
+ SPIDER_RESULT_LIST* result_list
+)
+{
+ return spider_bulk_malloc(
+ spider_current_trx, id, MYF(MY_WME | MY_ZEROFILL),
+ &spider->conn_keys, sizeof(char *) * share->link_count,
+ tmp_name, sizeof(char) * share->conn_keys_charlen,
+ &spider->conns, sizeof(SPIDER_CONN *) * share->link_count,
+ &spider->conn_link_idx, sizeof(uint) * share->link_count,
+ &spider->conn_can_fo, sizeof(uchar) * share->link_bitmap_size,
+ &spider->connection_ids, sizeof(ulonglong) * share->link_count,
+ &spider->db_request_id, sizeof(ulonglong) * share->link_count,
+ &spider->db_request_phase, sizeof(uchar) * share->link_bitmap_size,
+ &spider->need_mons, sizeof(int) * share->link_count,
+ &spider->quick_targets, sizeof(void *) * share->link_count,
+ &result_list->upd_tmp_tbls, sizeof(TABLE *) * share->link_count,
+ &result_list->upd_tmp_tbl_prms,
+ sizeof(TMP_TABLE_PARAM) * share->link_count,
+ &result_list->tmp_table_join_first,
+ sizeof(uchar) * share->link_bitmap_size,
+ &result_list->tmp_table_created,
+ sizeof(uchar) * share->link_bitmap_size,
+ &result_list->casual_read, sizeof(int) * share->link_count,
+ &spider->dbton_handler,
+ sizeof(spider_db_handler *) * SPIDER_DBTON_SIZE,
+ NullS);
+}
- spider->conn_keys_first_ptr = tmp_name;
- for (roop_count = 0; roop_count < (int) share->link_count; roop_count++)
+/**
+ Initialise dbton_handlers of a spider.
+*/
+int spider_share_init_spider_dbton_handlers(ha_spider *spider, SPIDER_SHARE *share)
+{
+ int roop_count, error_num= 0;
+ for (roop_count = 0; roop_count < (int) share->use_dbton_count;
+ roop_count++)
+ {
+ uint dbton_id = share->use_dbton_ids[roop_count];
+ if (!(spider->dbton_handler[dbton_id]=
+ spider_dbton[dbton_id].create_db_handler(spider,
+ share->dbton_share[dbton_id])))
{
- spider->conn_keys[roop_count] = tmp_name;
- *tmp_name = first_byte;
- tmp_name += share->conn_keys_lengths[roop_count] + 1;
- result_list->upd_tmp_tbl_prms[roop_count].init();
- result_list->upd_tmp_tbl_prms[roop_count].field_count = 1;
+ error_num = HA_ERR_OUT_OF_MEM;
+ break;
}
- spider_trx_set_link_idx_for_all(spider);
-
- for (roop_count = 0; roop_count < (int) share->use_dbton_count;
- roop_count++)
+ if ((error_num = spider->dbton_handler[dbton_id]->init()))
+ break;
+ }
+ /* Failure: rollback */
+ if (roop_count < (int) share->use_dbton_count)
+ {
+ for (; roop_count >= 0; roop_count--)
{
uint dbton_id = share->use_dbton_ids[roop_count];
- if (!(spider->dbton_handler[dbton_id] =
- spider_dbton[dbton_id].create_db_handler(spider,
- share->dbton_share[dbton_id])))
+ if (spider->dbton_handler[dbton_id])
{
- *error_num = HA_ERR_OUT_OF_MEM;
- break;
- }
- if ((*error_num = spider->dbton_handler[dbton_id]->init()))
- {
- break;
+ delete spider->dbton_handler[dbton_id];
+ spider->dbton_handler[dbton_id]= NULL;
}
}
- if (roop_count < (int) share->use_dbton_count)
- {
- for (; roop_count >= 0; roop_count--)
+ }
+ return error_num;
+}
+
+/** Gets or creates connections to all active servers */
+bool spider_share_get_conns(ha_spider *spider, SPIDER_SHARE *share,
+ int *error_num)
+{
+ DBUG_ENTER("spider_share_get_conns");
+ for (int roop_count = spider_conn_link_idx_next(
+ share->link_statuses, spider->conn_link_idx, -1,
+ share->link_count, SPIDER_LINK_STATUS_RECOVERY);
+ roop_count < (int) share->link_count;
+ roop_count = spider_conn_link_idx_next(
+ share->link_statuses, spider->conn_link_idx, roop_count,
+ share->link_count, SPIDER_LINK_STATUS_RECOVERY))
+ {
+ if (!(spider->conns[roop_count] =
+ spider_get_conn(share, roop_count, spider->conn_keys[roop_count],
+ spider->wide_handler->trx, spider, FALSE, TRUE,
+ error_num)))
+ {
+ if (share->monitoring_kind[roop_count] && spider->need_mons[roop_count])
{
- uint dbton_id = share->use_dbton_ids[roop_count];
- if (spider->dbton_handler[dbton_id])
- {
- delete spider->dbton_handler[dbton_id];
- spider->dbton_handler[dbton_id] = NULL;
- }
+ *error_num = spider_ping_table_mon_from_table(
+ spider->wide_handler->trx,
+ spider->wide_handler->trx->thd,
+ share,
+ roop_count,
+ (uint32) share->monitoring_sid[roop_count],
+ share->table_name,
+ share->table_name_length,
+ spider->conn_link_idx[roop_count],
+ NULL,
+ 0,
+ share->monitoring_kind[roop_count],
+ share->monitoring_limit[roop_count],
+ share->monitoring_flag[roop_count],
+ FALSE
+ );
}
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- goto error_after_alloc_conn_keys;
+ DBUG_RETURN(TRUE);
}
+ spider->conns[roop_count]->error_mode &= spider->error_mode;
+ }
+ DBUG_RETURN(FALSE);
+}
- if (
- sql_command != SQLCOM_DROP_TABLE &&
- sql_command != SQLCOM_ALTER_TABLE &&
- sql_command != SQLCOM_SHOW_CREATE
- ) {
- for (
- roop_count = spider_conn_link_idx_next(share->link_statuses,
- spider->conn_link_idx, -1, share->link_count,
- SPIDER_LINK_STATUS_RECOVERY);
- roop_count < (int) share->link_count;
- roop_count = spider_conn_link_idx_next(share->link_statuses,
- spider->conn_link_idx, roop_count, share->link_count,
- SPIDER_LINK_STATUS_RECOVERY)
- ) {
- if (
- !(spider->conns[roop_count] =
- spider_get_conn(share, roop_count, spider->conn_keys[roop_count],
- spider->wide_handler->trx, spider, FALSE, TRUE,
- error_num))
- ) {
- if (
- share->monitoring_kind[roop_count] &&
- spider->need_mons[roop_count]
- ) {
- *error_num = spider_ping_table_mon_from_table(
- spider->wide_handler->trx,
- spider->wide_handler->trx->thd,
- share,
- roop_count,
- (uint32) share->monitoring_sid[roop_count],
- share->table_name,
- share->table_name_length,
- spider->conn_link_idx[roop_count],
- NULL,
- 0,
- share->monitoring_kind[roop_count],
- share->monitoring_limit[roop_count],
- share->monitoring_flag[roop_count],
- FALSE
- );
- }
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- goto error_after_alloc_dbton_handler;
- }
- spider->conns[roop_count]->error_mode &= spider->error_mode;
- }
- }
- search_link_idx = spider_conn_first_link_idx(thd,
- share->link_statuses, share->access_balances, spider->conn_link_idx,
- share->link_count, SPIDER_LINK_STATUS_OK);
- if (search_link_idx == -1)
+/**
+ Handles a failed search for usable servers
+
+ @param share The spider share to update its init error
+ @param table_share The table share
+ @param search_result The search result, either -1 (no usable server) or
+ -2 (out of memory)
+ @return Error code associated with the failure
+*/
+int spider_share_handle_search_link_failure(
+ SPIDER_SHARE* share,
+ TABLE_SHARE* table_share,
+ const int search_result,
+ const bool init_share
+)
+{
+ DBUG_ENTER("spider_share_handle_search_link_failure");
+ if (likely(search_result == -1)) /* No available servers. */
+ {
+ char *db = (char *) my_alloca(
+ table_share->db.length + 1 + table_share->table_name.length + 1);
+ if (unlikely(!db))
{
- char *db = (char *) my_alloca(
- table_share->db.length + 1 + table_share->table_name.length + 1);
- if (!db)
- {
- *error_num = HA_ERR_OUT_OF_MEM;
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- goto error_after_alloc_dbton_handler;
- }
- char *table_name = db + table_share->db.length + 1;
- memcpy(db, table_share->db.str, table_share->db.length);
- db[table_share->db.length] = '\0';
- memcpy(table_name, table_share->table_name.str,
- table_share->table_name.length);
- table_name[table_share->table_name.length] = '\0';
- my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM,
- ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name);
- my_afree(db);
- *error_num = ER_SPIDER_ALL_LINKS_FAILED_NUM;
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- goto error_after_alloc_dbton_handler;
- } else if (search_link_idx == -2)
+ spider_share_init_error_free(share, init_share, false);
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
+ }
+ char *table_name = db + table_share->db.length + 1;
+ memcpy(db, table_share->db.str, table_share->db.length);
+ db[table_share->db.length] = '\0';
+ memcpy(table_name, table_share->table_name.str,
+ table_share->table_name.length);
+ table_name[table_share->table_name.length] = '\0';
+ my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM,
+ ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name);
+ my_afree(db);
+ spider_share_init_error_free(share, init_share, false);
+ DBUG_RETURN(ER_SPIDER_ALL_LINKS_FAILED_NUM);
+ }
+ spider_share_init_error_free(share, init_share, false);
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
+}
+
+/** Gets sts and crd for spider_init_share() */
+bool spider_share_get_sts_crd(
+ THD *thd,
+ ha_spider *spider,
+ SPIDER_SHARE *share,
+ TABLE *table,
+ const bool init_share,
+ /* fixme: do we need this? */
+ const bool has_lock,
+ int *error_num
+)
+{
+ const bool same_server_link = spider_param_same_server_link(thd);
+ const int load_sts_at_startup =
+ spider_param_load_sts_at_startup(share->load_sts_at_startup);
+ const int load_crd_at_startup =
+ spider_param_load_crd_at_startup(share->load_crd_at_startup);
+ DBUG_ENTER("spider_share_get_sts_crd");
+ if (!spider->error_mode &&
+ (!same_server_link || load_sts_at_startup || load_crd_at_startup))
+ {
+ const double sts_interval = spider_param_sts_interval(thd, share->sts_interval);
+ const int sts_mode = spider_param_sts_mode(thd, share->sts_mode);
+ const int auto_increment_mode = spider_param_auto_increment_mode(
+ thd, share->auto_increment_mode);
+ const int sts_sync = auto_increment_mode == 1 ? 0 :
+ spider_param_sts_sync(thd, share->sts_sync);
+ const double crd_interval = spider_param_crd_interval(thd, share->crd_interval);
+ int crd_mode = spider_param_crd_mode(thd, share->crd_mode);
+ /* TODO(MDEV-27996): Delete spider_crd_mode and spider_sts_mode */
+ if (crd_mode == 3)
+ crd_mode = 1;
+ const int crd_sync = spider_param_crd_sync(thd, share->crd_sync);
+
+ const time_t tmp_time = (time_t) time((time_t*) 0);
+ if (!has_lock)
{
- *error_num = HA_ERR_OUT_OF_MEM;
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- goto error_after_alloc_dbton_handler;
- }
- spider->search_link_idx = search_link_idx;
-
- same_server_link = spider_param_same_server_link(thd);
- load_sts_at_startup =
- spider_param_load_sts_at_startup(share->load_sts_at_startup);
- load_crd_at_startup =
- spider_param_load_crd_at_startup(share->load_crd_at_startup);
- if (
- sql_command != SQLCOM_DROP_TABLE &&
- sql_command != SQLCOM_ALTER_TABLE &&
- sql_command != SQLCOM_SHOW_CREATE &&
- !spider->error_mode &&
- (
- !same_server_link ||
- load_sts_at_startup ||
- load_crd_at_startup
- )
- ) {
- SPIDER_INIT_ERROR_TABLE *spider_init_error_table;
- sts_interval = spider_param_sts_interval(thd, share->sts_interval);
- sts_mode = spider_param_sts_mode(thd, share->sts_mode);
- sts_sync = spider_param_sts_sync(thd, share->sts_sync);
- auto_increment_mode = spider_param_auto_increment_mode(thd,
- share->auto_increment_mode);
- if (auto_increment_mode == 1)
- sts_sync = 0;
- crd_interval = spider_param_crd_interval(thd, share->crd_interval);
- crd_mode = spider_param_crd_mode(thd, share->crd_mode);
- if (crd_mode == 3)
- crd_mode = 1;
- crd_sync = spider_param_crd_sync(thd, share->crd_sync);
- time_t tmp_time = (time_t) time((time_t*) 0);
pthread_mutex_lock(&share->sts_mutex);
pthread_mutex_lock(&share->crd_mutex);
- if ((spider_init_error_table =
- spider_get_init_error_table(spider->wide_handler->trx, share, FALSE)))
- {
- DBUG_PRINT("info",("spider diff1=%f",
- difftime(tmp_time, spider_init_error_table->init_error_time)));
- if (difftime(tmp_time,
- spider_init_error_table->init_error_time) <
- spider_param_table_init_error_interval())
- {
- *error_num = spider_init_error_table->init_error;
- if (spider_init_error_table->init_error_with_message)
- my_message(spider_init_error_table->init_error,
- spider_init_error_table->init_error_msg, MYF(0));
- share->init_error = TRUE;
- share->init = TRUE;
- pthread_mutex_unlock(&share->crd_mutex);
- pthread_mutex_unlock(&share->sts_mutex);
- goto error_after_alloc_dbton_handler;
- }
- }
-
- if (
- (
- !same_server_link ||
- load_sts_at_startup
- ) &&
- (*error_num = spider_get_sts(share, spider->search_link_idx, tmp_time,
- spider, sts_interval, sts_mode,
- sts_sync,
- 1, HA_STATUS_VARIABLE | HA_STATUS_CONST | HA_STATUS_AUTO))
- ) {
- if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM)
- {
- thd->clear_error();
- } else {
- pthread_mutex_unlock(&share->crd_mutex);
- pthread_mutex_unlock(&share->sts_mutex);
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- goto error_after_alloc_dbton_handler;
- }
- }
- if (
- (
- !same_server_link ||
- load_crd_at_startup
- ) &&
- (*error_num = spider_get_crd(share, spider->search_link_idx, tmp_time,
- spider, table, crd_interval, crd_mode,
- crd_sync,
- 1))
- ) {
- if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM)
- {
- thd->clear_error();
- } else {
- pthread_mutex_unlock(&share->crd_mutex);
- pthread_mutex_unlock(&share->sts_mutex);
- share->init_error = TRUE;
- share->init_error_time = (time_t) time((time_t*) 0);
- share->init = TRUE;
- goto error_after_alloc_dbton_handler;
- }
- }
- pthread_mutex_unlock(&share->crd_mutex);
- pthread_mutex_unlock(&share->sts_mutex);
}
-
- share->init = TRUE;
- } else {
- share->use_count++;
- pthread_mutex_unlock(&spider_tbl_mutex);
-
- int sleep_cnt = 0;
- while (!share->init)
+ /* If not enough time has passed since the last init error, abort */
+ if (const SPIDER_INIT_ERROR_TABLE *spider_init_error_table =
+ spider_get_init_error_table(spider->wide_handler->trx, share, FALSE))
{
- // avoid for dead loop
- if (sleep_cnt++ > 1000)
+ DBUG_PRINT("info",("spider diff1=%f",
+ difftime(tmp_time, spider_init_error_table->init_error_time)));
+ if (difftime(tmp_time,
+ spider_init_error_table->init_error_time) <
+ spider_param_table_init_error_interval())
{
- fprintf(stderr, " [WARN SPIDER RESULT] "
- "Wait share->init too long, table_name %s %s %ld\n",
- share->table_name, share->tgt_hosts[0], share->tgt_ports[0]);
- *error_num = ER_SPIDER_TABLE_OPEN_TIMEOUT_NUM;
- my_printf_error(ER_SPIDER_TABLE_OPEN_TIMEOUT_NUM,
- ER_SPIDER_TABLE_OPEN_TIMEOUT_STR, MYF(0),
- table_share->db.str, table_share->table_name.str);
- spider_free_share(share);
- goto error_but_no_delete;
+ *error_num = spider_init_error_table->init_error;
+ if (spider_init_error_table->init_error_with_message)
+ my_message(spider_init_error_table->init_error,
+ spider_init_error_table->init_error_msg, MYF(0));
+ spider_share_init_error_free(share, init_share, false);
+ pthread_mutex_unlock(&share->crd_mutex);
+ pthread_mutex_unlock(&share->sts_mutex);
+ DBUG_RETURN(TRUE);
}
- my_sleep(10000); // wait 10 ms
}
- if (!share->link_status_init)
+ if ((!same_server_link || load_sts_at_startup) &&
+ (*error_num = spider_get_sts(share, spider->search_link_idx, tmp_time,
+ spider, sts_interval, sts_mode, sts_sync,
+ 1, HA_STATUS_VARIABLE | HA_STATUS_CONST | HA_STATUS_AUTO))
+ )
{
- pthread_mutex_lock(&share->mutex);
- for (roop_count = 0;
- roop_count < (int) spider_udf_table_mon_mutex_count;
- roop_count++
- ) {
- if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
- pthread_mutex_lock(&spider_udf_table_mon_mutexes[roop_count]);
- }
- if (!share->link_status_init)
+ if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM &&
+ *error_num != ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_NUM)
+ thd->clear_error();
+ else
{
- DBUG_ASSERT(!table_tables);
- /*
- The link statuses need to be refreshed from the spider_tables table
- if the operation:
- - Is not a DROP TABLE on a permanent table; or
- - Is an ALTER TABLE.
-
- Note that SHOW CREATE TABLE is not excluded, because the commands
- that follow it require up-to-date link statuses.
- */
- if ((table_share->tmp_table == NO_TMP_TABLE &&
- sql_command != SQLCOM_DROP_TABLE) ||
- /* for alter change link status */
- sql_command == SQLCOM_ALTER_TABLE)
- {
- SPD_INIT_ALLOC_ROOT(&mem_root, 4096, 0, MYF(MY_WME));
- init_mem_root = TRUE;
-
- if (
- !(table_tables = spider_open_sys_table(
- thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
- SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup,
- error_num))
- ) {
- for (roop_count = 0;
- roop_count < (int) spider_udf_table_mon_mutex_count;
- roop_count++
- ) {
- if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
- pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]);
- }
- pthread_mutex_unlock(&share->mutex);
- spider_free_share(share);
- goto error_open_sys_table;
- }
- *error_num = spider_get_link_statuses(table_tables, share,
- &mem_root);
- if (*error_num)
- {
- if (
- *error_num != HA_ERR_KEY_NOT_FOUND &&
- *error_num != HA_ERR_END_OF_FILE
- ) {
- for (roop_count = 0;
- roop_count < (int) spider_udf_table_mon_mutex_count;
- roop_count++
- ) {
- if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
- pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]);
- }
- pthread_mutex_unlock(&share->mutex);
- spider_free_share(share);
- spider_sys_close_table(thd, &open_tables_backup);
- table_tables = NULL;
- goto error_open_sys_table;
- }
- } else {
- memcpy(share->alter_table.tmp_link_statuses, share->link_statuses,
- sizeof(long) * share->all_link_count);
- share->link_status_init = TRUE;
- }
- spider_sys_close_table(thd, &open_tables_backup);
- table_tables = NULL;
- }
- share->have_recovery_link = spider_conn_check_recovery_link(share);
- if (init_mem_root)
- {
- free_root(&mem_root, MYF(0));
- init_mem_root = FALSE;
- }
- }
- for (roop_count = 0;
- roop_count < (int) spider_udf_table_mon_mutex_count;
- roop_count++
- ) {
- if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
- pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]);
+ pthread_mutex_unlock(&share->crd_mutex);
+ pthread_mutex_unlock(&share->sts_mutex);
+ spider_share_init_error_free(share, init_share, false);
+ DBUG_RETURN(TRUE);
}
- pthread_mutex_unlock(&share->mutex);
}
- semi_table_lock_conn = spider_param_semi_table_lock_connection(thd,
- share->semi_table_lock_conn);
- if (semi_table_lock_conn)
- first_byte = '0' +
- spider_param_semi_table_lock(thd, share->semi_table_lock);
- else
- first_byte = '0';
-
- spider->share = share;
- if (!(spider->wide_handler->trx = spider_get_trx(thd, TRUE, error_num)))
- {
- spider_free_share(share);
- goto error_but_no_delete;
- }
- spider->set_error_mode();
-
- if (!share->sts_spider_init)
+ if ((!same_server_link || load_crd_at_startup) &&
+ (*error_num = spider_get_crd(share, spider->search_link_idx, tmp_time,
+ spider, table, crd_interval, crd_mode,
+ crd_sync,
+ 1)))
{
- pthread_mutex_lock(&share->mutex);
- if (!share->sts_spider_init)
+ if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM &&
+ *error_num != ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_NUM)
+ thd->clear_error();
+ else
{
- if ((*error_num = spider_create_spider_object_for_share(
- spider->wide_handler->trx, share, &share->sts_spider)))
- {
- pthread_mutex_unlock(&share->mutex);
- spider_free_share(share);
- goto error_sts_spider_init;
- }
- share->sts_thread = &spider_table_sts_threads[
- my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
- spider_param_table_sts_thread_count()];
- share->sts_spider_init = TRUE;
+ pthread_mutex_unlock(&share->crd_mutex);
+ pthread_mutex_unlock(&share->sts_mutex);
+ spider_share_init_error_free(share, init_share, false);
+ DBUG_RETURN(TRUE);
}
- pthread_mutex_unlock(&share->mutex);
}
-
- if (!share->crd_spider_init)
+ if (!has_lock)
{
- pthread_mutex_lock(&share->mutex);
- if (!share->crd_spider_init)
- {
- if ((*error_num = spider_create_spider_object_for_share(
- spider->wide_handler->trx, share, &share->crd_spider)))
- {
- pthread_mutex_unlock(&share->mutex);
- spider_free_share(share);
- goto error_crd_spider_init;
- }
- share->crd_thread = &spider_table_crd_threads[
- my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
- spider_param_table_crd_thread_count()];
- share->crd_spider_init = TRUE;
- }
- pthread_mutex_unlock(&share->mutex);
+ pthread_mutex_unlock(&share->crd_mutex);
+ pthread_mutex_unlock(&share->sts_mutex);
}
+ }
+ DBUG_RETURN(FALSE);
+}
- if (
- sql_command != SQLCOM_DROP_TABLE &&
- sql_command != SQLCOM_ALTER_TABLE &&
- sql_command != SQLCOM_SHOW_CREATE &&
+/** Initialises a `SPIDER_SHARE` */
+bool spider_init_share(
+ const char *table_name,
+ TABLE *table,
+ THD *thd,
+ ha_spider *spider,
+ int *error_num,
+ SPIDER_SHARE *share,
+ TABLE_SHARE *table_share,
+ const bool new_share
+)
+{
+ char first_byte;
+ char *tmp_name;
+ SPIDER_RESULT_LIST *result_list = &spider->result_list;
+ int search_link_idx;
+ const uint sql_command = thd_sql_command(thd);
+ const bool continue_with_sql_command =
+ sql_command != SQLCOM_DROP_TABLE &&
+ sql_command != SQLCOM_ALTER_TABLE &&
+ sql_command != SQLCOM_SHOW_CREATE;
+ DBUG_ENTER("spider_init_share");
+ if (!share->link_status_init)
+ {
+ spider_lock_udf_table_mon_mutexes(share);
+ if (!share->link_status_init &&
+ spider_share_init_link_statuses(thd, share, table_share,
+ sql_command, new_share, error_num))
+ DBUG_RETURN(TRUE);
+ spider_unlock_udf_table_mon_mutexes(share);
+ }
+
+ const int semi_table_lock_conn =
+ spider_param_semi_table_lock_connection(thd, share->semi_table_lock_conn);
+ if (semi_table_lock_conn)
+ first_byte = '0' +
+ spider_param_semi_table_lock(thd, share->semi_table_lock);
+ else
+ first_byte = '0';
+
+ if (!(spider->wide_handler->trx = spider_get_trx(thd, TRUE, error_num)))
+ {
+ spider_share_init_error_free(share, new_share, true);
+ DBUG_RETURN(TRUE);
+ }
+ spider->set_error_mode();
+
+ /* There's no other place doing anything that
+ `spider_share_init_sts()` does or updating
+ `st_spider_share::sts_spider_init`, therefore there's no need to
+ lock/unlock. Same goes for crd */
+ if (!share->sts_spider_init &&
+ (*error_num= spider_share_init_sts(table_name, spider, share, new_share)))
+ DBUG_RETURN(TRUE);
+
+ if (!share->crd_spider_init &&
+ (*error_num= spider_share_init_crd(table_name, spider, share, new_share)))
+ DBUG_RETURN(TRUE);
+
+ if (continue_with_sql_command &&
(*error_num = spider_create_mon_threads(spider->wide_handler->trx,
- share))
- ) {
- spider_free_share(share);
- goto error_but_no_delete;
- }
-
- if (!(spider->conn_keys = (char **)
- spider_bulk_alloc_mem(spider_current_trx, 49,
- __func__, __FILE__, __LINE__, MYF(MY_WME | MY_ZEROFILL),
- &spider->conn_keys, sizeof(char *) * share->link_count,
- &tmp_name, sizeof(char) * share->conn_keys_charlen,
- &spider->conns, sizeof(SPIDER_CONN *) * share->link_count,
- &spider->conn_link_idx, sizeof(uint) * share->link_count,
- &spider->conn_can_fo, sizeof(uchar) * share->link_bitmap_size,
- &spider->connection_ids, sizeof(ulonglong) * share->link_count,
- &spider->db_request_id, sizeof(ulonglong) * share->link_count,
- &spider->db_request_phase, sizeof(uchar) * share->link_bitmap_size,
- &spider->need_mons, sizeof(int) * share->link_count,
- &spider->quick_targets, sizeof(void *) * share->link_count,
- &result_list->upd_tmp_tbls, sizeof(TABLE *) * share->link_count,
- &result_list->upd_tmp_tbl_prms,
- sizeof(TMP_TABLE_PARAM) * share->link_count,
- &result_list->tmp_table_join_first,
- sizeof(uchar) * share->link_bitmap_size,
- &result_list->tmp_table_created,
- sizeof(uchar) * share->link_bitmap_size,
- &result_list->casual_read, sizeof(int) * share->link_count,
- &spider->dbton_handler,
- sizeof(spider_db_handler *) * SPIDER_DBTON_SIZE,
- NullS))
- ) {
- spider_free_share(share);
- goto error_but_no_delete;
- }
- memcpy(tmp_name, share->conn_keys[0], share->conn_keys_charlen);
+ share)))
+ {
+ spider_share_init_error_free(share, new_share, true);
+ DBUG_RETURN(TRUE);
+ }
- spider->conn_keys_first_ptr = tmp_name;
- for (roop_count = 0; roop_count < (int) share->link_count; roop_count++)
- {
- spider->conn_keys[roop_count] = tmp_name;
- *tmp_name = first_byte;
- tmp_name += share->conn_keys_lengths[roop_count] + 1;
- result_list->upd_tmp_tbl_prms[roop_count].init();
- result_list->upd_tmp_tbl_prms[roop_count].field_count = 1;
- }
- spider_trx_set_link_idx_for_all(spider);
+ if (!(spider_share_malloc_for_spider(spider, share, 47, &tmp_name,
+ result_list)))
+ {
+ spider_share_init_error_free(share, new_share, true);
+ DBUG_RETURN(TRUE);
+ }
+ memcpy(tmp_name, share->conn_keys[0], share->conn_keys_charlen);
- for (roop_count = 0; roop_count < (int) share->use_dbton_count;
- roop_count++)
- {
- uint dbton_id = share->use_dbton_ids[roop_count];
- if (!(spider->dbton_handler[dbton_id] =
- spider_dbton[dbton_id].create_db_handler(spider,
- share->dbton_share[dbton_id])))
- {
- *error_num = HA_ERR_OUT_OF_MEM;
- break;
- }
- if ((*error_num = spider->dbton_handler[dbton_id]->init()))
- {
- break;
- }
- }
- if (roop_count < (int) share->use_dbton_count)
- {
- for (; roop_count >= 0; roop_count--)
- {
- uint dbton_id = share->use_dbton_ids[roop_count];
- if (spider->dbton_handler[dbton_id])
- {
- delete spider->dbton_handler[dbton_id];
- spider->dbton_handler[dbton_id] = NULL;
- }
- }
- goto error_after_alloc_conn_keys;
- }
+ spider->conn_keys_first_ptr = tmp_name;
+ for (int link_idx = 0; link_idx < (int) share->link_count; link_idx++)
+ {
+ spider->conn_keys[link_idx] = tmp_name;
+ *tmp_name = first_byte;
+ tmp_name += share->conn_keys_lengths[link_idx] + 1;
+ result_list->upd_tmp_tbl_prms[link_idx].init();
+ result_list->upd_tmp_tbl_prms[link_idx].field_count = 1;
+ }
+ spider_trx_set_link_idx_for_all(spider);
- if (
- sql_command != SQLCOM_DROP_TABLE &&
- sql_command != SQLCOM_ALTER_TABLE &&
- sql_command != SQLCOM_SHOW_CREATE
- ) {
- for (
- roop_count = spider_conn_link_idx_next(share->link_statuses,
- spider->conn_link_idx, -1, share->link_count,
- SPIDER_LINK_STATUS_RECOVERY);
- roop_count < (int) share->link_count;
- roop_count = spider_conn_link_idx_next(share->link_statuses,
- spider->conn_link_idx, roop_count, share->link_count,
- SPIDER_LINK_STATUS_RECOVERY)
- ) {
- if (
- !(spider->conns[roop_count] =
- spider_get_conn(share, roop_count, spider->conn_keys[roop_count],
- spider->wide_handler->trx, spider, FALSE, TRUE,
- error_num))
- ) {
- if (
- share->monitoring_kind[roop_count] &&
- spider->need_mons[roop_count]
- ) {
- *error_num = spider_ping_table_mon_from_table(
- spider->wide_handler->trx,
- spider->wide_handler->trx->thd,
- share,
- roop_count,
- (uint32) share->monitoring_sid[roop_count],
- share->table_name,
- share->table_name_length,
- spider->conn_link_idx[roop_count],
- NULL,
- 0,
- share->monitoring_kind[roop_count],
- share->monitoring_limit[roop_count],
- share->monitoring_flag[roop_count],
- FALSE
- );
- }
- goto error_after_alloc_dbton_handler;
- }
- spider->conns[roop_count]->error_mode &= spider->error_mode;
- }
- }
- search_link_idx = spider_conn_first_link_idx(thd,
- share->link_statuses, share->access_balances, spider->conn_link_idx,
- share->link_count, SPIDER_LINK_STATUS_OK);
- if (search_link_idx == -1)
+ if ((*error_num= spider_share_init_spider_dbton_handlers(spider, share)))
+ {
+ spider_share_init_error_free(share, new_share, false);
+ goto error_after_alloc_conn_keys;
+ }
+
+ if (continue_with_sql_command &&
+ spider_share_get_conns(spider, share, error_num))
+ {
+ spider_share_init_error_free(share, new_share, false);
+ goto error_after_alloc_dbton_handler;
+ }
+
+ search_link_idx =
+ spider_conn_first_link_idx(thd, share->link_statuses,
+ share->access_balances,
+ spider->conn_link_idx, share->link_count,
+ SPIDER_LINK_STATUS_OK);
+ if (search_link_idx < 0)
+ {
+ *error_num= spider_share_handle_search_link_failure(
+ share, table_share, search_link_idx, new_share);
+ goto error_after_alloc_dbton_handler;
+ }
+ spider->search_link_idx= search_link_idx;
+
+ if (continue_with_sql_command)
+ {
+ if (new_share)
{
- char *db = (char *) my_alloca(
- table_share->db.length + 1 + table_share->table_name.length + 1);
- if (!db)
- {
- *error_num = HA_ERR_OUT_OF_MEM;
+ if (spider_share_get_sts_crd(thd, spider, share, table, true, false,
+ error_num))
goto error_after_alloc_dbton_handler;
- }
- char *table_name = db + table_share->db.length + 1;
- memcpy(db, table_share->db.str, table_share->db.length);
- db[table_share->db.length] = '\0';
- memcpy(table_name, table_share->table_name.str,
- table_share->table_name.length);
- table_name[table_share->table_name.length] = '\0';
- my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM,
- ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name);
- my_afree(db);
- *error_num = ER_SPIDER_ALL_LINKS_FAILED_NUM;
- goto error_after_alloc_dbton_handler;
- } else if (search_link_idx == -2)
- {
- *error_num = HA_ERR_OUT_OF_MEM;
- goto error_after_alloc_dbton_handler;
- }
- spider->search_link_idx = search_link_idx;
-
- if (share->init_error)
+ } else if (share->init_error)
{
+ /* fixme: can we move the locking and unlocking into
+ spider_share_get_sts_crd()? */
pthread_mutex_lock(&share->sts_mutex);
pthread_mutex_lock(&share->crd_mutex);
if (share->init_error)
{
- same_server_link = spider_param_same_server_link(thd);
- load_sts_at_startup =
- spider_param_load_sts_at_startup(share->load_sts_at_startup);
- load_crd_at_startup =
- spider_param_load_crd_at_startup(share->load_crd_at_startup);
- if (
- sql_command != SQLCOM_DROP_TABLE &&
- sql_command != SQLCOM_ALTER_TABLE &&
- sql_command != SQLCOM_SHOW_CREATE &&
- !spider->error_mode &&
- (
- !same_server_link ||
- load_sts_at_startup ||
- load_crd_at_startup
- )
- ) {
- SPIDER_INIT_ERROR_TABLE *spider_init_error_table;
- sts_interval = spider_param_sts_interval(thd, share->sts_interval);
- sts_mode = spider_param_sts_mode(thd, share->sts_mode);
- sts_sync = spider_param_sts_sync(thd, share->sts_sync);
- auto_increment_mode = spider_param_auto_increment_mode(thd,
- share->auto_increment_mode);
- if (auto_increment_mode == 1)
- sts_sync = 0;
- crd_interval = spider_param_crd_interval(thd, share->crd_interval);
- crd_mode = spider_param_crd_mode(thd, share->crd_mode);
- if (crd_mode == 3)
- crd_mode = 1;
- crd_sync = spider_param_crd_sync(thd, share->crd_sync);
- time_t tmp_time = (time_t) time((time_t*) 0);
- if ((spider_init_error_table =
- spider_get_init_error_table(spider->wide_handler->trx, share,
- FALSE)))
- {
- DBUG_PRINT("info",("spider diff2=%f",
- difftime(tmp_time, spider_init_error_table->init_error_time)));
- if (difftime(tmp_time,
- spider_init_error_table->init_error_time) <
- spider_param_table_init_error_interval())
- {
- *error_num = spider_init_error_table->init_error;
- if (spider_init_error_table->init_error_with_message)
- my_message(spider_init_error_table->init_error,
- spider_init_error_table->init_error_msg, MYF(0));
- pthread_mutex_unlock(&share->crd_mutex);
- pthread_mutex_unlock(&share->sts_mutex);
- goto error_after_alloc_dbton_handler;
- }
- }
-
- if (
- (
- !same_server_link ||
- load_sts_at_startup
- ) &&
- (*error_num = spider_get_sts(share, spider->search_link_idx,
- tmp_time, spider, sts_interval, sts_mode,
- sts_sync,
- 1, HA_STATUS_VARIABLE | HA_STATUS_CONST | HA_STATUS_AUTO))
- ) {
- if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM)
- {
- thd->clear_error();
- } else {
- pthread_mutex_unlock(&share->crd_mutex);
- pthread_mutex_unlock(&share->sts_mutex);
- goto error_after_alloc_dbton_handler;
- }
- }
- if (
- (
- !same_server_link ||
- load_crd_at_startup
- ) &&
- (*error_num = spider_get_crd(share, spider->search_link_idx,
- tmp_time, spider, table, crd_interval, crd_mode,
- crd_sync,
- 1))
- ) {
- if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM)
- {
- thd->clear_error();
- } else {
- pthread_mutex_unlock(&share->crd_mutex);
- pthread_mutex_unlock(&share->sts_mutex);
- goto error_after_alloc_dbton_handler;
- }
- }
- }
- share->init_error = FALSE;
+ if (spider_share_get_sts_crd(thd, spider, share, table, FALSE, TRUE,
+ error_num))
+ goto error_after_alloc_dbton_handler;
+ share->init_error= FALSE;
}
pthread_mutex_unlock(&share->crd_mutex);
pthread_mutex_unlock(&share->sts_mutex);
}
}
-
- DBUG_PRINT("info",("spider share=%p", share));
- DBUG_RETURN(share);
+ DBUG_RETURN(FALSE);
error_after_alloc_dbton_handler:
- for (roop_count = 0; roop_count < (int) share->use_dbton_count; ++roop_count)
+ for (int roop_count = 0; roop_count < (int) share->use_dbton_count; ++roop_count)
{
uint dbton_id = share->use_dbton_ids[roop_count];
if (spider->dbton_handler[dbton_id])
@@ -5547,21 +5194,104 @@ error_after_alloc_conn_keys:
spider_free(spider_current_trx, spider->conn_keys, MYF(0));
spider->conn_keys = NULL;
spider_free_share(share);
- goto error_but_no_delete;
+ DBUG_RETURN(TRUE);
+}
+
+/**
+ Gets or creates a spider share, then initialises it
+*/
+SPIDER_SHARE *spider_get_share(
+ const char *table_name,
+ TABLE *table,
+ THD *thd,
+ ha_spider *spider,
+ int *error_num
+) {
+ SPIDER_SHARE *share;
+ TABLE_SHARE *table_share = table->s;
+ DBUG_ENTER("spider_get_share");
+
+ const TABLE_SHARE *top_share = spider->wide_handler->top_share;
+ if (top_share &&
+ (*error_num = spider_check_for_self_reference(thd, top_share)))
+ DBUG_RETURN(NULL);
+
+ const uint length = (uint) strlen(table_name);
+ const my_hash_value_type hash_value =
+ my_calc_hash(&spider_open_tables, (uchar*) table_name, length);
+ pthread_mutex_lock(&spider_tbl_mutex);
+ if (!(share = (SPIDER_SHARE*) my_hash_search_using_hash_value(
+ &spider_open_tables, hash_value, (uchar*) table_name, length)))
+ {
+ if (!(share = spider_create_share(table_name, table_share,
+ table->part_info, hash_value,
+ error_num)))
+ goto error_alloc_share;
+
+ uint old_elements = spider_open_tables.array.max_element;
+ if (my_hash_insert(&spider_open_tables, (uchar*) share))
+ {
+ *error_num = HA_ERR_OUT_OF_MEM;
+ goto error_hash_insert;
+ }
+ if (spider_open_tables.array.max_element > old_elements)
+ {
+ spider_alloc_calc_mem(spider_current_trx,
+ spider_open_tables,
+ (spider_open_tables.array.max_element - old_elements) *
+ spider_open_tables.array.size_of_element);
+ }
+
+ spider->share = share;
+ uint tmp_conn_link_idx= 0;
+ spider->conn_link_idx = &tmp_conn_link_idx;
+
+ share->use_count++;
+ pthread_mutex_unlock(&spider_tbl_mutex);
+
+ if (spider_init_share(table_name, table, thd, spider, error_num, share,
+ table_share, TRUE))
+ DBUG_RETURN(NULL);
+
+ share->init = TRUE;
+ } else
+ {
+ share->use_count++;
+ pthread_mutex_unlock(&spider_tbl_mutex);
+
+ int sleep_cnt = 0;
+ while (!share->init)
+ {
+ // avoid for dead loop
+ if (sleep_cnt++ > 1000)
+ {
+ fprintf(stderr, " [WARN SPIDER RESULT] "
+ "Wait share->init too long, table_name %s %s %ld\n",
+ share->table_name, share->tgt_hosts[0], share->tgt_ports[0]);
+ *error_num = ER_SPIDER_TABLE_OPEN_TIMEOUT_NUM;
+ my_printf_error(ER_SPIDER_TABLE_OPEN_TIMEOUT_NUM,
+ ER_SPIDER_TABLE_OPEN_TIMEOUT_STR, MYF(0),
+ table_share->db.str, table_share->table_name.str);
+ spider_free_share(share);
+ DBUG_RETURN(NULL);
+ }
+ my_sleep(10000); // wait 10 ms
+ }
+
+ spider->share = share;
+
+ if (spider_init_share(table_name, table, thd, spider, error_num, share,
+ table_share, FALSE))
+ DBUG_RETURN(NULL);
+ }
+
+ DBUG_PRINT("info",("spider share=%p", share));
+ DBUG_RETURN(share);
error_hash_insert:
spider_free_share_resource_only(share);
error_alloc_share:
pthread_mutex_unlock(&spider_tbl_mutex);
-error_open_sys_table:
-error_crd_spider_init:
-error_sts_spider_init:
- if (init_mem_root)
- {
- free_root(&mem_root, MYF(0));
- init_mem_root = FALSE;
- }
-error_but_no_delete:
DBUG_RETURN(NULL);
}
@@ -5877,46 +5607,6 @@ int spider_free_wide_share(
DBUG_RETURN(0);
}
-void spider_copy_sts_to_wide_share(
- SPIDER_WIDE_SHARE *wide_share,
- SPIDER_SHARE *share
-) {
- DBUG_ENTER("spider_copy_sts_to_pt_share");
- wide_share->stat = share->stat;
- DBUG_VOID_RETURN;
-}
-
-void spider_copy_sts_to_share(
- SPIDER_SHARE *share,
- SPIDER_WIDE_SHARE *wide_share
-) {
- DBUG_ENTER("spider_copy_sts_to_share");
- share->stat = wide_share->stat;
- DBUG_VOID_RETURN;
-}
-
-void spider_copy_crd_to_wide_share(
- SPIDER_WIDE_SHARE *wide_share,
- SPIDER_SHARE *share,
- int fields
-) {
- DBUG_ENTER("spider_copy_crd_to_wide_share");
- memcpy(wide_share->cardinality, share->cardinality,
- sizeof(longlong) * fields);
- DBUG_VOID_RETURN;
-}
-
-void spider_copy_crd_to_share(
- SPIDER_SHARE *share,
- SPIDER_WIDE_SHARE *wide_share,
- int fields
-) {
- DBUG_ENTER("spider_copy_crd_to_share");
- memcpy(share->cardinality, wide_share->cardinality,
- sizeof(longlong) * fields);
- DBUG_VOID_RETURN;
-}
-
int spider_open_all_tables(
SPIDER_TRX *trx,
bool lock
@@ -6515,7 +6205,7 @@ int spider_db_init(
void *p
) {
int error_num = HA_ERR_OUT_OF_MEM, roop_count;
- uint dbton_id = 0;
+ uint dbton_id;
uchar addr[6];
handlerton *spider_hton = (handlerton *)p;
DBUG_ENTER("spider_db_init");
@@ -6795,6 +6485,8 @@ int spider_db_init(
}
}
+ /** Populates `spider_dbton` with available `SPIDER_DBTON`s */
+ dbton_id = 0;
spider_dbton_mysql.dbton_id = dbton_id;
spider_dbton_mysql.db_util->dbton_id = dbton_id;
spider_dbton[dbton_id] = spider_dbton_mysql;
@@ -6803,15 +6495,11 @@ int spider_db_init(
spider_dbton_mariadb.db_util->dbton_id = dbton_id;
spider_dbton[dbton_id] = spider_dbton_mariadb;
++dbton_id;
- for (roop_count = 0; roop_count < SPIDER_DBTON_SIZE; roop_count++)
+ for (roop_count = 0; roop_count < (int) dbton_id; roop_count++)
{
- if (spider_dbton[roop_count].init)
- {
- if ((error_num = spider_dbton[roop_count].init()))
- {
+ if (spider_dbton[roop_count].init &&
+ (error_num = spider_dbton[roop_count].init()))
goto error_init_dbton;
- }
- }
}
DBUG_RETURN(0);
@@ -6819,9 +6507,7 @@ error_init_dbton:
for (roop_count--; roop_count >= 0; roop_count--)
{
if (spider_dbton[roop_count].deinit)
- {
spider_dbton[roop_count].deinit();
- }
}
roop_count = spider_param_table_crd_thread_count() - 1;
error_init_table_crd_threads:
@@ -7067,6 +6753,33 @@ void spider_get_partition_info(
DBUG_VOID_RETURN;
}
+/** Determines the get type for spider_get_sts() */
+enum ha_sts_crd_get_type spider_get_sts_type(
+ SPIDER_SHARE *share,
+ double sts_interval,
+ int sts_sync
+) {
+ if (sts_sync == 0)
+ return HA_GET_FETCH;
+ if (!share->wide_share->sts_init)
+ {
+ pthread_mutex_lock(&share->wide_share->sts_mutex);
+ if (!share->wide_share->sts_init)
+ return HA_GET_AFTER_LOCK;
+ pthread_mutex_unlock(&share->wide_share->sts_mutex);
+ return HA_GET_COPY;
+ }
+ if (difftime(share->sts_get_time, share->wide_share->sts_get_time) <
+ sts_interval)
+ return HA_GET_COPY;
+ if (!pthread_mutex_trylock(&share->wide_share->sts_mutex))
+ return HA_GET_AFTER_TRYLOCK;
+ return HA_GET_COPY;
+}
+
+/**
+ Populates share->stat or share->wide_share->stat with table status.
+*/
int spider_get_sts(
SPIDER_SHARE *share,
int link_idx,
@@ -7078,85 +6791,51 @@ int spider_get_sts(
int sts_sync_level,
uint flag
) {
- int get_type;
int error_num = 0;
bool need_to_get = TRUE;
DBUG_ENTER("spider_get_sts");
- if (
- sts_sync == 0
- ) {
- /* get */
- get_type = 1;
- } else if (
- !share->wide_share->sts_init
- ) {
- pthread_mutex_lock(&share->wide_share->sts_mutex);
- if (!share->wide_share->sts_init)
- {
- /* get after mutex_lock */
- get_type = 2;
- } else {
- pthread_mutex_unlock(&share->wide_share->sts_mutex);
- /* copy */
- get_type = 0;
- }
- } else if (
- difftime(share->sts_get_time, share->wide_share->sts_get_time) <
- sts_interval
- ) {
- /* copy */
- get_type = 0;
- } else if (
- !pthread_mutex_trylock(&share->wide_share->sts_mutex)
- ) {
- /* get after mutex_trylock */
- get_type = 3;
- } else {
- /* copy */
- get_type = 0;
- }
- if (
- !share->sts_init &&
- share->table_share->tmp_table == NO_TMP_TABLE &&
- spider_param_load_sts_at_startup(share->load_sts_at_startup) &&
- (!share->init || share->init_error)
- ) {
+ enum ha_sts_crd_get_type get_type =
+ spider_get_sts_type(share, sts_interval, sts_sync);
+ if (!share->sts_init &&
+ share->table_share->tmp_table == NO_TMP_TABLE &&
+ spider_param_load_sts_at_startup(share->load_sts_at_startup) &&
+ (!share->init || share->init_error))
+ {
error_num = spider_sys_get_table_sts(
current_thd,
share->lgtm_tblhnd_share->table_name,
share->lgtm_tblhnd_share->table_name_length,
&share->stat
);
- if (
- !error_num ||
- (error_num != HA_ERR_KEY_NOT_FOUND && error_num != HA_ERR_END_OF_FILE)
- )
+ if (!error_num ||
+ (error_num != HA_ERR_KEY_NOT_FOUND && error_num != HA_ERR_END_OF_FILE))
need_to_get = FALSE;
}
if (need_to_get)
{
- if (get_type == 0)
- spider_copy_sts_to_share(share, share->wide_share);
- else {
+ if (get_type == HA_GET_COPY)
+ share->stat = share->wide_share->stat;
+ else
+ /* Executes a `show table status` query and store the results in
+ share->stat */
error_num = spider_db_show_table_status(spider, link_idx, sts_mode, flag);
- }
}
- if (get_type >= 2)
+ if (get_type >= HA_GET_AFTER_LOCK)
pthread_mutex_unlock(&share->wide_share->sts_mutex);
+
if (error_num)
{
SPIDER_PARTITION_HANDLER *partition_handler =
spider->partition_handler;
- if (
- !share->wide_share->sts_init &&
- sts_sync >= sts_sync_level &&
- get_type > 1 &&
- partition_handler &&
- partition_handler->handlers &&
- partition_handler->handlers[0] == spider
- ) {
+ if (!share->wide_share->sts_init &&
+ sts_sync >= sts_sync_level &&
+ get_type > HA_GET_FETCH &&
+ partition_handler &&
+ partition_handler->handlers &&
+ partition_handler->handlers[0] == spider)
+ {
int roop_count;
ha_spider *tmp_spider;
SPIDER_SHARE *tmp_share;
@@ -7165,24 +6844,23 @@ int spider_get_sts(
int tmp_sts_sync;
THD *thd = spider->wide_handler->trx->thd;
for (roop_count = 1;
- roop_count < (int) partition_handler->no_parts;
- roop_count++)
+ roop_count < (int) partition_handler->no_parts;
+ roop_count++)
{
- tmp_spider =
- (ha_spider *) partition_handler->handlers[roop_count];
+ tmp_spider = (ha_spider *) partition_handler->handlers[roop_count];
tmp_share = tmp_spider->share;
tmp_sts_interval = spider_param_sts_interval(thd, share->sts_interval);
tmp_sts_mode = spider_param_sts_mode(thd, share->sts_mode);
tmp_sts_sync = spider_param_sts_sync(thd, share->sts_sync);
- spider_get_sts(tmp_share, tmp_spider->search_link_idx,
- tmp_time, tmp_spider, tmp_sts_interval, tmp_sts_mode, tmp_sts_sync,
- 1, flag);
+ spider_get_sts(tmp_share, tmp_spider->search_link_idx, tmp_time,
+ tmp_spider, tmp_sts_interval, tmp_sts_mode,
+ tmp_sts_sync, 1, flag);
if (share->wide_share->sts_init)
{
error_num = 0;
thd->clear_error();
- get_type = 0;
- spider_copy_sts_to_share(share, share->wide_share);
+ get_type = HA_GET_COPY;
+ share->stat = share->wide_share->stat;
break;
}
}
@@ -7190,9 +6868,10 @@ int spider_get_sts(
if (error_num)
DBUG_RETURN(error_num);
}
- if (sts_sync >= sts_sync_level && get_type > 0)
+
+ if (sts_sync >= sts_sync_level && get_type > HA_GET_COPY)
{
- spider_copy_sts_to_wide_share(share->wide_share, share);
+ share->wide_share->stat = share->stat;
share->wide_share->sts_get_time = tmp_time;
share->wide_share->sts_init = TRUE;
}
@@ -7201,6 +6880,34 @@ int spider_get_sts(
DBUG_RETURN(0);
}
+/** Determines the get type for spider_get_crd() */
+enum ha_sts_crd_get_type spider_get_crd_type(
+ SPIDER_SHARE *share,
+ double crd_interval,
+ int crd_sync
+) {
+ if (crd_sync == 0)
+ return HA_GET_FETCH;
+ if (!share->wide_share->crd_init)
+ {
+ pthread_mutex_lock(&share->wide_share->crd_mutex);
+ if (!share->wide_share->crd_init)
+ return HA_GET_AFTER_LOCK;
+ pthread_mutex_unlock(&share->wide_share->crd_mutex);
+ return HA_GET_COPY;
+ }
+ if (difftime(share->crd_get_time, share->wide_share->crd_get_time) <
+ crd_interval)
+ return HA_GET_COPY;
+ if (!pthread_mutex_trylock(&share->wide_share->crd_mutex))
+ return HA_GET_AFTER_TRYLOCK;
+ return HA_GET_COPY;
+}
+
+/**
+ Populates share->cardinality or share->wide_share->cardinality with
+ table index
+*/
int spider_get_crd(
SPIDER_SHARE *share,
int link_idx,
@@ -7212,49 +6919,16 @@ int spider_get_crd(
int crd_sync,
int crd_sync_level
) {
- int get_type;
int error_num = 0;
bool need_to_get = TRUE;
DBUG_ENTER("spider_get_crd");
- if (
- crd_sync == 0
- ) {
- /* get */
- get_type = 1;
- } else if (
- !share->wide_share->crd_init
- ) {
- pthread_mutex_lock(&share->wide_share->crd_mutex);
- if (!share->wide_share->crd_init)
- {
- /* get after mutex_lock */
- get_type = 2;
- } else {
- pthread_mutex_unlock(&share->wide_share->crd_mutex);
- /* copy */
- get_type = 0;
- }
- } else if (
- difftime(share->crd_get_time, share->wide_share->crd_get_time) <
- crd_interval
- ) {
- /* copy */
- get_type = 0;
- } else if (
- !pthread_mutex_trylock(&share->wide_share->crd_mutex)
- ) {
- /* get after mutex_trylock */
- get_type = 3;
- } else {
- /* copy */
- get_type = 0;
- }
- if (
- !share->crd_init &&
- share->table_share->tmp_table == NO_TMP_TABLE &&
- spider_param_load_sts_at_startup(share->load_crd_at_startup)
- ) {
+ enum ha_sts_crd_get_type get_type =
+ spider_get_crd_type(share, crd_interval, crd_sync);
+ if (!share->crd_init &&
+ share->table_share->tmp_table == NO_TMP_TABLE &&
+ spider_param_load_sts_at_startup(share->load_crd_at_startup))
+ {
error_num = spider_sys_get_table_crd(
current_thd,
share->lgtm_tblhnd_share->table_name,
@@ -7262,36 +6936,31 @@ int spider_get_crd(
share->cardinality,
table->s->fields
);
- if (
- !error_num ||
- (error_num != HA_ERR_KEY_NOT_FOUND && error_num != HA_ERR_END_OF_FILE)
- )
+ if (!error_num ||
+ (error_num != HA_ERR_KEY_NOT_FOUND && error_num != HA_ERR_END_OF_FILE))
need_to_get = FALSE;
}
if (need_to_get)
{
- if (get_type == 0)
- spider_copy_crd_to_share(share, share->wide_share,
- table->s->fields);
- else {
+ if (get_type == HA_GET_COPY)
+ memcpy(share->cardinality, share->wide_share->cardinality,
+ sizeof(longlong) * table->s->fields);
+ else
error_num = spider_db_show_index(spider, link_idx, table, crd_mode);
- }
}
- if (get_type >= 2)
+ if (get_type >= HA_GET_AFTER_LOCK)
pthread_mutex_unlock(&share->wide_share->crd_mutex);
if (error_num)
{
- SPIDER_PARTITION_HANDLER *partition_handler =
- spider->partition_handler;
- if (
- !share->wide_share->crd_init &&
- crd_sync >= crd_sync_level &&
- get_type > 1 &&
- partition_handler &&
- partition_handler->handlers &&
- partition_handler->handlers[0] == spider
- ) {
+ SPIDER_PARTITION_HANDLER *partition_handler = spider->partition_handler;
+ if (!share->wide_share->crd_init &&
+ crd_sync >= crd_sync_level &&
+ get_type > HA_GET_FETCH &&
+ partition_handler &&
+ partition_handler->handlers &&
+ partition_handler->handlers[0] == spider)
+ {
int roop_count;
ha_spider *tmp_spider;
SPIDER_SHARE *tmp_share;
@@ -7300,25 +6969,24 @@ int spider_get_crd(
int tmp_crd_sync;
THD *thd = spider->wide_handler->trx->thd;
for (roop_count = 1;
- roop_count < (int) partition_handler->no_parts;
- roop_count++)
+ roop_count < (int) partition_handler->no_parts;
+ roop_count++)
{
- tmp_spider =
- (ha_spider *) partition_handler->handlers[roop_count];
+ tmp_spider = (ha_spider *) partition_handler->handlers[roop_count];
tmp_share = tmp_spider->share;
tmp_crd_interval = spider_param_crd_interval(thd, share->crd_interval);
tmp_crd_mode = spider_param_crd_mode(thd, share->crd_mode);
tmp_crd_sync = spider_param_crd_sync(thd, share->crd_sync);
- spider_get_crd(tmp_share, tmp_spider->search_link_idx,
- tmp_time, tmp_spider, table, tmp_crd_interval, tmp_crd_mode,
- tmp_crd_sync, 1);
+ spider_get_crd(tmp_share, tmp_spider->search_link_idx, tmp_time,
+ tmp_spider, table, tmp_crd_interval, tmp_crd_mode,
+ tmp_crd_sync, 1);
if (share->wide_share->crd_init)
{
error_num = 0;
thd->clear_error();
- get_type = 0;
- spider_copy_crd_to_share(share, share->wide_share,
- table->s->fields);
+ get_type = HA_GET_COPY;
+ memcpy(share->cardinality, share->wide_share->cardinality,
+ sizeof(longlong) * table->s->fields);
break;
}
}
@@ -7326,10 +6994,10 @@ int spider_get_crd(
if (error_num)
DBUG_RETURN(error_num);
}
- if (crd_sync >= crd_sync_level && get_type > 0)
+ if (crd_sync >= crd_sync_level && get_type > HA_GET_COPY)
{
- spider_copy_crd_to_wide_share(share->wide_share, share,
- table->s->fields);
+ memcpy(share->wide_share->cardinality, share->cardinality,
+ sizeof(longlong) * table->s->fields);
share->wide_share->crd_get_time = tmp_time;
share->wide_share->crd_init = TRUE;
}
@@ -7374,6 +7042,18 @@ void spider_set_result_list_param(
DBUG_VOID_RETURN;
}
+/**
+ Gets or creates a `SPIDER_INIT_ERROR_TABLE` with the table name from
+ a given `SPIDER_SHARE`
+
+ When creating, also add the newly created object to
+ `spider_init_error_tables`
+
+ @param trx Transaction
+ @param share The spider share providing the table name
+ @param create Whether to create a new `SPIDER_INIT_ERROR_TABLE` if one wi th the required table name does not exist yet
+ @return A `SPIDER_INIT_ERROR_TABLE` or NULL if failure
+*/
SPIDER_INIT_ERROR_TABLE *spider_get_init_error_table(
SPIDER_TRX *trx,
SPIDER_SHARE *share,
@@ -7393,11 +7073,10 @@ SPIDER_INIT_ERROR_TABLE *spider_get_init_error_table(
pthread_mutex_unlock(&spider_init_error_tbl_mutex);
DBUG_RETURN(NULL);
}
- if (!(spider_init_error_table = (SPIDER_INIT_ERROR_TABLE *)
- spider_bulk_malloc(spider_current_trx, 54, MYF(MY_WME | MY_ZEROFILL),
+ if (!spider_bulk_malloc(spider_current_trx, 54, MYF(MY_WME | MY_ZEROFILL),
&spider_init_error_table, (uint) (sizeof(*spider_init_error_table)),
&tmp_name, (uint) (share->table_name_length + 1),
- NullS))
+ NullS)
) {
pthread_mutex_unlock(&spider_init_error_tbl_mutex);
DBUG_RETURN(NULL);
@@ -8404,6 +8083,7 @@ ulong spider_calc_for_sort(
DBUG_RETURN(sort);
}
+/** Generates a random number between 0 and 1 */
double spider_rand(
uint32 rand_source
) {
@@ -9085,6 +8765,8 @@ void *spider_table_bg_sts_action(
thd->mysys_var->current_cond = &thread->cond;
thd->mysys_var->current_mutex = &thread->mutex;
}
+ bool spd_wsrep_on = thd->variables.wsrep_on;
+ thd->variables.wsrep_on = false;
while (spider_init_queries[i].length && !thd->killed && !thread->killed &&
thread->init_command)
{
@@ -9098,6 +8780,7 @@ void *spider_table_bg_sts_action(
}
++i;
}
+ thd->variables.wsrep_on = spd_wsrep_on;
thd->mysys_var->current_cond = &thread->cond;
thd->mysys_var->current_mutex = &thread->mutex;
thd->client_capabilities -= CLIENT_MULTI_RESULTS;
diff --git a/storage/spider/spd_table.h b/storage/spider/spd_table.h
index 9b6eecb9d56..b5c265aff9d 100644
--- a/storage/spider/spd_table.h
+++ b/storage/spider/spd_table.h
@@ -493,28 +493,6 @@ int spider_free_wide_share(
SPIDER_WIDE_SHARE *wide_share
);
-void spider_copy_sts_to_wide_share(
- SPIDER_WIDE_SHARE *wide_share,
- SPIDER_SHARE *share
-);
-
-void spider_copy_sts_to_share(
- SPIDER_SHARE *share,
- SPIDER_WIDE_SHARE *wide_share
-);
-
-void spider_copy_crd_to_wide_share(
- SPIDER_WIDE_SHARE *wide_share,
- SPIDER_SHARE *share,
- int fields
-);
-
-void spider_copy_crd_to_share(
- SPIDER_SHARE *share,
- SPIDER_WIDE_SHARE *wide_share,
- int fields
-);
-
int spider_open_all_tables(
SPIDER_TRX *trx,
bool lock
diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc
index a6c5ea8f85a..3361f485d58 100644
--- a/storage/spider/spd_trx.cc
+++ b/storage/spider/spd_trx.cc
@@ -3872,46 +3872,59 @@ void spider_reuse_trx_ha(
DBUG_VOID_RETURN;
}
+/**
+ Sets link indices for load balancing read connections
+
+ Assuming `spider->share->link_count` is the number of active servers
+ to use, this function updates `spider->conn_link_idx` with the first
+ server in the same "modulus group" whose link status is not
+ `SPIDER_LINK_STATUS_NG`, or if one cannot be found, use the
+ `link_idx`th server
+*/
void spider_trx_set_link_idx_for_all(
ha_spider *spider
) {
- int roop_count, roop_count2;
SPIDER_SHARE *share = spider->share;
long *link_statuses = share->link_statuses;
uint *conn_link_idx = spider->conn_link_idx;
- int link_count = share->link_count;
- int all_link_count = share->all_link_count;
+ uint link_count = share->link_count;
+ uint all_link_count = share->all_link_count;
uchar *conn_can_fo = spider->conn_can_fo;
DBUG_ENTER("spider_trx_set_link_idx_for_all");
DBUG_PRINT("info",("spider set link_count=%d", link_count));
DBUG_PRINT("info",("spider set all_link_count=%d", all_link_count));
memset(conn_can_fo, 0, sizeof(uchar) * share->link_bitmap_size);
- for (roop_count = 0; roop_count < link_count; roop_count++)
- {
- for (roop_count2 = roop_count; roop_count2 < all_link_count;
- roop_count2 += link_count)
+ /* We change the name from roop_count and roop_count2 to link_idx
+ and all_link_idx because the latter are generally used in the
+ same context. */
+ for (uint link_idx = 0; link_idx < link_count; link_idx++)
+ {
+ uint all_link_idx;
+ for (all_link_idx = link_idx; all_link_idx < all_link_count;
+ all_link_idx += link_count)
{
- if (link_statuses[roop_count2] <= SPIDER_LINK_STATUS_RECOVERY)
+ if (link_statuses[all_link_idx] <= SPIDER_LINK_STATUS_RECOVERY)
break;
}
- if (roop_count2 < all_link_count)
+ if (all_link_idx < all_link_count)
{
- conn_link_idx[roop_count] = roop_count2;
- if (roop_count2 + link_count < all_link_count)
- spider_set_bit(conn_can_fo, roop_count);
+ conn_link_idx[link_idx] = all_link_idx;
+ if (all_link_idx + link_count < all_link_count)
+ spider_set_bit(conn_can_fo, link_idx);
DBUG_PRINT("info",("spider set conn_link_idx[%d]=%d",
- roop_count, roop_count2));
- } else {
- conn_link_idx[roop_count] = roop_count;
+ link_idx, all_link_idx));
+ } else
+ {
+ conn_link_idx[link_idx] = link_idx;
DBUG_PRINT("info",("spider set2 conn_link_idx[%d]=%d",
- roop_count, roop_count));
+ link_idx, link_idx));
}
- spider->conn_keys[roop_count] =
+ spider->conn_keys[link_idx] =
ADD_TO_PTR(spider->conn_keys_first_ptr,
- PTR_BYTE_DIFF(share->conn_keys[conn_link_idx[roop_count]],
+ PTR_BYTE_DIFF(share->conn_keys[conn_link_idx[link_idx]],
share->conn_keys[0]), char*);
DBUG_PRINT("info",("spider conn_keys[%d]=%s",
- roop_count, spider->conn_keys[roop_count]));
+ link_idx, spider->conn_keys[link_idx]));
}
DBUG_VOID_RETURN;
}
diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt
index 85e8cd05816..099f3c67660 100644
--- a/strings/CMakeLists.txt
+++ b/strings/CMakeLists.txt
@@ -22,6 +22,7 @@ SET(STRINGS_SOURCES bchange.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c
ctype-czech.c ctype-euc_kr.c ctype-eucjpms.c ctype-extra.c ctype-gb2312.c ctype-gbk.c
ctype-latin1.c ctype-mb.c ctype-simple.c ctype-sjis.c ctype-tis620.c ctype-uca.c
ctype-ucs2.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype.c decimal.c dtoa.c int2str.c
+ ctype-unidata.c
is_prefix.c llstr.c longlong2str.c my_strtoll10.c my_vsnprintf.c
str2int.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c
strxmov.c strxnmov.c xml.c
diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c
index 39ceee53ef9..fce763b4fc7 100644
--- a/strings/conf_to_src.c
+++ b/strings/conf_to_src.c
@@ -409,7 +409,6 @@ void dispcset(FILE *f,CHARSET_INFO *cs)
fprintf(f," NULL, /* from_uni */\n");
fprintf(f," NULL, /* casefold */\n");
- fprintf(f," &my_unicase_default, /* caseinfo */\n");
fprintf(f," NULL, /* state map */\n");
fprintf(f," NULL, /* ident map */\n");
fprintf(f," 1, /* strxfrm_multiply*/\n");
@@ -471,7 +470,7 @@ main(int argc, char **argv __attribute__((unused)))
bzero((void*)&all_charsets,sizeof(all_charsets));
bzero((void*) refids, sizeof(refids));
- sprintf(filename,"%s/%s",argv[1],"Index.xml");
+ snprintf(filename,sizeof(filename),"%s/%s",argv[1],"Index.xml");
my_read_charset_file(filename);
for (cs= all_charsets;
@@ -482,7 +481,8 @@ main(int argc, char **argv __attribute__((unused)))
{
if ( (!simple_cs_is_full(cs)) && (cs->cs_name.str))
{
- sprintf(filename,"%s/%s.xml",argv[1], cs->cs_name.str);
+ snprintf(filename, sizeof filename, "%s/%.*s.xml",
+ argv[1], cs->csname.length, cs->csname.str);
my_read_charset_file(filename);
}
cs->state|= MY_CS_LOADED;
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index ef01b45aec0..aaf6769989b 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -806,7 +806,8 @@ static const MY_CASEFOLD_CHARACTER *my_casefold_pages_big5[256]=
static MY_CASEFOLD_INFO my_casefold_big5=
{
0xFFFF,
- my_casefold_pages_big5
+ my_casefold_pages_big5,
+ NULL /* ws */
};
@@ -6847,7 +6848,6 @@ struct charset_info_st my_charset_big5_chinese_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_big5, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -6879,7 +6879,6 @@ struct charset_info_st my_charset_big5_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_big5, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -6911,7 +6910,6 @@ struct charset_info_st my_charset_big5_chinese_nopad_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_big5, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -6943,7 +6941,6 @@ struct charset_info_st my_charset_big5_nopad_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_big5, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c
index e934453f8db..f11fe611482 100644
--- a/strings/ctype-bin.c
+++ b/strings/ctype-bin.c
@@ -132,7 +132,8 @@ static int my_strnncollsp_binary(CHARSET_INFO * cs __attribute__((unused)),
static int my_strnncollsp_nchars_binary(CHARSET_INFO * cs __attribute__((unused)),
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
set_if_smaller(slen, nchars);
set_if_smaller(tlen, nchars);
@@ -217,7 +218,8 @@ static int my_strnncollsp_8bit_bin(CHARSET_INFO * cs __attribute__((unused)),
static int my_strnncollsp_nchars_8bit_bin(CHARSET_INFO * cs,
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
set_if_smaller(a_length, nchars);
set_if_smaller(b_length, nchars);
@@ -623,7 +625,6 @@ struct charset_info_st my_charset_bin =
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c
index 0f1e8457072..f01909d4f65 100644
--- a/strings/ctype-cp932.c
+++ b/strings/ctype-cp932.c
@@ -1706,7 +1706,8 @@ static const MY_CASEFOLD_CHARACTER *my_casefold_pages_cp932[256]=
MY_CASEFOLD_INFO my_casefold_cp932=
{
0xFFFF,
- my_casefold_pages_cp932
+ my_casefold_pages_cp932,
+ NULL /* ws */
};
@@ -34805,7 +34806,6 @@ struct charset_info_st my_charset_cp932_japanese_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_cp932, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -34836,7 +34836,6 @@ struct charset_info_st my_charset_cp932_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_cp932, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -34868,7 +34867,6 @@ struct charset_info_st my_charset_cp932_japanese_nopad_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_cp932, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -34899,7 +34897,6 @@ struct charset_info_st my_charset_cp932_nopad_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_cp932, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c
index 109731abaaf..64aff2e7be0 100644
--- a/strings/ctype-czech.c
+++ b/strings/ctype-czech.c
@@ -618,7 +618,6 @@ struct charset_info_st my_charset_latin2_czech_cs =
tab_8859_2_uni, /* tab_to_uni */
idx_uni_8859_2, /* tab_from_uni */
NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
4, /* strxfrm_multiply */
diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c
index ab27074f20d..dd6ab60bd3a 100644
--- a/strings/ctype-euc_kr.c
+++ b/strings/ctype-euc_kr.c
@@ -1483,7 +1483,8 @@ static const MY_CASEFOLD_CHARACTER *my_casefold_pages_euckr[256]=
static MY_CASEFOLD_INFO my_casefold_euckr=
{
0xFFFF,
- my_casefold_pages_euckr
+ my_casefold_pages_euckr,
+ NULL /* ws */
};
@@ -10095,7 +10096,6 @@ struct charset_info_st my_charset_euckr_korean_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_euckr, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -10127,7 +10127,6 @@ struct charset_info_st my_charset_euckr_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_euckr, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -10159,7 +10158,6 @@ struct charset_info_st my_charset_euckr_korean_nopad_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_euckr, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -10191,7 +10189,6 @@ struct charset_info_st my_charset_euckr_nopad_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_euckr, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c
index 1812c74d465..a5f727551aa 100644
--- a/strings/ctype-eucjpms.c
+++ b/strings/ctype-eucjpms.c
@@ -1779,7 +1779,8 @@ static const MY_CASEFOLD_CHARACTER *my_casefold_pages_eucjpms[512]=
static MY_CASEFOLD_INFO my_casefold_eucjpms=
{
0x0FFFF,
- my_casefold_pages_eucjpms
+ my_casefold_pages_eucjpms,
+ NULL /* ws */
};
@@ -67634,7 +67635,6 @@ struct charset_info_st my_charset_eucjpms_japanese_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_eucjpms,/* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -67666,7 +67666,6 @@ struct charset_info_st my_charset_eucjpms_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_eucjpms,/* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -67698,7 +67697,6 @@ struct charset_info_st my_charset_eucjpms_japanese_nopad_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_eucjpms,/* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -67730,7 +67728,6 @@ struct charset_info_st my_charset_eucjpms_nopad_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_eucjpms,/* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c
index 82df1088a62..8a25a9c6a61 100644
--- a/strings/ctype-extra.c
+++ b/strings/ctype-extra.c
@@ -3690,7 +3690,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_dec8_swedish_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -3722,7 +3721,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp850_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -3754,7 +3752,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin1_german1_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -3786,7 +3783,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_hp8_english_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -3818,7 +3814,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_koi8r_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -3850,7 +3845,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin2_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -3882,7 +3876,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_swe7_swedish_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -3914,7 +3907,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_ascii_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -3946,7 +3938,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1251_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -3978,7 +3969,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin1_danish_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4010,7 +4000,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_hebrew_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4042,7 +4031,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin7_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4074,7 +4062,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin2_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4106,7 +4093,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_koi8u_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4138,7 +4124,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1251_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4170,7 +4155,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_greek_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4202,7 +4186,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1250_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4234,7 +4217,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin2_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4266,7 +4248,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1257_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4298,7 +4279,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin5_turkish_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4330,7 +4310,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_armscii8_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4362,7 +4341,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp866_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4394,7 +4372,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_keybcs2_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4426,7 +4403,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_macce_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4458,7 +4434,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_macroman_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4490,7 +4465,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp852_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4522,7 +4496,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin7_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4554,7 +4527,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin7_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4586,7 +4558,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_macce_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4618,7 +4589,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1250_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4650,7 +4620,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin1_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4682,7 +4651,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin1_general_cs, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4714,7 +4682,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1251_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4746,7 +4713,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1251_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4778,7 +4744,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1251_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4810,7 +4775,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_macroman_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4842,7 +4806,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1256_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4874,7 +4837,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1257_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4906,7 +4868,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1257_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4938,7 +4899,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_armscii8_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -4970,7 +4930,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_ascii_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5002,7 +4961,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1250_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5034,7 +4992,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1256_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5066,7 +5023,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp866_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5098,7 +5054,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_dec8_swedish_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5130,7 +5085,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_greek_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5162,7 +5116,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_hebrew_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5194,7 +5147,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_hp8_english_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5226,7 +5178,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_keybcs2_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5258,7 +5209,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_koi8r_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5290,7 +5240,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_koi8u_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5322,7 +5271,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin2_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5354,7 +5302,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin5_turkish_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5386,7 +5333,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin7_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5418,7 +5364,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp850_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5450,7 +5395,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp852_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5482,7 +5426,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_swe7_swedish_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5514,7 +5457,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_geostd8_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5546,7 +5488,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_geostd8_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5578,7 +5519,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin1_spanish_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5610,7 +5550,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1250_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5642,7 +5581,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_dec8_swedish_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5674,7 +5612,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp850_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5706,7 +5643,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_hp8_english_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5738,7 +5674,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_koi8r_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5770,7 +5705,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin2_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5802,7 +5736,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_swe7_swedish_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5834,7 +5767,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_ascii_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5866,7 +5798,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_hebrew_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5898,7 +5829,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_koi8u_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5930,7 +5860,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_greek_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5962,7 +5891,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1250_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -5994,7 +5922,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin5_turkish_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6026,7 +5953,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_armscii8_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6058,7 +5984,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp866_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6090,7 +6015,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_keybcs2_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6122,7 +6046,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_macce_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6154,7 +6077,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_macroman_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6186,7 +6108,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp852_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6218,7 +6139,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin7_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6250,7 +6170,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_macce_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6282,7 +6201,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1251_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6314,7 +6232,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1251_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6346,7 +6263,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_macroman_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6378,7 +6294,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1256_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6410,7 +6325,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1257_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6442,7 +6356,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1257_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6474,7 +6387,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_armscii8_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6506,7 +6418,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_ascii_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6538,7 +6449,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1250_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6570,7 +6480,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp1256_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6602,7 +6511,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp866_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6634,7 +6542,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_dec8_swedish_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6666,7 +6573,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_greek_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6698,7 +6604,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_hebrew_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6730,7 +6635,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_hp8_english_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6762,7 +6666,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_keybcs2_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6794,7 +6697,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_koi8r_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6826,7 +6728,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_koi8u_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6858,7 +6759,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin2_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6890,7 +6790,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin5_turkish_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6922,7 +6821,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_latin7_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6954,7 +6852,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp850_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -6986,7 +6883,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_cp852_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -7018,7 +6914,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_swe7_swedish_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -7050,7 +6945,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_geostd8_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -7082,7 +6976,6 @@ struct charset_info_st compiled_charsets[] = {
to_uni_geostd8_general_ci, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
@@ -7113,7 +7006,6 @@ struct charset_info_st compiled_charsets[] = {
NULL, /* to_uni */
NULL, /* from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state map */
NULL, /* ident map */
1, /* strxfrm_multiply*/
diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c
index 9e6ed3cfabe..f3e9c902389 100644
--- a/strings/ctype-gb2312.c
+++ b/strings/ctype-gb2312.c
@@ -822,7 +822,8 @@ static const MY_CASEFOLD_CHARACTER *my_casefold_pages_gb2312[256]=
static MY_CASEFOLD_INFO my_casefold_gb2312=
{
0xFFFF,
- my_casefold_pages_gb2312
+ my_casefold_pages_gb2312,
+ NULL /* ws */
};
@@ -6499,7 +6500,6 @@ struct charset_info_st my_charset_gb2312_chinese_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_gb2312,/* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -6531,7 +6531,6 @@ struct charset_info_st my_charset_gb2312_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_gb2312,/* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -6563,7 +6562,6 @@ struct charset_info_st my_charset_gb2312_chinese_nopad_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_gb2312,/* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -6595,7 +6593,6 @@ struct charset_info_st my_charset_gb2312_nopad_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_gb2312,/* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index a81e2465157..a22e6aa8d84 100644
--- a/strings/ctype-gbk.c
+++ b/strings/ctype-gbk.c
@@ -1006,7 +1006,8 @@ static const MY_CASEFOLD_CHARACTER *my_casefold_pages_gbk[256]=
static MY_CASEFOLD_INFO my_casefold_gbk=
{
0xFFFF,
- my_casefold_pages_gbk
+ my_casefold_pages_gbk,
+ NULL /* ws */
};
@@ -10780,7 +10781,6 @@ struct charset_info_st my_charset_gbk_chinese_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_gbk, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -10811,7 +10811,6 @@ struct charset_info_st my_charset_gbk_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_gbk, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -10843,7 +10842,6 @@ struct charset_info_st my_charset_gbk_chinese_nopad_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_gbk, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -10874,7 +10872,6 @@ struct charset_info_st my_charset_gbk_nopad_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_gbk, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c
index a0bee911af5..5d763c6a561 100644
--- a/strings/ctype-latin1.c
+++ b/strings/ctype-latin1.c
@@ -449,7 +449,6 @@ struct charset_info_st my_charset_latin1=
cs_to_uni, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -481,7 +480,6 @@ struct charset_info_st my_charset_latin1_nopad=
cs_to_uni, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -763,7 +761,6 @@ struct charset_info_st my_charset_latin1_german2_ci=
cs_to_uni, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
2, /* strxfrm_multiply */
@@ -795,7 +792,6 @@ struct charset_info_st my_charset_latin1_bin=
cs_to_uni, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -827,7 +823,6 @@ struct charset_info_st my_charset_latin1_nopad_bin=
cs_to_uni, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 9858475fdcf..94dc7228cf5 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -211,7 +211,8 @@ static int
my_strnncollsp_nchars_simple(CHARSET_INFO * cs,
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
set_if_smaller(a_length, nchars);
set_if_smaller(b_length, nchars);
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index 1e3ef16bdb5..a5fed41b964 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -1076,7 +1076,8 @@ static const MY_CASEFOLD_CHARACTER *my_casefold_pages_sjis[256]=
static MY_CASEFOLD_INFO my_casefold_sjis=
{
0xFFFF,
- my_casefold_pages_sjis
+ my_casefold_pages_sjis,
+ NULL /* ws */
};
@@ -34193,7 +34194,6 @@ struct charset_info_st my_charset_sjis_japanese_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_sjis, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -34224,7 +34224,6 @@ struct charset_info_st my_charset_sjis_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_sjis, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -34256,7 +34255,6 @@ struct charset_info_st my_charset_sjis_japanese_nopad_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_sjis, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -34287,7 +34285,6 @@ struct charset_info_st my_charset_sjis_nopad_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_sjis, /* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index 3ae5240f9bc..0b728346f6a 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -593,7 +593,8 @@ static int
my_strnncollsp_nchars_tis620(CHARSET_INFO * cs,
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
set_if_smaller(a_length, nchars);
set_if_smaller(b_length, nchars);
@@ -956,7 +957,6 @@ struct charset_info_st my_charset_tis620_thai_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
4, /* strxfrm_multiply */
@@ -987,7 +987,6 @@ struct charset_info_st my_charset_tis620_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -1019,7 +1018,6 @@ struct charset_info_st my_charset_tis620_thai_nopad_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
4, /* strxfrm_multiply */
@@ -1051,7 +1049,6 @@ struct charset_info_st my_charset_tis620_nopad_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index 8e94a18a478..aa4d366208f 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -35,6 +35,7 @@
#include "strings_def.h"
#include <m_ctype.h>
#include "ctype-uca.h"
+#include "ctype-unidata.h"
#include "my_bit.h"
typedef struct
@@ -34611,8 +34612,8 @@ my_coll_init_uca(struct charset_info_st *cs, MY_CHARSET_LOADER *loader)
{
cs->pad_char= ' ';
cs->m_ctype= my_charset_utf8mb3_unicode_ci.m_ctype;
- if (!cs->caseinfo)
- cs->caseinfo= &my_unicase_default;
+ if (!cs->casefold)
+ cs->casefold= &my_casefold_default;
return create_tailoring(cs, loader);
}
@@ -34762,23 +34763,23 @@ create_tailoring(struct charset_info_st *cs,
if (rules.version == 520) /* Unicode-5.2.0 requested */
{
src_uca= &my_uca_v520;
- cs->caseinfo= &my_unicase_unicode520;
+ cs->casefold= &my_casefold_unicode520;
}
else if (rules.version == 1400) /* Unicode-14.0.0 */
{
src_uca= &my_uca_v1400;
- cs->caseinfo= &my_unicase_unicode520;
+ cs->casefold= &my_casefold_unicode1400;
}
else if (rules.version == 400) /* Unicode-4.0.0 requested */
{
src_uca= &my_uca_v400;
- cs->caseinfo= &my_unicase_default;
+ cs->casefold= &my_casefold_default;
}
else /* No Unicode version specified */
{
src_uca= cs->uca ? cs->uca : &my_uca_v400;
- if (!cs->caseinfo)
- cs->caseinfo= &my_unicase_default;
+ if (!cs->casefold)
+ cs->casefold= &my_casefold_default;
}
if (rules.strength)
my_ci_set_strength(cs, rules.strength);
@@ -34855,8 +34856,7 @@ struct charset_info_st my_charset_ucs2_unicode_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -34886,8 +34886,7 @@ struct charset_info_st my_charset_ucs2_icelandic_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -34917,8 +34916,7 @@ struct charset_info_st my_charset_ucs2_latvian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -34948,8 +34946,7 @@ struct charset_info_st my_charset_ucs2_romanian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -34979,8 +34976,7 @@ struct charset_info_st my_charset_ucs2_slovenian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35010,8 +35006,7 @@ struct charset_info_st my_charset_ucs2_polish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35041,8 +35036,7 @@ struct charset_info_st my_charset_ucs2_estonian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35072,8 +35066,7 @@ struct charset_info_st my_charset_ucs2_spanish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35103,8 +35096,7 @@ struct charset_info_st my_charset_ucs2_swedish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35134,8 +35126,7 @@ struct charset_info_st my_charset_ucs2_turkish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_turkish,/* caseinfo */
+ &my_casefold_turkish,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35165,8 +35156,7 @@ struct charset_info_st my_charset_ucs2_czech_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35197,8 +35187,7 @@ struct charset_info_st my_charset_ucs2_danish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35228,8 +35217,7 @@ struct charset_info_st my_charset_ucs2_lithuanian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35259,8 +35247,7 @@ struct charset_info_st my_charset_ucs2_slovak_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35290,8 +35277,7 @@ struct charset_info_st my_charset_ucs2_spanish2_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35322,8 +35308,7 @@ struct charset_info_st my_charset_ucs2_roman_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35354,8 +35339,7 @@ struct charset_info_st my_charset_ucs2_persian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35386,8 +35370,7 @@ struct charset_info_st my_charset_ucs2_esperanto_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35418,8 +35401,7 @@ struct charset_info_st my_charset_ucs2_hungarian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35449,8 +35431,7 @@ struct charset_info_st my_charset_ucs2_sinhala_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35482,8 +35463,7 @@ struct charset_info_st my_charset_ucs2_german2_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35513,8 +35493,7 @@ struct charset_info_st my_charset_ucs2_croatian_mysql561_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35545,8 +35524,7 @@ struct charset_info_st my_charset_ucs2_croatian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35577,8 +35555,7 @@ struct charset_info_st my_charset_ucs2_myanmar_uca_ci=
&my_uca_v520, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520,/* caseinfo */
+ &my_casefold_unicode520,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35609,8 +35586,7 @@ struct charset_info_st my_charset_ucs2_thai_520_w2=
&my_uca_v520_th, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520,/* caseinfo */
+ &my_casefold_unicode520,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
4, /* strxfrm_multiply */
@@ -35640,8 +35616,7 @@ struct charset_info_st my_charset_ucs2_unicode_520_ci=
&my_uca_v520, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520,/* caseinfo */
+ &my_casefold_unicode520,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35672,8 +35647,7 @@ struct charset_info_st my_charset_ucs2_vietnamese_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35704,8 +35678,7 @@ struct charset_info_st my_charset_ucs2_unicode_nopad_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default, /* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35736,8 +35709,7 @@ struct charset_info_st my_charset_ucs2_unicode_520_nopad_ci=
&my_uca_v520, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520, /* caseinfo */
+ &my_casefold_unicode520, /* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35837,8 +35809,7 @@ struct charset_info_st my_charset_utf8mb3_unicode_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35869,8 +35840,7 @@ struct charset_info_st my_charset_utf8mb3_icelandic_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35900,8 +35870,7 @@ struct charset_info_st my_charset_utf8mb3_latvian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35931,8 +35900,7 @@ struct charset_info_st my_charset_utf8mb3_romanian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35962,8 +35930,7 @@ struct charset_info_st my_charset_utf8mb3_slovenian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -35993,8 +35960,7 @@ struct charset_info_st my_charset_utf8mb3_polish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36024,8 +35990,7 @@ struct charset_info_st my_charset_utf8mb3_estonian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36055,8 +36020,7 @@ struct charset_info_st my_charset_utf8mb3_spanish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36086,8 +36050,7 @@ struct charset_info_st my_charset_utf8mb3_swedish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36117,8 +36080,7 @@ struct charset_info_st my_charset_utf8mb3_turkish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_turkish,/* caseinfo */
+ &my_casefold_turkish,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36148,8 +36110,7 @@ struct charset_info_st my_charset_utf8mb3_czech_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36180,8 +36141,7 @@ struct charset_info_st my_charset_utf8mb3_danish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36211,8 +36171,7 @@ struct charset_info_st my_charset_utf8mb3_lithuanian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36242,8 +36201,7 @@ struct charset_info_st my_charset_utf8mb3_slovak_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36273,8 +36231,7 @@ struct charset_info_st my_charset_utf8mb3_spanish2_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36304,8 +36261,7 @@ struct charset_info_st my_charset_utf8mb3_roman_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36335,8 +36291,7 @@ struct charset_info_st my_charset_utf8mb3_persian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36366,8 +36321,7 @@ struct charset_info_st my_charset_utf8mb3_esperanto_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36397,8 +36351,7 @@ struct charset_info_st my_charset_utf8mb3_hungarian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36428,8 +36381,7 @@ struct charset_info_st my_charset_utf8mb3_sinhala_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36460,8 +36412,7 @@ struct charset_info_st my_charset_utf8mb3_german2_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36491,8 +36442,7 @@ struct charset_info_st my_charset_utf8mb3_croatian_mysql561_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36523,8 +36473,7 @@ struct charset_info_st my_charset_utf8mb3_croatian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36555,8 +36504,7 @@ struct charset_info_st my_charset_utf8mb3_myanmar_uca_ci=
&my_uca_v520, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520,/* caseinfo */
+ &my_casefold_unicode520,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36587,8 +36535,7 @@ struct charset_info_st my_charset_utf8mb3_unicode_520_ci=
&my_uca_v520, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520,/* caseinfo */
+ &my_casefold_unicode520,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36618,8 +36565,7 @@ struct charset_info_st my_charset_utf8mb3_thai_520_w2=
&my_uca_v520_th, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520,/* caseinfo */
+ &my_casefold_unicode520,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
4, /* strxfrm_multiply */
@@ -36649,8 +36595,7 @@ struct charset_info_st my_charset_utf8mb3_vietnamese_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36681,8 +36626,7 @@ struct charset_info_st my_charset_utf8mb3_unicode_nopad_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default, /* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36713,8 +36657,7 @@ struct charset_info_st my_charset_utf8mb3_unicode_520_nopad_ci=
&my_uca_v520, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520, /* caseinfo */
+ &my_casefold_unicode520, /* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36787,8 +36730,7 @@ struct charset_info_st my_charset_utf8mb4_unicode_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36819,8 +36761,7 @@ struct charset_info_st my_charset_utf8mb4_icelandic_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36850,8 +36791,7 @@ struct charset_info_st my_charset_utf8mb4_latvian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36881,8 +36821,7 @@ struct charset_info_st my_charset_utf8mb4_romanian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36912,8 +36851,7 @@ struct charset_info_st my_charset_utf8mb4_slovenian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36943,8 +36881,7 @@ struct charset_info_st my_charset_utf8mb4_polish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -36974,8 +36911,7 @@ struct charset_info_st my_charset_utf8mb4_estonian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37005,8 +36941,7 @@ struct charset_info_st my_charset_utf8mb4_spanish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37036,8 +36971,7 @@ struct charset_info_st my_charset_utf8mb4_swedish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37067,8 +37001,7 @@ struct charset_info_st my_charset_utf8mb4_turkish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_turkish, /* caseinfo */
+ &my_casefold_turkish,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37098,8 +37031,7 @@ struct charset_info_st my_charset_utf8mb4_czech_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37130,8 +37062,7 @@ struct charset_info_st my_charset_utf8mb4_danish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37161,8 +37092,7 @@ struct charset_info_st my_charset_utf8mb4_lithuanian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37192,8 +37122,7 @@ struct charset_info_st my_charset_utf8mb4_slovak_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37223,8 +37152,7 @@ struct charset_info_st my_charset_utf8mb4_spanish2_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37254,8 +37182,7 @@ struct charset_info_st my_charset_utf8mb4_roman_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37285,8 +37212,7 @@ struct charset_info_st my_charset_utf8mb4_persian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37316,8 +37242,7 @@ struct charset_info_st my_charset_utf8mb4_esperanto_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37347,8 +37272,7 @@ struct charset_info_st my_charset_utf8mb4_hungarian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37378,8 +37302,7 @@ struct charset_info_st my_charset_utf8mb4_sinhala_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37409,8 +37332,7 @@ struct charset_info_st my_charset_utf8mb4_german2_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37440,8 +37362,7 @@ struct charset_info_st my_charset_utf8mb4_croatian_mysql561_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37472,8 +37393,7 @@ struct charset_info_st my_charset_utf8mb4_croatian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37504,8 +37424,7 @@ struct charset_info_st my_charset_utf8mb4_myanmar_uca_ci=
&my_uca_v520, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520,/* caseinfo */
+ &my_casefold_unicode520,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37535,8 +37454,7 @@ struct charset_info_st my_charset_utf8mb4_thai_520_w2=
&my_uca_v520_th, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520,/* caseinfo */
+ &my_casefold_unicode520,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
4, /* strxfrm_multiply */
@@ -37566,8 +37484,7 @@ struct charset_info_st my_charset_utf8mb4_unicode_520_ci=
&my_uca_v520, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520,/* caseinfo */
+ &my_casefold_unicode520,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37598,8 +37515,7 @@ struct charset_info_st my_charset_utf8mb4_vietnamese_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37630,8 +37546,7 @@ struct charset_info_st my_charset_utf8mb4_unicode_nopad_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default, /* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37662,8 +37577,7 @@ struct charset_info_st my_charset_utf8mb4_unicode_520_nopad_ci=
&my_uca_v520, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520, /* caseinfo */
+ &my_casefold_unicode520, /* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37713,8 +37627,7 @@ struct charset_info_st my_charset_utf32_unicode_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37745,8 +37658,7 @@ struct charset_info_st my_charset_utf32_icelandic_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37776,8 +37688,7 @@ struct charset_info_st my_charset_utf32_latvian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37807,8 +37718,7 @@ struct charset_info_st my_charset_utf32_romanian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37838,8 +37748,7 @@ struct charset_info_st my_charset_utf32_slovenian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37869,8 +37778,7 @@ struct charset_info_st my_charset_utf32_polish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37900,8 +37808,7 @@ struct charset_info_st my_charset_utf32_estonian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37931,8 +37838,7 @@ struct charset_info_st my_charset_utf32_spanish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37962,8 +37868,7 @@ struct charset_info_st my_charset_utf32_swedish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -37993,8 +37898,7 @@ struct charset_info_st my_charset_utf32_turkish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_turkish, /* caseinfo */
+ &my_casefold_turkish,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38024,8 +37928,7 @@ struct charset_info_st my_charset_utf32_czech_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38056,8 +37959,7 @@ struct charset_info_st my_charset_utf32_danish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38087,8 +37989,7 @@ struct charset_info_st my_charset_utf32_lithuanian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38118,8 +38019,7 @@ struct charset_info_st my_charset_utf32_slovak_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38149,8 +38049,7 @@ struct charset_info_st my_charset_utf32_spanish2_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38180,8 +38079,7 @@ struct charset_info_st my_charset_utf32_roman_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38211,8 +38109,7 @@ struct charset_info_st my_charset_utf32_persian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38242,8 +38139,7 @@ struct charset_info_st my_charset_utf32_esperanto_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38273,8 +38169,7 @@ struct charset_info_st my_charset_utf32_hungarian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38304,8 +38199,7 @@ struct charset_info_st my_charset_utf32_sinhala_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38335,8 +38229,7 @@ struct charset_info_st my_charset_utf32_german2_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38366,8 +38259,7 @@ struct charset_info_st my_charset_utf32_croatian_mysql561_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38397,8 +38289,7 @@ struct charset_info_st my_charset_utf32_croatian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38429,8 +38320,7 @@ struct charset_info_st my_charset_utf32_myanmar_uca_ci=
&my_uca_v520, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520,/* caseinfo */
+ &my_casefold_unicode520,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38461,8 +38351,7 @@ struct charset_info_st my_charset_utf32_thai_520_w2=
&my_uca_v520_th, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520,/* caseinfo */
+ &my_casefold_unicode520,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
4, /* strxfrm_multiply */
@@ -38493,8 +38382,7 @@ struct charset_info_st my_charset_utf32_unicode_520_ci=
&my_uca_v520, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520,/* caseinfo */
+ &my_casefold_unicode520,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38525,8 +38413,7 @@ struct charset_info_st my_charset_utf32_vietnamese_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38557,8 +38444,7 @@ struct charset_info_st my_charset_utf32_unicode_nopad_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default, /* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38589,8 +38475,7 @@ struct charset_info_st my_charset_utf32_unicode_520_nopad_ci=
&my_uca_v520, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520, /* caseinfo */
+ &my_casefold_unicode520, /* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38641,8 +38526,7 @@ struct charset_info_st my_charset_utf16_unicode_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38673,8 +38557,7 @@ struct charset_info_st my_charset_utf16_icelandic_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38704,8 +38587,7 @@ struct charset_info_st my_charset_utf16_latvian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38735,8 +38617,7 @@ struct charset_info_st my_charset_utf16_romanian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38766,8 +38647,7 @@ struct charset_info_st my_charset_utf16_slovenian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38797,8 +38677,7 @@ struct charset_info_st my_charset_utf16_polish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38828,8 +38707,7 @@ struct charset_info_st my_charset_utf16_estonian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38859,8 +38737,7 @@ struct charset_info_st my_charset_utf16_spanish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38890,8 +38767,7 @@ struct charset_info_st my_charset_utf16_swedish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38921,8 +38797,7 @@ struct charset_info_st my_charset_utf16_turkish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_turkish, /* caseinfo */
+ &my_casefold_turkish,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38952,8 +38827,7 @@ struct charset_info_st my_charset_utf16_czech_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -38984,8 +38858,7 @@ struct charset_info_st my_charset_utf16_danish_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39015,8 +38888,7 @@ struct charset_info_st my_charset_utf16_lithuanian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39046,8 +38918,7 @@ struct charset_info_st my_charset_utf16_slovak_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39077,8 +38948,7 @@ struct charset_info_st my_charset_utf16_spanish2_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39108,8 +38978,7 @@ struct charset_info_st my_charset_utf16_roman_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39139,8 +39008,7 @@ struct charset_info_st my_charset_utf16_persian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39170,8 +39038,7 @@ struct charset_info_st my_charset_utf16_esperanto_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39201,8 +39068,7 @@ struct charset_info_st my_charset_utf16_hungarian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39232,8 +39098,7 @@ struct charset_info_st my_charset_utf16_sinhala_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39263,8 +39128,7 @@ struct charset_info_st my_charset_utf16_german2_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39295,8 +39159,7 @@ struct charset_info_st my_charset_utf16_croatian_mysql561_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39327,8 +39190,7 @@ struct charset_info_st my_charset_utf16_croatian_uca_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39359,8 +39221,7 @@ struct charset_info_st my_charset_utf16_myanmar_uca_ci=
&my_uca_v520, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520,/* caseinfo */
+ &my_casefold_unicode520,/* casefold*/
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39391,8 +39252,7 @@ struct charset_info_st my_charset_utf16_thai_520_w2=
&my_uca_v520_th, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520,/* caseinfo */
+ &my_casefold_unicode520,/* casefold*/
NULL, /* state_map */
NULL, /* ident_map */
4, /* strxfrm_multiply */
@@ -39423,8 +39283,7 @@ struct charset_info_st my_charset_utf16_unicode_520_ci=
&my_uca_v520, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520,/* caseinfo */
+ &my_casefold_unicode520,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39455,8 +39314,7 @@ struct charset_info_st my_charset_utf16_vietnamese_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39487,8 +39345,7 @@ struct charset_info_st my_charset_utf16_unicode_nopad_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default, /* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39519,8 +39376,7 @@ struct charset_info_st my_charset_utf16_unicode_520_nopad_ci=
&my_uca_v520, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_unicode520, /* caseinfo */
+ &my_casefold_unicode520, /* casefold */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
@@ -39599,9 +39455,9 @@ my_uca1400_collation_definition_init(MY_CHARSET_LOADER *loader,
dst->uca= &my_uca_v1400;
dst->tailoring= def->tailoring;
if (def->tailoring == turkish)
- dst->caseinfo= &my_unicase_turkish; /*TODO: unicase_1400_turkish */
+ dst->casefold= &my_casefold_unicode1400tr;
else
- dst->caseinfo= &my_unicase_unicode520; /*TODO: unicase_1400*/
+ dst->casefold= &my_casefold_unicode1400;
if (nopad)
dst->state|= MY_CS_NOPAD;
my_ci_set_level_flags(dst, (1 << MY_CS_LEVEL_BIT_PRIMARY) |
diff --git a/strings/ctype-uca.inl b/strings/ctype-uca.inl
index 9b8c271ab50..6aa72847c81 100644
--- a/strings/ctype-uca.inl
+++ b/strings/ctype-uca.inl
@@ -398,6 +398,7 @@ static inline weight_and_nchars_t
MY_FUNCTION_NAME(scanner_next_pad_trim)(my_uca_scanner *scanner,
my_uca_scanner_param *param,
size_t nchars,
+ uint flags,
uint *generated)
{
weight_and_nchars_t res;
@@ -411,7 +412,10 @@ MY_FUNCTION_NAME(scanner_next_pad_trim)(my_uca_scanner *scanner,
We reached the end of the string, but the caller wants more weights.
Perform space padding.
*/
- res.weight= my_space_weight(param->level);
+ res.weight=
+ flags & MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES ?
+ my_space_weight(param->level) : 0;
+
res.nchars= 1;
(*generated)++;
}
@@ -448,7 +452,8 @@ MY_FUNCTION_NAME(strnncollsp_nchars_onelevel)(CHARSET_INFO *cs,
const MY_UCA_WEIGHT_LEVEL *level,
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
my_uca_scanner sscanner;
my_uca_scanner tscanner;
@@ -481,16 +486,17 @@ TODO: strnncollsp_nchars_onelevel
s_res= MY_FUNCTION_NAME(scanner_next_pad_trim)(&sscanner, &param,
s_nchars_left,
- &generated);
+ flags, &generated);
t_res= MY_FUNCTION_NAME(scanner_next_pad_trim)(&tscanner, &param,
t_nchars_left,
- &generated);
+ flags, &generated);
if ((diff= (s_res.weight - t_res.weight)))
return diff;
if (generated == 2)
{
- if (cs->state & MY_CS_NOPAD)
+ if ((cs->state & MY_CS_NOPAD) &&
+ (flags & MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES))
{
/*
Both values are auto-generated. There's no real data any more.
@@ -542,11 +548,12 @@ static int
MY_FUNCTION_NAME(strnncollsp_nchars)(CHARSET_INFO *cs,
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
return MY_FUNCTION_NAME(strnncollsp_nchars_onelevel)(cs, &cs->uca->level[0],
s, slen, t, tlen,
- nchars);
+ nchars, flags);
}
@@ -557,7 +564,8 @@ static int
MY_FUNCTION_NAME(strnncollsp_nchars_multilevel)(CHARSET_INFO *cs,
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
uint i, level_flags= cs->levels_for_order;
for (i= 0; level_flags; i++, level_flags>>= 1)
@@ -569,7 +577,7 @@ MY_FUNCTION_NAME(strnncollsp_nchars_multilevel)(CHARSET_INFO *cs,
&cs->uca->level[i],
s, slen,
t, tlen,
- nchars);
+ nchars, flags);
if (ret)
return ret;
}
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index 5c41380cbc9..5d67762ac2f 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1197,17 +1197,14 @@ my_lengthsp_mb2(CHARSET_INFO *cs __attribute__((unused)),
static inline int my_weight_mb2_utf16mb2_general_ci(uchar b0, uchar b1)
{
my_wc_t wc= MY_UTF16_WC2(b0, b1);
- MY_UNICASE_CHARACTER *page= my_unicase_default_pages[wc >> 8];
- return (int) (page ? page[wc & 0xFF].sort : wc);
+ return my_general_ci_bmp_char_to_weight((uint16) wc);
}
#define MY_FUNCTION_NAME(x) my_ ## x ## _utf16_general_ci
#define DEFINE_STRNXFRM_UNICODE
#define DEFINE_STRNXFRM_UNICODE_NOPAD
#define MY_MB_WC(cs, pwc, s, e) my_mb_wc_utf16_quick(pwc, s, e)
#define OPTIMIZE_ASCII 0
-#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR
-#define UNICASE_PAGE0 my_unicase_default_page00
-#define UNICASE_PAGES my_unicase_default_pages
+#define MY_WC_WEIGHT(x) my_general_ci_char_to_weight(x)
#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x))
#define WEIGHT_MB2(b0,b1) my_weight_mb2_utf16mb2_general_ci(b0,b1)
#define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER
@@ -1284,40 +1281,6 @@ my_uni_utf16(CHARSET_INFO *cs __attribute__((unused)),
const char charset_name_utf16le[]= "utf16le";
#define charset_name_utf16le_length (sizeof(charset_name_utf16le)-1)
-static inline void
-my_tolower_utf16(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
-{
- MY_UNICASE_CHARACTER *page;
- if ((*wc <= uni_plane->maxchar) && (page= uni_plane->page[*wc >> 8]))
- *wc= page[*wc & 0xFF].tolower;
-}
-
-
-static inline void
-my_toupper_utf16(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
-{
- MY_UNICASE_CHARACTER *page;
- if ((*wc <= uni_plane->maxchar) && (page= uni_plane->page[*wc >> 8]))
- *wc= page[*wc & 0xFF].toupper;
-}
-
-
-static inline void
-my_tosort_utf16(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
-{
- if (*wc <= uni_plane->maxchar)
- {
- MY_UNICASE_CHARACTER *page;
- if ((page= uni_plane->page[*wc >> 8]))
- *wc= page[*wc & 0xFF].sort;
- }
- else
- {
- *wc= MY_CS_REPLACEMENT_CHARACTER;
- }
-}
-
-
static size_t
my_caseup_utf16(CHARSET_INFO *cs, const char *src, size_t srclen,
@@ -1329,13 +1292,13 @@ my_caseup_utf16(CHARSET_INFO *cs, const char *src, size_t srclen,
int res;
const char *srcend= src + srclen;
char *dstend= dst + dstlen;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
DBUG_ASSERT(srclen <= dstlen);
while ((src < srcend) &&
(res= mb_wc(cs, &wc, (uchar *) src, (uchar *) srcend)) > 0)
{
- my_toupper_utf16(uni_plane, &wc);
+ my_toupper_unicode(uni_plane, &wc);
if (res != wc_mb(cs, wc, (uchar *) dst, (uchar *) dstend))
break;
src+= res;
@@ -1354,12 +1317,12 @@ my_hash_sort_utf16_nopad(CHARSET_INFO *cs,
my_charset_conv_mb_wc mb_wc= cs->cset->mb_wc;
int res;
const uchar *e= s + slen;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
register ulong m1= *nr1, m2= *nr2;
while ((s < e) && (res= mb_wc(cs, &wc, (uchar *) s, (uchar *) e)) > 0)
{
- my_tosort_utf16(uni_plane, &wc);
+ my_tosort_unicode(uni_plane, &wc);
MY_HASH_ADD_16(m1, m2, wc);
s+= res;
}
@@ -1387,13 +1350,13 @@ my_casedn_utf16(CHARSET_INFO *cs, const char *src, size_t srclen,
int res;
const char *srcend= src + srclen;
char *dstend= dst + dstlen;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
DBUG_ASSERT(srclen <= dstlen);
while ((src < srcend) &&
(res= mb_wc(cs, &wc, (uchar *) src, (uchar *) srcend)) > 0)
{
- my_tolower_utf16(uni_plane, &wc);
+ my_tolower_unicode(uni_plane, &wc);
if (res != wc_mb(cs, wc, (uchar *) dst, (uchar *) dstend))
break;
src+= res;
@@ -1459,7 +1422,7 @@ my_wildcmp_utf16_ci(CHARSET_INFO *cs,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many)
{
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
return my_wildcmp_unicode(cs, str, str_end, wildstr, wildend,
escape, w_one, w_many, uni_plane);
}
@@ -1637,8 +1600,7 @@ struct charset_info_st my_charset_utf16_general_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -1669,8 +1631,7 @@ struct charset_info_st my_charset_utf16_bin=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -1701,8 +1662,7 @@ struct charset_info_st my_charset_utf16_general_nopad_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -1734,8 +1694,7 @@ struct charset_info_st my_charset_utf16_nopad_bin=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -1759,9 +1718,7 @@ struct charset_info_st my_charset_utf16_nopad_bin=
#define DEFINE_STRNXFRM_UNICODE_NOPAD
#define MY_MB_WC(cs, pwc, s, e) (my_ci_mb_wc(cs, pwc, s, e))
#define OPTIMIZE_ASCII 0
-#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR
-#define UNICASE_PAGE0 my_unicase_default_page00
-#define UNICASE_PAGES my_unicase_default_pages
+#define MY_WC_WEIGHT(x) my_general_ci_char_to_weight(x)
#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x))
#define WEIGHT_MB2(b0,b1) my_weight_mb2_utf16mb2_general_ci(b1,b0)
#define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER
@@ -1996,8 +1953,7 @@ struct charset_info_st my_charset_utf16le_general_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -2028,8 +1984,7 @@ struct charset_info_st my_charset_utf16le_bin=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -2060,8 +2015,7 @@ struct charset_info_st my_charset_utf16le_general_nopad_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -2093,8 +2047,7 @@ struct charset_info_st my_charset_utf16le_nopad_bin=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -2130,21 +2083,14 @@ static inline int my_weight_utf32_general_ci(uchar b0, uchar b1,
uchar b2, uchar b3)
{
my_wc_t wc= MY_UTF32_WC4(b0, b1, b2, b3);
- if (wc <= 0xFFFF)
- {
- MY_UNICASE_CHARACTER *page= my_unicase_default_pages[wc >> 8];
- return (int) (page ? page[wc & 0xFF].sort : wc);
- }
- return MY_CS_REPLACEMENT_CHARACTER;
+ return my_general_ci_char_to_weight(wc);
}
#define MY_FUNCTION_NAME(x) my_ ## x ## _utf32_general_ci
#define DEFINE_STRNXFRM_UNICODE
#define DEFINE_STRNXFRM_UNICODE_NOPAD
#define MY_MB_WC(cs, pwc, s, e) my_mb_wc_utf32_quick(pwc, s, e)
#define OPTIMIZE_ASCII 0
-#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR
-#define UNICASE_PAGE0 my_unicase_default_page00
-#define UNICASE_PAGES my_unicase_default_pages
+#define MY_WC_WEIGHT(x) my_general_ci_char_to_weight(x)
#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x))
#define WEIGHT_MB4(b0,b1,b2,b3) my_weight_utf32_general_ci(b0, b1, b2, b3)
#include "strcoll.inl"
@@ -2196,40 +2142,6 @@ my_uni_utf32(CHARSET_INFO *cs __attribute__((unused)),
}
-static inline void
-my_tolower_utf32(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
-{
- MY_UNICASE_CHARACTER *page;
- if ((*wc <= uni_plane->maxchar) && (page= uni_plane->page[*wc >> 8]))
- *wc= page[*wc & 0xFF].tolower;
-}
-
-
-static inline void
-my_toupper_utf32(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
-{
- MY_UNICASE_CHARACTER *page;
- if ((*wc <= uni_plane->maxchar) && (page= uni_plane->page[*wc >> 8]))
- *wc= page[*wc & 0xFF].toupper;
-}
-
-
-static inline void
-my_tosort_utf32(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
-{
- if (*wc <= uni_plane->maxchar)
- {
- MY_UNICASE_CHARACTER *page;
- if ((page= uni_plane->page[*wc >> 8]))
- *wc= page[*wc & 0xFF].sort;
- }
- else
- {
- *wc= MY_CS_REPLACEMENT_CHARACTER;
- }
-}
-
-
static size_t
my_lengthsp_utf32(CHARSET_INFO *cs __attribute__((unused)),
const char *ptr, size_t length)
@@ -2250,13 +2162,13 @@ my_caseup_utf32(CHARSET_INFO *cs, const char *src, size_t srclen,
int res;
const char *srcend= src + srclen;
char *dstend= dst + dstlen;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
DBUG_ASSERT(srclen <= dstlen);
while ((src < srcend) &&
(res= my_utf32_uni(cs, &wc, (uchar *)src, (uchar*) srcend)) > 0)
{
- my_toupper_utf32(uni_plane, &wc);
+ my_toupper_unicode(uni_plane, &wc);
if (res != my_uni_utf32(cs, wc, (uchar*) dst, (uchar*) dstend))
break;
src+= res;
@@ -2273,12 +2185,12 @@ my_hash_sort_utf32_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen,
my_wc_t wc;
int res;
const uchar *e= s + slen;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
register ulong m1= *nr1, m2= *nr2;
while ((res= my_utf32_uni(cs, &wc, (uchar*) s, (uchar*) e)) > 0)
{
- my_tosort_utf32(uni_plane, &wc);
+ my_tosort_unicode(uni_plane, &wc);
MY_HASH_ADD(m1, m2, (uint) (wc >> 24));
MY_HASH_ADD(m1, m2, (uint) (wc >> 16) & 0xFF);
MY_HASH_ADD(m1, m2, (uint) (wc >> 8) & 0xFF);
@@ -2307,12 +2219,12 @@ my_casedn_utf32(CHARSET_INFO *cs, const char *src, size_t srclen,
int res;
const char *srcend= src + srclen;
char *dstend= dst + dstlen;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
DBUG_ASSERT(srclen <= dstlen);
while ((res= my_utf32_uni(cs, &wc, (uchar*) src, (uchar*) srcend)) > 0)
{
- my_tolower_utf32(uni_plane,&wc);
+ my_tolower_unicode(uni_plane,&wc);
if (res != my_uni_utf32(cs, wc, (uchar*) dst, (uchar*) dstend))
break;
src+= res;
@@ -2661,7 +2573,7 @@ my_wildcmp_utf32_ci(CHARSET_INFO *cs,
const char *wildstr, const char *wildend,
int escape, int w_one, int w_many)
{
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
return my_wildcmp_unicode(cs, str, str_end, wildstr, wildend,
escape, w_one, w_many, uni_plane);
}
@@ -2840,8 +2752,7 @@ struct charset_info_st my_charset_utf32_general_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -2872,8 +2783,7 @@ struct charset_info_st my_charset_utf32_bin=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -2904,8 +2814,7 @@ struct charset_info_st my_charset_utf32_general_nopad_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -2937,8 +2846,7 @@ struct charset_info_st my_charset_utf32_nopad_bin=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -3028,8 +2936,14 @@ static const uchar to_upper_ucs2[] = {
static inline int my_weight_mb2_ucs2_general_ci(uchar b0, uchar b1)
{
my_wc_t wc= UCS2_CODE(b0, b1);
- MY_UNICASE_CHARACTER *page= my_unicase_default_pages[wc >> 8];
- return (int) (page ? page[wc & 0xFF].sort : wc);
+ return my_general_ci_bmp_char_to_weight((uint16) wc);
+}
+
+
+static inline int my_weight_mb2_ucs2_general_mysql500_ci(uchar b0, uchar b1)
+{
+ my_wc_t wc= UCS2_CODE(b0, b1);
+ return my_general_mysql500_ci_bmp_char_to_weight((uint16) wc);
}
@@ -3038,14 +2952,23 @@ static inline int my_weight_mb2_ucs2_general_ci(uchar b0, uchar b1)
#define DEFINE_STRNXFRM_UNICODE_NOPAD
#define MY_MB_WC(cs, pwc, s, e) my_mb_wc_ucs2_quick(pwc, s, e)
#define OPTIMIZE_ASCII 0
-#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR
-#define UNICASE_PAGE0 my_unicase_default_page00
-#define UNICASE_PAGES my_unicase_default_pages
+#define MY_WC_WEIGHT(x) my_general_ci_bmp_char_to_weight(x)
#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x))
#define WEIGHT_MB2(b0,b1) my_weight_mb2_ucs2_general_ci(b0,b1)
#include "strcoll.inl"
+
+#define MY_FUNCTION_NAME(x) my_ ## x ## _ucs2_general_mysql500_ci
+#define DEFINE_STRNXFRM_UNICODE
+#define MY_MB_WC(cs, pwc, s, e) my_mb_wc_ucs2_quick(pwc, s, e)
+#define OPTIMIZE_ASCII 0
+#define MY_WC_WEIGHT(x) my_general_mysql500_ci_bmp_char_to_weight(x)
+#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x))
+#define WEIGHT_MB2(b0,b1) my_weight_mb2_ucs2_general_mysql500_ci(b0,b1)
+#include "strcoll.inl"
+
+
#define MY_FUNCTION_NAME(x) my_ ## x ## _ucs2_bin
#define DEFINE_STRNXFRM_UNICODE_BIN2
#define MY_MB_WC(cs, pwc, s, e) my_mb_wc_ucs2_quick(pwc, s, e)
@@ -3098,32 +3021,6 @@ static int my_uni_ucs2(CHARSET_INFO *cs __attribute__((unused)) ,
}
-static inline void
-my_tolower_ucs2(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
-{
- MY_UNICASE_CHARACTER *page;
- if ((page= uni_plane->page[(*wc >> 8) & 0xFF]))
- *wc= page[*wc & 0xFF].tolower;
-}
-
-
-static inline void
-my_toupper_ucs2(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
-{
- MY_UNICASE_CHARACTER *page;
- if ((page= uni_plane->page[(*wc >> 8) & 0xFF]))
- *wc= page[*wc & 0xFF].toupper;
-}
-
-
-static inline void
-my_tosort_ucs2(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
-{
- MY_UNICASE_CHARACTER *page;
- if ((page= uni_plane->page[(*wc >> 8) & 0xFF]))
- *wc= page[*wc & 0xFF].sort;
-}
-
static size_t my_caseup_ucs2(CHARSET_INFO *cs, const char *src, size_t srclen,
char *dst, size_t dstlen)
{
@@ -3131,13 +3028,13 @@ static size_t my_caseup_ucs2(CHARSET_INFO *cs, const char *src, size_t srclen,
int res;
const char *srcend= src + srclen;
char *dstend= dst + dstlen;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
DBUG_ASSERT(srclen <= dstlen);
while ((src < srcend) &&
(res= my_ucs2_uni(cs, &wc, (uchar *)src, (uchar*) srcend)) > 0)
{
- my_toupper_ucs2(uni_plane, &wc);
+ my_toupper_unicode_bmp(uni_plane, &wc);
if (res != my_uni_ucs2(cs, wc, (uchar*) dst, (uchar*) dstend))
break;
src+= res;
@@ -3154,12 +3051,12 @@ my_hash_sort_ucs2_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen,
my_wc_t wc;
int res;
const uchar *e=s+slen;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
register ulong m1= *nr1, m2= *nr2;
while ((s < e) && (res=my_ucs2_uni(cs,&wc, (uchar *)s, (uchar*)e)) >0)
{
- my_tosort_ucs2(uni_plane, &wc);
+ my_tosort_unicode_bmp(uni_plane, &wc);
MY_HASH_ADD_16(m1, m2, wc);
s+=res;
}
@@ -3182,13 +3079,13 @@ static size_t my_casedn_ucs2(CHARSET_INFO *cs, const char *src, size_t srclen,
int res;
const char *srcend= src + srclen;
char *dstend= dst + dstlen;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
DBUG_ASSERT(srclen <= dstlen);
while ((src < srcend) &&
(res= my_ucs2_uni(cs, &wc, (uchar*) src, (uchar*) srcend)) > 0)
{
- my_tolower_ucs2(uni_plane, &wc);
+ my_tolower_unicode_bmp(uni_plane, &wc);
if (res != my_uni_ucs2(cs, wc, (uchar*) dst, (uchar*) dstend))
break;
src+= res;
@@ -3272,7 +3169,7 @@ int my_wildcmp_ucs2_ci(CHARSET_INFO *cs,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many)
{
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
return my_wildcmp_unicode(cs,str,str_end,wildstr,wildend,
escape,w_one,w_many,uni_plane);
}
@@ -3335,6 +3232,27 @@ static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler =
};
+static MY_COLLATION_HANDLER my_collation_ucs2_general_mysql500_ci_handler =
+{
+ NULL, /* init */
+ my_strnncoll_ucs2_general_mysql500_ci,
+ my_strnncollsp_ucs2_general_mysql500_ci,
+ my_strnncollsp_nchars_ucs2_general_mysql500_ci,
+ my_strnxfrm_ucs2_general_mysql500_ci,
+ my_strnxfrmlen_unicode,
+ my_like_range_generic,
+ my_wildcmp_ucs2_ci,
+ my_strcasecmp_mb2_or_mb4,
+ my_instr_mb,
+ my_hash_sort_ucs2,
+ my_propagate_simple,
+ my_min_str_mb_simple,
+ my_max_str_mb_simple,
+ my_ci_get_id_generic,
+ my_ci_get_collation_name_generic
+};
+
+
static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler =
{
NULL, /* init */
@@ -3449,8 +3367,7 @@ struct charset_info_st my_charset_ucs2_general_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -3481,8 +3398,7 @@ struct charset_info_st my_charset_ucs2_general_mysql500_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_mysql500, /* caseinfo */
+ &my_casefold_mysql500, /* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -3494,7 +3410,7 @@ struct charset_info_st my_charset_ucs2_general_mysql500_ci=
0, /* escape_with_backslash_is_dangerous */
MY_CS_COLL_LEVELS_S1,
&my_charset_ucs2_handler,
- &my_collation_ucs2_general_ci_handler
+ &my_collation_ucs2_general_mysql500_ci_handler
};
@@ -3513,8 +3429,7 @@ struct charset_info_st my_charset_ucs2_bin=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -3545,8 +3460,7 @@ struct charset_info_st my_charset_ucs2_general_nopad_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default, /* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -3577,8 +3491,7 @@ struct charset_info_st my_charset_ucs2_nopad_bin=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default, /* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index 76f000e9ed6..a5624a8c341 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -67140,7 +67140,8 @@ static const MY_CASEFOLD_CHARACTER *my_casefold_pages_ujis[512]=
static MY_CASEFOLD_INFO my_casefold_info_ujis=
{
0x0FFFF,
- my_casefold_pages_ujis
+ my_casefold_pages_ujis,
+ NULL /* ws */
};
@@ -67378,7 +67379,6 @@ struct charset_info_st my_charset_ujis_japanese_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_info_ujis,/* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -67410,7 +67410,6 @@ struct charset_info_st my_charset_ujis_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_info_ujis,/* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -67442,7 +67441,6 @@ struct charset_info_st my_charset_ujis_japanese_nopad_ci=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_info_ujis,/* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -67474,7 +67472,6 @@ struct charset_info_st my_charset_ujis_nopad_bin=
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
&my_casefold_info_ujis,/* casefold */
- NULL, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
diff --git a/strings/ctype-unicode1400-casefold-tr.h b/strings/ctype-unicode1400-casefold-tr.h
new file mode 100644
index 00000000000..25e1b5d3d59
--- /dev/null
+++ b/strings/ctype-unicode1400-casefold-tr.h
@@ -0,0 +1,704 @@
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2023, 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
+*/
+
+/*
+ Generated by:
+ ./unidata-dump \
+ --mode=casefold-tr \
+ --page-name=u1400tr_casefold_page \
+ --page-name-derived=u1400_casefold_page \
+ --index-name=my_u1400tr_casefold_index \
+ UnicodeData-14.0.0.txt
+
+*/
+const MY_CASEFOLD_CHARACTER u1400tr_casefold_page00[256]={
+ {0x0000,0x0000},{0x0001,0x0001}, /* 0000 */
+ {0x0002,0x0002},{0x0003,0x0003}, /* 0002 */
+ {0x0004,0x0004},{0x0005,0x0005}, /* 0004 */
+ {0x0006,0x0006},{0x0007,0x0007}, /* 0006 */
+ {0x0008,0x0008},{0x0009,0x0009}, /* 0008 */
+ {0x000A,0x000A},{0x000B,0x000B}, /* 000A */
+ {0x000C,0x000C},{0x000D,0x000D}, /* 000C */
+ {0x000E,0x000E},{0x000F,0x000F}, /* 000E */
+ {0x0010,0x0010},{0x0011,0x0011}, /* 0010 */
+ {0x0012,0x0012},{0x0013,0x0013}, /* 0012 */
+ {0x0014,0x0014},{0x0015,0x0015}, /* 0014 */
+ {0x0016,0x0016},{0x0017,0x0017}, /* 0016 */
+ {0x0018,0x0018},{0x0019,0x0019}, /* 0018 */
+ {0x001A,0x001A},{0x001B,0x001B}, /* 001A */
+ {0x001C,0x001C},{0x001D,0x001D}, /* 001C */
+ {0x001E,0x001E},{0x001F,0x001F}, /* 001E */
+ {0x0020,0x0020},{0x0021,0x0021}, /* 0020 */
+ {0x0022,0x0022},{0x0023,0x0023}, /* 0022 */
+ {0x0024,0x0024},{0x0025,0x0025}, /* 0024 */
+ {0x0026,0x0026},{0x0027,0x0027}, /* 0026 */
+ {0x0028,0x0028},{0x0029,0x0029}, /* 0028 */
+ {0x002A,0x002A},{0x002B,0x002B}, /* 002A */
+ {0x002C,0x002C},{0x002D,0x002D}, /* 002C */
+ {0x002E,0x002E},{0x002F,0x002F}, /* 002E */
+ {0x0030,0x0030},{0x0031,0x0031}, /* 0030 */
+ {0x0032,0x0032},{0x0033,0x0033}, /* 0032 */
+ {0x0034,0x0034},{0x0035,0x0035}, /* 0034 */
+ {0x0036,0x0036},{0x0037,0x0037}, /* 0036 */
+ {0x0038,0x0038},{0x0039,0x0039}, /* 0038 */
+ {0x003A,0x003A},{0x003B,0x003B}, /* 003A */
+ {0x003C,0x003C},{0x003D,0x003D}, /* 003C */
+ {0x003E,0x003E},{0x003F,0x003F}, /* 003E */
+ {0x0040,0x0040},{0x0041,0x0061}, /* 0040 */
+ {0x0042,0x0062},{0x0043,0x0063}, /* 0042 */
+ {0x0044,0x0064},{0x0045,0x0065}, /* 0044 */
+ {0x0046,0x0066},{0x0047,0x0067}, /* 0046 */
+ {0x0048,0x0068},{0x0049,0x0131}, /* 0048 */
+ {0x004A,0x006A},{0x004B,0x006B}, /* 004A */
+ {0x004C,0x006C},{0x004D,0x006D}, /* 004C */
+ {0x004E,0x006E},{0x004F,0x006F}, /* 004E */
+ {0x0050,0x0070},{0x0051,0x0071}, /* 0050 */
+ {0x0052,0x0072},{0x0053,0x0073}, /* 0052 */
+ {0x0054,0x0074},{0x0055,0x0075}, /* 0054 */
+ {0x0056,0x0076},{0x0057,0x0077}, /* 0056 */
+ {0x0058,0x0078},{0x0059,0x0079}, /* 0058 */
+ {0x005A,0x007A},{0x005B,0x005B}, /* 005A */
+ {0x005C,0x005C},{0x005D,0x005D}, /* 005C */
+ {0x005E,0x005E},{0x005F,0x005F}, /* 005E */
+ {0x0060,0x0060},{0x0041,0x0061}, /* 0060 */
+ {0x0042,0x0062},{0x0043,0x0063}, /* 0062 */
+ {0x0044,0x0064},{0x0045,0x0065}, /* 0064 */
+ {0x0046,0x0066},{0x0047,0x0067}, /* 0066 */
+ {0x0048,0x0068},{0x0130,0x0069}, /* 0068 */
+ {0x004A,0x006A},{0x004B,0x006B}, /* 006A */
+ {0x004C,0x006C},{0x004D,0x006D}, /* 006C */
+ {0x004E,0x006E},{0x004F,0x006F}, /* 006E */
+ {0x0050,0x0070},{0x0051,0x0071}, /* 0070 */
+ {0x0052,0x0072},{0x0053,0x0073}, /* 0072 */
+ {0x0054,0x0074},{0x0055,0x0075}, /* 0074 */
+ {0x0056,0x0076},{0x0057,0x0077}, /* 0076 */
+ {0x0058,0x0078},{0x0059,0x0079}, /* 0078 */
+ {0x005A,0x007A},{0x007B,0x007B}, /* 007A */
+ {0x007C,0x007C},{0x007D,0x007D}, /* 007C */
+ {0x007E,0x007E},{0x007F,0x007F}, /* 007E */
+ {0x0080,0x0080},{0x0081,0x0081}, /* 0080 */
+ {0x0082,0x0082},{0x0083,0x0083}, /* 0082 */
+ {0x0084,0x0084},{0x0085,0x0085}, /* 0084 */
+ {0x0086,0x0086},{0x0087,0x0087}, /* 0086 */
+ {0x0088,0x0088},{0x0089,0x0089}, /* 0088 */
+ {0x008A,0x008A},{0x008B,0x008B}, /* 008A */
+ {0x008C,0x008C},{0x008D,0x008D}, /* 008C */
+ {0x008E,0x008E},{0x008F,0x008F}, /* 008E */
+ {0x0090,0x0090},{0x0091,0x0091}, /* 0090 */
+ {0x0092,0x0092},{0x0093,0x0093}, /* 0092 */
+ {0x0094,0x0094},{0x0095,0x0095}, /* 0094 */
+ {0x0096,0x0096},{0x0097,0x0097}, /* 0096 */
+ {0x0098,0x0098},{0x0099,0x0099}, /* 0098 */
+ {0x009A,0x009A},{0x009B,0x009B}, /* 009A */
+ {0x009C,0x009C},{0x009D,0x009D}, /* 009C */
+ {0x009E,0x009E},{0x009F,0x009F}, /* 009E */
+ {0x00A0,0x00A0},{0x00A1,0x00A1}, /* 00A0 */
+ {0x00A2,0x00A2},{0x00A3,0x00A3}, /* 00A2 */
+ {0x00A4,0x00A4},{0x00A5,0x00A5}, /* 00A4 */
+ {0x00A6,0x00A6},{0x00A7,0x00A7}, /* 00A6 */
+ {0x00A8,0x00A8},{0x00A9,0x00A9}, /* 00A8 */
+ {0x00AA,0x00AA},{0x00AB,0x00AB}, /* 00AA */
+ {0x00AC,0x00AC},{0x00AD,0x00AD}, /* 00AC */
+ {0x00AE,0x00AE},{0x00AF,0x00AF}, /* 00AE */
+ {0x00B0,0x00B0},{0x00B1,0x00B1}, /* 00B0 */
+ {0x00B2,0x00B2},{0x00B3,0x00B3}, /* 00B2 */
+ {0x00B4,0x00B4},{0x039C,0x00B5}, /* 00B4 */
+ {0x00B6,0x00B6},{0x00B7,0x00B7}, /* 00B6 */
+ {0x00B8,0x00B8},{0x00B9,0x00B9}, /* 00B8 */
+ {0x00BA,0x00BA},{0x00BB,0x00BB}, /* 00BA */
+ {0x00BC,0x00BC},{0x00BD,0x00BD}, /* 00BC */
+ {0x00BE,0x00BE},{0x00BF,0x00BF}, /* 00BE */
+ {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00C0 */
+ {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00C2 */
+ {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00C4 */
+ {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00C6 */
+ {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00C8 */
+ {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00CA */
+ {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00CC */
+ {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00CE */
+ {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00D0 */
+ {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00D2 */
+ {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00D4 */
+ {0x00D6,0x00F6},{0x00D7,0x00D7}, /* 00D6 */
+ {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00D8 */
+ {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00DA */
+ {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00DC */
+ {0x00DE,0x00FE},{0x00DF,0x00DF}, /* 00DE */
+ {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00E0 */
+ {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00E2 */
+ {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00E4 */
+ {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00E6 */
+ {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00E8 */
+ {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00EA */
+ {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00EC */
+ {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00EE */
+ {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00F0 */
+ {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00F2 */
+ {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00F4 */
+ {0x00D6,0x00F6},{0x00F7,0x00F7}, /* 00F6 */
+ {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00F8 */
+ {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00FA */
+ {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00FC */
+ {0x00DE,0x00FE},{0x0178,0x00FF} /* 00FE */
+};
+
+const MY_CASEFOLD_CHARACTER * my_u1400tr_casefold_index[4352]={
+ u1400tr_casefold_page00, u1400_casefold_page01, u1400_casefold_page02, u1400_casefold_page03, u1400_casefold_page04, u1400_casefold_page05, u1400_casefold_page06, u1400_casefold_page07,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ u1400_casefold_page10, NULL, NULL, u1400_casefold_page13, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, u1400_casefold_page1C, u1400_casefold_page1D, u1400_casefold_page1E, u1400_casefold_page1F,
+ NULL, u1400_casefold_page21, NULL, NULL, u1400_casefold_page24, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, u1400_casefold_page2C, u1400_casefold_page2D, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, u1400_casefold_pageA6, u1400_casefold_pageA7,
+ NULL, NULL, NULL, u1400_casefold_pageAB, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, u1400_casefold_pageFF,
+ NULL, NULL, NULL, NULL, u1400_casefold_page104, u1400_casefold_page105, NULL, NULL,
+ NULL, NULL, NULL, NULL, u1400_casefold_page10C, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ u1400_casefold_page118, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, u1400_casefold_page16E, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, u1400_casefold_page1E9, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+};
diff --git a/strings/ctype-unicode1400-casefold.h b/strings/ctype-unicode1400-casefold.h
new file mode 100644
index 00000000000..dae180d0157
--- /dev/null
+++ b/strings/ctype-unicode1400-casefold.h
@@ -0,0 +1,4240 @@
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2023, 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
+*/
+
+/*
+ Generated by:
+ ./unidata-dump \
+ --mode=casefold \
+ --page-name=u1400_casefold_page \
+ --index-name=my_u1400_casefold_index \
+ UnicodeData-14.0.0.txt
+
+*/
+const MY_CASEFOLD_CHARACTER u1400_casefold_page00[256]={
+ {0x0000,0x0000},{0x0001,0x0001}, /* 0000 */
+ {0x0002,0x0002},{0x0003,0x0003}, /* 0002 */
+ {0x0004,0x0004},{0x0005,0x0005}, /* 0004 */
+ {0x0006,0x0006},{0x0007,0x0007}, /* 0006 */
+ {0x0008,0x0008},{0x0009,0x0009}, /* 0008 */
+ {0x000A,0x000A},{0x000B,0x000B}, /* 000A */
+ {0x000C,0x000C},{0x000D,0x000D}, /* 000C */
+ {0x000E,0x000E},{0x000F,0x000F}, /* 000E */
+ {0x0010,0x0010},{0x0011,0x0011}, /* 0010 */
+ {0x0012,0x0012},{0x0013,0x0013}, /* 0012 */
+ {0x0014,0x0014},{0x0015,0x0015}, /* 0014 */
+ {0x0016,0x0016},{0x0017,0x0017}, /* 0016 */
+ {0x0018,0x0018},{0x0019,0x0019}, /* 0018 */
+ {0x001A,0x001A},{0x001B,0x001B}, /* 001A */
+ {0x001C,0x001C},{0x001D,0x001D}, /* 001C */
+ {0x001E,0x001E},{0x001F,0x001F}, /* 001E */
+ {0x0020,0x0020},{0x0021,0x0021}, /* 0020 */
+ {0x0022,0x0022},{0x0023,0x0023}, /* 0022 */
+ {0x0024,0x0024},{0x0025,0x0025}, /* 0024 */
+ {0x0026,0x0026},{0x0027,0x0027}, /* 0026 */
+ {0x0028,0x0028},{0x0029,0x0029}, /* 0028 */
+ {0x002A,0x002A},{0x002B,0x002B}, /* 002A */
+ {0x002C,0x002C},{0x002D,0x002D}, /* 002C */
+ {0x002E,0x002E},{0x002F,0x002F}, /* 002E */
+ {0x0030,0x0030},{0x0031,0x0031}, /* 0030 */
+ {0x0032,0x0032},{0x0033,0x0033}, /* 0032 */
+ {0x0034,0x0034},{0x0035,0x0035}, /* 0034 */
+ {0x0036,0x0036},{0x0037,0x0037}, /* 0036 */
+ {0x0038,0x0038},{0x0039,0x0039}, /* 0038 */
+ {0x003A,0x003A},{0x003B,0x003B}, /* 003A */
+ {0x003C,0x003C},{0x003D,0x003D}, /* 003C */
+ {0x003E,0x003E},{0x003F,0x003F}, /* 003E */
+ {0x0040,0x0040},{0x0041,0x0061}, /* 0040 */
+ {0x0042,0x0062},{0x0043,0x0063}, /* 0042 */
+ {0x0044,0x0064},{0x0045,0x0065}, /* 0044 */
+ {0x0046,0x0066},{0x0047,0x0067}, /* 0046 */
+ {0x0048,0x0068},{0x0049,0x0069}, /* 0048 */
+ {0x004A,0x006A},{0x004B,0x006B}, /* 004A */
+ {0x004C,0x006C},{0x004D,0x006D}, /* 004C */
+ {0x004E,0x006E},{0x004F,0x006F}, /* 004E */
+ {0x0050,0x0070},{0x0051,0x0071}, /* 0050 */
+ {0x0052,0x0072},{0x0053,0x0073}, /* 0052 */
+ {0x0054,0x0074},{0x0055,0x0075}, /* 0054 */
+ {0x0056,0x0076},{0x0057,0x0077}, /* 0056 */
+ {0x0058,0x0078},{0x0059,0x0079}, /* 0058 */
+ {0x005A,0x007A},{0x005B,0x005B}, /* 005A */
+ {0x005C,0x005C},{0x005D,0x005D}, /* 005C */
+ {0x005E,0x005E},{0x005F,0x005F}, /* 005E */
+ {0x0060,0x0060},{0x0041,0x0061}, /* 0060 */
+ {0x0042,0x0062},{0x0043,0x0063}, /* 0062 */
+ {0x0044,0x0064},{0x0045,0x0065}, /* 0064 */
+ {0x0046,0x0066},{0x0047,0x0067}, /* 0066 */
+ {0x0048,0x0068},{0x0049,0x0069}, /* 0068 */
+ {0x004A,0x006A},{0x004B,0x006B}, /* 006A */
+ {0x004C,0x006C},{0x004D,0x006D}, /* 006C */
+ {0x004E,0x006E},{0x004F,0x006F}, /* 006E */
+ {0x0050,0x0070},{0x0051,0x0071}, /* 0070 */
+ {0x0052,0x0072},{0x0053,0x0073}, /* 0072 */
+ {0x0054,0x0074},{0x0055,0x0075}, /* 0074 */
+ {0x0056,0x0076},{0x0057,0x0077}, /* 0076 */
+ {0x0058,0x0078},{0x0059,0x0079}, /* 0078 */
+ {0x005A,0x007A},{0x007B,0x007B}, /* 007A */
+ {0x007C,0x007C},{0x007D,0x007D}, /* 007C */
+ {0x007E,0x007E},{0x007F,0x007F}, /* 007E */
+ {0x0080,0x0080},{0x0081,0x0081}, /* 0080 */
+ {0x0082,0x0082},{0x0083,0x0083}, /* 0082 */
+ {0x0084,0x0084},{0x0085,0x0085}, /* 0084 */
+ {0x0086,0x0086},{0x0087,0x0087}, /* 0086 */
+ {0x0088,0x0088},{0x0089,0x0089}, /* 0088 */
+ {0x008A,0x008A},{0x008B,0x008B}, /* 008A */
+ {0x008C,0x008C},{0x008D,0x008D}, /* 008C */
+ {0x008E,0x008E},{0x008F,0x008F}, /* 008E */
+ {0x0090,0x0090},{0x0091,0x0091}, /* 0090 */
+ {0x0092,0x0092},{0x0093,0x0093}, /* 0092 */
+ {0x0094,0x0094},{0x0095,0x0095}, /* 0094 */
+ {0x0096,0x0096},{0x0097,0x0097}, /* 0096 */
+ {0x0098,0x0098},{0x0099,0x0099}, /* 0098 */
+ {0x009A,0x009A},{0x009B,0x009B}, /* 009A */
+ {0x009C,0x009C},{0x009D,0x009D}, /* 009C */
+ {0x009E,0x009E},{0x009F,0x009F}, /* 009E */
+ {0x00A0,0x00A0},{0x00A1,0x00A1}, /* 00A0 */
+ {0x00A2,0x00A2},{0x00A3,0x00A3}, /* 00A2 */
+ {0x00A4,0x00A4},{0x00A5,0x00A5}, /* 00A4 */
+ {0x00A6,0x00A6},{0x00A7,0x00A7}, /* 00A6 */
+ {0x00A8,0x00A8},{0x00A9,0x00A9}, /* 00A8 */
+ {0x00AA,0x00AA},{0x00AB,0x00AB}, /* 00AA */
+ {0x00AC,0x00AC},{0x00AD,0x00AD}, /* 00AC */
+ {0x00AE,0x00AE},{0x00AF,0x00AF}, /* 00AE */
+ {0x00B0,0x00B0},{0x00B1,0x00B1}, /* 00B0 */
+ {0x00B2,0x00B2},{0x00B3,0x00B3}, /* 00B2 */
+ {0x00B4,0x00B4},{0x039C,0x00B5}, /* 00B4 */
+ {0x00B6,0x00B6},{0x00B7,0x00B7}, /* 00B6 */
+ {0x00B8,0x00B8},{0x00B9,0x00B9}, /* 00B8 */
+ {0x00BA,0x00BA},{0x00BB,0x00BB}, /* 00BA */
+ {0x00BC,0x00BC},{0x00BD,0x00BD}, /* 00BC */
+ {0x00BE,0x00BE},{0x00BF,0x00BF}, /* 00BE */
+ {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00C0 */
+ {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00C2 */
+ {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00C4 */
+ {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00C6 */
+ {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00C8 */
+ {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00CA */
+ {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00CC */
+ {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00CE */
+ {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00D0 */
+ {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00D2 */
+ {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00D4 */
+ {0x00D6,0x00F6},{0x00D7,0x00D7}, /* 00D6 */
+ {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00D8 */
+ {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00DA */
+ {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00DC */
+ {0x00DE,0x00FE},{0x00DF,0x00DF}, /* 00DE */
+ {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00E0 */
+ {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00E2 */
+ {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00E4 */
+ {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00E6 */
+ {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00E8 */
+ {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00EA */
+ {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00EC */
+ {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00EE */
+ {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00F0 */
+ {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00F2 */
+ {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00F4 */
+ {0x00D6,0x00F6},{0x00F7,0x00F7}, /* 00F6 */
+ {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00F8 */
+ {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00FA */
+ {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00FC */
+ {0x00DE,0x00FE},{0x0178,0x00FF} /* 00FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page01[256]={
+ {0x0100,0x0101},{0x0100,0x0101}, /* 0100 */
+ {0x0102,0x0103},{0x0102,0x0103}, /* 0102 */
+ {0x0104,0x0105},{0x0104,0x0105}, /* 0104 */
+ {0x0106,0x0107},{0x0106,0x0107}, /* 0106 */
+ {0x0108,0x0109},{0x0108,0x0109}, /* 0108 */
+ {0x010A,0x010B},{0x010A,0x010B}, /* 010A */
+ {0x010C,0x010D},{0x010C,0x010D}, /* 010C */
+ {0x010E,0x010F},{0x010E,0x010F}, /* 010E */
+ {0x0110,0x0111},{0x0110,0x0111}, /* 0110 */
+ {0x0112,0x0113},{0x0112,0x0113}, /* 0112 */
+ {0x0114,0x0115},{0x0114,0x0115}, /* 0114 */
+ {0x0116,0x0117},{0x0116,0x0117}, /* 0116 */
+ {0x0118,0x0119},{0x0118,0x0119}, /* 0118 */
+ {0x011A,0x011B},{0x011A,0x011B}, /* 011A */
+ {0x011C,0x011D},{0x011C,0x011D}, /* 011C */
+ {0x011E,0x011F},{0x011E,0x011F}, /* 011E */
+ {0x0120,0x0121},{0x0120,0x0121}, /* 0120 */
+ {0x0122,0x0123},{0x0122,0x0123}, /* 0122 */
+ {0x0124,0x0125},{0x0124,0x0125}, /* 0124 */
+ {0x0126,0x0127},{0x0126,0x0127}, /* 0126 */
+ {0x0128,0x0129},{0x0128,0x0129}, /* 0128 */
+ {0x012A,0x012B},{0x012A,0x012B}, /* 012A */
+ {0x012C,0x012D},{0x012C,0x012D}, /* 012C */
+ {0x012E,0x012F},{0x012E,0x012F}, /* 012E */
+ {0x0130,0x0069},{0x0049,0x0131}, /* 0130 */
+ {0x0132,0x0133},{0x0132,0x0133}, /* 0132 */
+ {0x0134,0x0135},{0x0134,0x0135}, /* 0134 */
+ {0x0136,0x0137},{0x0136,0x0137}, /* 0136 */
+ {0x0138,0x0138},{0x0139,0x013A}, /* 0138 */
+ {0x0139,0x013A},{0x013B,0x013C}, /* 013A */
+ {0x013B,0x013C},{0x013D,0x013E}, /* 013C */
+ {0x013D,0x013E},{0x013F,0x0140}, /* 013E */
+ {0x013F,0x0140},{0x0141,0x0142}, /* 0140 */
+ {0x0141,0x0142},{0x0143,0x0144}, /* 0142 */
+ {0x0143,0x0144},{0x0145,0x0146}, /* 0144 */
+ {0x0145,0x0146},{0x0147,0x0148}, /* 0146 */
+ {0x0147,0x0148},{0x0149,0x0149}, /* 0148 */
+ {0x014A,0x014B},{0x014A,0x014B}, /* 014A */
+ {0x014C,0x014D},{0x014C,0x014D}, /* 014C */
+ {0x014E,0x014F},{0x014E,0x014F}, /* 014E */
+ {0x0150,0x0151},{0x0150,0x0151}, /* 0150 */
+ {0x0152,0x0153},{0x0152,0x0153}, /* 0152 */
+ {0x0154,0x0155},{0x0154,0x0155}, /* 0154 */
+ {0x0156,0x0157},{0x0156,0x0157}, /* 0156 */
+ {0x0158,0x0159},{0x0158,0x0159}, /* 0158 */
+ {0x015A,0x015B},{0x015A,0x015B}, /* 015A */
+ {0x015C,0x015D},{0x015C,0x015D}, /* 015C */
+ {0x015E,0x015F},{0x015E,0x015F}, /* 015E */
+ {0x0160,0x0161},{0x0160,0x0161}, /* 0160 */
+ {0x0162,0x0163},{0x0162,0x0163}, /* 0162 */
+ {0x0164,0x0165},{0x0164,0x0165}, /* 0164 */
+ {0x0166,0x0167},{0x0166,0x0167}, /* 0166 */
+ {0x0168,0x0169},{0x0168,0x0169}, /* 0168 */
+ {0x016A,0x016B},{0x016A,0x016B}, /* 016A */
+ {0x016C,0x016D},{0x016C,0x016D}, /* 016C */
+ {0x016E,0x016F},{0x016E,0x016F}, /* 016E */
+ {0x0170,0x0171},{0x0170,0x0171}, /* 0170 */
+ {0x0172,0x0173},{0x0172,0x0173}, /* 0172 */
+ {0x0174,0x0175},{0x0174,0x0175}, /* 0174 */
+ {0x0176,0x0177},{0x0176,0x0177}, /* 0176 */
+ {0x0178,0x00FF},{0x0179,0x017A}, /* 0178 */
+ {0x0179,0x017A},{0x017B,0x017C}, /* 017A */
+ {0x017B,0x017C},{0x017D,0x017E}, /* 017C */
+ {0x017D,0x017E},{0x0053,0x017F}, /* 017E */
+ {0x0243,0x0180},{0x0181,0x0253}, /* 0180 */
+ {0x0182,0x0183},{0x0182,0x0183}, /* 0182 */
+ {0x0184,0x0185},{0x0184,0x0185}, /* 0184 */
+ {0x0186,0x0254},{0x0187,0x0188}, /* 0186 */
+ {0x0187,0x0188},{0x0189,0x0256}, /* 0188 */
+ {0x018A,0x0257},{0x018B,0x018C}, /* 018A */
+ {0x018B,0x018C},{0x018D,0x018D}, /* 018C */
+ {0x018E,0x01DD},{0x018F,0x0259}, /* 018E */
+ {0x0190,0x025B},{0x0191,0x0192}, /* 0190 */
+ {0x0191,0x0192},{0x0193,0x0260}, /* 0192 */
+ {0x0194,0x0263},{0x01F6,0x0195}, /* 0194 */
+ {0x0196,0x0269},{0x0197,0x0268}, /* 0196 */
+ {0x0198,0x0199},{0x0198,0x0199}, /* 0198 */
+ {0x023D,0x019A},{0x019B,0x019B}, /* 019A */
+ {0x019C,0x026F},{0x019D,0x0272}, /* 019C */
+ {0x0220,0x019E},{0x019F,0x0275}, /* 019E */
+ {0x01A0,0x01A1},{0x01A0,0x01A1}, /* 01A0 */
+ {0x01A2,0x01A3},{0x01A2,0x01A3}, /* 01A2 */
+ {0x01A4,0x01A5},{0x01A4,0x01A5}, /* 01A4 */
+ {0x01A6,0x0280},{0x01A7,0x01A8}, /* 01A6 */
+ {0x01A7,0x01A8},{0x01A9,0x0283}, /* 01A8 */
+ {0x01AA,0x01AA},{0x01AB,0x01AB}, /* 01AA */
+ {0x01AC,0x01AD},{0x01AC,0x01AD}, /* 01AC */
+ {0x01AE,0x0288},{0x01AF,0x01B0}, /* 01AE */
+ {0x01AF,0x01B0},{0x01B1,0x028A}, /* 01B0 */
+ {0x01B2,0x028B},{0x01B3,0x01B4}, /* 01B2 */
+ {0x01B3,0x01B4},{0x01B5,0x01B6}, /* 01B4 */
+ {0x01B5,0x01B6},{0x01B7,0x0292}, /* 01B6 */
+ {0x01B8,0x01B9},{0x01B8,0x01B9}, /* 01B8 */
+ {0x01BA,0x01BA},{0x01BB,0x01BB}, /* 01BA */
+ {0x01BC,0x01BD},{0x01BC,0x01BD}, /* 01BC */
+ {0x01BE,0x01BE},{0x01F7,0x01BF}, /* 01BE */
+ {0x01C0,0x01C0},{0x01C1,0x01C1}, /* 01C0 */
+ {0x01C2,0x01C2},{0x01C3,0x01C3}, /* 01C2 */
+ {0x01C4,0x01C6},{0x01C4,0x01C6}, /* 01C4 */
+ {0x01C4,0x01C6},{0x01C7,0x01C9}, /* 01C6 */
+ {0x01C7,0x01C9},{0x01C7,0x01C9}, /* 01C8 */
+ {0x01CA,0x01CC},{0x01CA,0x01CC}, /* 01CA */
+ {0x01CA,0x01CC},{0x01CD,0x01CE}, /* 01CC */
+ {0x01CD,0x01CE},{0x01CF,0x01D0}, /* 01CE */
+ {0x01CF,0x01D0},{0x01D1,0x01D2}, /* 01D0 */
+ {0x01D1,0x01D2},{0x01D3,0x01D4}, /* 01D2 */
+ {0x01D3,0x01D4},{0x01D5,0x01D6}, /* 01D4 */
+ {0x01D5,0x01D6},{0x01D7,0x01D8}, /* 01D6 */
+ {0x01D7,0x01D8},{0x01D9,0x01DA}, /* 01D8 */
+ {0x01D9,0x01DA},{0x01DB,0x01DC}, /* 01DA */
+ {0x01DB,0x01DC},{0x018E,0x01DD}, /* 01DC */
+ {0x01DE,0x01DF},{0x01DE,0x01DF}, /* 01DE */
+ {0x01E0,0x01E1},{0x01E0,0x01E1}, /* 01E0 */
+ {0x01E2,0x01E3},{0x01E2,0x01E3}, /* 01E2 */
+ {0x01E4,0x01E5},{0x01E4,0x01E5}, /* 01E4 */
+ {0x01E6,0x01E7},{0x01E6,0x01E7}, /* 01E6 */
+ {0x01E8,0x01E9},{0x01E8,0x01E9}, /* 01E8 */
+ {0x01EA,0x01EB},{0x01EA,0x01EB}, /* 01EA */
+ {0x01EC,0x01ED},{0x01EC,0x01ED}, /* 01EC */
+ {0x01EE,0x01EF},{0x01EE,0x01EF}, /* 01EE */
+ {0x01F0,0x01F0},{0x01F1,0x01F3}, /* 01F0 */
+ {0x01F1,0x01F3},{0x01F1,0x01F3}, /* 01F2 */
+ {0x01F4,0x01F5},{0x01F4,0x01F5}, /* 01F4 */
+ {0x01F6,0x0195},{0x01F7,0x01BF}, /* 01F6 */
+ {0x01F8,0x01F9},{0x01F8,0x01F9}, /* 01F8 */
+ {0x01FA,0x01FB},{0x01FA,0x01FB}, /* 01FA */
+ {0x01FC,0x01FD},{0x01FC,0x01FD}, /* 01FC */
+ {0x01FE,0x01FF},{0x01FE,0x01FF} /* 01FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page02[256]={
+ {0x0200,0x0201},{0x0200,0x0201}, /* 0200 */
+ {0x0202,0x0203},{0x0202,0x0203}, /* 0202 */
+ {0x0204,0x0205},{0x0204,0x0205}, /* 0204 */
+ {0x0206,0x0207},{0x0206,0x0207}, /* 0206 */
+ {0x0208,0x0209},{0x0208,0x0209}, /* 0208 */
+ {0x020A,0x020B},{0x020A,0x020B}, /* 020A */
+ {0x020C,0x020D},{0x020C,0x020D}, /* 020C */
+ {0x020E,0x020F},{0x020E,0x020F}, /* 020E */
+ {0x0210,0x0211},{0x0210,0x0211}, /* 0210 */
+ {0x0212,0x0213},{0x0212,0x0213}, /* 0212 */
+ {0x0214,0x0215},{0x0214,0x0215}, /* 0214 */
+ {0x0216,0x0217},{0x0216,0x0217}, /* 0216 */
+ {0x0218,0x0219},{0x0218,0x0219}, /* 0218 */
+ {0x021A,0x021B},{0x021A,0x021B}, /* 021A */
+ {0x021C,0x021D},{0x021C,0x021D}, /* 021C */
+ {0x021E,0x021F},{0x021E,0x021F}, /* 021E */
+ {0x0220,0x019E},{0x0221,0x0221}, /* 0220 */
+ {0x0222,0x0223},{0x0222,0x0223}, /* 0222 */
+ {0x0224,0x0225},{0x0224,0x0225}, /* 0224 */
+ {0x0226,0x0227},{0x0226,0x0227}, /* 0226 */
+ {0x0228,0x0229},{0x0228,0x0229}, /* 0228 */
+ {0x022A,0x022B},{0x022A,0x022B}, /* 022A */
+ {0x022C,0x022D},{0x022C,0x022D}, /* 022C */
+ {0x022E,0x022F},{0x022E,0x022F}, /* 022E */
+ {0x0230,0x0231},{0x0230,0x0231}, /* 0230 */
+ {0x0232,0x0233},{0x0232,0x0233}, /* 0232 */
+ {0x0234,0x0234},{0x0235,0x0235}, /* 0234 */
+ {0x0236,0x0236},{0x0237,0x0237}, /* 0236 */
+ {0x0238,0x0238},{0x0239,0x0239}, /* 0238 */
+ {0x023A,0x2C65},{0x023B,0x023C}, /* 023A */
+ {0x023B,0x023C},{0x023D,0x019A}, /* 023C */
+ {0x023E,0x2C66},{0x2C7E,0x023F}, /* 023E */
+ {0x2C7F,0x0240},{0x0241,0x0242}, /* 0240 */
+ {0x0241,0x0242},{0x0243,0x0180}, /* 0242 */
+ {0x0244,0x0289},{0x0245,0x028C}, /* 0244 */
+ {0x0246,0x0247},{0x0246,0x0247}, /* 0246 */
+ {0x0248,0x0249},{0x0248,0x0249}, /* 0248 */
+ {0x024A,0x024B},{0x024A,0x024B}, /* 024A */
+ {0x024C,0x024D},{0x024C,0x024D}, /* 024C */
+ {0x024E,0x024F},{0x024E,0x024F}, /* 024E */
+ {0x2C6F,0x0250},{0x2C6D,0x0251}, /* 0250 */
+ {0x2C70,0x0252},{0x0181,0x0253}, /* 0252 */
+ {0x0186,0x0254},{0x0255,0x0255}, /* 0254 */
+ {0x0189,0x0256},{0x018A,0x0257}, /* 0256 */
+ {0x0258,0x0258},{0x018F,0x0259}, /* 0258 */
+ {0x025A,0x025A},{0x0190,0x025B}, /* 025A */
+ {0xA7AB,0x025C},{0x025D,0x025D}, /* 025C */
+ {0x025E,0x025E},{0x025F,0x025F}, /* 025E */
+ {0x0193,0x0260},{0xA7AC,0x0261}, /* 0260 */
+ {0x0262,0x0262},{0x0194,0x0263}, /* 0262 */
+ {0x0264,0x0264},{0xA78D,0x0265}, /* 0264 */
+ {0xA7AA,0x0266},{0x0267,0x0267}, /* 0266 */
+ {0x0197,0x0268},{0x0196,0x0269}, /* 0268 */
+ {0xA7AE,0x026A},{0x2C62,0x026B}, /* 026A */
+ {0xA7AD,0x026C},{0x026D,0x026D}, /* 026C */
+ {0x026E,0x026E},{0x019C,0x026F}, /* 026E */
+ {0x0270,0x0270},{0x2C6E,0x0271}, /* 0270 */
+ {0x019D,0x0272},{0x0273,0x0273}, /* 0272 */
+ {0x0274,0x0274},{0x019F,0x0275}, /* 0274 */
+ {0x0276,0x0276},{0x0277,0x0277}, /* 0276 */
+ {0x0278,0x0278},{0x0279,0x0279}, /* 0278 */
+ {0x027A,0x027A},{0x027B,0x027B}, /* 027A */
+ {0x027C,0x027C},{0x2C64,0x027D}, /* 027C */
+ {0x027E,0x027E},{0x027F,0x027F}, /* 027E */
+ {0x01A6,0x0280},{0x0281,0x0281}, /* 0280 */
+ {0xA7C5,0x0282},{0x01A9,0x0283}, /* 0282 */
+ {0x0284,0x0284},{0x0285,0x0285}, /* 0284 */
+ {0x0286,0x0286},{0xA7B1,0x0287}, /* 0286 */
+ {0x01AE,0x0288},{0x0244,0x0289}, /* 0288 */
+ {0x01B1,0x028A},{0x01B2,0x028B}, /* 028A */
+ {0x0245,0x028C},{0x028D,0x028D}, /* 028C */
+ {0x028E,0x028E},{0x028F,0x028F}, /* 028E */
+ {0x0290,0x0290},{0x0291,0x0291}, /* 0290 */
+ {0x01B7,0x0292},{0x0293,0x0293}, /* 0292 */
+ {0x0294,0x0294},{0x0295,0x0295}, /* 0294 */
+ {0x0296,0x0296},{0x0297,0x0297}, /* 0296 */
+ {0x0298,0x0298},{0x0299,0x0299}, /* 0298 */
+ {0x029A,0x029A},{0x029B,0x029B}, /* 029A */
+ {0x029C,0x029C},{0xA7B2,0x029D}, /* 029C */
+ {0xA7B0,0x029E},{0x029F,0x029F}, /* 029E */
+ {0x02A0,0x02A0},{0x02A1,0x02A1}, /* 02A0 */
+ {0x02A2,0x02A2},{0x02A3,0x02A3}, /* 02A2 */
+ {0x02A4,0x02A4},{0x02A5,0x02A5}, /* 02A4 */
+ {0x02A6,0x02A6},{0x02A7,0x02A7}, /* 02A6 */
+ {0x02A8,0x02A8},{0x02A9,0x02A9}, /* 02A8 */
+ {0x02AA,0x02AA},{0x02AB,0x02AB}, /* 02AA */
+ {0x02AC,0x02AC},{0x02AD,0x02AD}, /* 02AC */
+ {0x02AE,0x02AE},{0x02AF,0x02AF}, /* 02AE */
+ {0x02B0,0x02B0},{0x02B1,0x02B1}, /* 02B0 */
+ {0x02B2,0x02B2},{0x02B3,0x02B3}, /* 02B2 */
+ {0x02B4,0x02B4},{0x02B5,0x02B5}, /* 02B4 */
+ {0x02B6,0x02B6},{0x02B7,0x02B7}, /* 02B6 */
+ {0x02B8,0x02B8},{0x02B9,0x02B9}, /* 02B8 */
+ {0x02BA,0x02BA},{0x02BB,0x02BB}, /* 02BA */
+ {0x02BC,0x02BC},{0x02BD,0x02BD}, /* 02BC */
+ {0x02BE,0x02BE},{0x02BF,0x02BF}, /* 02BE */
+ {0x02C0,0x02C0},{0x02C1,0x02C1}, /* 02C0 */
+ {0x02C2,0x02C2},{0x02C3,0x02C3}, /* 02C2 */
+ {0x02C4,0x02C4},{0x02C5,0x02C5}, /* 02C4 */
+ {0x02C6,0x02C6},{0x02C7,0x02C7}, /* 02C6 */
+ {0x02C8,0x02C8},{0x02C9,0x02C9}, /* 02C8 */
+ {0x02CA,0x02CA},{0x02CB,0x02CB}, /* 02CA */
+ {0x02CC,0x02CC},{0x02CD,0x02CD}, /* 02CC */
+ {0x02CE,0x02CE},{0x02CF,0x02CF}, /* 02CE */
+ {0x02D0,0x02D0},{0x02D1,0x02D1}, /* 02D0 */
+ {0x02D2,0x02D2},{0x02D3,0x02D3}, /* 02D2 */
+ {0x02D4,0x02D4},{0x02D5,0x02D5}, /* 02D4 */
+ {0x02D6,0x02D6},{0x02D7,0x02D7}, /* 02D6 */
+ {0x02D8,0x02D8},{0x02D9,0x02D9}, /* 02D8 */
+ {0x02DA,0x02DA},{0x02DB,0x02DB}, /* 02DA */
+ {0x02DC,0x02DC},{0x02DD,0x02DD}, /* 02DC */
+ {0x02DE,0x02DE},{0x02DF,0x02DF}, /* 02DE */
+ {0x02E0,0x02E0},{0x02E1,0x02E1}, /* 02E0 */
+ {0x02E2,0x02E2},{0x02E3,0x02E3}, /* 02E2 */
+ {0x02E4,0x02E4},{0x02E5,0x02E5}, /* 02E4 */
+ {0x02E6,0x02E6},{0x02E7,0x02E7}, /* 02E6 */
+ {0x02E8,0x02E8},{0x02E9,0x02E9}, /* 02E8 */
+ {0x02EA,0x02EA},{0x02EB,0x02EB}, /* 02EA */
+ {0x02EC,0x02EC},{0x02ED,0x02ED}, /* 02EC */
+ {0x02EE,0x02EE},{0x02EF,0x02EF}, /* 02EE */
+ {0x02F0,0x02F0},{0x02F1,0x02F1}, /* 02F0 */
+ {0x02F2,0x02F2},{0x02F3,0x02F3}, /* 02F2 */
+ {0x02F4,0x02F4},{0x02F5,0x02F5}, /* 02F4 */
+ {0x02F6,0x02F6},{0x02F7,0x02F7}, /* 02F6 */
+ {0x02F8,0x02F8},{0x02F9,0x02F9}, /* 02F8 */
+ {0x02FA,0x02FA},{0x02FB,0x02FB}, /* 02FA */
+ {0x02FC,0x02FC},{0x02FD,0x02FD}, /* 02FC */
+ {0x02FE,0x02FE},{0x02FF,0x02FF} /* 02FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page03[256]={
+ {0x0300,0x0300},{0x0301,0x0301}, /* 0300 */
+ {0x0302,0x0302},{0x0303,0x0303}, /* 0302 */
+ {0x0304,0x0304},{0x0305,0x0305}, /* 0304 */
+ {0x0306,0x0306},{0x0307,0x0307}, /* 0306 */
+ {0x0308,0x0308},{0x0309,0x0309}, /* 0308 */
+ {0x030A,0x030A},{0x030B,0x030B}, /* 030A */
+ {0x030C,0x030C},{0x030D,0x030D}, /* 030C */
+ {0x030E,0x030E},{0x030F,0x030F}, /* 030E */
+ {0x0310,0x0310},{0x0311,0x0311}, /* 0310 */
+ {0x0312,0x0312},{0x0313,0x0313}, /* 0312 */
+ {0x0314,0x0314},{0x0315,0x0315}, /* 0314 */
+ {0x0316,0x0316},{0x0317,0x0317}, /* 0316 */
+ {0x0318,0x0318},{0x0319,0x0319}, /* 0318 */
+ {0x031A,0x031A},{0x031B,0x031B}, /* 031A */
+ {0x031C,0x031C},{0x031D,0x031D}, /* 031C */
+ {0x031E,0x031E},{0x031F,0x031F}, /* 031E */
+ {0x0320,0x0320},{0x0321,0x0321}, /* 0320 */
+ {0x0322,0x0322},{0x0323,0x0323}, /* 0322 */
+ {0x0324,0x0324},{0x0325,0x0325}, /* 0324 */
+ {0x0326,0x0326},{0x0327,0x0327}, /* 0326 */
+ {0x0328,0x0328},{0x0329,0x0329}, /* 0328 */
+ {0x032A,0x032A},{0x032B,0x032B}, /* 032A */
+ {0x032C,0x032C},{0x032D,0x032D}, /* 032C */
+ {0x032E,0x032E},{0x032F,0x032F}, /* 032E */
+ {0x0330,0x0330},{0x0331,0x0331}, /* 0330 */
+ {0x0332,0x0332},{0x0333,0x0333}, /* 0332 */
+ {0x0334,0x0334},{0x0335,0x0335}, /* 0334 */
+ {0x0336,0x0336},{0x0337,0x0337}, /* 0336 */
+ {0x0338,0x0338},{0x0339,0x0339}, /* 0338 */
+ {0x033A,0x033A},{0x033B,0x033B}, /* 033A */
+ {0x033C,0x033C},{0x033D,0x033D}, /* 033C */
+ {0x033E,0x033E},{0x033F,0x033F}, /* 033E */
+ {0x0340,0x0340},{0x0341,0x0341}, /* 0340 */
+ {0x0342,0x0342},{0x0343,0x0343}, /* 0342 */
+ {0x0344,0x0344},{0x0399,0x0345}, /* 0344 */
+ {0x0346,0x0346},{0x0347,0x0347}, /* 0346 */
+ {0x0348,0x0348},{0x0349,0x0349}, /* 0348 */
+ {0x034A,0x034A},{0x034B,0x034B}, /* 034A */
+ {0x034C,0x034C},{0x034D,0x034D}, /* 034C */
+ {0x034E,0x034E},{0x034F,0x034F}, /* 034E */
+ {0x0350,0x0350},{0x0351,0x0351}, /* 0350 */
+ {0x0352,0x0352},{0x0353,0x0353}, /* 0352 */
+ {0x0354,0x0354},{0x0355,0x0355}, /* 0354 */
+ {0x0356,0x0356},{0x0357,0x0357}, /* 0356 */
+ {0x0358,0x0358},{0x0359,0x0359}, /* 0358 */
+ {0x035A,0x035A},{0x035B,0x035B}, /* 035A */
+ {0x035C,0x035C},{0x035D,0x035D}, /* 035C */
+ {0x035E,0x035E},{0x035F,0x035F}, /* 035E */
+ {0x0360,0x0360},{0x0361,0x0361}, /* 0360 */
+ {0x0362,0x0362},{0x0363,0x0363}, /* 0362 */
+ {0x0364,0x0364},{0x0365,0x0365}, /* 0364 */
+ {0x0366,0x0366},{0x0367,0x0367}, /* 0366 */
+ {0x0368,0x0368},{0x0369,0x0369}, /* 0368 */
+ {0x036A,0x036A},{0x036B,0x036B}, /* 036A */
+ {0x036C,0x036C},{0x036D,0x036D}, /* 036C */
+ {0x036E,0x036E},{0x036F,0x036F}, /* 036E */
+ {0x0370,0x0371},{0x0370,0x0371}, /* 0370 */
+ {0x0372,0x0373},{0x0372,0x0373}, /* 0372 */
+ {0x0374,0x0374},{0x0375,0x0375}, /* 0374 */
+ {0x0376,0x0377},{0x0376,0x0377}, /* 0376 */
+ {0x0378,0x0378},{0x0379,0x0379}, /* 0378 */
+ {0x037A,0x037A},{0x03FD,0x037B}, /* 037A */
+ {0x03FE,0x037C},{0x03FF,0x037D}, /* 037C */
+ {0x037E,0x037E},{0x037F,0x03F3}, /* 037E */
+ {0x0380,0x0380},{0x0381,0x0381}, /* 0380 */
+ {0x0382,0x0382},{0x0383,0x0383}, /* 0382 */
+ {0x0384,0x0384},{0x0385,0x0385}, /* 0384 */
+ {0x0386,0x03AC},{0x0387,0x0387}, /* 0386 */
+ {0x0388,0x03AD},{0x0389,0x03AE}, /* 0388 */
+ {0x038A,0x03AF},{0x038B,0x038B}, /* 038A */
+ {0x038C,0x03CC},{0x038D,0x038D}, /* 038C */
+ {0x038E,0x03CD},{0x038F,0x03CE}, /* 038E */
+ {0x0390,0x0390},{0x0391,0x03B1}, /* 0390 */
+ {0x0392,0x03B2},{0x0393,0x03B3}, /* 0392 */
+ {0x0394,0x03B4},{0x0395,0x03B5}, /* 0394 */
+ {0x0396,0x03B6},{0x0397,0x03B7}, /* 0396 */
+ {0x0398,0x03B8},{0x0399,0x03B9}, /* 0398 */
+ {0x039A,0x03BA},{0x039B,0x03BB}, /* 039A */
+ {0x039C,0x03BC},{0x039D,0x03BD}, /* 039C */
+ {0x039E,0x03BE},{0x039F,0x03BF}, /* 039E */
+ {0x03A0,0x03C0},{0x03A1,0x03C1}, /* 03A0 */
+ {0x03A2,0x03A2},{0x03A3,0x03C3}, /* 03A2 */
+ {0x03A4,0x03C4},{0x03A5,0x03C5}, /* 03A4 */
+ {0x03A6,0x03C6},{0x03A7,0x03C7}, /* 03A6 */
+ {0x03A8,0x03C8},{0x03A9,0x03C9}, /* 03A8 */
+ {0x03AA,0x03CA},{0x03AB,0x03CB}, /* 03AA */
+ {0x0386,0x03AC},{0x0388,0x03AD}, /* 03AC */
+ {0x0389,0x03AE},{0x038A,0x03AF}, /* 03AE */
+ {0x03B0,0x03B0},{0x0391,0x03B1}, /* 03B0 */
+ {0x0392,0x03B2},{0x0393,0x03B3}, /* 03B2 */
+ {0x0394,0x03B4},{0x0395,0x03B5}, /* 03B4 */
+ {0x0396,0x03B6},{0x0397,0x03B7}, /* 03B6 */
+ {0x0398,0x03B8},{0x0399,0x03B9}, /* 03B8 */
+ {0x039A,0x03BA},{0x039B,0x03BB}, /* 03BA */
+ {0x039C,0x03BC},{0x039D,0x03BD}, /* 03BC */
+ {0x039E,0x03BE},{0x039F,0x03BF}, /* 03BE */
+ {0x03A0,0x03C0},{0x03A1,0x03C1}, /* 03C0 */
+ {0x03A3,0x03C2},{0x03A3,0x03C3}, /* 03C2 */
+ {0x03A4,0x03C4},{0x03A5,0x03C5}, /* 03C4 */
+ {0x03A6,0x03C6},{0x03A7,0x03C7}, /* 03C6 */
+ {0x03A8,0x03C8},{0x03A9,0x03C9}, /* 03C8 */
+ {0x03AA,0x03CA},{0x03AB,0x03CB}, /* 03CA */
+ {0x038C,0x03CC},{0x038E,0x03CD}, /* 03CC */
+ {0x038F,0x03CE},{0x03CF,0x03D7}, /* 03CE */
+ {0x0392,0x03D0},{0x0398,0x03D1}, /* 03D0 */
+ {0x03D2,0x03D2},{0x03D3,0x03D3}, /* 03D2 */
+ {0x03D4,0x03D4},{0x03A6,0x03D5}, /* 03D4 */
+ {0x03A0,0x03D6},{0x03CF,0x03D7}, /* 03D6 */
+ {0x03D8,0x03D9},{0x03D8,0x03D9}, /* 03D8 */
+ {0x03DA,0x03DB},{0x03DA,0x03DB}, /* 03DA */
+ {0x03DC,0x03DD},{0x03DC,0x03DD}, /* 03DC */
+ {0x03DE,0x03DF},{0x03DE,0x03DF}, /* 03DE */
+ {0x03E0,0x03E1},{0x03E0,0x03E1}, /* 03E0 */
+ {0x03E2,0x03E3},{0x03E2,0x03E3}, /* 03E2 */
+ {0x03E4,0x03E5},{0x03E4,0x03E5}, /* 03E4 */
+ {0x03E6,0x03E7},{0x03E6,0x03E7}, /* 03E6 */
+ {0x03E8,0x03E9},{0x03E8,0x03E9}, /* 03E8 */
+ {0x03EA,0x03EB},{0x03EA,0x03EB}, /* 03EA */
+ {0x03EC,0x03ED},{0x03EC,0x03ED}, /* 03EC */
+ {0x03EE,0x03EF},{0x03EE,0x03EF}, /* 03EE */
+ {0x039A,0x03F0},{0x03A1,0x03F1}, /* 03F0 */
+ {0x03F9,0x03F2},{0x037F,0x03F3}, /* 03F2 */
+ {0x03F4,0x03B8},{0x0395,0x03F5}, /* 03F4 */
+ {0x03F6,0x03F6},{0x03F7,0x03F8}, /* 03F6 */
+ {0x03F7,0x03F8},{0x03F9,0x03F2}, /* 03F8 */
+ {0x03FA,0x03FB},{0x03FA,0x03FB}, /* 03FA */
+ {0x03FC,0x03FC},{0x03FD,0x037B}, /* 03FC */
+ {0x03FE,0x037C},{0x03FF,0x037D} /* 03FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page04[256]={
+ {0x0400,0x0450},{0x0401,0x0451}, /* 0400 */
+ {0x0402,0x0452},{0x0403,0x0453}, /* 0402 */
+ {0x0404,0x0454},{0x0405,0x0455}, /* 0404 */
+ {0x0406,0x0456},{0x0407,0x0457}, /* 0406 */
+ {0x0408,0x0458},{0x0409,0x0459}, /* 0408 */
+ {0x040A,0x045A},{0x040B,0x045B}, /* 040A */
+ {0x040C,0x045C},{0x040D,0x045D}, /* 040C */
+ {0x040E,0x045E},{0x040F,0x045F}, /* 040E */
+ {0x0410,0x0430},{0x0411,0x0431}, /* 0410 */
+ {0x0412,0x0432},{0x0413,0x0433}, /* 0412 */
+ {0x0414,0x0434},{0x0415,0x0435}, /* 0414 */
+ {0x0416,0x0436},{0x0417,0x0437}, /* 0416 */
+ {0x0418,0x0438},{0x0419,0x0439}, /* 0418 */
+ {0x041A,0x043A},{0x041B,0x043B}, /* 041A */
+ {0x041C,0x043C},{0x041D,0x043D}, /* 041C */
+ {0x041E,0x043E},{0x041F,0x043F}, /* 041E */
+ {0x0420,0x0440},{0x0421,0x0441}, /* 0420 */
+ {0x0422,0x0442},{0x0423,0x0443}, /* 0422 */
+ {0x0424,0x0444},{0x0425,0x0445}, /* 0424 */
+ {0x0426,0x0446},{0x0427,0x0447}, /* 0426 */
+ {0x0428,0x0448},{0x0429,0x0449}, /* 0428 */
+ {0x042A,0x044A},{0x042B,0x044B}, /* 042A */
+ {0x042C,0x044C},{0x042D,0x044D}, /* 042C */
+ {0x042E,0x044E},{0x042F,0x044F}, /* 042E */
+ {0x0410,0x0430},{0x0411,0x0431}, /* 0430 */
+ {0x0412,0x0432},{0x0413,0x0433}, /* 0432 */
+ {0x0414,0x0434},{0x0415,0x0435}, /* 0434 */
+ {0x0416,0x0436},{0x0417,0x0437}, /* 0436 */
+ {0x0418,0x0438},{0x0419,0x0439}, /* 0438 */
+ {0x041A,0x043A},{0x041B,0x043B}, /* 043A */
+ {0x041C,0x043C},{0x041D,0x043D}, /* 043C */
+ {0x041E,0x043E},{0x041F,0x043F}, /* 043E */
+ {0x0420,0x0440},{0x0421,0x0441}, /* 0440 */
+ {0x0422,0x0442},{0x0423,0x0443}, /* 0442 */
+ {0x0424,0x0444},{0x0425,0x0445}, /* 0444 */
+ {0x0426,0x0446},{0x0427,0x0447}, /* 0446 */
+ {0x0428,0x0448},{0x0429,0x0449}, /* 0448 */
+ {0x042A,0x044A},{0x042B,0x044B}, /* 044A */
+ {0x042C,0x044C},{0x042D,0x044D}, /* 044C */
+ {0x042E,0x044E},{0x042F,0x044F}, /* 044E */
+ {0x0400,0x0450},{0x0401,0x0451}, /* 0450 */
+ {0x0402,0x0452},{0x0403,0x0453}, /* 0452 */
+ {0x0404,0x0454},{0x0405,0x0455}, /* 0454 */
+ {0x0406,0x0456},{0x0407,0x0457}, /* 0456 */
+ {0x0408,0x0458},{0x0409,0x0459}, /* 0458 */
+ {0x040A,0x045A},{0x040B,0x045B}, /* 045A */
+ {0x040C,0x045C},{0x040D,0x045D}, /* 045C */
+ {0x040E,0x045E},{0x040F,0x045F}, /* 045E */
+ {0x0460,0x0461},{0x0460,0x0461}, /* 0460 */
+ {0x0462,0x0463},{0x0462,0x0463}, /* 0462 */
+ {0x0464,0x0465},{0x0464,0x0465}, /* 0464 */
+ {0x0466,0x0467},{0x0466,0x0467}, /* 0466 */
+ {0x0468,0x0469},{0x0468,0x0469}, /* 0468 */
+ {0x046A,0x046B},{0x046A,0x046B}, /* 046A */
+ {0x046C,0x046D},{0x046C,0x046D}, /* 046C */
+ {0x046E,0x046F},{0x046E,0x046F}, /* 046E */
+ {0x0470,0x0471},{0x0470,0x0471}, /* 0470 */
+ {0x0472,0x0473},{0x0472,0x0473}, /* 0472 */
+ {0x0474,0x0475},{0x0474,0x0475}, /* 0474 */
+ {0x0476,0x0477},{0x0476,0x0477}, /* 0476 */
+ {0x0478,0x0479},{0x0478,0x0479}, /* 0478 */
+ {0x047A,0x047B},{0x047A,0x047B}, /* 047A */
+ {0x047C,0x047D},{0x047C,0x047D}, /* 047C */
+ {0x047E,0x047F},{0x047E,0x047F}, /* 047E */
+ {0x0480,0x0481},{0x0480,0x0481}, /* 0480 */
+ {0x0482,0x0482},{0x0483,0x0483}, /* 0482 */
+ {0x0484,0x0484},{0x0485,0x0485}, /* 0484 */
+ {0x0486,0x0486},{0x0487,0x0487}, /* 0486 */
+ {0x0488,0x0488},{0x0489,0x0489}, /* 0488 */
+ {0x048A,0x048B},{0x048A,0x048B}, /* 048A */
+ {0x048C,0x048D},{0x048C,0x048D}, /* 048C */
+ {0x048E,0x048F},{0x048E,0x048F}, /* 048E */
+ {0x0490,0x0491},{0x0490,0x0491}, /* 0490 */
+ {0x0492,0x0493},{0x0492,0x0493}, /* 0492 */
+ {0x0494,0x0495},{0x0494,0x0495}, /* 0494 */
+ {0x0496,0x0497},{0x0496,0x0497}, /* 0496 */
+ {0x0498,0x0499},{0x0498,0x0499}, /* 0498 */
+ {0x049A,0x049B},{0x049A,0x049B}, /* 049A */
+ {0x049C,0x049D},{0x049C,0x049D}, /* 049C */
+ {0x049E,0x049F},{0x049E,0x049F}, /* 049E */
+ {0x04A0,0x04A1},{0x04A0,0x04A1}, /* 04A0 */
+ {0x04A2,0x04A3},{0x04A2,0x04A3}, /* 04A2 */
+ {0x04A4,0x04A5},{0x04A4,0x04A5}, /* 04A4 */
+ {0x04A6,0x04A7},{0x04A6,0x04A7}, /* 04A6 */
+ {0x04A8,0x04A9},{0x04A8,0x04A9}, /* 04A8 */
+ {0x04AA,0x04AB},{0x04AA,0x04AB}, /* 04AA */
+ {0x04AC,0x04AD},{0x04AC,0x04AD}, /* 04AC */
+ {0x04AE,0x04AF},{0x04AE,0x04AF}, /* 04AE */
+ {0x04B0,0x04B1},{0x04B0,0x04B1}, /* 04B0 */
+ {0x04B2,0x04B3},{0x04B2,0x04B3}, /* 04B2 */
+ {0x04B4,0x04B5},{0x04B4,0x04B5}, /* 04B4 */
+ {0x04B6,0x04B7},{0x04B6,0x04B7}, /* 04B6 */
+ {0x04B8,0x04B9},{0x04B8,0x04B9}, /* 04B8 */
+ {0x04BA,0x04BB},{0x04BA,0x04BB}, /* 04BA */
+ {0x04BC,0x04BD},{0x04BC,0x04BD}, /* 04BC */
+ {0x04BE,0x04BF},{0x04BE,0x04BF}, /* 04BE */
+ {0x04C0,0x04CF},{0x04C1,0x04C2}, /* 04C0 */
+ {0x04C1,0x04C2},{0x04C3,0x04C4}, /* 04C2 */
+ {0x04C3,0x04C4},{0x04C5,0x04C6}, /* 04C4 */
+ {0x04C5,0x04C6},{0x04C7,0x04C8}, /* 04C6 */
+ {0x04C7,0x04C8},{0x04C9,0x04CA}, /* 04C8 */
+ {0x04C9,0x04CA},{0x04CB,0x04CC}, /* 04CA */
+ {0x04CB,0x04CC},{0x04CD,0x04CE}, /* 04CC */
+ {0x04CD,0x04CE},{0x04C0,0x04CF}, /* 04CE */
+ {0x04D0,0x04D1},{0x04D0,0x04D1}, /* 04D0 */
+ {0x04D2,0x04D3},{0x04D2,0x04D3}, /* 04D2 */
+ {0x04D4,0x04D5},{0x04D4,0x04D5}, /* 04D4 */
+ {0x04D6,0x04D7},{0x04D6,0x04D7}, /* 04D6 */
+ {0x04D8,0x04D9},{0x04D8,0x04D9}, /* 04D8 */
+ {0x04DA,0x04DB},{0x04DA,0x04DB}, /* 04DA */
+ {0x04DC,0x04DD},{0x04DC,0x04DD}, /* 04DC */
+ {0x04DE,0x04DF},{0x04DE,0x04DF}, /* 04DE */
+ {0x04E0,0x04E1},{0x04E0,0x04E1}, /* 04E0 */
+ {0x04E2,0x04E3},{0x04E2,0x04E3}, /* 04E2 */
+ {0x04E4,0x04E5},{0x04E4,0x04E5}, /* 04E4 */
+ {0x04E6,0x04E7},{0x04E6,0x04E7}, /* 04E6 */
+ {0x04E8,0x04E9},{0x04E8,0x04E9}, /* 04E8 */
+ {0x04EA,0x04EB},{0x04EA,0x04EB}, /* 04EA */
+ {0x04EC,0x04ED},{0x04EC,0x04ED}, /* 04EC */
+ {0x04EE,0x04EF},{0x04EE,0x04EF}, /* 04EE */
+ {0x04F0,0x04F1},{0x04F0,0x04F1}, /* 04F0 */
+ {0x04F2,0x04F3},{0x04F2,0x04F3}, /* 04F2 */
+ {0x04F4,0x04F5},{0x04F4,0x04F5}, /* 04F4 */
+ {0x04F6,0x04F7},{0x04F6,0x04F7}, /* 04F6 */
+ {0x04F8,0x04F9},{0x04F8,0x04F9}, /* 04F8 */
+ {0x04FA,0x04FB},{0x04FA,0x04FB}, /* 04FA */
+ {0x04FC,0x04FD},{0x04FC,0x04FD}, /* 04FC */
+ {0x04FE,0x04FF},{0x04FE,0x04FF} /* 04FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page05[256]={
+ {0x0500,0x0501},{0x0500,0x0501}, /* 0500 */
+ {0x0502,0x0503},{0x0502,0x0503}, /* 0502 */
+ {0x0504,0x0505},{0x0504,0x0505}, /* 0504 */
+ {0x0506,0x0507},{0x0506,0x0507}, /* 0506 */
+ {0x0508,0x0509},{0x0508,0x0509}, /* 0508 */
+ {0x050A,0x050B},{0x050A,0x050B}, /* 050A */
+ {0x050C,0x050D},{0x050C,0x050D}, /* 050C */
+ {0x050E,0x050F},{0x050E,0x050F}, /* 050E */
+ {0x0510,0x0511},{0x0510,0x0511}, /* 0510 */
+ {0x0512,0x0513},{0x0512,0x0513}, /* 0512 */
+ {0x0514,0x0515},{0x0514,0x0515}, /* 0514 */
+ {0x0516,0x0517},{0x0516,0x0517}, /* 0516 */
+ {0x0518,0x0519},{0x0518,0x0519}, /* 0518 */
+ {0x051A,0x051B},{0x051A,0x051B}, /* 051A */
+ {0x051C,0x051D},{0x051C,0x051D}, /* 051C */
+ {0x051E,0x051F},{0x051E,0x051F}, /* 051E */
+ {0x0520,0x0521},{0x0520,0x0521}, /* 0520 */
+ {0x0522,0x0523},{0x0522,0x0523}, /* 0522 */
+ {0x0524,0x0525},{0x0524,0x0525}, /* 0524 */
+ {0x0526,0x0527},{0x0526,0x0527}, /* 0526 */
+ {0x0528,0x0529},{0x0528,0x0529}, /* 0528 */
+ {0x052A,0x052B},{0x052A,0x052B}, /* 052A */
+ {0x052C,0x052D},{0x052C,0x052D}, /* 052C */
+ {0x052E,0x052F},{0x052E,0x052F}, /* 052E */
+ {0x0530,0x0530},{0x0531,0x0561}, /* 0530 */
+ {0x0532,0x0562},{0x0533,0x0563}, /* 0532 */
+ {0x0534,0x0564},{0x0535,0x0565}, /* 0534 */
+ {0x0536,0x0566},{0x0537,0x0567}, /* 0536 */
+ {0x0538,0x0568},{0x0539,0x0569}, /* 0538 */
+ {0x053A,0x056A},{0x053B,0x056B}, /* 053A */
+ {0x053C,0x056C},{0x053D,0x056D}, /* 053C */
+ {0x053E,0x056E},{0x053F,0x056F}, /* 053E */
+ {0x0540,0x0570},{0x0541,0x0571}, /* 0540 */
+ {0x0542,0x0572},{0x0543,0x0573}, /* 0542 */
+ {0x0544,0x0574},{0x0545,0x0575}, /* 0544 */
+ {0x0546,0x0576},{0x0547,0x0577}, /* 0546 */
+ {0x0548,0x0578},{0x0549,0x0579}, /* 0548 */
+ {0x054A,0x057A},{0x054B,0x057B}, /* 054A */
+ {0x054C,0x057C},{0x054D,0x057D}, /* 054C */
+ {0x054E,0x057E},{0x054F,0x057F}, /* 054E */
+ {0x0550,0x0580},{0x0551,0x0581}, /* 0550 */
+ {0x0552,0x0582},{0x0553,0x0583}, /* 0552 */
+ {0x0554,0x0584},{0x0555,0x0585}, /* 0554 */
+ {0x0556,0x0586},{0x0557,0x0557}, /* 0556 */
+ {0x0558,0x0558},{0x0559,0x0559}, /* 0558 */
+ {0x055A,0x055A},{0x055B,0x055B}, /* 055A */
+ {0x055C,0x055C},{0x055D,0x055D}, /* 055C */
+ {0x055E,0x055E},{0x055F,0x055F}, /* 055E */
+ {0x0560,0x0560},{0x0531,0x0561}, /* 0560 */
+ {0x0532,0x0562},{0x0533,0x0563}, /* 0562 */
+ {0x0534,0x0564},{0x0535,0x0565}, /* 0564 */
+ {0x0536,0x0566},{0x0537,0x0567}, /* 0566 */
+ {0x0538,0x0568},{0x0539,0x0569}, /* 0568 */
+ {0x053A,0x056A},{0x053B,0x056B}, /* 056A */
+ {0x053C,0x056C},{0x053D,0x056D}, /* 056C */
+ {0x053E,0x056E},{0x053F,0x056F}, /* 056E */
+ {0x0540,0x0570},{0x0541,0x0571}, /* 0570 */
+ {0x0542,0x0572},{0x0543,0x0573}, /* 0572 */
+ {0x0544,0x0574},{0x0545,0x0575}, /* 0574 */
+ {0x0546,0x0576},{0x0547,0x0577}, /* 0576 */
+ {0x0548,0x0578},{0x0549,0x0579}, /* 0578 */
+ {0x054A,0x057A},{0x054B,0x057B}, /* 057A */
+ {0x054C,0x057C},{0x054D,0x057D}, /* 057C */
+ {0x054E,0x057E},{0x054F,0x057F}, /* 057E */
+ {0x0550,0x0580},{0x0551,0x0581}, /* 0580 */
+ {0x0552,0x0582},{0x0553,0x0583}, /* 0582 */
+ {0x0554,0x0584},{0x0555,0x0585}, /* 0584 */
+ {0x0556,0x0586},{0x0587,0x0587}, /* 0586 */
+ {0x0588,0x0588},{0x0589,0x0589}, /* 0588 */
+ {0x058A,0x058A},{0x058B,0x058B}, /* 058A */
+ {0x058C,0x058C},{0x058D,0x058D}, /* 058C */
+ {0x058E,0x058E},{0x058F,0x058F}, /* 058E */
+ {0x0590,0x0590},{0x0591,0x0591}, /* 0590 */
+ {0x0592,0x0592},{0x0593,0x0593}, /* 0592 */
+ {0x0594,0x0594},{0x0595,0x0595}, /* 0594 */
+ {0x0596,0x0596},{0x0597,0x0597}, /* 0596 */
+ {0x0598,0x0598},{0x0599,0x0599}, /* 0598 */
+ {0x059A,0x059A},{0x059B,0x059B}, /* 059A */
+ {0x059C,0x059C},{0x059D,0x059D}, /* 059C */
+ {0x059E,0x059E},{0x059F,0x059F}, /* 059E */
+ {0x05A0,0x05A0},{0x05A1,0x05A1}, /* 05A0 */
+ {0x05A2,0x05A2},{0x05A3,0x05A3}, /* 05A2 */
+ {0x05A4,0x05A4},{0x05A5,0x05A5}, /* 05A4 */
+ {0x05A6,0x05A6},{0x05A7,0x05A7}, /* 05A6 */
+ {0x05A8,0x05A8},{0x05A9,0x05A9}, /* 05A8 */
+ {0x05AA,0x05AA},{0x05AB,0x05AB}, /* 05AA */
+ {0x05AC,0x05AC},{0x05AD,0x05AD}, /* 05AC */
+ {0x05AE,0x05AE},{0x05AF,0x05AF}, /* 05AE */
+ {0x05B0,0x05B0},{0x05B1,0x05B1}, /* 05B0 */
+ {0x05B2,0x05B2},{0x05B3,0x05B3}, /* 05B2 */
+ {0x05B4,0x05B4},{0x05B5,0x05B5}, /* 05B4 */
+ {0x05B6,0x05B6},{0x05B7,0x05B7}, /* 05B6 */
+ {0x05B8,0x05B8},{0x05B9,0x05B9}, /* 05B8 */
+ {0x05BA,0x05BA},{0x05BB,0x05BB}, /* 05BA */
+ {0x05BC,0x05BC},{0x05BD,0x05BD}, /* 05BC */
+ {0x05BE,0x05BE},{0x05BF,0x05BF}, /* 05BE */
+ {0x05C0,0x05C0},{0x05C1,0x05C1}, /* 05C0 */
+ {0x05C2,0x05C2},{0x05C3,0x05C3}, /* 05C2 */
+ {0x05C4,0x05C4},{0x05C5,0x05C5}, /* 05C4 */
+ {0x05C6,0x05C6},{0x05C7,0x05C7}, /* 05C6 */
+ {0x05C8,0x05C8},{0x05C9,0x05C9}, /* 05C8 */
+ {0x05CA,0x05CA},{0x05CB,0x05CB}, /* 05CA */
+ {0x05CC,0x05CC},{0x05CD,0x05CD}, /* 05CC */
+ {0x05CE,0x05CE},{0x05CF,0x05CF}, /* 05CE */
+ {0x05D0,0x05D0},{0x05D1,0x05D1}, /* 05D0 */
+ {0x05D2,0x05D2},{0x05D3,0x05D3}, /* 05D2 */
+ {0x05D4,0x05D4},{0x05D5,0x05D5}, /* 05D4 */
+ {0x05D6,0x05D6},{0x05D7,0x05D7}, /* 05D6 */
+ {0x05D8,0x05D8},{0x05D9,0x05D9}, /* 05D8 */
+ {0x05DA,0x05DA},{0x05DB,0x05DB}, /* 05DA */
+ {0x05DC,0x05DC},{0x05DD,0x05DD}, /* 05DC */
+ {0x05DE,0x05DE},{0x05DF,0x05DF}, /* 05DE */
+ {0x05E0,0x05E0},{0x05E1,0x05E1}, /* 05E0 */
+ {0x05E2,0x05E2},{0x05E3,0x05E3}, /* 05E2 */
+ {0x05E4,0x05E4},{0x05E5,0x05E5}, /* 05E4 */
+ {0x05E6,0x05E6},{0x05E7,0x05E7}, /* 05E6 */
+ {0x05E8,0x05E8},{0x05E9,0x05E9}, /* 05E8 */
+ {0x05EA,0x05EA},{0x05EB,0x05EB}, /* 05EA */
+ {0x05EC,0x05EC},{0x05ED,0x05ED}, /* 05EC */
+ {0x05EE,0x05EE},{0x05EF,0x05EF}, /* 05EE */
+ {0x05F0,0x05F0},{0x05F1,0x05F1}, /* 05F0 */
+ {0x05F2,0x05F2},{0x05F3,0x05F3}, /* 05F2 */
+ {0x05F4,0x05F4},{0x05F5,0x05F5}, /* 05F4 */
+ {0x05F6,0x05F6},{0x05F7,0x05F7}, /* 05F6 */
+ {0x05F8,0x05F8},{0x05F9,0x05F9}, /* 05F8 */
+ {0x05FA,0x05FA},{0x05FB,0x05FB}, /* 05FA */
+ {0x05FC,0x05FC},{0x05FD,0x05FD}, /* 05FC */
+ {0x05FE,0x05FE},{0x05FF,0x05FF} /* 05FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page06[256]={ /* This page is dummy */
+ {0x0600,0x0600},{0x0601,0x0601}, /* 0600 */
+ {0x0602,0x0602},{0x0603,0x0603}, /* 0602 */
+ {0x0604,0x0604},{0x0605,0x0605}, /* 0604 */
+ {0x0606,0x0606},{0x0607,0x0607}, /* 0606 */
+ {0x0608,0x0608},{0x0609,0x0609}, /* 0608 */
+ {0x060A,0x060A},{0x060B,0x060B}, /* 060A */
+ {0x060C,0x060C},{0x060D,0x060D}, /* 060C */
+ {0x060E,0x060E},{0x060F,0x060F}, /* 060E */
+ {0x0610,0x0610},{0x0611,0x0611}, /* 0610 */
+ {0x0612,0x0612},{0x0613,0x0613}, /* 0612 */
+ {0x0614,0x0614},{0x0615,0x0615}, /* 0614 */
+ {0x0616,0x0616},{0x0617,0x0617}, /* 0616 */
+ {0x0618,0x0618},{0x0619,0x0619}, /* 0618 */
+ {0x061A,0x061A},{0x061B,0x061B}, /* 061A */
+ {0x061C,0x061C},{0x061D,0x061D}, /* 061C */
+ {0x061E,0x061E},{0x061F,0x061F}, /* 061E */
+ {0x0620,0x0620},{0x0621,0x0621}, /* 0620 */
+ {0x0622,0x0622},{0x0623,0x0623}, /* 0622 */
+ {0x0624,0x0624},{0x0625,0x0625}, /* 0624 */
+ {0x0626,0x0626},{0x0627,0x0627}, /* 0626 */
+ {0x0628,0x0628},{0x0629,0x0629}, /* 0628 */
+ {0x062A,0x062A},{0x062B,0x062B}, /* 062A */
+ {0x062C,0x062C},{0x062D,0x062D}, /* 062C */
+ {0x062E,0x062E},{0x062F,0x062F}, /* 062E */
+ {0x0630,0x0630},{0x0631,0x0631}, /* 0630 */
+ {0x0632,0x0632},{0x0633,0x0633}, /* 0632 */
+ {0x0634,0x0634},{0x0635,0x0635}, /* 0634 */
+ {0x0636,0x0636},{0x0637,0x0637}, /* 0636 */
+ {0x0638,0x0638},{0x0639,0x0639}, /* 0638 */
+ {0x063A,0x063A},{0x063B,0x063B}, /* 063A */
+ {0x063C,0x063C},{0x063D,0x063D}, /* 063C */
+ {0x063E,0x063E},{0x063F,0x063F}, /* 063E */
+ {0x0640,0x0640},{0x0641,0x0641}, /* 0640 */
+ {0x0642,0x0642},{0x0643,0x0643}, /* 0642 */
+ {0x0644,0x0644},{0x0645,0x0645}, /* 0644 */
+ {0x0646,0x0646},{0x0647,0x0647}, /* 0646 */
+ {0x0648,0x0648},{0x0649,0x0649}, /* 0648 */
+ {0x064A,0x064A},{0x064B,0x064B}, /* 064A */
+ {0x064C,0x064C},{0x064D,0x064D}, /* 064C */
+ {0x064E,0x064E},{0x064F,0x064F}, /* 064E */
+ {0x0650,0x0650},{0x0651,0x0651}, /* 0650 */
+ {0x0652,0x0652},{0x0653,0x0653}, /* 0652 */
+ {0x0654,0x0654},{0x0655,0x0655}, /* 0654 */
+ {0x0656,0x0656},{0x0657,0x0657}, /* 0656 */
+ {0x0658,0x0658},{0x0659,0x0659}, /* 0658 */
+ {0x065A,0x065A},{0x065B,0x065B}, /* 065A */
+ {0x065C,0x065C},{0x065D,0x065D}, /* 065C */
+ {0x065E,0x065E},{0x065F,0x065F}, /* 065E */
+ {0x0660,0x0660},{0x0661,0x0661}, /* 0660 */
+ {0x0662,0x0662},{0x0663,0x0663}, /* 0662 */
+ {0x0664,0x0664},{0x0665,0x0665}, /* 0664 */
+ {0x0666,0x0666},{0x0667,0x0667}, /* 0666 */
+ {0x0668,0x0668},{0x0669,0x0669}, /* 0668 */
+ {0x066A,0x066A},{0x066B,0x066B}, /* 066A */
+ {0x066C,0x066C},{0x066D,0x066D}, /* 066C */
+ {0x066E,0x066E},{0x066F,0x066F}, /* 066E */
+ {0x0670,0x0670},{0x0671,0x0671}, /* 0670 */
+ {0x0672,0x0672},{0x0673,0x0673}, /* 0672 */
+ {0x0674,0x0674},{0x0675,0x0675}, /* 0674 */
+ {0x0676,0x0676},{0x0677,0x0677}, /* 0676 */
+ {0x0678,0x0678},{0x0679,0x0679}, /* 0678 */
+ {0x067A,0x067A},{0x067B,0x067B}, /* 067A */
+ {0x067C,0x067C},{0x067D,0x067D}, /* 067C */
+ {0x067E,0x067E},{0x067F,0x067F}, /* 067E */
+ {0x0680,0x0680},{0x0681,0x0681}, /* 0680 */
+ {0x0682,0x0682},{0x0683,0x0683}, /* 0682 */
+ {0x0684,0x0684},{0x0685,0x0685}, /* 0684 */
+ {0x0686,0x0686},{0x0687,0x0687}, /* 0686 */
+ {0x0688,0x0688},{0x0689,0x0689}, /* 0688 */
+ {0x068A,0x068A},{0x068B,0x068B}, /* 068A */
+ {0x068C,0x068C},{0x068D,0x068D}, /* 068C */
+ {0x068E,0x068E},{0x068F,0x068F}, /* 068E */
+ {0x0690,0x0690},{0x0691,0x0691}, /* 0690 */
+ {0x0692,0x0692},{0x0693,0x0693}, /* 0692 */
+ {0x0694,0x0694},{0x0695,0x0695}, /* 0694 */
+ {0x0696,0x0696},{0x0697,0x0697}, /* 0696 */
+ {0x0698,0x0698},{0x0699,0x0699}, /* 0698 */
+ {0x069A,0x069A},{0x069B,0x069B}, /* 069A */
+ {0x069C,0x069C},{0x069D,0x069D}, /* 069C */
+ {0x069E,0x069E},{0x069F,0x069F}, /* 069E */
+ {0x06A0,0x06A0},{0x06A1,0x06A1}, /* 06A0 */
+ {0x06A2,0x06A2},{0x06A3,0x06A3}, /* 06A2 */
+ {0x06A4,0x06A4},{0x06A5,0x06A5}, /* 06A4 */
+ {0x06A6,0x06A6},{0x06A7,0x06A7}, /* 06A6 */
+ {0x06A8,0x06A8},{0x06A9,0x06A9}, /* 06A8 */
+ {0x06AA,0x06AA},{0x06AB,0x06AB}, /* 06AA */
+ {0x06AC,0x06AC},{0x06AD,0x06AD}, /* 06AC */
+ {0x06AE,0x06AE},{0x06AF,0x06AF}, /* 06AE */
+ {0x06B0,0x06B0},{0x06B1,0x06B1}, /* 06B0 */
+ {0x06B2,0x06B2},{0x06B3,0x06B3}, /* 06B2 */
+ {0x06B4,0x06B4},{0x06B5,0x06B5}, /* 06B4 */
+ {0x06B6,0x06B6},{0x06B7,0x06B7}, /* 06B6 */
+ {0x06B8,0x06B8},{0x06B9,0x06B9}, /* 06B8 */
+ {0x06BA,0x06BA},{0x06BB,0x06BB}, /* 06BA */
+ {0x06BC,0x06BC},{0x06BD,0x06BD}, /* 06BC */
+ {0x06BE,0x06BE},{0x06BF,0x06BF}, /* 06BE */
+ {0x06C0,0x06C0},{0x06C1,0x06C1}, /* 06C0 */
+ {0x06C2,0x06C2},{0x06C3,0x06C3}, /* 06C2 */
+ {0x06C4,0x06C4},{0x06C5,0x06C5}, /* 06C4 */
+ {0x06C6,0x06C6},{0x06C7,0x06C7}, /* 06C6 */
+ {0x06C8,0x06C8},{0x06C9,0x06C9}, /* 06C8 */
+ {0x06CA,0x06CA},{0x06CB,0x06CB}, /* 06CA */
+ {0x06CC,0x06CC},{0x06CD,0x06CD}, /* 06CC */
+ {0x06CE,0x06CE},{0x06CF,0x06CF}, /* 06CE */
+ {0x06D0,0x06D0},{0x06D1,0x06D1}, /* 06D0 */
+ {0x06D2,0x06D2},{0x06D3,0x06D3}, /* 06D2 */
+ {0x06D4,0x06D4},{0x06D5,0x06D5}, /* 06D4 */
+ {0x06D6,0x06D6},{0x06D7,0x06D7}, /* 06D6 */
+ {0x06D8,0x06D8},{0x06D9,0x06D9}, /* 06D8 */
+ {0x06DA,0x06DA},{0x06DB,0x06DB}, /* 06DA */
+ {0x06DC,0x06DC},{0x06DD,0x06DD}, /* 06DC */
+ {0x06DE,0x06DE},{0x06DF,0x06DF}, /* 06DE */
+ {0x06E0,0x06E0},{0x06E1,0x06E1}, /* 06E0 */
+ {0x06E2,0x06E2},{0x06E3,0x06E3}, /* 06E2 */
+ {0x06E4,0x06E4},{0x06E5,0x06E5}, /* 06E4 */
+ {0x06E6,0x06E6},{0x06E7,0x06E7}, /* 06E6 */
+ {0x06E8,0x06E8},{0x06E9,0x06E9}, /* 06E8 */
+ {0x06EA,0x06EA},{0x06EB,0x06EB}, /* 06EA */
+ {0x06EC,0x06EC},{0x06ED,0x06ED}, /* 06EC */
+ {0x06EE,0x06EE},{0x06EF,0x06EF}, /* 06EE */
+ {0x06F0,0x06F0},{0x06F1,0x06F1}, /* 06F0 */
+ {0x06F2,0x06F2},{0x06F3,0x06F3}, /* 06F2 */
+ {0x06F4,0x06F4},{0x06F5,0x06F5}, /* 06F4 */
+ {0x06F6,0x06F6},{0x06F7,0x06F7}, /* 06F6 */
+ {0x06F8,0x06F8},{0x06F9,0x06F9}, /* 06F8 */
+ {0x06FA,0x06FA},{0x06FB,0x06FB}, /* 06FA */
+ {0x06FC,0x06FC},{0x06FD,0x06FD}, /* 06FC */
+ {0x06FE,0x06FE},{0x06FF,0x06FF} /* 06FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page07[256]={ /* This page is dummy */
+ {0x0700,0x0700},{0x0701,0x0701}, /* 0700 */
+ {0x0702,0x0702},{0x0703,0x0703}, /* 0702 */
+ {0x0704,0x0704},{0x0705,0x0705}, /* 0704 */
+ {0x0706,0x0706},{0x0707,0x0707}, /* 0706 */
+ {0x0708,0x0708},{0x0709,0x0709}, /* 0708 */
+ {0x070A,0x070A},{0x070B,0x070B}, /* 070A */
+ {0x070C,0x070C},{0x070D,0x070D}, /* 070C */
+ {0x070E,0x070E},{0x070F,0x070F}, /* 070E */
+ {0x0710,0x0710},{0x0711,0x0711}, /* 0710 */
+ {0x0712,0x0712},{0x0713,0x0713}, /* 0712 */
+ {0x0714,0x0714},{0x0715,0x0715}, /* 0714 */
+ {0x0716,0x0716},{0x0717,0x0717}, /* 0716 */
+ {0x0718,0x0718},{0x0719,0x0719}, /* 0718 */
+ {0x071A,0x071A},{0x071B,0x071B}, /* 071A */
+ {0x071C,0x071C},{0x071D,0x071D}, /* 071C */
+ {0x071E,0x071E},{0x071F,0x071F}, /* 071E */
+ {0x0720,0x0720},{0x0721,0x0721}, /* 0720 */
+ {0x0722,0x0722},{0x0723,0x0723}, /* 0722 */
+ {0x0724,0x0724},{0x0725,0x0725}, /* 0724 */
+ {0x0726,0x0726},{0x0727,0x0727}, /* 0726 */
+ {0x0728,0x0728},{0x0729,0x0729}, /* 0728 */
+ {0x072A,0x072A},{0x072B,0x072B}, /* 072A */
+ {0x072C,0x072C},{0x072D,0x072D}, /* 072C */
+ {0x072E,0x072E},{0x072F,0x072F}, /* 072E */
+ {0x0730,0x0730},{0x0731,0x0731}, /* 0730 */
+ {0x0732,0x0732},{0x0733,0x0733}, /* 0732 */
+ {0x0734,0x0734},{0x0735,0x0735}, /* 0734 */
+ {0x0736,0x0736},{0x0737,0x0737}, /* 0736 */
+ {0x0738,0x0738},{0x0739,0x0739}, /* 0738 */
+ {0x073A,0x073A},{0x073B,0x073B}, /* 073A */
+ {0x073C,0x073C},{0x073D,0x073D}, /* 073C */
+ {0x073E,0x073E},{0x073F,0x073F}, /* 073E */
+ {0x0740,0x0740},{0x0741,0x0741}, /* 0740 */
+ {0x0742,0x0742},{0x0743,0x0743}, /* 0742 */
+ {0x0744,0x0744},{0x0745,0x0745}, /* 0744 */
+ {0x0746,0x0746},{0x0747,0x0747}, /* 0746 */
+ {0x0748,0x0748},{0x0749,0x0749}, /* 0748 */
+ {0x074A,0x074A},{0x074B,0x074B}, /* 074A */
+ {0x074C,0x074C},{0x074D,0x074D}, /* 074C */
+ {0x074E,0x074E},{0x074F,0x074F}, /* 074E */
+ {0x0750,0x0750},{0x0751,0x0751}, /* 0750 */
+ {0x0752,0x0752},{0x0753,0x0753}, /* 0752 */
+ {0x0754,0x0754},{0x0755,0x0755}, /* 0754 */
+ {0x0756,0x0756},{0x0757,0x0757}, /* 0756 */
+ {0x0758,0x0758},{0x0759,0x0759}, /* 0758 */
+ {0x075A,0x075A},{0x075B,0x075B}, /* 075A */
+ {0x075C,0x075C},{0x075D,0x075D}, /* 075C */
+ {0x075E,0x075E},{0x075F,0x075F}, /* 075E */
+ {0x0760,0x0760},{0x0761,0x0761}, /* 0760 */
+ {0x0762,0x0762},{0x0763,0x0763}, /* 0762 */
+ {0x0764,0x0764},{0x0765,0x0765}, /* 0764 */
+ {0x0766,0x0766},{0x0767,0x0767}, /* 0766 */
+ {0x0768,0x0768},{0x0769,0x0769}, /* 0768 */
+ {0x076A,0x076A},{0x076B,0x076B}, /* 076A */
+ {0x076C,0x076C},{0x076D,0x076D}, /* 076C */
+ {0x076E,0x076E},{0x076F,0x076F}, /* 076E */
+ {0x0770,0x0770},{0x0771,0x0771}, /* 0770 */
+ {0x0772,0x0772},{0x0773,0x0773}, /* 0772 */
+ {0x0774,0x0774},{0x0775,0x0775}, /* 0774 */
+ {0x0776,0x0776},{0x0777,0x0777}, /* 0776 */
+ {0x0778,0x0778},{0x0779,0x0779}, /* 0778 */
+ {0x077A,0x077A},{0x077B,0x077B}, /* 077A */
+ {0x077C,0x077C},{0x077D,0x077D}, /* 077C */
+ {0x077E,0x077E},{0x077F,0x077F}, /* 077E */
+ {0x0780,0x0780},{0x0781,0x0781}, /* 0780 */
+ {0x0782,0x0782},{0x0783,0x0783}, /* 0782 */
+ {0x0784,0x0784},{0x0785,0x0785}, /* 0784 */
+ {0x0786,0x0786},{0x0787,0x0787}, /* 0786 */
+ {0x0788,0x0788},{0x0789,0x0789}, /* 0788 */
+ {0x078A,0x078A},{0x078B,0x078B}, /* 078A */
+ {0x078C,0x078C},{0x078D,0x078D}, /* 078C */
+ {0x078E,0x078E},{0x078F,0x078F}, /* 078E */
+ {0x0790,0x0790},{0x0791,0x0791}, /* 0790 */
+ {0x0792,0x0792},{0x0793,0x0793}, /* 0792 */
+ {0x0794,0x0794},{0x0795,0x0795}, /* 0794 */
+ {0x0796,0x0796},{0x0797,0x0797}, /* 0796 */
+ {0x0798,0x0798},{0x0799,0x0799}, /* 0798 */
+ {0x079A,0x079A},{0x079B,0x079B}, /* 079A */
+ {0x079C,0x079C},{0x079D,0x079D}, /* 079C */
+ {0x079E,0x079E},{0x079F,0x079F}, /* 079E */
+ {0x07A0,0x07A0},{0x07A1,0x07A1}, /* 07A0 */
+ {0x07A2,0x07A2},{0x07A3,0x07A3}, /* 07A2 */
+ {0x07A4,0x07A4},{0x07A5,0x07A5}, /* 07A4 */
+ {0x07A6,0x07A6},{0x07A7,0x07A7}, /* 07A6 */
+ {0x07A8,0x07A8},{0x07A9,0x07A9}, /* 07A8 */
+ {0x07AA,0x07AA},{0x07AB,0x07AB}, /* 07AA */
+ {0x07AC,0x07AC},{0x07AD,0x07AD}, /* 07AC */
+ {0x07AE,0x07AE},{0x07AF,0x07AF}, /* 07AE */
+ {0x07B0,0x07B0},{0x07B1,0x07B1}, /* 07B0 */
+ {0x07B2,0x07B2},{0x07B3,0x07B3}, /* 07B2 */
+ {0x07B4,0x07B4},{0x07B5,0x07B5}, /* 07B4 */
+ {0x07B6,0x07B6},{0x07B7,0x07B7}, /* 07B6 */
+ {0x07B8,0x07B8},{0x07B9,0x07B9}, /* 07B8 */
+ {0x07BA,0x07BA},{0x07BB,0x07BB}, /* 07BA */
+ {0x07BC,0x07BC},{0x07BD,0x07BD}, /* 07BC */
+ {0x07BE,0x07BE},{0x07BF,0x07BF}, /* 07BE */
+ {0x07C0,0x07C0},{0x07C1,0x07C1}, /* 07C0 */
+ {0x07C2,0x07C2},{0x07C3,0x07C3}, /* 07C2 */
+ {0x07C4,0x07C4},{0x07C5,0x07C5}, /* 07C4 */
+ {0x07C6,0x07C6},{0x07C7,0x07C7}, /* 07C6 */
+ {0x07C8,0x07C8},{0x07C9,0x07C9}, /* 07C8 */
+ {0x07CA,0x07CA},{0x07CB,0x07CB}, /* 07CA */
+ {0x07CC,0x07CC},{0x07CD,0x07CD}, /* 07CC */
+ {0x07CE,0x07CE},{0x07CF,0x07CF}, /* 07CE */
+ {0x07D0,0x07D0},{0x07D1,0x07D1}, /* 07D0 */
+ {0x07D2,0x07D2},{0x07D3,0x07D3}, /* 07D2 */
+ {0x07D4,0x07D4},{0x07D5,0x07D5}, /* 07D4 */
+ {0x07D6,0x07D6},{0x07D7,0x07D7}, /* 07D6 */
+ {0x07D8,0x07D8},{0x07D9,0x07D9}, /* 07D8 */
+ {0x07DA,0x07DA},{0x07DB,0x07DB}, /* 07DA */
+ {0x07DC,0x07DC},{0x07DD,0x07DD}, /* 07DC */
+ {0x07DE,0x07DE},{0x07DF,0x07DF}, /* 07DE */
+ {0x07E0,0x07E0},{0x07E1,0x07E1}, /* 07E0 */
+ {0x07E2,0x07E2},{0x07E3,0x07E3}, /* 07E2 */
+ {0x07E4,0x07E4},{0x07E5,0x07E5}, /* 07E4 */
+ {0x07E6,0x07E6},{0x07E7,0x07E7}, /* 07E6 */
+ {0x07E8,0x07E8},{0x07E9,0x07E9}, /* 07E8 */
+ {0x07EA,0x07EA},{0x07EB,0x07EB}, /* 07EA */
+ {0x07EC,0x07EC},{0x07ED,0x07ED}, /* 07EC */
+ {0x07EE,0x07EE},{0x07EF,0x07EF}, /* 07EE */
+ {0x07F0,0x07F0},{0x07F1,0x07F1}, /* 07F0 */
+ {0x07F2,0x07F2},{0x07F3,0x07F3}, /* 07F2 */
+ {0x07F4,0x07F4},{0x07F5,0x07F5}, /* 07F4 */
+ {0x07F6,0x07F6},{0x07F7,0x07F7}, /* 07F6 */
+ {0x07F8,0x07F8},{0x07F9,0x07F9}, /* 07F8 */
+ {0x07FA,0x07FA},{0x07FB,0x07FB}, /* 07FA */
+ {0x07FC,0x07FC},{0x07FD,0x07FD}, /* 07FC */
+ {0x07FE,0x07FE},{0x07FF,0x07FF} /* 07FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page10[256]={
+ {0x1000,0x1000},{0x1001,0x1001}, /* 1000 */
+ {0x1002,0x1002},{0x1003,0x1003}, /* 1002 */
+ {0x1004,0x1004},{0x1005,0x1005}, /* 1004 */
+ {0x1006,0x1006},{0x1007,0x1007}, /* 1006 */
+ {0x1008,0x1008},{0x1009,0x1009}, /* 1008 */
+ {0x100A,0x100A},{0x100B,0x100B}, /* 100A */
+ {0x100C,0x100C},{0x100D,0x100D}, /* 100C */
+ {0x100E,0x100E},{0x100F,0x100F}, /* 100E */
+ {0x1010,0x1010},{0x1011,0x1011}, /* 1010 */
+ {0x1012,0x1012},{0x1013,0x1013}, /* 1012 */
+ {0x1014,0x1014},{0x1015,0x1015}, /* 1014 */
+ {0x1016,0x1016},{0x1017,0x1017}, /* 1016 */
+ {0x1018,0x1018},{0x1019,0x1019}, /* 1018 */
+ {0x101A,0x101A},{0x101B,0x101B}, /* 101A */
+ {0x101C,0x101C},{0x101D,0x101D}, /* 101C */
+ {0x101E,0x101E},{0x101F,0x101F}, /* 101E */
+ {0x1020,0x1020},{0x1021,0x1021}, /* 1020 */
+ {0x1022,0x1022},{0x1023,0x1023}, /* 1022 */
+ {0x1024,0x1024},{0x1025,0x1025}, /* 1024 */
+ {0x1026,0x1026},{0x1027,0x1027}, /* 1026 */
+ {0x1028,0x1028},{0x1029,0x1029}, /* 1028 */
+ {0x102A,0x102A},{0x102B,0x102B}, /* 102A */
+ {0x102C,0x102C},{0x102D,0x102D}, /* 102C */
+ {0x102E,0x102E},{0x102F,0x102F}, /* 102E */
+ {0x1030,0x1030},{0x1031,0x1031}, /* 1030 */
+ {0x1032,0x1032},{0x1033,0x1033}, /* 1032 */
+ {0x1034,0x1034},{0x1035,0x1035}, /* 1034 */
+ {0x1036,0x1036},{0x1037,0x1037}, /* 1036 */
+ {0x1038,0x1038},{0x1039,0x1039}, /* 1038 */
+ {0x103A,0x103A},{0x103B,0x103B}, /* 103A */
+ {0x103C,0x103C},{0x103D,0x103D}, /* 103C */
+ {0x103E,0x103E},{0x103F,0x103F}, /* 103E */
+ {0x1040,0x1040},{0x1041,0x1041}, /* 1040 */
+ {0x1042,0x1042},{0x1043,0x1043}, /* 1042 */
+ {0x1044,0x1044},{0x1045,0x1045}, /* 1044 */
+ {0x1046,0x1046},{0x1047,0x1047}, /* 1046 */
+ {0x1048,0x1048},{0x1049,0x1049}, /* 1048 */
+ {0x104A,0x104A},{0x104B,0x104B}, /* 104A */
+ {0x104C,0x104C},{0x104D,0x104D}, /* 104C */
+ {0x104E,0x104E},{0x104F,0x104F}, /* 104E */
+ {0x1050,0x1050},{0x1051,0x1051}, /* 1050 */
+ {0x1052,0x1052},{0x1053,0x1053}, /* 1052 */
+ {0x1054,0x1054},{0x1055,0x1055}, /* 1054 */
+ {0x1056,0x1056},{0x1057,0x1057}, /* 1056 */
+ {0x1058,0x1058},{0x1059,0x1059}, /* 1058 */
+ {0x105A,0x105A},{0x105B,0x105B}, /* 105A */
+ {0x105C,0x105C},{0x105D,0x105D}, /* 105C */
+ {0x105E,0x105E},{0x105F,0x105F}, /* 105E */
+ {0x1060,0x1060},{0x1061,0x1061}, /* 1060 */
+ {0x1062,0x1062},{0x1063,0x1063}, /* 1062 */
+ {0x1064,0x1064},{0x1065,0x1065}, /* 1064 */
+ {0x1066,0x1066},{0x1067,0x1067}, /* 1066 */
+ {0x1068,0x1068},{0x1069,0x1069}, /* 1068 */
+ {0x106A,0x106A},{0x106B,0x106B}, /* 106A */
+ {0x106C,0x106C},{0x106D,0x106D}, /* 106C */
+ {0x106E,0x106E},{0x106F,0x106F}, /* 106E */
+ {0x1070,0x1070},{0x1071,0x1071}, /* 1070 */
+ {0x1072,0x1072},{0x1073,0x1073}, /* 1072 */
+ {0x1074,0x1074},{0x1075,0x1075}, /* 1074 */
+ {0x1076,0x1076},{0x1077,0x1077}, /* 1076 */
+ {0x1078,0x1078},{0x1079,0x1079}, /* 1078 */
+ {0x107A,0x107A},{0x107B,0x107B}, /* 107A */
+ {0x107C,0x107C},{0x107D,0x107D}, /* 107C */
+ {0x107E,0x107E},{0x107F,0x107F}, /* 107E */
+ {0x1080,0x1080},{0x1081,0x1081}, /* 1080 */
+ {0x1082,0x1082},{0x1083,0x1083}, /* 1082 */
+ {0x1084,0x1084},{0x1085,0x1085}, /* 1084 */
+ {0x1086,0x1086},{0x1087,0x1087}, /* 1086 */
+ {0x1088,0x1088},{0x1089,0x1089}, /* 1088 */
+ {0x108A,0x108A},{0x108B,0x108B}, /* 108A */
+ {0x108C,0x108C},{0x108D,0x108D}, /* 108C */
+ {0x108E,0x108E},{0x108F,0x108F}, /* 108E */
+ {0x1090,0x1090},{0x1091,0x1091}, /* 1090 */
+ {0x1092,0x1092},{0x1093,0x1093}, /* 1092 */
+ {0x1094,0x1094},{0x1095,0x1095}, /* 1094 */
+ {0x1096,0x1096},{0x1097,0x1097}, /* 1096 */
+ {0x1098,0x1098},{0x1099,0x1099}, /* 1098 */
+ {0x109A,0x109A},{0x109B,0x109B}, /* 109A */
+ {0x109C,0x109C},{0x109D,0x109D}, /* 109C */
+ {0x109E,0x109E},{0x109F,0x109F}, /* 109E */
+ {0x10A0,0x2D00},{0x10A1,0x2D01}, /* 10A0 */
+ {0x10A2,0x2D02},{0x10A3,0x2D03}, /* 10A2 */
+ {0x10A4,0x2D04},{0x10A5,0x2D05}, /* 10A4 */
+ {0x10A6,0x2D06},{0x10A7,0x2D07}, /* 10A6 */
+ {0x10A8,0x2D08},{0x10A9,0x2D09}, /* 10A8 */
+ {0x10AA,0x2D0A},{0x10AB,0x2D0B}, /* 10AA */
+ {0x10AC,0x2D0C},{0x10AD,0x2D0D}, /* 10AC */
+ {0x10AE,0x2D0E},{0x10AF,0x2D0F}, /* 10AE */
+ {0x10B0,0x2D10},{0x10B1,0x2D11}, /* 10B0 */
+ {0x10B2,0x2D12},{0x10B3,0x2D13}, /* 10B2 */
+ {0x10B4,0x2D14},{0x10B5,0x2D15}, /* 10B4 */
+ {0x10B6,0x2D16},{0x10B7,0x2D17}, /* 10B6 */
+ {0x10B8,0x2D18},{0x10B9,0x2D19}, /* 10B8 */
+ {0x10BA,0x2D1A},{0x10BB,0x2D1B}, /* 10BA */
+ {0x10BC,0x2D1C},{0x10BD,0x2D1D}, /* 10BC */
+ {0x10BE,0x2D1E},{0x10BF,0x2D1F}, /* 10BE */
+ {0x10C0,0x2D20},{0x10C1,0x2D21}, /* 10C0 */
+ {0x10C2,0x2D22},{0x10C3,0x2D23}, /* 10C2 */
+ {0x10C4,0x2D24},{0x10C5,0x2D25}, /* 10C4 */
+ {0x10C6,0x10C6},{0x10C7,0x2D27}, /* 10C6 */
+ {0x10C8,0x10C8},{0x10C9,0x10C9}, /* 10C8 */
+ {0x10CA,0x10CA},{0x10CB,0x10CB}, /* 10CA */
+ {0x10CC,0x10CC},{0x10CD,0x2D2D}, /* 10CC */
+ {0x10CE,0x10CE},{0x10CF,0x10CF}, /* 10CE */
+ {0x1C90,0x10D0},{0x1C91,0x10D1}, /* 10D0 */
+ {0x1C92,0x10D2},{0x1C93,0x10D3}, /* 10D2 */
+ {0x1C94,0x10D4},{0x1C95,0x10D5}, /* 10D4 */
+ {0x1C96,0x10D6},{0x1C97,0x10D7}, /* 10D6 */
+ {0x1C98,0x10D8},{0x1C99,0x10D9}, /* 10D8 */
+ {0x1C9A,0x10DA},{0x1C9B,0x10DB}, /* 10DA */
+ {0x1C9C,0x10DC},{0x1C9D,0x10DD}, /* 10DC */
+ {0x1C9E,0x10DE},{0x1C9F,0x10DF}, /* 10DE */
+ {0x1CA0,0x10E0},{0x1CA1,0x10E1}, /* 10E0 */
+ {0x1CA2,0x10E2},{0x1CA3,0x10E3}, /* 10E2 */
+ {0x1CA4,0x10E4},{0x1CA5,0x10E5}, /* 10E4 */
+ {0x1CA6,0x10E6},{0x1CA7,0x10E7}, /* 10E6 */
+ {0x1CA8,0x10E8},{0x1CA9,0x10E9}, /* 10E8 */
+ {0x1CAA,0x10EA},{0x1CAB,0x10EB}, /* 10EA */
+ {0x1CAC,0x10EC},{0x1CAD,0x10ED}, /* 10EC */
+ {0x1CAE,0x10EE},{0x1CAF,0x10EF}, /* 10EE */
+ {0x1CB0,0x10F0},{0x1CB1,0x10F1}, /* 10F0 */
+ {0x1CB2,0x10F2},{0x1CB3,0x10F3}, /* 10F2 */
+ {0x1CB4,0x10F4},{0x1CB5,0x10F5}, /* 10F4 */
+ {0x1CB6,0x10F6},{0x1CB7,0x10F7}, /* 10F6 */
+ {0x1CB8,0x10F8},{0x1CB9,0x10F9}, /* 10F8 */
+ {0x1CBA,0x10FA},{0x10FB,0x10FB}, /* 10FA */
+ {0x10FC,0x10FC},{0x1CBD,0x10FD}, /* 10FC */
+ {0x1CBE,0x10FE},{0x1CBF,0x10FF} /* 10FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page13[256]={
+ {0x1300,0x1300},{0x1301,0x1301}, /* 1300 */
+ {0x1302,0x1302},{0x1303,0x1303}, /* 1302 */
+ {0x1304,0x1304},{0x1305,0x1305}, /* 1304 */
+ {0x1306,0x1306},{0x1307,0x1307}, /* 1306 */
+ {0x1308,0x1308},{0x1309,0x1309}, /* 1308 */
+ {0x130A,0x130A},{0x130B,0x130B}, /* 130A */
+ {0x130C,0x130C},{0x130D,0x130D}, /* 130C */
+ {0x130E,0x130E},{0x130F,0x130F}, /* 130E */
+ {0x1310,0x1310},{0x1311,0x1311}, /* 1310 */
+ {0x1312,0x1312},{0x1313,0x1313}, /* 1312 */
+ {0x1314,0x1314},{0x1315,0x1315}, /* 1314 */
+ {0x1316,0x1316},{0x1317,0x1317}, /* 1316 */
+ {0x1318,0x1318},{0x1319,0x1319}, /* 1318 */
+ {0x131A,0x131A},{0x131B,0x131B}, /* 131A */
+ {0x131C,0x131C},{0x131D,0x131D}, /* 131C */
+ {0x131E,0x131E},{0x131F,0x131F}, /* 131E */
+ {0x1320,0x1320},{0x1321,0x1321}, /* 1320 */
+ {0x1322,0x1322},{0x1323,0x1323}, /* 1322 */
+ {0x1324,0x1324},{0x1325,0x1325}, /* 1324 */
+ {0x1326,0x1326},{0x1327,0x1327}, /* 1326 */
+ {0x1328,0x1328},{0x1329,0x1329}, /* 1328 */
+ {0x132A,0x132A},{0x132B,0x132B}, /* 132A */
+ {0x132C,0x132C},{0x132D,0x132D}, /* 132C */
+ {0x132E,0x132E},{0x132F,0x132F}, /* 132E */
+ {0x1330,0x1330},{0x1331,0x1331}, /* 1330 */
+ {0x1332,0x1332},{0x1333,0x1333}, /* 1332 */
+ {0x1334,0x1334},{0x1335,0x1335}, /* 1334 */
+ {0x1336,0x1336},{0x1337,0x1337}, /* 1336 */
+ {0x1338,0x1338},{0x1339,0x1339}, /* 1338 */
+ {0x133A,0x133A},{0x133B,0x133B}, /* 133A */
+ {0x133C,0x133C},{0x133D,0x133D}, /* 133C */
+ {0x133E,0x133E},{0x133F,0x133F}, /* 133E */
+ {0x1340,0x1340},{0x1341,0x1341}, /* 1340 */
+ {0x1342,0x1342},{0x1343,0x1343}, /* 1342 */
+ {0x1344,0x1344},{0x1345,0x1345}, /* 1344 */
+ {0x1346,0x1346},{0x1347,0x1347}, /* 1346 */
+ {0x1348,0x1348},{0x1349,0x1349}, /* 1348 */
+ {0x134A,0x134A},{0x134B,0x134B}, /* 134A */
+ {0x134C,0x134C},{0x134D,0x134D}, /* 134C */
+ {0x134E,0x134E},{0x134F,0x134F}, /* 134E */
+ {0x1350,0x1350},{0x1351,0x1351}, /* 1350 */
+ {0x1352,0x1352},{0x1353,0x1353}, /* 1352 */
+ {0x1354,0x1354},{0x1355,0x1355}, /* 1354 */
+ {0x1356,0x1356},{0x1357,0x1357}, /* 1356 */
+ {0x1358,0x1358},{0x1359,0x1359}, /* 1358 */
+ {0x135A,0x135A},{0x135B,0x135B}, /* 135A */
+ {0x135C,0x135C},{0x135D,0x135D}, /* 135C */
+ {0x135E,0x135E},{0x135F,0x135F}, /* 135E */
+ {0x1360,0x1360},{0x1361,0x1361}, /* 1360 */
+ {0x1362,0x1362},{0x1363,0x1363}, /* 1362 */
+ {0x1364,0x1364},{0x1365,0x1365}, /* 1364 */
+ {0x1366,0x1366},{0x1367,0x1367}, /* 1366 */
+ {0x1368,0x1368},{0x1369,0x1369}, /* 1368 */
+ {0x136A,0x136A},{0x136B,0x136B}, /* 136A */
+ {0x136C,0x136C},{0x136D,0x136D}, /* 136C */
+ {0x136E,0x136E},{0x136F,0x136F}, /* 136E */
+ {0x1370,0x1370},{0x1371,0x1371}, /* 1370 */
+ {0x1372,0x1372},{0x1373,0x1373}, /* 1372 */
+ {0x1374,0x1374},{0x1375,0x1375}, /* 1374 */
+ {0x1376,0x1376},{0x1377,0x1377}, /* 1376 */
+ {0x1378,0x1378},{0x1379,0x1379}, /* 1378 */
+ {0x137A,0x137A},{0x137B,0x137B}, /* 137A */
+ {0x137C,0x137C},{0x137D,0x137D}, /* 137C */
+ {0x137E,0x137E},{0x137F,0x137F}, /* 137E */
+ {0x1380,0x1380},{0x1381,0x1381}, /* 1380 */
+ {0x1382,0x1382},{0x1383,0x1383}, /* 1382 */
+ {0x1384,0x1384},{0x1385,0x1385}, /* 1384 */
+ {0x1386,0x1386},{0x1387,0x1387}, /* 1386 */
+ {0x1388,0x1388},{0x1389,0x1389}, /* 1388 */
+ {0x138A,0x138A},{0x138B,0x138B}, /* 138A */
+ {0x138C,0x138C},{0x138D,0x138D}, /* 138C */
+ {0x138E,0x138E},{0x138F,0x138F}, /* 138E */
+ {0x1390,0x1390},{0x1391,0x1391}, /* 1390 */
+ {0x1392,0x1392},{0x1393,0x1393}, /* 1392 */
+ {0x1394,0x1394},{0x1395,0x1395}, /* 1394 */
+ {0x1396,0x1396},{0x1397,0x1397}, /* 1396 */
+ {0x1398,0x1398},{0x1399,0x1399}, /* 1398 */
+ {0x139A,0x139A},{0x139B,0x139B}, /* 139A */
+ {0x139C,0x139C},{0x139D,0x139D}, /* 139C */
+ {0x139E,0x139E},{0x139F,0x139F}, /* 139E */
+ {0x13A0,0xAB70},{0x13A1,0xAB71}, /* 13A0 */
+ {0x13A2,0xAB72},{0x13A3,0xAB73}, /* 13A2 */
+ {0x13A4,0xAB74},{0x13A5,0xAB75}, /* 13A4 */
+ {0x13A6,0xAB76},{0x13A7,0xAB77}, /* 13A6 */
+ {0x13A8,0xAB78},{0x13A9,0xAB79}, /* 13A8 */
+ {0x13AA,0xAB7A},{0x13AB,0xAB7B}, /* 13AA */
+ {0x13AC,0xAB7C},{0x13AD,0xAB7D}, /* 13AC */
+ {0x13AE,0xAB7E},{0x13AF,0xAB7F}, /* 13AE */
+ {0x13B0,0xAB80},{0x13B1,0xAB81}, /* 13B0 */
+ {0x13B2,0xAB82},{0x13B3,0xAB83}, /* 13B2 */
+ {0x13B4,0xAB84},{0x13B5,0xAB85}, /* 13B4 */
+ {0x13B6,0xAB86},{0x13B7,0xAB87}, /* 13B6 */
+ {0x13B8,0xAB88},{0x13B9,0xAB89}, /* 13B8 */
+ {0x13BA,0xAB8A},{0x13BB,0xAB8B}, /* 13BA */
+ {0x13BC,0xAB8C},{0x13BD,0xAB8D}, /* 13BC */
+ {0x13BE,0xAB8E},{0x13BF,0xAB8F}, /* 13BE */
+ {0x13C0,0xAB90},{0x13C1,0xAB91}, /* 13C0 */
+ {0x13C2,0xAB92},{0x13C3,0xAB93}, /* 13C2 */
+ {0x13C4,0xAB94},{0x13C5,0xAB95}, /* 13C4 */
+ {0x13C6,0xAB96},{0x13C7,0xAB97}, /* 13C6 */
+ {0x13C8,0xAB98},{0x13C9,0xAB99}, /* 13C8 */
+ {0x13CA,0xAB9A},{0x13CB,0xAB9B}, /* 13CA */
+ {0x13CC,0xAB9C},{0x13CD,0xAB9D}, /* 13CC */
+ {0x13CE,0xAB9E},{0x13CF,0xAB9F}, /* 13CE */
+ {0x13D0,0xABA0},{0x13D1,0xABA1}, /* 13D0 */
+ {0x13D2,0xABA2},{0x13D3,0xABA3}, /* 13D2 */
+ {0x13D4,0xABA4},{0x13D5,0xABA5}, /* 13D4 */
+ {0x13D6,0xABA6},{0x13D7,0xABA7}, /* 13D6 */
+ {0x13D8,0xABA8},{0x13D9,0xABA9}, /* 13D8 */
+ {0x13DA,0xABAA},{0x13DB,0xABAB}, /* 13DA */
+ {0x13DC,0xABAC},{0x13DD,0xABAD}, /* 13DC */
+ {0x13DE,0xABAE},{0x13DF,0xABAF}, /* 13DE */
+ {0x13E0,0xABB0},{0x13E1,0xABB1}, /* 13E0 */
+ {0x13E2,0xABB2},{0x13E3,0xABB3}, /* 13E2 */
+ {0x13E4,0xABB4},{0x13E5,0xABB5}, /* 13E4 */
+ {0x13E6,0xABB6},{0x13E7,0xABB7}, /* 13E6 */
+ {0x13E8,0xABB8},{0x13E9,0xABB9}, /* 13E8 */
+ {0x13EA,0xABBA},{0x13EB,0xABBB}, /* 13EA */
+ {0x13EC,0xABBC},{0x13ED,0xABBD}, /* 13EC */
+ {0x13EE,0xABBE},{0x13EF,0xABBF}, /* 13EE */
+ {0x13F0,0x13F8},{0x13F1,0x13F9}, /* 13F0 */
+ {0x13F2,0x13FA},{0x13F3,0x13FB}, /* 13F2 */
+ {0x13F4,0x13FC},{0x13F5,0x13FD}, /* 13F4 */
+ {0x13F6,0x13F6},{0x13F7,0x13F7}, /* 13F6 */
+ {0x13F0,0x13F8},{0x13F1,0x13F9}, /* 13F8 */
+ {0x13F2,0x13FA},{0x13F3,0x13FB}, /* 13FA */
+ {0x13F4,0x13FC},{0x13F5,0x13FD}, /* 13FC */
+ {0x13FE,0x13FE},{0x13FF,0x13FF} /* 13FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page1C[256]={
+ {0x1C00,0x1C00},{0x1C01,0x1C01}, /* 1C00 */
+ {0x1C02,0x1C02},{0x1C03,0x1C03}, /* 1C02 */
+ {0x1C04,0x1C04},{0x1C05,0x1C05}, /* 1C04 */
+ {0x1C06,0x1C06},{0x1C07,0x1C07}, /* 1C06 */
+ {0x1C08,0x1C08},{0x1C09,0x1C09}, /* 1C08 */
+ {0x1C0A,0x1C0A},{0x1C0B,0x1C0B}, /* 1C0A */
+ {0x1C0C,0x1C0C},{0x1C0D,0x1C0D}, /* 1C0C */
+ {0x1C0E,0x1C0E},{0x1C0F,0x1C0F}, /* 1C0E */
+ {0x1C10,0x1C10},{0x1C11,0x1C11}, /* 1C10 */
+ {0x1C12,0x1C12},{0x1C13,0x1C13}, /* 1C12 */
+ {0x1C14,0x1C14},{0x1C15,0x1C15}, /* 1C14 */
+ {0x1C16,0x1C16},{0x1C17,0x1C17}, /* 1C16 */
+ {0x1C18,0x1C18},{0x1C19,0x1C19}, /* 1C18 */
+ {0x1C1A,0x1C1A},{0x1C1B,0x1C1B}, /* 1C1A */
+ {0x1C1C,0x1C1C},{0x1C1D,0x1C1D}, /* 1C1C */
+ {0x1C1E,0x1C1E},{0x1C1F,0x1C1F}, /* 1C1E */
+ {0x1C20,0x1C20},{0x1C21,0x1C21}, /* 1C20 */
+ {0x1C22,0x1C22},{0x1C23,0x1C23}, /* 1C22 */
+ {0x1C24,0x1C24},{0x1C25,0x1C25}, /* 1C24 */
+ {0x1C26,0x1C26},{0x1C27,0x1C27}, /* 1C26 */
+ {0x1C28,0x1C28},{0x1C29,0x1C29}, /* 1C28 */
+ {0x1C2A,0x1C2A},{0x1C2B,0x1C2B}, /* 1C2A */
+ {0x1C2C,0x1C2C},{0x1C2D,0x1C2D}, /* 1C2C */
+ {0x1C2E,0x1C2E},{0x1C2F,0x1C2F}, /* 1C2E */
+ {0x1C30,0x1C30},{0x1C31,0x1C31}, /* 1C30 */
+ {0x1C32,0x1C32},{0x1C33,0x1C33}, /* 1C32 */
+ {0x1C34,0x1C34},{0x1C35,0x1C35}, /* 1C34 */
+ {0x1C36,0x1C36},{0x1C37,0x1C37}, /* 1C36 */
+ {0x1C38,0x1C38},{0x1C39,0x1C39}, /* 1C38 */
+ {0x1C3A,0x1C3A},{0x1C3B,0x1C3B}, /* 1C3A */
+ {0x1C3C,0x1C3C},{0x1C3D,0x1C3D}, /* 1C3C */
+ {0x1C3E,0x1C3E},{0x1C3F,0x1C3F}, /* 1C3E */
+ {0x1C40,0x1C40},{0x1C41,0x1C41}, /* 1C40 */
+ {0x1C42,0x1C42},{0x1C43,0x1C43}, /* 1C42 */
+ {0x1C44,0x1C44},{0x1C45,0x1C45}, /* 1C44 */
+ {0x1C46,0x1C46},{0x1C47,0x1C47}, /* 1C46 */
+ {0x1C48,0x1C48},{0x1C49,0x1C49}, /* 1C48 */
+ {0x1C4A,0x1C4A},{0x1C4B,0x1C4B}, /* 1C4A */
+ {0x1C4C,0x1C4C},{0x1C4D,0x1C4D}, /* 1C4C */
+ {0x1C4E,0x1C4E},{0x1C4F,0x1C4F}, /* 1C4E */
+ {0x1C50,0x1C50},{0x1C51,0x1C51}, /* 1C50 */
+ {0x1C52,0x1C52},{0x1C53,0x1C53}, /* 1C52 */
+ {0x1C54,0x1C54},{0x1C55,0x1C55}, /* 1C54 */
+ {0x1C56,0x1C56},{0x1C57,0x1C57}, /* 1C56 */
+ {0x1C58,0x1C58},{0x1C59,0x1C59}, /* 1C58 */
+ {0x1C5A,0x1C5A},{0x1C5B,0x1C5B}, /* 1C5A */
+ {0x1C5C,0x1C5C},{0x1C5D,0x1C5D}, /* 1C5C */
+ {0x1C5E,0x1C5E},{0x1C5F,0x1C5F}, /* 1C5E */
+ {0x1C60,0x1C60},{0x1C61,0x1C61}, /* 1C60 */
+ {0x1C62,0x1C62},{0x1C63,0x1C63}, /* 1C62 */
+ {0x1C64,0x1C64},{0x1C65,0x1C65}, /* 1C64 */
+ {0x1C66,0x1C66},{0x1C67,0x1C67}, /* 1C66 */
+ {0x1C68,0x1C68},{0x1C69,0x1C69}, /* 1C68 */
+ {0x1C6A,0x1C6A},{0x1C6B,0x1C6B}, /* 1C6A */
+ {0x1C6C,0x1C6C},{0x1C6D,0x1C6D}, /* 1C6C */
+ {0x1C6E,0x1C6E},{0x1C6F,0x1C6F}, /* 1C6E */
+ {0x1C70,0x1C70},{0x1C71,0x1C71}, /* 1C70 */
+ {0x1C72,0x1C72},{0x1C73,0x1C73}, /* 1C72 */
+ {0x1C74,0x1C74},{0x1C75,0x1C75}, /* 1C74 */
+ {0x1C76,0x1C76},{0x1C77,0x1C77}, /* 1C76 */
+ {0x1C78,0x1C78},{0x1C79,0x1C79}, /* 1C78 */
+ {0x1C7A,0x1C7A},{0x1C7B,0x1C7B}, /* 1C7A */
+ {0x1C7C,0x1C7C},{0x1C7D,0x1C7D}, /* 1C7C */
+ {0x1C7E,0x1C7E},{0x1C7F,0x1C7F}, /* 1C7E */
+ {0x0412,0x1C80},{0x0414,0x1C81}, /* 1C80 */
+ {0x041E,0x1C82},{0x0421,0x1C83}, /* 1C82 */
+ {0x0422,0x1C84},{0x0422,0x1C85}, /* 1C84 */
+ {0x042A,0x1C86},{0x0462,0x1C87}, /* 1C86 */
+ {0xA64A,0x1C88},{0x1C89,0x1C89}, /* 1C88 */
+ {0x1C8A,0x1C8A},{0x1C8B,0x1C8B}, /* 1C8A */
+ {0x1C8C,0x1C8C},{0x1C8D,0x1C8D}, /* 1C8C */
+ {0x1C8E,0x1C8E},{0x1C8F,0x1C8F}, /* 1C8E */
+ {0x1C90,0x10D0},{0x1C91,0x10D1}, /* 1C90 */
+ {0x1C92,0x10D2},{0x1C93,0x10D3}, /* 1C92 */
+ {0x1C94,0x10D4},{0x1C95,0x10D5}, /* 1C94 */
+ {0x1C96,0x10D6},{0x1C97,0x10D7}, /* 1C96 */
+ {0x1C98,0x10D8},{0x1C99,0x10D9}, /* 1C98 */
+ {0x1C9A,0x10DA},{0x1C9B,0x10DB}, /* 1C9A */
+ {0x1C9C,0x10DC},{0x1C9D,0x10DD}, /* 1C9C */
+ {0x1C9E,0x10DE},{0x1C9F,0x10DF}, /* 1C9E */
+ {0x1CA0,0x10E0},{0x1CA1,0x10E1}, /* 1CA0 */
+ {0x1CA2,0x10E2},{0x1CA3,0x10E3}, /* 1CA2 */
+ {0x1CA4,0x10E4},{0x1CA5,0x10E5}, /* 1CA4 */
+ {0x1CA6,0x10E6},{0x1CA7,0x10E7}, /* 1CA6 */
+ {0x1CA8,0x10E8},{0x1CA9,0x10E9}, /* 1CA8 */
+ {0x1CAA,0x10EA},{0x1CAB,0x10EB}, /* 1CAA */
+ {0x1CAC,0x10EC},{0x1CAD,0x10ED}, /* 1CAC */
+ {0x1CAE,0x10EE},{0x1CAF,0x10EF}, /* 1CAE */
+ {0x1CB0,0x10F0},{0x1CB1,0x10F1}, /* 1CB0 */
+ {0x1CB2,0x10F2},{0x1CB3,0x10F3}, /* 1CB2 */
+ {0x1CB4,0x10F4},{0x1CB5,0x10F5}, /* 1CB4 */
+ {0x1CB6,0x10F6},{0x1CB7,0x10F7}, /* 1CB6 */
+ {0x1CB8,0x10F8},{0x1CB9,0x10F9}, /* 1CB8 */
+ {0x1CBA,0x10FA},{0x1CBB,0x1CBB}, /* 1CBA */
+ {0x1CBC,0x1CBC},{0x1CBD,0x10FD}, /* 1CBC */
+ {0x1CBE,0x10FE},{0x1CBF,0x10FF}, /* 1CBE */
+ {0x1CC0,0x1CC0},{0x1CC1,0x1CC1}, /* 1CC0 */
+ {0x1CC2,0x1CC2},{0x1CC3,0x1CC3}, /* 1CC2 */
+ {0x1CC4,0x1CC4},{0x1CC5,0x1CC5}, /* 1CC4 */
+ {0x1CC6,0x1CC6},{0x1CC7,0x1CC7}, /* 1CC6 */
+ {0x1CC8,0x1CC8},{0x1CC9,0x1CC9}, /* 1CC8 */
+ {0x1CCA,0x1CCA},{0x1CCB,0x1CCB}, /* 1CCA */
+ {0x1CCC,0x1CCC},{0x1CCD,0x1CCD}, /* 1CCC */
+ {0x1CCE,0x1CCE},{0x1CCF,0x1CCF}, /* 1CCE */
+ {0x1CD0,0x1CD0},{0x1CD1,0x1CD1}, /* 1CD0 */
+ {0x1CD2,0x1CD2},{0x1CD3,0x1CD3}, /* 1CD2 */
+ {0x1CD4,0x1CD4},{0x1CD5,0x1CD5}, /* 1CD4 */
+ {0x1CD6,0x1CD6},{0x1CD7,0x1CD7}, /* 1CD6 */
+ {0x1CD8,0x1CD8},{0x1CD9,0x1CD9}, /* 1CD8 */
+ {0x1CDA,0x1CDA},{0x1CDB,0x1CDB}, /* 1CDA */
+ {0x1CDC,0x1CDC},{0x1CDD,0x1CDD}, /* 1CDC */
+ {0x1CDE,0x1CDE},{0x1CDF,0x1CDF}, /* 1CDE */
+ {0x1CE0,0x1CE0},{0x1CE1,0x1CE1}, /* 1CE0 */
+ {0x1CE2,0x1CE2},{0x1CE3,0x1CE3}, /* 1CE2 */
+ {0x1CE4,0x1CE4},{0x1CE5,0x1CE5}, /* 1CE4 */
+ {0x1CE6,0x1CE6},{0x1CE7,0x1CE7}, /* 1CE6 */
+ {0x1CE8,0x1CE8},{0x1CE9,0x1CE9}, /* 1CE8 */
+ {0x1CEA,0x1CEA},{0x1CEB,0x1CEB}, /* 1CEA */
+ {0x1CEC,0x1CEC},{0x1CED,0x1CED}, /* 1CEC */
+ {0x1CEE,0x1CEE},{0x1CEF,0x1CEF}, /* 1CEE */
+ {0x1CF0,0x1CF0},{0x1CF1,0x1CF1}, /* 1CF0 */
+ {0x1CF2,0x1CF2},{0x1CF3,0x1CF3}, /* 1CF2 */
+ {0x1CF4,0x1CF4},{0x1CF5,0x1CF5}, /* 1CF4 */
+ {0x1CF6,0x1CF6},{0x1CF7,0x1CF7}, /* 1CF6 */
+ {0x1CF8,0x1CF8},{0x1CF9,0x1CF9}, /* 1CF8 */
+ {0x1CFA,0x1CFA},{0x1CFB,0x1CFB}, /* 1CFA */
+ {0x1CFC,0x1CFC},{0x1CFD,0x1CFD}, /* 1CFC */
+ {0x1CFE,0x1CFE},{0x1CFF,0x1CFF} /* 1CFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page1D[256]={
+ {0x1D00,0x1D00},{0x1D01,0x1D01}, /* 1D00 */
+ {0x1D02,0x1D02},{0x1D03,0x1D03}, /* 1D02 */
+ {0x1D04,0x1D04},{0x1D05,0x1D05}, /* 1D04 */
+ {0x1D06,0x1D06},{0x1D07,0x1D07}, /* 1D06 */
+ {0x1D08,0x1D08},{0x1D09,0x1D09}, /* 1D08 */
+ {0x1D0A,0x1D0A},{0x1D0B,0x1D0B}, /* 1D0A */
+ {0x1D0C,0x1D0C},{0x1D0D,0x1D0D}, /* 1D0C */
+ {0x1D0E,0x1D0E},{0x1D0F,0x1D0F}, /* 1D0E */
+ {0x1D10,0x1D10},{0x1D11,0x1D11}, /* 1D10 */
+ {0x1D12,0x1D12},{0x1D13,0x1D13}, /* 1D12 */
+ {0x1D14,0x1D14},{0x1D15,0x1D15}, /* 1D14 */
+ {0x1D16,0x1D16},{0x1D17,0x1D17}, /* 1D16 */
+ {0x1D18,0x1D18},{0x1D19,0x1D19}, /* 1D18 */
+ {0x1D1A,0x1D1A},{0x1D1B,0x1D1B}, /* 1D1A */
+ {0x1D1C,0x1D1C},{0x1D1D,0x1D1D}, /* 1D1C */
+ {0x1D1E,0x1D1E},{0x1D1F,0x1D1F}, /* 1D1E */
+ {0x1D20,0x1D20},{0x1D21,0x1D21}, /* 1D20 */
+ {0x1D22,0x1D22},{0x1D23,0x1D23}, /* 1D22 */
+ {0x1D24,0x1D24},{0x1D25,0x1D25}, /* 1D24 */
+ {0x1D26,0x1D26},{0x1D27,0x1D27}, /* 1D26 */
+ {0x1D28,0x1D28},{0x1D29,0x1D29}, /* 1D28 */
+ {0x1D2A,0x1D2A},{0x1D2B,0x1D2B}, /* 1D2A */
+ {0x1D2C,0x1D2C},{0x1D2D,0x1D2D}, /* 1D2C */
+ {0x1D2E,0x1D2E},{0x1D2F,0x1D2F}, /* 1D2E */
+ {0x1D30,0x1D30},{0x1D31,0x1D31}, /* 1D30 */
+ {0x1D32,0x1D32},{0x1D33,0x1D33}, /* 1D32 */
+ {0x1D34,0x1D34},{0x1D35,0x1D35}, /* 1D34 */
+ {0x1D36,0x1D36},{0x1D37,0x1D37}, /* 1D36 */
+ {0x1D38,0x1D38},{0x1D39,0x1D39}, /* 1D38 */
+ {0x1D3A,0x1D3A},{0x1D3B,0x1D3B}, /* 1D3A */
+ {0x1D3C,0x1D3C},{0x1D3D,0x1D3D}, /* 1D3C */
+ {0x1D3E,0x1D3E},{0x1D3F,0x1D3F}, /* 1D3E */
+ {0x1D40,0x1D40},{0x1D41,0x1D41}, /* 1D40 */
+ {0x1D42,0x1D42},{0x1D43,0x1D43}, /* 1D42 */
+ {0x1D44,0x1D44},{0x1D45,0x1D45}, /* 1D44 */
+ {0x1D46,0x1D46},{0x1D47,0x1D47}, /* 1D46 */
+ {0x1D48,0x1D48},{0x1D49,0x1D49}, /* 1D48 */
+ {0x1D4A,0x1D4A},{0x1D4B,0x1D4B}, /* 1D4A */
+ {0x1D4C,0x1D4C},{0x1D4D,0x1D4D}, /* 1D4C */
+ {0x1D4E,0x1D4E},{0x1D4F,0x1D4F}, /* 1D4E */
+ {0x1D50,0x1D50},{0x1D51,0x1D51}, /* 1D50 */
+ {0x1D52,0x1D52},{0x1D53,0x1D53}, /* 1D52 */
+ {0x1D54,0x1D54},{0x1D55,0x1D55}, /* 1D54 */
+ {0x1D56,0x1D56},{0x1D57,0x1D57}, /* 1D56 */
+ {0x1D58,0x1D58},{0x1D59,0x1D59}, /* 1D58 */
+ {0x1D5A,0x1D5A},{0x1D5B,0x1D5B}, /* 1D5A */
+ {0x1D5C,0x1D5C},{0x1D5D,0x1D5D}, /* 1D5C */
+ {0x1D5E,0x1D5E},{0x1D5F,0x1D5F}, /* 1D5E */
+ {0x1D60,0x1D60},{0x1D61,0x1D61}, /* 1D60 */
+ {0x1D62,0x1D62},{0x1D63,0x1D63}, /* 1D62 */
+ {0x1D64,0x1D64},{0x1D65,0x1D65}, /* 1D64 */
+ {0x1D66,0x1D66},{0x1D67,0x1D67}, /* 1D66 */
+ {0x1D68,0x1D68},{0x1D69,0x1D69}, /* 1D68 */
+ {0x1D6A,0x1D6A},{0x1D6B,0x1D6B}, /* 1D6A */
+ {0x1D6C,0x1D6C},{0x1D6D,0x1D6D}, /* 1D6C */
+ {0x1D6E,0x1D6E},{0x1D6F,0x1D6F}, /* 1D6E */
+ {0x1D70,0x1D70},{0x1D71,0x1D71}, /* 1D70 */
+ {0x1D72,0x1D72},{0x1D73,0x1D73}, /* 1D72 */
+ {0x1D74,0x1D74},{0x1D75,0x1D75}, /* 1D74 */
+ {0x1D76,0x1D76},{0x1D77,0x1D77}, /* 1D76 */
+ {0x1D78,0x1D78},{0xA77D,0x1D79}, /* 1D78 */
+ {0x1D7A,0x1D7A},{0x1D7B,0x1D7B}, /* 1D7A */
+ {0x1D7C,0x1D7C},{0x2C63,0x1D7D}, /* 1D7C */
+ {0x1D7E,0x1D7E},{0x1D7F,0x1D7F}, /* 1D7E */
+ {0x1D80,0x1D80},{0x1D81,0x1D81}, /* 1D80 */
+ {0x1D82,0x1D82},{0x1D83,0x1D83}, /* 1D82 */
+ {0x1D84,0x1D84},{0x1D85,0x1D85}, /* 1D84 */
+ {0x1D86,0x1D86},{0x1D87,0x1D87}, /* 1D86 */
+ {0x1D88,0x1D88},{0x1D89,0x1D89}, /* 1D88 */
+ {0x1D8A,0x1D8A},{0x1D8B,0x1D8B}, /* 1D8A */
+ {0x1D8C,0x1D8C},{0x1D8D,0x1D8D}, /* 1D8C */
+ {0xA7C6,0x1D8E},{0x1D8F,0x1D8F}, /* 1D8E */
+ {0x1D90,0x1D90},{0x1D91,0x1D91}, /* 1D90 */
+ {0x1D92,0x1D92},{0x1D93,0x1D93}, /* 1D92 */
+ {0x1D94,0x1D94},{0x1D95,0x1D95}, /* 1D94 */
+ {0x1D96,0x1D96},{0x1D97,0x1D97}, /* 1D96 */
+ {0x1D98,0x1D98},{0x1D99,0x1D99}, /* 1D98 */
+ {0x1D9A,0x1D9A},{0x1D9B,0x1D9B}, /* 1D9A */
+ {0x1D9C,0x1D9C},{0x1D9D,0x1D9D}, /* 1D9C */
+ {0x1D9E,0x1D9E},{0x1D9F,0x1D9F}, /* 1D9E */
+ {0x1DA0,0x1DA0},{0x1DA1,0x1DA1}, /* 1DA0 */
+ {0x1DA2,0x1DA2},{0x1DA3,0x1DA3}, /* 1DA2 */
+ {0x1DA4,0x1DA4},{0x1DA5,0x1DA5}, /* 1DA4 */
+ {0x1DA6,0x1DA6},{0x1DA7,0x1DA7}, /* 1DA6 */
+ {0x1DA8,0x1DA8},{0x1DA9,0x1DA9}, /* 1DA8 */
+ {0x1DAA,0x1DAA},{0x1DAB,0x1DAB}, /* 1DAA */
+ {0x1DAC,0x1DAC},{0x1DAD,0x1DAD}, /* 1DAC */
+ {0x1DAE,0x1DAE},{0x1DAF,0x1DAF}, /* 1DAE */
+ {0x1DB0,0x1DB0},{0x1DB1,0x1DB1}, /* 1DB0 */
+ {0x1DB2,0x1DB2},{0x1DB3,0x1DB3}, /* 1DB2 */
+ {0x1DB4,0x1DB4},{0x1DB5,0x1DB5}, /* 1DB4 */
+ {0x1DB6,0x1DB6},{0x1DB7,0x1DB7}, /* 1DB6 */
+ {0x1DB8,0x1DB8},{0x1DB9,0x1DB9}, /* 1DB8 */
+ {0x1DBA,0x1DBA},{0x1DBB,0x1DBB}, /* 1DBA */
+ {0x1DBC,0x1DBC},{0x1DBD,0x1DBD}, /* 1DBC */
+ {0x1DBE,0x1DBE},{0x1DBF,0x1DBF}, /* 1DBE */
+ {0x1DC0,0x1DC0},{0x1DC1,0x1DC1}, /* 1DC0 */
+ {0x1DC2,0x1DC2},{0x1DC3,0x1DC3}, /* 1DC2 */
+ {0x1DC4,0x1DC4},{0x1DC5,0x1DC5}, /* 1DC4 */
+ {0x1DC6,0x1DC6},{0x1DC7,0x1DC7}, /* 1DC6 */
+ {0x1DC8,0x1DC8},{0x1DC9,0x1DC9}, /* 1DC8 */
+ {0x1DCA,0x1DCA},{0x1DCB,0x1DCB}, /* 1DCA */
+ {0x1DCC,0x1DCC},{0x1DCD,0x1DCD}, /* 1DCC */
+ {0x1DCE,0x1DCE},{0x1DCF,0x1DCF}, /* 1DCE */
+ {0x1DD0,0x1DD0},{0x1DD1,0x1DD1}, /* 1DD0 */
+ {0x1DD2,0x1DD2},{0x1DD3,0x1DD3}, /* 1DD2 */
+ {0x1DD4,0x1DD4},{0x1DD5,0x1DD5}, /* 1DD4 */
+ {0x1DD6,0x1DD6},{0x1DD7,0x1DD7}, /* 1DD6 */
+ {0x1DD8,0x1DD8},{0x1DD9,0x1DD9}, /* 1DD8 */
+ {0x1DDA,0x1DDA},{0x1DDB,0x1DDB}, /* 1DDA */
+ {0x1DDC,0x1DDC},{0x1DDD,0x1DDD}, /* 1DDC */
+ {0x1DDE,0x1DDE},{0x1DDF,0x1DDF}, /* 1DDE */
+ {0x1DE0,0x1DE0},{0x1DE1,0x1DE1}, /* 1DE0 */
+ {0x1DE2,0x1DE2},{0x1DE3,0x1DE3}, /* 1DE2 */
+ {0x1DE4,0x1DE4},{0x1DE5,0x1DE5}, /* 1DE4 */
+ {0x1DE6,0x1DE6},{0x1DE7,0x1DE7}, /* 1DE6 */
+ {0x1DE8,0x1DE8},{0x1DE9,0x1DE9}, /* 1DE8 */
+ {0x1DEA,0x1DEA},{0x1DEB,0x1DEB}, /* 1DEA */
+ {0x1DEC,0x1DEC},{0x1DED,0x1DED}, /* 1DEC */
+ {0x1DEE,0x1DEE},{0x1DEF,0x1DEF}, /* 1DEE */
+ {0x1DF0,0x1DF0},{0x1DF1,0x1DF1}, /* 1DF0 */
+ {0x1DF2,0x1DF2},{0x1DF3,0x1DF3}, /* 1DF2 */
+ {0x1DF4,0x1DF4},{0x1DF5,0x1DF5}, /* 1DF4 */
+ {0x1DF6,0x1DF6},{0x1DF7,0x1DF7}, /* 1DF6 */
+ {0x1DF8,0x1DF8},{0x1DF9,0x1DF9}, /* 1DF8 */
+ {0x1DFA,0x1DFA},{0x1DFB,0x1DFB}, /* 1DFA */
+ {0x1DFC,0x1DFC},{0x1DFD,0x1DFD}, /* 1DFC */
+ {0x1DFE,0x1DFE},{0x1DFF,0x1DFF} /* 1DFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page1E[256]={
+ {0x1E00,0x1E01},{0x1E00,0x1E01}, /* 1E00 */
+ {0x1E02,0x1E03},{0x1E02,0x1E03}, /* 1E02 */
+ {0x1E04,0x1E05},{0x1E04,0x1E05}, /* 1E04 */
+ {0x1E06,0x1E07},{0x1E06,0x1E07}, /* 1E06 */
+ {0x1E08,0x1E09},{0x1E08,0x1E09}, /* 1E08 */
+ {0x1E0A,0x1E0B},{0x1E0A,0x1E0B}, /* 1E0A */
+ {0x1E0C,0x1E0D},{0x1E0C,0x1E0D}, /* 1E0C */
+ {0x1E0E,0x1E0F},{0x1E0E,0x1E0F}, /* 1E0E */
+ {0x1E10,0x1E11},{0x1E10,0x1E11}, /* 1E10 */
+ {0x1E12,0x1E13},{0x1E12,0x1E13}, /* 1E12 */
+ {0x1E14,0x1E15},{0x1E14,0x1E15}, /* 1E14 */
+ {0x1E16,0x1E17},{0x1E16,0x1E17}, /* 1E16 */
+ {0x1E18,0x1E19},{0x1E18,0x1E19}, /* 1E18 */
+ {0x1E1A,0x1E1B},{0x1E1A,0x1E1B}, /* 1E1A */
+ {0x1E1C,0x1E1D},{0x1E1C,0x1E1D}, /* 1E1C */
+ {0x1E1E,0x1E1F},{0x1E1E,0x1E1F}, /* 1E1E */
+ {0x1E20,0x1E21},{0x1E20,0x1E21}, /* 1E20 */
+ {0x1E22,0x1E23},{0x1E22,0x1E23}, /* 1E22 */
+ {0x1E24,0x1E25},{0x1E24,0x1E25}, /* 1E24 */
+ {0x1E26,0x1E27},{0x1E26,0x1E27}, /* 1E26 */
+ {0x1E28,0x1E29},{0x1E28,0x1E29}, /* 1E28 */
+ {0x1E2A,0x1E2B},{0x1E2A,0x1E2B}, /* 1E2A */
+ {0x1E2C,0x1E2D},{0x1E2C,0x1E2D}, /* 1E2C */
+ {0x1E2E,0x1E2F},{0x1E2E,0x1E2F}, /* 1E2E */
+ {0x1E30,0x1E31},{0x1E30,0x1E31}, /* 1E30 */
+ {0x1E32,0x1E33},{0x1E32,0x1E33}, /* 1E32 */
+ {0x1E34,0x1E35},{0x1E34,0x1E35}, /* 1E34 */
+ {0x1E36,0x1E37},{0x1E36,0x1E37}, /* 1E36 */
+ {0x1E38,0x1E39},{0x1E38,0x1E39}, /* 1E38 */
+ {0x1E3A,0x1E3B},{0x1E3A,0x1E3B}, /* 1E3A */
+ {0x1E3C,0x1E3D},{0x1E3C,0x1E3D}, /* 1E3C */
+ {0x1E3E,0x1E3F},{0x1E3E,0x1E3F}, /* 1E3E */
+ {0x1E40,0x1E41},{0x1E40,0x1E41}, /* 1E40 */
+ {0x1E42,0x1E43},{0x1E42,0x1E43}, /* 1E42 */
+ {0x1E44,0x1E45},{0x1E44,0x1E45}, /* 1E44 */
+ {0x1E46,0x1E47},{0x1E46,0x1E47}, /* 1E46 */
+ {0x1E48,0x1E49},{0x1E48,0x1E49}, /* 1E48 */
+ {0x1E4A,0x1E4B},{0x1E4A,0x1E4B}, /* 1E4A */
+ {0x1E4C,0x1E4D},{0x1E4C,0x1E4D}, /* 1E4C */
+ {0x1E4E,0x1E4F},{0x1E4E,0x1E4F}, /* 1E4E */
+ {0x1E50,0x1E51},{0x1E50,0x1E51}, /* 1E50 */
+ {0x1E52,0x1E53},{0x1E52,0x1E53}, /* 1E52 */
+ {0x1E54,0x1E55},{0x1E54,0x1E55}, /* 1E54 */
+ {0x1E56,0x1E57},{0x1E56,0x1E57}, /* 1E56 */
+ {0x1E58,0x1E59},{0x1E58,0x1E59}, /* 1E58 */
+ {0x1E5A,0x1E5B},{0x1E5A,0x1E5B}, /* 1E5A */
+ {0x1E5C,0x1E5D},{0x1E5C,0x1E5D}, /* 1E5C */
+ {0x1E5E,0x1E5F},{0x1E5E,0x1E5F}, /* 1E5E */
+ {0x1E60,0x1E61},{0x1E60,0x1E61}, /* 1E60 */
+ {0x1E62,0x1E63},{0x1E62,0x1E63}, /* 1E62 */
+ {0x1E64,0x1E65},{0x1E64,0x1E65}, /* 1E64 */
+ {0x1E66,0x1E67},{0x1E66,0x1E67}, /* 1E66 */
+ {0x1E68,0x1E69},{0x1E68,0x1E69}, /* 1E68 */
+ {0x1E6A,0x1E6B},{0x1E6A,0x1E6B}, /* 1E6A */
+ {0x1E6C,0x1E6D},{0x1E6C,0x1E6D}, /* 1E6C */
+ {0x1E6E,0x1E6F},{0x1E6E,0x1E6F}, /* 1E6E */
+ {0x1E70,0x1E71},{0x1E70,0x1E71}, /* 1E70 */
+ {0x1E72,0x1E73},{0x1E72,0x1E73}, /* 1E72 */
+ {0x1E74,0x1E75},{0x1E74,0x1E75}, /* 1E74 */
+ {0x1E76,0x1E77},{0x1E76,0x1E77}, /* 1E76 */
+ {0x1E78,0x1E79},{0x1E78,0x1E79}, /* 1E78 */
+ {0x1E7A,0x1E7B},{0x1E7A,0x1E7B}, /* 1E7A */
+ {0x1E7C,0x1E7D},{0x1E7C,0x1E7D}, /* 1E7C */
+ {0x1E7E,0x1E7F},{0x1E7E,0x1E7F}, /* 1E7E */
+ {0x1E80,0x1E81},{0x1E80,0x1E81}, /* 1E80 */
+ {0x1E82,0x1E83},{0x1E82,0x1E83}, /* 1E82 */
+ {0x1E84,0x1E85},{0x1E84,0x1E85}, /* 1E84 */
+ {0x1E86,0x1E87},{0x1E86,0x1E87}, /* 1E86 */
+ {0x1E88,0x1E89},{0x1E88,0x1E89}, /* 1E88 */
+ {0x1E8A,0x1E8B},{0x1E8A,0x1E8B}, /* 1E8A */
+ {0x1E8C,0x1E8D},{0x1E8C,0x1E8D}, /* 1E8C */
+ {0x1E8E,0x1E8F},{0x1E8E,0x1E8F}, /* 1E8E */
+ {0x1E90,0x1E91},{0x1E90,0x1E91}, /* 1E90 */
+ {0x1E92,0x1E93},{0x1E92,0x1E93}, /* 1E92 */
+ {0x1E94,0x1E95},{0x1E94,0x1E95}, /* 1E94 */
+ {0x1E96,0x1E96},{0x1E97,0x1E97}, /* 1E96 */
+ {0x1E98,0x1E98},{0x1E99,0x1E99}, /* 1E98 */
+ {0x1E9A,0x1E9A},{0x1E60,0x1E9B}, /* 1E9A */
+ {0x1E9C,0x1E9C},{0x1E9D,0x1E9D}, /* 1E9C */
+ {0x1E9E,0x00DF},{0x1E9F,0x1E9F}, /* 1E9E */
+ {0x1EA0,0x1EA1},{0x1EA0,0x1EA1}, /* 1EA0 */
+ {0x1EA2,0x1EA3},{0x1EA2,0x1EA3}, /* 1EA2 */
+ {0x1EA4,0x1EA5},{0x1EA4,0x1EA5}, /* 1EA4 */
+ {0x1EA6,0x1EA7},{0x1EA6,0x1EA7}, /* 1EA6 */
+ {0x1EA8,0x1EA9},{0x1EA8,0x1EA9}, /* 1EA8 */
+ {0x1EAA,0x1EAB},{0x1EAA,0x1EAB}, /* 1EAA */
+ {0x1EAC,0x1EAD},{0x1EAC,0x1EAD}, /* 1EAC */
+ {0x1EAE,0x1EAF},{0x1EAE,0x1EAF}, /* 1EAE */
+ {0x1EB0,0x1EB1},{0x1EB0,0x1EB1}, /* 1EB0 */
+ {0x1EB2,0x1EB3},{0x1EB2,0x1EB3}, /* 1EB2 */
+ {0x1EB4,0x1EB5},{0x1EB4,0x1EB5}, /* 1EB4 */
+ {0x1EB6,0x1EB7},{0x1EB6,0x1EB7}, /* 1EB6 */
+ {0x1EB8,0x1EB9},{0x1EB8,0x1EB9}, /* 1EB8 */
+ {0x1EBA,0x1EBB},{0x1EBA,0x1EBB}, /* 1EBA */
+ {0x1EBC,0x1EBD},{0x1EBC,0x1EBD}, /* 1EBC */
+ {0x1EBE,0x1EBF},{0x1EBE,0x1EBF}, /* 1EBE */
+ {0x1EC0,0x1EC1},{0x1EC0,0x1EC1}, /* 1EC0 */
+ {0x1EC2,0x1EC3},{0x1EC2,0x1EC3}, /* 1EC2 */
+ {0x1EC4,0x1EC5},{0x1EC4,0x1EC5}, /* 1EC4 */
+ {0x1EC6,0x1EC7},{0x1EC6,0x1EC7}, /* 1EC6 */
+ {0x1EC8,0x1EC9},{0x1EC8,0x1EC9}, /* 1EC8 */
+ {0x1ECA,0x1ECB},{0x1ECA,0x1ECB}, /* 1ECA */
+ {0x1ECC,0x1ECD},{0x1ECC,0x1ECD}, /* 1ECC */
+ {0x1ECE,0x1ECF},{0x1ECE,0x1ECF}, /* 1ECE */
+ {0x1ED0,0x1ED1},{0x1ED0,0x1ED1}, /* 1ED0 */
+ {0x1ED2,0x1ED3},{0x1ED2,0x1ED3}, /* 1ED2 */
+ {0x1ED4,0x1ED5},{0x1ED4,0x1ED5}, /* 1ED4 */
+ {0x1ED6,0x1ED7},{0x1ED6,0x1ED7}, /* 1ED6 */
+ {0x1ED8,0x1ED9},{0x1ED8,0x1ED9}, /* 1ED8 */
+ {0x1EDA,0x1EDB},{0x1EDA,0x1EDB}, /* 1EDA */
+ {0x1EDC,0x1EDD},{0x1EDC,0x1EDD}, /* 1EDC */
+ {0x1EDE,0x1EDF},{0x1EDE,0x1EDF}, /* 1EDE */
+ {0x1EE0,0x1EE1},{0x1EE0,0x1EE1}, /* 1EE0 */
+ {0x1EE2,0x1EE3},{0x1EE2,0x1EE3}, /* 1EE2 */
+ {0x1EE4,0x1EE5},{0x1EE4,0x1EE5}, /* 1EE4 */
+ {0x1EE6,0x1EE7},{0x1EE6,0x1EE7}, /* 1EE6 */
+ {0x1EE8,0x1EE9},{0x1EE8,0x1EE9}, /* 1EE8 */
+ {0x1EEA,0x1EEB},{0x1EEA,0x1EEB}, /* 1EEA */
+ {0x1EEC,0x1EED},{0x1EEC,0x1EED}, /* 1EEC */
+ {0x1EEE,0x1EEF},{0x1EEE,0x1EEF}, /* 1EEE */
+ {0x1EF0,0x1EF1},{0x1EF0,0x1EF1}, /* 1EF0 */
+ {0x1EF2,0x1EF3},{0x1EF2,0x1EF3}, /* 1EF2 */
+ {0x1EF4,0x1EF5},{0x1EF4,0x1EF5}, /* 1EF4 */
+ {0x1EF6,0x1EF7},{0x1EF6,0x1EF7}, /* 1EF6 */
+ {0x1EF8,0x1EF9},{0x1EF8,0x1EF9}, /* 1EF8 */
+ {0x1EFA,0x1EFB},{0x1EFA,0x1EFB}, /* 1EFA */
+ {0x1EFC,0x1EFD},{0x1EFC,0x1EFD}, /* 1EFC */
+ {0x1EFE,0x1EFF},{0x1EFE,0x1EFF} /* 1EFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page1F[256]={
+ {0x1F08,0x1F00},{0x1F09,0x1F01}, /* 1F00 */
+ {0x1F0A,0x1F02},{0x1F0B,0x1F03}, /* 1F02 */
+ {0x1F0C,0x1F04},{0x1F0D,0x1F05}, /* 1F04 */
+ {0x1F0E,0x1F06},{0x1F0F,0x1F07}, /* 1F06 */
+ {0x1F08,0x1F00},{0x1F09,0x1F01}, /* 1F08 */
+ {0x1F0A,0x1F02},{0x1F0B,0x1F03}, /* 1F0A */
+ {0x1F0C,0x1F04},{0x1F0D,0x1F05}, /* 1F0C */
+ {0x1F0E,0x1F06},{0x1F0F,0x1F07}, /* 1F0E */
+ {0x1F18,0x1F10},{0x1F19,0x1F11}, /* 1F10 */
+ {0x1F1A,0x1F12},{0x1F1B,0x1F13}, /* 1F12 */
+ {0x1F1C,0x1F14},{0x1F1D,0x1F15}, /* 1F14 */
+ {0x1F16,0x1F16},{0x1F17,0x1F17}, /* 1F16 */
+ {0x1F18,0x1F10},{0x1F19,0x1F11}, /* 1F18 */
+ {0x1F1A,0x1F12},{0x1F1B,0x1F13}, /* 1F1A */
+ {0x1F1C,0x1F14},{0x1F1D,0x1F15}, /* 1F1C */
+ {0x1F1E,0x1F1E},{0x1F1F,0x1F1F}, /* 1F1E */
+ {0x1F28,0x1F20},{0x1F29,0x1F21}, /* 1F20 */
+ {0x1F2A,0x1F22},{0x1F2B,0x1F23}, /* 1F22 */
+ {0x1F2C,0x1F24},{0x1F2D,0x1F25}, /* 1F24 */
+ {0x1F2E,0x1F26},{0x1F2F,0x1F27}, /* 1F26 */
+ {0x1F28,0x1F20},{0x1F29,0x1F21}, /* 1F28 */
+ {0x1F2A,0x1F22},{0x1F2B,0x1F23}, /* 1F2A */
+ {0x1F2C,0x1F24},{0x1F2D,0x1F25}, /* 1F2C */
+ {0x1F2E,0x1F26},{0x1F2F,0x1F27}, /* 1F2E */
+ {0x1F38,0x1F30},{0x1F39,0x1F31}, /* 1F30 */
+ {0x1F3A,0x1F32},{0x1F3B,0x1F33}, /* 1F32 */
+ {0x1F3C,0x1F34},{0x1F3D,0x1F35}, /* 1F34 */
+ {0x1F3E,0x1F36},{0x1F3F,0x1F37}, /* 1F36 */
+ {0x1F38,0x1F30},{0x1F39,0x1F31}, /* 1F38 */
+ {0x1F3A,0x1F32},{0x1F3B,0x1F33}, /* 1F3A */
+ {0x1F3C,0x1F34},{0x1F3D,0x1F35}, /* 1F3C */
+ {0x1F3E,0x1F36},{0x1F3F,0x1F37}, /* 1F3E */
+ {0x1F48,0x1F40},{0x1F49,0x1F41}, /* 1F40 */
+ {0x1F4A,0x1F42},{0x1F4B,0x1F43}, /* 1F42 */
+ {0x1F4C,0x1F44},{0x1F4D,0x1F45}, /* 1F44 */
+ {0x1F46,0x1F46},{0x1F47,0x1F47}, /* 1F46 */
+ {0x1F48,0x1F40},{0x1F49,0x1F41}, /* 1F48 */
+ {0x1F4A,0x1F42},{0x1F4B,0x1F43}, /* 1F4A */
+ {0x1F4C,0x1F44},{0x1F4D,0x1F45}, /* 1F4C */
+ {0x1F4E,0x1F4E},{0x1F4F,0x1F4F}, /* 1F4E */
+ {0x1F50,0x1F50},{0x1F59,0x1F51}, /* 1F50 */
+ {0x1F52,0x1F52},{0x1F5B,0x1F53}, /* 1F52 */
+ {0x1F54,0x1F54},{0x1F5D,0x1F55}, /* 1F54 */
+ {0x1F56,0x1F56},{0x1F5F,0x1F57}, /* 1F56 */
+ {0x1F58,0x1F58},{0x1F59,0x1F51}, /* 1F58 */
+ {0x1F5A,0x1F5A},{0x1F5B,0x1F53}, /* 1F5A */
+ {0x1F5C,0x1F5C},{0x1F5D,0x1F55}, /* 1F5C */
+ {0x1F5E,0x1F5E},{0x1F5F,0x1F57}, /* 1F5E */
+ {0x1F68,0x1F60},{0x1F69,0x1F61}, /* 1F60 */
+ {0x1F6A,0x1F62},{0x1F6B,0x1F63}, /* 1F62 */
+ {0x1F6C,0x1F64},{0x1F6D,0x1F65}, /* 1F64 */
+ {0x1F6E,0x1F66},{0x1F6F,0x1F67}, /* 1F66 */
+ {0x1F68,0x1F60},{0x1F69,0x1F61}, /* 1F68 */
+ {0x1F6A,0x1F62},{0x1F6B,0x1F63}, /* 1F6A */
+ {0x1F6C,0x1F64},{0x1F6D,0x1F65}, /* 1F6C */
+ {0x1F6E,0x1F66},{0x1F6F,0x1F67}, /* 1F6E */
+ {0x1FBA,0x1F70},{0x1FBB,0x1F71}, /* 1F70 */
+ {0x1FC8,0x1F72},{0x1FC9,0x1F73}, /* 1F72 */
+ {0x1FCA,0x1F74},{0x1FCB,0x1F75}, /* 1F74 */
+ {0x1FDA,0x1F76},{0x1FDB,0x1F77}, /* 1F76 */
+ {0x1FF8,0x1F78},{0x1FF9,0x1F79}, /* 1F78 */
+ {0x1FEA,0x1F7A},{0x1FEB,0x1F7B}, /* 1F7A */
+ {0x1FFA,0x1F7C},{0x1FFB,0x1F7D}, /* 1F7C */
+ {0x1F7E,0x1F7E},{0x1F7F,0x1F7F}, /* 1F7E */
+ {0x1F88,0x1F80},{0x1F89,0x1F81}, /* 1F80 */
+ {0x1F8A,0x1F82},{0x1F8B,0x1F83}, /* 1F82 */
+ {0x1F8C,0x1F84},{0x1F8D,0x1F85}, /* 1F84 */
+ {0x1F8E,0x1F86},{0x1F8F,0x1F87}, /* 1F86 */
+ {0x1F88,0x1F80},{0x1F89,0x1F81}, /* 1F88 */
+ {0x1F8A,0x1F82},{0x1F8B,0x1F83}, /* 1F8A */
+ {0x1F8C,0x1F84},{0x1F8D,0x1F85}, /* 1F8C */
+ {0x1F8E,0x1F86},{0x1F8F,0x1F87}, /* 1F8E */
+ {0x1F98,0x1F90},{0x1F99,0x1F91}, /* 1F90 */
+ {0x1F9A,0x1F92},{0x1F9B,0x1F93}, /* 1F92 */
+ {0x1F9C,0x1F94},{0x1F9D,0x1F95}, /* 1F94 */
+ {0x1F9E,0x1F96},{0x1F9F,0x1F97}, /* 1F96 */
+ {0x1F98,0x1F90},{0x1F99,0x1F91}, /* 1F98 */
+ {0x1F9A,0x1F92},{0x1F9B,0x1F93}, /* 1F9A */
+ {0x1F9C,0x1F94},{0x1F9D,0x1F95}, /* 1F9C */
+ {0x1F9E,0x1F96},{0x1F9F,0x1F97}, /* 1F9E */
+ {0x1FA8,0x1FA0},{0x1FA9,0x1FA1}, /* 1FA0 */
+ {0x1FAA,0x1FA2},{0x1FAB,0x1FA3}, /* 1FA2 */
+ {0x1FAC,0x1FA4},{0x1FAD,0x1FA5}, /* 1FA4 */
+ {0x1FAE,0x1FA6},{0x1FAF,0x1FA7}, /* 1FA6 */
+ {0x1FA8,0x1FA0},{0x1FA9,0x1FA1}, /* 1FA8 */
+ {0x1FAA,0x1FA2},{0x1FAB,0x1FA3}, /* 1FAA */
+ {0x1FAC,0x1FA4},{0x1FAD,0x1FA5}, /* 1FAC */
+ {0x1FAE,0x1FA6},{0x1FAF,0x1FA7}, /* 1FAE */
+ {0x1FB8,0x1FB0},{0x1FB9,0x1FB1}, /* 1FB0 */
+ {0x1FB2,0x1FB2},{0x1FBC,0x1FB3}, /* 1FB2 */
+ {0x1FB4,0x1FB4},{0x1FB5,0x1FB5}, /* 1FB4 */
+ {0x1FB6,0x1FB6},{0x1FB7,0x1FB7}, /* 1FB6 */
+ {0x1FB8,0x1FB0},{0x1FB9,0x1FB1}, /* 1FB8 */
+ {0x1FBA,0x1F70},{0x1FBB,0x1F71}, /* 1FBA */
+ {0x1FBC,0x1FB3},{0x1FBD,0x1FBD}, /* 1FBC */
+ {0x0399,0x1FBE},{0x1FBF,0x1FBF}, /* 1FBE */
+ {0x1FC0,0x1FC0},{0x1FC1,0x1FC1}, /* 1FC0 */
+ {0x1FC2,0x1FC2},{0x1FCC,0x1FC3}, /* 1FC2 */
+ {0x1FC4,0x1FC4},{0x1FC5,0x1FC5}, /* 1FC4 */
+ {0x1FC6,0x1FC6},{0x1FC7,0x1FC7}, /* 1FC6 */
+ {0x1FC8,0x1F72},{0x1FC9,0x1F73}, /* 1FC8 */
+ {0x1FCA,0x1F74},{0x1FCB,0x1F75}, /* 1FCA */
+ {0x1FCC,0x1FC3},{0x1FCD,0x1FCD}, /* 1FCC */
+ {0x1FCE,0x1FCE},{0x1FCF,0x1FCF}, /* 1FCE */
+ {0x1FD8,0x1FD0},{0x1FD9,0x1FD1}, /* 1FD0 */
+ {0x1FD2,0x1FD2},{0x1FD3,0x1FD3}, /* 1FD2 */
+ {0x1FD4,0x1FD4},{0x1FD5,0x1FD5}, /* 1FD4 */
+ {0x1FD6,0x1FD6},{0x1FD7,0x1FD7}, /* 1FD6 */
+ {0x1FD8,0x1FD0},{0x1FD9,0x1FD1}, /* 1FD8 */
+ {0x1FDA,0x1F76},{0x1FDB,0x1F77}, /* 1FDA */
+ {0x1FDC,0x1FDC},{0x1FDD,0x1FDD}, /* 1FDC */
+ {0x1FDE,0x1FDE},{0x1FDF,0x1FDF}, /* 1FDE */
+ {0x1FE8,0x1FE0},{0x1FE9,0x1FE1}, /* 1FE0 */
+ {0x1FE2,0x1FE2},{0x1FE3,0x1FE3}, /* 1FE2 */
+ {0x1FE4,0x1FE4},{0x1FEC,0x1FE5}, /* 1FE4 */
+ {0x1FE6,0x1FE6},{0x1FE7,0x1FE7}, /* 1FE6 */
+ {0x1FE8,0x1FE0},{0x1FE9,0x1FE1}, /* 1FE8 */
+ {0x1FEA,0x1F7A},{0x1FEB,0x1F7B}, /* 1FEA */
+ {0x1FEC,0x1FE5},{0x1FED,0x1FED}, /* 1FEC */
+ {0x1FEE,0x1FEE},{0x1FEF,0x1FEF}, /* 1FEE */
+ {0x1FF0,0x1FF0},{0x1FF1,0x1FF1}, /* 1FF0 */
+ {0x1FF2,0x1FF2},{0x1FFC,0x1FF3}, /* 1FF2 */
+ {0x1FF4,0x1FF4},{0x1FF5,0x1FF5}, /* 1FF4 */
+ {0x1FF6,0x1FF6},{0x1FF7,0x1FF7}, /* 1FF6 */
+ {0x1FF8,0x1F78},{0x1FF9,0x1F79}, /* 1FF8 */
+ {0x1FFA,0x1F7C},{0x1FFB,0x1F7D}, /* 1FFA */
+ {0x1FFC,0x1FF3},{0x1FFD,0x1FFD}, /* 1FFC */
+ {0x1FFE,0x1FFE},{0x1FFF,0x1FFF} /* 1FFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page21[256]={
+ {0x2100,0x2100},{0x2101,0x2101}, /* 2100 */
+ {0x2102,0x2102},{0x2103,0x2103}, /* 2102 */
+ {0x2104,0x2104},{0x2105,0x2105}, /* 2104 */
+ {0x2106,0x2106},{0x2107,0x2107}, /* 2106 */
+ {0x2108,0x2108},{0x2109,0x2109}, /* 2108 */
+ {0x210A,0x210A},{0x210B,0x210B}, /* 210A */
+ {0x210C,0x210C},{0x210D,0x210D}, /* 210C */
+ {0x210E,0x210E},{0x210F,0x210F}, /* 210E */
+ {0x2110,0x2110},{0x2111,0x2111}, /* 2110 */
+ {0x2112,0x2112},{0x2113,0x2113}, /* 2112 */
+ {0x2114,0x2114},{0x2115,0x2115}, /* 2114 */
+ {0x2116,0x2116},{0x2117,0x2117}, /* 2116 */
+ {0x2118,0x2118},{0x2119,0x2119}, /* 2118 */
+ {0x211A,0x211A},{0x211B,0x211B}, /* 211A */
+ {0x211C,0x211C},{0x211D,0x211D}, /* 211C */
+ {0x211E,0x211E},{0x211F,0x211F}, /* 211E */
+ {0x2120,0x2120},{0x2121,0x2121}, /* 2120 */
+ {0x2122,0x2122},{0x2123,0x2123}, /* 2122 */
+ {0x2124,0x2124},{0x2125,0x2125}, /* 2124 */
+ {0x2126,0x03C9},{0x2127,0x2127}, /* 2126 */
+ {0x2128,0x2128},{0x2129,0x2129}, /* 2128 */
+ {0x212A,0x006B},{0x212B,0x00E5}, /* 212A */
+ {0x212C,0x212C},{0x212D,0x212D}, /* 212C */
+ {0x212E,0x212E},{0x212F,0x212F}, /* 212E */
+ {0x2130,0x2130},{0x2131,0x2131}, /* 2130 */
+ {0x2132,0x214E},{0x2133,0x2133}, /* 2132 */
+ {0x2134,0x2134},{0x2135,0x2135}, /* 2134 */
+ {0x2136,0x2136},{0x2137,0x2137}, /* 2136 */
+ {0x2138,0x2138},{0x2139,0x2139}, /* 2138 */
+ {0x213A,0x213A},{0x213B,0x213B}, /* 213A */
+ {0x213C,0x213C},{0x213D,0x213D}, /* 213C */
+ {0x213E,0x213E},{0x213F,0x213F}, /* 213E */
+ {0x2140,0x2140},{0x2141,0x2141}, /* 2140 */
+ {0x2142,0x2142},{0x2143,0x2143}, /* 2142 */
+ {0x2144,0x2144},{0x2145,0x2145}, /* 2144 */
+ {0x2146,0x2146},{0x2147,0x2147}, /* 2146 */
+ {0x2148,0x2148},{0x2149,0x2149}, /* 2148 */
+ {0x214A,0x214A},{0x214B,0x214B}, /* 214A */
+ {0x214C,0x214C},{0x214D,0x214D}, /* 214C */
+ {0x2132,0x214E},{0x214F,0x214F}, /* 214E */
+ {0x2150,0x2150},{0x2151,0x2151}, /* 2150 */
+ {0x2152,0x2152},{0x2153,0x2153}, /* 2152 */
+ {0x2154,0x2154},{0x2155,0x2155}, /* 2154 */
+ {0x2156,0x2156},{0x2157,0x2157}, /* 2156 */
+ {0x2158,0x2158},{0x2159,0x2159}, /* 2158 */
+ {0x215A,0x215A},{0x215B,0x215B}, /* 215A */
+ {0x215C,0x215C},{0x215D,0x215D}, /* 215C */
+ {0x215E,0x215E},{0x215F,0x215F}, /* 215E */
+ {0x2160,0x2170},{0x2161,0x2171}, /* 2160 */
+ {0x2162,0x2172},{0x2163,0x2173}, /* 2162 */
+ {0x2164,0x2174},{0x2165,0x2175}, /* 2164 */
+ {0x2166,0x2176},{0x2167,0x2177}, /* 2166 */
+ {0x2168,0x2178},{0x2169,0x2179}, /* 2168 */
+ {0x216A,0x217A},{0x216B,0x217B}, /* 216A */
+ {0x216C,0x217C},{0x216D,0x217D}, /* 216C */
+ {0x216E,0x217E},{0x216F,0x217F}, /* 216E */
+ {0x2160,0x2170},{0x2161,0x2171}, /* 2170 */
+ {0x2162,0x2172},{0x2163,0x2173}, /* 2172 */
+ {0x2164,0x2174},{0x2165,0x2175}, /* 2174 */
+ {0x2166,0x2176},{0x2167,0x2177}, /* 2176 */
+ {0x2168,0x2178},{0x2169,0x2179}, /* 2178 */
+ {0x216A,0x217A},{0x216B,0x217B}, /* 217A */
+ {0x216C,0x217C},{0x216D,0x217D}, /* 217C */
+ {0x216E,0x217E},{0x216F,0x217F}, /* 217E */
+ {0x2180,0x2180},{0x2181,0x2181}, /* 2180 */
+ {0x2182,0x2182},{0x2183,0x2184}, /* 2182 */
+ {0x2183,0x2184},{0x2185,0x2185}, /* 2184 */
+ {0x2186,0x2186},{0x2187,0x2187}, /* 2186 */
+ {0x2188,0x2188},{0x2189,0x2189}, /* 2188 */
+ {0x218A,0x218A},{0x218B,0x218B}, /* 218A */
+ {0x218C,0x218C},{0x218D,0x218D}, /* 218C */
+ {0x218E,0x218E},{0x218F,0x218F}, /* 218E */
+ {0x2190,0x2190},{0x2191,0x2191}, /* 2190 */
+ {0x2192,0x2192},{0x2193,0x2193}, /* 2192 */
+ {0x2194,0x2194},{0x2195,0x2195}, /* 2194 */
+ {0x2196,0x2196},{0x2197,0x2197}, /* 2196 */
+ {0x2198,0x2198},{0x2199,0x2199}, /* 2198 */
+ {0x219A,0x219A},{0x219B,0x219B}, /* 219A */
+ {0x219C,0x219C},{0x219D,0x219D}, /* 219C */
+ {0x219E,0x219E},{0x219F,0x219F}, /* 219E */
+ {0x21A0,0x21A0},{0x21A1,0x21A1}, /* 21A0 */
+ {0x21A2,0x21A2},{0x21A3,0x21A3}, /* 21A2 */
+ {0x21A4,0x21A4},{0x21A5,0x21A5}, /* 21A4 */
+ {0x21A6,0x21A6},{0x21A7,0x21A7}, /* 21A6 */
+ {0x21A8,0x21A8},{0x21A9,0x21A9}, /* 21A8 */
+ {0x21AA,0x21AA},{0x21AB,0x21AB}, /* 21AA */
+ {0x21AC,0x21AC},{0x21AD,0x21AD}, /* 21AC */
+ {0x21AE,0x21AE},{0x21AF,0x21AF}, /* 21AE */
+ {0x21B0,0x21B0},{0x21B1,0x21B1}, /* 21B0 */
+ {0x21B2,0x21B2},{0x21B3,0x21B3}, /* 21B2 */
+ {0x21B4,0x21B4},{0x21B5,0x21B5}, /* 21B4 */
+ {0x21B6,0x21B6},{0x21B7,0x21B7}, /* 21B6 */
+ {0x21B8,0x21B8},{0x21B9,0x21B9}, /* 21B8 */
+ {0x21BA,0x21BA},{0x21BB,0x21BB}, /* 21BA */
+ {0x21BC,0x21BC},{0x21BD,0x21BD}, /* 21BC */
+ {0x21BE,0x21BE},{0x21BF,0x21BF}, /* 21BE */
+ {0x21C0,0x21C0},{0x21C1,0x21C1}, /* 21C0 */
+ {0x21C2,0x21C2},{0x21C3,0x21C3}, /* 21C2 */
+ {0x21C4,0x21C4},{0x21C5,0x21C5}, /* 21C4 */
+ {0x21C6,0x21C6},{0x21C7,0x21C7}, /* 21C6 */
+ {0x21C8,0x21C8},{0x21C9,0x21C9}, /* 21C8 */
+ {0x21CA,0x21CA},{0x21CB,0x21CB}, /* 21CA */
+ {0x21CC,0x21CC},{0x21CD,0x21CD}, /* 21CC */
+ {0x21CE,0x21CE},{0x21CF,0x21CF}, /* 21CE */
+ {0x21D0,0x21D0},{0x21D1,0x21D1}, /* 21D0 */
+ {0x21D2,0x21D2},{0x21D3,0x21D3}, /* 21D2 */
+ {0x21D4,0x21D4},{0x21D5,0x21D5}, /* 21D4 */
+ {0x21D6,0x21D6},{0x21D7,0x21D7}, /* 21D6 */
+ {0x21D8,0x21D8},{0x21D9,0x21D9}, /* 21D8 */
+ {0x21DA,0x21DA},{0x21DB,0x21DB}, /* 21DA */
+ {0x21DC,0x21DC},{0x21DD,0x21DD}, /* 21DC */
+ {0x21DE,0x21DE},{0x21DF,0x21DF}, /* 21DE */
+ {0x21E0,0x21E0},{0x21E1,0x21E1}, /* 21E0 */
+ {0x21E2,0x21E2},{0x21E3,0x21E3}, /* 21E2 */
+ {0x21E4,0x21E4},{0x21E5,0x21E5}, /* 21E4 */
+ {0x21E6,0x21E6},{0x21E7,0x21E7}, /* 21E6 */
+ {0x21E8,0x21E8},{0x21E9,0x21E9}, /* 21E8 */
+ {0x21EA,0x21EA},{0x21EB,0x21EB}, /* 21EA */
+ {0x21EC,0x21EC},{0x21ED,0x21ED}, /* 21EC */
+ {0x21EE,0x21EE},{0x21EF,0x21EF}, /* 21EE */
+ {0x21F0,0x21F0},{0x21F1,0x21F1}, /* 21F0 */
+ {0x21F2,0x21F2},{0x21F3,0x21F3}, /* 21F2 */
+ {0x21F4,0x21F4},{0x21F5,0x21F5}, /* 21F4 */
+ {0x21F6,0x21F6},{0x21F7,0x21F7}, /* 21F6 */
+ {0x21F8,0x21F8},{0x21F9,0x21F9}, /* 21F8 */
+ {0x21FA,0x21FA},{0x21FB,0x21FB}, /* 21FA */
+ {0x21FC,0x21FC},{0x21FD,0x21FD}, /* 21FC */
+ {0x21FE,0x21FE},{0x21FF,0x21FF} /* 21FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page24[256]={
+ {0x2400,0x2400},{0x2401,0x2401}, /* 2400 */
+ {0x2402,0x2402},{0x2403,0x2403}, /* 2402 */
+ {0x2404,0x2404},{0x2405,0x2405}, /* 2404 */
+ {0x2406,0x2406},{0x2407,0x2407}, /* 2406 */
+ {0x2408,0x2408},{0x2409,0x2409}, /* 2408 */
+ {0x240A,0x240A},{0x240B,0x240B}, /* 240A */
+ {0x240C,0x240C},{0x240D,0x240D}, /* 240C */
+ {0x240E,0x240E},{0x240F,0x240F}, /* 240E */
+ {0x2410,0x2410},{0x2411,0x2411}, /* 2410 */
+ {0x2412,0x2412},{0x2413,0x2413}, /* 2412 */
+ {0x2414,0x2414},{0x2415,0x2415}, /* 2414 */
+ {0x2416,0x2416},{0x2417,0x2417}, /* 2416 */
+ {0x2418,0x2418},{0x2419,0x2419}, /* 2418 */
+ {0x241A,0x241A},{0x241B,0x241B}, /* 241A */
+ {0x241C,0x241C},{0x241D,0x241D}, /* 241C */
+ {0x241E,0x241E},{0x241F,0x241F}, /* 241E */
+ {0x2420,0x2420},{0x2421,0x2421}, /* 2420 */
+ {0x2422,0x2422},{0x2423,0x2423}, /* 2422 */
+ {0x2424,0x2424},{0x2425,0x2425}, /* 2424 */
+ {0x2426,0x2426},{0x2427,0x2427}, /* 2426 */
+ {0x2428,0x2428},{0x2429,0x2429}, /* 2428 */
+ {0x242A,0x242A},{0x242B,0x242B}, /* 242A */
+ {0x242C,0x242C},{0x242D,0x242D}, /* 242C */
+ {0x242E,0x242E},{0x242F,0x242F}, /* 242E */
+ {0x2430,0x2430},{0x2431,0x2431}, /* 2430 */
+ {0x2432,0x2432},{0x2433,0x2433}, /* 2432 */
+ {0x2434,0x2434},{0x2435,0x2435}, /* 2434 */
+ {0x2436,0x2436},{0x2437,0x2437}, /* 2436 */
+ {0x2438,0x2438},{0x2439,0x2439}, /* 2438 */
+ {0x243A,0x243A},{0x243B,0x243B}, /* 243A */
+ {0x243C,0x243C},{0x243D,0x243D}, /* 243C */
+ {0x243E,0x243E},{0x243F,0x243F}, /* 243E */
+ {0x2440,0x2440},{0x2441,0x2441}, /* 2440 */
+ {0x2442,0x2442},{0x2443,0x2443}, /* 2442 */
+ {0x2444,0x2444},{0x2445,0x2445}, /* 2444 */
+ {0x2446,0x2446},{0x2447,0x2447}, /* 2446 */
+ {0x2448,0x2448},{0x2449,0x2449}, /* 2448 */
+ {0x244A,0x244A},{0x244B,0x244B}, /* 244A */
+ {0x244C,0x244C},{0x244D,0x244D}, /* 244C */
+ {0x244E,0x244E},{0x244F,0x244F}, /* 244E */
+ {0x2450,0x2450},{0x2451,0x2451}, /* 2450 */
+ {0x2452,0x2452},{0x2453,0x2453}, /* 2452 */
+ {0x2454,0x2454},{0x2455,0x2455}, /* 2454 */
+ {0x2456,0x2456},{0x2457,0x2457}, /* 2456 */
+ {0x2458,0x2458},{0x2459,0x2459}, /* 2458 */
+ {0x245A,0x245A},{0x245B,0x245B}, /* 245A */
+ {0x245C,0x245C},{0x245D,0x245D}, /* 245C */
+ {0x245E,0x245E},{0x245F,0x245F}, /* 245E */
+ {0x2460,0x2460},{0x2461,0x2461}, /* 2460 */
+ {0x2462,0x2462},{0x2463,0x2463}, /* 2462 */
+ {0x2464,0x2464},{0x2465,0x2465}, /* 2464 */
+ {0x2466,0x2466},{0x2467,0x2467}, /* 2466 */
+ {0x2468,0x2468},{0x2469,0x2469}, /* 2468 */
+ {0x246A,0x246A},{0x246B,0x246B}, /* 246A */
+ {0x246C,0x246C},{0x246D,0x246D}, /* 246C */
+ {0x246E,0x246E},{0x246F,0x246F}, /* 246E */
+ {0x2470,0x2470},{0x2471,0x2471}, /* 2470 */
+ {0x2472,0x2472},{0x2473,0x2473}, /* 2472 */
+ {0x2474,0x2474},{0x2475,0x2475}, /* 2474 */
+ {0x2476,0x2476},{0x2477,0x2477}, /* 2476 */
+ {0x2478,0x2478},{0x2479,0x2479}, /* 2478 */
+ {0x247A,0x247A},{0x247B,0x247B}, /* 247A */
+ {0x247C,0x247C},{0x247D,0x247D}, /* 247C */
+ {0x247E,0x247E},{0x247F,0x247F}, /* 247E */
+ {0x2480,0x2480},{0x2481,0x2481}, /* 2480 */
+ {0x2482,0x2482},{0x2483,0x2483}, /* 2482 */
+ {0x2484,0x2484},{0x2485,0x2485}, /* 2484 */
+ {0x2486,0x2486},{0x2487,0x2487}, /* 2486 */
+ {0x2488,0x2488},{0x2489,0x2489}, /* 2488 */
+ {0x248A,0x248A},{0x248B,0x248B}, /* 248A */
+ {0x248C,0x248C},{0x248D,0x248D}, /* 248C */
+ {0x248E,0x248E},{0x248F,0x248F}, /* 248E */
+ {0x2490,0x2490},{0x2491,0x2491}, /* 2490 */
+ {0x2492,0x2492},{0x2493,0x2493}, /* 2492 */
+ {0x2494,0x2494},{0x2495,0x2495}, /* 2494 */
+ {0x2496,0x2496},{0x2497,0x2497}, /* 2496 */
+ {0x2498,0x2498},{0x2499,0x2499}, /* 2498 */
+ {0x249A,0x249A},{0x249B,0x249B}, /* 249A */
+ {0x249C,0x249C},{0x249D,0x249D}, /* 249C */
+ {0x249E,0x249E},{0x249F,0x249F}, /* 249E */
+ {0x24A0,0x24A0},{0x24A1,0x24A1}, /* 24A0 */
+ {0x24A2,0x24A2},{0x24A3,0x24A3}, /* 24A2 */
+ {0x24A4,0x24A4},{0x24A5,0x24A5}, /* 24A4 */
+ {0x24A6,0x24A6},{0x24A7,0x24A7}, /* 24A6 */
+ {0x24A8,0x24A8},{0x24A9,0x24A9}, /* 24A8 */
+ {0x24AA,0x24AA},{0x24AB,0x24AB}, /* 24AA */
+ {0x24AC,0x24AC},{0x24AD,0x24AD}, /* 24AC */
+ {0x24AE,0x24AE},{0x24AF,0x24AF}, /* 24AE */
+ {0x24B0,0x24B0},{0x24B1,0x24B1}, /* 24B0 */
+ {0x24B2,0x24B2},{0x24B3,0x24B3}, /* 24B2 */
+ {0x24B4,0x24B4},{0x24B5,0x24B5}, /* 24B4 */
+ {0x24B6,0x24D0},{0x24B7,0x24D1}, /* 24B6 */
+ {0x24B8,0x24D2},{0x24B9,0x24D3}, /* 24B8 */
+ {0x24BA,0x24D4},{0x24BB,0x24D5}, /* 24BA */
+ {0x24BC,0x24D6},{0x24BD,0x24D7}, /* 24BC */
+ {0x24BE,0x24D8},{0x24BF,0x24D9}, /* 24BE */
+ {0x24C0,0x24DA},{0x24C1,0x24DB}, /* 24C0 */
+ {0x24C2,0x24DC},{0x24C3,0x24DD}, /* 24C2 */
+ {0x24C4,0x24DE},{0x24C5,0x24DF}, /* 24C4 */
+ {0x24C6,0x24E0},{0x24C7,0x24E1}, /* 24C6 */
+ {0x24C8,0x24E2},{0x24C9,0x24E3}, /* 24C8 */
+ {0x24CA,0x24E4},{0x24CB,0x24E5}, /* 24CA */
+ {0x24CC,0x24E6},{0x24CD,0x24E7}, /* 24CC */
+ {0x24CE,0x24E8},{0x24CF,0x24E9}, /* 24CE */
+ {0x24B6,0x24D0},{0x24B7,0x24D1}, /* 24D0 */
+ {0x24B8,0x24D2},{0x24B9,0x24D3}, /* 24D2 */
+ {0x24BA,0x24D4},{0x24BB,0x24D5}, /* 24D4 */
+ {0x24BC,0x24D6},{0x24BD,0x24D7}, /* 24D6 */
+ {0x24BE,0x24D8},{0x24BF,0x24D9}, /* 24D8 */
+ {0x24C0,0x24DA},{0x24C1,0x24DB}, /* 24DA */
+ {0x24C2,0x24DC},{0x24C3,0x24DD}, /* 24DC */
+ {0x24C4,0x24DE},{0x24C5,0x24DF}, /* 24DE */
+ {0x24C6,0x24E0},{0x24C7,0x24E1}, /* 24E0 */
+ {0x24C8,0x24E2},{0x24C9,0x24E3}, /* 24E2 */
+ {0x24CA,0x24E4},{0x24CB,0x24E5}, /* 24E4 */
+ {0x24CC,0x24E6},{0x24CD,0x24E7}, /* 24E6 */
+ {0x24CE,0x24E8},{0x24CF,0x24E9}, /* 24E8 */
+ {0x24EA,0x24EA},{0x24EB,0x24EB}, /* 24EA */
+ {0x24EC,0x24EC},{0x24ED,0x24ED}, /* 24EC */
+ {0x24EE,0x24EE},{0x24EF,0x24EF}, /* 24EE */
+ {0x24F0,0x24F0},{0x24F1,0x24F1}, /* 24F0 */
+ {0x24F2,0x24F2},{0x24F3,0x24F3}, /* 24F2 */
+ {0x24F4,0x24F4},{0x24F5,0x24F5}, /* 24F4 */
+ {0x24F6,0x24F6},{0x24F7,0x24F7}, /* 24F6 */
+ {0x24F8,0x24F8},{0x24F9,0x24F9}, /* 24F8 */
+ {0x24FA,0x24FA},{0x24FB,0x24FB}, /* 24FA */
+ {0x24FC,0x24FC},{0x24FD,0x24FD}, /* 24FC */
+ {0x24FE,0x24FE},{0x24FF,0x24FF} /* 24FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page2C[256]={
+ {0x2C00,0x2C30},{0x2C01,0x2C31}, /* 2C00 */
+ {0x2C02,0x2C32},{0x2C03,0x2C33}, /* 2C02 */
+ {0x2C04,0x2C34},{0x2C05,0x2C35}, /* 2C04 */
+ {0x2C06,0x2C36},{0x2C07,0x2C37}, /* 2C06 */
+ {0x2C08,0x2C38},{0x2C09,0x2C39}, /* 2C08 */
+ {0x2C0A,0x2C3A},{0x2C0B,0x2C3B}, /* 2C0A */
+ {0x2C0C,0x2C3C},{0x2C0D,0x2C3D}, /* 2C0C */
+ {0x2C0E,0x2C3E},{0x2C0F,0x2C3F}, /* 2C0E */
+ {0x2C10,0x2C40},{0x2C11,0x2C41}, /* 2C10 */
+ {0x2C12,0x2C42},{0x2C13,0x2C43}, /* 2C12 */
+ {0x2C14,0x2C44},{0x2C15,0x2C45}, /* 2C14 */
+ {0x2C16,0x2C46},{0x2C17,0x2C47}, /* 2C16 */
+ {0x2C18,0x2C48},{0x2C19,0x2C49}, /* 2C18 */
+ {0x2C1A,0x2C4A},{0x2C1B,0x2C4B}, /* 2C1A */
+ {0x2C1C,0x2C4C},{0x2C1D,0x2C4D}, /* 2C1C */
+ {0x2C1E,0x2C4E},{0x2C1F,0x2C4F}, /* 2C1E */
+ {0x2C20,0x2C50},{0x2C21,0x2C51}, /* 2C20 */
+ {0x2C22,0x2C52},{0x2C23,0x2C53}, /* 2C22 */
+ {0x2C24,0x2C54},{0x2C25,0x2C55}, /* 2C24 */
+ {0x2C26,0x2C56},{0x2C27,0x2C57}, /* 2C26 */
+ {0x2C28,0x2C58},{0x2C29,0x2C59}, /* 2C28 */
+ {0x2C2A,0x2C5A},{0x2C2B,0x2C5B}, /* 2C2A */
+ {0x2C2C,0x2C5C},{0x2C2D,0x2C5D}, /* 2C2C */
+ {0x2C2E,0x2C5E},{0x2C2F,0x2C5F}, /* 2C2E */
+ {0x2C00,0x2C30},{0x2C01,0x2C31}, /* 2C30 */
+ {0x2C02,0x2C32},{0x2C03,0x2C33}, /* 2C32 */
+ {0x2C04,0x2C34},{0x2C05,0x2C35}, /* 2C34 */
+ {0x2C06,0x2C36},{0x2C07,0x2C37}, /* 2C36 */
+ {0x2C08,0x2C38},{0x2C09,0x2C39}, /* 2C38 */
+ {0x2C0A,0x2C3A},{0x2C0B,0x2C3B}, /* 2C3A */
+ {0x2C0C,0x2C3C},{0x2C0D,0x2C3D}, /* 2C3C */
+ {0x2C0E,0x2C3E},{0x2C0F,0x2C3F}, /* 2C3E */
+ {0x2C10,0x2C40},{0x2C11,0x2C41}, /* 2C40 */
+ {0x2C12,0x2C42},{0x2C13,0x2C43}, /* 2C42 */
+ {0x2C14,0x2C44},{0x2C15,0x2C45}, /* 2C44 */
+ {0x2C16,0x2C46},{0x2C17,0x2C47}, /* 2C46 */
+ {0x2C18,0x2C48},{0x2C19,0x2C49}, /* 2C48 */
+ {0x2C1A,0x2C4A},{0x2C1B,0x2C4B}, /* 2C4A */
+ {0x2C1C,0x2C4C},{0x2C1D,0x2C4D}, /* 2C4C */
+ {0x2C1E,0x2C4E},{0x2C1F,0x2C4F}, /* 2C4E */
+ {0x2C20,0x2C50},{0x2C21,0x2C51}, /* 2C50 */
+ {0x2C22,0x2C52},{0x2C23,0x2C53}, /* 2C52 */
+ {0x2C24,0x2C54},{0x2C25,0x2C55}, /* 2C54 */
+ {0x2C26,0x2C56},{0x2C27,0x2C57}, /* 2C56 */
+ {0x2C28,0x2C58},{0x2C29,0x2C59}, /* 2C58 */
+ {0x2C2A,0x2C5A},{0x2C2B,0x2C5B}, /* 2C5A */
+ {0x2C2C,0x2C5C},{0x2C2D,0x2C5D}, /* 2C5C */
+ {0x2C2E,0x2C5E},{0x2C2F,0x2C5F}, /* 2C5E */
+ {0x2C60,0x2C61},{0x2C60,0x2C61}, /* 2C60 */
+ {0x2C62,0x026B},{0x2C63,0x1D7D}, /* 2C62 */
+ {0x2C64,0x027D},{0x023A,0x2C65}, /* 2C64 */
+ {0x023E,0x2C66},{0x2C67,0x2C68}, /* 2C66 */
+ {0x2C67,0x2C68},{0x2C69,0x2C6A}, /* 2C68 */
+ {0x2C69,0x2C6A},{0x2C6B,0x2C6C}, /* 2C6A */
+ {0x2C6B,0x2C6C},{0x2C6D,0x0251}, /* 2C6C */
+ {0x2C6E,0x0271},{0x2C6F,0x0250}, /* 2C6E */
+ {0x2C70,0x0252},{0x2C71,0x2C71}, /* 2C70 */
+ {0x2C72,0x2C73},{0x2C72,0x2C73}, /* 2C72 */
+ {0x2C74,0x2C74},{0x2C75,0x2C76}, /* 2C74 */
+ {0x2C75,0x2C76},{0x2C77,0x2C77}, /* 2C76 */
+ {0x2C78,0x2C78},{0x2C79,0x2C79}, /* 2C78 */
+ {0x2C7A,0x2C7A},{0x2C7B,0x2C7B}, /* 2C7A */
+ {0x2C7C,0x2C7C},{0x2C7D,0x2C7D}, /* 2C7C */
+ {0x2C7E,0x023F},{0x2C7F,0x0240}, /* 2C7E */
+ {0x2C80,0x2C81},{0x2C80,0x2C81}, /* 2C80 */
+ {0x2C82,0x2C83},{0x2C82,0x2C83}, /* 2C82 */
+ {0x2C84,0x2C85},{0x2C84,0x2C85}, /* 2C84 */
+ {0x2C86,0x2C87},{0x2C86,0x2C87}, /* 2C86 */
+ {0x2C88,0x2C89},{0x2C88,0x2C89}, /* 2C88 */
+ {0x2C8A,0x2C8B},{0x2C8A,0x2C8B}, /* 2C8A */
+ {0x2C8C,0x2C8D},{0x2C8C,0x2C8D}, /* 2C8C */
+ {0x2C8E,0x2C8F},{0x2C8E,0x2C8F}, /* 2C8E */
+ {0x2C90,0x2C91},{0x2C90,0x2C91}, /* 2C90 */
+ {0x2C92,0x2C93},{0x2C92,0x2C93}, /* 2C92 */
+ {0x2C94,0x2C95},{0x2C94,0x2C95}, /* 2C94 */
+ {0x2C96,0x2C97},{0x2C96,0x2C97}, /* 2C96 */
+ {0x2C98,0x2C99},{0x2C98,0x2C99}, /* 2C98 */
+ {0x2C9A,0x2C9B},{0x2C9A,0x2C9B}, /* 2C9A */
+ {0x2C9C,0x2C9D},{0x2C9C,0x2C9D}, /* 2C9C */
+ {0x2C9E,0x2C9F},{0x2C9E,0x2C9F}, /* 2C9E */
+ {0x2CA0,0x2CA1},{0x2CA0,0x2CA1}, /* 2CA0 */
+ {0x2CA2,0x2CA3},{0x2CA2,0x2CA3}, /* 2CA2 */
+ {0x2CA4,0x2CA5},{0x2CA4,0x2CA5}, /* 2CA4 */
+ {0x2CA6,0x2CA7},{0x2CA6,0x2CA7}, /* 2CA6 */
+ {0x2CA8,0x2CA9},{0x2CA8,0x2CA9}, /* 2CA8 */
+ {0x2CAA,0x2CAB},{0x2CAA,0x2CAB}, /* 2CAA */
+ {0x2CAC,0x2CAD},{0x2CAC,0x2CAD}, /* 2CAC */
+ {0x2CAE,0x2CAF},{0x2CAE,0x2CAF}, /* 2CAE */
+ {0x2CB0,0x2CB1},{0x2CB0,0x2CB1}, /* 2CB0 */
+ {0x2CB2,0x2CB3},{0x2CB2,0x2CB3}, /* 2CB2 */
+ {0x2CB4,0x2CB5},{0x2CB4,0x2CB5}, /* 2CB4 */
+ {0x2CB6,0x2CB7},{0x2CB6,0x2CB7}, /* 2CB6 */
+ {0x2CB8,0x2CB9},{0x2CB8,0x2CB9}, /* 2CB8 */
+ {0x2CBA,0x2CBB},{0x2CBA,0x2CBB}, /* 2CBA */
+ {0x2CBC,0x2CBD},{0x2CBC,0x2CBD}, /* 2CBC */
+ {0x2CBE,0x2CBF},{0x2CBE,0x2CBF}, /* 2CBE */
+ {0x2CC0,0x2CC1},{0x2CC0,0x2CC1}, /* 2CC0 */
+ {0x2CC2,0x2CC3},{0x2CC2,0x2CC3}, /* 2CC2 */
+ {0x2CC4,0x2CC5},{0x2CC4,0x2CC5}, /* 2CC4 */
+ {0x2CC6,0x2CC7},{0x2CC6,0x2CC7}, /* 2CC6 */
+ {0x2CC8,0x2CC9},{0x2CC8,0x2CC9}, /* 2CC8 */
+ {0x2CCA,0x2CCB},{0x2CCA,0x2CCB}, /* 2CCA */
+ {0x2CCC,0x2CCD},{0x2CCC,0x2CCD}, /* 2CCC */
+ {0x2CCE,0x2CCF},{0x2CCE,0x2CCF}, /* 2CCE */
+ {0x2CD0,0x2CD1},{0x2CD0,0x2CD1}, /* 2CD0 */
+ {0x2CD2,0x2CD3},{0x2CD2,0x2CD3}, /* 2CD2 */
+ {0x2CD4,0x2CD5},{0x2CD4,0x2CD5}, /* 2CD4 */
+ {0x2CD6,0x2CD7},{0x2CD6,0x2CD7}, /* 2CD6 */
+ {0x2CD8,0x2CD9},{0x2CD8,0x2CD9}, /* 2CD8 */
+ {0x2CDA,0x2CDB},{0x2CDA,0x2CDB}, /* 2CDA */
+ {0x2CDC,0x2CDD},{0x2CDC,0x2CDD}, /* 2CDC */
+ {0x2CDE,0x2CDF},{0x2CDE,0x2CDF}, /* 2CDE */
+ {0x2CE0,0x2CE1},{0x2CE0,0x2CE1}, /* 2CE0 */
+ {0x2CE2,0x2CE3},{0x2CE2,0x2CE3}, /* 2CE2 */
+ {0x2CE4,0x2CE4},{0x2CE5,0x2CE5}, /* 2CE4 */
+ {0x2CE6,0x2CE6},{0x2CE7,0x2CE7}, /* 2CE6 */
+ {0x2CE8,0x2CE8},{0x2CE9,0x2CE9}, /* 2CE8 */
+ {0x2CEA,0x2CEA},{0x2CEB,0x2CEC}, /* 2CEA */
+ {0x2CEB,0x2CEC},{0x2CED,0x2CEE}, /* 2CEC */
+ {0x2CED,0x2CEE},{0x2CEF,0x2CEF}, /* 2CEE */
+ {0x2CF0,0x2CF0},{0x2CF1,0x2CF1}, /* 2CF0 */
+ {0x2CF2,0x2CF3},{0x2CF2,0x2CF3}, /* 2CF2 */
+ {0x2CF4,0x2CF4},{0x2CF5,0x2CF5}, /* 2CF4 */
+ {0x2CF6,0x2CF6},{0x2CF7,0x2CF7}, /* 2CF6 */
+ {0x2CF8,0x2CF8},{0x2CF9,0x2CF9}, /* 2CF8 */
+ {0x2CFA,0x2CFA},{0x2CFB,0x2CFB}, /* 2CFA */
+ {0x2CFC,0x2CFC},{0x2CFD,0x2CFD}, /* 2CFC */
+ {0x2CFE,0x2CFE},{0x2CFF,0x2CFF} /* 2CFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page2D[256]={
+ {0x10A0,0x2D00},{0x10A1,0x2D01}, /* 2D00 */
+ {0x10A2,0x2D02},{0x10A3,0x2D03}, /* 2D02 */
+ {0x10A4,0x2D04},{0x10A5,0x2D05}, /* 2D04 */
+ {0x10A6,0x2D06},{0x10A7,0x2D07}, /* 2D06 */
+ {0x10A8,0x2D08},{0x10A9,0x2D09}, /* 2D08 */
+ {0x10AA,0x2D0A},{0x10AB,0x2D0B}, /* 2D0A */
+ {0x10AC,0x2D0C},{0x10AD,0x2D0D}, /* 2D0C */
+ {0x10AE,0x2D0E},{0x10AF,0x2D0F}, /* 2D0E */
+ {0x10B0,0x2D10},{0x10B1,0x2D11}, /* 2D10 */
+ {0x10B2,0x2D12},{0x10B3,0x2D13}, /* 2D12 */
+ {0x10B4,0x2D14},{0x10B5,0x2D15}, /* 2D14 */
+ {0x10B6,0x2D16},{0x10B7,0x2D17}, /* 2D16 */
+ {0x10B8,0x2D18},{0x10B9,0x2D19}, /* 2D18 */
+ {0x10BA,0x2D1A},{0x10BB,0x2D1B}, /* 2D1A */
+ {0x10BC,0x2D1C},{0x10BD,0x2D1D}, /* 2D1C */
+ {0x10BE,0x2D1E},{0x10BF,0x2D1F}, /* 2D1E */
+ {0x10C0,0x2D20},{0x10C1,0x2D21}, /* 2D20 */
+ {0x10C2,0x2D22},{0x10C3,0x2D23}, /* 2D22 */
+ {0x10C4,0x2D24},{0x10C5,0x2D25}, /* 2D24 */
+ {0x2D26,0x2D26},{0x10C7,0x2D27}, /* 2D26 */
+ {0x2D28,0x2D28},{0x2D29,0x2D29}, /* 2D28 */
+ {0x2D2A,0x2D2A},{0x2D2B,0x2D2B}, /* 2D2A */
+ {0x2D2C,0x2D2C},{0x10CD,0x2D2D}, /* 2D2C */
+ {0x2D2E,0x2D2E},{0x2D2F,0x2D2F}, /* 2D2E */
+ {0x2D30,0x2D30},{0x2D31,0x2D31}, /* 2D30 */
+ {0x2D32,0x2D32},{0x2D33,0x2D33}, /* 2D32 */
+ {0x2D34,0x2D34},{0x2D35,0x2D35}, /* 2D34 */
+ {0x2D36,0x2D36},{0x2D37,0x2D37}, /* 2D36 */
+ {0x2D38,0x2D38},{0x2D39,0x2D39}, /* 2D38 */
+ {0x2D3A,0x2D3A},{0x2D3B,0x2D3B}, /* 2D3A */
+ {0x2D3C,0x2D3C},{0x2D3D,0x2D3D}, /* 2D3C */
+ {0x2D3E,0x2D3E},{0x2D3F,0x2D3F}, /* 2D3E */
+ {0x2D40,0x2D40},{0x2D41,0x2D41}, /* 2D40 */
+ {0x2D42,0x2D42},{0x2D43,0x2D43}, /* 2D42 */
+ {0x2D44,0x2D44},{0x2D45,0x2D45}, /* 2D44 */
+ {0x2D46,0x2D46},{0x2D47,0x2D47}, /* 2D46 */
+ {0x2D48,0x2D48},{0x2D49,0x2D49}, /* 2D48 */
+ {0x2D4A,0x2D4A},{0x2D4B,0x2D4B}, /* 2D4A */
+ {0x2D4C,0x2D4C},{0x2D4D,0x2D4D}, /* 2D4C */
+ {0x2D4E,0x2D4E},{0x2D4F,0x2D4F}, /* 2D4E */
+ {0x2D50,0x2D50},{0x2D51,0x2D51}, /* 2D50 */
+ {0x2D52,0x2D52},{0x2D53,0x2D53}, /* 2D52 */
+ {0x2D54,0x2D54},{0x2D55,0x2D55}, /* 2D54 */
+ {0x2D56,0x2D56},{0x2D57,0x2D57}, /* 2D56 */
+ {0x2D58,0x2D58},{0x2D59,0x2D59}, /* 2D58 */
+ {0x2D5A,0x2D5A},{0x2D5B,0x2D5B}, /* 2D5A */
+ {0x2D5C,0x2D5C},{0x2D5D,0x2D5D}, /* 2D5C */
+ {0x2D5E,0x2D5E},{0x2D5F,0x2D5F}, /* 2D5E */
+ {0x2D60,0x2D60},{0x2D61,0x2D61}, /* 2D60 */
+ {0x2D62,0x2D62},{0x2D63,0x2D63}, /* 2D62 */
+ {0x2D64,0x2D64},{0x2D65,0x2D65}, /* 2D64 */
+ {0x2D66,0x2D66},{0x2D67,0x2D67}, /* 2D66 */
+ {0x2D68,0x2D68},{0x2D69,0x2D69}, /* 2D68 */
+ {0x2D6A,0x2D6A},{0x2D6B,0x2D6B}, /* 2D6A */
+ {0x2D6C,0x2D6C},{0x2D6D,0x2D6D}, /* 2D6C */
+ {0x2D6E,0x2D6E},{0x2D6F,0x2D6F}, /* 2D6E */
+ {0x2D70,0x2D70},{0x2D71,0x2D71}, /* 2D70 */
+ {0x2D72,0x2D72},{0x2D73,0x2D73}, /* 2D72 */
+ {0x2D74,0x2D74},{0x2D75,0x2D75}, /* 2D74 */
+ {0x2D76,0x2D76},{0x2D77,0x2D77}, /* 2D76 */
+ {0x2D78,0x2D78},{0x2D79,0x2D79}, /* 2D78 */
+ {0x2D7A,0x2D7A},{0x2D7B,0x2D7B}, /* 2D7A */
+ {0x2D7C,0x2D7C},{0x2D7D,0x2D7D}, /* 2D7C */
+ {0x2D7E,0x2D7E},{0x2D7F,0x2D7F}, /* 2D7E */
+ {0x2D80,0x2D80},{0x2D81,0x2D81}, /* 2D80 */
+ {0x2D82,0x2D82},{0x2D83,0x2D83}, /* 2D82 */
+ {0x2D84,0x2D84},{0x2D85,0x2D85}, /* 2D84 */
+ {0x2D86,0x2D86},{0x2D87,0x2D87}, /* 2D86 */
+ {0x2D88,0x2D88},{0x2D89,0x2D89}, /* 2D88 */
+ {0x2D8A,0x2D8A},{0x2D8B,0x2D8B}, /* 2D8A */
+ {0x2D8C,0x2D8C},{0x2D8D,0x2D8D}, /* 2D8C */
+ {0x2D8E,0x2D8E},{0x2D8F,0x2D8F}, /* 2D8E */
+ {0x2D90,0x2D90},{0x2D91,0x2D91}, /* 2D90 */
+ {0x2D92,0x2D92},{0x2D93,0x2D93}, /* 2D92 */
+ {0x2D94,0x2D94},{0x2D95,0x2D95}, /* 2D94 */
+ {0x2D96,0x2D96},{0x2D97,0x2D97}, /* 2D96 */
+ {0x2D98,0x2D98},{0x2D99,0x2D99}, /* 2D98 */
+ {0x2D9A,0x2D9A},{0x2D9B,0x2D9B}, /* 2D9A */
+ {0x2D9C,0x2D9C},{0x2D9D,0x2D9D}, /* 2D9C */
+ {0x2D9E,0x2D9E},{0x2D9F,0x2D9F}, /* 2D9E */
+ {0x2DA0,0x2DA0},{0x2DA1,0x2DA1}, /* 2DA0 */
+ {0x2DA2,0x2DA2},{0x2DA3,0x2DA3}, /* 2DA2 */
+ {0x2DA4,0x2DA4},{0x2DA5,0x2DA5}, /* 2DA4 */
+ {0x2DA6,0x2DA6},{0x2DA7,0x2DA7}, /* 2DA6 */
+ {0x2DA8,0x2DA8},{0x2DA9,0x2DA9}, /* 2DA8 */
+ {0x2DAA,0x2DAA},{0x2DAB,0x2DAB}, /* 2DAA */
+ {0x2DAC,0x2DAC},{0x2DAD,0x2DAD}, /* 2DAC */
+ {0x2DAE,0x2DAE},{0x2DAF,0x2DAF}, /* 2DAE */
+ {0x2DB0,0x2DB0},{0x2DB1,0x2DB1}, /* 2DB0 */
+ {0x2DB2,0x2DB2},{0x2DB3,0x2DB3}, /* 2DB2 */
+ {0x2DB4,0x2DB4},{0x2DB5,0x2DB5}, /* 2DB4 */
+ {0x2DB6,0x2DB6},{0x2DB7,0x2DB7}, /* 2DB6 */
+ {0x2DB8,0x2DB8},{0x2DB9,0x2DB9}, /* 2DB8 */
+ {0x2DBA,0x2DBA},{0x2DBB,0x2DBB}, /* 2DBA */
+ {0x2DBC,0x2DBC},{0x2DBD,0x2DBD}, /* 2DBC */
+ {0x2DBE,0x2DBE},{0x2DBF,0x2DBF}, /* 2DBE */
+ {0x2DC0,0x2DC0},{0x2DC1,0x2DC1}, /* 2DC0 */
+ {0x2DC2,0x2DC2},{0x2DC3,0x2DC3}, /* 2DC2 */
+ {0x2DC4,0x2DC4},{0x2DC5,0x2DC5}, /* 2DC4 */
+ {0x2DC6,0x2DC6},{0x2DC7,0x2DC7}, /* 2DC6 */
+ {0x2DC8,0x2DC8},{0x2DC9,0x2DC9}, /* 2DC8 */
+ {0x2DCA,0x2DCA},{0x2DCB,0x2DCB}, /* 2DCA */
+ {0x2DCC,0x2DCC},{0x2DCD,0x2DCD}, /* 2DCC */
+ {0x2DCE,0x2DCE},{0x2DCF,0x2DCF}, /* 2DCE */
+ {0x2DD0,0x2DD0},{0x2DD1,0x2DD1}, /* 2DD0 */
+ {0x2DD2,0x2DD2},{0x2DD3,0x2DD3}, /* 2DD2 */
+ {0x2DD4,0x2DD4},{0x2DD5,0x2DD5}, /* 2DD4 */
+ {0x2DD6,0x2DD6},{0x2DD7,0x2DD7}, /* 2DD6 */
+ {0x2DD8,0x2DD8},{0x2DD9,0x2DD9}, /* 2DD8 */
+ {0x2DDA,0x2DDA},{0x2DDB,0x2DDB}, /* 2DDA */
+ {0x2DDC,0x2DDC},{0x2DDD,0x2DDD}, /* 2DDC */
+ {0x2DDE,0x2DDE},{0x2DDF,0x2DDF}, /* 2DDE */
+ {0x2DE0,0x2DE0},{0x2DE1,0x2DE1}, /* 2DE0 */
+ {0x2DE2,0x2DE2},{0x2DE3,0x2DE3}, /* 2DE2 */
+ {0x2DE4,0x2DE4},{0x2DE5,0x2DE5}, /* 2DE4 */
+ {0x2DE6,0x2DE6},{0x2DE7,0x2DE7}, /* 2DE6 */
+ {0x2DE8,0x2DE8},{0x2DE9,0x2DE9}, /* 2DE8 */
+ {0x2DEA,0x2DEA},{0x2DEB,0x2DEB}, /* 2DEA */
+ {0x2DEC,0x2DEC},{0x2DED,0x2DED}, /* 2DEC */
+ {0x2DEE,0x2DEE},{0x2DEF,0x2DEF}, /* 2DEE */
+ {0x2DF0,0x2DF0},{0x2DF1,0x2DF1}, /* 2DF0 */
+ {0x2DF2,0x2DF2},{0x2DF3,0x2DF3}, /* 2DF2 */
+ {0x2DF4,0x2DF4},{0x2DF5,0x2DF5}, /* 2DF4 */
+ {0x2DF6,0x2DF6},{0x2DF7,0x2DF7}, /* 2DF6 */
+ {0x2DF8,0x2DF8},{0x2DF9,0x2DF9}, /* 2DF8 */
+ {0x2DFA,0x2DFA},{0x2DFB,0x2DFB}, /* 2DFA */
+ {0x2DFC,0x2DFC},{0x2DFD,0x2DFD}, /* 2DFC */
+ {0x2DFE,0x2DFE},{0x2DFF,0x2DFF} /* 2DFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_pageA6[256]={
+ {0xA600,0xA600},{0xA601,0xA601}, /* A600 */
+ {0xA602,0xA602},{0xA603,0xA603}, /* A602 */
+ {0xA604,0xA604},{0xA605,0xA605}, /* A604 */
+ {0xA606,0xA606},{0xA607,0xA607}, /* A606 */
+ {0xA608,0xA608},{0xA609,0xA609}, /* A608 */
+ {0xA60A,0xA60A},{0xA60B,0xA60B}, /* A60A */
+ {0xA60C,0xA60C},{0xA60D,0xA60D}, /* A60C */
+ {0xA60E,0xA60E},{0xA60F,0xA60F}, /* A60E */
+ {0xA610,0xA610},{0xA611,0xA611}, /* A610 */
+ {0xA612,0xA612},{0xA613,0xA613}, /* A612 */
+ {0xA614,0xA614},{0xA615,0xA615}, /* A614 */
+ {0xA616,0xA616},{0xA617,0xA617}, /* A616 */
+ {0xA618,0xA618},{0xA619,0xA619}, /* A618 */
+ {0xA61A,0xA61A},{0xA61B,0xA61B}, /* A61A */
+ {0xA61C,0xA61C},{0xA61D,0xA61D}, /* A61C */
+ {0xA61E,0xA61E},{0xA61F,0xA61F}, /* A61E */
+ {0xA620,0xA620},{0xA621,0xA621}, /* A620 */
+ {0xA622,0xA622},{0xA623,0xA623}, /* A622 */
+ {0xA624,0xA624},{0xA625,0xA625}, /* A624 */
+ {0xA626,0xA626},{0xA627,0xA627}, /* A626 */
+ {0xA628,0xA628},{0xA629,0xA629}, /* A628 */
+ {0xA62A,0xA62A},{0xA62B,0xA62B}, /* A62A */
+ {0xA62C,0xA62C},{0xA62D,0xA62D}, /* A62C */
+ {0xA62E,0xA62E},{0xA62F,0xA62F}, /* A62E */
+ {0xA630,0xA630},{0xA631,0xA631}, /* A630 */
+ {0xA632,0xA632},{0xA633,0xA633}, /* A632 */
+ {0xA634,0xA634},{0xA635,0xA635}, /* A634 */
+ {0xA636,0xA636},{0xA637,0xA637}, /* A636 */
+ {0xA638,0xA638},{0xA639,0xA639}, /* A638 */
+ {0xA63A,0xA63A},{0xA63B,0xA63B}, /* A63A */
+ {0xA63C,0xA63C},{0xA63D,0xA63D}, /* A63C */
+ {0xA63E,0xA63E},{0xA63F,0xA63F}, /* A63E */
+ {0xA640,0xA641},{0xA640,0xA641}, /* A640 */
+ {0xA642,0xA643},{0xA642,0xA643}, /* A642 */
+ {0xA644,0xA645},{0xA644,0xA645}, /* A644 */
+ {0xA646,0xA647},{0xA646,0xA647}, /* A646 */
+ {0xA648,0xA649},{0xA648,0xA649}, /* A648 */
+ {0xA64A,0xA64B},{0xA64A,0xA64B}, /* A64A */
+ {0xA64C,0xA64D},{0xA64C,0xA64D}, /* A64C */
+ {0xA64E,0xA64F},{0xA64E,0xA64F}, /* A64E */
+ {0xA650,0xA651},{0xA650,0xA651}, /* A650 */
+ {0xA652,0xA653},{0xA652,0xA653}, /* A652 */
+ {0xA654,0xA655},{0xA654,0xA655}, /* A654 */
+ {0xA656,0xA657},{0xA656,0xA657}, /* A656 */
+ {0xA658,0xA659},{0xA658,0xA659}, /* A658 */
+ {0xA65A,0xA65B},{0xA65A,0xA65B}, /* A65A */
+ {0xA65C,0xA65D},{0xA65C,0xA65D}, /* A65C */
+ {0xA65E,0xA65F},{0xA65E,0xA65F}, /* A65E */
+ {0xA660,0xA661},{0xA660,0xA661}, /* A660 */
+ {0xA662,0xA663},{0xA662,0xA663}, /* A662 */
+ {0xA664,0xA665},{0xA664,0xA665}, /* A664 */
+ {0xA666,0xA667},{0xA666,0xA667}, /* A666 */
+ {0xA668,0xA669},{0xA668,0xA669}, /* A668 */
+ {0xA66A,0xA66B},{0xA66A,0xA66B}, /* A66A */
+ {0xA66C,0xA66D},{0xA66C,0xA66D}, /* A66C */
+ {0xA66E,0xA66E},{0xA66F,0xA66F}, /* A66E */
+ {0xA670,0xA670},{0xA671,0xA671}, /* A670 */
+ {0xA672,0xA672},{0xA673,0xA673}, /* A672 */
+ {0xA674,0xA674},{0xA675,0xA675}, /* A674 */
+ {0xA676,0xA676},{0xA677,0xA677}, /* A676 */
+ {0xA678,0xA678},{0xA679,0xA679}, /* A678 */
+ {0xA67A,0xA67A},{0xA67B,0xA67B}, /* A67A */
+ {0xA67C,0xA67C},{0xA67D,0xA67D}, /* A67C */
+ {0xA67E,0xA67E},{0xA67F,0xA67F}, /* A67E */
+ {0xA680,0xA681},{0xA680,0xA681}, /* A680 */
+ {0xA682,0xA683},{0xA682,0xA683}, /* A682 */
+ {0xA684,0xA685},{0xA684,0xA685}, /* A684 */
+ {0xA686,0xA687},{0xA686,0xA687}, /* A686 */
+ {0xA688,0xA689},{0xA688,0xA689}, /* A688 */
+ {0xA68A,0xA68B},{0xA68A,0xA68B}, /* A68A */
+ {0xA68C,0xA68D},{0xA68C,0xA68D}, /* A68C */
+ {0xA68E,0xA68F},{0xA68E,0xA68F}, /* A68E */
+ {0xA690,0xA691},{0xA690,0xA691}, /* A690 */
+ {0xA692,0xA693},{0xA692,0xA693}, /* A692 */
+ {0xA694,0xA695},{0xA694,0xA695}, /* A694 */
+ {0xA696,0xA697},{0xA696,0xA697}, /* A696 */
+ {0xA698,0xA699},{0xA698,0xA699}, /* A698 */
+ {0xA69A,0xA69B},{0xA69A,0xA69B}, /* A69A */
+ {0xA69C,0xA69C},{0xA69D,0xA69D}, /* A69C */
+ {0xA69E,0xA69E},{0xA69F,0xA69F}, /* A69E */
+ {0xA6A0,0xA6A0},{0xA6A1,0xA6A1}, /* A6A0 */
+ {0xA6A2,0xA6A2},{0xA6A3,0xA6A3}, /* A6A2 */
+ {0xA6A4,0xA6A4},{0xA6A5,0xA6A5}, /* A6A4 */
+ {0xA6A6,0xA6A6},{0xA6A7,0xA6A7}, /* A6A6 */
+ {0xA6A8,0xA6A8},{0xA6A9,0xA6A9}, /* A6A8 */
+ {0xA6AA,0xA6AA},{0xA6AB,0xA6AB}, /* A6AA */
+ {0xA6AC,0xA6AC},{0xA6AD,0xA6AD}, /* A6AC */
+ {0xA6AE,0xA6AE},{0xA6AF,0xA6AF}, /* A6AE */
+ {0xA6B0,0xA6B0},{0xA6B1,0xA6B1}, /* A6B0 */
+ {0xA6B2,0xA6B2},{0xA6B3,0xA6B3}, /* A6B2 */
+ {0xA6B4,0xA6B4},{0xA6B5,0xA6B5}, /* A6B4 */
+ {0xA6B6,0xA6B6},{0xA6B7,0xA6B7}, /* A6B6 */
+ {0xA6B8,0xA6B8},{0xA6B9,0xA6B9}, /* A6B8 */
+ {0xA6BA,0xA6BA},{0xA6BB,0xA6BB}, /* A6BA */
+ {0xA6BC,0xA6BC},{0xA6BD,0xA6BD}, /* A6BC */
+ {0xA6BE,0xA6BE},{0xA6BF,0xA6BF}, /* A6BE */
+ {0xA6C0,0xA6C0},{0xA6C1,0xA6C1}, /* A6C0 */
+ {0xA6C2,0xA6C2},{0xA6C3,0xA6C3}, /* A6C2 */
+ {0xA6C4,0xA6C4},{0xA6C5,0xA6C5}, /* A6C4 */
+ {0xA6C6,0xA6C6},{0xA6C7,0xA6C7}, /* A6C6 */
+ {0xA6C8,0xA6C8},{0xA6C9,0xA6C9}, /* A6C8 */
+ {0xA6CA,0xA6CA},{0xA6CB,0xA6CB}, /* A6CA */
+ {0xA6CC,0xA6CC},{0xA6CD,0xA6CD}, /* A6CC */
+ {0xA6CE,0xA6CE},{0xA6CF,0xA6CF}, /* A6CE */
+ {0xA6D0,0xA6D0},{0xA6D1,0xA6D1}, /* A6D0 */
+ {0xA6D2,0xA6D2},{0xA6D3,0xA6D3}, /* A6D2 */
+ {0xA6D4,0xA6D4},{0xA6D5,0xA6D5}, /* A6D4 */
+ {0xA6D6,0xA6D6},{0xA6D7,0xA6D7}, /* A6D6 */
+ {0xA6D8,0xA6D8},{0xA6D9,0xA6D9}, /* A6D8 */
+ {0xA6DA,0xA6DA},{0xA6DB,0xA6DB}, /* A6DA */
+ {0xA6DC,0xA6DC},{0xA6DD,0xA6DD}, /* A6DC */
+ {0xA6DE,0xA6DE},{0xA6DF,0xA6DF}, /* A6DE */
+ {0xA6E0,0xA6E0},{0xA6E1,0xA6E1}, /* A6E0 */
+ {0xA6E2,0xA6E2},{0xA6E3,0xA6E3}, /* A6E2 */
+ {0xA6E4,0xA6E4},{0xA6E5,0xA6E5}, /* A6E4 */
+ {0xA6E6,0xA6E6},{0xA6E7,0xA6E7}, /* A6E6 */
+ {0xA6E8,0xA6E8},{0xA6E9,0xA6E9}, /* A6E8 */
+ {0xA6EA,0xA6EA},{0xA6EB,0xA6EB}, /* A6EA */
+ {0xA6EC,0xA6EC},{0xA6ED,0xA6ED}, /* A6EC */
+ {0xA6EE,0xA6EE},{0xA6EF,0xA6EF}, /* A6EE */
+ {0xA6F0,0xA6F0},{0xA6F1,0xA6F1}, /* A6F0 */
+ {0xA6F2,0xA6F2},{0xA6F3,0xA6F3}, /* A6F2 */
+ {0xA6F4,0xA6F4},{0xA6F5,0xA6F5}, /* A6F4 */
+ {0xA6F6,0xA6F6},{0xA6F7,0xA6F7}, /* A6F6 */
+ {0xA6F8,0xA6F8},{0xA6F9,0xA6F9}, /* A6F8 */
+ {0xA6FA,0xA6FA},{0xA6FB,0xA6FB}, /* A6FA */
+ {0xA6FC,0xA6FC},{0xA6FD,0xA6FD}, /* A6FC */
+ {0xA6FE,0xA6FE},{0xA6FF,0xA6FF} /* A6FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_pageA7[256]={
+ {0xA700,0xA700},{0xA701,0xA701}, /* A700 */
+ {0xA702,0xA702},{0xA703,0xA703}, /* A702 */
+ {0xA704,0xA704},{0xA705,0xA705}, /* A704 */
+ {0xA706,0xA706},{0xA707,0xA707}, /* A706 */
+ {0xA708,0xA708},{0xA709,0xA709}, /* A708 */
+ {0xA70A,0xA70A},{0xA70B,0xA70B}, /* A70A */
+ {0xA70C,0xA70C},{0xA70D,0xA70D}, /* A70C */
+ {0xA70E,0xA70E},{0xA70F,0xA70F}, /* A70E */
+ {0xA710,0xA710},{0xA711,0xA711}, /* A710 */
+ {0xA712,0xA712},{0xA713,0xA713}, /* A712 */
+ {0xA714,0xA714},{0xA715,0xA715}, /* A714 */
+ {0xA716,0xA716},{0xA717,0xA717}, /* A716 */
+ {0xA718,0xA718},{0xA719,0xA719}, /* A718 */
+ {0xA71A,0xA71A},{0xA71B,0xA71B}, /* A71A */
+ {0xA71C,0xA71C},{0xA71D,0xA71D}, /* A71C */
+ {0xA71E,0xA71E},{0xA71F,0xA71F}, /* A71E */
+ {0xA720,0xA720},{0xA721,0xA721}, /* A720 */
+ {0xA722,0xA723},{0xA722,0xA723}, /* A722 */
+ {0xA724,0xA725},{0xA724,0xA725}, /* A724 */
+ {0xA726,0xA727},{0xA726,0xA727}, /* A726 */
+ {0xA728,0xA729},{0xA728,0xA729}, /* A728 */
+ {0xA72A,0xA72B},{0xA72A,0xA72B}, /* A72A */
+ {0xA72C,0xA72D},{0xA72C,0xA72D}, /* A72C */
+ {0xA72E,0xA72F},{0xA72E,0xA72F}, /* A72E */
+ {0xA730,0xA730},{0xA731,0xA731}, /* A730 */
+ {0xA732,0xA733},{0xA732,0xA733}, /* A732 */
+ {0xA734,0xA735},{0xA734,0xA735}, /* A734 */
+ {0xA736,0xA737},{0xA736,0xA737}, /* A736 */
+ {0xA738,0xA739},{0xA738,0xA739}, /* A738 */
+ {0xA73A,0xA73B},{0xA73A,0xA73B}, /* A73A */
+ {0xA73C,0xA73D},{0xA73C,0xA73D}, /* A73C */
+ {0xA73E,0xA73F},{0xA73E,0xA73F}, /* A73E */
+ {0xA740,0xA741},{0xA740,0xA741}, /* A740 */
+ {0xA742,0xA743},{0xA742,0xA743}, /* A742 */
+ {0xA744,0xA745},{0xA744,0xA745}, /* A744 */
+ {0xA746,0xA747},{0xA746,0xA747}, /* A746 */
+ {0xA748,0xA749},{0xA748,0xA749}, /* A748 */
+ {0xA74A,0xA74B},{0xA74A,0xA74B}, /* A74A */
+ {0xA74C,0xA74D},{0xA74C,0xA74D}, /* A74C */
+ {0xA74E,0xA74F},{0xA74E,0xA74F}, /* A74E */
+ {0xA750,0xA751},{0xA750,0xA751}, /* A750 */
+ {0xA752,0xA753},{0xA752,0xA753}, /* A752 */
+ {0xA754,0xA755},{0xA754,0xA755}, /* A754 */
+ {0xA756,0xA757},{0xA756,0xA757}, /* A756 */
+ {0xA758,0xA759},{0xA758,0xA759}, /* A758 */
+ {0xA75A,0xA75B},{0xA75A,0xA75B}, /* A75A */
+ {0xA75C,0xA75D},{0xA75C,0xA75D}, /* A75C */
+ {0xA75E,0xA75F},{0xA75E,0xA75F}, /* A75E */
+ {0xA760,0xA761},{0xA760,0xA761}, /* A760 */
+ {0xA762,0xA763},{0xA762,0xA763}, /* A762 */
+ {0xA764,0xA765},{0xA764,0xA765}, /* A764 */
+ {0xA766,0xA767},{0xA766,0xA767}, /* A766 */
+ {0xA768,0xA769},{0xA768,0xA769}, /* A768 */
+ {0xA76A,0xA76B},{0xA76A,0xA76B}, /* A76A */
+ {0xA76C,0xA76D},{0xA76C,0xA76D}, /* A76C */
+ {0xA76E,0xA76F},{0xA76E,0xA76F}, /* A76E */
+ {0xA770,0xA770},{0xA771,0xA771}, /* A770 */
+ {0xA772,0xA772},{0xA773,0xA773}, /* A772 */
+ {0xA774,0xA774},{0xA775,0xA775}, /* A774 */
+ {0xA776,0xA776},{0xA777,0xA777}, /* A776 */
+ {0xA778,0xA778},{0xA779,0xA77A}, /* A778 */
+ {0xA779,0xA77A},{0xA77B,0xA77C}, /* A77A */
+ {0xA77B,0xA77C},{0xA77D,0x1D79}, /* A77C */
+ {0xA77E,0xA77F},{0xA77E,0xA77F}, /* A77E */
+ {0xA780,0xA781},{0xA780,0xA781}, /* A780 */
+ {0xA782,0xA783},{0xA782,0xA783}, /* A782 */
+ {0xA784,0xA785},{0xA784,0xA785}, /* A784 */
+ {0xA786,0xA787},{0xA786,0xA787}, /* A786 */
+ {0xA788,0xA788},{0xA789,0xA789}, /* A788 */
+ {0xA78A,0xA78A},{0xA78B,0xA78C}, /* A78A */
+ {0xA78B,0xA78C},{0xA78D,0x0265}, /* A78C */
+ {0xA78E,0xA78E},{0xA78F,0xA78F}, /* A78E */
+ {0xA790,0xA791},{0xA790,0xA791}, /* A790 */
+ {0xA792,0xA793},{0xA792,0xA793}, /* A792 */
+ {0xA7C4,0xA794},{0xA795,0xA795}, /* A794 */
+ {0xA796,0xA797},{0xA796,0xA797}, /* A796 */
+ {0xA798,0xA799},{0xA798,0xA799}, /* A798 */
+ {0xA79A,0xA79B},{0xA79A,0xA79B}, /* A79A */
+ {0xA79C,0xA79D},{0xA79C,0xA79D}, /* A79C */
+ {0xA79E,0xA79F},{0xA79E,0xA79F}, /* A79E */
+ {0xA7A0,0xA7A1},{0xA7A0,0xA7A1}, /* A7A0 */
+ {0xA7A2,0xA7A3},{0xA7A2,0xA7A3}, /* A7A2 */
+ {0xA7A4,0xA7A5},{0xA7A4,0xA7A5}, /* A7A4 */
+ {0xA7A6,0xA7A7},{0xA7A6,0xA7A7}, /* A7A6 */
+ {0xA7A8,0xA7A9},{0xA7A8,0xA7A9}, /* A7A8 */
+ {0xA7AA,0x0266},{0xA7AB,0x025C}, /* A7AA */
+ {0xA7AC,0x0261},{0xA7AD,0x026C}, /* A7AC */
+ {0xA7AE,0x026A},{0xA7AF,0xA7AF}, /* A7AE */
+ {0xA7B0,0x029E},{0xA7B1,0x0287}, /* A7B0 */
+ {0xA7B2,0x029D},{0xA7B3,0xAB53}, /* A7B2 */
+ {0xA7B4,0xA7B5},{0xA7B4,0xA7B5}, /* A7B4 */
+ {0xA7B6,0xA7B7},{0xA7B6,0xA7B7}, /* A7B6 */
+ {0xA7B8,0xA7B9},{0xA7B8,0xA7B9}, /* A7B8 */
+ {0xA7BA,0xA7BB},{0xA7BA,0xA7BB}, /* A7BA */
+ {0xA7BC,0xA7BD},{0xA7BC,0xA7BD}, /* A7BC */
+ {0xA7BE,0xA7BF},{0xA7BE,0xA7BF}, /* A7BE */
+ {0xA7C0,0xA7C1},{0xA7C0,0xA7C1}, /* A7C0 */
+ {0xA7C2,0xA7C3},{0xA7C2,0xA7C3}, /* A7C2 */
+ {0xA7C4,0xA794},{0xA7C5,0x0282}, /* A7C4 */
+ {0xA7C6,0x1D8E},{0xA7C7,0xA7C8}, /* A7C6 */
+ {0xA7C7,0xA7C8},{0xA7C9,0xA7CA}, /* A7C8 */
+ {0xA7C9,0xA7CA},{0xA7CB,0xA7CB}, /* A7CA */
+ {0xA7CC,0xA7CC},{0xA7CD,0xA7CD}, /* A7CC */
+ {0xA7CE,0xA7CE},{0xA7CF,0xA7CF}, /* A7CE */
+ {0xA7D0,0xA7D1},{0xA7D0,0xA7D1}, /* A7D0 */
+ {0xA7D2,0xA7D2},{0xA7D3,0xA7D3}, /* A7D2 */
+ {0xA7D4,0xA7D4},{0xA7D5,0xA7D5}, /* A7D4 */
+ {0xA7D6,0xA7D7},{0xA7D6,0xA7D7}, /* A7D6 */
+ {0xA7D8,0xA7D9},{0xA7D8,0xA7D9}, /* A7D8 */
+ {0xA7DA,0xA7DA},{0xA7DB,0xA7DB}, /* A7DA */
+ {0xA7DC,0xA7DC},{0xA7DD,0xA7DD}, /* A7DC */
+ {0xA7DE,0xA7DE},{0xA7DF,0xA7DF}, /* A7DE */
+ {0xA7E0,0xA7E0},{0xA7E1,0xA7E1}, /* A7E0 */
+ {0xA7E2,0xA7E2},{0xA7E3,0xA7E3}, /* A7E2 */
+ {0xA7E4,0xA7E4},{0xA7E5,0xA7E5}, /* A7E4 */
+ {0xA7E6,0xA7E6},{0xA7E7,0xA7E7}, /* A7E6 */
+ {0xA7E8,0xA7E8},{0xA7E9,0xA7E9}, /* A7E8 */
+ {0xA7EA,0xA7EA},{0xA7EB,0xA7EB}, /* A7EA */
+ {0xA7EC,0xA7EC},{0xA7ED,0xA7ED}, /* A7EC */
+ {0xA7EE,0xA7EE},{0xA7EF,0xA7EF}, /* A7EE */
+ {0xA7F0,0xA7F0},{0xA7F1,0xA7F1}, /* A7F0 */
+ {0xA7F2,0xA7F2},{0xA7F3,0xA7F3}, /* A7F2 */
+ {0xA7F4,0xA7F4},{0xA7F5,0xA7F6}, /* A7F4 */
+ {0xA7F5,0xA7F6},{0xA7F7,0xA7F7}, /* A7F6 */
+ {0xA7F8,0xA7F8},{0xA7F9,0xA7F9}, /* A7F8 */
+ {0xA7FA,0xA7FA},{0xA7FB,0xA7FB}, /* A7FA */
+ {0xA7FC,0xA7FC},{0xA7FD,0xA7FD}, /* A7FC */
+ {0xA7FE,0xA7FE},{0xA7FF,0xA7FF} /* A7FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_pageAB[256]={
+ {0xAB00,0xAB00},{0xAB01,0xAB01}, /* AB00 */
+ {0xAB02,0xAB02},{0xAB03,0xAB03}, /* AB02 */
+ {0xAB04,0xAB04},{0xAB05,0xAB05}, /* AB04 */
+ {0xAB06,0xAB06},{0xAB07,0xAB07}, /* AB06 */
+ {0xAB08,0xAB08},{0xAB09,0xAB09}, /* AB08 */
+ {0xAB0A,0xAB0A},{0xAB0B,0xAB0B}, /* AB0A */
+ {0xAB0C,0xAB0C},{0xAB0D,0xAB0D}, /* AB0C */
+ {0xAB0E,0xAB0E},{0xAB0F,0xAB0F}, /* AB0E */
+ {0xAB10,0xAB10},{0xAB11,0xAB11}, /* AB10 */
+ {0xAB12,0xAB12},{0xAB13,0xAB13}, /* AB12 */
+ {0xAB14,0xAB14},{0xAB15,0xAB15}, /* AB14 */
+ {0xAB16,0xAB16},{0xAB17,0xAB17}, /* AB16 */
+ {0xAB18,0xAB18},{0xAB19,0xAB19}, /* AB18 */
+ {0xAB1A,0xAB1A},{0xAB1B,0xAB1B}, /* AB1A */
+ {0xAB1C,0xAB1C},{0xAB1D,0xAB1D}, /* AB1C */
+ {0xAB1E,0xAB1E},{0xAB1F,0xAB1F}, /* AB1E */
+ {0xAB20,0xAB20},{0xAB21,0xAB21}, /* AB20 */
+ {0xAB22,0xAB22},{0xAB23,0xAB23}, /* AB22 */
+ {0xAB24,0xAB24},{0xAB25,0xAB25}, /* AB24 */
+ {0xAB26,0xAB26},{0xAB27,0xAB27}, /* AB26 */
+ {0xAB28,0xAB28},{0xAB29,0xAB29}, /* AB28 */
+ {0xAB2A,0xAB2A},{0xAB2B,0xAB2B}, /* AB2A */
+ {0xAB2C,0xAB2C},{0xAB2D,0xAB2D}, /* AB2C */
+ {0xAB2E,0xAB2E},{0xAB2F,0xAB2F}, /* AB2E */
+ {0xAB30,0xAB30},{0xAB31,0xAB31}, /* AB30 */
+ {0xAB32,0xAB32},{0xAB33,0xAB33}, /* AB32 */
+ {0xAB34,0xAB34},{0xAB35,0xAB35}, /* AB34 */
+ {0xAB36,0xAB36},{0xAB37,0xAB37}, /* AB36 */
+ {0xAB38,0xAB38},{0xAB39,0xAB39}, /* AB38 */
+ {0xAB3A,0xAB3A},{0xAB3B,0xAB3B}, /* AB3A */
+ {0xAB3C,0xAB3C},{0xAB3D,0xAB3D}, /* AB3C */
+ {0xAB3E,0xAB3E},{0xAB3F,0xAB3F}, /* AB3E */
+ {0xAB40,0xAB40},{0xAB41,0xAB41}, /* AB40 */
+ {0xAB42,0xAB42},{0xAB43,0xAB43}, /* AB42 */
+ {0xAB44,0xAB44},{0xAB45,0xAB45}, /* AB44 */
+ {0xAB46,0xAB46},{0xAB47,0xAB47}, /* AB46 */
+ {0xAB48,0xAB48},{0xAB49,0xAB49}, /* AB48 */
+ {0xAB4A,0xAB4A},{0xAB4B,0xAB4B}, /* AB4A */
+ {0xAB4C,0xAB4C},{0xAB4D,0xAB4D}, /* AB4C */
+ {0xAB4E,0xAB4E},{0xAB4F,0xAB4F}, /* AB4E */
+ {0xAB50,0xAB50},{0xAB51,0xAB51}, /* AB50 */
+ {0xAB52,0xAB52},{0xA7B3,0xAB53}, /* AB52 */
+ {0xAB54,0xAB54},{0xAB55,0xAB55}, /* AB54 */
+ {0xAB56,0xAB56},{0xAB57,0xAB57}, /* AB56 */
+ {0xAB58,0xAB58},{0xAB59,0xAB59}, /* AB58 */
+ {0xAB5A,0xAB5A},{0xAB5B,0xAB5B}, /* AB5A */
+ {0xAB5C,0xAB5C},{0xAB5D,0xAB5D}, /* AB5C */
+ {0xAB5E,0xAB5E},{0xAB5F,0xAB5F}, /* AB5E */
+ {0xAB60,0xAB60},{0xAB61,0xAB61}, /* AB60 */
+ {0xAB62,0xAB62},{0xAB63,0xAB63}, /* AB62 */
+ {0xAB64,0xAB64},{0xAB65,0xAB65}, /* AB64 */
+ {0xAB66,0xAB66},{0xAB67,0xAB67}, /* AB66 */
+ {0xAB68,0xAB68},{0xAB69,0xAB69}, /* AB68 */
+ {0xAB6A,0xAB6A},{0xAB6B,0xAB6B}, /* AB6A */
+ {0xAB6C,0xAB6C},{0xAB6D,0xAB6D}, /* AB6C */
+ {0xAB6E,0xAB6E},{0xAB6F,0xAB6F}, /* AB6E */
+ {0x13A0,0xAB70},{0x13A1,0xAB71}, /* AB70 */
+ {0x13A2,0xAB72},{0x13A3,0xAB73}, /* AB72 */
+ {0x13A4,0xAB74},{0x13A5,0xAB75}, /* AB74 */
+ {0x13A6,0xAB76},{0x13A7,0xAB77}, /* AB76 */
+ {0x13A8,0xAB78},{0x13A9,0xAB79}, /* AB78 */
+ {0x13AA,0xAB7A},{0x13AB,0xAB7B}, /* AB7A */
+ {0x13AC,0xAB7C},{0x13AD,0xAB7D}, /* AB7C */
+ {0x13AE,0xAB7E},{0x13AF,0xAB7F}, /* AB7E */
+ {0x13B0,0xAB80},{0x13B1,0xAB81}, /* AB80 */
+ {0x13B2,0xAB82},{0x13B3,0xAB83}, /* AB82 */
+ {0x13B4,0xAB84},{0x13B5,0xAB85}, /* AB84 */
+ {0x13B6,0xAB86},{0x13B7,0xAB87}, /* AB86 */
+ {0x13B8,0xAB88},{0x13B9,0xAB89}, /* AB88 */
+ {0x13BA,0xAB8A},{0x13BB,0xAB8B}, /* AB8A */
+ {0x13BC,0xAB8C},{0x13BD,0xAB8D}, /* AB8C */
+ {0x13BE,0xAB8E},{0x13BF,0xAB8F}, /* AB8E */
+ {0x13C0,0xAB90},{0x13C1,0xAB91}, /* AB90 */
+ {0x13C2,0xAB92},{0x13C3,0xAB93}, /* AB92 */
+ {0x13C4,0xAB94},{0x13C5,0xAB95}, /* AB94 */
+ {0x13C6,0xAB96},{0x13C7,0xAB97}, /* AB96 */
+ {0x13C8,0xAB98},{0x13C9,0xAB99}, /* AB98 */
+ {0x13CA,0xAB9A},{0x13CB,0xAB9B}, /* AB9A */
+ {0x13CC,0xAB9C},{0x13CD,0xAB9D}, /* AB9C */
+ {0x13CE,0xAB9E},{0x13CF,0xAB9F}, /* AB9E */
+ {0x13D0,0xABA0},{0x13D1,0xABA1}, /* ABA0 */
+ {0x13D2,0xABA2},{0x13D3,0xABA3}, /* ABA2 */
+ {0x13D4,0xABA4},{0x13D5,0xABA5}, /* ABA4 */
+ {0x13D6,0xABA6},{0x13D7,0xABA7}, /* ABA6 */
+ {0x13D8,0xABA8},{0x13D9,0xABA9}, /* ABA8 */
+ {0x13DA,0xABAA},{0x13DB,0xABAB}, /* ABAA */
+ {0x13DC,0xABAC},{0x13DD,0xABAD}, /* ABAC */
+ {0x13DE,0xABAE},{0x13DF,0xABAF}, /* ABAE */
+ {0x13E0,0xABB0},{0x13E1,0xABB1}, /* ABB0 */
+ {0x13E2,0xABB2},{0x13E3,0xABB3}, /* ABB2 */
+ {0x13E4,0xABB4},{0x13E5,0xABB5}, /* ABB4 */
+ {0x13E6,0xABB6},{0x13E7,0xABB7}, /* ABB6 */
+ {0x13E8,0xABB8},{0x13E9,0xABB9}, /* ABB8 */
+ {0x13EA,0xABBA},{0x13EB,0xABBB}, /* ABBA */
+ {0x13EC,0xABBC},{0x13ED,0xABBD}, /* ABBC */
+ {0x13EE,0xABBE},{0x13EF,0xABBF}, /* ABBE */
+ {0xABC0,0xABC0},{0xABC1,0xABC1}, /* ABC0 */
+ {0xABC2,0xABC2},{0xABC3,0xABC3}, /* ABC2 */
+ {0xABC4,0xABC4},{0xABC5,0xABC5}, /* ABC4 */
+ {0xABC6,0xABC6},{0xABC7,0xABC7}, /* ABC6 */
+ {0xABC8,0xABC8},{0xABC9,0xABC9}, /* ABC8 */
+ {0xABCA,0xABCA},{0xABCB,0xABCB}, /* ABCA */
+ {0xABCC,0xABCC},{0xABCD,0xABCD}, /* ABCC */
+ {0xABCE,0xABCE},{0xABCF,0xABCF}, /* ABCE */
+ {0xABD0,0xABD0},{0xABD1,0xABD1}, /* ABD0 */
+ {0xABD2,0xABD2},{0xABD3,0xABD3}, /* ABD2 */
+ {0xABD4,0xABD4},{0xABD5,0xABD5}, /* ABD4 */
+ {0xABD6,0xABD6},{0xABD7,0xABD7}, /* ABD6 */
+ {0xABD8,0xABD8},{0xABD9,0xABD9}, /* ABD8 */
+ {0xABDA,0xABDA},{0xABDB,0xABDB}, /* ABDA */
+ {0xABDC,0xABDC},{0xABDD,0xABDD}, /* ABDC */
+ {0xABDE,0xABDE},{0xABDF,0xABDF}, /* ABDE */
+ {0xABE0,0xABE0},{0xABE1,0xABE1}, /* ABE0 */
+ {0xABE2,0xABE2},{0xABE3,0xABE3}, /* ABE2 */
+ {0xABE4,0xABE4},{0xABE5,0xABE5}, /* ABE4 */
+ {0xABE6,0xABE6},{0xABE7,0xABE7}, /* ABE6 */
+ {0xABE8,0xABE8},{0xABE9,0xABE9}, /* ABE8 */
+ {0xABEA,0xABEA},{0xABEB,0xABEB}, /* ABEA */
+ {0xABEC,0xABEC},{0xABED,0xABED}, /* ABEC */
+ {0xABEE,0xABEE},{0xABEF,0xABEF}, /* ABEE */
+ {0xABF0,0xABF0},{0xABF1,0xABF1}, /* ABF0 */
+ {0xABF2,0xABF2},{0xABF3,0xABF3}, /* ABF2 */
+ {0xABF4,0xABF4},{0xABF5,0xABF5}, /* ABF4 */
+ {0xABF6,0xABF6},{0xABF7,0xABF7}, /* ABF6 */
+ {0xABF8,0xABF8},{0xABF9,0xABF9}, /* ABF8 */
+ {0xABFA,0xABFA},{0xABFB,0xABFB}, /* ABFA */
+ {0xABFC,0xABFC},{0xABFD,0xABFD}, /* ABFC */
+ {0xABFE,0xABFE},{0xABFF,0xABFF} /* ABFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_pageFF[256]={
+ {0xFF00,0xFF00},{0xFF01,0xFF01}, /* FF00 */
+ {0xFF02,0xFF02},{0xFF03,0xFF03}, /* FF02 */
+ {0xFF04,0xFF04},{0xFF05,0xFF05}, /* FF04 */
+ {0xFF06,0xFF06},{0xFF07,0xFF07}, /* FF06 */
+ {0xFF08,0xFF08},{0xFF09,0xFF09}, /* FF08 */
+ {0xFF0A,0xFF0A},{0xFF0B,0xFF0B}, /* FF0A */
+ {0xFF0C,0xFF0C},{0xFF0D,0xFF0D}, /* FF0C */
+ {0xFF0E,0xFF0E},{0xFF0F,0xFF0F}, /* FF0E */
+ {0xFF10,0xFF10},{0xFF11,0xFF11}, /* FF10 */
+ {0xFF12,0xFF12},{0xFF13,0xFF13}, /* FF12 */
+ {0xFF14,0xFF14},{0xFF15,0xFF15}, /* FF14 */
+ {0xFF16,0xFF16},{0xFF17,0xFF17}, /* FF16 */
+ {0xFF18,0xFF18},{0xFF19,0xFF19}, /* FF18 */
+ {0xFF1A,0xFF1A},{0xFF1B,0xFF1B}, /* FF1A */
+ {0xFF1C,0xFF1C},{0xFF1D,0xFF1D}, /* FF1C */
+ {0xFF1E,0xFF1E},{0xFF1F,0xFF1F}, /* FF1E */
+ {0xFF20,0xFF20},{0xFF21,0xFF41}, /* FF20 */
+ {0xFF22,0xFF42},{0xFF23,0xFF43}, /* FF22 */
+ {0xFF24,0xFF44},{0xFF25,0xFF45}, /* FF24 */
+ {0xFF26,0xFF46},{0xFF27,0xFF47}, /* FF26 */
+ {0xFF28,0xFF48},{0xFF29,0xFF49}, /* FF28 */
+ {0xFF2A,0xFF4A},{0xFF2B,0xFF4B}, /* FF2A */
+ {0xFF2C,0xFF4C},{0xFF2D,0xFF4D}, /* FF2C */
+ {0xFF2E,0xFF4E},{0xFF2F,0xFF4F}, /* FF2E */
+ {0xFF30,0xFF50},{0xFF31,0xFF51}, /* FF30 */
+ {0xFF32,0xFF52},{0xFF33,0xFF53}, /* FF32 */
+ {0xFF34,0xFF54},{0xFF35,0xFF55}, /* FF34 */
+ {0xFF36,0xFF56},{0xFF37,0xFF57}, /* FF36 */
+ {0xFF38,0xFF58},{0xFF39,0xFF59}, /* FF38 */
+ {0xFF3A,0xFF5A},{0xFF3B,0xFF3B}, /* FF3A */
+ {0xFF3C,0xFF3C},{0xFF3D,0xFF3D}, /* FF3C */
+ {0xFF3E,0xFF3E},{0xFF3F,0xFF3F}, /* FF3E */
+ {0xFF40,0xFF40},{0xFF21,0xFF41}, /* FF40 */
+ {0xFF22,0xFF42},{0xFF23,0xFF43}, /* FF42 */
+ {0xFF24,0xFF44},{0xFF25,0xFF45}, /* FF44 */
+ {0xFF26,0xFF46},{0xFF27,0xFF47}, /* FF46 */
+ {0xFF28,0xFF48},{0xFF29,0xFF49}, /* FF48 */
+ {0xFF2A,0xFF4A},{0xFF2B,0xFF4B}, /* FF4A */
+ {0xFF2C,0xFF4C},{0xFF2D,0xFF4D}, /* FF4C */
+ {0xFF2E,0xFF4E},{0xFF2F,0xFF4F}, /* FF4E */
+ {0xFF30,0xFF50},{0xFF31,0xFF51}, /* FF50 */
+ {0xFF32,0xFF52},{0xFF33,0xFF53}, /* FF52 */
+ {0xFF34,0xFF54},{0xFF35,0xFF55}, /* FF54 */
+ {0xFF36,0xFF56},{0xFF37,0xFF57}, /* FF56 */
+ {0xFF38,0xFF58},{0xFF39,0xFF59}, /* FF58 */
+ {0xFF3A,0xFF5A},{0xFF5B,0xFF5B}, /* FF5A */
+ {0xFF5C,0xFF5C},{0xFF5D,0xFF5D}, /* FF5C */
+ {0xFF5E,0xFF5E},{0xFF5F,0xFF5F}, /* FF5E */
+ {0xFF60,0xFF60},{0xFF61,0xFF61}, /* FF60 */
+ {0xFF62,0xFF62},{0xFF63,0xFF63}, /* FF62 */
+ {0xFF64,0xFF64},{0xFF65,0xFF65}, /* FF64 */
+ {0xFF66,0xFF66},{0xFF67,0xFF67}, /* FF66 */
+ {0xFF68,0xFF68},{0xFF69,0xFF69}, /* FF68 */
+ {0xFF6A,0xFF6A},{0xFF6B,0xFF6B}, /* FF6A */
+ {0xFF6C,0xFF6C},{0xFF6D,0xFF6D}, /* FF6C */
+ {0xFF6E,0xFF6E},{0xFF6F,0xFF6F}, /* FF6E */
+ {0xFF70,0xFF70},{0xFF71,0xFF71}, /* FF70 */
+ {0xFF72,0xFF72},{0xFF73,0xFF73}, /* FF72 */
+ {0xFF74,0xFF74},{0xFF75,0xFF75}, /* FF74 */
+ {0xFF76,0xFF76},{0xFF77,0xFF77}, /* FF76 */
+ {0xFF78,0xFF78},{0xFF79,0xFF79}, /* FF78 */
+ {0xFF7A,0xFF7A},{0xFF7B,0xFF7B}, /* FF7A */
+ {0xFF7C,0xFF7C},{0xFF7D,0xFF7D}, /* FF7C */
+ {0xFF7E,0xFF7E},{0xFF7F,0xFF7F}, /* FF7E */
+ {0xFF80,0xFF80},{0xFF81,0xFF81}, /* FF80 */
+ {0xFF82,0xFF82},{0xFF83,0xFF83}, /* FF82 */
+ {0xFF84,0xFF84},{0xFF85,0xFF85}, /* FF84 */
+ {0xFF86,0xFF86},{0xFF87,0xFF87}, /* FF86 */
+ {0xFF88,0xFF88},{0xFF89,0xFF89}, /* FF88 */
+ {0xFF8A,0xFF8A},{0xFF8B,0xFF8B}, /* FF8A */
+ {0xFF8C,0xFF8C},{0xFF8D,0xFF8D}, /* FF8C */
+ {0xFF8E,0xFF8E},{0xFF8F,0xFF8F}, /* FF8E */
+ {0xFF90,0xFF90},{0xFF91,0xFF91}, /* FF90 */
+ {0xFF92,0xFF92},{0xFF93,0xFF93}, /* FF92 */
+ {0xFF94,0xFF94},{0xFF95,0xFF95}, /* FF94 */
+ {0xFF96,0xFF96},{0xFF97,0xFF97}, /* FF96 */
+ {0xFF98,0xFF98},{0xFF99,0xFF99}, /* FF98 */
+ {0xFF9A,0xFF9A},{0xFF9B,0xFF9B}, /* FF9A */
+ {0xFF9C,0xFF9C},{0xFF9D,0xFF9D}, /* FF9C */
+ {0xFF9E,0xFF9E},{0xFF9F,0xFF9F}, /* FF9E */
+ {0xFFA0,0xFFA0},{0xFFA1,0xFFA1}, /* FFA0 */
+ {0xFFA2,0xFFA2},{0xFFA3,0xFFA3}, /* FFA2 */
+ {0xFFA4,0xFFA4},{0xFFA5,0xFFA5}, /* FFA4 */
+ {0xFFA6,0xFFA6},{0xFFA7,0xFFA7}, /* FFA6 */
+ {0xFFA8,0xFFA8},{0xFFA9,0xFFA9}, /* FFA8 */
+ {0xFFAA,0xFFAA},{0xFFAB,0xFFAB}, /* FFAA */
+ {0xFFAC,0xFFAC},{0xFFAD,0xFFAD}, /* FFAC */
+ {0xFFAE,0xFFAE},{0xFFAF,0xFFAF}, /* FFAE */
+ {0xFFB0,0xFFB0},{0xFFB1,0xFFB1}, /* FFB0 */
+ {0xFFB2,0xFFB2},{0xFFB3,0xFFB3}, /* FFB2 */
+ {0xFFB4,0xFFB4},{0xFFB5,0xFFB5}, /* FFB4 */
+ {0xFFB6,0xFFB6},{0xFFB7,0xFFB7}, /* FFB6 */
+ {0xFFB8,0xFFB8},{0xFFB9,0xFFB9}, /* FFB8 */
+ {0xFFBA,0xFFBA},{0xFFBB,0xFFBB}, /* FFBA */
+ {0xFFBC,0xFFBC},{0xFFBD,0xFFBD}, /* FFBC */
+ {0xFFBE,0xFFBE},{0xFFBF,0xFFBF}, /* FFBE */
+ {0xFFC0,0xFFC0},{0xFFC1,0xFFC1}, /* FFC0 */
+ {0xFFC2,0xFFC2},{0xFFC3,0xFFC3}, /* FFC2 */
+ {0xFFC4,0xFFC4},{0xFFC5,0xFFC5}, /* FFC4 */
+ {0xFFC6,0xFFC6},{0xFFC7,0xFFC7}, /* FFC6 */
+ {0xFFC8,0xFFC8},{0xFFC9,0xFFC9}, /* FFC8 */
+ {0xFFCA,0xFFCA},{0xFFCB,0xFFCB}, /* FFCA */
+ {0xFFCC,0xFFCC},{0xFFCD,0xFFCD}, /* FFCC */
+ {0xFFCE,0xFFCE},{0xFFCF,0xFFCF}, /* FFCE */
+ {0xFFD0,0xFFD0},{0xFFD1,0xFFD1}, /* FFD0 */
+ {0xFFD2,0xFFD2},{0xFFD3,0xFFD3}, /* FFD2 */
+ {0xFFD4,0xFFD4},{0xFFD5,0xFFD5}, /* FFD4 */
+ {0xFFD6,0xFFD6},{0xFFD7,0xFFD7}, /* FFD6 */
+ {0xFFD8,0xFFD8},{0xFFD9,0xFFD9}, /* FFD8 */
+ {0xFFDA,0xFFDA},{0xFFDB,0xFFDB}, /* FFDA */
+ {0xFFDC,0xFFDC},{0xFFDD,0xFFDD}, /* FFDC */
+ {0xFFDE,0xFFDE},{0xFFDF,0xFFDF}, /* FFDE */
+ {0xFFE0,0xFFE0},{0xFFE1,0xFFE1}, /* FFE0 */
+ {0xFFE2,0xFFE2},{0xFFE3,0xFFE3}, /* FFE2 */
+ {0xFFE4,0xFFE4},{0xFFE5,0xFFE5}, /* FFE4 */
+ {0xFFE6,0xFFE6},{0xFFE7,0xFFE7}, /* FFE6 */
+ {0xFFE8,0xFFE8},{0xFFE9,0xFFE9}, /* FFE8 */
+ {0xFFEA,0xFFEA},{0xFFEB,0xFFEB}, /* FFEA */
+ {0xFFEC,0xFFEC},{0xFFED,0xFFED}, /* FFEC */
+ {0xFFEE,0xFFEE},{0xFFEF,0xFFEF}, /* FFEE */
+ {0xFFF0,0xFFF0},{0xFFF1,0xFFF1}, /* FFF0 */
+ {0xFFF2,0xFFF2},{0xFFF3,0xFFF3}, /* FFF2 */
+ {0xFFF4,0xFFF4},{0xFFF5,0xFFF5}, /* FFF4 */
+ {0xFFF6,0xFFF6},{0xFFF7,0xFFF7}, /* FFF6 */
+ {0xFFF8,0xFFF8},{0xFFF9,0xFFF9}, /* FFF8 */
+ {0xFFFA,0xFFFA},{0xFFFB,0xFFFB}, /* FFFA */
+ {0xFFFC,0xFFFC},{0xFFFD,0xFFFD}, /* FFFC */
+ {0xFFFE,0xFFFE},{0xFFFF,0xFFFF} /* FFFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page104[256]={
+ {0x10400,0x10428},{0x10401,0x10429}, /* 10400 */
+ {0x10402,0x1042A},{0x10403,0x1042B}, /* 10402 */
+ {0x10404,0x1042C},{0x10405,0x1042D}, /* 10404 */
+ {0x10406,0x1042E},{0x10407,0x1042F}, /* 10406 */
+ {0x10408,0x10430},{0x10409,0x10431}, /* 10408 */
+ {0x1040A,0x10432},{0x1040B,0x10433}, /* 1040A */
+ {0x1040C,0x10434},{0x1040D,0x10435}, /* 1040C */
+ {0x1040E,0x10436},{0x1040F,0x10437}, /* 1040E */
+ {0x10410,0x10438},{0x10411,0x10439}, /* 10410 */
+ {0x10412,0x1043A},{0x10413,0x1043B}, /* 10412 */
+ {0x10414,0x1043C},{0x10415,0x1043D}, /* 10414 */
+ {0x10416,0x1043E},{0x10417,0x1043F}, /* 10416 */
+ {0x10418,0x10440},{0x10419,0x10441}, /* 10418 */
+ {0x1041A,0x10442},{0x1041B,0x10443}, /* 1041A */
+ {0x1041C,0x10444},{0x1041D,0x10445}, /* 1041C */
+ {0x1041E,0x10446},{0x1041F,0x10447}, /* 1041E */
+ {0x10420,0x10448},{0x10421,0x10449}, /* 10420 */
+ {0x10422,0x1044A},{0x10423,0x1044B}, /* 10422 */
+ {0x10424,0x1044C},{0x10425,0x1044D}, /* 10424 */
+ {0x10426,0x1044E},{0x10427,0x1044F}, /* 10426 */
+ {0x10400,0x10428},{0x10401,0x10429}, /* 10428 */
+ {0x10402,0x1042A},{0x10403,0x1042B}, /* 1042A */
+ {0x10404,0x1042C},{0x10405,0x1042D}, /* 1042C */
+ {0x10406,0x1042E},{0x10407,0x1042F}, /* 1042E */
+ {0x10408,0x10430},{0x10409,0x10431}, /* 10430 */
+ {0x1040A,0x10432},{0x1040B,0x10433}, /* 10432 */
+ {0x1040C,0x10434},{0x1040D,0x10435}, /* 10434 */
+ {0x1040E,0x10436},{0x1040F,0x10437}, /* 10436 */
+ {0x10410,0x10438},{0x10411,0x10439}, /* 10438 */
+ {0x10412,0x1043A},{0x10413,0x1043B}, /* 1043A */
+ {0x10414,0x1043C},{0x10415,0x1043D}, /* 1043C */
+ {0x10416,0x1043E},{0x10417,0x1043F}, /* 1043E */
+ {0x10418,0x10440},{0x10419,0x10441}, /* 10440 */
+ {0x1041A,0x10442},{0x1041B,0x10443}, /* 10442 */
+ {0x1041C,0x10444},{0x1041D,0x10445}, /* 10444 */
+ {0x1041E,0x10446},{0x1041F,0x10447}, /* 10446 */
+ {0x10420,0x10448},{0x10421,0x10449}, /* 10448 */
+ {0x10422,0x1044A},{0x10423,0x1044B}, /* 1044A */
+ {0x10424,0x1044C},{0x10425,0x1044D}, /* 1044C */
+ {0x10426,0x1044E},{0x10427,0x1044F}, /* 1044E */
+ {0x10450,0x10450},{0x10451,0x10451}, /* 10450 */
+ {0x10452,0x10452},{0x10453,0x10453}, /* 10452 */
+ {0x10454,0x10454},{0x10455,0x10455}, /* 10454 */
+ {0x10456,0x10456},{0x10457,0x10457}, /* 10456 */
+ {0x10458,0x10458},{0x10459,0x10459}, /* 10458 */
+ {0x1045A,0x1045A},{0x1045B,0x1045B}, /* 1045A */
+ {0x1045C,0x1045C},{0x1045D,0x1045D}, /* 1045C */
+ {0x1045E,0x1045E},{0x1045F,0x1045F}, /* 1045E */
+ {0x10460,0x10460},{0x10461,0x10461}, /* 10460 */
+ {0x10462,0x10462},{0x10463,0x10463}, /* 10462 */
+ {0x10464,0x10464},{0x10465,0x10465}, /* 10464 */
+ {0x10466,0x10466},{0x10467,0x10467}, /* 10466 */
+ {0x10468,0x10468},{0x10469,0x10469}, /* 10468 */
+ {0x1046A,0x1046A},{0x1046B,0x1046B}, /* 1046A */
+ {0x1046C,0x1046C},{0x1046D,0x1046D}, /* 1046C */
+ {0x1046E,0x1046E},{0x1046F,0x1046F}, /* 1046E */
+ {0x10470,0x10470},{0x10471,0x10471}, /* 10470 */
+ {0x10472,0x10472},{0x10473,0x10473}, /* 10472 */
+ {0x10474,0x10474},{0x10475,0x10475}, /* 10474 */
+ {0x10476,0x10476},{0x10477,0x10477}, /* 10476 */
+ {0x10478,0x10478},{0x10479,0x10479}, /* 10478 */
+ {0x1047A,0x1047A},{0x1047B,0x1047B}, /* 1047A */
+ {0x1047C,0x1047C},{0x1047D,0x1047D}, /* 1047C */
+ {0x1047E,0x1047E},{0x1047F,0x1047F}, /* 1047E */
+ {0x10480,0x10480},{0x10481,0x10481}, /* 10480 */
+ {0x10482,0x10482},{0x10483,0x10483}, /* 10482 */
+ {0x10484,0x10484},{0x10485,0x10485}, /* 10484 */
+ {0x10486,0x10486},{0x10487,0x10487}, /* 10486 */
+ {0x10488,0x10488},{0x10489,0x10489}, /* 10488 */
+ {0x1048A,0x1048A},{0x1048B,0x1048B}, /* 1048A */
+ {0x1048C,0x1048C},{0x1048D,0x1048D}, /* 1048C */
+ {0x1048E,0x1048E},{0x1048F,0x1048F}, /* 1048E */
+ {0x10490,0x10490},{0x10491,0x10491}, /* 10490 */
+ {0x10492,0x10492},{0x10493,0x10493}, /* 10492 */
+ {0x10494,0x10494},{0x10495,0x10495}, /* 10494 */
+ {0x10496,0x10496},{0x10497,0x10497}, /* 10496 */
+ {0x10498,0x10498},{0x10499,0x10499}, /* 10498 */
+ {0x1049A,0x1049A},{0x1049B,0x1049B}, /* 1049A */
+ {0x1049C,0x1049C},{0x1049D,0x1049D}, /* 1049C */
+ {0x1049E,0x1049E},{0x1049F,0x1049F}, /* 1049E */
+ {0x104A0,0x104A0},{0x104A1,0x104A1}, /* 104A0 */
+ {0x104A2,0x104A2},{0x104A3,0x104A3}, /* 104A2 */
+ {0x104A4,0x104A4},{0x104A5,0x104A5}, /* 104A4 */
+ {0x104A6,0x104A6},{0x104A7,0x104A7}, /* 104A6 */
+ {0x104A8,0x104A8},{0x104A9,0x104A9}, /* 104A8 */
+ {0x104AA,0x104AA},{0x104AB,0x104AB}, /* 104AA */
+ {0x104AC,0x104AC},{0x104AD,0x104AD}, /* 104AC */
+ {0x104AE,0x104AE},{0x104AF,0x104AF}, /* 104AE */
+ {0x104B0,0x104D8},{0x104B1,0x104D9}, /* 104B0 */
+ {0x104B2,0x104DA},{0x104B3,0x104DB}, /* 104B2 */
+ {0x104B4,0x104DC},{0x104B5,0x104DD}, /* 104B4 */
+ {0x104B6,0x104DE},{0x104B7,0x104DF}, /* 104B6 */
+ {0x104B8,0x104E0},{0x104B9,0x104E1}, /* 104B8 */
+ {0x104BA,0x104E2},{0x104BB,0x104E3}, /* 104BA */
+ {0x104BC,0x104E4},{0x104BD,0x104E5}, /* 104BC */
+ {0x104BE,0x104E6},{0x104BF,0x104E7}, /* 104BE */
+ {0x104C0,0x104E8},{0x104C1,0x104E9}, /* 104C0 */
+ {0x104C2,0x104EA},{0x104C3,0x104EB}, /* 104C2 */
+ {0x104C4,0x104EC},{0x104C5,0x104ED}, /* 104C4 */
+ {0x104C6,0x104EE},{0x104C7,0x104EF}, /* 104C6 */
+ {0x104C8,0x104F0},{0x104C9,0x104F1}, /* 104C8 */
+ {0x104CA,0x104F2},{0x104CB,0x104F3}, /* 104CA */
+ {0x104CC,0x104F4},{0x104CD,0x104F5}, /* 104CC */
+ {0x104CE,0x104F6},{0x104CF,0x104F7}, /* 104CE */
+ {0x104D0,0x104F8},{0x104D1,0x104F9}, /* 104D0 */
+ {0x104D2,0x104FA},{0x104D3,0x104FB}, /* 104D2 */
+ {0x104D4,0x104D4},{0x104D5,0x104D5}, /* 104D4 */
+ {0x104D6,0x104D6},{0x104D7,0x104D7}, /* 104D6 */
+ {0x104B0,0x104D8},{0x104B1,0x104D9}, /* 104D8 */
+ {0x104B2,0x104DA},{0x104B3,0x104DB}, /* 104DA */
+ {0x104B4,0x104DC},{0x104B5,0x104DD}, /* 104DC */
+ {0x104B6,0x104DE},{0x104B7,0x104DF}, /* 104DE */
+ {0x104B8,0x104E0},{0x104B9,0x104E1}, /* 104E0 */
+ {0x104BA,0x104E2},{0x104BB,0x104E3}, /* 104E2 */
+ {0x104BC,0x104E4},{0x104BD,0x104E5}, /* 104E4 */
+ {0x104BE,0x104E6},{0x104BF,0x104E7}, /* 104E6 */
+ {0x104C0,0x104E8},{0x104C1,0x104E9}, /* 104E8 */
+ {0x104C2,0x104EA},{0x104C3,0x104EB}, /* 104EA */
+ {0x104C4,0x104EC},{0x104C5,0x104ED}, /* 104EC */
+ {0x104C6,0x104EE},{0x104C7,0x104EF}, /* 104EE */
+ {0x104C8,0x104F0},{0x104C9,0x104F1}, /* 104F0 */
+ {0x104CA,0x104F2},{0x104CB,0x104F3}, /* 104F2 */
+ {0x104CC,0x104F4},{0x104CD,0x104F5}, /* 104F4 */
+ {0x104CE,0x104F6},{0x104CF,0x104F7}, /* 104F6 */
+ {0x104D0,0x104F8},{0x104D1,0x104F9}, /* 104F8 */
+ {0x104D2,0x104FA},{0x104D3,0x104FB}, /* 104FA */
+ {0x104FC,0x104FC},{0x104FD,0x104FD}, /* 104FC */
+ {0x104FE,0x104FE},{0x104FF,0x104FF} /* 104FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page105[256]={
+ {0x10500,0x10500},{0x10501,0x10501}, /* 10500 */
+ {0x10502,0x10502},{0x10503,0x10503}, /* 10502 */
+ {0x10504,0x10504},{0x10505,0x10505}, /* 10504 */
+ {0x10506,0x10506},{0x10507,0x10507}, /* 10506 */
+ {0x10508,0x10508},{0x10509,0x10509}, /* 10508 */
+ {0x1050A,0x1050A},{0x1050B,0x1050B}, /* 1050A */
+ {0x1050C,0x1050C},{0x1050D,0x1050D}, /* 1050C */
+ {0x1050E,0x1050E},{0x1050F,0x1050F}, /* 1050E */
+ {0x10510,0x10510},{0x10511,0x10511}, /* 10510 */
+ {0x10512,0x10512},{0x10513,0x10513}, /* 10512 */
+ {0x10514,0x10514},{0x10515,0x10515}, /* 10514 */
+ {0x10516,0x10516},{0x10517,0x10517}, /* 10516 */
+ {0x10518,0x10518},{0x10519,0x10519}, /* 10518 */
+ {0x1051A,0x1051A},{0x1051B,0x1051B}, /* 1051A */
+ {0x1051C,0x1051C},{0x1051D,0x1051D}, /* 1051C */
+ {0x1051E,0x1051E},{0x1051F,0x1051F}, /* 1051E */
+ {0x10520,0x10520},{0x10521,0x10521}, /* 10520 */
+ {0x10522,0x10522},{0x10523,0x10523}, /* 10522 */
+ {0x10524,0x10524},{0x10525,0x10525}, /* 10524 */
+ {0x10526,0x10526},{0x10527,0x10527}, /* 10526 */
+ {0x10528,0x10528},{0x10529,0x10529}, /* 10528 */
+ {0x1052A,0x1052A},{0x1052B,0x1052B}, /* 1052A */
+ {0x1052C,0x1052C},{0x1052D,0x1052D}, /* 1052C */
+ {0x1052E,0x1052E},{0x1052F,0x1052F}, /* 1052E */
+ {0x10530,0x10530},{0x10531,0x10531}, /* 10530 */
+ {0x10532,0x10532},{0x10533,0x10533}, /* 10532 */
+ {0x10534,0x10534},{0x10535,0x10535}, /* 10534 */
+ {0x10536,0x10536},{0x10537,0x10537}, /* 10536 */
+ {0x10538,0x10538},{0x10539,0x10539}, /* 10538 */
+ {0x1053A,0x1053A},{0x1053B,0x1053B}, /* 1053A */
+ {0x1053C,0x1053C},{0x1053D,0x1053D}, /* 1053C */
+ {0x1053E,0x1053E},{0x1053F,0x1053F}, /* 1053E */
+ {0x10540,0x10540},{0x10541,0x10541}, /* 10540 */
+ {0x10542,0x10542},{0x10543,0x10543}, /* 10542 */
+ {0x10544,0x10544},{0x10545,0x10545}, /* 10544 */
+ {0x10546,0x10546},{0x10547,0x10547}, /* 10546 */
+ {0x10548,0x10548},{0x10549,0x10549}, /* 10548 */
+ {0x1054A,0x1054A},{0x1054B,0x1054B}, /* 1054A */
+ {0x1054C,0x1054C},{0x1054D,0x1054D}, /* 1054C */
+ {0x1054E,0x1054E},{0x1054F,0x1054F}, /* 1054E */
+ {0x10550,0x10550},{0x10551,0x10551}, /* 10550 */
+ {0x10552,0x10552},{0x10553,0x10553}, /* 10552 */
+ {0x10554,0x10554},{0x10555,0x10555}, /* 10554 */
+ {0x10556,0x10556},{0x10557,0x10557}, /* 10556 */
+ {0x10558,0x10558},{0x10559,0x10559}, /* 10558 */
+ {0x1055A,0x1055A},{0x1055B,0x1055B}, /* 1055A */
+ {0x1055C,0x1055C},{0x1055D,0x1055D}, /* 1055C */
+ {0x1055E,0x1055E},{0x1055F,0x1055F}, /* 1055E */
+ {0x10560,0x10560},{0x10561,0x10561}, /* 10560 */
+ {0x10562,0x10562},{0x10563,0x10563}, /* 10562 */
+ {0x10564,0x10564},{0x10565,0x10565}, /* 10564 */
+ {0x10566,0x10566},{0x10567,0x10567}, /* 10566 */
+ {0x10568,0x10568},{0x10569,0x10569}, /* 10568 */
+ {0x1056A,0x1056A},{0x1056B,0x1056B}, /* 1056A */
+ {0x1056C,0x1056C},{0x1056D,0x1056D}, /* 1056C */
+ {0x1056E,0x1056E},{0x1056F,0x1056F}, /* 1056E */
+ {0x10570,0x10597},{0x10571,0x10598}, /* 10570 */
+ {0x10572,0x10599},{0x10573,0x1059A}, /* 10572 */
+ {0x10574,0x1059B},{0x10575,0x1059C}, /* 10574 */
+ {0x10576,0x1059D},{0x10577,0x1059E}, /* 10576 */
+ {0x10578,0x1059F},{0x10579,0x105A0}, /* 10578 */
+ {0x1057A,0x105A1},{0x1057B,0x1057B}, /* 1057A */
+ {0x1057C,0x105A3},{0x1057D,0x105A4}, /* 1057C */
+ {0x1057E,0x105A5},{0x1057F,0x105A6}, /* 1057E */
+ {0x10580,0x105A7},{0x10581,0x105A8}, /* 10580 */
+ {0x10582,0x105A9},{0x10583,0x105AA}, /* 10582 */
+ {0x10584,0x105AB},{0x10585,0x105AC}, /* 10584 */
+ {0x10586,0x105AD},{0x10587,0x105AE}, /* 10586 */
+ {0x10588,0x105AF},{0x10589,0x105B0}, /* 10588 */
+ {0x1058A,0x105B1},{0x1058B,0x1058B}, /* 1058A */
+ {0x1058C,0x105B3},{0x1058D,0x105B4}, /* 1058C */
+ {0x1058E,0x105B5},{0x1058F,0x105B6}, /* 1058E */
+ {0x10590,0x105B7},{0x10591,0x105B8}, /* 10590 */
+ {0x10592,0x105B9},{0x10593,0x10593}, /* 10592 */
+ {0x10594,0x105BB},{0x10595,0x105BC}, /* 10594 */
+ {0x10596,0x10596},{0x10570,0x10597}, /* 10596 */
+ {0x10571,0x10598},{0x10572,0x10599}, /* 10598 */
+ {0x10573,0x1059A},{0x10574,0x1059B}, /* 1059A */
+ {0x10575,0x1059C},{0x10576,0x1059D}, /* 1059C */
+ {0x10577,0x1059E},{0x10578,0x1059F}, /* 1059E */
+ {0x10579,0x105A0},{0x1057A,0x105A1}, /* 105A0 */
+ {0x105A2,0x105A2},{0x1057C,0x105A3}, /* 105A2 */
+ {0x1057D,0x105A4},{0x1057E,0x105A5}, /* 105A4 */
+ {0x1057F,0x105A6},{0x10580,0x105A7}, /* 105A6 */
+ {0x10581,0x105A8},{0x10582,0x105A9}, /* 105A8 */
+ {0x10583,0x105AA},{0x10584,0x105AB}, /* 105AA */
+ {0x10585,0x105AC},{0x10586,0x105AD}, /* 105AC */
+ {0x10587,0x105AE},{0x10588,0x105AF}, /* 105AE */
+ {0x10589,0x105B0},{0x1058A,0x105B1}, /* 105B0 */
+ {0x105B2,0x105B2},{0x1058C,0x105B3}, /* 105B2 */
+ {0x1058D,0x105B4},{0x1058E,0x105B5}, /* 105B4 */
+ {0x1058F,0x105B6},{0x10590,0x105B7}, /* 105B6 */
+ {0x10591,0x105B8},{0x10592,0x105B9}, /* 105B8 */
+ {0x105BA,0x105BA},{0x10594,0x105BB}, /* 105BA */
+ {0x10595,0x105BC},{0x105BD,0x105BD}, /* 105BC */
+ {0x105BE,0x105BE},{0x105BF,0x105BF}, /* 105BE */
+ {0x105C0,0x105C0},{0x105C1,0x105C1}, /* 105C0 */
+ {0x105C2,0x105C2},{0x105C3,0x105C3}, /* 105C2 */
+ {0x105C4,0x105C4},{0x105C5,0x105C5}, /* 105C4 */
+ {0x105C6,0x105C6},{0x105C7,0x105C7}, /* 105C6 */
+ {0x105C8,0x105C8},{0x105C9,0x105C9}, /* 105C8 */
+ {0x105CA,0x105CA},{0x105CB,0x105CB}, /* 105CA */
+ {0x105CC,0x105CC},{0x105CD,0x105CD}, /* 105CC */
+ {0x105CE,0x105CE},{0x105CF,0x105CF}, /* 105CE */
+ {0x105D0,0x105D0},{0x105D1,0x105D1}, /* 105D0 */
+ {0x105D2,0x105D2},{0x105D3,0x105D3}, /* 105D2 */
+ {0x105D4,0x105D4},{0x105D5,0x105D5}, /* 105D4 */
+ {0x105D6,0x105D6},{0x105D7,0x105D7}, /* 105D6 */
+ {0x105D8,0x105D8},{0x105D9,0x105D9}, /* 105D8 */
+ {0x105DA,0x105DA},{0x105DB,0x105DB}, /* 105DA */
+ {0x105DC,0x105DC},{0x105DD,0x105DD}, /* 105DC */
+ {0x105DE,0x105DE},{0x105DF,0x105DF}, /* 105DE */
+ {0x105E0,0x105E0},{0x105E1,0x105E1}, /* 105E0 */
+ {0x105E2,0x105E2},{0x105E3,0x105E3}, /* 105E2 */
+ {0x105E4,0x105E4},{0x105E5,0x105E5}, /* 105E4 */
+ {0x105E6,0x105E6},{0x105E7,0x105E7}, /* 105E6 */
+ {0x105E8,0x105E8},{0x105E9,0x105E9}, /* 105E8 */
+ {0x105EA,0x105EA},{0x105EB,0x105EB}, /* 105EA */
+ {0x105EC,0x105EC},{0x105ED,0x105ED}, /* 105EC */
+ {0x105EE,0x105EE},{0x105EF,0x105EF}, /* 105EE */
+ {0x105F0,0x105F0},{0x105F1,0x105F1}, /* 105F0 */
+ {0x105F2,0x105F2},{0x105F3,0x105F3}, /* 105F2 */
+ {0x105F4,0x105F4},{0x105F5,0x105F5}, /* 105F4 */
+ {0x105F6,0x105F6},{0x105F7,0x105F7}, /* 105F6 */
+ {0x105F8,0x105F8},{0x105F9,0x105F9}, /* 105F8 */
+ {0x105FA,0x105FA},{0x105FB,0x105FB}, /* 105FA */
+ {0x105FC,0x105FC},{0x105FD,0x105FD}, /* 105FC */
+ {0x105FE,0x105FE},{0x105FF,0x105FF} /* 105FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page10C[256]={
+ {0x10C00,0x10C00},{0x10C01,0x10C01}, /* 10C00 */
+ {0x10C02,0x10C02},{0x10C03,0x10C03}, /* 10C02 */
+ {0x10C04,0x10C04},{0x10C05,0x10C05}, /* 10C04 */
+ {0x10C06,0x10C06},{0x10C07,0x10C07}, /* 10C06 */
+ {0x10C08,0x10C08},{0x10C09,0x10C09}, /* 10C08 */
+ {0x10C0A,0x10C0A},{0x10C0B,0x10C0B}, /* 10C0A */
+ {0x10C0C,0x10C0C},{0x10C0D,0x10C0D}, /* 10C0C */
+ {0x10C0E,0x10C0E},{0x10C0F,0x10C0F}, /* 10C0E */
+ {0x10C10,0x10C10},{0x10C11,0x10C11}, /* 10C10 */
+ {0x10C12,0x10C12},{0x10C13,0x10C13}, /* 10C12 */
+ {0x10C14,0x10C14},{0x10C15,0x10C15}, /* 10C14 */
+ {0x10C16,0x10C16},{0x10C17,0x10C17}, /* 10C16 */
+ {0x10C18,0x10C18},{0x10C19,0x10C19}, /* 10C18 */
+ {0x10C1A,0x10C1A},{0x10C1B,0x10C1B}, /* 10C1A */
+ {0x10C1C,0x10C1C},{0x10C1D,0x10C1D}, /* 10C1C */
+ {0x10C1E,0x10C1E},{0x10C1F,0x10C1F}, /* 10C1E */
+ {0x10C20,0x10C20},{0x10C21,0x10C21}, /* 10C20 */
+ {0x10C22,0x10C22},{0x10C23,0x10C23}, /* 10C22 */
+ {0x10C24,0x10C24},{0x10C25,0x10C25}, /* 10C24 */
+ {0x10C26,0x10C26},{0x10C27,0x10C27}, /* 10C26 */
+ {0x10C28,0x10C28},{0x10C29,0x10C29}, /* 10C28 */
+ {0x10C2A,0x10C2A},{0x10C2B,0x10C2B}, /* 10C2A */
+ {0x10C2C,0x10C2C},{0x10C2D,0x10C2D}, /* 10C2C */
+ {0x10C2E,0x10C2E},{0x10C2F,0x10C2F}, /* 10C2E */
+ {0x10C30,0x10C30},{0x10C31,0x10C31}, /* 10C30 */
+ {0x10C32,0x10C32},{0x10C33,0x10C33}, /* 10C32 */
+ {0x10C34,0x10C34},{0x10C35,0x10C35}, /* 10C34 */
+ {0x10C36,0x10C36},{0x10C37,0x10C37}, /* 10C36 */
+ {0x10C38,0x10C38},{0x10C39,0x10C39}, /* 10C38 */
+ {0x10C3A,0x10C3A},{0x10C3B,0x10C3B}, /* 10C3A */
+ {0x10C3C,0x10C3C},{0x10C3D,0x10C3D}, /* 10C3C */
+ {0x10C3E,0x10C3E},{0x10C3F,0x10C3F}, /* 10C3E */
+ {0x10C40,0x10C40},{0x10C41,0x10C41}, /* 10C40 */
+ {0x10C42,0x10C42},{0x10C43,0x10C43}, /* 10C42 */
+ {0x10C44,0x10C44},{0x10C45,0x10C45}, /* 10C44 */
+ {0x10C46,0x10C46},{0x10C47,0x10C47}, /* 10C46 */
+ {0x10C48,0x10C48},{0x10C49,0x10C49}, /* 10C48 */
+ {0x10C4A,0x10C4A},{0x10C4B,0x10C4B}, /* 10C4A */
+ {0x10C4C,0x10C4C},{0x10C4D,0x10C4D}, /* 10C4C */
+ {0x10C4E,0x10C4E},{0x10C4F,0x10C4F}, /* 10C4E */
+ {0x10C50,0x10C50},{0x10C51,0x10C51}, /* 10C50 */
+ {0x10C52,0x10C52},{0x10C53,0x10C53}, /* 10C52 */
+ {0x10C54,0x10C54},{0x10C55,0x10C55}, /* 10C54 */
+ {0x10C56,0x10C56},{0x10C57,0x10C57}, /* 10C56 */
+ {0x10C58,0x10C58},{0x10C59,0x10C59}, /* 10C58 */
+ {0x10C5A,0x10C5A},{0x10C5B,0x10C5B}, /* 10C5A */
+ {0x10C5C,0x10C5C},{0x10C5D,0x10C5D}, /* 10C5C */
+ {0x10C5E,0x10C5E},{0x10C5F,0x10C5F}, /* 10C5E */
+ {0x10C60,0x10C60},{0x10C61,0x10C61}, /* 10C60 */
+ {0x10C62,0x10C62},{0x10C63,0x10C63}, /* 10C62 */
+ {0x10C64,0x10C64},{0x10C65,0x10C65}, /* 10C64 */
+ {0x10C66,0x10C66},{0x10C67,0x10C67}, /* 10C66 */
+ {0x10C68,0x10C68},{0x10C69,0x10C69}, /* 10C68 */
+ {0x10C6A,0x10C6A},{0x10C6B,0x10C6B}, /* 10C6A */
+ {0x10C6C,0x10C6C},{0x10C6D,0x10C6D}, /* 10C6C */
+ {0x10C6E,0x10C6E},{0x10C6F,0x10C6F}, /* 10C6E */
+ {0x10C70,0x10C70},{0x10C71,0x10C71}, /* 10C70 */
+ {0x10C72,0x10C72},{0x10C73,0x10C73}, /* 10C72 */
+ {0x10C74,0x10C74},{0x10C75,0x10C75}, /* 10C74 */
+ {0x10C76,0x10C76},{0x10C77,0x10C77}, /* 10C76 */
+ {0x10C78,0x10C78},{0x10C79,0x10C79}, /* 10C78 */
+ {0x10C7A,0x10C7A},{0x10C7B,0x10C7B}, /* 10C7A */
+ {0x10C7C,0x10C7C},{0x10C7D,0x10C7D}, /* 10C7C */
+ {0x10C7E,0x10C7E},{0x10C7F,0x10C7F}, /* 10C7E */
+ {0x10C80,0x10CC0},{0x10C81,0x10CC1}, /* 10C80 */
+ {0x10C82,0x10CC2},{0x10C83,0x10CC3}, /* 10C82 */
+ {0x10C84,0x10CC4},{0x10C85,0x10CC5}, /* 10C84 */
+ {0x10C86,0x10CC6},{0x10C87,0x10CC7}, /* 10C86 */
+ {0x10C88,0x10CC8},{0x10C89,0x10CC9}, /* 10C88 */
+ {0x10C8A,0x10CCA},{0x10C8B,0x10CCB}, /* 10C8A */
+ {0x10C8C,0x10CCC},{0x10C8D,0x10CCD}, /* 10C8C */
+ {0x10C8E,0x10CCE},{0x10C8F,0x10CCF}, /* 10C8E */
+ {0x10C90,0x10CD0},{0x10C91,0x10CD1}, /* 10C90 */
+ {0x10C92,0x10CD2},{0x10C93,0x10CD3}, /* 10C92 */
+ {0x10C94,0x10CD4},{0x10C95,0x10CD5}, /* 10C94 */
+ {0x10C96,0x10CD6},{0x10C97,0x10CD7}, /* 10C96 */
+ {0x10C98,0x10CD8},{0x10C99,0x10CD9}, /* 10C98 */
+ {0x10C9A,0x10CDA},{0x10C9B,0x10CDB}, /* 10C9A */
+ {0x10C9C,0x10CDC},{0x10C9D,0x10CDD}, /* 10C9C */
+ {0x10C9E,0x10CDE},{0x10C9F,0x10CDF}, /* 10C9E */
+ {0x10CA0,0x10CE0},{0x10CA1,0x10CE1}, /* 10CA0 */
+ {0x10CA2,0x10CE2},{0x10CA3,0x10CE3}, /* 10CA2 */
+ {0x10CA4,0x10CE4},{0x10CA5,0x10CE5}, /* 10CA4 */
+ {0x10CA6,0x10CE6},{0x10CA7,0x10CE7}, /* 10CA6 */
+ {0x10CA8,0x10CE8},{0x10CA9,0x10CE9}, /* 10CA8 */
+ {0x10CAA,0x10CEA},{0x10CAB,0x10CEB}, /* 10CAA */
+ {0x10CAC,0x10CEC},{0x10CAD,0x10CED}, /* 10CAC */
+ {0x10CAE,0x10CEE},{0x10CAF,0x10CEF}, /* 10CAE */
+ {0x10CB0,0x10CF0},{0x10CB1,0x10CF1}, /* 10CB0 */
+ {0x10CB2,0x10CF2},{0x10CB3,0x10CB3}, /* 10CB2 */
+ {0x10CB4,0x10CB4},{0x10CB5,0x10CB5}, /* 10CB4 */
+ {0x10CB6,0x10CB6},{0x10CB7,0x10CB7}, /* 10CB6 */
+ {0x10CB8,0x10CB8},{0x10CB9,0x10CB9}, /* 10CB8 */
+ {0x10CBA,0x10CBA},{0x10CBB,0x10CBB}, /* 10CBA */
+ {0x10CBC,0x10CBC},{0x10CBD,0x10CBD}, /* 10CBC */
+ {0x10CBE,0x10CBE},{0x10CBF,0x10CBF}, /* 10CBE */
+ {0x10C80,0x10CC0},{0x10C81,0x10CC1}, /* 10CC0 */
+ {0x10C82,0x10CC2},{0x10C83,0x10CC3}, /* 10CC2 */
+ {0x10C84,0x10CC4},{0x10C85,0x10CC5}, /* 10CC4 */
+ {0x10C86,0x10CC6},{0x10C87,0x10CC7}, /* 10CC6 */
+ {0x10C88,0x10CC8},{0x10C89,0x10CC9}, /* 10CC8 */
+ {0x10C8A,0x10CCA},{0x10C8B,0x10CCB}, /* 10CCA */
+ {0x10C8C,0x10CCC},{0x10C8D,0x10CCD}, /* 10CCC */
+ {0x10C8E,0x10CCE},{0x10C8F,0x10CCF}, /* 10CCE */
+ {0x10C90,0x10CD0},{0x10C91,0x10CD1}, /* 10CD0 */
+ {0x10C92,0x10CD2},{0x10C93,0x10CD3}, /* 10CD2 */
+ {0x10C94,0x10CD4},{0x10C95,0x10CD5}, /* 10CD4 */
+ {0x10C96,0x10CD6},{0x10C97,0x10CD7}, /* 10CD6 */
+ {0x10C98,0x10CD8},{0x10C99,0x10CD9}, /* 10CD8 */
+ {0x10C9A,0x10CDA},{0x10C9B,0x10CDB}, /* 10CDA */
+ {0x10C9C,0x10CDC},{0x10C9D,0x10CDD}, /* 10CDC */
+ {0x10C9E,0x10CDE},{0x10C9F,0x10CDF}, /* 10CDE */
+ {0x10CA0,0x10CE0},{0x10CA1,0x10CE1}, /* 10CE0 */
+ {0x10CA2,0x10CE2},{0x10CA3,0x10CE3}, /* 10CE2 */
+ {0x10CA4,0x10CE4},{0x10CA5,0x10CE5}, /* 10CE4 */
+ {0x10CA6,0x10CE6},{0x10CA7,0x10CE7}, /* 10CE6 */
+ {0x10CA8,0x10CE8},{0x10CA9,0x10CE9}, /* 10CE8 */
+ {0x10CAA,0x10CEA},{0x10CAB,0x10CEB}, /* 10CEA */
+ {0x10CAC,0x10CEC},{0x10CAD,0x10CED}, /* 10CEC */
+ {0x10CAE,0x10CEE},{0x10CAF,0x10CEF}, /* 10CEE */
+ {0x10CB0,0x10CF0},{0x10CB1,0x10CF1}, /* 10CF0 */
+ {0x10CB2,0x10CF2},{0x10CF3,0x10CF3}, /* 10CF2 */
+ {0x10CF4,0x10CF4},{0x10CF5,0x10CF5}, /* 10CF4 */
+ {0x10CF6,0x10CF6},{0x10CF7,0x10CF7}, /* 10CF6 */
+ {0x10CF8,0x10CF8},{0x10CF9,0x10CF9}, /* 10CF8 */
+ {0x10CFA,0x10CFA},{0x10CFB,0x10CFB}, /* 10CFA */
+ {0x10CFC,0x10CFC},{0x10CFD,0x10CFD}, /* 10CFC */
+ {0x10CFE,0x10CFE},{0x10CFF,0x10CFF} /* 10CFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page118[256]={
+ {0x11800,0x11800},{0x11801,0x11801}, /* 11800 */
+ {0x11802,0x11802},{0x11803,0x11803}, /* 11802 */
+ {0x11804,0x11804},{0x11805,0x11805}, /* 11804 */
+ {0x11806,0x11806},{0x11807,0x11807}, /* 11806 */
+ {0x11808,0x11808},{0x11809,0x11809}, /* 11808 */
+ {0x1180A,0x1180A},{0x1180B,0x1180B}, /* 1180A */
+ {0x1180C,0x1180C},{0x1180D,0x1180D}, /* 1180C */
+ {0x1180E,0x1180E},{0x1180F,0x1180F}, /* 1180E */
+ {0x11810,0x11810},{0x11811,0x11811}, /* 11810 */
+ {0x11812,0x11812},{0x11813,0x11813}, /* 11812 */
+ {0x11814,0x11814},{0x11815,0x11815}, /* 11814 */
+ {0x11816,0x11816},{0x11817,0x11817}, /* 11816 */
+ {0x11818,0x11818},{0x11819,0x11819}, /* 11818 */
+ {0x1181A,0x1181A},{0x1181B,0x1181B}, /* 1181A */
+ {0x1181C,0x1181C},{0x1181D,0x1181D}, /* 1181C */
+ {0x1181E,0x1181E},{0x1181F,0x1181F}, /* 1181E */
+ {0x11820,0x11820},{0x11821,0x11821}, /* 11820 */
+ {0x11822,0x11822},{0x11823,0x11823}, /* 11822 */
+ {0x11824,0x11824},{0x11825,0x11825}, /* 11824 */
+ {0x11826,0x11826},{0x11827,0x11827}, /* 11826 */
+ {0x11828,0x11828},{0x11829,0x11829}, /* 11828 */
+ {0x1182A,0x1182A},{0x1182B,0x1182B}, /* 1182A */
+ {0x1182C,0x1182C},{0x1182D,0x1182D}, /* 1182C */
+ {0x1182E,0x1182E},{0x1182F,0x1182F}, /* 1182E */
+ {0x11830,0x11830},{0x11831,0x11831}, /* 11830 */
+ {0x11832,0x11832},{0x11833,0x11833}, /* 11832 */
+ {0x11834,0x11834},{0x11835,0x11835}, /* 11834 */
+ {0x11836,0x11836},{0x11837,0x11837}, /* 11836 */
+ {0x11838,0x11838},{0x11839,0x11839}, /* 11838 */
+ {0x1183A,0x1183A},{0x1183B,0x1183B}, /* 1183A */
+ {0x1183C,0x1183C},{0x1183D,0x1183D}, /* 1183C */
+ {0x1183E,0x1183E},{0x1183F,0x1183F}, /* 1183E */
+ {0x11840,0x11840},{0x11841,0x11841}, /* 11840 */
+ {0x11842,0x11842},{0x11843,0x11843}, /* 11842 */
+ {0x11844,0x11844},{0x11845,0x11845}, /* 11844 */
+ {0x11846,0x11846},{0x11847,0x11847}, /* 11846 */
+ {0x11848,0x11848},{0x11849,0x11849}, /* 11848 */
+ {0x1184A,0x1184A},{0x1184B,0x1184B}, /* 1184A */
+ {0x1184C,0x1184C},{0x1184D,0x1184D}, /* 1184C */
+ {0x1184E,0x1184E},{0x1184F,0x1184F}, /* 1184E */
+ {0x11850,0x11850},{0x11851,0x11851}, /* 11850 */
+ {0x11852,0x11852},{0x11853,0x11853}, /* 11852 */
+ {0x11854,0x11854},{0x11855,0x11855}, /* 11854 */
+ {0x11856,0x11856},{0x11857,0x11857}, /* 11856 */
+ {0x11858,0x11858},{0x11859,0x11859}, /* 11858 */
+ {0x1185A,0x1185A},{0x1185B,0x1185B}, /* 1185A */
+ {0x1185C,0x1185C},{0x1185D,0x1185D}, /* 1185C */
+ {0x1185E,0x1185E},{0x1185F,0x1185F}, /* 1185E */
+ {0x11860,0x11860},{0x11861,0x11861}, /* 11860 */
+ {0x11862,0x11862},{0x11863,0x11863}, /* 11862 */
+ {0x11864,0x11864},{0x11865,0x11865}, /* 11864 */
+ {0x11866,0x11866},{0x11867,0x11867}, /* 11866 */
+ {0x11868,0x11868},{0x11869,0x11869}, /* 11868 */
+ {0x1186A,0x1186A},{0x1186B,0x1186B}, /* 1186A */
+ {0x1186C,0x1186C},{0x1186D,0x1186D}, /* 1186C */
+ {0x1186E,0x1186E},{0x1186F,0x1186F}, /* 1186E */
+ {0x11870,0x11870},{0x11871,0x11871}, /* 11870 */
+ {0x11872,0x11872},{0x11873,0x11873}, /* 11872 */
+ {0x11874,0x11874},{0x11875,0x11875}, /* 11874 */
+ {0x11876,0x11876},{0x11877,0x11877}, /* 11876 */
+ {0x11878,0x11878},{0x11879,0x11879}, /* 11878 */
+ {0x1187A,0x1187A},{0x1187B,0x1187B}, /* 1187A */
+ {0x1187C,0x1187C},{0x1187D,0x1187D}, /* 1187C */
+ {0x1187E,0x1187E},{0x1187F,0x1187F}, /* 1187E */
+ {0x11880,0x11880},{0x11881,0x11881}, /* 11880 */
+ {0x11882,0x11882},{0x11883,0x11883}, /* 11882 */
+ {0x11884,0x11884},{0x11885,0x11885}, /* 11884 */
+ {0x11886,0x11886},{0x11887,0x11887}, /* 11886 */
+ {0x11888,0x11888},{0x11889,0x11889}, /* 11888 */
+ {0x1188A,0x1188A},{0x1188B,0x1188B}, /* 1188A */
+ {0x1188C,0x1188C},{0x1188D,0x1188D}, /* 1188C */
+ {0x1188E,0x1188E},{0x1188F,0x1188F}, /* 1188E */
+ {0x11890,0x11890},{0x11891,0x11891}, /* 11890 */
+ {0x11892,0x11892},{0x11893,0x11893}, /* 11892 */
+ {0x11894,0x11894},{0x11895,0x11895}, /* 11894 */
+ {0x11896,0x11896},{0x11897,0x11897}, /* 11896 */
+ {0x11898,0x11898},{0x11899,0x11899}, /* 11898 */
+ {0x1189A,0x1189A},{0x1189B,0x1189B}, /* 1189A */
+ {0x1189C,0x1189C},{0x1189D,0x1189D}, /* 1189C */
+ {0x1189E,0x1189E},{0x1189F,0x1189F}, /* 1189E */
+ {0x118A0,0x118C0},{0x118A1,0x118C1}, /* 118A0 */
+ {0x118A2,0x118C2},{0x118A3,0x118C3}, /* 118A2 */
+ {0x118A4,0x118C4},{0x118A5,0x118C5}, /* 118A4 */
+ {0x118A6,0x118C6},{0x118A7,0x118C7}, /* 118A6 */
+ {0x118A8,0x118C8},{0x118A9,0x118C9}, /* 118A8 */
+ {0x118AA,0x118CA},{0x118AB,0x118CB}, /* 118AA */
+ {0x118AC,0x118CC},{0x118AD,0x118CD}, /* 118AC */
+ {0x118AE,0x118CE},{0x118AF,0x118CF}, /* 118AE */
+ {0x118B0,0x118D0},{0x118B1,0x118D1}, /* 118B0 */
+ {0x118B2,0x118D2},{0x118B3,0x118D3}, /* 118B2 */
+ {0x118B4,0x118D4},{0x118B5,0x118D5}, /* 118B4 */
+ {0x118B6,0x118D6},{0x118B7,0x118D7}, /* 118B6 */
+ {0x118B8,0x118D8},{0x118B9,0x118D9}, /* 118B8 */
+ {0x118BA,0x118DA},{0x118BB,0x118DB}, /* 118BA */
+ {0x118BC,0x118DC},{0x118BD,0x118DD}, /* 118BC */
+ {0x118BE,0x118DE},{0x118BF,0x118DF}, /* 118BE */
+ {0x118A0,0x118C0},{0x118A1,0x118C1}, /* 118C0 */
+ {0x118A2,0x118C2},{0x118A3,0x118C3}, /* 118C2 */
+ {0x118A4,0x118C4},{0x118A5,0x118C5}, /* 118C4 */
+ {0x118A6,0x118C6},{0x118A7,0x118C7}, /* 118C6 */
+ {0x118A8,0x118C8},{0x118A9,0x118C9}, /* 118C8 */
+ {0x118AA,0x118CA},{0x118AB,0x118CB}, /* 118CA */
+ {0x118AC,0x118CC},{0x118AD,0x118CD}, /* 118CC */
+ {0x118AE,0x118CE},{0x118AF,0x118CF}, /* 118CE */
+ {0x118B0,0x118D0},{0x118B1,0x118D1}, /* 118D0 */
+ {0x118B2,0x118D2},{0x118B3,0x118D3}, /* 118D2 */
+ {0x118B4,0x118D4},{0x118B5,0x118D5}, /* 118D4 */
+ {0x118B6,0x118D6},{0x118B7,0x118D7}, /* 118D6 */
+ {0x118B8,0x118D8},{0x118B9,0x118D9}, /* 118D8 */
+ {0x118BA,0x118DA},{0x118BB,0x118DB}, /* 118DA */
+ {0x118BC,0x118DC},{0x118BD,0x118DD}, /* 118DC */
+ {0x118BE,0x118DE},{0x118BF,0x118DF}, /* 118DE */
+ {0x118E0,0x118E0},{0x118E1,0x118E1}, /* 118E0 */
+ {0x118E2,0x118E2},{0x118E3,0x118E3}, /* 118E2 */
+ {0x118E4,0x118E4},{0x118E5,0x118E5}, /* 118E4 */
+ {0x118E6,0x118E6},{0x118E7,0x118E7}, /* 118E6 */
+ {0x118E8,0x118E8},{0x118E9,0x118E9}, /* 118E8 */
+ {0x118EA,0x118EA},{0x118EB,0x118EB}, /* 118EA */
+ {0x118EC,0x118EC},{0x118ED,0x118ED}, /* 118EC */
+ {0x118EE,0x118EE},{0x118EF,0x118EF}, /* 118EE */
+ {0x118F0,0x118F0},{0x118F1,0x118F1}, /* 118F0 */
+ {0x118F2,0x118F2},{0x118F3,0x118F3}, /* 118F2 */
+ {0x118F4,0x118F4},{0x118F5,0x118F5}, /* 118F4 */
+ {0x118F6,0x118F6},{0x118F7,0x118F7}, /* 118F6 */
+ {0x118F8,0x118F8},{0x118F9,0x118F9}, /* 118F8 */
+ {0x118FA,0x118FA},{0x118FB,0x118FB}, /* 118FA */
+ {0x118FC,0x118FC},{0x118FD,0x118FD}, /* 118FC */
+ {0x118FE,0x118FE},{0x118FF,0x118FF} /* 118FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page16E[256]={
+ {0x16E00,0x16E00},{0x16E01,0x16E01}, /* 16E00 */
+ {0x16E02,0x16E02},{0x16E03,0x16E03}, /* 16E02 */
+ {0x16E04,0x16E04},{0x16E05,0x16E05}, /* 16E04 */
+ {0x16E06,0x16E06},{0x16E07,0x16E07}, /* 16E06 */
+ {0x16E08,0x16E08},{0x16E09,0x16E09}, /* 16E08 */
+ {0x16E0A,0x16E0A},{0x16E0B,0x16E0B}, /* 16E0A */
+ {0x16E0C,0x16E0C},{0x16E0D,0x16E0D}, /* 16E0C */
+ {0x16E0E,0x16E0E},{0x16E0F,0x16E0F}, /* 16E0E */
+ {0x16E10,0x16E10},{0x16E11,0x16E11}, /* 16E10 */
+ {0x16E12,0x16E12},{0x16E13,0x16E13}, /* 16E12 */
+ {0x16E14,0x16E14},{0x16E15,0x16E15}, /* 16E14 */
+ {0x16E16,0x16E16},{0x16E17,0x16E17}, /* 16E16 */
+ {0x16E18,0x16E18},{0x16E19,0x16E19}, /* 16E18 */
+ {0x16E1A,0x16E1A},{0x16E1B,0x16E1B}, /* 16E1A */
+ {0x16E1C,0x16E1C},{0x16E1D,0x16E1D}, /* 16E1C */
+ {0x16E1E,0x16E1E},{0x16E1F,0x16E1F}, /* 16E1E */
+ {0x16E20,0x16E20},{0x16E21,0x16E21}, /* 16E20 */
+ {0x16E22,0x16E22},{0x16E23,0x16E23}, /* 16E22 */
+ {0x16E24,0x16E24},{0x16E25,0x16E25}, /* 16E24 */
+ {0x16E26,0x16E26},{0x16E27,0x16E27}, /* 16E26 */
+ {0x16E28,0x16E28},{0x16E29,0x16E29}, /* 16E28 */
+ {0x16E2A,0x16E2A},{0x16E2B,0x16E2B}, /* 16E2A */
+ {0x16E2C,0x16E2C},{0x16E2D,0x16E2D}, /* 16E2C */
+ {0x16E2E,0x16E2E},{0x16E2F,0x16E2F}, /* 16E2E */
+ {0x16E30,0x16E30},{0x16E31,0x16E31}, /* 16E30 */
+ {0x16E32,0x16E32},{0x16E33,0x16E33}, /* 16E32 */
+ {0x16E34,0x16E34},{0x16E35,0x16E35}, /* 16E34 */
+ {0x16E36,0x16E36},{0x16E37,0x16E37}, /* 16E36 */
+ {0x16E38,0x16E38},{0x16E39,0x16E39}, /* 16E38 */
+ {0x16E3A,0x16E3A},{0x16E3B,0x16E3B}, /* 16E3A */
+ {0x16E3C,0x16E3C},{0x16E3D,0x16E3D}, /* 16E3C */
+ {0x16E3E,0x16E3E},{0x16E3F,0x16E3F}, /* 16E3E */
+ {0x16E40,0x16E60},{0x16E41,0x16E61}, /* 16E40 */
+ {0x16E42,0x16E62},{0x16E43,0x16E63}, /* 16E42 */
+ {0x16E44,0x16E64},{0x16E45,0x16E65}, /* 16E44 */
+ {0x16E46,0x16E66},{0x16E47,0x16E67}, /* 16E46 */
+ {0x16E48,0x16E68},{0x16E49,0x16E69}, /* 16E48 */
+ {0x16E4A,0x16E6A},{0x16E4B,0x16E6B}, /* 16E4A */
+ {0x16E4C,0x16E6C},{0x16E4D,0x16E6D}, /* 16E4C */
+ {0x16E4E,0x16E6E},{0x16E4F,0x16E6F}, /* 16E4E */
+ {0x16E50,0x16E70},{0x16E51,0x16E71}, /* 16E50 */
+ {0x16E52,0x16E72},{0x16E53,0x16E73}, /* 16E52 */
+ {0x16E54,0x16E74},{0x16E55,0x16E75}, /* 16E54 */
+ {0x16E56,0x16E76},{0x16E57,0x16E77}, /* 16E56 */
+ {0x16E58,0x16E78},{0x16E59,0x16E79}, /* 16E58 */
+ {0x16E5A,0x16E7A},{0x16E5B,0x16E7B}, /* 16E5A */
+ {0x16E5C,0x16E7C},{0x16E5D,0x16E7D}, /* 16E5C */
+ {0x16E5E,0x16E7E},{0x16E5F,0x16E7F}, /* 16E5E */
+ {0x16E40,0x16E60},{0x16E41,0x16E61}, /* 16E60 */
+ {0x16E42,0x16E62},{0x16E43,0x16E63}, /* 16E62 */
+ {0x16E44,0x16E64},{0x16E45,0x16E65}, /* 16E64 */
+ {0x16E46,0x16E66},{0x16E47,0x16E67}, /* 16E66 */
+ {0x16E48,0x16E68},{0x16E49,0x16E69}, /* 16E68 */
+ {0x16E4A,0x16E6A},{0x16E4B,0x16E6B}, /* 16E6A */
+ {0x16E4C,0x16E6C},{0x16E4D,0x16E6D}, /* 16E6C */
+ {0x16E4E,0x16E6E},{0x16E4F,0x16E6F}, /* 16E6E */
+ {0x16E50,0x16E70},{0x16E51,0x16E71}, /* 16E70 */
+ {0x16E52,0x16E72},{0x16E53,0x16E73}, /* 16E72 */
+ {0x16E54,0x16E74},{0x16E55,0x16E75}, /* 16E74 */
+ {0x16E56,0x16E76},{0x16E57,0x16E77}, /* 16E76 */
+ {0x16E58,0x16E78},{0x16E59,0x16E79}, /* 16E78 */
+ {0x16E5A,0x16E7A},{0x16E5B,0x16E7B}, /* 16E7A */
+ {0x16E5C,0x16E7C},{0x16E5D,0x16E7D}, /* 16E7C */
+ {0x16E5E,0x16E7E},{0x16E5F,0x16E7F}, /* 16E7E */
+ {0x16E80,0x16E80},{0x16E81,0x16E81}, /* 16E80 */
+ {0x16E82,0x16E82},{0x16E83,0x16E83}, /* 16E82 */
+ {0x16E84,0x16E84},{0x16E85,0x16E85}, /* 16E84 */
+ {0x16E86,0x16E86},{0x16E87,0x16E87}, /* 16E86 */
+ {0x16E88,0x16E88},{0x16E89,0x16E89}, /* 16E88 */
+ {0x16E8A,0x16E8A},{0x16E8B,0x16E8B}, /* 16E8A */
+ {0x16E8C,0x16E8C},{0x16E8D,0x16E8D}, /* 16E8C */
+ {0x16E8E,0x16E8E},{0x16E8F,0x16E8F}, /* 16E8E */
+ {0x16E90,0x16E90},{0x16E91,0x16E91}, /* 16E90 */
+ {0x16E92,0x16E92},{0x16E93,0x16E93}, /* 16E92 */
+ {0x16E94,0x16E94},{0x16E95,0x16E95}, /* 16E94 */
+ {0x16E96,0x16E96},{0x16E97,0x16E97}, /* 16E96 */
+ {0x16E98,0x16E98},{0x16E99,0x16E99}, /* 16E98 */
+ {0x16E9A,0x16E9A},{0x16E9B,0x16E9B}, /* 16E9A */
+ {0x16E9C,0x16E9C},{0x16E9D,0x16E9D}, /* 16E9C */
+ {0x16E9E,0x16E9E},{0x16E9F,0x16E9F}, /* 16E9E */
+ {0x16EA0,0x16EA0},{0x16EA1,0x16EA1}, /* 16EA0 */
+ {0x16EA2,0x16EA2},{0x16EA3,0x16EA3}, /* 16EA2 */
+ {0x16EA4,0x16EA4},{0x16EA5,0x16EA5}, /* 16EA4 */
+ {0x16EA6,0x16EA6},{0x16EA7,0x16EA7}, /* 16EA6 */
+ {0x16EA8,0x16EA8},{0x16EA9,0x16EA9}, /* 16EA8 */
+ {0x16EAA,0x16EAA},{0x16EAB,0x16EAB}, /* 16EAA */
+ {0x16EAC,0x16EAC},{0x16EAD,0x16EAD}, /* 16EAC */
+ {0x16EAE,0x16EAE},{0x16EAF,0x16EAF}, /* 16EAE */
+ {0x16EB0,0x16EB0},{0x16EB1,0x16EB1}, /* 16EB0 */
+ {0x16EB2,0x16EB2},{0x16EB3,0x16EB3}, /* 16EB2 */
+ {0x16EB4,0x16EB4},{0x16EB5,0x16EB5}, /* 16EB4 */
+ {0x16EB6,0x16EB6},{0x16EB7,0x16EB7}, /* 16EB6 */
+ {0x16EB8,0x16EB8},{0x16EB9,0x16EB9}, /* 16EB8 */
+ {0x16EBA,0x16EBA},{0x16EBB,0x16EBB}, /* 16EBA */
+ {0x16EBC,0x16EBC},{0x16EBD,0x16EBD}, /* 16EBC */
+ {0x16EBE,0x16EBE},{0x16EBF,0x16EBF}, /* 16EBE */
+ {0x16EC0,0x16EC0},{0x16EC1,0x16EC1}, /* 16EC0 */
+ {0x16EC2,0x16EC2},{0x16EC3,0x16EC3}, /* 16EC2 */
+ {0x16EC4,0x16EC4},{0x16EC5,0x16EC5}, /* 16EC4 */
+ {0x16EC6,0x16EC6},{0x16EC7,0x16EC7}, /* 16EC6 */
+ {0x16EC8,0x16EC8},{0x16EC9,0x16EC9}, /* 16EC8 */
+ {0x16ECA,0x16ECA},{0x16ECB,0x16ECB}, /* 16ECA */
+ {0x16ECC,0x16ECC},{0x16ECD,0x16ECD}, /* 16ECC */
+ {0x16ECE,0x16ECE},{0x16ECF,0x16ECF}, /* 16ECE */
+ {0x16ED0,0x16ED0},{0x16ED1,0x16ED1}, /* 16ED0 */
+ {0x16ED2,0x16ED2},{0x16ED3,0x16ED3}, /* 16ED2 */
+ {0x16ED4,0x16ED4},{0x16ED5,0x16ED5}, /* 16ED4 */
+ {0x16ED6,0x16ED6},{0x16ED7,0x16ED7}, /* 16ED6 */
+ {0x16ED8,0x16ED8},{0x16ED9,0x16ED9}, /* 16ED8 */
+ {0x16EDA,0x16EDA},{0x16EDB,0x16EDB}, /* 16EDA */
+ {0x16EDC,0x16EDC},{0x16EDD,0x16EDD}, /* 16EDC */
+ {0x16EDE,0x16EDE},{0x16EDF,0x16EDF}, /* 16EDE */
+ {0x16EE0,0x16EE0},{0x16EE1,0x16EE1}, /* 16EE0 */
+ {0x16EE2,0x16EE2},{0x16EE3,0x16EE3}, /* 16EE2 */
+ {0x16EE4,0x16EE4},{0x16EE5,0x16EE5}, /* 16EE4 */
+ {0x16EE6,0x16EE6},{0x16EE7,0x16EE7}, /* 16EE6 */
+ {0x16EE8,0x16EE8},{0x16EE9,0x16EE9}, /* 16EE8 */
+ {0x16EEA,0x16EEA},{0x16EEB,0x16EEB}, /* 16EEA */
+ {0x16EEC,0x16EEC},{0x16EED,0x16EED}, /* 16EEC */
+ {0x16EEE,0x16EEE},{0x16EEF,0x16EEF}, /* 16EEE */
+ {0x16EF0,0x16EF0},{0x16EF1,0x16EF1}, /* 16EF0 */
+ {0x16EF2,0x16EF2},{0x16EF3,0x16EF3}, /* 16EF2 */
+ {0x16EF4,0x16EF4},{0x16EF5,0x16EF5}, /* 16EF4 */
+ {0x16EF6,0x16EF6},{0x16EF7,0x16EF7}, /* 16EF6 */
+ {0x16EF8,0x16EF8},{0x16EF9,0x16EF9}, /* 16EF8 */
+ {0x16EFA,0x16EFA},{0x16EFB,0x16EFB}, /* 16EFA */
+ {0x16EFC,0x16EFC},{0x16EFD,0x16EFD}, /* 16EFC */
+ {0x16EFE,0x16EFE},{0x16EFF,0x16EFF} /* 16EFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u1400_casefold_page1E9[256]={
+ {0x1E900,0x1E922},{0x1E901,0x1E923}, /* 1E900 */
+ {0x1E902,0x1E924},{0x1E903,0x1E925}, /* 1E902 */
+ {0x1E904,0x1E926},{0x1E905,0x1E927}, /* 1E904 */
+ {0x1E906,0x1E928},{0x1E907,0x1E929}, /* 1E906 */
+ {0x1E908,0x1E92A},{0x1E909,0x1E92B}, /* 1E908 */
+ {0x1E90A,0x1E92C},{0x1E90B,0x1E92D}, /* 1E90A */
+ {0x1E90C,0x1E92E},{0x1E90D,0x1E92F}, /* 1E90C */
+ {0x1E90E,0x1E930},{0x1E90F,0x1E931}, /* 1E90E */
+ {0x1E910,0x1E932},{0x1E911,0x1E933}, /* 1E910 */
+ {0x1E912,0x1E934},{0x1E913,0x1E935}, /* 1E912 */
+ {0x1E914,0x1E936},{0x1E915,0x1E937}, /* 1E914 */
+ {0x1E916,0x1E938},{0x1E917,0x1E939}, /* 1E916 */
+ {0x1E918,0x1E93A},{0x1E919,0x1E93B}, /* 1E918 */
+ {0x1E91A,0x1E93C},{0x1E91B,0x1E93D}, /* 1E91A */
+ {0x1E91C,0x1E93E},{0x1E91D,0x1E93F}, /* 1E91C */
+ {0x1E91E,0x1E940},{0x1E91F,0x1E941}, /* 1E91E */
+ {0x1E920,0x1E942},{0x1E921,0x1E943}, /* 1E920 */
+ {0x1E900,0x1E922},{0x1E901,0x1E923}, /* 1E922 */
+ {0x1E902,0x1E924},{0x1E903,0x1E925}, /* 1E924 */
+ {0x1E904,0x1E926},{0x1E905,0x1E927}, /* 1E926 */
+ {0x1E906,0x1E928},{0x1E907,0x1E929}, /* 1E928 */
+ {0x1E908,0x1E92A},{0x1E909,0x1E92B}, /* 1E92A */
+ {0x1E90A,0x1E92C},{0x1E90B,0x1E92D}, /* 1E92C */
+ {0x1E90C,0x1E92E},{0x1E90D,0x1E92F}, /* 1E92E */
+ {0x1E90E,0x1E930},{0x1E90F,0x1E931}, /* 1E930 */
+ {0x1E910,0x1E932},{0x1E911,0x1E933}, /* 1E932 */
+ {0x1E912,0x1E934},{0x1E913,0x1E935}, /* 1E934 */
+ {0x1E914,0x1E936},{0x1E915,0x1E937}, /* 1E936 */
+ {0x1E916,0x1E938},{0x1E917,0x1E939}, /* 1E938 */
+ {0x1E918,0x1E93A},{0x1E919,0x1E93B}, /* 1E93A */
+ {0x1E91A,0x1E93C},{0x1E91B,0x1E93D}, /* 1E93C */
+ {0x1E91C,0x1E93E},{0x1E91D,0x1E93F}, /* 1E93E */
+ {0x1E91E,0x1E940},{0x1E91F,0x1E941}, /* 1E940 */
+ {0x1E920,0x1E942},{0x1E921,0x1E943}, /* 1E942 */
+ {0x1E944,0x1E944},{0x1E945,0x1E945}, /* 1E944 */
+ {0x1E946,0x1E946},{0x1E947,0x1E947}, /* 1E946 */
+ {0x1E948,0x1E948},{0x1E949,0x1E949}, /* 1E948 */
+ {0x1E94A,0x1E94A},{0x1E94B,0x1E94B}, /* 1E94A */
+ {0x1E94C,0x1E94C},{0x1E94D,0x1E94D}, /* 1E94C */
+ {0x1E94E,0x1E94E},{0x1E94F,0x1E94F}, /* 1E94E */
+ {0x1E950,0x1E950},{0x1E951,0x1E951}, /* 1E950 */
+ {0x1E952,0x1E952},{0x1E953,0x1E953}, /* 1E952 */
+ {0x1E954,0x1E954},{0x1E955,0x1E955}, /* 1E954 */
+ {0x1E956,0x1E956},{0x1E957,0x1E957}, /* 1E956 */
+ {0x1E958,0x1E958},{0x1E959,0x1E959}, /* 1E958 */
+ {0x1E95A,0x1E95A},{0x1E95B,0x1E95B}, /* 1E95A */
+ {0x1E95C,0x1E95C},{0x1E95D,0x1E95D}, /* 1E95C */
+ {0x1E95E,0x1E95E},{0x1E95F,0x1E95F}, /* 1E95E */
+ {0x1E960,0x1E960},{0x1E961,0x1E961}, /* 1E960 */
+ {0x1E962,0x1E962},{0x1E963,0x1E963}, /* 1E962 */
+ {0x1E964,0x1E964},{0x1E965,0x1E965}, /* 1E964 */
+ {0x1E966,0x1E966},{0x1E967,0x1E967}, /* 1E966 */
+ {0x1E968,0x1E968},{0x1E969,0x1E969}, /* 1E968 */
+ {0x1E96A,0x1E96A},{0x1E96B,0x1E96B}, /* 1E96A */
+ {0x1E96C,0x1E96C},{0x1E96D,0x1E96D}, /* 1E96C */
+ {0x1E96E,0x1E96E},{0x1E96F,0x1E96F}, /* 1E96E */
+ {0x1E970,0x1E970},{0x1E971,0x1E971}, /* 1E970 */
+ {0x1E972,0x1E972},{0x1E973,0x1E973}, /* 1E972 */
+ {0x1E974,0x1E974},{0x1E975,0x1E975}, /* 1E974 */
+ {0x1E976,0x1E976},{0x1E977,0x1E977}, /* 1E976 */
+ {0x1E978,0x1E978},{0x1E979,0x1E979}, /* 1E978 */
+ {0x1E97A,0x1E97A},{0x1E97B,0x1E97B}, /* 1E97A */
+ {0x1E97C,0x1E97C},{0x1E97D,0x1E97D}, /* 1E97C */
+ {0x1E97E,0x1E97E},{0x1E97F,0x1E97F}, /* 1E97E */
+ {0x1E980,0x1E980},{0x1E981,0x1E981}, /* 1E980 */
+ {0x1E982,0x1E982},{0x1E983,0x1E983}, /* 1E982 */
+ {0x1E984,0x1E984},{0x1E985,0x1E985}, /* 1E984 */
+ {0x1E986,0x1E986},{0x1E987,0x1E987}, /* 1E986 */
+ {0x1E988,0x1E988},{0x1E989,0x1E989}, /* 1E988 */
+ {0x1E98A,0x1E98A},{0x1E98B,0x1E98B}, /* 1E98A */
+ {0x1E98C,0x1E98C},{0x1E98D,0x1E98D}, /* 1E98C */
+ {0x1E98E,0x1E98E},{0x1E98F,0x1E98F}, /* 1E98E */
+ {0x1E990,0x1E990},{0x1E991,0x1E991}, /* 1E990 */
+ {0x1E992,0x1E992},{0x1E993,0x1E993}, /* 1E992 */
+ {0x1E994,0x1E994},{0x1E995,0x1E995}, /* 1E994 */
+ {0x1E996,0x1E996},{0x1E997,0x1E997}, /* 1E996 */
+ {0x1E998,0x1E998},{0x1E999,0x1E999}, /* 1E998 */
+ {0x1E99A,0x1E99A},{0x1E99B,0x1E99B}, /* 1E99A */
+ {0x1E99C,0x1E99C},{0x1E99D,0x1E99D}, /* 1E99C */
+ {0x1E99E,0x1E99E},{0x1E99F,0x1E99F}, /* 1E99E */
+ {0x1E9A0,0x1E9A0},{0x1E9A1,0x1E9A1}, /* 1E9A0 */
+ {0x1E9A2,0x1E9A2},{0x1E9A3,0x1E9A3}, /* 1E9A2 */
+ {0x1E9A4,0x1E9A4},{0x1E9A5,0x1E9A5}, /* 1E9A4 */
+ {0x1E9A6,0x1E9A6},{0x1E9A7,0x1E9A7}, /* 1E9A6 */
+ {0x1E9A8,0x1E9A8},{0x1E9A9,0x1E9A9}, /* 1E9A8 */
+ {0x1E9AA,0x1E9AA},{0x1E9AB,0x1E9AB}, /* 1E9AA */
+ {0x1E9AC,0x1E9AC},{0x1E9AD,0x1E9AD}, /* 1E9AC */
+ {0x1E9AE,0x1E9AE},{0x1E9AF,0x1E9AF}, /* 1E9AE */
+ {0x1E9B0,0x1E9B0},{0x1E9B1,0x1E9B1}, /* 1E9B0 */
+ {0x1E9B2,0x1E9B2},{0x1E9B3,0x1E9B3}, /* 1E9B2 */
+ {0x1E9B4,0x1E9B4},{0x1E9B5,0x1E9B5}, /* 1E9B4 */
+ {0x1E9B6,0x1E9B6},{0x1E9B7,0x1E9B7}, /* 1E9B6 */
+ {0x1E9B8,0x1E9B8},{0x1E9B9,0x1E9B9}, /* 1E9B8 */
+ {0x1E9BA,0x1E9BA},{0x1E9BB,0x1E9BB}, /* 1E9BA */
+ {0x1E9BC,0x1E9BC},{0x1E9BD,0x1E9BD}, /* 1E9BC */
+ {0x1E9BE,0x1E9BE},{0x1E9BF,0x1E9BF}, /* 1E9BE */
+ {0x1E9C0,0x1E9C0},{0x1E9C1,0x1E9C1}, /* 1E9C0 */
+ {0x1E9C2,0x1E9C2},{0x1E9C3,0x1E9C3}, /* 1E9C2 */
+ {0x1E9C4,0x1E9C4},{0x1E9C5,0x1E9C5}, /* 1E9C4 */
+ {0x1E9C6,0x1E9C6},{0x1E9C7,0x1E9C7}, /* 1E9C6 */
+ {0x1E9C8,0x1E9C8},{0x1E9C9,0x1E9C9}, /* 1E9C8 */
+ {0x1E9CA,0x1E9CA},{0x1E9CB,0x1E9CB}, /* 1E9CA */
+ {0x1E9CC,0x1E9CC},{0x1E9CD,0x1E9CD}, /* 1E9CC */
+ {0x1E9CE,0x1E9CE},{0x1E9CF,0x1E9CF}, /* 1E9CE */
+ {0x1E9D0,0x1E9D0},{0x1E9D1,0x1E9D1}, /* 1E9D0 */
+ {0x1E9D2,0x1E9D2},{0x1E9D3,0x1E9D3}, /* 1E9D2 */
+ {0x1E9D4,0x1E9D4},{0x1E9D5,0x1E9D5}, /* 1E9D4 */
+ {0x1E9D6,0x1E9D6},{0x1E9D7,0x1E9D7}, /* 1E9D6 */
+ {0x1E9D8,0x1E9D8},{0x1E9D9,0x1E9D9}, /* 1E9D8 */
+ {0x1E9DA,0x1E9DA},{0x1E9DB,0x1E9DB}, /* 1E9DA */
+ {0x1E9DC,0x1E9DC},{0x1E9DD,0x1E9DD}, /* 1E9DC */
+ {0x1E9DE,0x1E9DE},{0x1E9DF,0x1E9DF}, /* 1E9DE */
+ {0x1E9E0,0x1E9E0},{0x1E9E1,0x1E9E1}, /* 1E9E0 */
+ {0x1E9E2,0x1E9E2},{0x1E9E3,0x1E9E3}, /* 1E9E2 */
+ {0x1E9E4,0x1E9E4},{0x1E9E5,0x1E9E5}, /* 1E9E4 */
+ {0x1E9E6,0x1E9E6},{0x1E9E7,0x1E9E7}, /* 1E9E6 */
+ {0x1E9E8,0x1E9E8},{0x1E9E9,0x1E9E9}, /* 1E9E8 */
+ {0x1E9EA,0x1E9EA},{0x1E9EB,0x1E9EB}, /* 1E9EA */
+ {0x1E9EC,0x1E9EC},{0x1E9ED,0x1E9ED}, /* 1E9EC */
+ {0x1E9EE,0x1E9EE},{0x1E9EF,0x1E9EF}, /* 1E9EE */
+ {0x1E9F0,0x1E9F0},{0x1E9F1,0x1E9F1}, /* 1E9F0 */
+ {0x1E9F2,0x1E9F2},{0x1E9F3,0x1E9F3}, /* 1E9F2 */
+ {0x1E9F4,0x1E9F4},{0x1E9F5,0x1E9F5}, /* 1E9F4 */
+ {0x1E9F6,0x1E9F6},{0x1E9F7,0x1E9F7}, /* 1E9F6 */
+ {0x1E9F8,0x1E9F8},{0x1E9F9,0x1E9F9}, /* 1E9F8 */
+ {0x1E9FA,0x1E9FA},{0x1E9FB,0x1E9FB}, /* 1E9FA */
+ {0x1E9FC,0x1E9FC},{0x1E9FD,0x1E9FD}, /* 1E9FC */
+ {0x1E9FE,0x1E9FE},{0x1E9FF,0x1E9FF} /* 1E9FE */
+};
+
+const MY_CASEFOLD_CHARACTER * my_u1400_casefold_index[4352]={
+ u1400_casefold_page00, u1400_casefold_page01, u1400_casefold_page02, u1400_casefold_page03, u1400_casefold_page04, u1400_casefold_page05, u1400_casefold_page06, u1400_casefold_page07,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ u1400_casefold_page10, NULL, NULL, u1400_casefold_page13, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, u1400_casefold_page1C, u1400_casefold_page1D, u1400_casefold_page1E, u1400_casefold_page1F,
+ NULL, u1400_casefold_page21, NULL, NULL, u1400_casefold_page24, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, u1400_casefold_page2C, u1400_casefold_page2D, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, u1400_casefold_pageA6, u1400_casefold_pageA7,
+ NULL, NULL, NULL, u1400_casefold_pageAB, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, u1400_casefold_pageFF,
+ NULL, NULL, NULL, NULL, u1400_casefold_page104, u1400_casefold_page105, NULL, NULL,
+ NULL, NULL, NULL, NULL, u1400_casefold_page10C, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ u1400_casefold_page118, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, u1400_casefold_page16E, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, u1400_casefold_page1E9, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+};
diff --git a/strings/ctype-unicode300-casefold-tr.h b/strings/ctype-unicode300-casefold-tr.h
new file mode 100644
index 00000000000..ff428112382
--- /dev/null
+++ b/strings/ctype-unicode300-casefold-tr.h
@@ -0,0 +1,193 @@
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2023, 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
+*/
+
+/*
+ Generated by:
+ ./unidata-dump \
+ --mode=casefold-tr \
+ --page-name=u300tr_casefold_page \
+ --page-name-derived=u300_casefold_page \
+ --index-name=my_u300tr_casefold_index \
+ --max-char=0xFFFF \
+ UnicodeData-3.0.0.txt
+
+*/
+const MY_CASEFOLD_CHARACTER u300tr_casefold_page00[256]={
+ {0x0000,0x0000},{0x0001,0x0001}, /* 0000 */
+ {0x0002,0x0002},{0x0003,0x0003}, /* 0002 */
+ {0x0004,0x0004},{0x0005,0x0005}, /* 0004 */
+ {0x0006,0x0006},{0x0007,0x0007}, /* 0006 */
+ {0x0008,0x0008},{0x0009,0x0009}, /* 0008 */
+ {0x000A,0x000A},{0x000B,0x000B}, /* 000A */
+ {0x000C,0x000C},{0x000D,0x000D}, /* 000C */
+ {0x000E,0x000E},{0x000F,0x000F}, /* 000E */
+ {0x0010,0x0010},{0x0011,0x0011}, /* 0010 */
+ {0x0012,0x0012},{0x0013,0x0013}, /* 0012 */
+ {0x0014,0x0014},{0x0015,0x0015}, /* 0014 */
+ {0x0016,0x0016},{0x0017,0x0017}, /* 0016 */
+ {0x0018,0x0018},{0x0019,0x0019}, /* 0018 */
+ {0x001A,0x001A},{0x001B,0x001B}, /* 001A */
+ {0x001C,0x001C},{0x001D,0x001D}, /* 001C */
+ {0x001E,0x001E},{0x001F,0x001F}, /* 001E */
+ {0x0020,0x0020},{0x0021,0x0021}, /* 0020 */
+ {0x0022,0x0022},{0x0023,0x0023}, /* 0022 */
+ {0x0024,0x0024},{0x0025,0x0025}, /* 0024 */
+ {0x0026,0x0026},{0x0027,0x0027}, /* 0026 */
+ {0x0028,0x0028},{0x0029,0x0029}, /* 0028 */
+ {0x002A,0x002A},{0x002B,0x002B}, /* 002A */
+ {0x002C,0x002C},{0x002D,0x002D}, /* 002C */
+ {0x002E,0x002E},{0x002F,0x002F}, /* 002E */
+ {0x0030,0x0030},{0x0031,0x0031}, /* 0030 */
+ {0x0032,0x0032},{0x0033,0x0033}, /* 0032 */
+ {0x0034,0x0034},{0x0035,0x0035}, /* 0034 */
+ {0x0036,0x0036},{0x0037,0x0037}, /* 0036 */
+ {0x0038,0x0038},{0x0039,0x0039}, /* 0038 */
+ {0x003A,0x003A},{0x003B,0x003B}, /* 003A */
+ {0x003C,0x003C},{0x003D,0x003D}, /* 003C */
+ {0x003E,0x003E},{0x003F,0x003F}, /* 003E */
+ {0x0040,0x0040},{0x0041,0x0061}, /* 0040 */
+ {0x0042,0x0062},{0x0043,0x0063}, /* 0042 */
+ {0x0044,0x0064},{0x0045,0x0065}, /* 0044 */
+ {0x0046,0x0066},{0x0047,0x0067}, /* 0046 */
+ {0x0048,0x0068},{0x0049,0x0131}, /* 0048 */
+ {0x004A,0x006A},{0x004B,0x006B}, /* 004A */
+ {0x004C,0x006C},{0x004D,0x006D}, /* 004C */
+ {0x004E,0x006E},{0x004F,0x006F}, /* 004E */
+ {0x0050,0x0070},{0x0051,0x0071}, /* 0050 */
+ {0x0052,0x0072},{0x0053,0x0073}, /* 0052 */
+ {0x0054,0x0074},{0x0055,0x0075}, /* 0054 */
+ {0x0056,0x0076},{0x0057,0x0077}, /* 0056 */
+ {0x0058,0x0078},{0x0059,0x0079}, /* 0058 */
+ {0x005A,0x007A},{0x005B,0x005B}, /* 005A */
+ {0x005C,0x005C},{0x005D,0x005D}, /* 005C */
+ {0x005E,0x005E},{0x005F,0x005F}, /* 005E */
+ {0x0060,0x0060},{0x0041,0x0061}, /* 0060 */
+ {0x0042,0x0062},{0x0043,0x0063}, /* 0062 */
+ {0x0044,0x0064},{0x0045,0x0065}, /* 0064 */
+ {0x0046,0x0066},{0x0047,0x0067}, /* 0066 */
+ {0x0048,0x0068},{0x0130,0x0069}, /* 0068 */
+ {0x004A,0x006A},{0x004B,0x006B}, /* 006A */
+ {0x004C,0x006C},{0x004D,0x006D}, /* 006C */
+ {0x004E,0x006E},{0x004F,0x006F}, /* 006E */
+ {0x0050,0x0070},{0x0051,0x0071}, /* 0070 */
+ {0x0052,0x0072},{0x0053,0x0073}, /* 0072 */
+ {0x0054,0x0074},{0x0055,0x0075}, /* 0074 */
+ {0x0056,0x0076},{0x0057,0x0077}, /* 0076 */
+ {0x0058,0x0078},{0x0059,0x0079}, /* 0078 */
+ {0x005A,0x007A},{0x007B,0x007B}, /* 007A */
+ {0x007C,0x007C},{0x007D,0x007D}, /* 007C */
+ {0x007E,0x007E},{0x007F,0x007F}, /* 007E */
+ {0x0080,0x0080},{0x0081,0x0081}, /* 0080 */
+ {0x0082,0x0082},{0x0083,0x0083}, /* 0082 */
+ {0x0084,0x0084},{0x0085,0x0085}, /* 0084 */
+ {0x0086,0x0086},{0x0087,0x0087}, /* 0086 */
+ {0x0088,0x0088},{0x0089,0x0089}, /* 0088 */
+ {0x008A,0x008A},{0x008B,0x008B}, /* 008A */
+ {0x008C,0x008C},{0x008D,0x008D}, /* 008C */
+ {0x008E,0x008E},{0x008F,0x008F}, /* 008E */
+ {0x0090,0x0090},{0x0091,0x0091}, /* 0090 */
+ {0x0092,0x0092},{0x0093,0x0093}, /* 0092 */
+ {0x0094,0x0094},{0x0095,0x0095}, /* 0094 */
+ {0x0096,0x0096},{0x0097,0x0097}, /* 0096 */
+ {0x0098,0x0098},{0x0099,0x0099}, /* 0098 */
+ {0x009A,0x009A},{0x009B,0x009B}, /* 009A */
+ {0x009C,0x009C},{0x009D,0x009D}, /* 009C */
+ {0x009E,0x009E},{0x009F,0x009F}, /* 009E */
+ {0x00A0,0x00A0},{0x00A1,0x00A1}, /* 00A0 */
+ {0x00A2,0x00A2},{0x00A3,0x00A3}, /* 00A2 */
+ {0x00A4,0x00A4},{0x00A5,0x00A5}, /* 00A4 */
+ {0x00A6,0x00A6},{0x00A7,0x00A7}, /* 00A6 */
+ {0x00A8,0x00A8},{0x00A9,0x00A9}, /* 00A8 */
+ {0x00AA,0x00AA},{0x00AB,0x00AB}, /* 00AA */
+ {0x00AC,0x00AC},{0x00AD,0x00AD}, /* 00AC */
+ {0x00AE,0x00AE},{0x00AF,0x00AF}, /* 00AE */
+ {0x00B0,0x00B0},{0x00B1,0x00B1}, /* 00B0 */
+ {0x00B2,0x00B2},{0x00B3,0x00B3}, /* 00B2 */
+ {0x00B4,0x00B4},{0x039C,0x00B5}, /* 00B4 */
+ {0x00B6,0x00B6},{0x00B7,0x00B7}, /* 00B6 */
+ {0x00B8,0x00B8},{0x00B9,0x00B9}, /* 00B8 */
+ {0x00BA,0x00BA},{0x00BB,0x00BB}, /* 00BA */
+ {0x00BC,0x00BC},{0x00BD,0x00BD}, /* 00BC */
+ {0x00BE,0x00BE},{0x00BF,0x00BF}, /* 00BE */
+ {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00C0 */
+ {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00C2 */
+ {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00C4 */
+ {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00C6 */
+ {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00C8 */
+ {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00CA */
+ {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00CC */
+ {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00CE */
+ {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00D0 */
+ {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00D2 */
+ {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00D4 */
+ {0x00D6,0x00F6},{0x00D7,0x00D7}, /* 00D6 */
+ {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00D8 */
+ {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00DA */
+ {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00DC */
+ {0x00DE,0x00FE},{0x00DF,0x00DF}, /* 00DE */
+ {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00E0 */
+ {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00E2 */
+ {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00E4 */
+ {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00E6 */
+ {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00E8 */
+ {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00EA */
+ {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00EC */
+ {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00EE */
+ {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00F0 */
+ {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00F2 */
+ {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00F4 */
+ {0x00D6,0x00F6},{0x00F7,0x00F7}, /* 00F6 */
+ {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00F8 */
+ {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00FA */
+ {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00FC */
+ {0x00DE,0x00FE},{0x0178,0x00FF} /* 00FE */
+};
+
+const MY_CASEFOLD_CHARACTER * my_u300tr_casefold_index[256]={
+ u300tr_casefold_page00, u300_casefold_page01, u300_casefold_page02, u300_casefold_page03, u300_casefold_page04, u300_casefold_page05, u300_casefold_page06, u300_casefold_page07,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, u300_casefold_page1E, u300_casefold_page1F,
+ NULL, u300_casefold_page21, NULL, NULL, u300_casefold_page24, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, u300_casefold_pageFF
+};
diff --git a/strings/ctype-unicode300-casefold.h b/strings/ctype-unicode300-casefold.h
new file mode 100644
index 00000000000..353cba0846a
--- /dev/null
+++ b/strings/ctype-unicode300-casefold.h
@@ -0,0 +1,1764 @@
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2023, 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
+*/
+
+/*
+ Generated by:
+ ./unidata-dump \
+ --mode=casefold \
+ --page-name=u300_casefold_page \
+ --index-name=my_u300_casefold_index \
+ --max-char=0xFFFF \
+ UnicodeData-3.0.0.txt
+
+*/
+const MY_CASEFOLD_CHARACTER u300_casefold_page00[256]={
+ {0x0000,0x0000},{0x0001,0x0001}, /* 0000 */
+ {0x0002,0x0002},{0x0003,0x0003}, /* 0002 */
+ {0x0004,0x0004},{0x0005,0x0005}, /* 0004 */
+ {0x0006,0x0006},{0x0007,0x0007}, /* 0006 */
+ {0x0008,0x0008},{0x0009,0x0009}, /* 0008 */
+ {0x000A,0x000A},{0x000B,0x000B}, /* 000A */
+ {0x000C,0x000C},{0x000D,0x000D}, /* 000C */
+ {0x000E,0x000E},{0x000F,0x000F}, /* 000E */
+ {0x0010,0x0010},{0x0011,0x0011}, /* 0010 */
+ {0x0012,0x0012},{0x0013,0x0013}, /* 0012 */
+ {0x0014,0x0014},{0x0015,0x0015}, /* 0014 */
+ {0x0016,0x0016},{0x0017,0x0017}, /* 0016 */
+ {0x0018,0x0018},{0x0019,0x0019}, /* 0018 */
+ {0x001A,0x001A},{0x001B,0x001B}, /* 001A */
+ {0x001C,0x001C},{0x001D,0x001D}, /* 001C */
+ {0x001E,0x001E},{0x001F,0x001F}, /* 001E */
+ {0x0020,0x0020},{0x0021,0x0021}, /* 0020 */
+ {0x0022,0x0022},{0x0023,0x0023}, /* 0022 */
+ {0x0024,0x0024},{0x0025,0x0025}, /* 0024 */
+ {0x0026,0x0026},{0x0027,0x0027}, /* 0026 */
+ {0x0028,0x0028},{0x0029,0x0029}, /* 0028 */
+ {0x002A,0x002A},{0x002B,0x002B}, /* 002A */
+ {0x002C,0x002C},{0x002D,0x002D}, /* 002C */
+ {0x002E,0x002E},{0x002F,0x002F}, /* 002E */
+ {0x0030,0x0030},{0x0031,0x0031}, /* 0030 */
+ {0x0032,0x0032},{0x0033,0x0033}, /* 0032 */
+ {0x0034,0x0034},{0x0035,0x0035}, /* 0034 */
+ {0x0036,0x0036},{0x0037,0x0037}, /* 0036 */
+ {0x0038,0x0038},{0x0039,0x0039}, /* 0038 */
+ {0x003A,0x003A},{0x003B,0x003B}, /* 003A */
+ {0x003C,0x003C},{0x003D,0x003D}, /* 003C */
+ {0x003E,0x003E},{0x003F,0x003F}, /* 003E */
+ {0x0040,0x0040},{0x0041,0x0061}, /* 0040 */
+ {0x0042,0x0062},{0x0043,0x0063}, /* 0042 */
+ {0x0044,0x0064},{0x0045,0x0065}, /* 0044 */
+ {0x0046,0x0066},{0x0047,0x0067}, /* 0046 */
+ {0x0048,0x0068},{0x0049,0x0069}, /* 0048 */
+ {0x004A,0x006A},{0x004B,0x006B}, /* 004A */
+ {0x004C,0x006C},{0x004D,0x006D}, /* 004C */
+ {0x004E,0x006E},{0x004F,0x006F}, /* 004E */
+ {0x0050,0x0070},{0x0051,0x0071}, /* 0050 */
+ {0x0052,0x0072},{0x0053,0x0073}, /* 0052 */
+ {0x0054,0x0074},{0x0055,0x0075}, /* 0054 */
+ {0x0056,0x0076},{0x0057,0x0077}, /* 0056 */
+ {0x0058,0x0078},{0x0059,0x0079}, /* 0058 */
+ {0x005A,0x007A},{0x005B,0x005B}, /* 005A */
+ {0x005C,0x005C},{0x005D,0x005D}, /* 005C */
+ {0x005E,0x005E},{0x005F,0x005F}, /* 005E */
+ {0x0060,0x0060},{0x0041,0x0061}, /* 0060 */
+ {0x0042,0x0062},{0x0043,0x0063}, /* 0062 */
+ {0x0044,0x0064},{0x0045,0x0065}, /* 0064 */
+ {0x0046,0x0066},{0x0047,0x0067}, /* 0066 */
+ {0x0048,0x0068},{0x0049,0x0069}, /* 0068 */
+ {0x004A,0x006A},{0x004B,0x006B}, /* 006A */
+ {0x004C,0x006C},{0x004D,0x006D}, /* 006C */
+ {0x004E,0x006E},{0x004F,0x006F}, /* 006E */
+ {0x0050,0x0070},{0x0051,0x0071}, /* 0070 */
+ {0x0052,0x0072},{0x0053,0x0073}, /* 0072 */
+ {0x0054,0x0074},{0x0055,0x0075}, /* 0074 */
+ {0x0056,0x0076},{0x0057,0x0077}, /* 0076 */
+ {0x0058,0x0078},{0x0059,0x0079}, /* 0078 */
+ {0x005A,0x007A},{0x007B,0x007B}, /* 007A */
+ {0x007C,0x007C},{0x007D,0x007D}, /* 007C */
+ {0x007E,0x007E},{0x007F,0x007F}, /* 007E */
+ {0x0080,0x0080},{0x0081,0x0081}, /* 0080 */
+ {0x0082,0x0082},{0x0083,0x0083}, /* 0082 */
+ {0x0084,0x0084},{0x0085,0x0085}, /* 0084 */
+ {0x0086,0x0086},{0x0087,0x0087}, /* 0086 */
+ {0x0088,0x0088},{0x0089,0x0089}, /* 0088 */
+ {0x008A,0x008A},{0x008B,0x008B}, /* 008A */
+ {0x008C,0x008C},{0x008D,0x008D}, /* 008C */
+ {0x008E,0x008E},{0x008F,0x008F}, /* 008E */
+ {0x0090,0x0090},{0x0091,0x0091}, /* 0090 */
+ {0x0092,0x0092},{0x0093,0x0093}, /* 0092 */
+ {0x0094,0x0094},{0x0095,0x0095}, /* 0094 */
+ {0x0096,0x0096},{0x0097,0x0097}, /* 0096 */
+ {0x0098,0x0098},{0x0099,0x0099}, /* 0098 */
+ {0x009A,0x009A},{0x009B,0x009B}, /* 009A */
+ {0x009C,0x009C},{0x009D,0x009D}, /* 009C */
+ {0x009E,0x009E},{0x009F,0x009F}, /* 009E */
+ {0x00A0,0x00A0},{0x00A1,0x00A1}, /* 00A0 */
+ {0x00A2,0x00A2},{0x00A3,0x00A3}, /* 00A2 */
+ {0x00A4,0x00A4},{0x00A5,0x00A5}, /* 00A4 */
+ {0x00A6,0x00A6},{0x00A7,0x00A7}, /* 00A6 */
+ {0x00A8,0x00A8},{0x00A9,0x00A9}, /* 00A8 */
+ {0x00AA,0x00AA},{0x00AB,0x00AB}, /* 00AA */
+ {0x00AC,0x00AC},{0x00AD,0x00AD}, /* 00AC */
+ {0x00AE,0x00AE},{0x00AF,0x00AF}, /* 00AE */
+ {0x00B0,0x00B0},{0x00B1,0x00B1}, /* 00B0 */
+ {0x00B2,0x00B2},{0x00B3,0x00B3}, /* 00B2 */
+ {0x00B4,0x00B4},{0x039C,0x00B5}, /* 00B4 */
+ {0x00B6,0x00B6},{0x00B7,0x00B7}, /* 00B6 */
+ {0x00B8,0x00B8},{0x00B9,0x00B9}, /* 00B8 */
+ {0x00BA,0x00BA},{0x00BB,0x00BB}, /* 00BA */
+ {0x00BC,0x00BC},{0x00BD,0x00BD}, /* 00BC */
+ {0x00BE,0x00BE},{0x00BF,0x00BF}, /* 00BE */
+ {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00C0 */
+ {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00C2 */
+ {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00C4 */
+ {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00C6 */
+ {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00C8 */
+ {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00CA */
+ {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00CC */
+ {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00CE */
+ {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00D0 */
+ {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00D2 */
+ {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00D4 */
+ {0x00D6,0x00F6},{0x00D7,0x00D7}, /* 00D6 */
+ {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00D8 */
+ {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00DA */
+ {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00DC */
+ {0x00DE,0x00FE},{0x00DF,0x00DF}, /* 00DE */
+ {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00E0 */
+ {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00E2 */
+ {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00E4 */
+ {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00E6 */
+ {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00E8 */
+ {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00EA */
+ {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00EC */
+ {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00EE */
+ {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00F0 */
+ {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00F2 */
+ {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00F4 */
+ {0x00D6,0x00F6},{0x00F7,0x00F7}, /* 00F6 */
+ {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00F8 */
+ {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00FA */
+ {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00FC */
+ {0x00DE,0x00FE},{0x0178,0x00FF} /* 00FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u300_casefold_page01[256]={
+ {0x0100,0x0101},{0x0100,0x0101}, /* 0100 */
+ {0x0102,0x0103},{0x0102,0x0103}, /* 0102 */
+ {0x0104,0x0105},{0x0104,0x0105}, /* 0104 */
+ {0x0106,0x0107},{0x0106,0x0107}, /* 0106 */
+ {0x0108,0x0109},{0x0108,0x0109}, /* 0108 */
+ {0x010A,0x010B},{0x010A,0x010B}, /* 010A */
+ {0x010C,0x010D},{0x010C,0x010D}, /* 010C */
+ {0x010E,0x010F},{0x010E,0x010F}, /* 010E */
+ {0x0110,0x0111},{0x0110,0x0111}, /* 0110 */
+ {0x0112,0x0113},{0x0112,0x0113}, /* 0112 */
+ {0x0114,0x0115},{0x0114,0x0115}, /* 0114 */
+ {0x0116,0x0117},{0x0116,0x0117}, /* 0116 */
+ {0x0118,0x0119},{0x0118,0x0119}, /* 0118 */
+ {0x011A,0x011B},{0x011A,0x011B}, /* 011A */
+ {0x011C,0x011D},{0x011C,0x011D}, /* 011C */
+ {0x011E,0x011F},{0x011E,0x011F}, /* 011E */
+ {0x0120,0x0121},{0x0120,0x0121}, /* 0120 */
+ {0x0122,0x0123},{0x0122,0x0123}, /* 0122 */
+ {0x0124,0x0125},{0x0124,0x0125}, /* 0124 */
+ {0x0126,0x0127},{0x0126,0x0127}, /* 0126 */
+ {0x0128,0x0129},{0x0128,0x0129}, /* 0128 */
+ {0x012A,0x012B},{0x012A,0x012B}, /* 012A */
+ {0x012C,0x012D},{0x012C,0x012D}, /* 012C */
+ {0x012E,0x012F},{0x012E,0x012F}, /* 012E */
+ {0x0130,0x0069},{0x0049,0x0131}, /* 0130 */
+ {0x0132,0x0133},{0x0132,0x0133}, /* 0132 */
+ {0x0134,0x0135},{0x0134,0x0135}, /* 0134 */
+ {0x0136,0x0137},{0x0136,0x0137}, /* 0136 */
+ {0x0138,0x0138},{0x0139,0x013A}, /* 0138 */
+ {0x0139,0x013A},{0x013B,0x013C}, /* 013A */
+ {0x013B,0x013C},{0x013D,0x013E}, /* 013C */
+ {0x013D,0x013E},{0x013F,0x0140}, /* 013E */
+ {0x013F,0x0140},{0x0141,0x0142}, /* 0140 */
+ {0x0141,0x0142},{0x0143,0x0144}, /* 0142 */
+ {0x0143,0x0144},{0x0145,0x0146}, /* 0144 */
+ {0x0145,0x0146},{0x0147,0x0148}, /* 0146 */
+ {0x0147,0x0148},{0x0149,0x0149}, /* 0148 */
+ {0x014A,0x014B},{0x014A,0x014B}, /* 014A */
+ {0x014C,0x014D},{0x014C,0x014D}, /* 014C */
+ {0x014E,0x014F},{0x014E,0x014F}, /* 014E */
+ {0x0150,0x0151},{0x0150,0x0151}, /* 0150 */
+ {0x0152,0x0153},{0x0152,0x0153}, /* 0152 */
+ {0x0154,0x0155},{0x0154,0x0155}, /* 0154 */
+ {0x0156,0x0157},{0x0156,0x0157}, /* 0156 */
+ {0x0158,0x0159},{0x0158,0x0159}, /* 0158 */
+ {0x015A,0x015B},{0x015A,0x015B}, /* 015A */
+ {0x015C,0x015D},{0x015C,0x015D}, /* 015C */
+ {0x015E,0x015F},{0x015E,0x015F}, /* 015E */
+ {0x0160,0x0161},{0x0160,0x0161}, /* 0160 */
+ {0x0162,0x0163},{0x0162,0x0163}, /* 0162 */
+ {0x0164,0x0165},{0x0164,0x0165}, /* 0164 */
+ {0x0166,0x0167},{0x0166,0x0167}, /* 0166 */
+ {0x0168,0x0169},{0x0168,0x0169}, /* 0168 */
+ {0x016A,0x016B},{0x016A,0x016B}, /* 016A */
+ {0x016C,0x016D},{0x016C,0x016D}, /* 016C */
+ {0x016E,0x016F},{0x016E,0x016F}, /* 016E */
+ {0x0170,0x0171},{0x0170,0x0171}, /* 0170 */
+ {0x0172,0x0173},{0x0172,0x0173}, /* 0172 */
+ {0x0174,0x0175},{0x0174,0x0175}, /* 0174 */
+ {0x0176,0x0177},{0x0176,0x0177}, /* 0176 */
+ {0x0178,0x00FF},{0x0179,0x017A}, /* 0178 */
+ {0x0179,0x017A},{0x017B,0x017C}, /* 017A */
+ {0x017B,0x017C},{0x017D,0x017E}, /* 017C */
+ {0x017D,0x017E},{0x0053,0x017F}, /* 017E */
+ {0x0180,0x0180},{0x0181,0x0253}, /* 0180 */
+ {0x0182,0x0183},{0x0182,0x0183}, /* 0182 */
+ {0x0184,0x0185},{0x0184,0x0185}, /* 0184 */
+ {0x0186,0x0254},{0x0187,0x0188}, /* 0186 */
+ {0x0187,0x0188},{0x0189,0x0256}, /* 0188 */
+ {0x018A,0x0257},{0x018B,0x018C}, /* 018A */
+ {0x018B,0x018C},{0x018D,0x018D}, /* 018C */
+ {0x018E,0x01DD},{0x018F,0x0259}, /* 018E */
+ {0x0190,0x025B},{0x0191,0x0192}, /* 0190 */
+ {0x0191,0x0192},{0x0193,0x0260}, /* 0192 */
+ {0x0194,0x0263},{0x01F6,0x0195}, /* 0194 */
+ {0x0196,0x0269},{0x0197,0x0268}, /* 0196 */
+ {0x0198,0x0199},{0x0198,0x0199}, /* 0198 */
+ {0x019A,0x019A},{0x019B,0x019B}, /* 019A */
+ {0x019C,0x026F},{0x019D,0x0272}, /* 019C */
+ {0x019E,0x019E},{0x019F,0x0275}, /* 019E */
+ {0x01A0,0x01A1},{0x01A0,0x01A1}, /* 01A0 */
+ {0x01A2,0x01A3},{0x01A2,0x01A3}, /* 01A2 */
+ {0x01A4,0x01A5},{0x01A4,0x01A5}, /* 01A4 */
+ {0x01A6,0x0280},{0x01A7,0x01A8}, /* 01A6 */
+ {0x01A7,0x01A8},{0x01A9,0x0283}, /* 01A8 */
+ {0x01AA,0x01AA},{0x01AB,0x01AB}, /* 01AA */
+ {0x01AC,0x01AD},{0x01AC,0x01AD}, /* 01AC */
+ {0x01AE,0x0288},{0x01AF,0x01B0}, /* 01AE */
+ {0x01AF,0x01B0},{0x01B1,0x028A}, /* 01B0 */
+ {0x01B2,0x028B},{0x01B3,0x01B4}, /* 01B2 */
+ {0x01B3,0x01B4},{0x01B5,0x01B6}, /* 01B4 */
+ {0x01B5,0x01B6},{0x01B7,0x0292}, /* 01B6 */
+ {0x01B8,0x01B9},{0x01B8,0x01B9}, /* 01B8 */
+ {0x01BA,0x01BA},{0x01BB,0x01BB}, /* 01BA */
+ {0x01BC,0x01BD},{0x01BC,0x01BD}, /* 01BC */
+ {0x01BE,0x01BE},{0x01F7,0x01BF}, /* 01BE */
+ {0x01C0,0x01C0},{0x01C1,0x01C1}, /* 01C0 */
+ {0x01C2,0x01C2},{0x01C3,0x01C3}, /* 01C2 */
+ {0x01C4,0x01C6},{0x01C4,0x01C6}, /* 01C4 */
+ {0x01C4,0x01C6},{0x01C7,0x01C9}, /* 01C6 */
+ {0x01C7,0x01C9},{0x01C7,0x01C9}, /* 01C8 */
+ {0x01CA,0x01CC},{0x01CA,0x01CC}, /* 01CA */
+ {0x01CA,0x01CC},{0x01CD,0x01CE}, /* 01CC */
+ {0x01CD,0x01CE},{0x01CF,0x01D0}, /* 01CE */
+ {0x01CF,0x01D0},{0x01D1,0x01D2}, /* 01D0 */
+ {0x01D1,0x01D2},{0x01D3,0x01D4}, /* 01D2 */
+ {0x01D3,0x01D4},{0x01D5,0x01D6}, /* 01D4 */
+ {0x01D5,0x01D6},{0x01D7,0x01D8}, /* 01D6 */
+ {0x01D7,0x01D8},{0x01D9,0x01DA}, /* 01D8 */
+ {0x01D9,0x01DA},{0x01DB,0x01DC}, /* 01DA */
+ {0x01DB,0x01DC},{0x018E,0x01DD}, /* 01DC */
+ {0x01DE,0x01DF},{0x01DE,0x01DF}, /* 01DE */
+ {0x01E0,0x01E1},{0x01E0,0x01E1}, /* 01E0 */
+ {0x01E2,0x01E3},{0x01E2,0x01E3}, /* 01E2 */
+ {0x01E4,0x01E5},{0x01E4,0x01E5}, /* 01E4 */
+ {0x01E6,0x01E7},{0x01E6,0x01E7}, /* 01E6 */
+ {0x01E8,0x01E9},{0x01E8,0x01E9}, /* 01E8 */
+ {0x01EA,0x01EB},{0x01EA,0x01EB}, /* 01EA */
+ {0x01EC,0x01ED},{0x01EC,0x01ED}, /* 01EC */
+ {0x01EE,0x01EF},{0x01EE,0x01EF}, /* 01EE */
+ {0x01F0,0x01F0},{0x01F1,0x01F3}, /* 01F0 */
+ {0x01F1,0x01F3},{0x01F1,0x01F3}, /* 01F2 */
+ {0x01F4,0x01F5},{0x01F4,0x01F5}, /* 01F4 */
+ {0x01F6,0x0195},{0x01F7,0x01BF}, /* 01F6 */
+ {0x01F8,0x01F9},{0x01F8,0x01F9}, /* 01F8 */
+ {0x01FA,0x01FB},{0x01FA,0x01FB}, /* 01FA */
+ {0x01FC,0x01FD},{0x01FC,0x01FD}, /* 01FC */
+ {0x01FE,0x01FF},{0x01FE,0x01FF} /* 01FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u300_casefold_page02[256]={
+ {0x0200,0x0201},{0x0200,0x0201}, /* 0200 */
+ {0x0202,0x0203},{0x0202,0x0203}, /* 0202 */
+ {0x0204,0x0205},{0x0204,0x0205}, /* 0204 */
+ {0x0206,0x0207},{0x0206,0x0207}, /* 0206 */
+ {0x0208,0x0209},{0x0208,0x0209}, /* 0208 */
+ {0x020A,0x020B},{0x020A,0x020B}, /* 020A */
+ {0x020C,0x020D},{0x020C,0x020D}, /* 020C */
+ {0x020E,0x020F},{0x020E,0x020F}, /* 020E */
+ {0x0210,0x0211},{0x0210,0x0211}, /* 0210 */
+ {0x0212,0x0213},{0x0212,0x0213}, /* 0212 */
+ {0x0214,0x0215},{0x0214,0x0215}, /* 0214 */
+ {0x0216,0x0217},{0x0216,0x0217}, /* 0216 */
+ {0x0218,0x0219},{0x0218,0x0219}, /* 0218 */
+ {0x021A,0x021B},{0x021A,0x021B}, /* 021A */
+ {0x021C,0x021D},{0x021C,0x021D}, /* 021C */
+ {0x021E,0x021F},{0x021E,0x021F}, /* 021E */
+ {0x0220,0x0220},{0x0221,0x0221}, /* 0220 */
+ {0x0222,0x0223},{0x0222,0x0223}, /* 0222 */
+ {0x0224,0x0225},{0x0224,0x0225}, /* 0224 */
+ {0x0226,0x0227},{0x0226,0x0227}, /* 0226 */
+ {0x0228,0x0229},{0x0228,0x0229}, /* 0228 */
+ {0x022A,0x022B},{0x022A,0x022B}, /* 022A */
+ {0x022C,0x022D},{0x022C,0x022D}, /* 022C */
+ {0x022E,0x022F},{0x022E,0x022F}, /* 022E */
+ {0x0230,0x0231},{0x0230,0x0231}, /* 0230 */
+ {0x0232,0x0233},{0x0232,0x0233}, /* 0232 */
+ {0x0234,0x0234},{0x0235,0x0235}, /* 0234 */
+ {0x0236,0x0236},{0x0237,0x0237}, /* 0236 */
+ {0x0238,0x0238},{0x0239,0x0239}, /* 0238 */
+ {0x023A,0x023A},{0x023B,0x023B}, /* 023A */
+ {0x023C,0x023C},{0x023D,0x023D}, /* 023C */
+ {0x023E,0x023E},{0x023F,0x023F}, /* 023E */
+ {0x0240,0x0240},{0x0241,0x0241}, /* 0240 */
+ {0x0242,0x0242},{0x0243,0x0243}, /* 0242 */
+ {0x0244,0x0244},{0x0245,0x0245}, /* 0244 */
+ {0x0246,0x0246},{0x0247,0x0247}, /* 0246 */
+ {0x0248,0x0248},{0x0249,0x0249}, /* 0248 */
+ {0x024A,0x024A},{0x024B,0x024B}, /* 024A */
+ {0x024C,0x024C},{0x024D,0x024D}, /* 024C */
+ {0x024E,0x024E},{0x024F,0x024F}, /* 024E */
+ {0x0250,0x0250},{0x0251,0x0251}, /* 0250 */
+ {0x0252,0x0252},{0x0181,0x0253}, /* 0252 */
+ {0x0186,0x0254},{0x0255,0x0255}, /* 0254 */
+ {0x0189,0x0256},{0x018A,0x0257}, /* 0256 */
+ {0x0258,0x0258},{0x018F,0x0259}, /* 0258 */
+ {0x025A,0x025A},{0x0190,0x025B}, /* 025A */
+ {0x025C,0x025C},{0x025D,0x025D}, /* 025C */
+ {0x025E,0x025E},{0x025F,0x025F}, /* 025E */
+ {0x0193,0x0260},{0x0261,0x0261}, /* 0260 */
+ {0x0262,0x0262},{0x0194,0x0263}, /* 0262 */
+ {0x0264,0x0264},{0x0265,0x0265}, /* 0264 */
+ {0x0266,0x0266},{0x0267,0x0267}, /* 0266 */
+ {0x0197,0x0268},{0x0196,0x0269}, /* 0268 */
+ {0x026A,0x026A},{0x026B,0x026B}, /* 026A */
+ {0x026C,0x026C},{0x026D,0x026D}, /* 026C */
+ {0x026E,0x026E},{0x019C,0x026F}, /* 026E */
+ {0x0270,0x0270},{0x0271,0x0271}, /* 0270 */
+ {0x019D,0x0272},{0x0273,0x0273}, /* 0272 */
+ {0x0274,0x0274},{0x019F,0x0275}, /* 0274 */
+ {0x0276,0x0276},{0x0277,0x0277}, /* 0276 */
+ {0x0278,0x0278},{0x0279,0x0279}, /* 0278 */
+ {0x027A,0x027A},{0x027B,0x027B}, /* 027A */
+ {0x027C,0x027C},{0x027D,0x027D}, /* 027C */
+ {0x027E,0x027E},{0x027F,0x027F}, /* 027E */
+ {0x01A6,0x0280},{0x0281,0x0281}, /* 0280 */
+ {0x0282,0x0282},{0x01A9,0x0283}, /* 0282 */
+ {0x0284,0x0284},{0x0285,0x0285}, /* 0284 */
+ {0x0286,0x0286},{0x0287,0x0287}, /* 0286 */
+ {0x01AE,0x0288},{0x0289,0x0289}, /* 0288 */
+ {0x01B1,0x028A},{0x01B2,0x028B}, /* 028A */
+ {0x028C,0x028C},{0x028D,0x028D}, /* 028C */
+ {0x028E,0x028E},{0x028F,0x028F}, /* 028E */
+ {0x0290,0x0290},{0x0291,0x0291}, /* 0290 */
+ {0x01B7,0x0292},{0x0293,0x0293}, /* 0292 */
+ {0x0294,0x0294},{0x0295,0x0295}, /* 0294 */
+ {0x0296,0x0296},{0x0297,0x0297}, /* 0296 */
+ {0x0298,0x0298},{0x0299,0x0299}, /* 0298 */
+ {0x029A,0x029A},{0x029B,0x029B}, /* 029A */
+ {0x029C,0x029C},{0x029D,0x029D}, /* 029C */
+ {0x029E,0x029E},{0x029F,0x029F}, /* 029E */
+ {0x02A0,0x02A0},{0x02A1,0x02A1}, /* 02A0 */
+ {0x02A2,0x02A2},{0x02A3,0x02A3}, /* 02A2 */
+ {0x02A4,0x02A4},{0x02A5,0x02A5}, /* 02A4 */
+ {0x02A6,0x02A6},{0x02A7,0x02A7}, /* 02A6 */
+ {0x02A8,0x02A8},{0x02A9,0x02A9}, /* 02A8 */
+ {0x02AA,0x02AA},{0x02AB,0x02AB}, /* 02AA */
+ {0x02AC,0x02AC},{0x02AD,0x02AD}, /* 02AC */
+ {0x02AE,0x02AE},{0x02AF,0x02AF}, /* 02AE */
+ {0x02B0,0x02B0},{0x02B1,0x02B1}, /* 02B0 */
+ {0x02B2,0x02B2},{0x02B3,0x02B3}, /* 02B2 */
+ {0x02B4,0x02B4},{0x02B5,0x02B5}, /* 02B4 */
+ {0x02B6,0x02B6},{0x02B7,0x02B7}, /* 02B6 */
+ {0x02B8,0x02B8},{0x02B9,0x02B9}, /* 02B8 */
+ {0x02BA,0x02BA},{0x02BB,0x02BB}, /* 02BA */
+ {0x02BC,0x02BC},{0x02BD,0x02BD}, /* 02BC */
+ {0x02BE,0x02BE},{0x02BF,0x02BF}, /* 02BE */
+ {0x02C0,0x02C0},{0x02C1,0x02C1}, /* 02C0 */
+ {0x02C2,0x02C2},{0x02C3,0x02C3}, /* 02C2 */
+ {0x02C4,0x02C4},{0x02C5,0x02C5}, /* 02C4 */
+ {0x02C6,0x02C6},{0x02C7,0x02C7}, /* 02C6 */
+ {0x02C8,0x02C8},{0x02C9,0x02C9}, /* 02C8 */
+ {0x02CA,0x02CA},{0x02CB,0x02CB}, /* 02CA */
+ {0x02CC,0x02CC},{0x02CD,0x02CD}, /* 02CC */
+ {0x02CE,0x02CE},{0x02CF,0x02CF}, /* 02CE */
+ {0x02D0,0x02D0},{0x02D1,0x02D1}, /* 02D0 */
+ {0x02D2,0x02D2},{0x02D3,0x02D3}, /* 02D2 */
+ {0x02D4,0x02D4},{0x02D5,0x02D5}, /* 02D4 */
+ {0x02D6,0x02D6},{0x02D7,0x02D7}, /* 02D6 */
+ {0x02D8,0x02D8},{0x02D9,0x02D9}, /* 02D8 */
+ {0x02DA,0x02DA},{0x02DB,0x02DB}, /* 02DA */
+ {0x02DC,0x02DC},{0x02DD,0x02DD}, /* 02DC */
+ {0x02DE,0x02DE},{0x02DF,0x02DF}, /* 02DE */
+ {0x02E0,0x02E0},{0x02E1,0x02E1}, /* 02E0 */
+ {0x02E2,0x02E2},{0x02E3,0x02E3}, /* 02E2 */
+ {0x02E4,0x02E4},{0x02E5,0x02E5}, /* 02E4 */
+ {0x02E6,0x02E6},{0x02E7,0x02E7}, /* 02E6 */
+ {0x02E8,0x02E8},{0x02E9,0x02E9}, /* 02E8 */
+ {0x02EA,0x02EA},{0x02EB,0x02EB}, /* 02EA */
+ {0x02EC,0x02EC},{0x02ED,0x02ED}, /* 02EC */
+ {0x02EE,0x02EE},{0x02EF,0x02EF}, /* 02EE */
+ {0x02F0,0x02F0},{0x02F1,0x02F1}, /* 02F0 */
+ {0x02F2,0x02F2},{0x02F3,0x02F3}, /* 02F2 */
+ {0x02F4,0x02F4},{0x02F5,0x02F5}, /* 02F4 */
+ {0x02F6,0x02F6},{0x02F7,0x02F7}, /* 02F6 */
+ {0x02F8,0x02F8},{0x02F9,0x02F9}, /* 02F8 */
+ {0x02FA,0x02FA},{0x02FB,0x02FB}, /* 02FA */
+ {0x02FC,0x02FC},{0x02FD,0x02FD}, /* 02FC */
+ {0x02FE,0x02FE},{0x02FF,0x02FF} /* 02FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u300_casefold_page03[256]={
+ {0x0300,0x0300},{0x0301,0x0301}, /* 0300 */
+ {0x0302,0x0302},{0x0303,0x0303}, /* 0302 */
+ {0x0304,0x0304},{0x0305,0x0305}, /* 0304 */
+ {0x0306,0x0306},{0x0307,0x0307}, /* 0306 */
+ {0x0308,0x0308},{0x0309,0x0309}, /* 0308 */
+ {0x030A,0x030A},{0x030B,0x030B}, /* 030A */
+ {0x030C,0x030C},{0x030D,0x030D}, /* 030C */
+ {0x030E,0x030E},{0x030F,0x030F}, /* 030E */
+ {0x0310,0x0310},{0x0311,0x0311}, /* 0310 */
+ {0x0312,0x0312},{0x0313,0x0313}, /* 0312 */
+ {0x0314,0x0314},{0x0315,0x0315}, /* 0314 */
+ {0x0316,0x0316},{0x0317,0x0317}, /* 0316 */
+ {0x0318,0x0318},{0x0319,0x0319}, /* 0318 */
+ {0x031A,0x031A},{0x031B,0x031B}, /* 031A */
+ {0x031C,0x031C},{0x031D,0x031D}, /* 031C */
+ {0x031E,0x031E},{0x031F,0x031F}, /* 031E */
+ {0x0320,0x0320},{0x0321,0x0321}, /* 0320 */
+ {0x0322,0x0322},{0x0323,0x0323}, /* 0322 */
+ {0x0324,0x0324},{0x0325,0x0325}, /* 0324 */
+ {0x0326,0x0326},{0x0327,0x0327}, /* 0326 */
+ {0x0328,0x0328},{0x0329,0x0329}, /* 0328 */
+ {0x032A,0x032A},{0x032B,0x032B}, /* 032A */
+ {0x032C,0x032C},{0x032D,0x032D}, /* 032C */
+ {0x032E,0x032E},{0x032F,0x032F}, /* 032E */
+ {0x0330,0x0330},{0x0331,0x0331}, /* 0330 */
+ {0x0332,0x0332},{0x0333,0x0333}, /* 0332 */
+ {0x0334,0x0334},{0x0335,0x0335}, /* 0334 */
+ {0x0336,0x0336},{0x0337,0x0337}, /* 0336 */
+ {0x0338,0x0338},{0x0339,0x0339}, /* 0338 */
+ {0x033A,0x033A},{0x033B,0x033B}, /* 033A */
+ {0x033C,0x033C},{0x033D,0x033D}, /* 033C */
+ {0x033E,0x033E},{0x033F,0x033F}, /* 033E */
+ {0x0340,0x0340},{0x0341,0x0341}, /* 0340 */
+ {0x0342,0x0342},{0x0343,0x0343}, /* 0342 */
+ {0x0344,0x0344},{0x0399,0x0345}, /* 0344 */
+ {0x0346,0x0346},{0x0347,0x0347}, /* 0346 */
+ {0x0348,0x0348},{0x0349,0x0349}, /* 0348 */
+ {0x034A,0x034A},{0x034B,0x034B}, /* 034A */
+ {0x034C,0x034C},{0x034D,0x034D}, /* 034C */
+ {0x034E,0x034E},{0x034F,0x034F}, /* 034E */
+ {0x0350,0x0350},{0x0351,0x0351}, /* 0350 */
+ {0x0352,0x0352},{0x0353,0x0353}, /* 0352 */
+ {0x0354,0x0354},{0x0355,0x0355}, /* 0354 */
+ {0x0356,0x0356},{0x0357,0x0357}, /* 0356 */
+ {0x0358,0x0358},{0x0359,0x0359}, /* 0358 */
+ {0x035A,0x035A},{0x035B,0x035B}, /* 035A */
+ {0x035C,0x035C},{0x035D,0x035D}, /* 035C */
+ {0x035E,0x035E},{0x035F,0x035F}, /* 035E */
+ {0x0360,0x0360},{0x0361,0x0361}, /* 0360 */
+ {0x0362,0x0362},{0x0363,0x0363}, /* 0362 */
+ {0x0364,0x0364},{0x0365,0x0365}, /* 0364 */
+ {0x0366,0x0366},{0x0367,0x0367}, /* 0366 */
+ {0x0368,0x0368},{0x0369,0x0369}, /* 0368 */
+ {0x036A,0x036A},{0x036B,0x036B}, /* 036A */
+ {0x036C,0x036C},{0x036D,0x036D}, /* 036C */
+ {0x036E,0x036E},{0x036F,0x036F}, /* 036E */
+ {0x0370,0x0370},{0x0371,0x0371}, /* 0370 */
+ {0x0372,0x0372},{0x0373,0x0373}, /* 0372 */
+ {0x0374,0x0374},{0x0375,0x0375}, /* 0374 */
+ {0x0376,0x0376},{0x0377,0x0377}, /* 0376 */
+ {0x0378,0x0378},{0x0379,0x0379}, /* 0378 */
+ {0x037A,0x037A},{0x037B,0x037B}, /* 037A */
+ {0x037C,0x037C},{0x037D,0x037D}, /* 037C */
+ {0x037E,0x037E},{0x037F,0x037F}, /* 037E */
+ {0x0380,0x0380},{0x0381,0x0381}, /* 0380 */
+ {0x0382,0x0382},{0x0383,0x0383}, /* 0382 */
+ {0x0384,0x0384},{0x0385,0x0385}, /* 0384 */
+ {0x0386,0x03AC},{0x0387,0x0387}, /* 0386 */
+ {0x0388,0x03AD},{0x0389,0x03AE}, /* 0388 */
+ {0x038A,0x03AF},{0x038B,0x038B}, /* 038A */
+ {0x038C,0x03CC},{0x038D,0x038D}, /* 038C */
+ {0x038E,0x03CD},{0x038F,0x03CE}, /* 038E */
+ {0x0390,0x0390},{0x0391,0x03B1}, /* 0390 */
+ {0x0392,0x03B2},{0x0393,0x03B3}, /* 0392 */
+ {0x0394,0x03B4},{0x0395,0x03B5}, /* 0394 */
+ {0x0396,0x03B6},{0x0397,0x03B7}, /* 0396 */
+ {0x0398,0x03B8},{0x0399,0x03B9}, /* 0398 */
+ {0x039A,0x03BA},{0x039B,0x03BB}, /* 039A */
+ {0x039C,0x03BC},{0x039D,0x03BD}, /* 039C */
+ {0x039E,0x03BE},{0x039F,0x03BF}, /* 039E */
+ {0x03A0,0x03C0},{0x03A1,0x03C1}, /* 03A0 */
+ {0x03A2,0x03A2},{0x03A3,0x03C3}, /* 03A2 */
+ {0x03A4,0x03C4},{0x03A5,0x03C5}, /* 03A4 */
+ {0x03A6,0x03C6},{0x03A7,0x03C7}, /* 03A6 */
+ {0x03A8,0x03C8},{0x03A9,0x03C9}, /* 03A8 */
+ {0x03AA,0x03CA},{0x03AB,0x03CB}, /* 03AA */
+ {0x0386,0x03AC},{0x0388,0x03AD}, /* 03AC */
+ {0x0389,0x03AE},{0x038A,0x03AF}, /* 03AE */
+ {0x03B0,0x03B0},{0x0391,0x03B1}, /* 03B0 */
+ {0x0392,0x03B2},{0x0393,0x03B3}, /* 03B2 */
+ {0x0394,0x03B4},{0x0395,0x03B5}, /* 03B4 */
+ {0x0396,0x03B6},{0x0397,0x03B7}, /* 03B6 */
+ {0x0398,0x03B8},{0x0399,0x03B9}, /* 03B8 */
+ {0x039A,0x03BA},{0x039B,0x03BB}, /* 03BA */
+ {0x039C,0x03BC},{0x039D,0x03BD}, /* 03BC */
+ {0x039E,0x03BE},{0x039F,0x03BF}, /* 03BE */
+ {0x03A0,0x03C0},{0x03A1,0x03C1}, /* 03C0 */
+ {0x03A3,0x03C2},{0x03A3,0x03C3}, /* 03C2 */
+ {0x03A4,0x03C4},{0x03A5,0x03C5}, /* 03C4 */
+ {0x03A6,0x03C6},{0x03A7,0x03C7}, /* 03C6 */
+ {0x03A8,0x03C8},{0x03A9,0x03C9}, /* 03C8 */
+ {0x03AA,0x03CA},{0x03AB,0x03CB}, /* 03CA */
+ {0x038C,0x03CC},{0x038E,0x03CD}, /* 03CC */
+ {0x038F,0x03CE},{0x03CF,0x03CF}, /* 03CE */
+ {0x0392,0x03D0},{0x0398,0x03D1}, /* 03D0 */
+ {0x03D2,0x03D2},{0x03D3,0x03D3}, /* 03D2 */
+ {0x03D4,0x03D4},{0x03A6,0x03D5}, /* 03D4 */
+ {0x03A0,0x03D6},{0x03D7,0x03D7}, /* 03D6 */
+ {0x03D8,0x03D8},{0x03D9,0x03D9}, /* 03D8 */
+ {0x03DA,0x03DB},{0x03DA,0x03DB}, /* 03DA */
+ {0x03DC,0x03DD},{0x03DC,0x03DD}, /* 03DC */
+ {0x03DE,0x03DF},{0x03DE,0x03DF}, /* 03DE */
+ {0x03E0,0x03E1},{0x03E0,0x03E1}, /* 03E0 */
+ {0x03E2,0x03E3},{0x03E2,0x03E3}, /* 03E2 */
+ {0x03E4,0x03E5},{0x03E4,0x03E5}, /* 03E4 */
+ {0x03E6,0x03E7},{0x03E6,0x03E7}, /* 03E6 */
+ {0x03E8,0x03E9},{0x03E8,0x03E9}, /* 03E8 */
+ {0x03EA,0x03EB},{0x03EA,0x03EB}, /* 03EA */
+ {0x03EC,0x03ED},{0x03EC,0x03ED}, /* 03EC */
+ {0x03EE,0x03EF},{0x03EE,0x03EF}, /* 03EE */
+ {0x039A,0x03F0},{0x03A1,0x03F1}, /* 03F0 */
+ {0x03A3,0x03F2},{0x03F3,0x03F3}, /* 03F2 */
+ {0x03F4,0x03F4},{0x03F5,0x03F5}, /* 03F4 */
+ {0x03F6,0x03F6},{0x03F7,0x03F7}, /* 03F6 */
+ {0x03F8,0x03F8},{0x03F9,0x03F9}, /* 03F8 */
+ {0x03FA,0x03FA},{0x03FB,0x03FB}, /* 03FA */
+ {0x03FC,0x03FC},{0x03FD,0x03FD}, /* 03FC */
+ {0x03FE,0x03FE},{0x03FF,0x03FF} /* 03FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u300_casefold_page04[256]={
+ {0x0400,0x0450},{0x0401,0x0451}, /* 0400 */
+ {0x0402,0x0452},{0x0403,0x0453}, /* 0402 */
+ {0x0404,0x0454},{0x0405,0x0455}, /* 0404 */
+ {0x0406,0x0456},{0x0407,0x0457}, /* 0406 */
+ {0x0408,0x0458},{0x0409,0x0459}, /* 0408 */
+ {0x040A,0x045A},{0x040B,0x045B}, /* 040A */
+ {0x040C,0x045C},{0x040D,0x045D}, /* 040C */
+ {0x040E,0x045E},{0x040F,0x045F}, /* 040E */
+ {0x0410,0x0430},{0x0411,0x0431}, /* 0410 */
+ {0x0412,0x0432},{0x0413,0x0433}, /* 0412 */
+ {0x0414,0x0434},{0x0415,0x0435}, /* 0414 */
+ {0x0416,0x0436},{0x0417,0x0437}, /* 0416 */
+ {0x0418,0x0438},{0x0419,0x0439}, /* 0418 */
+ {0x041A,0x043A},{0x041B,0x043B}, /* 041A */
+ {0x041C,0x043C},{0x041D,0x043D}, /* 041C */
+ {0x041E,0x043E},{0x041F,0x043F}, /* 041E */
+ {0x0420,0x0440},{0x0421,0x0441}, /* 0420 */
+ {0x0422,0x0442},{0x0423,0x0443}, /* 0422 */
+ {0x0424,0x0444},{0x0425,0x0445}, /* 0424 */
+ {0x0426,0x0446},{0x0427,0x0447}, /* 0426 */
+ {0x0428,0x0448},{0x0429,0x0449}, /* 0428 */
+ {0x042A,0x044A},{0x042B,0x044B}, /* 042A */
+ {0x042C,0x044C},{0x042D,0x044D}, /* 042C */
+ {0x042E,0x044E},{0x042F,0x044F}, /* 042E */
+ {0x0410,0x0430},{0x0411,0x0431}, /* 0430 */
+ {0x0412,0x0432},{0x0413,0x0433}, /* 0432 */
+ {0x0414,0x0434},{0x0415,0x0435}, /* 0434 */
+ {0x0416,0x0436},{0x0417,0x0437}, /* 0436 */
+ {0x0418,0x0438},{0x0419,0x0439}, /* 0438 */
+ {0x041A,0x043A},{0x041B,0x043B}, /* 043A */
+ {0x041C,0x043C},{0x041D,0x043D}, /* 043C */
+ {0x041E,0x043E},{0x041F,0x043F}, /* 043E */
+ {0x0420,0x0440},{0x0421,0x0441}, /* 0440 */
+ {0x0422,0x0442},{0x0423,0x0443}, /* 0442 */
+ {0x0424,0x0444},{0x0425,0x0445}, /* 0444 */
+ {0x0426,0x0446},{0x0427,0x0447}, /* 0446 */
+ {0x0428,0x0448},{0x0429,0x0449}, /* 0448 */
+ {0x042A,0x044A},{0x042B,0x044B}, /* 044A */
+ {0x042C,0x044C},{0x042D,0x044D}, /* 044C */
+ {0x042E,0x044E},{0x042F,0x044F}, /* 044E */
+ {0x0400,0x0450},{0x0401,0x0451}, /* 0450 */
+ {0x0402,0x0452},{0x0403,0x0453}, /* 0452 */
+ {0x0404,0x0454},{0x0405,0x0455}, /* 0454 */
+ {0x0406,0x0456},{0x0407,0x0457}, /* 0456 */
+ {0x0408,0x0458},{0x0409,0x0459}, /* 0458 */
+ {0x040A,0x045A},{0x040B,0x045B}, /* 045A */
+ {0x040C,0x045C},{0x040D,0x045D}, /* 045C */
+ {0x040E,0x045E},{0x040F,0x045F}, /* 045E */
+ {0x0460,0x0461},{0x0460,0x0461}, /* 0460 */
+ {0x0462,0x0463},{0x0462,0x0463}, /* 0462 */
+ {0x0464,0x0465},{0x0464,0x0465}, /* 0464 */
+ {0x0466,0x0467},{0x0466,0x0467}, /* 0466 */
+ {0x0468,0x0469},{0x0468,0x0469}, /* 0468 */
+ {0x046A,0x046B},{0x046A,0x046B}, /* 046A */
+ {0x046C,0x046D},{0x046C,0x046D}, /* 046C */
+ {0x046E,0x046F},{0x046E,0x046F}, /* 046E */
+ {0x0470,0x0471},{0x0470,0x0471}, /* 0470 */
+ {0x0472,0x0473},{0x0472,0x0473}, /* 0472 */
+ {0x0474,0x0475},{0x0474,0x0475}, /* 0474 */
+ {0x0476,0x0477},{0x0476,0x0477}, /* 0476 */
+ {0x0478,0x0479},{0x0478,0x0479}, /* 0478 */
+ {0x047A,0x047B},{0x047A,0x047B}, /* 047A */
+ {0x047C,0x047D},{0x047C,0x047D}, /* 047C */
+ {0x047E,0x047F},{0x047E,0x047F}, /* 047E */
+ {0x0480,0x0481},{0x0480,0x0481}, /* 0480 */
+ {0x0482,0x0482},{0x0483,0x0483}, /* 0482 */
+ {0x0484,0x0484},{0x0485,0x0485}, /* 0484 */
+ {0x0486,0x0486},{0x0487,0x0487}, /* 0486 */
+ {0x0488,0x0488},{0x0489,0x0489}, /* 0488 */
+ {0x048A,0x048A},{0x048B,0x048B}, /* 048A */
+ {0x048C,0x048D},{0x048C,0x048D}, /* 048C */
+ {0x048E,0x048F},{0x048E,0x048F}, /* 048E */
+ {0x0490,0x0491},{0x0490,0x0491}, /* 0490 */
+ {0x0492,0x0493},{0x0492,0x0493}, /* 0492 */
+ {0x0494,0x0495},{0x0494,0x0495}, /* 0494 */
+ {0x0496,0x0497},{0x0496,0x0497}, /* 0496 */
+ {0x0498,0x0499},{0x0498,0x0499}, /* 0498 */
+ {0x049A,0x049B},{0x049A,0x049B}, /* 049A */
+ {0x049C,0x049D},{0x049C,0x049D}, /* 049C */
+ {0x049E,0x049F},{0x049E,0x049F}, /* 049E */
+ {0x04A0,0x04A1},{0x04A0,0x04A1}, /* 04A0 */
+ {0x04A2,0x04A3},{0x04A2,0x04A3}, /* 04A2 */
+ {0x04A4,0x04A5},{0x04A4,0x04A5}, /* 04A4 */
+ {0x04A6,0x04A7},{0x04A6,0x04A7}, /* 04A6 */
+ {0x04A8,0x04A9},{0x04A8,0x04A9}, /* 04A8 */
+ {0x04AA,0x04AB},{0x04AA,0x04AB}, /* 04AA */
+ {0x04AC,0x04AD},{0x04AC,0x04AD}, /* 04AC */
+ {0x04AE,0x04AF},{0x04AE,0x04AF}, /* 04AE */
+ {0x04B0,0x04B1},{0x04B0,0x04B1}, /* 04B0 */
+ {0x04B2,0x04B3},{0x04B2,0x04B3}, /* 04B2 */
+ {0x04B4,0x04B5},{0x04B4,0x04B5}, /* 04B4 */
+ {0x04B6,0x04B7},{0x04B6,0x04B7}, /* 04B6 */
+ {0x04B8,0x04B9},{0x04B8,0x04B9}, /* 04B8 */
+ {0x04BA,0x04BB},{0x04BA,0x04BB}, /* 04BA */
+ {0x04BC,0x04BD},{0x04BC,0x04BD}, /* 04BC */
+ {0x04BE,0x04BF},{0x04BE,0x04BF}, /* 04BE */
+ {0x04C0,0x04C0},{0x04C1,0x04C2}, /* 04C0 */
+ {0x04C1,0x04C2},{0x04C3,0x04C4}, /* 04C2 */
+ {0x04C3,0x04C4},{0x04C5,0x04C5}, /* 04C4 */
+ {0x04C6,0x04C6},{0x04C7,0x04C8}, /* 04C6 */
+ {0x04C7,0x04C8},{0x04C9,0x04C9}, /* 04C8 */
+ {0x04CA,0x04CA},{0x04CB,0x04CC}, /* 04CA */
+ {0x04CB,0x04CC},{0x04CD,0x04CD}, /* 04CC */
+ {0x04CE,0x04CE},{0x04CF,0x04CF}, /* 04CE */
+ {0x04D0,0x04D1},{0x04D0,0x04D1}, /* 04D0 */
+ {0x04D2,0x04D3},{0x04D2,0x04D3}, /* 04D2 */
+ {0x04D4,0x04D5},{0x04D4,0x04D5}, /* 04D4 */
+ {0x04D6,0x04D7},{0x04D6,0x04D7}, /* 04D6 */
+ {0x04D8,0x04D9},{0x04D8,0x04D9}, /* 04D8 */
+ {0x04DA,0x04DB},{0x04DA,0x04DB}, /* 04DA */
+ {0x04DC,0x04DD},{0x04DC,0x04DD}, /* 04DC */
+ {0x04DE,0x04DF},{0x04DE,0x04DF}, /* 04DE */
+ {0x04E0,0x04E1},{0x04E0,0x04E1}, /* 04E0 */
+ {0x04E2,0x04E3},{0x04E2,0x04E3}, /* 04E2 */
+ {0x04E4,0x04E5},{0x04E4,0x04E5}, /* 04E4 */
+ {0x04E6,0x04E7},{0x04E6,0x04E7}, /* 04E6 */
+ {0x04E8,0x04E9},{0x04E8,0x04E9}, /* 04E8 */
+ {0x04EA,0x04EB},{0x04EA,0x04EB}, /* 04EA */
+ {0x04EC,0x04ED},{0x04EC,0x04ED}, /* 04EC */
+ {0x04EE,0x04EF},{0x04EE,0x04EF}, /* 04EE */
+ {0x04F0,0x04F1},{0x04F0,0x04F1}, /* 04F0 */
+ {0x04F2,0x04F3},{0x04F2,0x04F3}, /* 04F2 */
+ {0x04F4,0x04F5},{0x04F4,0x04F5}, /* 04F4 */
+ {0x04F6,0x04F6},{0x04F7,0x04F7}, /* 04F6 */
+ {0x04F8,0x04F9},{0x04F8,0x04F9}, /* 04F8 */
+ {0x04FA,0x04FA},{0x04FB,0x04FB}, /* 04FA */
+ {0x04FC,0x04FC},{0x04FD,0x04FD}, /* 04FC */
+ {0x04FE,0x04FE},{0x04FF,0x04FF} /* 04FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u300_casefold_page05[256]={
+ {0x0500,0x0500},{0x0501,0x0501}, /* 0500 */
+ {0x0502,0x0502},{0x0503,0x0503}, /* 0502 */
+ {0x0504,0x0504},{0x0505,0x0505}, /* 0504 */
+ {0x0506,0x0506},{0x0507,0x0507}, /* 0506 */
+ {0x0508,0x0508},{0x0509,0x0509}, /* 0508 */
+ {0x050A,0x050A},{0x050B,0x050B}, /* 050A */
+ {0x050C,0x050C},{0x050D,0x050D}, /* 050C */
+ {0x050E,0x050E},{0x050F,0x050F}, /* 050E */
+ {0x0510,0x0510},{0x0511,0x0511}, /* 0510 */
+ {0x0512,0x0512},{0x0513,0x0513}, /* 0512 */
+ {0x0514,0x0514},{0x0515,0x0515}, /* 0514 */
+ {0x0516,0x0516},{0x0517,0x0517}, /* 0516 */
+ {0x0518,0x0518},{0x0519,0x0519}, /* 0518 */
+ {0x051A,0x051A},{0x051B,0x051B}, /* 051A */
+ {0x051C,0x051C},{0x051D,0x051D}, /* 051C */
+ {0x051E,0x051E},{0x051F,0x051F}, /* 051E */
+ {0x0520,0x0520},{0x0521,0x0521}, /* 0520 */
+ {0x0522,0x0522},{0x0523,0x0523}, /* 0522 */
+ {0x0524,0x0524},{0x0525,0x0525}, /* 0524 */
+ {0x0526,0x0526},{0x0527,0x0527}, /* 0526 */
+ {0x0528,0x0528},{0x0529,0x0529}, /* 0528 */
+ {0x052A,0x052A},{0x052B,0x052B}, /* 052A */
+ {0x052C,0x052C},{0x052D,0x052D}, /* 052C */
+ {0x052E,0x052E},{0x052F,0x052F}, /* 052E */
+ {0x0530,0x0530},{0x0531,0x0561}, /* 0530 */
+ {0x0532,0x0562},{0x0533,0x0563}, /* 0532 */
+ {0x0534,0x0564},{0x0535,0x0565}, /* 0534 */
+ {0x0536,0x0566},{0x0537,0x0567}, /* 0536 */
+ {0x0538,0x0568},{0x0539,0x0569}, /* 0538 */
+ {0x053A,0x056A},{0x053B,0x056B}, /* 053A */
+ {0x053C,0x056C},{0x053D,0x056D}, /* 053C */
+ {0x053E,0x056E},{0x053F,0x056F}, /* 053E */
+ {0x0540,0x0570},{0x0541,0x0571}, /* 0540 */
+ {0x0542,0x0572},{0x0543,0x0573}, /* 0542 */
+ {0x0544,0x0574},{0x0545,0x0575}, /* 0544 */
+ {0x0546,0x0576},{0x0547,0x0577}, /* 0546 */
+ {0x0548,0x0578},{0x0549,0x0579}, /* 0548 */
+ {0x054A,0x057A},{0x054B,0x057B}, /* 054A */
+ {0x054C,0x057C},{0x054D,0x057D}, /* 054C */
+ {0x054E,0x057E},{0x054F,0x057F}, /* 054E */
+ {0x0550,0x0580},{0x0551,0x0581}, /* 0550 */
+ {0x0552,0x0582},{0x0553,0x0583}, /* 0552 */
+ {0x0554,0x0584},{0x0555,0x0585}, /* 0554 */
+ {0x0556,0x0586},{0x0557,0x0557}, /* 0556 */
+ {0x0558,0x0558},{0x0559,0x0559}, /* 0558 */
+ {0x055A,0x055A},{0x055B,0x055B}, /* 055A */
+ {0x055C,0x055C},{0x055D,0x055D}, /* 055C */
+ {0x055E,0x055E},{0x055F,0x055F}, /* 055E */
+ {0x0560,0x0560},{0x0531,0x0561}, /* 0560 */
+ {0x0532,0x0562},{0x0533,0x0563}, /* 0562 */
+ {0x0534,0x0564},{0x0535,0x0565}, /* 0564 */
+ {0x0536,0x0566},{0x0537,0x0567}, /* 0566 */
+ {0x0538,0x0568},{0x0539,0x0569}, /* 0568 */
+ {0x053A,0x056A},{0x053B,0x056B}, /* 056A */
+ {0x053C,0x056C},{0x053D,0x056D}, /* 056C */
+ {0x053E,0x056E},{0x053F,0x056F}, /* 056E */
+ {0x0540,0x0570},{0x0541,0x0571}, /* 0570 */
+ {0x0542,0x0572},{0x0543,0x0573}, /* 0572 */
+ {0x0544,0x0574},{0x0545,0x0575}, /* 0574 */
+ {0x0546,0x0576},{0x0547,0x0577}, /* 0576 */
+ {0x0548,0x0578},{0x0549,0x0579}, /* 0578 */
+ {0x054A,0x057A},{0x054B,0x057B}, /* 057A */
+ {0x054C,0x057C},{0x054D,0x057D}, /* 057C */
+ {0x054E,0x057E},{0x054F,0x057F}, /* 057E */
+ {0x0550,0x0580},{0x0551,0x0581}, /* 0580 */
+ {0x0552,0x0582},{0x0553,0x0583}, /* 0582 */
+ {0x0554,0x0584},{0x0555,0x0585}, /* 0584 */
+ {0x0556,0x0586},{0x0587,0x0587}, /* 0586 */
+ {0x0588,0x0588},{0x0589,0x0589}, /* 0588 */
+ {0x058A,0x058A},{0x058B,0x058B}, /* 058A */
+ {0x058C,0x058C},{0x058D,0x058D}, /* 058C */
+ {0x058E,0x058E},{0x058F,0x058F}, /* 058E */
+ {0x0590,0x0590},{0x0591,0x0591}, /* 0590 */
+ {0x0592,0x0592},{0x0593,0x0593}, /* 0592 */
+ {0x0594,0x0594},{0x0595,0x0595}, /* 0594 */
+ {0x0596,0x0596},{0x0597,0x0597}, /* 0596 */
+ {0x0598,0x0598},{0x0599,0x0599}, /* 0598 */
+ {0x059A,0x059A},{0x059B,0x059B}, /* 059A */
+ {0x059C,0x059C},{0x059D,0x059D}, /* 059C */
+ {0x059E,0x059E},{0x059F,0x059F}, /* 059E */
+ {0x05A0,0x05A0},{0x05A1,0x05A1}, /* 05A0 */
+ {0x05A2,0x05A2},{0x05A3,0x05A3}, /* 05A2 */
+ {0x05A4,0x05A4},{0x05A5,0x05A5}, /* 05A4 */
+ {0x05A6,0x05A6},{0x05A7,0x05A7}, /* 05A6 */
+ {0x05A8,0x05A8},{0x05A9,0x05A9}, /* 05A8 */
+ {0x05AA,0x05AA},{0x05AB,0x05AB}, /* 05AA */
+ {0x05AC,0x05AC},{0x05AD,0x05AD}, /* 05AC */
+ {0x05AE,0x05AE},{0x05AF,0x05AF}, /* 05AE */
+ {0x05B0,0x05B0},{0x05B1,0x05B1}, /* 05B0 */
+ {0x05B2,0x05B2},{0x05B3,0x05B3}, /* 05B2 */
+ {0x05B4,0x05B4},{0x05B5,0x05B5}, /* 05B4 */
+ {0x05B6,0x05B6},{0x05B7,0x05B7}, /* 05B6 */
+ {0x05B8,0x05B8},{0x05B9,0x05B9}, /* 05B8 */
+ {0x05BA,0x05BA},{0x05BB,0x05BB}, /* 05BA */
+ {0x05BC,0x05BC},{0x05BD,0x05BD}, /* 05BC */
+ {0x05BE,0x05BE},{0x05BF,0x05BF}, /* 05BE */
+ {0x05C0,0x05C0},{0x05C1,0x05C1}, /* 05C0 */
+ {0x05C2,0x05C2},{0x05C3,0x05C3}, /* 05C2 */
+ {0x05C4,0x05C4},{0x05C5,0x05C5}, /* 05C4 */
+ {0x05C6,0x05C6},{0x05C7,0x05C7}, /* 05C6 */
+ {0x05C8,0x05C8},{0x05C9,0x05C9}, /* 05C8 */
+ {0x05CA,0x05CA},{0x05CB,0x05CB}, /* 05CA */
+ {0x05CC,0x05CC},{0x05CD,0x05CD}, /* 05CC */
+ {0x05CE,0x05CE},{0x05CF,0x05CF}, /* 05CE */
+ {0x05D0,0x05D0},{0x05D1,0x05D1}, /* 05D0 */
+ {0x05D2,0x05D2},{0x05D3,0x05D3}, /* 05D2 */
+ {0x05D4,0x05D4},{0x05D5,0x05D5}, /* 05D4 */
+ {0x05D6,0x05D6},{0x05D7,0x05D7}, /* 05D6 */
+ {0x05D8,0x05D8},{0x05D9,0x05D9}, /* 05D8 */
+ {0x05DA,0x05DA},{0x05DB,0x05DB}, /* 05DA */
+ {0x05DC,0x05DC},{0x05DD,0x05DD}, /* 05DC */
+ {0x05DE,0x05DE},{0x05DF,0x05DF}, /* 05DE */
+ {0x05E0,0x05E0},{0x05E1,0x05E1}, /* 05E0 */
+ {0x05E2,0x05E2},{0x05E3,0x05E3}, /* 05E2 */
+ {0x05E4,0x05E4},{0x05E5,0x05E5}, /* 05E4 */
+ {0x05E6,0x05E6},{0x05E7,0x05E7}, /* 05E6 */
+ {0x05E8,0x05E8},{0x05E9,0x05E9}, /* 05E8 */
+ {0x05EA,0x05EA},{0x05EB,0x05EB}, /* 05EA */
+ {0x05EC,0x05EC},{0x05ED,0x05ED}, /* 05EC */
+ {0x05EE,0x05EE},{0x05EF,0x05EF}, /* 05EE */
+ {0x05F0,0x05F0},{0x05F1,0x05F1}, /* 05F0 */
+ {0x05F2,0x05F2},{0x05F3,0x05F3}, /* 05F2 */
+ {0x05F4,0x05F4},{0x05F5,0x05F5}, /* 05F4 */
+ {0x05F6,0x05F6},{0x05F7,0x05F7}, /* 05F6 */
+ {0x05F8,0x05F8},{0x05F9,0x05F9}, /* 05F8 */
+ {0x05FA,0x05FA},{0x05FB,0x05FB}, /* 05FA */
+ {0x05FC,0x05FC},{0x05FD,0x05FD}, /* 05FC */
+ {0x05FE,0x05FE},{0x05FF,0x05FF} /* 05FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u300_casefold_page06[256]={ /* This page is dummy */
+ {0x0600,0x0600},{0x0601,0x0601}, /* 0600 */
+ {0x0602,0x0602},{0x0603,0x0603}, /* 0602 */
+ {0x0604,0x0604},{0x0605,0x0605}, /* 0604 */
+ {0x0606,0x0606},{0x0607,0x0607}, /* 0606 */
+ {0x0608,0x0608},{0x0609,0x0609}, /* 0608 */
+ {0x060A,0x060A},{0x060B,0x060B}, /* 060A */
+ {0x060C,0x060C},{0x060D,0x060D}, /* 060C */
+ {0x060E,0x060E},{0x060F,0x060F}, /* 060E */
+ {0x0610,0x0610},{0x0611,0x0611}, /* 0610 */
+ {0x0612,0x0612},{0x0613,0x0613}, /* 0612 */
+ {0x0614,0x0614},{0x0615,0x0615}, /* 0614 */
+ {0x0616,0x0616},{0x0617,0x0617}, /* 0616 */
+ {0x0618,0x0618},{0x0619,0x0619}, /* 0618 */
+ {0x061A,0x061A},{0x061B,0x061B}, /* 061A */
+ {0x061C,0x061C},{0x061D,0x061D}, /* 061C */
+ {0x061E,0x061E},{0x061F,0x061F}, /* 061E */
+ {0x0620,0x0620},{0x0621,0x0621}, /* 0620 */
+ {0x0622,0x0622},{0x0623,0x0623}, /* 0622 */
+ {0x0624,0x0624},{0x0625,0x0625}, /* 0624 */
+ {0x0626,0x0626},{0x0627,0x0627}, /* 0626 */
+ {0x0628,0x0628},{0x0629,0x0629}, /* 0628 */
+ {0x062A,0x062A},{0x062B,0x062B}, /* 062A */
+ {0x062C,0x062C},{0x062D,0x062D}, /* 062C */
+ {0x062E,0x062E},{0x062F,0x062F}, /* 062E */
+ {0x0630,0x0630},{0x0631,0x0631}, /* 0630 */
+ {0x0632,0x0632},{0x0633,0x0633}, /* 0632 */
+ {0x0634,0x0634},{0x0635,0x0635}, /* 0634 */
+ {0x0636,0x0636},{0x0637,0x0637}, /* 0636 */
+ {0x0638,0x0638},{0x0639,0x0639}, /* 0638 */
+ {0x063A,0x063A},{0x063B,0x063B}, /* 063A */
+ {0x063C,0x063C},{0x063D,0x063D}, /* 063C */
+ {0x063E,0x063E},{0x063F,0x063F}, /* 063E */
+ {0x0640,0x0640},{0x0641,0x0641}, /* 0640 */
+ {0x0642,0x0642},{0x0643,0x0643}, /* 0642 */
+ {0x0644,0x0644},{0x0645,0x0645}, /* 0644 */
+ {0x0646,0x0646},{0x0647,0x0647}, /* 0646 */
+ {0x0648,0x0648},{0x0649,0x0649}, /* 0648 */
+ {0x064A,0x064A},{0x064B,0x064B}, /* 064A */
+ {0x064C,0x064C},{0x064D,0x064D}, /* 064C */
+ {0x064E,0x064E},{0x064F,0x064F}, /* 064E */
+ {0x0650,0x0650},{0x0651,0x0651}, /* 0650 */
+ {0x0652,0x0652},{0x0653,0x0653}, /* 0652 */
+ {0x0654,0x0654},{0x0655,0x0655}, /* 0654 */
+ {0x0656,0x0656},{0x0657,0x0657}, /* 0656 */
+ {0x0658,0x0658},{0x0659,0x0659}, /* 0658 */
+ {0x065A,0x065A},{0x065B,0x065B}, /* 065A */
+ {0x065C,0x065C},{0x065D,0x065D}, /* 065C */
+ {0x065E,0x065E},{0x065F,0x065F}, /* 065E */
+ {0x0660,0x0660},{0x0661,0x0661}, /* 0660 */
+ {0x0662,0x0662},{0x0663,0x0663}, /* 0662 */
+ {0x0664,0x0664},{0x0665,0x0665}, /* 0664 */
+ {0x0666,0x0666},{0x0667,0x0667}, /* 0666 */
+ {0x0668,0x0668},{0x0669,0x0669}, /* 0668 */
+ {0x066A,0x066A},{0x066B,0x066B}, /* 066A */
+ {0x066C,0x066C},{0x066D,0x066D}, /* 066C */
+ {0x066E,0x066E},{0x066F,0x066F}, /* 066E */
+ {0x0670,0x0670},{0x0671,0x0671}, /* 0670 */
+ {0x0672,0x0672},{0x0673,0x0673}, /* 0672 */
+ {0x0674,0x0674},{0x0675,0x0675}, /* 0674 */
+ {0x0676,0x0676},{0x0677,0x0677}, /* 0676 */
+ {0x0678,0x0678},{0x0679,0x0679}, /* 0678 */
+ {0x067A,0x067A},{0x067B,0x067B}, /* 067A */
+ {0x067C,0x067C},{0x067D,0x067D}, /* 067C */
+ {0x067E,0x067E},{0x067F,0x067F}, /* 067E */
+ {0x0680,0x0680},{0x0681,0x0681}, /* 0680 */
+ {0x0682,0x0682},{0x0683,0x0683}, /* 0682 */
+ {0x0684,0x0684},{0x0685,0x0685}, /* 0684 */
+ {0x0686,0x0686},{0x0687,0x0687}, /* 0686 */
+ {0x0688,0x0688},{0x0689,0x0689}, /* 0688 */
+ {0x068A,0x068A},{0x068B,0x068B}, /* 068A */
+ {0x068C,0x068C},{0x068D,0x068D}, /* 068C */
+ {0x068E,0x068E},{0x068F,0x068F}, /* 068E */
+ {0x0690,0x0690},{0x0691,0x0691}, /* 0690 */
+ {0x0692,0x0692},{0x0693,0x0693}, /* 0692 */
+ {0x0694,0x0694},{0x0695,0x0695}, /* 0694 */
+ {0x0696,0x0696},{0x0697,0x0697}, /* 0696 */
+ {0x0698,0x0698},{0x0699,0x0699}, /* 0698 */
+ {0x069A,0x069A},{0x069B,0x069B}, /* 069A */
+ {0x069C,0x069C},{0x069D,0x069D}, /* 069C */
+ {0x069E,0x069E},{0x069F,0x069F}, /* 069E */
+ {0x06A0,0x06A0},{0x06A1,0x06A1}, /* 06A0 */
+ {0x06A2,0x06A2},{0x06A3,0x06A3}, /* 06A2 */
+ {0x06A4,0x06A4},{0x06A5,0x06A5}, /* 06A4 */
+ {0x06A6,0x06A6},{0x06A7,0x06A7}, /* 06A6 */
+ {0x06A8,0x06A8},{0x06A9,0x06A9}, /* 06A8 */
+ {0x06AA,0x06AA},{0x06AB,0x06AB}, /* 06AA */
+ {0x06AC,0x06AC},{0x06AD,0x06AD}, /* 06AC */
+ {0x06AE,0x06AE},{0x06AF,0x06AF}, /* 06AE */
+ {0x06B0,0x06B0},{0x06B1,0x06B1}, /* 06B0 */
+ {0x06B2,0x06B2},{0x06B3,0x06B3}, /* 06B2 */
+ {0x06B4,0x06B4},{0x06B5,0x06B5}, /* 06B4 */
+ {0x06B6,0x06B6},{0x06B7,0x06B7}, /* 06B6 */
+ {0x06B8,0x06B8},{0x06B9,0x06B9}, /* 06B8 */
+ {0x06BA,0x06BA},{0x06BB,0x06BB}, /* 06BA */
+ {0x06BC,0x06BC},{0x06BD,0x06BD}, /* 06BC */
+ {0x06BE,0x06BE},{0x06BF,0x06BF}, /* 06BE */
+ {0x06C0,0x06C0},{0x06C1,0x06C1}, /* 06C0 */
+ {0x06C2,0x06C2},{0x06C3,0x06C3}, /* 06C2 */
+ {0x06C4,0x06C4},{0x06C5,0x06C5}, /* 06C4 */
+ {0x06C6,0x06C6},{0x06C7,0x06C7}, /* 06C6 */
+ {0x06C8,0x06C8},{0x06C9,0x06C9}, /* 06C8 */
+ {0x06CA,0x06CA},{0x06CB,0x06CB}, /* 06CA */
+ {0x06CC,0x06CC},{0x06CD,0x06CD}, /* 06CC */
+ {0x06CE,0x06CE},{0x06CF,0x06CF}, /* 06CE */
+ {0x06D0,0x06D0},{0x06D1,0x06D1}, /* 06D0 */
+ {0x06D2,0x06D2},{0x06D3,0x06D3}, /* 06D2 */
+ {0x06D4,0x06D4},{0x06D5,0x06D5}, /* 06D4 */
+ {0x06D6,0x06D6},{0x06D7,0x06D7}, /* 06D6 */
+ {0x06D8,0x06D8},{0x06D9,0x06D9}, /* 06D8 */
+ {0x06DA,0x06DA},{0x06DB,0x06DB}, /* 06DA */
+ {0x06DC,0x06DC},{0x06DD,0x06DD}, /* 06DC */
+ {0x06DE,0x06DE},{0x06DF,0x06DF}, /* 06DE */
+ {0x06E0,0x06E0},{0x06E1,0x06E1}, /* 06E0 */
+ {0x06E2,0x06E2},{0x06E3,0x06E3}, /* 06E2 */
+ {0x06E4,0x06E4},{0x06E5,0x06E5}, /* 06E4 */
+ {0x06E6,0x06E6},{0x06E7,0x06E7}, /* 06E6 */
+ {0x06E8,0x06E8},{0x06E9,0x06E9}, /* 06E8 */
+ {0x06EA,0x06EA},{0x06EB,0x06EB}, /* 06EA */
+ {0x06EC,0x06EC},{0x06ED,0x06ED}, /* 06EC */
+ {0x06EE,0x06EE},{0x06EF,0x06EF}, /* 06EE */
+ {0x06F0,0x06F0},{0x06F1,0x06F1}, /* 06F0 */
+ {0x06F2,0x06F2},{0x06F3,0x06F3}, /* 06F2 */
+ {0x06F4,0x06F4},{0x06F5,0x06F5}, /* 06F4 */
+ {0x06F6,0x06F6},{0x06F7,0x06F7}, /* 06F6 */
+ {0x06F8,0x06F8},{0x06F9,0x06F9}, /* 06F8 */
+ {0x06FA,0x06FA},{0x06FB,0x06FB}, /* 06FA */
+ {0x06FC,0x06FC},{0x06FD,0x06FD}, /* 06FC */
+ {0x06FE,0x06FE},{0x06FF,0x06FF} /* 06FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u300_casefold_page07[256]={ /* This page is dummy */
+ {0x0700,0x0700},{0x0701,0x0701}, /* 0700 */
+ {0x0702,0x0702},{0x0703,0x0703}, /* 0702 */
+ {0x0704,0x0704},{0x0705,0x0705}, /* 0704 */
+ {0x0706,0x0706},{0x0707,0x0707}, /* 0706 */
+ {0x0708,0x0708},{0x0709,0x0709}, /* 0708 */
+ {0x070A,0x070A},{0x070B,0x070B}, /* 070A */
+ {0x070C,0x070C},{0x070D,0x070D}, /* 070C */
+ {0x070E,0x070E},{0x070F,0x070F}, /* 070E */
+ {0x0710,0x0710},{0x0711,0x0711}, /* 0710 */
+ {0x0712,0x0712},{0x0713,0x0713}, /* 0712 */
+ {0x0714,0x0714},{0x0715,0x0715}, /* 0714 */
+ {0x0716,0x0716},{0x0717,0x0717}, /* 0716 */
+ {0x0718,0x0718},{0x0719,0x0719}, /* 0718 */
+ {0x071A,0x071A},{0x071B,0x071B}, /* 071A */
+ {0x071C,0x071C},{0x071D,0x071D}, /* 071C */
+ {0x071E,0x071E},{0x071F,0x071F}, /* 071E */
+ {0x0720,0x0720},{0x0721,0x0721}, /* 0720 */
+ {0x0722,0x0722},{0x0723,0x0723}, /* 0722 */
+ {0x0724,0x0724},{0x0725,0x0725}, /* 0724 */
+ {0x0726,0x0726},{0x0727,0x0727}, /* 0726 */
+ {0x0728,0x0728},{0x0729,0x0729}, /* 0728 */
+ {0x072A,0x072A},{0x072B,0x072B}, /* 072A */
+ {0x072C,0x072C},{0x072D,0x072D}, /* 072C */
+ {0x072E,0x072E},{0x072F,0x072F}, /* 072E */
+ {0x0730,0x0730},{0x0731,0x0731}, /* 0730 */
+ {0x0732,0x0732},{0x0733,0x0733}, /* 0732 */
+ {0x0734,0x0734},{0x0735,0x0735}, /* 0734 */
+ {0x0736,0x0736},{0x0737,0x0737}, /* 0736 */
+ {0x0738,0x0738},{0x0739,0x0739}, /* 0738 */
+ {0x073A,0x073A},{0x073B,0x073B}, /* 073A */
+ {0x073C,0x073C},{0x073D,0x073D}, /* 073C */
+ {0x073E,0x073E},{0x073F,0x073F}, /* 073E */
+ {0x0740,0x0740},{0x0741,0x0741}, /* 0740 */
+ {0x0742,0x0742},{0x0743,0x0743}, /* 0742 */
+ {0x0744,0x0744},{0x0745,0x0745}, /* 0744 */
+ {0x0746,0x0746},{0x0747,0x0747}, /* 0746 */
+ {0x0748,0x0748},{0x0749,0x0749}, /* 0748 */
+ {0x074A,0x074A},{0x074B,0x074B}, /* 074A */
+ {0x074C,0x074C},{0x074D,0x074D}, /* 074C */
+ {0x074E,0x074E},{0x074F,0x074F}, /* 074E */
+ {0x0750,0x0750},{0x0751,0x0751}, /* 0750 */
+ {0x0752,0x0752},{0x0753,0x0753}, /* 0752 */
+ {0x0754,0x0754},{0x0755,0x0755}, /* 0754 */
+ {0x0756,0x0756},{0x0757,0x0757}, /* 0756 */
+ {0x0758,0x0758},{0x0759,0x0759}, /* 0758 */
+ {0x075A,0x075A},{0x075B,0x075B}, /* 075A */
+ {0x075C,0x075C},{0x075D,0x075D}, /* 075C */
+ {0x075E,0x075E},{0x075F,0x075F}, /* 075E */
+ {0x0760,0x0760},{0x0761,0x0761}, /* 0760 */
+ {0x0762,0x0762},{0x0763,0x0763}, /* 0762 */
+ {0x0764,0x0764},{0x0765,0x0765}, /* 0764 */
+ {0x0766,0x0766},{0x0767,0x0767}, /* 0766 */
+ {0x0768,0x0768},{0x0769,0x0769}, /* 0768 */
+ {0x076A,0x076A},{0x076B,0x076B}, /* 076A */
+ {0x076C,0x076C},{0x076D,0x076D}, /* 076C */
+ {0x076E,0x076E},{0x076F,0x076F}, /* 076E */
+ {0x0770,0x0770},{0x0771,0x0771}, /* 0770 */
+ {0x0772,0x0772},{0x0773,0x0773}, /* 0772 */
+ {0x0774,0x0774},{0x0775,0x0775}, /* 0774 */
+ {0x0776,0x0776},{0x0777,0x0777}, /* 0776 */
+ {0x0778,0x0778},{0x0779,0x0779}, /* 0778 */
+ {0x077A,0x077A},{0x077B,0x077B}, /* 077A */
+ {0x077C,0x077C},{0x077D,0x077D}, /* 077C */
+ {0x077E,0x077E},{0x077F,0x077F}, /* 077E */
+ {0x0780,0x0780},{0x0781,0x0781}, /* 0780 */
+ {0x0782,0x0782},{0x0783,0x0783}, /* 0782 */
+ {0x0784,0x0784},{0x0785,0x0785}, /* 0784 */
+ {0x0786,0x0786},{0x0787,0x0787}, /* 0786 */
+ {0x0788,0x0788},{0x0789,0x0789}, /* 0788 */
+ {0x078A,0x078A},{0x078B,0x078B}, /* 078A */
+ {0x078C,0x078C},{0x078D,0x078D}, /* 078C */
+ {0x078E,0x078E},{0x078F,0x078F}, /* 078E */
+ {0x0790,0x0790},{0x0791,0x0791}, /* 0790 */
+ {0x0792,0x0792},{0x0793,0x0793}, /* 0792 */
+ {0x0794,0x0794},{0x0795,0x0795}, /* 0794 */
+ {0x0796,0x0796},{0x0797,0x0797}, /* 0796 */
+ {0x0798,0x0798},{0x0799,0x0799}, /* 0798 */
+ {0x079A,0x079A},{0x079B,0x079B}, /* 079A */
+ {0x079C,0x079C},{0x079D,0x079D}, /* 079C */
+ {0x079E,0x079E},{0x079F,0x079F}, /* 079E */
+ {0x07A0,0x07A0},{0x07A1,0x07A1}, /* 07A0 */
+ {0x07A2,0x07A2},{0x07A3,0x07A3}, /* 07A2 */
+ {0x07A4,0x07A4},{0x07A5,0x07A5}, /* 07A4 */
+ {0x07A6,0x07A6},{0x07A7,0x07A7}, /* 07A6 */
+ {0x07A8,0x07A8},{0x07A9,0x07A9}, /* 07A8 */
+ {0x07AA,0x07AA},{0x07AB,0x07AB}, /* 07AA */
+ {0x07AC,0x07AC},{0x07AD,0x07AD}, /* 07AC */
+ {0x07AE,0x07AE},{0x07AF,0x07AF}, /* 07AE */
+ {0x07B0,0x07B0},{0x07B1,0x07B1}, /* 07B0 */
+ {0x07B2,0x07B2},{0x07B3,0x07B3}, /* 07B2 */
+ {0x07B4,0x07B4},{0x07B5,0x07B5}, /* 07B4 */
+ {0x07B6,0x07B6},{0x07B7,0x07B7}, /* 07B6 */
+ {0x07B8,0x07B8},{0x07B9,0x07B9}, /* 07B8 */
+ {0x07BA,0x07BA},{0x07BB,0x07BB}, /* 07BA */
+ {0x07BC,0x07BC},{0x07BD,0x07BD}, /* 07BC */
+ {0x07BE,0x07BE},{0x07BF,0x07BF}, /* 07BE */
+ {0x07C0,0x07C0},{0x07C1,0x07C1}, /* 07C0 */
+ {0x07C2,0x07C2},{0x07C3,0x07C3}, /* 07C2 */
+ {0x07C4,0x07C4},{0x07C5,0x07C5}, /* 07C4 */
+ {0x07C6,0x07C6},{0x07C7,0x07C7}, /* 07C6 */
+ {0x07C8,0x07C8},{0x07C9,0x07C9}, /* 07C8 */
+ {0x07CA,0x07CA},{0x07CB,0x07CB}, /* 07CA */
+ {0x07CC,0x07CC},{0x07CD,0x07CD}, /* 07CC */
+ {0x07CE,0x07CE},{0x07CF,0x07CF}, /* 07CE */
+ {0x07D0,0x07D0},{0x07D1,0x07D1}, /* 07D0 */
+ {0x07D2,0x07D2},{0x07D3,0x07D3}, /* 07D2 */
+ {0x07D4,0x07D4},{0x07D5,0x07D5}, /* 07D4 */
+ {0x07D6,0x07D6},{0x07D7,0x07D7}, /* 07D6 */
+ {0x07D8,0x07D8},{0x07D9,0x07D9}, /* 07D8 */
+ {0x07DA,0x07DA},{0x07DB,0x07DB}, /* 07DA */
+ {0x07DC,0x07DC},{0x07DD,0x07DD}, /* 07DC */
+ {0x07DE,0x07DE},{0x07DF,0x07DF}, /* 07DE */
+ {0x07E0,0x07E0},{0x07E1,0x07E1}, /* 07E0 */
+ {0x07E2,0x07E2},{0x07E3,0x07E3}, /* 07E2 */
+ {0x07E4,0x07E4},{0x07E5,0x07E5}, /* 07E4 */
+ {0x07E6,0x07E6},{0x07E7,0x07E7}, /* 07E6 */
+ {0x07E8,0x07E8},{0x07E9,0x07E9}, /* 07E8 */
+ {0x07EA,0x07EA},{0x07EB,0x07EB}, /* 07EA */
+ {0x07EC,0x07EC},{0x07ED,0x07ED}, /* 07EC */
+ {0x07EE,0x07EE},{0x07EF,0x07EF}, /* 07EE */
+ {0x07F0,0x07F0},{0x07F1,0x07F1}, /* 07F0 */
+ {0x07F2,0x07F2},{0x07F3,0x07F3}, /* 07F2 */
+ {0x07F4,0x07F4},{0x07F5,0x07F5}, /* 07F4 */
+ {0x07F6,0x07F6},{0x07F7,0x07F7}, /* 07F6 */
+ {0x07F8,0x07F8},{0x07F9,0x07F9}, /* 07F8 */
+ {0x07FA,0x07FA},{0x07FB,0x07FB}, /* 07FA */
+ {0x07FC,0x07FC},{0x07FD,0x07FD}, /* 07FC */
+ {0x07FE,0x07FE},{0x07FF,0x07FF} /* 07FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u300_casefold_page1E[256]={
+ {0x1E00,0x1E01},{0x1E00,0x1E01}, /* 1E00 */
+ {0x1E02,0x1E03},{0x1E02,0x1E03}, /* 1E02 */
+ {0x1E04,0x1E05},{0x1E04,0x1E05}, /* 1E04 */
+ {0x1E06,0x1E07},{0x1E06,0x1E07}, /* 1E06 */
+ {0x1E08,0x1E09},{0x1E08,0x1E09}, /* 1E08 */
+ {0x1E0A,0x1E0B},{0x1E0A,0x1E0B}, /* 1E0A */
+ {0x1E0C,0x1E0D},{0x1E0C,0x1E0D}, /* 1E0C */
+ {0x1E0E,0x1E0F},{0x1E0E,0x1E0F}, /* 1E0E */
+ {0x1E10,0x1E11},{0x1E10,0x1E11}, /* 1E10 */
+ {0x1E12,0x1E13},{0x1E12,0x1E13}, /* 1E12 */
+ {0x1E14,0x1E15},{0x1E14,0x1E15}, /* 1E14 */
+ {0x1E16,0x1E17},{0x1E16,0x1E17}, /* 1E16 */
+ {0x1E18,0x1E19},{0x1E18,0x1E19}, /* 1E18 */
+ {0x1E1A,0x1E1B},{0x1E1A,0x1E1B}, /* 1E1A */
+ {0x1E1C,0x1E1D},{0x1E1C,0x1E1D}, /* 1E1C */
+ {0x1E1E,0x1E1F},{0x1E1E,0x1E1F}, /* 1E1E */
+ {0x1E20,0x1E21},{0x1E20,0x1E21}, /* 1E20 */
+ {0x1E22,0x1E23},{0x1E22,0x1E23}, /* 1E22 */
+ {0x1E24,0x1E25},{0x1E24,0x1E25}, /* 1E24 */
+ {0x1E26,0x1E27},{0x1E26,0x1E27}, /* 1E26 */
+ {0x1E28,0x1E29},{0x1E28,0x1E29}, /* 1E28 */
+ {0x1E2A,0x1E2B},{0x1E2A,0x1E2B}, /* 1E2A */
+ {0x1E2C,0x1E2D},{0x1E2C,0x1E2D}, /* 1E2C */
+ {0x1E2E,0x1E2F},{0x1E2E,0x1E2F}, /* 1E2E */
+ {0x1E30,0x1E31},{0x1E30,0x1E31}, /* 1E30 */
+ {0x1E32,0x1E33},{0x1E32,0x1E33}, /* 1E32 */
+ {0x1E34,0x1E35},{0x1E34,0x1E35}, /* 1E34 */
+ {0x1E36,0x1E37},{0x1E36,0x1E37}, /* 1E36 */
+ {0x1E38,0x1E39},{0x1E38,0x1E39}, /* 1E38 */
+ {0x1E3A,0x1E3B},{0x1E3A,0x1E3B}, /* 1E3A */
+ {0x1E3C,0x1E3D},{0x1E3C,0x1E3D}, /* 1E3C */
+ {0x1E3E,0x1E3F},{0x1E3E,0x1E3F}, /* 1E3E */
+ {0x1E40,0x1E41},{0x1E40,0x1E41}, /* 1E40 */
+ {0x1E42,0x1E43},{0x1E42,0x1E43}, /* 1E42 */
+ {0x1E44,0x1E45},{0x1E44,0x1E45}, /* 1E44 */
+ {0x1E46,0x1E47},{0x1E46,0x1E47}, /* 1E46 */
+ {0x1E48,0x1E49},{0x1E48,0x1E49}, /* 1E48 */
+ {0x1E4A,0x1E4B},{0x1E4A,0x1E4B}, /* 1E4A */
+ {0x1E4C,0x1E4D},{0x1E4C,0x1E4D}, /* 1E4C */
+ {0x1E4E,0x1E4F},{0x1E4E,0x1E4F}, /* 1E4E */
+ {0x1E50,0x1E51},{0x1E50,0x1E51}, /* 1E50 */
+ {0x1E52,0x1E53},{0x1E52,0x1E53}, /* 1E52 */
+ {0x1E54,0x1E55},{0x1E54,0x1E55}, /* 1E54 */
+ {0x1E56,0x1E57},{0x1E56,0x1E57}, /* 1E56 */
+ {0x1E58,0x1E59},{0x1E58,0x1E59}, /* 1E58 */
+ {0x1E5A,0x1E5B},{0x1E5A,0x1E5B}, /* 1E5A */
+ {0x1E5C,0x1E5D},{0x1E5C,0x1E5D}, /* 1E5C */
+ {0x1E5E,0x1E5F},{0x1E5E,0x1E5F}, /* 1E5E */
+ {0x1E60,0x1E61},{0x1E60,0x1E61}, /* 1E60 */
+ {0x1E62,0x1E63},{0x1E62,0x1E63}, /* 1E62 */
+ {0x1E64,0x1E65},{0x1E64,0x1E65}, /* 1E64 */
+ {0x1E66,0x1E67},{0x1E66,0x1E67}, /* 1E66 */
+ {0x1E68,0x1E69},{0x1E68,0x1E69}, /* 1E68 */
+ {0x1E6A,0x1E6B},{0x1E6A,0x1E6B}, /* 1E6A */
+ {0x1E6C,0x1E6D},{0x1E6C,0x1E6D}, /* 1E6C */
+ {0x1E6E,0x1E6F},{0x1E6E,0x1E6F}, /* 1E6E */
+ {0x1E70,0x1E71},{0x1E70,0x1E71}, /* 1E70 */
+ {0x1E72,0x1E73},{0x1E72,0x1E73}, /* 1E72 */
+ {0x1E74,0x1E75},{0x1E74,0x1E75}, /* 1E74 */
+ {0x1E76,0x1E77},{0x1E76,0x1E77}, /* 1E76 */
+ {0x1E78,0x1E79},{0x1E78,0x1E79}, /* 1E78 */
+ {0x1E7A,0x1E7B},{0x1E7A,0x1E7B}, /* 1E7A */
+ {0x1E7C,0x1E7D},{0x1E7C,0x1E7D}, /* 1E7C */
+ {0x1E7E,0x1E7F},{0x1E7E,0x1E7F}, /* 1E7E */
+ {0x1E80,0x1E81},{0x1E80,0x1E81}, /* 1E80 */
+ {0x1E82,0x1E83},{0x1E82,0x1E83}, /* 1E82 */
+ {0x1E84,0x1E85},{0x1E84,0x1E85}, /* 1E84 */
+ {0x1E86,0x1E87},{0x1E86,0x1E87}, /* 1E86 */
+ {0x1E88,0x1E89},{0x1E88,0x1E89}, /* 1E88 */
+ {0x1E8A,0x1E8B},{0x1E8A,0x1E8B}, /* 1E8A */
+ {0x1E8C,0x1E8D},{0x1E8C,0x1E8D}, /* 1E8C */
+ {0x1E8E,0x1E8F},{0x1E8E,0x1E8F}, /* 1E8E */
+ {0x1E90,0x1E91},{0x1E90,0x1E91}, /* 1E90 */
+ {0x1E92,0x1E93},{0x1E92,0x1E93}, /* 1E92 */
+ {0x1E94,0x1E95},{0x1E94,0x1E95}, /* 1E94 */
+ {0x1E96,0x1E96},{0x1E97,0x1E97}, /* 1E96 */
+ {0x1E98,0x1E98},{0x1E99,0x1E99}, /* 1E98 */
+ {0x1E9A,0x1E9A},{0x1E60,0x1E9B}, /* 1E9A */
+ {0x1E9C,0x1E9C},{0x1E9D,0x1E9D}, /* 1E9C */
+ {0x1E9E,0x1E9E},{0x1E9F,0x1E9F}, /* 1E9E */
+ {0x1EA0,0x1EA1},{0x1EA0,0x1EA1}, /* 1EA0 */
+ {0x1EA2,0x1EA3},{0x1EA2,0x1EA3}, /* 1EA2 */
+ {0x1EA4,0x1EA5},{0x1EA4,0x1EA5}, /* 1EA4 */
+ {0x1EA6,0x1EA7},{0x1EA6,0x1EA7}, /* 1EA6 */
+ {0x1EA8,0x1EA9},{0x1EA8,0x1EA9}, /* 1EA8 */
+ {0x1EAA,0x1EAB},{0x1EAA,0x1EAB}, /* 1EAA */
+ {0x1EAC,0x1EAD},{0x1EAC,0x1EAD}, /* 1EAC */
+ {0x1EAE,0x1EAF},{0x1EAE,0x1EAF}, /* 1EAE */
+ {0x1EB0,0x1EB1},{0x1EB0,0x1EB1}, /* 1EB0 */
+ {0x1EB2,0x1EB3},{0x1EB2,0x1EB3}, /* 1EB2 */
+ {0x1EB4,0x1EB5},{0x1EB4,0x1EB5}, /* 1EB4 */
+ {0x1EB6,0x1EB7},{0x1EB6,0x1EB7}, /* 1EB6 */
+ {0x1EB8,0x1EB9},{0x1EB8,0x1EB9}, /* 1EB8 */
+ {0x1EBA,0x1EBB},{0x1EBA,0x1EBB}, /* 1EBA */
+ {0x1EBC,0x1EBD},{0x1EBC,0x1EBD}, /* 1EBC */
+ {0x1EBE,0x1EBF},{0x1EBE,0x1EBF}, /* 1EBE */
+ {0x1EC0,0x1EC1},{0x1EC0,0x1EC1}, /* 1EC0 */
+ {0x1EC2,0x1EC3},{0x1EC2,0x1EC3}, /* 1EC2 */
+ {0x1EC4,0x1EC5},{0x1EC4,0x1EC5}, /* 1EC4 */
+ {0x1EC6,0x1EC7},{0x1EC6,0x1EC7}, /* 1EC6 */
+ {0x1EC8,0x1EC9},{0x1EC8,0x1EC9}, /* 1EC8 */
+ {0x1ECA,0x1ECB},{0x1ECA,0x1ECB}, /* 1ECA */
+ {0x1ECC,0x1ECD},{0x1ECC,0x1ECD}, /* 1ECC */
+ {0x1ECE,0x1ECF},{0x1ECE,0x1ECF}, /* 1ECE */
+ {0x1ED0,0x1ED1},{0x1ED0,0x1ED1}, /* 1ED0 */
+ {0x1ED2,0x1ED3},{0x1ED2,0x1ED3}, /* 1ED2 */
+ {0x1ED4,0x1ED5},{0x1ED4,0x1ED5}, /* 1ED4 */
+ {0x1ED6,0x1ED7},{0x1ED6,0x1ED7}, /* 1ED6 */
+ {0x1ED8,0x1ED9},{0x1ED8,0x1ED9}, /* 1ED8 */
+ {0x1EDA,0x1EDB},{0x1EDA,0x1EDB}, /* 1EDA */
+ {0x1EDC,0x1EDD},{0x1EDC,0x1EDD}, /* 1EDC */
+ {0x1EDE,0x1EDF},{0x1EDE,0x1EDF}, /* 1EDE */
+ {0x1EE0,0x1EE1},{0x1EE0,0x1EE1}, /* 1EE0 */
+ {0x1EE2,0x1EE3},{0x1EE2,0x1EE3}, /* 1EE2 */
+ {0x1EE4,0x1EE5},{0x1EE4,0x1EE5}, /* 1EE4 */
+ {0x1EE6,0x1EE7},{0x1EE6,0x1EE7}, /* 1EE6 */
+ {0x1EE8,0x1EE9},{0x1EE8,0x1EE9}, /* 1EE8 */
+ {0x1EEA,0x1EEB},{0x1EEA,0x1EEB}, /* 1EEA */
+ {0x1EEC,0x1EED},{0x1EEC,0x1EED}, /* 1EEC */
+ {0x1EEE,0x1EEF},{0x1EEE,0x1EEF}, /* 1EEE */
+ {0x1EF0,0x1EF1},{0x1EF0,0x1EF1}, /* 1EF0 */
+ {0x1EF2,0x1EF3},{0x1EF2,0x1EF3}, /* 1EF2 */
+ {0x1EF4,0x1EF5},{0x1EF4,0x1EF5}, /* 1EF4 */
+ {0x1EF6,0x1EF7},{0x1EF6,0x1EF7}, /* 1EF6 */
+ {0x1EF8,0x1EF9},{0x1EF8,0x1EF9}, /* 1EF8 */
+ {0x1EFA,0x1EFA},{0x1EFB,0x1EFB}, /* 1EFA */
+ {0x1EFC,0x1EFC},{0x1EFD,0x1EFD}, /* 1EFC */
+ {0x1EFE,0x1EFE},{0x1EFF,0x1EFF} /* 1EFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u300_casefold_page1F[256]={
+ {0x1F08,0x1F00},{0x1F09,0x1F01}, /* 1F00 */
+ {0x1F0A,0x1F02},{0x1F0B,0x1F03}, /* 1F02 */
+ {0x1F0C,0x1F04},{0x1F0D,0x1F05}, /* 1F04 */
+ {0x1F0E,0x1F06},{0x1F0F,0x1F07}, /* 1F06 */
+ {0x1F08,0x1F00},{0x1F09,0x1F01}, /* 1F08 */
+ {0x1F0A,0x1F02},{0x1F0B,0x1F03}, /* 1F0A */
+ {0x1F0C,0x1F04},{0x1F0D,0x1F05}, /* 1F0C */
+ {0x1F0E,0x1F06},{0x1F0F,0x1F07}, /* 1F0E */
+ {0x1F18,0x1F10},{0x1F19,0x1F11}, /* 1F10 */
+ {0x1F1A,0x1F12},{0x1F1B,0x1F13}, /* 1F12 */
+ {0x1F1C,0x1F14},{0x1F1D,0x1F15}, /* 1F14 */
+ {0x1F16,0x1F16},{0x1F17,0x1F17}, /* 1F16 */
+ {0x1F18,0x1F10},{0x1F19,0x1F11}, /* 1F18 */
+ {0x1F1A,0x1F12},{0x1F1B,0x1F13}, /* 1F1A */
+ {0x1F1C,0x1F14},{0x1F1D,0x1F15}, /* 1F1C */
+ {0x1F1E,0x1F1E},{0x1F1F,0x1F1F}, /* 1F1E */
+ {0x1F28,0x1F20},{0x1F29,0x1F21}, /* 1F20 */
+ {0x1F2A,0x1F22},{0x1F2B,0x1F23}, /* 1F22 */
+ {0x1F2C,0x1F24},{0x1F2D,0x1F25}, /* 1F24 */
+ {0x1F2E,0x1F26},{0x1F2F,0x1F27}, /* 1F26 */
+ {0x1F28,0x1F20},{0x1F29,0x1F21}, /* 1F28 */
+ {0x1F2A,0x1F22},{0x1F2B,0x1F23}, /* 1F2A */
+ {0x1F2C,0x1F24},{0x1F2D,0x1F25}, /* 1F2C */
+ {0x1F2E,0x1F26},{0x1F2F,0x1F27}, /* 1F2E */
+ {0x1F38,0x1F30},{0x1F39,0x1F31}, /* 1F30 */
+ {0x1F3A,0x1F32},{0x1F3B,0x1F33}, /* 1F32 */
+ {0x1F3C,0x1F34},{0x1F3D,0x1F35}, /* 1F34 */
+ {0x1F3E,0x1F36},{0x1F3F,0x1F37}, /* 1F36 */
+ {0x1F38,0x1F30},{0x1F39,0x1F31}, /* 1F38 */
+ {0x1F3A,0x1F32},{0x1F3B,0x1F33}, /* 1F3A */
+ {0x1F3C,0x1F34},{0x1F3D,0x1F35}, /* 1F3C */
+ {0x1F3E,0x1F36},{0x1F3F,0x1F37}, /* 1F3E */
+ {0x1F48,0x1F40},{0x1F49,0x1F41}, /* 1F40 */
+ {0x1F4A,0x1F42},{0x1F4B,0x1F43}, /* 1F42 */
+ {0x1F4C,0x1F44},{0x1F4D,0x1F45}, /* 1F44 */
+ {0x1F46,0x1F46},{0x1F47,0x1F47}, /* 1F46 */
+ {0x1F48,0x1F40},{0x1F49,0x1F41}, /* 1F48 */
+ {0x1F4A,0x1F42},{0x1F4B,0x1F43}, /* 1F4A */
+ {0x1F4C,0x1F44},{0x1F4D,0x1F45}, /* 1F4C */
+ {0x1F4E,0x1F4E},{0x1F4F,0x1F4F}, /* 1F4E */
+ {0x1F50,0x1F50},{0x1F59,0x1F51}, /* 1F50 */
+ {0x1F52,0x1F52},{0x1F5B,0x1F53}, /* 1F52 */
+ {0x1F54,0x1F54},{0x1F5D,0x1F55}, /* 1F54 */
+ {0x1F56,0x1F56},{0x1F5F,0x1F57}, /* 1F56 */
+ {0x1F58,0x1F58},{0x1F59,0x1F51}, /* 1F58 */
+ {0x1F5A,0x1F5A},{0x1F5B,0x1F53}, /* 1F5A */
+ {0x1F5C,0x1F5C},{0x1F5D,0x1F55}, /* 1F5C */
+ {0x1F5E,0x1F5E},{0x1F5F,0x1F57}, /* 1F5E */
+ {0x1F68,0x1F60},{0x1F69,0x1F61}, /* 1F60 */
+ {0x1F6A,0x1F62},{0x1F6B,0x1F63}, /* 1F62 */
+ {0x1F6C,0x1F64},{0x1F6D,0x1F65}, /* 1F64 */
+ {0x1F6E,0x1F66},{0x1F6F,0x1F67}, /* 1F66 */
+ {0x1F68,0x1F60},{0x1F69,0x1F61}, /* 1F68 */
+ {0x1F6A,0x1F62},{0x1F6B,0x1F63}, /* 1F6A */
+ {0x1F6C,0x1F64},{0x1F6D,0x1F65}, /* 1F6C */
+ {0x1F6E,0x1F66},{0x1F6F,0x1F67}, /* 1F6E */
+ {0x1FBA,0x1F70},{0x1FBB,0x1F71}, /* 1F70 */
+ {0x1FC8,0x1F72},{0x1FC9,0x1F73}, /* 1F72 */
+ {0x1FCA,0x1F74},{0x1FCB,0x1F75}, /* 1F74 */
+ {0x1FDA,0x1F76},{0x1FDB,0x1F77}, /* 1F76 */
+ {0x1FF8,0x1F78},{0x1FF9,0x1F79}, /* 1F78 */
+ {0x1FEA,0x1F7A},{0x1FEB,0x1F7B}, /* 1F7A */
+ {0x1FFA,0x1F7C},{0x1FFB,0x1F7D}, /* 1F7C */
+ {0x1F7E,0x1F7E},{0x1F7F,0x1F7F}, /* 1F7E */
+ {0x1F88,0x1F80},{0x1F89,0x1F81}, /* 1F80 */
+ {0x1F8A,0x1F82},{0x1F8B,0x1F83}, /* 1F82 */
+ {0x1F8C,0x1F84},{0x1F8D,0x1F85}, /* 1F84 */
+ {0x1F8E,0x1F86},{0x1F8F,0x1F87}, /* 1F86 */
+ {0x1F88,0x1F80},{0x1F89,0x1F81}, /* 1F88 */
+ {0x1F8A,0x1F82},{0x1F8B,0x1F83}, /* 1F8A */
+ {0x1F8C,0x1F84},{0x1F8D,0x1F85}, /* 1F8C */
+ {0x1F8E,0x1F86},{0x1F8F,0x1F87}, /* 1F8E */
+ {0x1F98,0x1F90},{0x1F99,0x1F91}, /* 1F90 */
+ {0x1F9A,0x1F92},{0x1F9B,0x1F93}, /* 1F92 */
+ {0x1F9C,0x1F94},{0x1F9D,0x1F95}, /* 1F94 */
+ {0x1F9E,0x1F96},{0x1F9F,0x1F97}, /* 1F96 */
+ {0x1F98,0x1F90},{0x1F99,0x1F91}, /* 1F98 */
+ {0x1F9A,0x1F92},{0x1F9B,0x1F93}, /* 1F9A */
+ {0x1F9C,0x1F94},{0x1F9D,0x1F95}, /* 1F9C */
+ {0x1F9E,0x1F96},{0x1F9F,0x1F97}, /* 1F9E */
+ {0x1FA8,0x1FA0},{0x1FA9,0x1FA1}, /* 1FA0 */
+ {0x1FAA,0x1FA2},{0x1FAB,0x1FA3}, /* 1FA2 */
+ {0x1FAC,0x1FA4},{0x1FAD,0x1FA5}, /* 1FA4 */
+ {0x1FAE,0x1FA6},{0x1FAF,0x1FA7}, /* 1FA6 */
+ {0x1FA8,0x1FA0},{0x1FA9,0x1FA1}, /* 1FA8 */
+ {0x1FAA,0x1FA2},{0x1FAB,0x1FA3}, /* 1FAA */
+ {0x1FAC,0x1FA4},{0x1FAD,0x1FA5}, /* 1FAC */
+ {0x1FAE,0x1FA6},{0x1FAF,0x1FA7}, /* 1FAE */
+ {0x1FB8,0x1FB0},{0x1FB9,0x1FB1}, /* 1FB0 */
+ {0x1FB2,0x1FB2},{0x1FBC,0x1FB3}, /* 1FB2 */
+ {0x1FB4,0x1FB4},{0x1FB5,0x1FB5}, /* 1FB4 */
+ {0x1FB6,0x1FB6},{0x1FB7,0x1FB7}, /* 1FB6 */
+ {0x1FB8,0x1FB0},{0x1FB9,0x1FB1}, /* 1FB8 */
+ {0x1FBA,0x1F70},{0x1FBB,0x1F71}, /* 1FBA */
+ {0x1FBC,0x1FB3},{0x1FBD,0x1FBD}, /* 1FBC */
+ {0x0399,0x1FBE},{0x1FBF,0x1FBF}, /* 1FBE */
+ {0x1FC0,0x1FC0},{0x1FC1,0x1FC1}, /* 1FC0 */
+ {0x1FC2,0x1FC2},{0x1FCC,0x1FC3}, /* 1FC2 */
+ {0x1FC4,0x1FC4},{0x1FC5,0x1FC5}, /* 1FC4 */
+ {0x1FC6,0x1FC6},{0x1FC7,0x1FC7}, /* 1FC6 */
+ {0x1FC8,0x1F72},{0x1FC9,0x1F73}, /* 1FC8 */
+ {0x1FCA,0x1F74},{0x1FCB,0x1F75}, /* 1FCA */
+ {0x1FCC,0x1FC3},{0x1FCD,0x1FCD}, /* 1FCC */
+ {0x1FCE,0x1FCE},{0x1FCF,0x1FCF}, /* 1FCE */
+ {0x1FD8,0x1FD0},{0x1FD9,0x1FD1}, /* 1FD0 */
+ {0x1FD2,0x1FD2},{0x1FD3,0x1FD3}, /* 1FD2 */
+ {0x1FD4,0x1FD4},{0x1FD5,0x1FD5}, /* 1FD4 */
+ {0x1FD6,0x1FD6},{0x1FD7,0x1FD7}, /* 1FD6 */
+ {0x1FD8,0x1FD0},{0x1FD9,0x1FD1}, /* 1FD8 */
+ {0x1FDA,0x1F76},{0x1FDB,0x1F77}, /* 1FDA */
+ {0x1FDC,0x1FDC},{0x1FDD,0x1FDD}, /* 1FDC */
+ {0x1FDE,0x1FDE},{0x1FDF,0x1FDF}, /* 1FDE */
+ {0x1FE8,0x1FE0},{0x1FE9,0x1FE1}, /* 1FE0 */
+ {0x1FE2,0x1FE2},{0x1FE3,0x1FE3}, /* 1FE2 */
+ {0x1FE4,0x1FE4},{0x1FEC,0x1FE5}, /* 1FE4 */
+ {0x1FE6,0x1FE6},{0x1FE7,0x1FE7}, /* 1FE6 */
+ {0x1FE8,0x1FE0},{0x1FE9,0x1FE1}, /* 1FE8 */
+ {0x1FEA,0x1F7A},{0x1FEB,0x1F7B}, /* 1FEA */
+ {0x1FEC,0x1FE5},{0x1FED,0x1FED}, /* 1FEC */
+ {0x1FEE,0x1FEE},{0x1FEF,0x1FEF}, /* 1FEE */
+ {0x1FF0,0x1FF0},{0x1FF1,0x1FF1}, /* 1FF0 */
+ {0x1FF2,0x1FF2},{0x1FFC,0x1FF3}, /* 1FF2 */
+ {0x1FF4,0x1FF4},{0x1FF5,0x1FF5}, /* 1FF4 */
+ {0x1FF6,0x1FF6},{0x1FF7,0x1FF7}, /* 1FF6 */
+ {0x1FF8,0x1F78},{0x1FF9,0x1F79}, /* 1FF8 */
+ {0x1FFA,0x1F7C},{0x1FFB,0x1F7D}, /* 1FFA */
+ {0x1FFC,0x1FF3},{0x1FFD,0x1FFD}, /* 1FFC */
+ {0x1FFE,0x1FFE},{0x1FFF,0x1FFF} /* 1FFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u300_casefold_page21[256]={
+ {0x2100,0x2100},{0x2101,0x2101}, /* 2100 */
+ {0x2102,0x2102},{0x2103,0x2103}, /* 2102 */
+ {0x2104,0x2104},{0x2105,0x2105}, /* 2104 */
+ {0x2106,0x2106},{0x2107,0x2107}, /* 2106 */
+ {0x2108,0x2108},{0x2109,0x2109}, /* 2108 */
+ {0x210A,0x210A},{0x210B,0x210B}, /* 210A */
+ {0x210C,0x210C},{0x210D,0x210D}, /* 210C */
+ {0x210E,0x210E},{0x210F,0x210F}, /* 210E */
+ {0x2110,0x2110},{0x2111,0x2111}, /* 2110 */
+ {0x2112,0x2112},{0x2113,0x2113}, /* 2112 */
+ {0x2114,0x2114},{0x2115,0x2115}, /* 2114 */
+ {0x2116,0x2116},{0x2117,0x2117}, /* 2116 */
+ {0x2118,0x2118},{0x2119,0x2119}, /* 2118 */
+ {0x211A,0x211A},{0x211B,0x211B}, /* 211A */
+ {0x211C,0x211C},{0x211D,0x211D}, /* 211C */
+ {0x211E,0x211E},{0x211F,0x211F}, /* 211E */
+ {0x2120,0x2120},{0x2121,0x2121}, /* 2120 */
+ {0x2122,0x2122},{0x2123,0x2123}, /* 2122 */
+ {0x2124,0x2124},{0x2125,0x2125}, /* 2124 */
+ {0x2126,0x03C9},{0x2127,0x2127}, /* 2126 */
+ {0x2128,0x2128},{0x2129,0x2129}, /* 2128 */
+ {0x212A,0x006B},{0x212B,0x00E5}, /* 212A */
+ {0x212C,0x212C},{0x212D,0x212D}, /* 212C */
+ {0x212E,0x212E},{0x212F,0x212F}, /* 212E */
+ {0x2130,0x2130},{0x2131,0x2131}, /* 2130 */
+ {0x2132,0x2132},{0x2133,0x2133}, /* 2132 */
+ {0x2134,0x2134},{0x2135,0x2135}, /* 2134 */
+ {0x2136,0x2136},{0x2137,0x2137}, /* 2136 */
+ {0x2138,0x2138},{0x2139,0x2139}, /* 2138 */
+ {0x213A,0x213A},{0x213B,0x213B}, /* 213A */
+ {0x213C,0x213C},{0x213D,0x213D}, /* 213C */
+ {0x213E,0x213E},{0x213F,0x213F}, /* 213E */
+ {0x2140,0x2140},{0x2141,0x2141}, /* 2140 */
+ {0x2142,0x2142},{0x2143,0x2143}, /* 2142 */
+ {0x2144,0x2144},{0x2145,0x2145}, /* 2144 */
+ {0x2146,0x2146},{0x2147,0x2147}, /* 2146 */
+ {0x2148,0x2148},{0x2149,0x2149}, /* 2148 */
+ {0x214A,0x214A},{0x214B,0x214B}, /* 214A */
+ {0x214C,0x214C},{0x214D,0x214D}, /* 214C */
+ {0x214E,0x214E},{0x214F,0x214F}, /* 214E */
+ {0x2150,0x2150},{0x2151,0x2151}, /* 2150 */
+ {0x2152,0x2152},{0x2153,0x2153}, /* 2152 */
+ {0x2154,0x2154},{0x2155,0x2155}, /* 2154 */
+ {0x2156,0x2156},{0x2157,0x2157}, /* 2156 */
+ {0x2158,0x2158},{0x2159,0x2159}, /* 2158 */
+ {0x215A,0x215A},{0x215B,0x215B}, /* 215A */
+ {0x215C,0x215C},{0x215D,0x215D}, /* 215C */
+ {0x215E,0x215E},{0x215F,0x215F}, /* 215E */
+ {0x2160,0x2170},{0x2161,0x2171}, /* 2160 */
+ {0x2162,0x2172},{0x2163,0x2173}, /* 2162 */
+ {0x2164,0x2174},{0x2165,0x2175}, /* 2164 */
+ {0x2166,0x2176},{0x2167,0x2177}, /* 2166 */
+ {0x2168,0x2178},{0x2169,0x2179}, /* 2168 */
+ {0x216A,0x217A},{0x216B,0x217B}, /* 216A */
+ {0x216C,0x217C},{0x216D,0x217D}, /* 216C */
+ {0x216E,0x217E},{0x216F,0x217F}, /* 216E */
+ {0x2160,0x2170},{0x2161,0x2171}, /* 2170 */
+ {0x2162,0x2172},{0x2163,0x2173}, /* 2172 */
+ {0x2164,0x2174},{0x2165,0x2175}, /* 2174 */
+ {0x2166,0x2176},{0x2167,0x2177}, /* 2176 */
+ {0x2168,0x2178},{0x2169,0x2179}, /* 2178 */
+ {0x216A,0x217A},{0x216B,0x217B}, /* 217A */
+ {0x216C,0x217C},{0x216D,0x217D}, /* 217C */
+ {0x216E,0x217E},{0x216F,0x217F}, /* 217E */
+ {0x2180,0x2180},{0x2181,0x2181}, /* 2180 */
+ {0x2182,0x2182},{0x2183,0x2183}, /* 2182 */
+ {0x2184,0x2184},{0x2185,0x2185}, /* 2184 */
+ {0x2186,0x2186},{0x2187,0x2187}, /* 2186 */
+ {0x2188,0x2188},{0x2189,0x2189}, /* 2188 */
+ {0x218A,0x218A},{0x218B,0x218B}, /* 218A */
+ {0x218C,0x218C},{0x218D,0x218D}, /* 218C */
+ {0x218E,0x218E},{0x218F,0x218F}, /* 218E */
+ {0x2190,0x2190},{0x2191,0x2191}, /* 2190 */
+ {0x2192,0x2192},{0x2193,0x2193}, /* 2192 */
+ {0x2194,0x2194},{0x2195,0x2195}, /* 2194 */
+ {0x2196,0x2196},{0x2197,0x2197}, /* 2196 */
+ {0x2198,0x2198},{0x2199,0x2199}, /* 2198 */
+ {0x219A,0x219A},{0x219B,0x219B}, /* 219A */
+ {0x219C,0x219C},{0x219D,0x219D}, /* 219C */
+ {0x219E,0x219E},{0x219F,0x219F}, /* 219E */
+ {0x21A0,0x21A0},{0x21A1,0x21A1}, /* 21A0 */
+ {0x21A2,0x21A2},{0x21A3,0x21A3}, /* 21A2 */
+ {0x21A4,0x21A4},{0x21A5,0x21A5}, /* 21A4 */
+ {0x21A6,0x21A6},{0x21A7,0x21A7}, /* 21A6 */
+ {0x21A8,0x21A8},{0x21A9,0x21A9}, /* 21A8 */
+ {0x21AA,0x21AA},{0x21AB,0x21AB}, /* 21AA */
+ {0x21AC,0x21AC},{0x21AD,0x21AD}, /* 21AC */
+ {0x21AE,0x21AE},{0x21AF,0x21AF}, /* 21AE */
+ {0x21B0,0x21B0},{0x21B1,0x21B1}, /* 21B0 */
+ {0x21B2,0x21B2},{0x21B3,0x21B3}, /* 21B2 */
+ {0x21B4,0x21B4},{0x21B5,0x21B5}, /* 21B4 */
+ {0x21B6,0x21B6},{0x21B7,0x21B7}, /* 21B6 */
+ {0x21B8,0x21B8},{0x21B9,0x21B9}, /* 21B8 */
+ {0x21BA,0x21BA},{0x21BB,0x21BB}, /* 21BA */
+ {0x21BC,0x21BC},{0x21BD,0x21BD}, /* 21BC */
+ {0x21BE,0x21BE},{0x21BF,0x21BF}, /* 21BE */
+ {0x21C0,0x21C0},{0x21C1,0x21C1}, /* 21C0 */
+ {0x21C2,0x21C2},{0x21C3,0x21C3}, /* 21C2 */
+ {0x21C4,0x21C4},{0x21C5,0x21C5}, /* 21C4 */
+ {0x21C6,0x21C6},{0x21C7,0x21C7}, /* 21C6 */
+ {0x21C8,0x21C8},{0x21C9,0x21C9}, /* 21C8 */
+ {0x21CA,0x21CA},{0x21CB,0x21CB}, /* 21CA */
+ {0x21CC,0x21CC},{0x21CD,0x21CD}, /* 21CC */
+ {0x21CE,0x21CE},{0x21CF,0x21CF}, /* 21CE */
+ {0x21D0,0x21D0},{0x21D1,0x21D1}, /* 21D0 */
+ {0x21D2,0x21D2},{0x21D3,0x21D3}, /* 21D2 */
+ {0x21D4,0x21D4},{0x21D5,0x21D5}, /* 21D4 */
+ {0x21D6,0x21D6},{0x21D7,0x21D7}, /* 21D6 */
+ {0x21D8,0x21D8},{0x21D9,0x21D9}, /* 21D8 */
+ {0x21DA,0x21DA},{0x21DB,0x21DB}, /* 21DA */
+ {0x21DC,0x21DC},{0x21DD,0x21DD}, /* 21DC */
+ {0x21DE,0x21DE},{0x21DF,0x21DF}, /* 21DE */
+ {0x21E0,0x21E0},{0x21E1,0x21E1}, /* 21E0 */
+ {0x21E2,0x21E2},{0x21E3,0x21E3}, /* 21E2 */
+ {0x21E4,0x21E4},{0x21E5,0x21E5}, /* 21E4 */
+ {0x21E6,0x21E6},{0x21E7,0x21E7}, /* 21E6 */
+ {0x21E8,0x21E8},{0x21E9,0x21E9}, /* 21E8 */
+ {0x21EA,0x21EA},{0x21EB,0x21EB}, /* 21EA */
+ {0x21EC,0x21EC},{0x21ED,0x21ED}, /* 21EC */
+ {0x21EE,0x21EE},{0x21EF,0x21EF}, /* 21EE */
+ {0x21F0,0x21F0},{0x21F1,0x21F1}, /* 21F0 */
+ {0x21F2,0x21F2},{0x21F3,0x21F3}, /* 21F2 */
+ {0x21F4,0x21F4},{0x21F5,0x21F5}, /* 21F4 */
+ {0x21F6,0x21F6},{0x21F7,0x21F7}, /* 21F6 */
+ {0x21F8,0x21F8},{0x21F9,0x21F9}, /* 21F8 */
+ {0x21FA,0x21FA},{0x21FB,0x21FB}, /* 21FA */
+ {0x21FC,0x21FC},{0x21FD,0x21FD}, /* 21FC */
+ {0x21FE,0x21FE},{0x21FF,0x21FF} /* 21FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u300_casefold_page24[256]={
+ {0x2400,0x2400},{0x2401,0x2401}, /* 2400 */
+ {0x2402,0x2402},{0x2403,0x2403}, /* 2402 */
+ {0x2404,0x2404},{0x2405,0x2405}, /* 2404 */
+ {0x2406,0x2406},{0x2407,0x2407}, /* 2406 */
+ {0x2408,0x2408},{0x2409,0x2409}, /* 2408 */
+ {0x240A,0x240A},{0x240B,0x240B}, /* 240A */
+ {0x240C,0x240C},{0x240D,0x240D}, /* 240C */
+ {0x240E,0x240E},{0x240F,0x240F}, /* 240E */
+ {0x2410,0x2410},{0x2411,0x2411}, /* 2410 */
+ {0x2412,0x2412},{0x2413,0x2413}, /* 2412 */
+ {0x2414,0x2414},{0x2415,0x2415}, /* 2414 */
+ {0x2416,0x2416},{0x2417,0x2417}, /* 2416 */
+ {0x2418,0x2418},{0x2419,0x2419}, /* 2418 */
+ {0x241A,0x241A},{0x241B,0x241B}, /* 241A */
+ {0x241C,0x241C},{0x241D,0x241D}, /* 241C */
+ {0x241E,0x241E},{0x241F,0x241F}, /* 241E */
+ {0x2420,0x2420},{0x2421,0x2421}, /* 2420 */
+ {0x2422,0x2422},{0x2423,0x2423}, /* 2422 */
+ {0x2424,0x2424},{0x2425,0x2425}, /* 2424 */
+ {0x2426,0x2426},{0x2427,0x2427}, /* 2426 */
+ {0x2428,0x2428},{0x2429,0x2429}, /* 2428 */
+ {0x242A,0x242A},{0x242B,0x242B}, /* 242A */
+ {0x242C,0x242C},{0x242D,0x242D}, /* 242C */
+ {0x242E,0x242E},{0x242F,0x242F}, /* 242E */
+ {0x2430,0x2430},{0x2431,0x2431}, /* 2430 */
+ {0x2432,0x2432},{0x2433,0x2433}, /* 2432 */
+ {0x2434,0x2434},{0x2435,0x2435}, /* 2434 */
+ {0x2436,0x2436},{0x2437,0x2437}, /* 2436 */
+ {0x2438,0x2438},{0x2439,0x2439}, /* 2438 */
+ {0x243A,0x243A},{0x243B,0x243B}, /* 243A */
+ {0x243C,0x243C},{0x243D,0x243D}, /* 243C */
+ {0x243E,0x243E},{0x243F,0x243F}, /* 243E */
+ {0x2440,0x2440},{0x2441,0x2441}, /* 2440 */
+ {0x2442,0x2442},{0x2443,0x2443}, /* 2442 */
+ {0x2444,0x2444},{0x2445,0x2445}, /* 2444 */
+ {0x2446,0x2446},{0x2447,0x2447}, /* 2446 */
+ {0x2448,0x2448},{0x2449,0x2449}, /* 2448 */
+ {0x244A,0x244A},{0x244B,0x244B}, /* 244A */
+ {0x244C,0x244C},{0x244D,0x244D}, /* 244C */
+ {0x244E,0x244E},{0x244F,0x244F}, /* 244E */
+ {0x2450,0x2450},{0x2451,0x2451}, /* 2450 */
+ {0x2452,0x2452},{0x2453,0x2453}, /* 2452 */
+ {0x2454,0x2454},{0x2455,0x2455}, /* 2454 */
+ {0x2456,0x2456},{0x2457,0x2457}, /* 2456 */
+ {0x2458,0x2458},{0x2459,0x2459}, /* 2458 */
+ {0x245A,0x245A},{0x245B,0x245B}, /* 245A */
+ {0x245C,0x245C},{0x245D,0x245D}, /* 245C */
+ {0x245E,0x245E},{0x245F,0x245F}, /* 245E */
+ {0x2460,0x2460},{0x2461,0x2461}, /* 2460 */
+ {0x2462,0x2462},{0x2463,0x2463}, /* 2462 */
+ {0x2464,0x2464},{0x2465,0x2465}, /* 2464 */
+ {0x2466,0x2466},{0x2467,0x2467}, /* 2466 */
+ {0x2468,0x2468},{0x2469,0x2469}, /* 2468 */
+ {0x246A,0x246A},{0x246B,0x246B}, /* 246A */
+ {0x246C,0x246C},{0x246D,0x246D}, /* 246C */
+ {0x246E,0x246E},{0x246F,0x246F}, /* 246E */
+ {0x2470,0x2470},{0x2471,0x2471}, /* 2470 */
+ {0x2472,0x2472},{0x2473,0x2473}, /* 2472 */
+ {0x2474,0x2474},{0x2475,0x2475}, /* 2474 */
+ {0x2476,0x2476},{0x2477,0x2477}, /* 2476 */
+ {0x2478,0x2478},{0x2479,0x2479}, /* 2478 */
+ {0x247A,0x247A},{0x247B,0x247B}, /* 247A */
+ {0x247C,0x247C},{0x247D,0x247D}, /* 247C */
+ {0x247E,0x247E},{0x247F,0x247F}, /* 247E */
+ {0x2480,0x2480},{0x2481,0x2481}, /* 2480 */
+ {0x2482,0x2482},{0x2483,0x2483}, /* 2482 */
+ {0x2484,0x2484},{0x2485,0x2485}, /* 2484 */
+ {0x2486,0x2486},{0x2487,0x2487}, /* 2486 */
+ {0x2488,0x2488},{0x2489,0x2489}, /* 2488 */
+ {0x248A,0x248A},{0x248B,0x248B}, /* 248A */
+ {0x248C,0x248C},{0x248D,0x248D}, /* 248C */
+ {0x248E,0x248E},{0x248F,0x248F}, /* 248E */
+ {0x2490,0x2490},{0x2491,0x2491}, /* 2490 */
+ {0x2492,0x2492},{0x2493,0x2493}, /* 2492 */
+ {0x2494,0x2494},{0x2495,0x2495}, /* 2494 */
+ {0x2496,0x2496},{0x2497,0x2497}, /* 2496 */
+ {0x2498,0x2498},{0x2499,0x2499}, /* 2498 */
+ {0x249A,0x249A},{0x249B,0x249B}, /* 249A */
+ {0x249C,0x249C},{0x249D,0x249D}, /* 249C */
+ {0x249E,0x249E},{0x249F,0x249F}, /* 249E */
+ {0x24A0,0x24A0},{0x24A1,0x24A1}, /* 24A0 */
+ {0x24A2,0x24A2},{0x24A3,0x24A3}, /* 24A2 */
+ {0x24A4,0x24A4},{0x24A5,0x24A5}, /* 24A4 */
+ {0x24A6,0x24A6},{0x24A7,0x24A7}, /* 24A6 */
+ {0x24A8,0x24A8},{0x24A9,0x24A9}, /* 24A8 */
+ {0x24AA,0x24AA},{0x24AB,0x24AB}, /* 24AA */
+ {0x24AC,0x24AC},{0x24AD,0x24AD}, /* 24AC */
+ {0x24AE,0x24AE},{0x24AF,0x24AF}, /* 24AE */
+ {0x24B0,0x24B0},{0x24B1,0x24B1}, /* 24B0 */
+ {0x24B2,0x24B2},{0x24B3,0x24B3}, /* 24B2 */
+ {0x24B4,0x24B4},{0x24B5,0x24B5}, /* 24B4 */
+ {0x24B6,0x24D0},{0x24B7,0x24D1}, /* 24B6 */
+ {0x24B8,0x24D2},{0x24B9,0x24D3}, /* 24B8 */
+ {0x24BA,0x24D4},{0x24BB,0x24D5}, /* 24BA */
+ {0x24BC,0x24D6},{0x24BD,0x24D7}, /* 24BC */
+ {0x24BE,0x24D8},{0x24BF,0x24D9}, /* 24BE */
+ {0x24C0,0x24DA},{0x24C1,0x24DB}, /* 24C0 */
+ {0x24C2,0x24DC},{0x24C3,0x24DD}, /* 24C2 */
+ {0x24C4,0x24DE},{0x24C5,0x24DF}, /* 24C4 */
+ {0x24C6,0x24E0},{0x24C7,0x24E1}, /* 24C6 */
+ {0x24C8,0x24E2},{0x24C9,0x24E3}, /* 24C8 */
+ {0x24CA,0x24E4},{0x24CB,0x24E5}, /* 24CA */
+ {0x24CC,0x24E6},{0x24CD,0x24E7}, /* 24CC */
+ {0x24CE,0x24E8},{0x24CF,0x24E9}, /* 24CE */
+ {0x24B6,0x24D0},{0x24B7,0x24D1}, /* 24D0 */
+ {0x24B8,0x24D2},{0x24B9,0x24D3}, /* 24D2 */
+ {0x24BA,0x24D4},{0x24BB,0x24D5}, /* 24D4 */
+ {0x24BC,0x24D6},{0x24BD,0x24D7}, /* 24D6 */
+ {0x24BE,0x24D8},{0x24BF,0x24D9}, /* 24D8 */
+ {0x24C0,0x24DA},{0x24C1,0x24DB}, /* 24DA */
+ {0x24C2,0x24DC},{0x24C3,0x24DD}, /* 24DC */
+ {0x24C4,0x24DE},{0x24C5,0x24DF}, /* 24DE */
+ {0x24C6,0x24E0},{0x24C7,0x24E1}, /* 24E0 */
+ {0x24C8,0x24E2},{0x24C9,0x24E3}, /* 24E2 */
+ {0x24CA,0x24E4},{0x24CB,0x24E5}, /* 24E4 */
+ {0x24CC,0x24E6},{0x24CD,0x24E7}, /* 24E6 */
+ {0x24CE,0x24E8},{0x24CF,0x24E9}, /* 24E8 */
+ {0x24EA,0x24EA},{0x24EB,0x24EB}, /* 24EA */
+ {0x24EC,0x24EC},{0x24ED,0x24ED}, /* 24EC */
+ {0x24EE,0x24EE},{0x24EF,0x24EF}, /* 24EE */
+ {0x24F0,0x24F0},{0x24F1,0x24F1}, /* 24F0 */
+ {0x24F2,0x24F2},{0x24F3,0x24F3}, /* 24F2 */
+ {0x24F4,0x24F4},{0x24F5,0x24F5}, /* 24F4 */
+ {0x24F6,0x24F6},{0x24F7,0x24F7}, /* 24F6 */
+ {0x24F8,0x24F8},{0x24F9,0x24F9}, /* 24F8 */
+ {0x24FA,0x24FA},{0x24FB,0x24FB}, /* 24FA */
+ {0x24FC,0x24FC},{0x24FD,0x24FD}, /* 24FC */
+ {0x24FE,0x24FE},{0x24FF,0x24FF} /* 24FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u300_casefold_pageFF[256]={
+ {0xFF00,0xFF00},{0xFF01,0xFF01}, /* FF00 */
+ {0xFF02,0xFF02},{0xFF03,0xFF03}, /* FF02 */
+ {0xFF04,0xFF04},{0xFF05,0xFF05}, /* FF04 */
+ {0xFF06,0xFF06},{0xFF07,0xFF07}, /* FF06 */
+ {0xFF08,0xFF08},{0xFF09,0xFF09}, /* FF08 */
+ {0xFF0A,0xFF0A},{0xFF0B,0xFF0B}, /* FF0A */
+ {0xFF0C,0xFF0C},{0xFF0D,0xFF0D}, /* FF0C */
+ {0xFF0E,0xFF0E},{0xFF0F,0xFF0F}, /* FF0E */
+ {0xFF10,0xFF10},{0xFF11,0xFF11}, /* FF10 */
+ {0xFF12,0xFF12},{0xFF13,0xFF13}, /* FF12 */
+ {0xFF14,0xFF14},{0xFF15,0xFF15}, /* FF14 */
+ {0xFF16,0xFF16},{0xFF17,0xFF17}, /* FF16 */
+ {0xFF18,0xFF18},{0xFF19,0xFF19}, /* FF18 */
+ {0xFF1A,0xFF1A},{0xFF1B,0xFF1B}, /* FF1A */
+ {0xFF1C,0xFF1C},{0xFF1D,0xFF1D}, /* FF1C */
+ {0xFF1E,0xFF1E},{0xFF1F,0xFF1F}, /* FF1E */
+ {0xFF20,0xFF20},{0xFF21,0xFF41}, /* FF20 */
+ {0xFF22,0xFF42},{0xFF23,0xFF43}, /* FF22 */
+ {0xFF24,0xFF44},{0xFF25,0xFF45}, /* FF24 */
+ {0xFF26,0xFF46},{0xFF27,0xFF47}, /* FF26 */
+ {0xFF28,0xFF48},{0xFF29,0xFF49}, /* FF28 */
+ {0xFF2A,0xFF4A},{0xFF2B,0xFF4B}, /* FF2A */
+ {0xFF2C,0xFF4C},{0xFF2D,0xFF4D}, /* FF2C */
+ {0xFF2E,0xFF4E},{0xFF2F,0xFF4F}, /* FF2E */
+ {0xFF30,0xFF50},{0xFF31,0xFF51}, /* FF30 */
+ {0xFF32,0xFF52},{0xFF33,0xFF53}, /* FF32 */
+ {0xFF34,0xFF54},{0xFF35,0xFF55}, /* FF34 */
+ {0xFF36,0xFF56},{0xFF37,0xFF57}, /* FF36 */
+ {0xFF38,0xFF58},{0xFF39,0xFF59}, /* FF38 */
+ {0xFF3A,0xFF5A},{0xFF3B,0xFF3B}, /* FF3A */
+ {0xFF3C,0xFF3C},{0xFF3D,0xFF3D}, /* FF3C */
+ {0xFF3E,0xFF3E},{0xFF3F,0xFF3F}, /* FF3E */
+ {0xFF40,0xFF40},{0xFF21,0xFF41}, /* FF40 */
+ {0xFF22,0xFF42},{0xFF23,0xFF43}, /* FF42 */
+ {0xFF24,0xFF44},{0xFF25,0xFF45}, /* FF44 */
+ {0xFF26,0xFF46},{0xFF27,0xFF47}, /* FF46 */
+ {0xFF28,0xFF48},{0xFF29,0xFF49}, /* FF48 */
+ {0xFF2A,0xFF4A},{0xFF2B,0xFF4B}, /* FF4A */
+ {0xFF2C,0xFF4C},{0xFF2D,0xFF4D}, /* FF4C */
+ {0xFF2E,0xFF4E},{0xFF2F,0xFF4F}, /* FF4E */
+ {0xFF30,0xFF50},{0xFF31,0xFF51}, /* FF50 */
+ {0xFF32,0xFF52},{0xFF33,0xFF53}, /* FF52 */
+ {0xFF34,0xFF54},{0xFF35,0xFF55}, /* FF54 */
+ {0xFF36,0xFF56},{0xFF37,0xFF57}, /* FF56 */
+ {0xFF38,0xFF58},{0xFF39,0xFF59}, /* FF58 */
+ {0xFF3A,0xFF5A},{0xFF5B,0xFF5B}, /* FF5A */
+ {0xFF5C,0xFF5C},{0xFF5D,0xFF5D}, /* FF5C */
+ {0xFF5E,0xFF5E},{0xFF5F,0xFF5F}, /* FF5E */
+ {0xFF60,0xFF60},{0xFF61,0xFF61}, /* FF60 */
+ {0xFF62,0xFF62},{0xFF63,0xFF63}, /* FF62 */
+ {0xFF64,0xFF64},{0xFF65,0xFF65}, /* FF64 */
+ {0xFF66,0xFF66},{0xFF67,0xFF67}, /* FF66 */
+ {0xFF68,0xFF68},{0xFF69,0xFF69}, /* FF68 */
+ {0xFF6A,0xFF6A},{0xFF6B,0xFF6B}, /* FF6A */
+ {0xFF6C,0xFF6C},{0xFF6D,0xFF6D}, /* FF6C */
+ {0xFF6E,0xFF6E},{0xFF6F,0xFF6F}, /* FF6E */
+ {0xFF70,0xFF70},{0xFF71,0xFF71}, /* FF70 */
+ {0xFF72,0xFF72},{0xFF73,0xFF73}, /* FF72 */
+ {0xFF74,0xFF74},{0xFF75,0xFF75}, /* FF74 */
+ {0xFF76,0xFF76},{0xFF77,0xFF77}, /* FF76 */
+ {0xFF78,0xFF78},{0xFF79,0xFF79}, /* FF78 */
+ {0xFF7A,0xFF7A},{0xFF7B,0xFF7B}, /* FF7A */
+ {0xFF7C,0xFF7C},{0xFF7D,0xFF7D}, /* FF7C */
+ {0xFF7E,0xFF7E},{0xFF7F,0xFF7F}, /* FF7E */
+ {0xFF80,0xFF80},{0xFF81,0xFF81}, /* FF80 */
+ {0xFF82,0xFF82},{0xFF83,0xFF83}, /* FF82 */
+ {0xFF84,0xFF84},{0xFF85,0xFF85}, /* FF84 */
+ {0xFF86,0xFF86},{0xFF87,0xFF87}, /* FF86 */
+ {0xFF88,0xFF88},{0xFF89,0xFF89}, /* FF88 */
+ {0xFF8A,0xFF8A},{0xFF8B,0xFF8B}, /* FF8A */
+ {0xFF8C,0xFF8C},{0xFF8D,0xFF8D}, /* FF8C */
+ {0xFF8E,0xFF8E},{0xFF8F,0xFF8F}, /* FF8E */
+ {0xFF90,0xFF90},{0xFF91,0xFF91}, /* FF90 */
+ {0xFF92,0xFF92},{0xFF93,0xFF93}, /* FF92 */
+ {0xFF94,0xFF94},{0xFF95,0xFF95}, /* FF94 */
+ {0xFF96,0xFF96},{0xFF97,0xFF97}, /* FF96 */
+ {0xFF98,0xFF98},{0xFF99,0xFF99}, /* FF98 */
+ {0xFF9A,0xFF9A},{0xFF9B,0xFF9B}, /* FF9A */
+ {0xFF9C,0xFF9C},{0xFF9D,0xFF9D}, /* FF9C */
+ {0xFF9E,0xFF9E},{0xFF9F,0xFF9F}, /* FF9E */
+ {0xFFA0,0xFFA0},{0xFFA1,0xFFA1}, /* FFA0 */
+ {0xFFA2,0xFFA2},{0xFFA3,0xFFA3}, /* FFA2 */
+ {0xFFA4,0xFFA4},{0xFFA5,0xFFA5}, /* FFA4 */
+ {0xFFA6,0xFFA6},{0xFFA7,0xFFA7}, /* FFA6 */
+ {0xFFA8,0xFFA8},{0xFFA9,0xFFA9}, /* FFA8 */
+ {0xFFAA,0xFFAA},{0xFFAB,0xFFAB}, /* FFAA */
+ {0xFFAC,0xFFAC},{0xFFAD,0xFFAD}, /* FFAC */
+ {0xFFAE,0xFFAE},{0xFFAF,0xFFAF}, /* FFAE */
+ {0xFFB0,0xFFB0},{0xFFB1,0xFFB1}, /* FFB0 */
+ {0xFFB2,0xFFB2},{0xFFB3,0xFFB3}, /* FFB2 */
+ {0xFFB4,0xFFB4},{0xFFB5,0xFFB5}, /* FFB4 */
+ {0xFFB6,0xFFB6},{0xFFB7,0xFFB7}, /* FFB6 */
+ {0xFFB8,0xFFB8},{0xFFB9,0xFFB9}, /* FFB8 */
+ {0xFFBA,0xFFBA},{0xFFBB,0xFFBB}, /* FFBA */
+ {0xFFBC,0xFFBC},{0xFFBD,0xFFBD}, /* FFBC */
+ {0xFFBE,0xFFBE},{0xFFBF,0xFFBF}, /* FFBE */
+ {0xFFC0,0xFFC0},{0xFFC1,0xFFC1}, /* FFC0 */
+ {0xFFC2,0xFFC2},{0xFFC3,0xFFC3}, /* FFC2 */
+ {0xFFC4,0xFFC4},{0xFFC5,0xFFC5}, /* FFC4 */
+ {0xFFC6,0xFFC6},{0xFFC7,0xFFC7}, /* FFC6 */
+ {0xFFC8,0xFFC8},{0xFFC9,0xFFC9}, /* FFC8 */
+ {0xFFCA,0xFFCA},{0xFFCB,0xFFCB}, /* FFCA */
+ {0xFFCC,0xFFCC},{0xFFCD,0xFFCD}, /* FFCC */
+ {0xFFCE,0xFFCE},{0xFFCF,0xFFCF}, /* FFCE */
+ {0xFFD0,0xFFD0},{0xFFD1,0xFFD1}, /* FFD0 */
+ {0xFFD2,0xFFD2},{0xFFD3,0xFFD3}, /* FFD2 */
+ {0xFFD4,0xFFD4},{0xFFD5,0xFFD5}, /* FFD4 */
+ {0xFFD6,0xFFD6},{0xFFD7,0xFFD7}, /* FFD6 */
+ {0xFFD8,0xFFD8},{0xFFD9,0xFFD9}, /* FFD8 */
+ {0xFFDA,0xFFDA},{0xFFDB,0xFFDB}, /* FFDA */
+ {0xFFDC,0xFFDC},{0xFFDD,0xFFDD}, /* FFDC */
+ {0xFFDE,0xFFDE},{0xFFDF,0xFFDF}, /* FFDE */
+ {0xFFE0,0xFFE0},{0xFFE1,0xFFE1}, /* FFE0 */
+ {0xFFE2,0xFFE2},{0xFFE3,0xFFE3}, /* FFE2 */
+ {0xFFE4,0xFFE4},{0xFFE5,0xFFE5}, /* FFE4 */
+ {0xFFE6,0xFFE6},{0xFFE7,0xFFE7}, /* FFE6 */
+ {0xFFE8,0xFFE8},{0xFFE9,0xFFE9}, /* FFE8 */
+ {0xFFEA,0xFFEA},{0xFFEB,0xFFEB}, /* FFEA */
+ {0xFFEC,0xFFEC},{0xFFED,0xFFED}, /* FFEC */
+ {0xFFEE,0xFFEE},{0xFFEF,0xFFEF}, /* FFEE */
+ {0xFFF0,0xFFF0},{0xFFF1,0xFFF1}, /* FFF0 */
+ {0xFFF2,0xFFF2},{0xFFF3,0xFFF3}, /* FFF2 */
+ {0xFFF4,0xFFF4},{0xFFF5,0xFFF5}, /* FFF4 */
+ {0xFFF6,0xFFF6},{0xFFF7,0xFFF7}, /* FFF6 */
+ {0xFFF8,0xFFF8},{0xFFF9,0xFFF9}, /* FFF8 */
+ {0xFFFA,0xFFFA},{0xFFFB,0xFFFB}, /* FFFA */
+ {0xFFFC,0xFFFC},{0xFFFD,0xFFFD}, /* FFFC */
+ {0xFFFE,0xFFFE},{0xFFFF,0xFFFF} /* FFFE */
+};
+
+const MY_CASEFOLD_CHARACTER * my_u300_casefold_index[256]={
+ u300_casefold_page00, u300_casefold_page01, u300_casefold_page02, u300_casefold_page03, u300_casefold_page04, u300_casefold_page05, u300_casefold_page06, u300_casefold_page07,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, u300_casefold_page1E, u300_casefold_page1F,
+ NULL, u300_casefold_page21, NULL, NULL, u300_casefold_page24, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, u300_casefold_pageFF
+};
diff --git a/strings/ctype-unicode300-general_ci.h b/strings/ctype-unicode300-general_ci.h
new file mode 100644
index 00000000000..fd8cd71bf1a
--- /dev/null
+++ b/strings/ctype-unicode300-general_ci.h
@@ -0,0 +1,610 @@
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2023, 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
+*/
+
+/*
+ Generated by:
+ ./unidata-dump \
+ --mode=weight_general_ci \
+ --max-char=0xFFFF \
+ UnicodeData-3.0.0.txt
+
+*/
+const uint16 weight_general_ci_page00[256]={
+ 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, /* 0000 */
+ 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, /* 0008 */
+ 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, /* 0010 */
+ 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, /* 0018 */
+ 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, /* 0020 */
+ 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, /* 0028 */
+ 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, /* 0030 */
+ 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, /* 0038 */
+ 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, /* 0040 */
+ 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, /* 0048 */
+ 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, /* 0050 */
+ 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, /* 0058 */
+ 0x0060,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, /* 0060 */
+ 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, /* 0068 */
+ 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, /* 0070 */
+ 0x0058,0x0059,0x005A,0x007B,0x007C,0x007D,0x007E,0x007F, /* 0078 */
+ 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, /* 0080 */
+ 0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, /* 0088 */
+ 0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, /* 0090 */
+ 0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, /* 0098 */
+ 0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, /* 00A0 */
+ 0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, /* 00A8 */
+ 0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x039C,0x00B6,0x00B7, /* 00B0 */
+ 0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, /* 00B8 */
+ 0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x00C6,0x0043, /* 00C0 */
+ 0x0045,0x0045,0x0045,0x0045,0x0049,0x0049,0x0049,0x0049, /* 00C8 */
+ 0x00D0,0x004E,0x004F,0x004F,0x004F,0x004F,0x004F,0x00D7, /* 00D0 */
+ 0x00D8,0x0055,0x0055,0x0055,0x0055,0x0059,0x00DE,0x0053, /* 00D8 */
+ 0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x00C6,0x0043, /* 00E0 */
+ 0x0045,0x0045,0x0045,0x0045,0x0049,0x0049,0x0049,0x0049, /* 00E8 */
+ 0x00D0,0x004E,0x004F,0x004F,0x004F,0x004F,0x004F,0x00F7, /* 00F0 */
+ 0x00D8,0x0055,0x0055,0x0055,0x0055,0x0059,0x00DE,0x0059 /* 00F8 */
+};
+
+static const uint16 weight_general_ci_page01[256]={
+ 0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x0043,0x0043, /* 0100 */
+ 0x0043,0x0043,0x0043,0x0043,0x0043,0x0043,0x0044,0x0044, /* 0108 */
+ 0x0110,0x0110,0x0045,0x0045,0x0045,0x0045,0x0045,0x0045, /* 0110 */
+ 0x0045,0x0045,0x0045,0x0045,0x0047,0x0047,0x0047,0x0047, /* 0118 */
+ 0x0047,0x0047,0x0047,0x0047,0x0048,0x0048,0x0126,0x0126, /* 0120 */
+ 0x0049,0x0049,0x0049,0x0049,0x0049,0x0049,0x0049,0x0049, /* 0128 */
+ 0x0049,0x0049,0x0132,0x0132,0x004A,0x004A,0x004B,0x004B, /* 0130 */
+ 0x0138,0x004C,0x004C,0x004C,0x004C,0x004C,0x004C,0x013F, /* 0138 */
+ 0x013F,0x0141,0x0141,0x004E,0x004E,0x004E,0x004E,0x004E, /* 0140 */
+ 0x004E,0x0149,0x014A,0x014A,0x004F,0x004F,0x004F,0x004F, /* 0148 */
+ 0x004F,0x004F,0x0152,0x0152,0x0052,0x0052,0x0052,0x0052, /* 0150 */
+ 0x0052,0x0052,0x0053,0x0053,0x0053,0x0053,0x0053,0x0053, /* 0158 */
+ 0x0053,0x0053,0x0054,0x0054,0x0054,0x0054,0x0166,0x0166, /* 0160 */
+ 0x0055,0x0055,0x0055,0x0055,0x0055,0x0055,0x0055,0x0055, /* 0168 */
+ 0x0055,0x0055,0x0055,0x0055,0x0057,0x0057,0x0059,0x0059, /* 0170 */
+ 0x0059,0x005A,0x005A,0x005A,0x005A,0x005A,0x005A,0x0053, /* 0178 */
+ 0x0180,0x0181,0x0182,0x0182,0x0184,0x0184,0x0186,0x0187, /* 0180 */
+ 0x0187,0x0189,0x018A,0x018B,0x018B,0x018D,0x018E,0x018F, /* 0188 */
+ 0x0190,0x0191,0x0191,0x0193,0x0194,0x01F6,0x0196,0x0197, /* 0190 */
+ 0x0198,0x0198,0x019A,0x019B,0x019C,0x019D,0x019E,0x019F, /* 0198 */
+ 0x004F,0x004F,0x01A2,0x01A2,0x01A4,0x01A4,0x01A6,0x01A7, /* 01A0 */
+ 0x01A7,0x01A9,0x01AA,0x01AB,0x01AC,0x01AC,0x01AE,0x0055, /* 01A8 */
+ 0x0055,0x01B1,0x01B2,0x01B3,0x01B3,0x01B5,0x01B5,0x01B7, /* 01B0 */
+ 0x01B8,0x01B8,0x01BA,0x01BB,0x01BC,0x01BC,0x01BE,0x01F7, /* 01B8 */
+ 0x01C0,0x01C1,0x01C2,0x01C3,0x01C4,0x01C4,0x01C4,0x01C7, /* 01C0 */
+ 0x01C7,0x01C7,0x01CA,0x01CA,0x01CA,0x0041,0x0041,0x0049, /* 01C8 */
+ 0x0049,0x004F,0x004F,0x0055,0x0055,0x0055,0x0055,0x0055, /* 01D0 */
+ 0x0055,0x0055,0x0055,0x0055,0x0055,0x018E,0x0041,0x0041, /* 01D8 */
+ 0x0041,0x0041,0x00C6,0x00C6,0x01E4,0x01E4,0x0047,0x0047, /* 01E0 */
+ 0x004B,0x004B,0x004F,0x004F,0x004F,0x004F,0x01B7,0x01B7, /* 01E8 */
+ 0x004A,0x01F1,0x01F1,0x01F1,0x0047,0x0047,0x01F6,0x01F7, /* 01F0 */
+ 0x004E,0x004E,0x0041,0x0041,0x00C6,0x00C6,0x00D8,0x00D8 /* 01F8 */
+};
+
+static const uint16 weight_general_ci_page02[256]={
+ 0x0041,0x0041,0x0041,0x0041,0x0045,0x0045,0x0045,0x0045, /* 0200 */
+ 0x0049,0x0049,0x0049,0x0049,0x004F,0x004F,0x004F,0x004F, /* 0208 */
+ 0x0052,0x0052,0x0052,0x0052,0x0055,0x0055,0x0055,0x0055, /* 0210 */
+ 0x0053,0x0053,0x0054,0x0054,0x021C,0x021C,0x0048,0x0048, /* 0218 */
+ 0x0220,0x0221,0x0222,0x0222,0x0224,0x0224,0x0041,0x0041, /* 0220 */
+ 0x0045,0x0045,0x004F,0x004F,0x004F,0x004F,0x004F,0x004F, /* 0228 */
+ 0x004F,0x004F,0x0059,0x0059,0x0234,0x0235,0x0236,0x0237, /* 0230 */
+ 0x0238,0x0239,0x023A,0x023B,0x023C,0x023D,0x023E,0x023F, /* 0238 */
+ 0x0240,0x0241,0x0242,0x0243,0x0244,0x0245,0x0246,0x0247, /* 0240 */
+ 0x0248,0x0249,0x024A,0x024B,0x024C,0x024D,0x024E,0x024F, /* 0248 */
+ 0x0250,0x0251,0x0252,0x0181,0x0186,0x0255,0x0189,0x018A, /* 0250 */
+ 0x0258,0x018F,0x025A,0x0190,0x025C,0x025D,0x025E,0x025F, /* 0258 */
+ 0x0193,0x0261,0x0262,0x0194,0x0264,0x0265,0x0266,0x0267, /* 0260 */
+ 0x0197,0x0196,0x026A,0x026B,0x026C,0x026D,0x026E,0x019C, /* 0268 */
+ 0x0270,0x0271,0x019D,0x0273,0x0274,0x019F,0x0276,0x0277, /* 0270 */
+ 0x0278,0x0279,0x027A,0x027B,0x027C,0x027D,0x027E,0x027F, /* 0278 */
+ 0x01A6,0x0281,0x0282,0x01A9,0x0284,0x0285,0x0286,0x0287, /* 0280 */
+ 0x01AE,0x0289,0x01B1,0x01B2,0x028C,0x028D,0x028E,0x028F, /* 0288 */
+ 0x0290,0x0291,0x01B7,0x0293,0x0294,0x0295,0x0296,0x0297, /* 0290 */
+ 0x0298,0x0299,0x029A,0x029B,0x029C,0x029D,0x029E,0x029F, /* 0298 */
+ 0x02A0,0x02A1,0x02A2,0x02A3,0x02A4,0x02A5,0x02A6,0x02A7, /* 02A0 */
+ 0x02A8,0x02A9,0x02AA,0x02AB,0x02AC,0x02AD,0x02AE,0x02AF, /* 02A8 */
+ 0x02B0,0x02B1,0x02B2,0x02B3,0x02B4,0x02B5,0x02B6,0x02B7, /* 02B0 */
+ 0x02B8,0x02B9,0x02BA,0x02BB,0x02BC,0x02BD,0x02BE,0x02BF, /* 02B8 */
+ 0x02C0,0x02C1,0x02C2,0x02C3,0x02C4,0x02C5,0x02C6,0x02C7, /* 02C0 */
+ 0x02C8,0x02C9,0x02CA,0x02CB,0x02CC,0x02CD,0x02CE,0x02CF, /* 02C8 */
+ 0x02D0,0x02D1,0x02D2,0x02D3,0x02D4,0x02D5,0x02D6,0x02D7, /* 02D0 */
+ 0x02D8,0x02D9,0x02DA,0x02DB,0x02DC,0x02DD,0x02DE,0x02DF, /* 02D8 */
+ 0x02E0,0x02E1,0x02E2,0x02E3,0x02E4,0x02E5,0x02E6,0x02E7, /* 02E0 */
+ 0x02E8,0x02E9,0x02EA,0x02EB,0x02EC,0x02ED,0x02EE,0x02EF, /* 02E8 */
+ 0x02F0,0x02F1,0x02F2,0x02F3,0x02F4,0x02F5,0x02F6,0x02F7, /* 02F0 */
+ 0x02F8,0x02F9,0x02FA,0x02FB,0x02FC,0x02FD,0x02FE,0x02FF /* 02F8 */
+};
+
+static const uint16 weight_general_ci_page03[256]={
+ 0x0300,0x0301,0x0302,0x0303,0x0304,0x0305,0x0306,0x0307, /* 0300 */
+ 0x0308,0x0309,0x030A,0x030B,0x030C,0x030D,0x030E,0x030F, /* 0308 */
+ 0x0310,0x0311,0x0312,0x0313,0x0314,0x0315,0x0316,0x0317, /* 0310 */
+ 0x0318,0x0319,0x031A,0x031B,0x031C,0x031D,0x031E,0x031F, /* 0318 */
+ 0x0320,0x0321,0x0322,0x0323,0x0324,0x0325,0x0326,0x0327, /* 0320 */
+ 0x0328,0x0329,0x032A,0x032B,0x032C,0x032D,0x032E,0x032F, /* 0328 */
+ 0x0330,0x0331,0x0332,0x0333,0x0334,0x0335,0x0336,0x0337, /* 0330 */
+ 0x0338,0x0339,0x033A,0x033B,0x033C,0x033D,0x033E,0x033F, /* 0338 */
+ 0x0340,0x0341,0x0342,0x0343,0x0344,0x0399,0x0346,0x0347, /* 0340 */
+ 0x0348,0x0349,0x034A,0x034B,0x034C,0x034D,0x034E,0x034F, /* 0348 */
+ 0x0350,0x0351,0x0352,0x0353,0x0354,0x0355,0x0356,0x0357, /* 0350 */
+ 0x0358,0x0359,0x035A,0x035B,0x035C,0x035D,0x035E,0x035F, /* 0358 */
+ 0x0360,0x0361,0x0362,0x0363,0x0364,0x0365,0x0366,0x0367, /* 0360 */
+ 0x0368,0x0369,0x036A,0x036B,0x036C,0x036D,0x036E,0x036F, /* 0368 */
+ 0x0370,0x0371,0x0372,0x0373,0x0374,0x0375,0x0376,0x0377, /* 0370 */
+ 0x0378,0x0379,0x037A,0x037B,0x037C,0x037D,0x037E,0x037F, /* 0378 */
+ 0x0380,0x0381,0x0382,0x0383,0x0384,0x0385,0x0391,0x0387, /* 0380 */
+ 0x0395,0x0397,0x0399,0x038B,0x039F,0x038D,0x03A5,0x03A9, /* 0388 */
+ 0x0399,0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397, /* 0390 */
+ 0x0398,0x0399,0x039A,0x039B,0x039C,0x039D,0x039E,0x039F, /* 0398 */
+ 0x03A0,0x03A1,0x03A2,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7, /* 03A0 */
+ 0x03A8,0x03A9,0x0399,0x03A5,0x0391,0x0395,0x0397,0x0399, /* 03A8 */
+ 0x03A5,0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397, /* 03B0 */
+ 0x0398,0x0399,0x039A,0x039B,0x039C,0x039D,0x039E,0x039F, /* 03B8 */
+ 0x03A0,0x03A1,0x03A3,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7, /* 03C0 */
+ 0x03A8,0x03A9,0x0399,0x03A5,0x039F,0x03A5,0x03A9,0x03CF, /* 03C8 */
+ 0x0392,0x0398,0x03D2,0x03D2,0x03D2,0x03A6,0x03A0,0x03D7, /* 03D0 */
+ 0x03D8,0x03D9,0x03DA,0x03DA,0x03DC,0x03DC,0x03DE,0x03DE, /* 03D8 */
+ 0x03E0,0x03E0,0x03E2,0x03E2,0x03E4,0x03E4,0x03E6,0x03E6, /* 03E0 */
+ 0x03E8,0x03E8,0x03EA,0x03EA,0x03EC,0x03EC,0x03EE,0x03EE, /* 03E8 */
+ 0x039A,0x03A1,0x03A3,0x03F3,0x03F4,0x03F5,0x03F6,0x03F7, /* 03F0 */
+ 0x03F8,0x03F9,0x03FA,0x03FB,0x03FC,0x03FD,0x03FE,0x03FF /* 03F8 */
+};
+
+static const uint16 weight_general_ci_page04[256]={
+ 0x0415,0x0415,0x0402,0x0413,0x0404,0x0405,0x0406,0x0406, /* 0400 */
+ 0x0408,0x0409,0x040A,0x040B,0x041A,0x0418,0x0423,0x040F, /* 0408 */
+ 0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, /* 0410 */
+ 0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, /* 0418 */
+ 0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, /* 0420 */
+ 0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, /* 0428 */
+ 0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, /* 0430 */
+ 0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, /* 0438 */
+ 0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, /* 0440 */
+ 0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, /* 0448 */
+ 0x0415,0x0415,0x0402,0x0413,0x0404,0x0405,0x0406,0x0406, /* 0450 */
+ 0x0408,0x0409,0x040A,0x040B,0x041A,0x0418,0x0423,0x040F, /* 0458 */
+ 0x0460,0x0460,0x0462,0x0462,0x0464,0x0464,0x0466,0x0466, /* 0460 */
+ 0x0468,0x0468,0x046A,0x046A,0x046C,0x046C,0x046E,0x046E, /* 0468 */
+ 0x0470,0x0470,0x0472,0x0472,0x0474,0x0474,0x0474,0x0474, /* 0470 */
+ 0x0478,0x0478,0x047A,0x047A,0x047C,0x047C,0x047E,0x047E, /* 0478 */
+ 0x0480,0x0480,0x0482,0x0483,0x0484,0x0485,0x0486,0x0487, /* 0480 */
+ 0x0488,0x0489,0x048A,0x048B,0x048C,0x048C,0x048E,0x048E, /* 0488 */
+ 0x0490,0x0490,0x0492,0x0492,0x0494,0x0494,0x0496,0x0496, /* 0490 */
+ 0x0498,0x0498,0x049A,0x049A,0x049C,0x049C,0x049E,0x049E, /* 0498 */
+ 0x04A0,0x04A0,0x04A2,0x04A2,0x04A4,0x04A4,0x04A6,0x04A6, /* 04A0 */
+ 0x04A8,0x04A8,0x04AA,0x04AA,0x04AC,0x04AC,0x04AE,0x04AE, /* 04A8 */
+ 0x04B0,0x04B0,0x04B2,0x04B2,0x04B4,0x04B4,0x04B6,0x04B6, /* 04B0 */
+ 0x04B8,0x04B8,0x04BA,0x04BA,0x04BC,0x04BC,0x04BE,0x04BE, /* 04B8 */
+ 0x04C0,0x0416,0x0416,0x04C3,0x04C3,0x04C5,0x04C6,0x04C7, /* 04C0 */
+ 0x04C7,0x04C9,0x04CA,0x04CB,0x04CB,0x04CD,0x04CE,0x04CF, /* 04C8 */
+ 0x0410,0x0410,0x0410,0x0410,0x04D4,0x04D4,0x0415,0x0415, /* 04D0 */
+ 0x04D8,0x04D8,0x04D8,0x04D8,0x0416,0x0416,0x0417,0x0417, /* 04D8 */
+ 0x04E0,0x04E0,0x0418,0x0418,0x0418,0x0418,0x041E,0x041E, /* 04E0 */
+ 0x04E8,0x04E8,0x04E8,0x04E8,0x042D,0x042D,0x0423,0x0423, /* 04E8 */
+ 0x0423,0x0423,0x0423,0x0423,0x0427,0x0427,0x04F6,0x04F7, /* 04F0 */
+ 0x042B,0x042B,0x04FA,0x04FB,0x04FC,0x04FD,0x04FE,0x04FF /* 04F8 */
+};
+
+static const uint16 weight_general_ci_page05[256]={
+ 0x0500,0x0501,0x0502,0x0503,0x0504,0x0505,0x0506,0x0507, /* 0500 */
+ 0x0508,0x0509,0x050A,0x050B,0x050C,0x050D,0x050E,0x050F, /* 0508 */
+ 0x0510,0x0511,0x0512,0x0513,0x0514,0x0515,0x0516,0x0517, /* 0510 */
+ 0x0518,0x0519,0x051A,0x051B,0x051C,0x051D,0x051E,0x051F, /* 0518 */
+ 0x0520,0x0521,0x0522,0x0523,0x0524,0x0525,0x0526,0x0527, /* 0520 */
+ 0x0528,0x0529,0x052A,0x052B,0x052C,0x052D,0x052E,0x052F, /* 0528 */
+ 0x0530,0x0531,0x0532,0x0533,0x0534,0x0535,0x0536,0x0537, /* 0530 */
+ 0x0538,0x0539,0x053A,0x053B,0x053C,0x053D,0x053E,0x053F, /* 0538 */
+ 0x0540,0x0541,0x0542,0x0543,0x0544,0x0545,0x0546,0x0547, /* 0540 */
+ 0x0548,0x0549,0x054A,0x054B,0x054C,0x054D,0x054E,0x054F, /* 0548 */
+ 0x0550,0x0551,0x0552,0x0553,0x0554,0x0555,0x0556,0x0557, /* 0550 */
+ 0x0558,0x0559,0x055A,0x055B,0x055C,0x055D,0x055E,0x055F, /* 0558 */
+ 0x0560,0x0531,0x0532,0x0533,0x0534,0x0535,0x0536,0x0537, /* 0560 */
+ 0x0538,0x0539,0x053A,0x053B,0x053C,0x053D,0x053E,0x053F, /* 0568 */
+ 0x0540,0x0541,0x0542,0x0543,0x0544,0x0545,0x0546,0x0547, /* 0570 */
+ 0x0548,0x0549,0x054A,0x054B,0x054C,0x054D,0x054E,0x054F, /* 0578 */
+ 0x0550,0x0551,0x0552,0x0553,0x0554,0x0555,0x0556,0x0587, /* 0580 */
+ 0x0588,0x0589,0x058A,0x058B,0x058C,0x058D,0x058E,0x058F, /* 0588 */
+ 0x0590,0x0591,0x0592,0x0593,0x0594,0x0595,0x0596,0x0597, /* 0590 */
+ 0x0598,0x0599,0x059A,0x059B,0x059C,0x059D,0x059E,0x059F, /* 0598 */
+ 0x05A0,0x05A1,0x05A2,0x05A3,0x05A4,0x05A5,0x05A6,0x05A7, /* 05A0 */
+ 0x05A8,0x05A9,0x05AA,0x05AB,0x05AC,0x05AD,0x05AE,0x05AF, /* 05A8 */
+ 0x05B0,0x05B1,0x05B2,0x05B3,0x05B4,0x05B5,0x05B6,0x05B7, /* 05B0 */
+ 0x05B8,0x05B9,0x05BA,0x05BB,0x05BC,0x05BD,0x05BE,0x05BF, /* 05B8 */
+ 0x05C0,0x05C1,0x05C2,0x05C3,0x05C4,0x05C5,0x05C6,0x05C7, /* 05C0 */
+ 0x05C8,0x05C9,0x05CA,0x05CB,0x05CC,0x05CD,0x05CE,0x05CF, /* 05C8 */
+ 0x05D0,0x05D1,0x05D2,0x05D3,0x05D4,0x05D5,0x05D6,0x05D7, /* 05D0 */
+ 0x05D8,0x05D9,0x05DA,0x05DB,0x05DC,0x05DD,0x05DE,0x05DF, /* 05D8 */
+ 0x05E0,0x05E1,0x05E2,0x05E3,0x05E4,0x05E5,0x05E6,0x05E7, /* 05E0 */
+ 0x05E8,0x05E9,0x05EA,0x05EB,0x05EC,0x05ED,0x05EE,0x05EF, /* 05E8 */
+ 0x05F0,0x05F1,0x05F2,0x05F3,0x05F4,0x05F5,0x05F6,0x05F7, /* 05F0 */
+ 0x05F8,0x05F9,0x05FA,0x05FB,0x05FC,0x05FD,0x05FE,0x05FF /* 05F8 */
+};
+
+static const uint16 weight_general_ci_page06[256]={ /* This page is dummy */
+ 0x0600,0x0601,0x0602,0x0603,0x0604,0x0605,0x0606,0x0607, /* 0600 */
+ 0x0608,0x0609,0x060A,0x060B,0x060C,0x060D,0x060E,0x060F, /* 0608 */
+ 0x0610,0x0611,0x0612,0x0613,0x0614,0x0615,0x0616,0x0617, /* 0610 */
+ 0x0618,0x0619,0x061A,0x061B,0x061C,0x061D,0x061E,0x061F, /* 0618 */
+ 0x0620,0x0621,0x0622,0x0623,0x0624,0x0625,0x0626,0x0627, /* 0620 */
+ 0x0628,0x0629,0x062A,0x062B,0x062C,0x062D,0x062E,0x062F, /* 0628 */
+ 0x0630,0x0631,0x0632,0x0633,0x0634,0x0635,0x0636,0x0637, /* 0630 */
+ 0x0638,0x0639,0x063A,0x063B,0x063C,0x063D,0x063E,0x063F, /* 0638 */
+ 0x0640,0x0641,0x0642,0x0643,0x0644,0x0645,0x0646,0x0647, /* 0640 */
+ 0x0648,0x0649,0x064A,0x064B,0x064C,0x064D,0x064E,0x064F, /* 0648 */
+ 0x0650,0x0651,0x0652,0x0653,0x0654,0x0655,0x0656,0x0657, /* 0650 */
+ 0x0658,0x0659,0x065A,0x065B,0x065C,0x065D,0x065E,0x065F, /* 0658 */
+ 0x0660,0x0661,0x0662,0x0663,0x0664,0x0665,0x0666,0x0667, /* 0660 */
+ 0x0668,0x0669,0x066A,0x066B,0x066C,0x066D,0x066E,0x066F, /* 0668 */
+ 0x0670,0x0671,0x0672,0x0673,0x0674,0x0675,0x0676,0x0677, /* 0670 */
+ 0x0678,0x0679,0x067A,0x067B,0x067C,0x067D,0x067E,0x067F, /* 0678 */
+ 0x0680,0x0681,0x0682,0x0683,0x0684,0x0685,0x0686,0x0687, /* 0680 */
+ 0x0688,0x0689,0x068A,0x068B,0x068C,0x068D,0x068E,0x068F, /* 0688 */
+ 0x0690,0x0691,0x0692,0x0693,0x0694,0x0695,0x0696,0x0697, /* 0690 */
+ 0x0698,0x0699,0x069A,0x069B,0x069C,0x069D,0x069E,0x069F, /* 0698 */
+ 0x06A0,0x06A1,0x06A2,0x06A3,0x06A4,0x06A5,0x06A6,0x06A7, /* 06A0 */
+ 0x06A8,0x06A9,0x06AA,0x06AB,0x06AC,0x06AD,0x06AE,0x06AF, /* 06A8 */
+ 0x06B0,0x06B1,0x06B2,0x06B3,0x06B4,0x06B5,0x06B6,0x06B7, /* 06B0 */
+ 0x06B8,0x06B9,0x06BA,0x06BB,0x06BC,0x06BD,0x06BE,0x06BF, /* 06B8 */
+ 0x06C0,0x06C1,0x06C2,0x06C3,0x06C4,0x06C5,0x06C6,0x06C7, /* 06C0 */
+ 0x06C8,0x06C9,0x06CA,0x06CB,0x06CC,0x06CD,0x06CE,0x06CF, /* 06C8 */
+ 0x06D0,0x06D1,0x06D2,0x06D3,0x06D4,0x06D5,0x06D6,0x06D7, /* 06D0 */
+ 0x06D8,0x06D9,0x06DA,0x06DB,0x06DC,0x06DD,0x06DE,0x06DF, /* 06D8 */
+ 0x06E0,0x06E1,0x06E2,0x06E3,0x06E4,0x06E5,0x06E6,0x06E7, /* 06E0 */
+ 0x06E8,0x06E9,0x06EA,0x06EB,0x06EC,0x06ED,0x06EE,0x06EF, /* 06E8 */
+ 0x06F0,0x06F1,0x06F2,0x06F3,0x06F4,0x06F5,0x06F6,0x06F7, /* 06F0 */
+ 0x06F8,0x06F9,0x06FA,0x06FB,0x06FC,0x06FD,0x06FE,0x06FF /* 06F8 */
+};
+
+static const uint16 weight_general_ci_page07[256]={ /* This page is dummy */
+ 0x0700,0x0701,0x0702,0x0703,0x0704,0x0705,0x0706,0x0707, /* 0700 */
+ 0x0708,0x0709,0x070A,0x070B,0x070C,0x070D,0x070E,0x070F, /* 0708 */
+ 0x0710,0x0711,0x0712,0x0713,0x0714,0x0715,0x0716,0x0717, /* 0710 */
+ 0x0718,0x0719,0x071A,0x071B,0x071C,0x071D,0x071E,0x071F, /* 0718 */
+ 0x0720,0x0721,0x0722,0x0723,0x0724,0x0725,0x0726,0x0727, /* 0720 */
+ 0x0728,0x0729,0x072A,0x072B,0x072C,0x072D,0x072E,0x072F, /* 0728 */
+ 0x0730,0x0731,0x0732,0x0733,0x0734,0x0735,0x0736,0x0737, /* 0730 */
+ 0x0738,0x0739,0x073A,0x073B,0x073C,0x073D,0x073E,0x073F, /* 0738 */
+ 0x0740,0x0741,0x0742,0x0743,0x0744,0x0745,0x0746,0x0747, /* 0740 */
+ 0x0748,0x0749,0x074A,0x074B,0x074C,0x074D,0x074E,0x074F, /* 0748 */
+ 0x0750,0x0751,0x0752,0x0753,0x0754,0x0755,0x0756,0x0757, /* 0750 */
+ 0x0758,0x0759,0x075A,0x075B,0x075C,0x075D,0x075E,0x075F, /* 0758 */
+ 0x0760,0x0761,0x0762,0x0763,0x0764,0x0765,0x0766,0x0767, /* 0760 */
+ 0x0768,0x0769,0x076A,0x076B,0x076C,0x076D,0x076E,0x076F, /* 0768 */
+ 0x0770,0x0771,0x0772,0x0773,0x0774,0x0775,0x0776,0x0777, /* 0770 */
+ 0x0778,0x0779,0x077A,0x077B,0x077C,0x077D,0x077E,0x077F, /* 0778 */
+ 0x0780,0x0781,0x0782,0x0783,0x0784,0x0785,0x0786,0x0787, /* 0780 */
+ 0x0788,0x0789,0x078A,0x078B,0x078C,0x078D,0x078E,0x078F, /* 0788 */
+ 0x0790,0x0791,0x0792,0x0793,0x0794,0x0795,0x0796,0x0797, /* 0790 */
+ 0x0798,0x0799,0x079A,0x079B,0x079C,0x079D,0x079E,0x079F, /* 0798 */
+ 0x07A0,0x07A1,0x07A2,0x07A3,0x07A4,0x07A5,0x07A6,0x07A7, /* 07A0 */
+ 0x07A8,0x07A9,0x07AA,0x07AB,0x07AC,0x07AD,0x07AE,0x07AF, /* 07A8 */
+ 0x07B0,0x07B1,0x07B2,0x07B3,0x07B4,0x07B5,0x07B6,0x07B7, /* 07B0 */
+ 0x07B8,0x07B9,0x07BA,0x07BB,0x07BC,0x07BD,0x07BE,0x07BF, /* 07B8 */
+ 0x07C0,0x07C1,0x07C2,0x07C3,0x07C4,0x07C5,0x07C6,0x07C7, /* 07C0 */
+ 0x07C8,0x07C9,0x07CA,0x07CB,0x07CC,0x07CD,0x07CE,0x07CF, /* 07C8 */
+ 0x07D0,0x07D1,0x07D2,0x07D3,0x07D4,0x07D5,0x07D6,0x07D7, /* 07D0 */
+ 0x07D8,0x07D9,0x07DA,0x07DB,0x07DC,0x07DD,0x07DE,0x07DF, /* 07D8 */
+ 0x07E0,0x07E1,0x07E2,0x07E3,0x07E4,0x07E5,0x07E6,0x07E7, /* 07E0 */
+ 0x07E8,0x07E9,0x07EA,0x07EB,0x07EC,0x07ED,0x07EE,0x07EF, /* 07E8 */
+ 0x07F0,0x07F1,0x07F2,0x07F3,0x07F4,0x07F5,0x07F6,0x07F7, /* 07F0 */
+ 0x07F8,0x07F9,0x07FA,0x07FB,0x07FC,0x07FD,0x07FE,0x07FF /* 07F8 */
+};
+
+static const uint16 weight_general_ci_page1E[256]={
+ 0x0041,0x0041,0x0042,0x0042,0x0042,0x0042,0x0042,0x0042, /* 1E00 */
+ 0x0043,0x0043,0x0044,0x0044,0x0044,0x0044,0x0044,0x0044, /* 1E08 */
+ 0x0044,0x0044,0x0044,0x0044,0x0045,0x0045,0x0045,0x0045, /* 1E10 */
+ 0x0045,0x0045,0x0045,0x0045,0x0045,0x0045,0x0046,0x0046, /* 1E18 */
+ 0x0047,0x0047,0x0048,0x0048,0x0048,0x0048,0x0048,0x0048, /* 1E20 */
+ 0x0048,0x0048,0x0048,0x0048,0x0049,0x0049,0x0049,0x0049, /* 1E28 */
+ 0x004B,0x004B,0x004B,0x004B,0x004B,0x004B,0x004C,0x004C, /* 1E30 */
+ 0x004C,0x004C,0x004C,0x004C,0x004C,0x004C,0x004D,0x004D, /* 1E38 */
+ 0x004D,0x004D,0x004D,0x004D,0x004E,0x004E,0x004E,0x004E, /* 1E40 */
+ 0x004E,0x004E,0x004E,0x004E,0x004F,0x004F,0x004F,0x004F, /* 1E48 */
+ 0x004F,0x004F,0x004F,0x004F,0x0050,0x0050,0x0050,0x0050, /* 1E50 */
+ 0x0052,0x0052,0x0052,0x0052,0x0052,0x0052,0x0052,0x0052, /* 1E58 */
+ 0x0053,0x0053,0x0053,0x0053,0x0053,0x0053,0x0053,0x0053, /* 1E60 */
+ 0x0053,0x0053,0x0054,0x0054,0x0054,0x0054,0x0054,0x0054, /* 1E68 */
+ 0x0054,0x0054,0x0055,0x0055,0x0055,0x0055,0x0055,0x0055, /* 1E70 */
+ 0x0055,0x0055,0x0055,0x0055,0x0056,0x0056,0x0056,0x0056, /* 1E78 */
+ 0x0057,0x0057,0x0057,0x0057,0x0057,0x0057,0x0057,0x0057, /* 1E80 */
+ 0x0057,0x0057,0x0058,0x0058,0x0058,0x0058,0x0059,0x0059, /* 1E88 */
+ 0x005A,0x005A,0x005A,0x005A,0x005A,0x005A,0x0048,0x0054, /* 1E90 */
+ 0x0057,0x0059,0x1E9A,0x0053,0x1E9C,0x1E9D,0x1E9E,0x1E9F, /* 1E98 */
+ 0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x0041, /* 1EA0 */
+ 0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x0041, /* 1EA8 */
+ 0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x0041, /* 1EB0 */
+ 0x0045,0x0045,0x0045,0x0045,0x0045,0x0045,0x0045,0x0045, /* 1EB8 */
+ 0x0045,0x0045,0x0045,0x0045,0x0045,0x0045,0x0045,0x0045, /* 1EC0 */
+ 0x0049,0x0049,0x0049,0x0049,0x004F,0x004F,0x004F,0x004F, /* 1EC8 */
+ 0x004F,0x004F,0x004F,0x004F,0x004F,0x004F,0x004F,0x004F, /* 1ED0 */
+ 0x004F,0x004F,0x004F,0x004F,0x004F,0x004F,0x004F,0x004F, /* 1ED8 */
+ 0x004F,0x004F,0x004F,0x004F,0x0055,0x0055,0x0055,0x0055, /* 1EE0 */
+ 0x0055,0x0055,0x0055,0x0055,0x0055,0x0055,0x0055,0x0055, /* 1EE8 */
+ 0x0055,0x0055,0x0059,0x0059,0x0059,0x0059,0x0059,0x0059, /* 1EF0 */
+ 0x0059,0x0059,0x1EFA,0x1EFB,0x1EFC,0x1EFD,0x1EFE,0x1EFF /* 1EF8 */
+};
+
+static const uint16 weight_general_ci_page1F[256]={
+ 0x0391,0x0391,0x0391,0x0391,0x0391,0x0391,0x0391,0x0391, /* 1F00 */
+ 0x0391,0x0391,0x0391,0x0391,0x0391,0x0391,0x0391,0x0391, /* 1F08 */
+ 0x0395,0x0395,0x0395,0x0395,0x0395,0x0395,0x1F16,0x1F17, /* 1F10 */
+ 0x0395,0x0395,0x0395,0x0395,0x0395,0x0395,0x1F1E,0x1F1F, /* 1F18 */
+ 0x0397,0x0397,0x0397,0x0397,0x0397,0x0397,0x0397,0x0397, /* 1F20 */
+ 0x0397,0x0397,0x0397,0x0397,0x0397,0x0397,0x0397,0x0397, /* 1F28 */
+ 0x0399,0x0399,0x0399,0x0399,0x0399,0x0399,0x0399,0x0399, /* 1F30 */
+ 0x0399,0x0399,0x0399,0x0399,0x0399,0x0399,0x0399,0x0399, /* 1F38 */
+ 0x039F,0x039F,0x039F,0x039F,0x039F,0x039F,0x1F46,0x1F47, /* 1F40 */
+ 0x039F,0x039F,0x039F,0x039F,0x039F,0x039F,0x1F4E,0x1F4F, /* 1F48 */
+ 0x03A5,0x03A5,0x03A5,0x03A5,0x03A5,0x03A5,0x03A5,0x03A5, /* 1F50 */
+ 0x1F58,0x03A5,0x1F5A,0x03A5,0x1F5C,0x03A5,0x1F5E,0x03A5, /* 1F58 */
+ 0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9, /* 1F60 */
+ 0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9, /* 1F68 */
+ 0x0391,0x1FBB,0x0395,0x1FC9,0x0397,0x1FCB,0x0399,0x1FDB, /* 1F70 */
+ 0x039F,0x1FF9,0x03A5,0x1FEB,0x03A9,0x1FFB,0x1F7E,0x1F7F, /* 1F78 */
+ 0x0391,0x0391,0x0391,0x0391,0x0391,0x0391,0x0391,0x0391, /* 1F80 */
+ 0x0391,0x0391,0x0391,0x0391,0x0391,0x0391,0x0391,0x0391, /* 1F88 */
+ 0x0397,0x0397,0x0397,0x0397,0x0397,0x0397,0x0397,0x0397, /* 1F90 */
+ 0x0397,0x0397,0x0397,0x0397,0x0397,0x0397,0x0397,0x0397, /* 1F98 */
+ 0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9, /* 1FA0 */
+ 0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9, /* 1FA8 */
+ 0x0391,0x0391,0x0391,0x0391,0x0391,0x1FB5,0x0391,0x0391, /* 1FB0 */
+ 0x0391,0x0391,0x0391,0x1FBB,0x0391,0x1FBD,0x0399,0x1FBF, /* 1FB8 */
+ 0x1FC0,0x1FC1,0x0397,0x0397,0x0397,0x1FC5,0x0397,0x0397, /* 1FC0 */
+ 0x0395,0x1FC9,0x0397,0x1FCB,0x0397,0x1FCD,0x1FCE,0x1FCF, /* 1FC8 */
+ 0x0399,0x0399,0x0399,0x1FD3,0x1FD4,0x1FD5,0x0399,0x0399, /* 1FD0 */
+ 0x0399,0x0399,0x0399,0x1FDB,0x1FDC,0x1FDD,0x1FDE,0x1FDF, /* 1FD8 */
+ 0x03A5,0x03A5,0x03A5,0x1FE3,0x03A1,0x03A1,0x03A5,0x03A5, /* 1FE0 */
+ 0x03A5,0x03A5,0x03A5,0x1FEB,0x03A1,0x1FED,0x1FEE,0x1FEF, /* 1FE8 */
+ 0x1FF0,0x1FF1,0x03A9,0x03A9,0x03A9,0x1FF5,0x03A9,0x03A9, /* 1FF0 */
+ 0x039F,0x1FF9,0x03A9,0x1FFB,0x03A9,0x1FFD,0x1FFE,0x1FFF /* 1FF8 */
+};
+
+static const uint16 weight_general_ci_page21[256]={
+ 0x2100,0x2101,0x2102,0x2103,0x2104,0x2105,0x2106,0x2107, /* 2100 */
+ 0x2108,0x2109,0x210A,0x210B,0x210C,0x210D,0x210E,0x210F, /* 2108 */
+ 0x2110,0x2111,0x2112,0x2113,0x2114,0x2115,0x2116,0x2117, /* 2110 */
+ 0x2118,0x2119,0x211A,0x211B,0x211C,0x211D,0x211E,0x211F, /* 2118 */
+ 0x2120,0x2121,0x2122,0x2123,0x2124,0x2125,0x2126,0x2127, /* 2120 */
+ 0x2128,0x2129,0x212A,0x212B,0x212C,0x212D,0x212E,0x212F, /* 2128 */
+ 0x2130,0x2131,0x2132,0x2133,0x2134,0x2135,0x2136,0x2137, /* 2130 */
+ 0x2138,0x2139,0x213A,0x213B,0x213C,0x213D,0x213E,0x213F, /* 2138 */
+ 0x2140,0x2141,0x2142,0x2143,0x2144,0x2145,0x2146,0x2147, /* 2140 */
+ 0x2148,0x2149,0x214A,0x214B,0x214C,0x214D,0x214E,0x214F, /* 2148 */
+ 0x2150,0x2151,0x2152,0x2153,0x2154,0x2155,0x2156,0x2157, /* 2150 */
+ 0x2158,0x2159,0x215A,0x215B,0x215C,0x215D,0x215E,0x215F, /* 2158 */
+ 0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166,0x2167, /* 2160 */
+ 0x2168,0x2169,0x216A,0x216B,0x216C,0x216D,0x216E,0x216F, /* 2168 */
+ 0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166,0x2167, /* 2170 */
+ 0x2168,0x2169,0x216A,0x216B,0x216C,0x216D,0x216E,0x216F, /* 2178 */
+ 0x2180,0x2181,0x2182,0x2183,0x2184,0x2185,0x2186,0x2187, /* 2180 */
+ 0x2188,0x2189,0x218A,0x218B,0x218C,0x218D,0x218E,0x218F, /* 2188 */
+ 0x2190,0x2191,0x2192,0x2193,0x2194,0x2195,0x2196,0x2197, /* 2190 */
+ 0x2198,0x2199,0x219A,0x219B,0x219C,0x219D,0x219E,0x219F, /* 2198 */
+ 0x21A0,0x21A1,0x21A2,0x21A3,0x21A4,0x21A5,0x21A6,0x21A7, /* 21A0 */
+ 0x21A8,0x21A9,0x21AA,0x21AB,0x21AC,0x21AD,0x21AE,0x21AF, /* 21A8 */
+ 0x21B0,0x21B1,0x21B2,0x21B3,0x21B4,0x21B5,0x21B6,0x21B7, /* 21B0 */
+ 0x21B8,0x21B9,0x21BA,0x21BB,0x21BC,0x21BD,0x21BE,0x21BF, /* 21B8 */
+ 0x21C0,0x21C1,0x21C2,0x21C3,0x21C4,0x21C5,0x21C6,0x21C7, /* 21C0 */
+ 0x21C8,0x21C9,0x21CA,0x21CB,0x21CC,0x21CD,0x21CE,0x21CF, /* 21C8 */
+ 0x21D0,0x21D1,0x21D2,0x21D3,0x21D4,0x21D5,0x21D6,0x21D7, /* 21D0 */
+ 0x21D8,0x21D9,0x21DA,0x21DB,0x21DC,0x21DD,0x21DE,0x21DF, /* 21D8 */
+ 0x21E0,0x21E1,0x21E2,0x21E3,0x21E4,0x21E5,0x21E6,0x21E7, /* 21E0 */
+ 0x21E8,0x21E9,0x21EA,0x21EB,0x21EC,0x21ED,0x21EE,0x21EF, /* 21E8 */
+ 0x21F0,0x21F1,0x21F2,0x21F3,0x21F4,0x21F5,0x21F6,0x21F7, /* 21F0 */
+ 0x21F8,0x21F9,0x21FA,0x21FB,0x21FC,0x21FD,0x21FE,0x21FF /* 21F8 */
+};
+
+static const uint16 weight_general_ci_page24[256]={
+ 0x2400,0x2401,0x2402,0x2403,0x2404,0x2405,0x2406,0x2407, /* 2400 */
+ 0x2408,0x2409,0x240A,0x240B,0x240C,0x240D,0x240E,0x240F, /* 2408 */
+ 0x2410,0x2411,0x2412,0x2413,0x2414,0x2415,0x2416,0x2417, /* 2410 */
+ 0x2418,0x2419,0x241A,0x241B,0x241C,0x241D,0x241E,0x241F, /* 2418 */
+ 0x2420,0x2421,0x2422,0x2423,0x2424,0x2425,0x2426,0x2427, /* 2420 */
+ 0x2428,0x2429,0x242A,0x242B,0x242C,0x242D,0x242E,0x242F, /* 2428 */
+ 0x2430,0x2431,0x2432,0x2433,0x2434,0x2435,0x2436,0x2437, /* 2430 */
+ 0x2438,0x2439,0x243A,0x243B,0x243C,0x243D,0x243E,0x243F, /* 2438 */
+ 0x2440,0x2441,0x2442,0x2443,0x2444,0x2445,0x2446,0x2447, /* 2440 */
+ 0x2448,0x2449,0x244A,0x244B,0x244C,0x244D,0x244E,0x244F, /* 2448 */
+ 0x2450,0x2451,0x2452,0x2453,0x2454,0x2455,0x2456,0x2457, /* 2450 */
+ 0x2458,0x2459,0x245A,0x245B,0x245C,0x245D,0x245E,0x245F, /* 2458 */
+ 0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467, /* 2460 */
+ 0x2468,0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F, /* 2468 */
+ 0x2470,0x2471,0x2472,0x2473,0x2474,0x2475,0x2476,0x2477, /* 2470 */
+ 0x2478,0x2479,0x247A,0x247B,0x247C,0x247D,0x247E,0x247F, /* 2478 */
+ 0x2480,0x2481,0x2482,0x2483,0x2484,0x2485,0x2486,0x2487, /* 2480 */
+ 0x2488,0x2489,0x248A,0x248B,0x248C,0x248D,0x248E,0x248F, /* 2488 */
+ 0x2490,0x2491,0x2492,0x2493,0x2494,0x2495,0x2496,0x2497, /* 2490 */
+ 0x2498,0x2499,0x249A,0x249B,0x249C,0x249D,0x249E,0x249F, /* 2498 */
+ 0x24A0,0x24A1,0x24A2,0x24A3,0x24A4,0x24A5,0x24A6,0x24A7, /* 24A0 */
+ 0x24A8,0x24A9,0x24AA,0x24AB,0x24AC,0x24AD,0x24AE,0x24AF, /* 24A8 */
+ 0x24B0,0x24B1,0x24B2,0x24B3,0x24B4,0x24B5,0x24B6,0x24B7, /* 24B0 */
+ 0x24B8,0x24B9,0x24BA,0x24BB,0x24BC,0x24BD,0x24BE,0x24BF, /* 24B8 */
+ 0x24C0,0x24C1,0x24C2,0x24C3,0x24C4,0x24C5,0x24C6,0x24C7, /* 24C0 */
+ 0x24C8,0x24C9,0x24CA,0x24CB,0x24CC,0x24CD,0x24CE,0x24CF, /* 24C8 */
+ 0x24B6,0x24B7,0x24B8,0x24B9,0x24BA,0x24BB,0x24BC,0x24BD, /* 24D0 */
+ 0x24BE,0x24BF,0x24C0,0x24C1,0x24C2,0x24C3,0x24C4,0x24C5, /* 24D8 */
+ 0x24C6,0x24C7,0x24C8,0x24C9,0x24CA,0x24CB,0x24CC,0x24CD, /* 24E0 */
+ 0x24CE,0x24CF,0x24EA,0x24EB,0x24EC,0x24ED,0x24EE,0x24EF, /* 24E8 */
+ 0x24F0,0x24F1,0x24F2,0x24F3,0x24F4,0x24F5,0x24F6,0x24F7, /* 24F0 */
+ 0x24F8,0x24F9,0x24FA,0x24FB,0x24FC,0x24FD,0x24FE,0x24FF /* 24F8 */
+};
+
+static const uint16 weight_general_ci_pageFF[256]={
+ 0xFF00,0xFF01,0xFF02,0xFF03,0xFF04,0xFF05,0xFF06,0xFF07, /* FF00 */
+ 0xFF08,0xFF09,0xFF0A,0xFF0B,0xFF0C,0xFF0D,0xFF0E,0xFF0F, /* FF08 */
+ 0xFF10,0xFF11,0xFF12,0xFF13,0xFF14,0xFF15,0xFF16,0xFF17, /* FF10 */
+ 0xFF18,0xFF19,0xFF1A,0xFF1B,0xFF1C,0xFF1D,0xFF1E,0xFF1F, /* FF18 */
+ 0xFF20,0xFF21,0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27, /* FF20 */
+ 0xFF28,0xFF29,0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F, /* FF28 */
+ 0xFF30,0xFF31,0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37, /* FF30 */
+ 0xFF38,0xFF39,0xFF3A,0xFF3B,0xFF3C,0xFF3D,0xFF3E,0xFF3F, /* FF38 */
+ 0xFF40,0xFF21,0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27, /* FF40 */
+ 0xFF28,0xFF29,0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F, /* FF48 */
+ 0xFF30,0xFF31,0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37, /* FF50 */
+ 0xFF38,0xFF39,0xFF3A,0xFF5B,0xFF5C,0xFF5D,0xFF5E,0xFF5F, /* FF58 */
+ 0xFF60,0xFF61,0xFF62,0xFF63,0xFF64,0xFF65,0xFF66,0xFF67, /* FF60 */
+ 0xFF68,0xFF69,0xFF6A,0xFF6B,0xFF6C,0xFF6D,0xFF6E,0xFF6F, /* FF68 */
+ 0xFF70,0xFF71,0xFF72,0xFF73,0xFF74,0xFF75,0xFF76,0xFF77, /* FF70 */
+ 0xFF78,0xFF79,0xFF7A,0xFF7B,0xFF7C,0xFF7D,0xFF7E,0xFF7F, /* FF78 */
+ 0xFF80,0xFF81,0xFF82,0xFF83,0xFF84,0xFF85,0xFF86,0xFF87, /* FF80 */
+ 0xFF88,0xFF89,0xFF8A,0xFF8B,0xFF8C,0xFF8D,0xFF8E,0xFF8F, /* FF88 */
+ 0xFF90,0xFF91,0xFF92,0xFF93,0xFF94,0xFF95,0xFF96,0xFF97, /* FF90 */
+ 0xFF98,0xFF99,0xFF9A,0xFF9B,0xFF9C,0xFF9D,0xFF9E,0xFF9F, /* FF98 */
+ 0xFFA0,0xFFA1,0xFFA2,0xFFA3,0xFFA4,0xFFA5,0xFFA6,0xFFA7, /* FFA0 */
+ 0xFFA8,0xFFA9,0xFFAA,0xFFAB,0xFFAC,0xFFAD,0xFFAE,0xFFAF, /* FFA8 */
+ 0xFFB0,0xFFB1,0xFFB2,0xFFB3,0xFFB4,0xFFB5,0xFFB6,0xFFB7, /* FFB0 */
+ 0xFFB8,0xFFB9,0xFFBA,0xFFBB,0xFFBC,0xFFBD,0xFFBE,0xFFBF, /* FFB8 */
+ 0xFFC0,0xFFC1,0xFFC2,0xFFC3,0xFFC4,0xFFC5,0xFFC6,0xFFC7, /* FFC0 */
+ 0xFFC8,0xFFC9,0xFFCA,0xFFCB,0xFFCC,0xFFCD,0xFFCE,0xFFCF, /* FFC8 */
+ 0xFFD0,0xFFD1,0xFFD2,0xFFD3,0xFFD4,0xFFD5,0xFFD6,0xFFD7, /* FFD0 */
+ 0xFFD8,0xFFD9,0xFFDA,0xFFDB,0xFFDC,0xFFDD,0xFFDE,0xFFDF, /* FFD8 */
+ 0xFFE0,0xFFE1,0xFFE2,0xFFE3,0xFFE4,0xFFE5,0xFFE6,0xFFE7, /* FFE0 */
+ 0xFFE8,0xFFE9,0xFFEA,0xFFEB,0xFFEC,0xFFED,0xFFEE,0xFFEF, /* FFE8 */
+ 0xFFF0,0xFFF1,0xFFF2,0xFFF3,0xFFF4,0xFFF5,0xFFF6,0xFFF7, /* FFF0 */
+ 0xFFF8,0xFFF9,0xFFFA,0xFFFB,0xFFFC,0xFFFD,0xFFFE,0xFFFF /* FFF8 */
+};
+
+const uint16 * weight_general_ci_index[256]={
+ weight_general_ci_page00, weight_general_ci_page01,
+ weight_general_ci_page02, weight_general_ci_page03,
+ weight_general_ci_page04, weight_general_ci_page05,
+ weight_general_ci_page06, weight_general_ci_page07,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ weight_general_ci_page1E, weight_general_ci_page1F,
+ NULL, weight_general_ci_page21,
+ NULL, NULL,
+ weight_general_ci_page24, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, weight_general_ci_pageFF
+};
diff --git a/strings/ctype-unicode300-general_mysql500_ci.h b/strings/ctype-unicode300-general_mysql500_ci.h
new file mode 100644
index 00000000000..3366c391380
--- /dev/null
+++ b/strings/ctype-unicode300-general_mysql500_ci.h
@@ -0,0 +1,190 @@
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2023, 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
+*/
+
+/*
+ Generated by:
+ ./unidata-dump \
+ --mode=weight_general_mysql500_ci \
+ --max-char=0xFFFF \
+ UnicodeData-3.0.0.txt
+
+*/
+const uint16 weight_general_mysql500_ci_page00[256]={
+ 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, /* 0000 */
+ 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, /* 0008 */
+ 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, /* 0010 */
+ 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, /* 0018 */
+ 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, /* 0020 */
+ 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, /* 0028 */
+ 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, /* 0030 */
+ 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, /* 0038 */
+ 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, /* 0040 */
+ 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, /* 0048 */
+ 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, /* 0050 */
+ 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, /* 0058 */
+ 0x0060,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, /* 0060 */
+ 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, /* 0068 */
+ 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, /* 0070 */
+ 0x0058,0x0059,0x005A,0x007B,0x007C,0x007D,0x007E,0x007F, /* 0078 */
+ 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, /* 0080 */
+ 0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, /* 0088 */
+ 0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, /* 0090 */
+ 0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, /* 0098 */
+ 0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, /* 00A0 */
+ 0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, /* 00A8 */
+ 0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x039C,0x00B6,0x00B7, /* 00B0 */
+ 0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, /* 00B8 */
+ 0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x00C6,0x0043, /* 00C0 */
+ 0x0045,0x0045,0x0045,0x0045,0x0049,0x0049,0x0049,0x0049, /* 00C8 */
+ 0x00D0,0x004E,0x004F,0x004F,0x004F,0x004F,0x004F,0x00D7, /* 00D0 */
+ 0x00D8,0x0055,0x0055,0x0055,0x0055,0x0059,0x00DE,0x00DF, /* 00D8 */
+ 0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x00C6,0x0043, /* 00E0 */
+ 0x0045,0x0045,0x0045,0x0045,0x0049,0x0049,0x0049,0x0049, /* 00E8 */
+ 0x00D0,0x004E,0x004F,0x004F,0x004F,0x004F,0x004F,0x00F7, /* 00F0 */
+ 0x00D8,0x0055,0x0055,0x0055,0x0055,0x0059,0x00DE,0x0059 /* 00F8 */
+};
+
+const uint16 * weight_general_mysql500_ci_index[256]={
+ weight_general_mysql500_ci_page00, weight_general_ci_page01,
+ weight_general_ci_page02, weight_general_ci_page03,
+ weight_general_ci_page04, weight_general_ci_page05,
+ weight_general_ci_page06, weight_general_ci_page07,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ weight_general_ci_page1E, weight_general_ci_page1F,
+ NULL, weight_general_ci_page21,
+ NULL, NULL,
+ weight_general_ci_page24, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, weight_general_ci_pageFF
+};
diff --git a/strings/ctype-unicode520-casefold.h b/strings/ctype-unicode520-casefold.h
new file mode 100644
index 00000000000..bcd0ff355be
--- /dev/null
+++ b/strings/ctype-unicode520-casefold.h
@@ -0,0 +1,3192 @@
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2023, 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
+*/
+
+/*
+ Generated by:
+ ./unidata-dump \
+ --mode=casefold \
+ --page-name=u520_casefold_page \
+ --index-name=my_u520_casefold_index \
+ UnicodeData-5.2.0.txt
+
+*/
+const MY_CASEFOLD_CHARACTER u520_casefold_page00[256]={
+ {0x0000,0x0000},{0x0001,0x0001}, /* 0000 */
+ {0x0002,0x0002},{0x0003,0x0003}, /* 0002 */
+ {0x0004,0x0004},{0x0005,0x0005}, /* 0004 */
+ {0x0006,0x0006},{0x0007,0x0007}, /* 0006 */
+ {0x0008,0x0008},{0x0009,0x0009}, /* 0008 */
+ {0x000A,0x000A},{0x000B,0x000B}, /* 000A */
+ {0x000C,0x000C},{0x000D,0x000D}, /* 000C */
+ {0x000E,0x000E},{0x000F,0x000F}, /* 000E */
+ {0x0010,0x0010},{0x0011,0x0011}, /* 0010 */
+ {0x0012,0x0012},{0x0013,0x0013}, /* 0012 */
+ {0x0014,0x0014},{0x0015,0x0015}, /* 0014 */
+ {0x0016,0x0016},{0x0017,0x0017}, /* 0016 */
+ {0x0018,0x0018},{0x0019,0x0019}, /* 0018 */
+ {0x001A,0x001A},{0x001B,0x001B}, /* 001A */
+ {0x001C,0x001C},{0x001D,0x001D}, /* 001C */
+ {0x001E,0x001E},{0x001F,0x001F}, /* 001E */
+ {0x0020,0x0020},{0x0021,0x0021}, /* 0020 */
+ {0x0022,0x0022},{0x0023,0x0023}, /* 0022 */
+ {0x0024,0x0024},{0x0025,0x0025}, /* 0024 */
+ {0x0026,0x0026},{0x0027,0x0027}, /* 0026 */
+ {0x0028,0x0028},{0x0029,0x0029}, /* 0028 */
+ {0x002A,0x002A},{0x002B,0x002B}, /* 002A */
+ {0x002C,0x002C},{0x002D,0x002D}, /* 002C */
+ {0x002E,0x002E},{0x002F,0x002F}, /* 002E */
+ {0x0030,0x0030},{0x0031,0x0031}, /* 0030 */
+ {0x0032,0x0032},{0x0033,0x0033}, /* 0032 */
+ {0x0034,0x0034},{0x0035,0x0035}, /* 0034 */
+ {0x0036,0x0036},{0x0037,0x0037}, /* 0036 */
+ {0x0038,0x0038},{0x0039,0x0039}, /* 0038 */
+ {0x003A,0x003A},{0x003B,0x003B}, /* 003A */
+ {0x003C,0x003C},{0x003D,0x003D}, /* 003C */
+ {0x003E,0x003E},{0x003F,0x003F}, /* 003E */
+ {0x0040,0x0040},{0x0041,0x0061}, /* 0040 */
+ {0x0042,0x0062},{0x0043,0x0063}, /* 0042 */
+ {0x0044,0x0064},{0x0045,0x0065}, /* 0044 */
+ {0x0046,0x0066},{0x0047,0x0067}, /* 0046 */
+ {0x0048,0x0068},{0x0049,0x0069}, /* 0048 */
+ {0x004A,0x006A},{0x004B,0x006B}, /* 004A */
+ {0x004C,0x006C},{0x004D,0x006D}, /* 004C */
+ {0x004E,0x006E},{0x004F,0x006F}, /* 004E */
+ {0x0050,0x0070},{0x0051,0x0071}, /* 0050 */
+ {0x0052,0x0072},{0x0053,0x0073}, /* 0052 */
+ {0x0054,0x0074},{0x0055,0x0075}, /* 0054 */
+ {0x0056,0x0076},{0x0057,0x0077}, /* 0056 */
+ {0x0058,0x0078},{0x0059,0x0079}, /* 0058 */
+ {0x005A,0x007A},{0x005B,0x005B}, /* 005A */
+ {0x005C,0x005C},{0x005D,0x005D}, /* 005C */
+ {0x005E,0x005E},{0x005F,0x005F}, /* 005E */
+ {0x0060,0x0060},{0x0041,0x0061}, /* 0060 */
+ {0x0042,0x0062},{0x0043,0x0063}, /* 0062 */
+ {0x0044,0x0064},{0x0045,0x0065}, /* 0064 */
+ {0x0046,0x0066},{0x0047,0x0067}, /* 0066 */
+ {0x0048,0x0068},{0x0049,0x0069}, /* 0068 */
+ {0x004A,0x006A},{0x004B,0x006B}, /* 006A */
+ {0x004C,0x006C},{0x004D,0x006D}, /* 006C */
+ {0x004E,0x006E},{0x004F,0x006F}, /* 006E */
+ {0x0050,0x0070},{0x0051,0x0071}, /* 0070 */
+ {0x0052,0x0072},{0x0053,0x0073}, /* 0072 */
+ {0x0054,0x0074},{0x0055,0x0075}, /* 0074 */
+ {0x0056,0x0076},{0x0057,0x0077}, /* 0076 */
+ {0x0058,0x0078},{0x0059,0x0079}, /* 0078 */
+ {0x005A,0x007A},{0x007B,0x007B}, /* 007A */
+ {0x007C,0x007C},{0x007D,0x007D}, /* 007C */
+ {0x007E,0x007E},{0x007F,0x007F}, /* 007E */
+ {0x0080,0x0080},{0x0081,0x0081}, /* 0080 */
+ {0x0082,0x0082},{0x0083,0x0083}, /* 0082 */
+ {0x0084,0x0084},{0x0085,0x0085}, /* 0084 */
+ {0x0086,0x0086},{0x0087,0x0087}, /* 0086 */
+ {0x0088,0x0088},{0x0089,0x0089}, /* 0088 */
+ {0x008A,0x008A},{0x008B,0x008B}, /* 008A */
+ {0x008C,0x008C},{0x008D,0x008D}, /* 008C */
+ {0x008E,0x008E},{0x008F,0x008F}, /* 008E */
+ {0x0090,0x0090},{0x0091,0x0091}, /* 0090 */
+ {0x0092,0x0092},{0x0093,0x0093}, /* 0092 */
+ {0x0094,0x0094},{0x0095,0x0095}, /* 0094 */
+ {0x0096,0x0096},{0x0097,0x0097}, /* 0096 */
+ {0x0098,0x0098},{0x0099,0x0099}, /* 0098 */
+ {0x009A,0x009A},{0x009B,0x009B}, /* 009A */
+ {0x009C,0x009C},{0x009D,0x009D}, /* 009C */
+ {0x009E,0x009E},{0x009F,0x009F}, /* 009E */
+ {0x00A0,0x00A0},{0x00A1,0x00A1}, /* 00A0 */
+ {0x00A2,0x00A2},{0x00A3,0x00A3}, /* 00A2 */
+ {0x00A4,0x00A4},{0x00A5,0x00A5}, /* 00A4 */
+ {0x00A6,0x00A6},{0x00A7,0x00A7}, /* 00A6 */
+ {0x00A8,0x00A8},{0x00A9,0x00A9}, /* 00A8 */
+ {0x00AA,0x00AA},{0x00AB,0x00AB}, /* 00AA */
+ {0x00AC,0x00AC},{0x00AD,0x00AD}, /* 00AC */
+ {0x00AE,0x00AE},{0x00AF,0x00AF}, /* 00AE */
+ {0x00B0,0x00B0},{0x00B1,0x00B1}, /* 00B0 */
+ {0x00B2,0x00B2},{0x00B3,0x00B3}, /* 00B2 */
+ {0x00B4,0x00B4},{0x039C,0x00B5}, /* 00B4 */
+ {0x00B6,0x00B6},{0x00B7,0x00B7}, /* 00B6 */
+ {0x00B8,0x00B8},{0x00B9,0x00B9}, /* 00B8 */
+ {0x00BA,0x00BA},{0x00BB,0x00BB}, /* 00BA */
+ {0x00BC,0x00BC},{0x00BD,0x00BD}, /* 00BC */
+ {0x00BE,0x00BE},{0x00BF,0x00BF}, /* 00BE */
+ {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00C0 */
+ {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00C2 */
+ {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00C4 */
+ {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00C6 */
+ {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00C8 */
+ {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00CA */
+ {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00CC */
+ {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00CE */
+ {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00D0 */
+ {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00D2 */
+ {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00D4 */
+ {0x00D6,0x00F6},{0x00D7,0x00D7}, /* 00D6 */
+ {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00D8 */
+ {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00DA */
+ {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00DC */
+ {0x00DE,0x00FE},{0x00DF,0x00DF}, /* 00DE */
+ {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00E0 */
+ {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00E2 */
+ {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00E4 */
+ {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00E6 */
+ {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00E8 */
+ {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00EA */
+ {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00EC */
+ {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00EE */
+ {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00F0 */
+ {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00F2 */
+ {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00F4 */
+ {0x00D6,0x00F6},{0x00F7,0x00F7}, /* 00F6 */
+ {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00F8 */
+ {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00FA */
+ {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00FC */
+ {0x00DE,0x00FE},{0x0178,0x00FF} /* 00FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_page01[256]={
+ {0x0100,0x0101},{0x0100,0x0101}, /* 0100 */
+ {0x0102,0x0103},{0x0102,0x0103}, /* 0102 */
+ {0x0104,0x0105},{0x0104,0x0105}, /* 0104 */
+ {0x0106,0x0107},{0x0106,0x0107}, /* 0106 */
+ {0x0108,0x0109},{0x0108,0x0109}, /* 0108 */
+ {0x010A,0x010B},{0x010A,0x010B}, /* 010A */
+ {0x010C,0x010D},{0x010C,0x010D}, /* 010C */
+ {0x010E,0x010F},{0x010E,0x010F}, /* 010E */
+ {0x0110,0x0111},{0x0110,0x0111}, /* 0110 */
+ {0x0112,0x0113},{0x0112,0x0113}, /* 0112 */
+ {0x0114,0x0115},{0x0114,0x0115}, /* 0114 */
+ {0x0116,0x0117},{0x0116,0x0117}, /* 0116 */
+ {0x0118,0x0119},{0x0118,0x0119}, /* 0118 */
+ {0x011A,0x011B},{0x011A,0x011B}, /* 011A */
+ {0x011C,0x011D},{0x011C,0x011D}, /* 011C */
+ {0x011E,0x011F},{0x011E,0x011F}, /* 011E */
+ {0x0120,0x0121},{0x0120,0x0121}, /* 0120 */
+ {0x0122,0x0123},{0x0122,0x0123}, /* 0122 */
+ {0x0124,0x0125},{0x0124,0x0125}, /* 0124 */
+ {0x0126,0x0127},{0x0126,0x0127}, /* 0126 */
+ {0x0128,0x0129},{0x0128,0x0129}, /* 0128 */
+ {0x012A,0x012B},{0x012A,0x012B}, /* 012A */
+ {0x012C,0x012D},{0x012C,0x012D}, /* 012C */
+ {0x012E,0x012F},{0x012E,0x012F}, /* 012E */
+ {0x0130,0x0069},{0x0049,0x0131}, /* 0130 */
+ {0x0132,0x0133},{0x0132,0x0133}, /* 0132 */
+ {0x0134,0x0135},{0x0134,0x0135}, /* 0134 */
+ {0x0136,0x0137},{0x0136,0x0137}, /* 0136 */
+ {0x0138,0x0138},{0x0139,0x013A}, /* 0138 */
+ {0x0139,0x013A},{0x013B,0x013C}, /* 013A */
+ {0x013B,0x013C},{0x013D,0x013E}, /* 013C */
+ {0x013D,0x013E},{0x013F,0x0140}, /* 013E */
+ {0x013F,0x0140},{0x0141,0x0142}, /* 0140 */
+ {0x0141,0x0142},{0x0143,0x0144}, /* 0142 */
+ {0x0143,0x0144},{0x0145,0x0146}, /* 0144 */
+ {0x0145,0x0146},{0x0147,0x0148}, /* 0146 */
+ {0x0147,0x0148},{0x0149,0x0149}, /* 0148 */
+ {0x014A,0x014B},{0x014A,0x014B}, /* 014A */
+ {0x014C,0x014D},{0x014C,0x014D}, /* 014C */
+ {0x014E,0x014F},{0x014E,0x014F}, /* 014E */
+ {0x0150,0x0151},{0x0150,0x0151}, /* 0150 */
+ {0x0152,0x0153},{0x0152,0x0153}, /* 0152 */
+ {0x0154,0x0155},{0x0154,0x0155}, /* 0154 */
+ {0x0156,0x0157},{0x0156,0x0157}, /* 0156 */
+ {0x0158,0x0159},{0x0158,0x0159}, /* 0158 */
+ {0x015A,0x015B},{0x015A,0x015B}, /* 015A */
+ {0x015C,0x015D},{0x015C,0x015D}, /* 015C */
+ {0x015E,0x015F},{0x015E,0x015F}, /* 015E */
+ {0x0160,0x0161},{0x0160,0x0161}, /* 0160 */
+ {0x0162,0x0163},{0x0162,0x0163}, /* 0162 */
+ {0x0164,0x0165},{0x0164,0x0165}, /* 0164 */
+ {0x0166,0x0167},{0x0166,0x0167}, /* 0166 */
+ {0x0168,0x0169},{0x0168,0x0169}, /* 0168 */
+ {0x016A,0x016B},{0x016A,0x016B}, /* 016A */
+ {0x016C,0x016D},{0x016C,0x016D}, /* 016C */
+ {0x016E,0x016F},{0x016E,0x016F}, /* 016E */
+ {0x0170,0x0171},{0x0170,0x0171}, /* 0170 */
+ {0x0172,0x0173},{0x0172,0x0173}, /* 0172 */
+ {0x0174,0x0175},{0x0174,0x0175}, /* 0174 */
+ {0x0176,0x0177},{0x0176,0x0177}, /* 0176 */
+ {0x0178,0x00FF},{0x0179,0x017A}, /* 0178 */
+ {0x0179,0x017A},{0x017B,0x017C}, /* 017A */
+ {0x017B,0x017C},{0x017D,0x017E}, /* 017C */
+ {0x017D,0x017E},{0x0053,0x017F}, /* 017E */
+ {0x0243,0x0180},{0x0181,0x0253}, /* 0180 */
+ {0x0182,0x0183},{0x0182,0x0183}, /* 0182 */
+ {0x0184,0x0185},{0x0184,0x0185}, /* 0184 */
+ {0x0186,0x0254},{0x0187,0x0188}, /* 0186 */
+ {0x0187,0x0188},{0x0189,0x0256}, /* 0188 */
+ {0x018A,0x0257},{0x018B,0x018C}, /* 018A */
+ {0x018B,0x018C},{0x018D,0x018D}, /* 018C */
+ {0x018E,0x01DD},{0x018F,0x0259}, /* 018E */
+ {0x0190,0x025B},{0x0191,0x0192}, /* 0190 */
+ {0x0191,0x0192},{0x0193,0x0260}, /* 0192 */
+ {0x0194,0x0263},{0x01F6,0x0195}, /* 0194 */
+ {0x0196,0x0269},{0x0197,0x0268}, /* 0196 */
+ {0x0198,0x0199},{0x0198,0x0199}, /* 0198 */
+ {0x023D,0x019A},{0x019B,0x019B}, /* 019A */
+ {0x019C,0x026F},{0x019D,0x0272}, /* 019C */
+ {0x0220,0x019E},{0x019F,0x0275}, /* 019E */
+ {0x01A0,0x01A1},{0x01A0,0x01A1}, /* 01A0 */
+ {0x01A2,0x01A3},{0x01A2,0x01A3}, /* 01A2 */
+ {0x01A4,0x01A5},{0x01A4,0x01A5}, /* 01A4 */
+ {0x01A6,0x0280},{0x01A7,0x01A8}, /* 01A6 */
+ {0x01A7,0x01A8},{0x01A9,0x0283}, /* 01A8 */
+ {0x01AA,0x01AA},{0x01AB,0x01AB}, /* 01AA */
+ {0x01AC,0x01AD},{0x01AC,0x01AD}, /* 01AC */
+ {0x01AE,0x0288},{0x01AF,0x01B0}, /* 01AE */
+ {0x01AF,0x01B0},{0x01B1,0x028A}, /* 01B0 */
+ {0x01B2,0x028B},{0x01B3,0x01B4}, /* 01B2 */
+ {0x01B3,0x01B4},{0x01B5,0x01B6}, /* 01B4 */
+ {0x01B5,0x01B6},{0x01B7,0x0292}, /* 01B6 */
+ {0x01B8,0x01B9},{0x01B8,0x01B9}, /* 01B8 */
+ {0x01BA,0x01BA},{0x01BB,0x01BB}, /* 01BA */
+ {0x01BC,0x01BD},{0x01BC,0x01BD}, /* 01BC */
+ {0x01BE,0x01BE},{0x01F7,0x01BF}, /* 01BE */
+ {0x01C0,0x01C0},{0x01C1,0x01C1}, /* 01C0 */
+ {0x01C2,0x01C2},{0x01C3,0x01C3}, /* 01C2 */
+ {0x01C4,0x01C6},{0x01C4,0x01C6}, /* 01C4 */
+ {0x01C4,0x01C6},{0x01C7,0x01C9}, /* 01C6 */
+ {0x01C7,0x01C9},{0x01C7,0x01C9}, /* 01C8 */
+ {0x01CA,0x01CC},{0x01CA,0x01CC}, /* 01CA */
+ {0x01CA,0x01CC},{0x01CD,0x01CE}, /* 01CC */
+ {0x01CD,0x01CE},{0x01CF,0x01D0}, /* 01CE */
+ {0x01CF,0x01D0},{0x01D1,0x01D2}, /* 01D0 */
+ {0x01D1,0x01D2},{0x01D3,0x01D4}, /* 01D2 */
+ {0x01D3,0x01D4},{0x01D5,0x01D6}, /* 01D4 */
+ {0x01D5,0x01D6},{0x01D7,0x01D8}, /* 01D6 */
+ {0x01D7,0x01D8},{0x01D9,0x01DA}, /* 01D8 */
+ {0x01D9,0x01DA},{0x01DB,0x01DC}, /* 01DA */
+ {0x01DB,0x01DC},{0x018E,0x01DD}, /* 01DC */
+ {0x01DE,0x01DF},{0x01DE,0x01DF}, /* 01DE */
+ {0x01E0,0x01E1},{0x01E0,0x01E1}, /* 01E0 */
+ {0x01E2,0x01E3},{0x01E2,0x01E3}, /* 01E2 */
+ {0x01E4,0x01E5},{0x01E4,0x01E5}, /* 01E4 */
+ {0x01E6,0x01E7},{0x01E6,0x01E7}, /* 01E6 */
+ {0x01E8,0x01E9},{0x01E8,0x01E9}, /* 01E8 */
+ {0x01EA,0x01EB},{0x01EA,0x01EB}, /* 01EA */
+ {0x01EC,0x01ED},{0x01EC,0x01ED}, /* 01EC */
+ {0x01EE,0x01EF},{0x01EE,0x01EF}, /* 01EE */
+ {0x01F0,0x01F0},{0x01F1,0x01F3}, /* 01F0 */
+ {0x01F1,0x01F3},{0x01F1,0x01F3}, /* 01F2 */
+ {0x01F4,0x01F5},{0x01F4,0x01F5}, /* 01F4 */
+ {0x01F6,0x0195},{0x01F7,0x01BF}, /* 01F6 */
+ {0x01F8,0x01F9},{0x01F8,0x01F9}, /* 01F8 */
+ {0x01FA,0x01FB},{0x01FA,0x01FB}, /* 01FA */
+ {0x01FC,0x01FD},{0x01FC,0x01FD}, /* 01FC */
+ {0x01FE,0x01FF},{0x01FE,0x01FF} /* 01FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_page02[256]={
+ {0x0200,0x0201},{0x0200,0x0201}, /* 0200 */
+ {0x0202,0x0203},{0x0202,0x0203}, /* 0202 */
+ {0x0204,0x0205},{0x0204,0x0205}, /* 0204 */
+ {0x0206,0x0207},{0x0206,0x0207}, /* 0206 */
+ {0x0208,0x0209},{0x0208,0x0209}, /* 0208 */
+ {0x020A,0x020B},{0x020A,0x020B}, /* 020A */
+ {0x020C,0x020D},{0x020C,0x020D}, /* 020C */
+ {0x020E,0x020F},{0x020E,0x020F}, /* 020E */
+ {0x0210,0x0211},{0x0210,0x0211}, /* 0210 */
+ {0x0212,0x0213},{0x0212,0x0213}, /* 0212 */
+ {0x0214,0x0215},{0x0214,0x0215}, /* 0214 */
+ {0x0216,0x0217},{0x0216,0x0217}, /* 0216 */
+ {0x0218,0x0219},{0x0218,0x0219}, /* 0218 */
+ {0x021A,0x021B},{0x021A,0x021B}, /* 021A */
+ {0x021C,0x021D},{0x021C,0x021D}, /* 021C */
+ {0x021E,0x021F},{0x021E,0x021F}, /* 021E */
+ {0x0220,0x019E},{0x0221,0x0221}, /* 0220 */
+ {0x0222,0x0223},{0x0222,0x0223}, /* 0222 */
+ {0x0224,0x0225},{0x0224,0x0225}, /* 0224 */
+ {0x0226,0x0227},{0x0226,0x0227}, /* 0226 */
+ {0x0228,0x0229},{0x0228,0x0229}, /* 0228 */
+ {0x022A,0x022B},{0x022A,0x022B}, /* 022A */
+ {0x022C,0x022D},{0x022C,0x022D}, /* 022C */
+ {0x022E,0x022F},{0x022E,0x022F}, /* 022E */
+ {0x0230,0x0231},{0x0230,0x0231}, /* 0230 */
+ {0x0232,0x0233},{0x0232,0x0233}, /* 0232 */
+ {0x0234,0x0234},{0x0235,0x0235}, /* 0234 */
+ {0x0236,0x0236},{0x0237,0x0237}, /* 0236 */
+ {0x0238,0x0238},{0x0239,0x0239}, /* 0238 */
+ {0x023A,0x2C65},{0x023B,0x023C}, /* 023A */
+ {0x023B,0x023C},{0x023D,0x019A}, /* 023C */
+ {0x023E,0x2C66},{0x2C7E,0x023F}, /* 023E */
+ {0x2C7F,0x0240},{0x0241,0x0242}, /* 0240 */
+ {0x0241,0x0242},{0x0243,0x0180}, /* 0242 */
+ {0x0244,0x0289},{0x0245,0x028C}, /* 0244 */
+ {0x0246,0x0247},{0x0246,0x0247}, /* 0246 */
+ {0x0248,0x0249},{0x0248,0x0249}, /* 0248 */
+ {0x024A,0x024B},{0x024A,0x024B}, /* 024A */
+ {0x024C,0x024D},{0x024C,0x024D}, /* 024C */
+ {0x024E,0x024F},{0x024E,0x024F}, /* 024E */
+ {0x2C6F,0x0250},{0x2C6D,0x0251}, /* 0250 */
+ {0x2C70,0x0252},{0x0181,0x0253}, /* 0252 */
+ {0x0186,0x0254},{0x0255,0x0255}, /* 0254 */
+ {0x0189,0x0256},{0x018A,0x0257}, /* 0256 */
+ {0x0258,0x0258},{0x018F,0x0259}, /* 0258 */
+ {0x025A,0x025A},{0x0190,0x025B}, /* 025A */
+ {0x025C,0x025C},{0x025D,0x025D}, /* 025C */
+ {0x025E,0x025E},{0x025F,0x025F}, /* 025E */
+ {0x0193,0x0260},{0x0261,0x0261}, /* 0260 */
+ {0x0262,0x0262},{0x0194,0x0263}, /* 0262 */
+ {0x0264,0x0264},{0x0265,0x0265}, /* 0264 */
+ {0x0266,0x0266},{0x0267,0x0267}, /* 0266 */
+ {0x0197,0x0268},{0x0196,0x0269}, /* 0268 */
+ {0x026A,0x026A},{0x2C62,0x026B}, /* 026A */
+ {0x026C,0x026C},{0x026D,0x026D}, /* 026C */
+ {0x026E,0x026E},{0x019C,0x026F}, /* 026E */
+ {0x0270,0x0270},{0x2C6E,0x0271}, /* 0270 */
+ {0x019D,0x0272},{0x0273,0x0273}, /* 0272 */
+ {0x0274,0x0274},{0x019F,0x0275}, /* 0274 */
+ {0x0276,0x0276},{0x0277,0x0277}, /* 0276 */
+ {0x0278,0x0278},{0x0279,0x0279}, /* 0278 */
+ {0x027A,0x027A},{0x027B,0x027B}, /* 027A */
+ {0x027C,0x027C},{0x2C64,0x027D}, /* 027C */
+ {0x027E,0x027E},{0x027F,0x027F}, /* 027E */
+ {0x01A6,0x0280},{0x0281,0x0281}, /* 0280 */
+ {0x0282,0x0282},{0x01A9,0x0283}, /* 0282 */
+ {0x0284,0x0284},{0x0285,0x0285}, /* 0284 */
+ {0x0286,0x0286},{0x0287,0x0287}, /* 0286 */
+ {0x01AE,0x0288},{0x0244,0x0289}, /* 0288 */
+ {0x01B1,0x028A},{0x01B2,0x028B}, /* 028A */
+ {0x0245,0x028C},{0x028D,0x028D}, /* 028C */
+ {0x028E,0x028E},{0x028F,0x028F}, /* 028E */
+ {0x0290,0x0290},{0x0291,0x0291}, /* 0290 */
+ {0x01B7,0x0292},{0x0293,0x0293}, /* 0292 */
+ {0x0294,0x0294},{0x0295,0x0295}, /* 0294 */
+ {0x0296,0x0296},{0x0297,0x0297}, /* 0296 */
+ {0x0298,0x0298},{0x0299,0x0299}, /* 0298 */
+ {0x029A,0x029A},{0x029B,0x029B}, /* 029A */
+ {0x029C,0x029C},{0x029D,0x029D}, /* 029C */
+ {0x029E,0x029E},{0x029F,0x029F}, /* 029E */
+ {0x02A0,0x02A0},{0x02A1,0x02A1}, /* 02A0 */
+ {0x02A2,0x02A2},{0x02A3,0x02A3}, /* 02A2 */
+ {0x02A4,0x02A4},{0x02A5,0x02A5}, /* 02A4 */
+ {0x02A6,0x02A6},{0x02A7,0x02A7}, /* 02A6 */
+ {0x02A8,0x02A8},{0x02A9,0x02A9}, /* 02A8 */
+ {0x02AA,0x02AA},{0x02AB,0x02AB}, /* 02AA */
+ {0x02AC,0x02AC},{0x02AD,0x02AD}, /* 02AC */
+ {0x02AE,0x02AE},{0x02AF,0x02AF}, /* 02AE */
+ {0x02B0,0x02B0},{0x02B1,0x02B1}, /* 02B0 */
+ {0x02B2,0x02B2},{0x02B3,0x02B3}, /* 02B2 */
+ {0x02B4,0x02B4},{0x02B5,0x02B5}, /* 02B4 */
+ {0x02B6,0x02B6},{0x02B7,0x02B7}, /* 02B6 */
+ {0x02B8,0x02B8},{0x02B9,0x02B9}, /* 02B8 */
+ {0x02BA,0x02BA},{0x02BB,0x02BB}, /* 02BA */
+ {0x02BC,0x02BC},{0x02BD,0x02BD}, /* 02BC */
+ {0x02BE,0x02BE},{0x02BF,0x02BF}, /* 02BE */
+ {0x02C0,0x02C0},{0x02C1,0x02C1}, /* 02C0 */
+ {0x02C2,0x02C2},{0x02C3,0x02C3}, /* 02C2 */
+ {0x02C4,0x02C4},{0x02C5,0x02C5}, /* 02C4 */
+ {0x02C6,0x02C6},{0x02C7,0x02C7}, /* 02C6 */
+ {0x02C8,0x02C8},{0x02C9,0x02C9}, /* 02C8 */
+ {0x02CA,0x02CA},{0x02CB,0x02CB}, /* 02CA */
+ {0x02CC,0x02CC},{0x02CD,0x02CD}, /* 02CC */
+ {0x02CE,0x02CE},{0x02CF,0x02CF}, /* 02CE */
+ {0x02D0,0x02D0},{0x02D1,0x02D1}, /* 02D0 */
+ {0x02D2,0x02D2},{0x02D3,0x02D3}, /* 02D2 */
+ {0x02D4,0x02D4},{0x02D5,0x02D5}, /* 02D4 */
+ {0x02D6,0x02D6},{0x02D7,0x02D7}, /* 02D6 */
+ {0x02D8,0x02D8},{0x02D9,0x02D9}, /* 02D8 */
+ {0x02DA,0x02DA},{0x02DB,0x02DB}, /* 02DA */
+ {0x02DC,0x02DC},{0x02DD,0x02DD}, /* 02DC */
+ {0x02DE,0x02DE},{0x02DF,0x02DF}, /* 02DE */
+ {0x02E0,0x02E0},{0x02E1,0x02E1}, /* 02E0 */
+ {0x02E2,0x02E2},{0x02E3,0x02E3}, /* 02E2 */
+ {0x02E4,0x02E4},{0x02E5,0x02E5}, /* 02E4 */
+ {0x02E6,0x02E6},{0x02E7,0x02E7}, /* 02E6 */
+ {0x02E8,0x02E8},{0x02E9,0x02E9}, /* 02E8 */
+ {0x02EA,0x02EA},{0x02EB,0x02EB}, /* 02EA */
+ {0x02EC,0x02EC},{0x02ED,0x02ED}, /* 02EC */
+ {0x02EE,0x02EE},{0x02EF,0x02EF}, /* 02EE */
+ {0x02F0,0x02F0},{0x02F1,0x02F1}, /* 02F0 */
+ {0x02F2,0x02F2},{0x02F3,0x02F3}, /* 02F2 */
+ {0x02F4,0x02F4},{0x02F5,0x02F5}, /* 02F4 */
+ {0x02F6,0x02F6},{0x02F7,0x02F7}, /* 02F6 */
+ {0x02F8,0x02F8},{0x02F9,0x02F9}, /* 02F8 */
+ {0x02FA,0x02FA},{0x02FB,0x02FB}, /* 02FA */
+ {0x02FC,0x02FC},{0x02FD,0x02FD}, /* 02FC */
+ {0x02FE,0x02FE},{0x02FF,0x02FF} /* 02FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_page03[256]={
+ {0x0300,0x0300},{0x0301,0x0301}, /* 0300 */
+ {0x0302,0x0302},{0x0303,0x0303}, /* 0302 */
+ {0x0304,0x0304},{0x0305,0x0305}, /* 0304 */
+ {0x0306,0x0306},{0x0307,0x0307}, /* 0306 */
+ {0x0308,0x0308},{0x0309,0x0309}, /* 0308 */
+ {0x030A,0x030A},{0x030B,0x030B}, /* 030A */
+ {0x030C,0x030C},{0x030D,0x030D}, /* 030C */
+ {0x030E,0x030E},{0x030F,0x030F}, /* 030E */
+ {0x0310,0x0310},{0x0311,0x0311}, /* 0310 */
+ {0x0312,0x0312},{0x0313,0x0313}, /* 0312 */
+ {0x0314,0x0314},{0x0315,0x0315}, /* 0314 */
+ {0x0316,0x0316},{0x0317,0x0317}, /* 0316 */
+ {0x0318,0x0318},{0x0319,0x0319}, /* 0318 */
+ {0x031A,0x031A},{0x031B,0x031B}, /* 031A */
+ {0x031C,0x031C},{0x031D,0x031D}, /* 031C */
+ {0x031E,0x031E},{0x031F,0x031F}, /* 031E */
+ {0x0320,0x0320},{0x0321,0x0321}, /* 0320 */
+ {0x0322,0x0322},{0x0323,0x0323}, /* 0322 */
+ {0x0324,0x0324},{0x0325,0x0325}, /* 0324 */
+ {0x0326,0x0326},{0x0327,0x0327}, /* 0326 */
+ {0x0328,0x0328},{0x0329,0x0329}, /* 0328 */
+ {0x032A,0x032A},{0x032B,0x032B}, /* 032A */
+ {0x032C,0x032C},{0x032D,0x032D}, /* 032C */
+ {0x032E,0x032E},{0x032F,0x032F}, /* 032E */
+ {0x0330,0x0330},{0x0331,0x0331}, /* 0330 */
+ {0x0332,0x0332},{0x0333,0x0333}, /* 0332 */
+ {0x0334,0x0334},{0x0335,0x0335}, /* 0334 */
+ {0x0336,0x0336},{0x0337,0x0337}, /* 0336 */
+ {0x0338,0x0338},{0x0339,0x0339}, /* 0338 */
+ {0x033A,0x033A},{0x033B,0x033B}, /* 033A */
+ {0x033C,0x033C},{0x033D,0x033D}, /* 033C */
+ {0x033E,0x033E},{0x033F,0x033F}, /* 033E */
+ {0x0340,0x0340},{0x0341,0x0341}, /* 0340 */
+ {0x0342,0x0342},{0x0343,0x0343}, /* 0342 */
+ {0x0344,0x0344},{0x0399,0x0345}, /* 0344 */
+ {0x0346,0x0346},{0x0347,0x0347}, /* 0346 */
+ {0x0348,0x0348},{0x0349,0x0349}, /* 0348 */
+ {0x034A,0x034A},{0x034B,0x034B}, /* 034A */
+ {0x034C,0x034C},{0x034D,0x034D}, /* 034C */
+ {0x034E,0x034E},{0x034F,0x034F}, /* 034E */
+ {0x0350,0x0350},{0x0351,0x0351}, /* 0350 */
+ {0x0352,0x0352},{0x0353,0x0353}, /* 0352 */
+ {0x0354,0x0354},{0x0355,0x0355}, /* 0354 */
+ {0x0356,0x0356},{0x0357,0x0357}, /* 0356 */
+ {0x0358,0x0358},{0x0359,0x0359}, /* 0358 */
+ {0x035A,0x035A},{0x035B,0x035B}, /* 035A */
+ {0x035C,0x035C},{0x035D,0x035D}, /* 035C */
+ {0x035E,0x035E},{0x035F,0x035F}, /* 035E */
+ {0x0360,0x0360},{0x0361,0x0361}, /* 0360 */
+ {0x0362,0x0362},{0x0363,0x0363}, /* 0362 */
+ {0x0364,0x0364},{0x0365,0x0365}, /* 0364 */
+ {0x0366,0x0366},{0x0367,0x0367}, /* 0366 */
+ {0x0368,0x0368},{0x0369,0x0369}, /* 0368 */
+ {0x036A,0x036A},{0x036B,0x036B}, /* 036A */
+ {0x036C,0x036C},{0x036D,0x036D}, /* 036C */
+ {0x036E,0x036E},{0x036F,0x036F}, /* 036E */
+ {0x0370,0x0371},{0x0370,0x0371}, /* 0370 */
+ {0x0372,0x0373},{0x0372,0x0373}, /* 0372 */
+ {0x0374,0x0374},{0x0375,0x0375}, /* 0374 */
+ {0x0376,0x0377},{0x0376,0x0377}, /* 0376 */
+ {0x0378,0x0378},{0x0379,0x0379}, /* 0378 */
+ {0x037A,0x037A},{0x03FD,0x037B}, /* 037A */
+ {0x03FE,0x037C},{0x03FF,0x037D}, /* 037C */
+ {0x037E,0x037E},{0x037F,0x037F}, /* 037E */
+ {0x0380,0x0380},{0x0381,0x0381}, /* 0380 */
+ {0x0382,0x0382},{0x0383,0x0383}, /* 0382 */
+ {0x0384,0x0384},{0x0385,0x0385}, /* 0384 */
+ {0x0386,0x03AC},{0x0387,0x0387}, /* 0386 */
+ {0x0388,0x03AD},{0x0389,0x03AE}, /* 0388 */
+ {0x038A,0x03AF},{0x038B,0x038B}, /* 038A */
+ {0x038C,0x03CC},{0x038D,0x038D}, /* 038C */
+ {0x038E,0x03CD},{0x038F,0x03CE}, /* 038E */
+ {0x0390,0x0390},{0x0391,0x03B1}, /* 0390 */
+ {0x0392,0x03B2},{0x0393,0x03B3}, /* 0392 */
+ {0x0394,0x03B4},{0x0395,0x03B5}, /* 0394 */
+ {0x0396,0x03B6},{0x0397,0x03B7}, /* 0396 */
+ {0x0398,0x03B8},{0x0399,0x03B9}, /* 0398 */
+ {0x039A,0x03BA},{0x039B,0x03BB}, /* 039A */
+ {0x039C,0x03BC},{0x039D,0x03BD}, /* 039C */
+ {0x039E,0x03BE},{0x039F,0x03BF}, /* 039E */
+ {0x03A0,0x03C0},{0x03A1,0x03C1}, /* 03A0 */
+ {0x03A2,0x03A2},{0x03A3,0x03C3}, /* 03A2 */
+ {0x03A4,0x03C4},{0x03A5,0x03C5}, /* 03A4 */
+ {0x03A6,0x03C6},{0x03A7,0x03C7}, /* 03A6 */
+ {0x03A8,0x03C8},{0x03A9,0x03C9}, /* 03A8 */
+ {0x03AA,0x03CA},{0x03AB,0x03CB}, /* 03AA */
+ {0x0386,0x03AC},{0x0388,0x03AD}, /* 03AC */
+ {0x0389,0x03AE},{0x038A,0x03AF}, /* 03AE */
+ {0x03B0,0x03B0},{0x0391,0x03B1}, /* 03B0 */
+ {0x0392,0x03B2},{0x0393,0x03B3}, /* 03B2 */
+ {0x0394,0x03B4},{0x0395,0x03B5}, /* 03B4 */
+ {0x0396,0x03B6},{0x0397,0x03B7}, /* 03B6 */
+ {0x0398,0x03B8},{0x0399,0x03B9}, /* 03B8 */
+ {0x039A,0x03BA},{0x039B,0x03BB}, /* 03BA */
+ {0x039C,0x03BC},{0x039D,0x03BD}, /* 03BC */
+ {0x039E,0x03BE},{0x039F,0x03BF}, /* 03BE */
+ {0x03A0,0x03C0},{0x03A1,0x03C1}, /* 03C0 */
+ {0x03A3,0x03C2},{0x03A3,0x03C3}, /* 03C2 */
+ {0x03A4,0x03C4},{0x03A5,0x03C5}, /* 03C4 */
+ {0x03A6,0x03C6},{0x03A7,0x03C7}, /* 03C6 */
+ {0x03A8,0x03C8},{0x03A9,0x03C9}, /* 03C8 */
+ {0x03AA,0x03CA},{0x03AB,0x03CB}, /* 03CA */
+ {0x038C,0x03CC},{0x038E,0x03CD}, /* 03CC */
+ {0x038F,0x03CE},{0x03CF,0x03D7}, /* 03CE */
+ {0x0392,0x03D0},{0x0398,0x03D1}, /* 03D0 */
+ {0x03D2,0x03D2},{0x03D3,0x03D3}, /* 03D2 */
+ {0x03D4,0x03D4},{0x03A6,0x03D5}, /* 03D4 */
+ {0x03A0,0x03D6},{0x03CF,0x03D7}, /* 03D6 */
+ {0x03D8,0x03D9},{0x03D8,0x03D9}, /* 03D8 */
+ {0x03DA,0x03DB},{0x03DA,0x03DB}, /* 03DA */
+ {0x03DC,0x03DD},{0x03DC,0x03DD}, /* 03DC */
+ {0x03DE,0x03DF},{0x03DE,0x03DF}, /* 03DE */
+ {0x03E0,0x03E1},{0x03E0,0x03E1}, /* 03E0 */
+ {0x03E2,0x03E3},{0x03E2,0x03E3}, /* 03E2 */
+ {0x03E4,0x03E5},{0x03E4,0x03E5}, /* 03E4 */
+ {0x03E6,0x03E7},{0x03E6,0x03E7}, /* 03E6 */
+ {0x03E8,0x03E9},{0x03E8,0x03E9}, /* 03E8 */
+ {0x03EA,0x03EB},{0x03EA,0x03EB}, /* 03EA */
+ {0x03EC,0x03ED},{0x03EC,0x03ED}, /* 03EC */
+ {0x03EE,0x03EF},{0x03EE,0x03EF}, /* 03EE */
+ {0x039A,0x03F0},{0x03A1,0x03F1}, /* 03F0 */
+ {0x03F9,0x03F2},{0x03F3,0x03F3}, /* 03F2 */
+ {0x03F4,0x03B8},{0x0395,0x03F5}, /* 03F4 */
+ {0x03F6,0x03F6},{0x03F7,0x03F8}, /* 03F6 */
+ {0x03F7,0x03F8},{0x03F9,0x03F2}, /* 03F8 */
+ {0x03FA,0x03FB},{0x03FA,0x03FB}, /* 03FA */
+ {0x03FC,0x03FC},{0x03FD,0x037B}, /* 03FC */
+ {0x03FE,0x037C},{0x03FF,0x037D} /* 03FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_page04[256]={
+ {0x0400,0x0450},{0x0401,0x0451}, /* 0400 */
+ {0x0402,0x0452},{0x0403,0x0453}, /* 0402 */
+ {0x0404,0x0454},{0x0405,0x0455}, /* 0404 */
+ {0x0406,0x0456},{0x0407,0x0457}, /* 0406 */
+ {0x0408,0x0458},{0x0409,0x0459}, /* 0408 */
+ {0x040A,0x045A},{0x040B,0x045B}, /* 040A */
+ {0x040C,0x045C},{0x040D,0x045D}, /* 040C */
+ {0x040E,0x045E},{0x040F,0x045F}, /* 040E */
+ {0x0410,0x0430},{0x0411,0x0431}, /* 0410 */
+ {0x0412,0x0432},{0x0413,0x0433}, /* 0412 */
+ {0x0414,0x0434},{0x0415,0x0435}, /* 0414 */
+ {0x0416,0x0436},{0x0417,0x0437}, /* 0416 */
+ {0x0418,0x0438},{0x0419,0x0439}, /* 0418 */
+ {0x041A,0x043A},{0x041B,0x043B}, /* 041A */
+ {0x041C,0x043C},{0x041D,0x043D}, /* 041C */
+ {0x041E,0x043E},{0x041F,0x043F}, /* 041E */
+ {0x0420,0x0440},{0x0421,0x0441}, /* 0420 */
+ {0x0422,0x0442},{0x0423,0x0443}, /* 0422 */
+ {0x0424,0x0444},{0x0425,0x0445}, /* 0424 */
+ {0x0426,0x0446},{0x0427,0x0447}, /* 0426 */
+ {0x0428,0x0448},{0x0429,0x0449}, /* 0428 */
+ {0x042A,0x044A},{0x042B,0x044B}, /* 042A */
+ {0x042C,0x044C},{0x042D,0x044D}, /* 042C */
+ {0x042E,0x044E},{0x042F,0x044F}, /* 042E */
+ {0x0410,0x0430},{0x0411,0x0431}, /* 0430 */
+ {0x0412,0x0432},{0x0413,0x0433}, /* 0432 */
+ {0x0414,0x0434},{0x0415,0x0435}, /* 0434 */
+ {0x0416,0x0436},{0x0417,0x0437}, /* 0436 */
+ {0x0418,0x0438},{0x0419,0x0439}, /* 0438 */
+ {0x041A,0x043A},{0x041B,0x043B}, /* 043A */
+ {0x041C,0x043C},{0x041D,0x043D}, /* 043C */
+ {0x041E,0x043E},{0x041F,0x043F}, /* 043E */
+ {0x0420,0x0440},{0x0421,0x0441}, /* 0440 */
+ {0x0422,0x0442},{0x0423,0x0443}, /* 0442 */
+ {0x0424,0x0444},{0x0425,0x0445}, /* 0444 */
+ {0x0426,0x0446},{0x0427,0x0447}, /* 0446 */
+ {0x0428,0x0448},{0x0429,0x0449}, /* 0448 */
+ {0x042A,0x044A},{0x042B,0x044B}, /* 044A */
+ {0x042C,0x044C},{0x042D,0x044D}, /* 044C */
+ {0x042E,0x044E},{0x042F,0x044F}, /* 044E */
+ {0x0400,0x0450},{0x0401,0x0451}, /* 0450 */
+ {0x0402,0x0452},{0x0403,0x0453}, /* 0452 */
+ {0x0404,0x0454},{0x0405,0x0455}, /* 0454 */
+ {0x0406,0x0456},{0x0407,0x0457}, /* 0456 */
+ {0x0408,0x0458},{0x0409,0x0459}, /* 0458 */
+ {0x040A,0x045A},{0x040B,0x045B}, /* 045A */
+ {0x040C,0x045C},{0x040D,0x045D}, /* 045C */
+ {0x040E,0x045E},{0x040F,0x045F}, /* 045E */
+ {0x0460,0x0461},{0x0460,0x0461}, /* 0460 */
+ {0x0462,0x0463},{0x0462,0x0463}, /* 0462 */
+ {0x0464,0x0465},{0x0464,0x0465}, /* 0464 */
+ {0x0466,0x0467},{0x0466,0x0467}, /* 0466 */
+ {0x0468,0x0469},{0x0468,0x0469}, /* 0468 */
+ {0x046A,0x046B},{0x046A,0x046B}, /* 046A */
+ {0x046C,0x046D},{0x046C,0x046D}, /* 046C */
+ {0x046E,0x046F},{0x046E,0x046F}, /* 046E */
+ {0x0470,0x0471},{0x0470,0x0471}, /* 0470 */
+ {0x0472,0x0473},{0x0472,0x0473}, /* 0472 */
+ {0x0474,0x0475},{0x0474,0x0475}, /* 0474 */
+ {0x0476,0x0477},{0x0476,0x0477}, /* 0476 */
+ {0x0478,0x0479},{0x0478,0x0479}, /* 0478 */
+ {0x047A,0x047B},{0x047A,0x047B}, /* 047A */
+ {0x047C,0x047D},{0x047C,0x047D}, /* 047C */
+ {0x047E,0x047F},{0x047E,0x047F}, /* 047E */
+ {0x0480,0x0481},{0x0480,0x0481}, /* 0480 */
+ {0x0482,0x0482},{0x0483,0x0483}, /* 0482 */
+ {0x0484,0x0484},{0x0485,0x0485}, /* 0484 */
+ {0x0486,0x0486},{0x0487,0x0487}, /* 0486 */
+ {0x0488,0x0488},{0x0489,0x0489}, /* 0488 */
+ {0x048A,0x048B},{0x048A,0x048B}, /* 048A */
+ {0x048C,0x048D},{0x048C,0x048D}, /* 048C */
+ {0x048E,0x048F},{0x048E,0x048F}, /* 048E */
+ {0x0490,0x0491},{0x0490,0x0491}, /* 0490 */
+ {0x0492,0x0493},{0x0492,0x0493}, /* 0492 */
+ {0x0494,0x0495},{0x0494,0x0495}, /* 0494 */
+ {0x0496,0x0497},{0x0496,0x0497}, /* 0496 */
+ {0x0498,0x0499},{0x0498,0x0499}, /* 0498 */
+ {0x049A,0x049B},{0x049A,0x049B}, /* 049A */
+ {0x049C,0x049D},{0x049C,0x049D}, /* 049C */
+ {0x049E,0x049F},{0x049E,0x049F}, /* 049E */
+ {0x04A0,0x04A1},{0x04A0,0x04A1}, /* 04A0 */
+ {0x04A2,0x04A3},{0x04A2,0x04A3}, /* 04A2 */
+ {0x04A4,0x04A5},{0x04A4,0x04A5}, /* 04A4 */
+ {0x04A6,0x04A7},{0x04A6,0x04A7}, /* 04A6 */
+ {0x04A8,0x04A9},{0x04A8,0x04A9}, /* 04A8 */
+ {0x04AA,0x04AB},{0x04AA,0x04AB}, /* 04AA */
+ {0x04AC,0x04AD},{0x04AC,0x04AD}, /* 04AC */
+ {0x04AE,0x04AF},{0x04AE,0x04AF}, /* 04AE */
+ {0x04B0,0x04B1},{0x04B0,0x04B1}, /* 04B0 */
+ {0x04B2,0x04B3},{0x04B2,0x04B3}, /* 04B2 */
+ {0x04B4,0x04B5},{0x04B4,0x04B5}, /* 04B4 */
+ {0x04B6,0x04B7},{0x04B6,0x04B7}, /* 04B6 */
+ {0x04B8,0x04B9},{0x04B8,0x04B9}, /* 04B8 */
+ {0x04BA,0x04BB},{0x04BA,0x04BB}, /* 04BA */
+ {0x04BC,0x04BD},{0x04BC,0x04BD}, /* 04BC */
+ {0x04BE,0x04BF},{0x04BE,0x04BF}, /* 04BE */
+ {0x04C0,0x04CF},{0x04C1,0x04C2}, /* 04C0 */
+ {0x04C1,0x04C2},{0x04C3,0x04C4}, /* 04C2 */
+ {0x04C3,0x04C4},{0x04C5,0x04C6}, /* 04C4 */
+ {0x04C5,0x04C6},{0x04C7,0x04C8}, /* 04C6 */
+ {0x04C7,0x04C8},{0x04C9,0x04CA}, /* 04C8 */
+ {0x04C9,0x04CA},{0x04CB,0x04CC}, /* 04CA */
+ {0x04CB,0x04CC},{0x04CD,0x04CE}, /* 04CC */
+ {0x04CD,0x04CE},{0x04C0,0x04CF}, /* 04CE */
+ {0x04D0,0x04D1},{0x04D0,0x04D1}, /* 04D0 */
+ {0x04D2,0x04D3},{0x04D2,0x04D3}, /* 04D2 */
+ {0x04D4,0x04D5},{0x04D4,0x04D5}, /* 04D4 */
+ {0x04D6,0x04D7},{0x04D6,0x04D7}, /* 04D6 */
+ {0x04D8,0x04D9},{0x04D8,0x04D9}, /* 04D8 */
+ {0x04DA,0x04DB},{0x04DA,0x04DB}, /* 04DA */
+ {0x04DC,0x04DD},{0x04DC,0x04DD}, /* 04DC */
+ {0x04DE,0x04DF},{0x04DE,0x04DF}, /* 04DE */
+ {0x04E0,0x04E1},{0x04E0,0x04E1}, /* 04E0 */
+ {0x04E2,0x04E3},{0x04E2,0x04E3}, /* 04E2 */
+ {0x04E4,0x04E5},{0x04E4,0x04E5}, /* 04E4 */
+ {0x04E6,0x04E7},{0x04E6,0x04E7}, /* 04E6 */
+ {0x04E8,0x04E9},{0x04E8,0x04E9}, /* 04E8 */
+ {0x04EA,0x04EB},{0x04EA,0x04EB}, /* 04EA */
+ {0x04EC,0x04ED},{0x04EC,0x04ED}, /* 04EC */
+ {0x04EE,0x04EF},{0x04EE,0x04EF}, /* 04EE */
+ {0x04F0,0x04F1},{0x04F0,0x04F1}, /* 04F0 */
+ {0x04F2,0x04F3},{0x04F2,0x04F3}, /* 04F2 */
+ {0x04F4,0x04F5},{0x04F4,0x04F5}, /* 04F4 */
+ {0x04F6,0x04F7},{0x04F6,0x04F7}, /* 04F6 */
+ {0x04F8,0x04F9},{0x04F8,0x04F9}, /* 04F8 */
+ {0x04FA,0x04FB},{0x04FA,0x04FB}, /* 04FA */
+ {0x04FC,0x04FD},{0x04FC,0x04FD}, /* 04FC */
+ {0x04FE,0x04FF},{0x04FE,0x04FF} /* 04FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_page05[256]={
+ {0x0500,0x0501},{0x0500,0x0501}, /* 0500 */
+ {0x0502,0x0503},{0x0502,0x0503}, /* 0502 */
+ {0x0504,0x0505},{0x0504,0x0505}, /* 0504 */
+ {0x0506,0x0507},{0x0506,0x0507}, /* 0506 */
+ {0x0508,0x0509},{0x0508,0x0509}, /* 0508 */
+ {0x050A,0x050B},{0x050A,0x050B}, /* 050A */
+ {0x050C,0x050D},{0x050C,0x050D}, /* 050C */
+ {0x050E,0x050F},{0x050E,0x050F}, /* 050E */
+ {0x0510,0x0511},{0x0510,0x0511}, /* 0510 */
+ {0x0512,0x0513},{0x0512,0x0513}, /* 0512 */
+ {0x0514,0x0515},{0x0514,0x0515}, /* 0514 */
+ {0x0516,0x0517},{0x0516,0x0517}, /* 0516 */
+ {0x0518,0x0519},{0x0518,0x0519}, /* 0518 */
+ {0x051A,0x051B},{0x051A,0x051B}, /* 051A */
+ {0x051C,0x051D},{0x051C,0x051D}, /* 051C */
+ {0x051E,0x051F},{0x051E,0x051F}, /* 051E */
+ {0x0520,0x0521},{0x0520,0x0521}, /* 0520 */
+ {0x0522,0x0523},{0x0522,0x0523}, /* 0522 */
+ {0x0524,0x0525},{0x0524,0x0525}, /* 0524 */
+ {0x0526,0x0526},{0x0527,0x0527}, /* 0526 */
+ {0x0528,0x0528},{0x0529,0x0529}, /* 0528 */
+ {0x052A,0x052A},{0x052B,0x052B}, /* 052A */
+ {0x052C,0x052C},{0x052D,0x052D}, /* 052C */
+ {0x052E,0x052E},{0x052F,0x052F}, /* 052E */
+ {0x0530,0x0530},{0x0531,0x0561}, /* 0530 */
+ {0x0532,0x0562},{0x0533,0x0563}, /* 0532 */
+ {0x0534,0x0564},{0x0535,0x0565}, /* 0534 */
+ {0x0536,0x0566},{0x0537,0x0567}, /* 0536 */
+ {0x0538,0x0568},{0x0539,0x0569}, /* 0538 */
+ {0x053A,0x056A},{0x053B,0x056B}, /* 053A */
+ {0x053C,0x056C},{0x053D,0x056D}, /* 053C */
+ {0x053E,0x056E},{0x053F,0x056F}, /* 053E */
+ {0x0540,0x0570},{0x0541,0x0571}, /* 0540 */
+ {0x0542,0x0572},{0x0543,0x0573}, /* 0542 */
+ {0x0544,0x0574},{0x0545,0x0575}, /* 0544 */
+ {0x0546,0x0576},{0x0547,0x0577}, /* 0546 */
+ {0x0548,0x0578},{0x0549,0x0579}, /* 0548 */
+ {0x054A,0x057A},{0x054B,0x057B}, /* 054A */
+ {0x054C,0x057C},{0x054D,0x057D}, /* 054C */
+ {0x054E,0x057E},{0x054F,0x057F}, /* 054E */
+ {0x0550,0x0580},{0x0551,0x0581}, /* 0550 */
+ {0x0552,0x0582},{0x0553,0x0583}, /* 0552 */
+ {0x0554,0x0584},{0x0555,0x0585}, /* 0554 */
+ {0x0556,0x0586},{0x0557,0x0557}, /* 0556 */
+ {0x0558,0x0558},{0x0559,0x0559}, /* 0558 */
+ {0x055A,0x055A},{0x055B,0x055B}, /* 055A */
+ {0x055C,0x055C},{0x055D,0x055D}, /* 055C */
+ {0x055E,0x055E},{0x055F,0x055F}, /* 055E */
+ {0x0560,0x0560},{0x0531,0x0561}, /* 0560 */
+ {0x0532,0x0562},{0x0533,0x0563}, /* 0562 */
+ {0x0534,0x0564},{0x0535,0x0565}, /* 0564 */
+ {0x0536,0x0566},{0x0537,0x0567}, /* 0566 */
+ {0x0538,0x0568},{0x0539,0x0569}, /* 0568 */
+ {0x053A,0x056A},{0x053B,0x056B}, /* 056A */
+ {0x053C,0x056C},{0x053D,0x056D}, /* 056C */
+ {0x053E,0x056E},{0x053F,0x056F}, /* 056E */
+ {0x0540,0x0570},{0x0541,0x0571}, /* 0570 */
+ {0x0542,0x0572},{0x0543,0x0573}, /* 0572 */
+ {0x0544,0x0574},{0x0545,0x0575}, /* 0574 */
+ {0x0546,0x0576},{0x0547,0x0577}, /* 0576 */
+ {0x0548,0x0578},{0x0549,0x0579}, /* 0578 */
+ {0x054A,0x057A},{0x054B,0x057B}, /* 057A */
+ {0x054C,0x057C},{0x054D,0x057D}, /* 057C */
+ {0x054E,0x057E},{0x054F,0x057F}, /* 057E */
+ {0x0550,0x0580},{0x0551,0x0581}, /* 0580 */
+ {0x0552,0x0582},{0x0553,0x0583}, /* 0582 */
+ {0x0554,0x0584},{0x0555,0x0585}, /* 0584 */
+ {0x0556,0x0586},{0x0587,0x0587}, /* 0586 */
+ {0x0588,0x0588},{0x0589,0x0589}, /* 0588 */
+ {0x058A,0x058A},{0x058B,0x058B}, /* 058A */
+ {0x058C,0x058C},{0x058D,0x058D}, /* 058C */
+ {0x058E,0x058E},{0x058F,0x058F}, /* 058E */
+ {0x0590,0x0590},{0x0591,0x0591}, /* 0590 */
+ {0x0592,0x0592},{0x0593,0x0593}, /* 0592 */
+ {0x0594,0x0594},{0x0595,0x0595}, /* 0594 */
+ {0x0596,0x0596},{0x0597,0x0597}, /* 0596 */
+ {0x0598,0x0598},{0x0599,0x0599}, /* 0598 */
+ {0x059A,0x059A},{0x059B,0x059B}, /* 059A */
+ {0x059C,0x059C},{0x059D,0x059D}, /* 059C */
+ {0x059E,0x059E},{0x059F,0x059F}, /* 059E */
+ {0x05A0,0x05A0},{0x05A1,0x05A1}, /* 05A0 */
+ {0x05A2,0x05A2},{0x05A3,0x05A3}, /* 05A2 */
+ {0x05A4,0x05A4},{0x05A5,0x05A5}, /* 05A4 */
+ {0x05A6,0x05A6},{0x05A7,0x05A7}, /* 05A6 */
+ {0x05A8,0x05A8},{0x05A9,0x05A9}, /* 05A8 */
+ {0x05AA,0x05AA},{0x05AB,0x05AB}, /* 05AA */
+ {0x05AC,0x05AC},{0x05AD,0x05AD}, /* 05AC */
+ {0x05AE,0x05AE},{0x05AF,0x05AF}, /* 05AE */
+ {0x05B0,0x05B0},{0x05B1,0x05B1}, /* 05B0 */
+ {0x05B2,0x05B2},{0x05B3,0x05B3}, /* 05B2 */
+ {0x05B4,0x05B4},{0x05B5,0x05B5}, /* 05B4 */
+ {0x05B6,0x05B6},{0x05B7,0x05B7}, /* 05B6 */
+ {0x05B8,0x05B8},{0x05B9,0x05B9}, /* 05B8 */
+ {0x05BA,0x05BA},{0x05BB,0x05BB}, /* 05BA */
+ {0x05BC,0x05BC},{0x05BD,0x05BD}, /* 05BC */
+ {0x05BE,0x05BE},{0x05BF,0x05BF}, /* 05BE */
+ {0x05C0,0x05C0},{0x05C1,0x05C1}, /* 05C0 */
+ {0x05C2,0x05C2},{0x05C3,0x05C3}, /* 05C2 */
+ {0x05C4,0x05C4},{0x05C5,0x05C5}, /* 05C4 */
+ {0x05C6,0x05C6},{0x05C7,0x05C7}, /* 05C6 */
+ {0x05C8,0x05C8},{0x05C9,0x05C9}, /* 05C8 */
+ {0x05CA,0x05CA},{0x05CB,0x05CB}, /* 05CA */
+ {0x05CC,0x05CC},{0x05CD,0x05CD}, /* 05CC */
+ {0x05CE,0x05CE},{0x05CF,0x05CF}, /* 05CE */
+ {0x05D0,0x05D0},{0x05D1,0x05D1}, /* 05D0 */
+ {0x05D2,0x05D2},{0x05D3,0x05D3}, /* 05D2 */
+ {0x05D4,0x05D4},{0x05D5,0x05D5}, /* 05D4 */
+ {0x05D6,0x05D6},{0x05D7,0x05D7}, /* 05D6 */
+ {0x05D8,0x05D8},{0x05D9,0x05D9}, /* 05D8 */
+ {0x05DA,0x05DA},{0x05DB,0x05DB}, /* 05DA */
+ {0x05DC,0x05DC},{0x05DD,0x05DD}, /* 05DC */
+ {0x05DE,0x05DE},{0x05DF,0x05DF}, /* 05DE */
+ {0x05E0,0x05E0},{0x05E1,0x05E1}, /* 05E0 */
+ {0x05E2,0x05E2},{0x05E3,0x05E3}, /* 05E2 */
+ {0x05E4,0x05E4},{0x05E5,0x05E5}, /* 05E4 */
+ {0x05E6,0x05E6},{0x05E7,0x05E7}, /* 05E6 */
+ {0x05E8,0x05E8},{0x05E9,0x05E9}, /* 05E8 */
+ {0x05EA,0x05EA},{0x05EB,0x05EB}, /* 05EA */
+ {0x05EC,0x05EC},{0x05ED,0x05ED}, /* 05EC */
+ {0x05EE,0x05EE},{0x05EF,0x05EF}, /* 05EE */
+ {0x05F0,0x05F0},{0x05F1,0x05F1}, /* 05F0 */
+ {0x05F2,0x05F2},{0x05F3,0x05F3}, /* 05F2 */
+ {0x05F4,0x05F4},{0x05F5,0x05F5}, /* 05F4 */
+ {0x05F6,0x05F6},{0x05F7,0x05F7}, /* 05F6 */
+ {0x05F8,0x05F8},{0x05F9,0x05F9}, /* 05F8 */
+ {0x05FA,0x05FA},{0x05FB,0x05FB}, /* 05FA */
+ {0x05FC,0x05FC},{0x05FD,0x05FD}, /* 05FC */
+ {0x05FE,0x05FE},{0x05FF,0x05FF} /* 05FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_page06[256]={ /* This page is dummy */
+ {0x0600,0x0600},{0x0601,0x0601}, /* 0600 */
+ {0x0602,0x0602},{0x0603,0x0603}, /* 0602 */
+ {0x0604,0x0604},{0x0605,0x0605}, /* 0604 */
+ {0x0606,0x0606},{0x0607,0x0607}, /* 0606 */
+ {0x0608,0x0608},{0x0609,0x0609}, /* 0608 */
+ {0x060A,0x060A},{0x060B,0x060B}, /* 060A */
+ {0x060C,0x060C},{0x060D,0x060D}, /* 060C */
+ {0x060E,0x060E},{0x060F,0x060F}, /* 060E */
+ {0x0610,0x0610},{0x0611,0x0611}, /* 0610 */
+ {0x0612,0x0612},{0x0613,0x0613}, /* 0612 */
+ {0x0614,0x0614},{0x0615,0x0615}, /* 0614 */
+ {0x0616,0x0616},{0x0617,0x0617}, /* 0616 */
+ {0x0618,0x0618},{0x0619,0x0619}, /* 0618 */
+ {0x061A,0x061A},{0x061B,0x061B}, /* 061A */
+ {0x061C,0x061C},{0x061D,0x061D}, /* 061C */
+ {0x061E,0x061E},{0x061F,0x061F}, /* 061E */
+ {0x0620,0x0620},{0x0621,0x0621}, /* 0620 */
+ {0x0622,0x0622},{0x0623,0x0623}, /* 0622 */
+ {0x0624,0x0624},{0x0625,0x0625}, /* 0624 */
+ {0x0626,0x0626},{0x0627,0x0627}, /* 0626 */
+ {0x0628,0x0628},{0x0629,0x0629}, /* 0628 */
+ {0x062A,0x062A},{0x062B,0x062B}, /* 062A */
+ {0x062C,0x062C},{0x062D,0x062D}, /* 062C */
+ {0x062E,0x062E},{0x062F,0x062F}, /* 062E */
+ {0x0630,0x0630},{0x0631,0x0631}, /* 0630 */
+ {0x0632,0x0632},{0x0633,0x0633}, /* 0632 */
+ {0x0634,0x0634},{0x0635,0x0635}, /* 0634 */
+ {0x0636,0x0636},{0x0637,0x0637}, /* 0636 */
+ {0x0638,0x0638},{0x0639,0x0639}, /* 0638 */
+ {0x063A,0x063A},{0x063B,0x063B}, /* 063A */
+ {0x063C,0x063C},{0x063D,0x063D}, /* 063C */
+ {0x063E,0x063E},{0x063F,0x063F}, /* 063E */
+ {0x0640,0x0640},{0x0641,0x0641}, /* 0640 */
+ {0x0642,0x0642},{0x0643,0x0643}, /* 0642 */
+ {0x0644,0x0644},{0x0645,0x0645}, /* 0644 */
+ {0x0646,0x0646},{0x0647,0x0647}, /* 0646 */
+ {0x0648,0x0648},{0x0649,0x0649}, /* 0648 */
+ {0x064A,0x064A},{0x064B,0x064B}, /* 064A */
+ {0x064C,0x064C},{0x064D,0x064D}, /* 064C */
+ {0x064E,0x064E},{0x064F,0x064F}, /* 064E */
+ {0x0650,0x0650},{0x0651,0x0651}, /* 0650 */
+ {0x0652,0x0652},{0x0653,0x0653}, /* 0652 */
+ {0x0654,0x0654},{0x0655,0x0655}, /* 0654 */
+ {0x0656,0x0656},{0x0657,0x0657}, /* 0656 */
+ {0x0658,0x0658},{0x0659,0x0659}, /* 0658 */
+ {0x065A,0x065A},{0x065B,0x065B}, /* 065A */
+ {0x065C,0x065C},{0x065D,0x065D}, /* 065C */
+ {0x065E,0x065E},{0x065F,0x065F}, /* 065E */
+ {0x0660,0x0660},{0x0661,0x0661}, /* 0660 */
+ {0x0662,0x0662},{0x0663,0x0663}, /* 0662 */
+ {0x0664,0x0664},{0x0665,0x0665}, /* 0664 */
+ {0x0666,0x0666},{0x0667,0x0667}, /* 0666 */
+ {0x0668,0x0668},{0x0669,0x0669}, /* 0668 */
+ {0x066A,0x066A},{0x066B,0x066B}, /* 066A */
+ {0x066C,0x066C},{0x066D,0x066D}, /* 066C */
+ {0x066E,0x066E},{0x066F,0x066F}, /* 066E */
+ {0x0670,0x0670},{0x0671,0x0671}, /* 0670 */
+ {0x0672,0x0672},{0x0673,0x0673}, /* 0672 */
+ {0x0674,0x0674},{0x0675,0x0675}, /* 0674 */
+ {0x0676,0x0676},{0x0677,0x0677}, /* 0676 */
+ {0x0678,0x0678},{0x0679,0x0679}, /* 0678 */
+ {0x067A,0x067A},{0x067B,0x067B}, /* 067A */
+ {0x067C,0x067C},{0x067D,0x067D}, /* 067C */
+ {0x067E,0x067E},{0x067F,0x067F}, /* 067E */
+ {0x0680,0x0680},{0x0681,0x0681}, /* 0680 */
+ {0x0682,0x0682},{0x0683,0x0683}, /* 0682 */
+ {0x0684,0x0684},{0x0685,0x0685}, /* 0684 */
+ {0x0686,0x0686},{0x0687,0x0687}, /* 0686 */
+ {0x0688,0x0688},{0x0689,0x0689}, /* 0688 */
+ {0x068A,0x068A},{0x068B,0x068B}, /* 068A */
+ {0x068C,0x068C},{0x068D,0x068D}, /* 068C */
+ {0x068E,0x068E},{0x068F,0x068F}, /* 068E */
+ {0x0690,0x0690},{0x0691,0x0691}, /* 0690 */
+ {0x0692,0x0692},{0x0693,0x0693}, /* 0692 */
+ {0x0694,0x0694},{0x0695,0x0695}, /* 0694 */
+ {0x0696,0x0696},{0x0697,0x0697}, /* 0696 */
+ {0x0698,0x0698},{0x0699,0x0699}, /* 0698 */
+ {0x069A,0x069A},{0x069B,0x069B}, /* 069A */
+ {0x069C,0x069C},{0x069D,0x069D}, /* 069C */
+ {0x069E,0x069E},{0x069F,0x069F}, /* 069E */
+ {0x06A0,0x06A0},{0x06A1,0x06A1}, /* 06A0 */
+ {0x06A2,0x06A2},{0x06A3,0x06A3}, /* 06A2 */
+ {0x06A4,0x06A4},{0x06A5,0x06A5}, /* 06A4 */
+ {0x06A6,0x06A6},{0x06A7,0x06A7}, /* 06A6 */
+ {0x06A8,0x06A8},{0x06A9,0x06A9}, /* 06A8 */
+ {0x06AA,0x06AA},{0x06AB,0x06AB}, /* 06AA */
+ {0x06AC,0x06AC},{0x06AD,0x06AD}, /* 06AC */
+ {0x06AE,0x06AE},{0x06AF,0x06AF}, /* 06AE */
+ {0x06B0,0x06B0},{0x06B1,0x06B1}, /* 06B0 */
+ {0x06B2,0x06B2},{0x06B3,0x06B3}, /* 06B2 */
+ {0x06B4,0x06B4},{0x06B5,0x06B5}, /* 06B4 */
+ {0x06B6,0x06B6},{0x06B7,0x06B7}, /* 06B6 */
+ {0x06B8,0x06B8},{0x06B9,0x06B9}, /* 06B8 */
+ {0x06BA,0x06BA},{0x06BB,0x06BB}, /* 06BA */
+ {0x06BC,0x06BC},{0x06BD,0x06BD}, /* 06BC */
+ {0x06BE,0x06BE},{0x06BF,0x06BF}, /* 06BE */
+ {0x06C0,0x06C0},{0x06C1,0x06C1}, /* 06C0 */
+ {0x06C2,0x06C2},{0x06C3,0x06C3}, /* 06C2 */
+ {0x06C4,0x06C4},{0x06C5,0x06C5}, /* 06C4 */
+ {0x06C6,0x06C6},{0x06C7,0x06C7}, /* 06C6 */
+ {0x06C8,0x06C8},{0x06C9,0x06C9}, /* 06C8 */
+ {0x06CA,0x06CA},{0x06CB,0x06CB}, /* 06CA */
+ {0x06CC,0x06CC},{0x06CD,0x06CD}, /* 06CC */
+ {0x06CE,0x06CE},{0x06CF,0x06CF}, /* 06CE */
+ {0x06D0,0x06D0},{0x06D1,0x06D1}, /* 06D0 */
+ {0x06D2,0x06D2},{0x06D3,0x06D3}, /* 06D2 */
+ {0x06D4,0x06D4},{0x06D5,0x06D5}, /* 06D4 */
+ {0x06D6,0x06D6},{0x06D7,0x06D7}, /* 06D6 */
+ {0x06D8,0x06D8},{0x06D9,0x06D9}, /* 06D8 */
+ {0x06DA,0x06DA},{0x06DB,0x06DB}, /* 06DA */
+ {0x06DC,0x06DC},{0x06DD,0x06DD}, /* 06DC */
+ {0x06DE,0x06DE},{0x06DF,0x06DF}, /* 06DE */
+ {0x06E0,0x06E0},{0x06E1,0x06E1}, /* 06E0 */
+ {0x06E2,0x06E2},{0x06E3,0x06E3}, /* 06E2 */
+ {0x06E4,0x06E4},{0x06E5,0x06E5}, /* 06E4 */
+ {0x06E6,0x06E6},{0x06E7,0x06E7}, /* 06E6 */
+ {0x06E8,0x06E8},{0x06E9,0x06E9}, /* 06E8 */
+ {0x06EA,0x06EA},{0x06EB,0x06EB}, /* 06EA */
+ {0x06EC,0x06EC},{0x06ED,0x06ED}, /* 06EC */
+ {0x06EE,0x06EE},{0x06EF,0x06EF}, /* 06EE */
+ {0x06F0,0x06F0},{0x06F1,0x06F1}, /* 06F0 */
+ {0x06F2,0x06F2},{0x06F3,0x06F3}, /* 06F2 */
+ {0x06F4,0x06F4},{0x06F5,0x06F5}, /* 06F4 */
+ {0x06F6,0x06F6},{0x06F7,0x06F7}, /* 06F6 */
+ {0x06F8,0x06F8},{0x06F9,0x06F9}, /* 06F8 */
+ {0x06FA,0x06FA},{0x06FB,0x06FB}, /* 06FA */
+ {0x06FC,0x06FC},{0x06FD,0x06FD}, /* 06FC */
+ {0x06FE,0x06FE},{0x06FF,0x06FF} /* 06FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_page07[256]={ /* This page is dummy */
+ {0x0700,0x0700},{0x0701,0x0701}, /* 0700 */
+ {0x0702,0x0702},{0x0703,0x0703}, /* 0702 */
+ {0x0704,0x0704},{0x0705,0x0705}, /* 0704 */
+ {0x0706,0x0706},{0x0707,0x0707}, /* 0706 */
+ {0x0708,0x0708},{0x0709,0x0709}, /* 0708 */
+ {0x070A,0x070A},{0x070B,0x070B}, /* 070A */
+ {0x070C,0x070C},{0x070D,0x070D}, /* 070C */
+ {0x070E,0x070E},{0x070F,0x070F}, /* 070E */
+ {0x0710,0x0710},{0x0711,0x0711}, /* 0710 */
+ {0x0712,0x0712},{0x0713,0x0713}, /* 0712 */
+ {0x0714,0x0714},{0x0715,0x0715}, /* 0714 */
+ {0x0716,0x0716},{0x0717,0x0717}, /* 0716 */
+ {0x0718,0x0718},{0x0719,0x0719}, /* 0718 */
+ {0x071A,0x071A},{0x071B,0x071B}, /* 071A */
+ {0x071C,0x071C},{0x071D,0x071D}, /* 071C */
+ {0x071E,0x071E},{0x071F,0x071F}, /* 071E */
+ {0x0720,0x0720},{0x0721,0x0721}, /* 0720 */
+ {0x0722,0x0722},{0x0723,0x0723}, /* 0722 */
+ {0x0724,0x0724},{0x0725,0x0725}, /* 0724 */
+ {0x0726,0x0726},{0x0727,0x0727}, /* 0726 */
+ {0x0728,0x0728},{0x0729,0x0729}, /* 0728 */
+ {0x072A,0x072A},{0x072B,0x072B}, /* 072A */
+ {0x072C,0x072C},{0x072D,0x072D}, /* 072C */
+ {0x072E,0x072E},{0x072F,0x072F}, /* 072E */
+ {0x0730,0x0730},{0x0731,0x0731}, /* 0730 */
+ {0x0732,0x0732},{0x0733,0x0733}, /* 0732 */
+ {0x0734,0x0734},{0x0735,0x0735}, /* 0734 */
+ {0x0736,0x0736},{0x0737,0x0737}, /* 0736 */
+ {0x0738,0x0738},{0x0739,0x0739}, /* 0738 */
+ {0x073A,0x073A},{0x073B,0x073B}, /* 073A */
+ {0x073C,0x073C},{0x073D,0x073D}, /* 073C */
+ {0x073E,0x073E},{0x073F,0x073F}, /* 073E */
+ {0x0740,0x0740},{0x0741,0x0741}, /* 0740 */
+ {0x0742,0x0742},{0x0743,0x0743}, /* 0742 */
+ {0x0744,0x0744},{0x0745,0x0745}, /* 0744 */
+ {0x0746,0x0746},{0x0747,0x0747}, /* 0746 */
+ {0x0748,0x0748},{0x0749,0x0749}, /* 0748 */
+ {0x074A,0x074A},{0x074B,0x074B}, /* 074A */
+ {0x074C,0x074C},{0x074D,0x074D}, /* 074C */
+ {0x074E,0x074E},{0x074F,0x074F}, /* 074E */
+ {0x0750,0x0750},{0x0751,0x0751}, /* 0750 */
+ {0x0752,0x0752},{0x0753,0x0753}, /* 0752 */
+ {0x0754,0x0754},{0x0755,0x0755}, /* 0754 */
+ {0x0756,0x0756},{0x0757,0x0757}, /* 0756 */
+ {0x0758,0x0758},{0x0759,0x0759}, /* 0758 */
+ {0x075A,0x075A},{0x075B,0x075B}, /* 075A */
+ {0x075C,0x075C},{0x075D,0x075D}, /* 075C */
+ {0x075E,0x075E},{0x075F,0x075F}, /* 075E */
+ {0x0760,0x0760},{0x0761,0x0761}, /* 0760 */
+ {0x0762,0x0762},{0x0763,0x0763}, /* 0762 */
+ {0x0764,0x0764},{0x0765,0x0765}, /* 0764 */
+ {0x0766,0x0766},{0x0767,0x0767}, /* 0766 */
+ {0x0768,0x0768},{0x0769,0x0769}, /* 0768 */
+ {0x076A,0x076A},{0x076B,0x076B}, /* 076A */
+ {0x076C,0x076C},{0x076D,0x076D}, /* 076C */
+ {0x076E,0x076E},{0x076F,0x076F}, /* 076E */
+ {0x0770,0x0770},{0x0771,0x0771}, /* 0770 */
+ {0x0772,0x0772},{0x0773,0x0773}, /* 0772 */
+ {0x0774,0x0774},{0x0775,0x0775}, /* 0774 */
+ {0x0776,0x0776},{0x0777,0x0777}, /* 0776 */
+ {0x0778,0x0778},{0x0779,0x0779}, /* 0778 */
+ {0x077A,0x077A},{0x077B,0x077B}, /* 077A */
+ {0x077C,0x077C},{0x077D,0x077D}, /* 077C */
+ {0x077E,0x077E},{0x077F,0x077F}, /* 077E */
+ {0x0780,0x0780},{0x0781,0x0781}, /* 0780 */
+ {0x0782,0x0782},{0x0783,0x0783}, /* 0782 */
+ {0x0784,0x0784},{0x0785,0x0785}, /* 0784 */
+ {0x0786,0x0786},{0x0787,0x0787}, /* 0786 */
+ {0x0788,0x0788},{0x0789,0x0789}, /* 0788 */
+ {0x078A,0x078A},{0x078B,0x078B}, /* 078A */
+ {0x078C,0x078C},{0x078D,0x078D}, /* 078C */
+ {0x078E,0x078E},{0x078F,0x078F}, /* 078E */
+ {0x0790,0x0790},{0x0791,0x0791}, /* 0790 */
+ {0x0792,0x0792},{0x0793,0x0793}, /* 0792 */
+ {0x0794,0x0794},{0x0795,0x0795}, /* 0794 */
+ {0x0796,0x0796},{0x0797,0x0797}, /* 0796 */
+ {0x0798,0x0798},{0x0799,0x0799}, /* 0798 */
+ {0x079A,0x079A},{0x079B,0x079B}, /* 079A */
+ {0x079C,0x079C},{0x079D,0x079D}, /* 079C */
+ {0x079E,0x079E},{0x079F,0x079F}, /* 079E */
+ {0x07A0,0x07A0},{0x07A1,0x07A1}, /* 07A0 */
+ {0x07A2,0x07A2},{0x07A3,0x07A3}, /* 07A2 */
+ {0x07A4,0x07A4},{0x07A5,0x07A5}, /* 07A4 */
+ {0x07A6,0x07A6},{0x07A7,0x07A7}, /* 07A6 */
+ {0x07A8,0x07A8},{0x07A9,0x07A9}, /* 07A8 */
+ {0x07AA,0x07AA},{0x07AB,0x07AB}, /* 07AA */
+ {0x07AC,0x07AC},{0x07AD,0x07AD}, /* 07AC */
+ {0x07AE,0x07AE},{0x07AF,0x07AF}, /* 07AE */
+ {0x07B0,0x07B0},{0x07B1,0x07B1}, /* 07B0 */
+ {0x07B2,0x07B2},{0x07B3,0x07B3}, /* 07B2 */
+ {0x07B4,0x07B4},{0x07B5,0x07B5}, /* 07B4 */
+ {0x07B6,0x07B6},{0x07B7,0x07B7}, /* 07B6 */
+ {0x07B8,0x07B8},{0x07B9,0x07B9}, /* 07B8 */
+ {0x07BA,0x07BA},{0x07BB,0x07BB}, /* 07BA */
+ {0x07BC,0x07BC},{0x07BD,0x07BD}, /* 07BC */
+ {0x07BE,0x07BE},{0x07BF,0x07BF}, /* 07BE */
+ {0x07C0,0x07C0},{0x07C1,0x07C1}, /* 07C0 */
+ {0x07C2,0x07C2},{0x07C3,0x07C3}, /* 07C2 */
+ {0x07C4,0x07C4},{0x07C5,0x07C5}, /* 07C4 */
+ {0x07C6,0x07C6},{0x07C7,0x07C7}, /* 07C6 */
+ {0x07C8,0x07C8},{0x07C9,0x07C9}, /* 07C8 */
+ {0x07CA,0x07CA},{0x07CB,0x07CB}, /* 07CA */
+ {0x07CC,0x07CC},{0x07CD,0x07CD}, /* 07CC */
+ {0x07CE,0x07CE},{0x07CF,0x07CF}, /* 07CE */
+ {0x07D0,0x07D0},{0x07D1,0x07D1}, /* 07D0 */
+ {0x07D2,0x07D2},{0x07D3,0x07D3}, /* 07D2 */
+ {0x07D4,0x07D4},{0x07D5,0x07D5}, /* 07D4 */
+ {0x07D6,0x07D6},{0x07D7,0x07D7}, /* 07D6 */
+ {0x07D8,0x07D8},{0x07D9,0x07D9}, /* 07D8 */
+ {0x07DA,0x07DA},{0x07DB,0x07DB}, /* 07DA */
+ {0x07DC,0x07DC},{0x07DD,0x07DD}, /* 07DC */
+ {0x07DE,0x07DE},{0x07DF,0x07DF}, /* 07DE */
+ {0x07E0,0x07E0},{0x07E1,0x07E1}, /* 07E0 */
+ {0x07E2,0x07E2},{0x07E3,0x07E3}, /* 07E2 */
+ {0x07E4,0x07E4},{0x07E5,0x07E5}, /* 07E4 */
+ {0x07E6,0x07E6},{0x07E7,0x07E7}, /* 07E6 */
+ {0x07E8,0x07E8},{0x07E9,0x07E9}, /* 07E8 */
+ {0x07EA,0x07EA},{0x07EB,0x07EB}, /* 07EA */
+ {0x07EC,0x07EC},{0x07ED,0x07ED}, /* 07EC */
+ {0x07EE,0x07EE},{0x07EF,0x07EF}, /* 07EE */
+ {0x07F0,0x07F0},{0x07F1,0x07F1}, /* 07F0 */
+ {0x07F2,0x07F2},{0x07F3,0x07F3}, /* 07F2 */
+ {0x07F4,0x07F4},{0x07F5,0x07F5}, /* 07F4 */
+ {0x07F6,0x07F6},{0x07F7,0x07F7}, /* 07F6 */
+ {0x07F8,0x07F8},{0x07F9,0x07F9}, /* 07F8 */
+ {0x07FA,0x07FA},{0x07FB,0x07FB}, /* 07FA */
+ {0x07FC,0x07FC},{0x07FD,0x07FD}, /* 07FC */
+ {0x07FE,0x07FE},{0x07FF,0x07FF} /* 07FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_page10[256]={
+ {0x1000,0x1000},{0x1001,0x1001}, /* 1000 */
+ {0x1002,0x1002},{0x1003,0x1003}, /* 1002 */
+ {0x1004,0x1004},{0x1005,0x1005}, /* 1004 */
+ {0x1006,0x1006},{0x1007,0x1007}, /* 1006 */
+ {0x1008,0x1008},{0x1009,0x1009}, /* 1008 */
+ {0x100A,0x100A},{0x100B,0x100B}, /* 100A */
+ {0x100C,0x100C},{0x100D,0x100D}, /* 100C */
+ {0x100E,0x100E},{0x100F,0x100F}, /* 100E */
+ {0x1010,0x1010},{0x1011,0x1011}, /* 1010 */
+ {0x1012,0x1012},{0x1013,0x1013}, /* 1012 */
+ {0x1014,0x1014},{0x1015,0x1015}, /* 1014 */
+ {0x1016,0x1016},{0x1017,0x1017}, /* 1016 */
+ {0x1018,0x1018},{0x1019,0x1019}, /* 1018 */
+ {0x101A,0x101A},{0x101B,0x101B}, /* 101A */
+ {0x101C,0x101C},{0x101D,0x101D}, /* 101C */
+ {0x101E,0x101E},{0x101F,0x101F}, /* 101E */
+ {0x1020,0x1020},{0x1021,0x1021}, /* 1020 */
+ {0x1022,0x1022},{0x1023,0x1023}, /* 1022 */
+ {0x1024,0x1024},{0x1025,0x1025}, /* 1024 */
+ {0x1026,0x1026},{0x1027,0x1027}, /* 1026 */
+ {0x1028,0x1028},{0x1029,0x1029}, /* 1028 */
+ {0x102A,0x102A},{0x102B,0x102B}, /* 102A */
+ {0x102C,0x102C},{0x102D,0x102D}, /* 102C */
+ {0x102E,0x102E},{0x102F,0x102F}, /* 102E */
+ {0x1030,0x1030},{0x1031,0x1031}, /* 1030 */
+ {0x1032,0x1032},{0x1033,0x1033}, /* 1032 */
+ {0x1034,0x1034},{0x1035,0x1035}, /* 1034 */
+ {0x1036,0x1036},{0x1037,0x1037}, /* 1036 */
+ {0x1038,0x1038},{0x1039,0x1039}, /* 1038 */
+ {0x103A,0x103A},{0x103B,0x103B}, /* 103A */
+ {0x103C,0x103C},{0x103D,0x103D}, /* 103C */
+ {0x103E,0x103E},{0x103F,0x103F}, /* 103E */
+ {0x1040,0x1040},{0x1041,0x1041}, /* 1040 */
+ {0x1042,0x1042},{0x1043,0x1043}, /* 1042 */
+ {0x1044,0x1044},{0x1045,0x1045}, /* 1044 */
+ {0x1046,0x1046},{0x1047,0x1047}, /* 1046 */
+ {0x1048,0x1048},{0x1049,0x1049}, /* 1048 */
+ {0x104A,0x104A},{0x104B,0x104B}, /* 104A */
+ {0x104C,0x104C},{0x104D,0x104D}, /* 104C */
+ {0x104E,0x104E},{0x104F,0x104F}, /* 104E */
+ {0x1050,0x1050},{0x1051,0x1051}, /* 1050 */
+ {0x1052,0x1052},{0x1053,0x1053}, /* 1052 */
+ {0x1054,0x1054},{0x1055,0x1055}, /* 1054 */
+ {0x1056,0x1056},{0x1057,0x1057}, /* 1056 */
+ {0x1058,0x1058},{0x1059,0x1059}, /* 1058 */
+ {0x105A,0x105A},{0x105B,0x105B}, /* 105A */
+ {0x105C,0x105C},{0x105D,0x105D}, /* 105C */
+ {0x105E,0x105E},{0x105F,0x105F}, /* 105E */
+ {0x1060,0x1060},{0x1061,0x1061}, /* 1060 */
+ {0x1062,0x1062},{0x1063,0x1063}, /* 1062 */
+ {0x1064,0x1064},{0x1065,0x1065}, /* 1064 */
+ {0x1066,0x1066},{0x1067,0x1067}, /* 1066 */
+ {0x1068,0x1068},{0x1069,0x1069}, /* 1068 */
+ {0x106A,0x106A},{0x106B,0x106B}, /* 106A */
+ {0x106C,0x106C},{0x106D,0x106D}, /* 106C */
+ {0x106E,0x106E},{0x106F,0x106F}, /* 106E */
+ {0x1070,0x1070},{0x1071,0x1071}, /* 1070 */
+ {0x1072,0x1072},{0x1073,0x1073}, /* 1072 */
+ {0x1074,0x1074},{0x1075,0x1075}, /* 1074 */
+ {0x1076,0x1076},{0x1077,0x1077}, /* 1076 */
+ {0x1078,0x1078},{0x1079,0x1079}, /* 1078 */
+ {0x107A,0x107A},{0x107B,0x107B}, /* 107A */
+ {0x107C,0x107C},{0x107D,0x107D}, /* 107C */
+ {0x107E,0x107E},{0x107F,0x107F}, /* 107E */
+ {0x1080,0x1080},{0x1081,0x1081}, /* 1080 */
+ {0x1082,0x1082},{0x1083,0x1083}, /* 1082 */
+ {0x1084,0x1084},{0x1085,0x1085}, /* 1084 */
+ {0x1086,0x1086},{0x1087,0x1087}, /* 1086 */
+ {0x1088,0x1088},{0x1089,0x1089}, /* 1088 */
+ {0x108A,0x108A},{0x108B,0x108B}, /* 108A */
+ {0x108C,0x108C},{0x108D,0x108D}, /* 108C */
+ {0x108E,0x108E},{0x108F,0x108F}, /* 108E */
+ {0x1090,0x1090},{0x1091,0x1091}, /* 1090 */
+ {0x1092,0x1092},{0x1093,0x1093}, /* 1092 */
+ {0x1094,0x1094},{0x1095,0x1095}, /* 1094 */
+ {0x1096,0x1096},{0x1097,0x1097}, /* 1096 */
+ {0x1098,0x1098},{0x1099,0x1099}, /* 1098 */
+ {0x109A,0x109A},{0x109B,0x109B}, /* 109A */
+ {0x109C,0x109C},{0x109D,0x109D}, /* 109C */
+ {0x109E,0x109E},{0x109F,0x109F}, /* 109E */
+ {0x10A0,0x2D00},{0x10A1,0x2D01}, /* 10A0 */
+ {0x10A2,0x2D02},{0x10A3,0x2D03}, /* 10A2 */
+ {0x10A4,0x2D04},{0x10A5,0x2D05}, /* 10A4 */
+ {0x10A6,0x2D06},{0x10A7,0x2D07}, /* 10A6 */
+ {0x10A8,0x2D08},{0x10A9,0x2D09}, /* 10A8 */
+ {0x10AA,0x2D0A},{0x10AB,0x2D0B}, /* 10AA */
+ {0x10AC,0x2D0C},{0x10AD,0x2D0D}, /* 10AC */
+ {0x10AE,0x2D0E},{0x10AF,0x2D0F}, /* 10AE */
+ {0x10B0,0x2D10},{0x10B1,0x2D11}, /* 10B0 */
+ {0x10B2,0x2D12},{0x10B3,0x2D13}, /* 10B2 */
+ {0x10B4,0x2D14},{0x10B5,0x2D15}, /* 10B4 */
+ {0x10B6,0x2D16},{0x10B7,0x2D17}, /* 10B6 */
+ {0x10B8,0x2D18},{0x10B9,0x2D19}, /* 10B8 */
+ {0x10BA,0x2D1A},{0x10BB,0x2D1B}, /* 10BA */
+ {0x10BC,0x2D1C},{0x10BD,0x2D1D}, /* 10BC */
+ {0x10BE,0x2D1E},{0x10BF,0x2D1F}, /* 10BE */
+ {0x10C0,0x2D20},{0x10C1,0x2D21}, /* 10C0 */
+ {0x10C2,0x2D22},{0x10C3,0x2D23}, /* 10C2 */
+ {0x10C4,0x2D24},{0x10C5,0x2D25}, /* 10C4 */
+ {0x10C6,0x10C6},{0x10C7,0x10C7}, /* 10C6 */
+ {0x10C8,0x10C8},{0x10C9,0x10C9}, /* 10C8 */
+ {0x10CA,0x10CA},{0x10CB,0x10CB}, /* 10CA */
+ {0x10CC,0x10CC},{0x10CD,0x10CD}, /* 10CC */
+ {0x10CE,0x10CE},{0x10CF,0x10CF}, /* 10CE */
+ {0x10D0,0x10D0},{0x10D1,0x10D1}, /* 10D0 */
+ {0x10D2,0x10D2},{0x10D3,0x10D3}, /* 10D2 */
+ {0x10D4,0x10D4},{0x10D5,0x10D5}, /* 10D4 */
+ {0x10D6,0x10D6},{0x10D7,0x10D7}, /* 10D6 */
+ {0x10D8,0x10D8},{0x10D9,0x10D9}, /* 10D8 */
+ {0x10DA,0x10DA},{0x10DB,0x10DB}, /* 10DA */
+ {0x10DC,0x10DC},{0x10DD,0x10DD}, /* 10DC */
+ {0x10DE,0x10DE},{0x10DF,0x10DF}, /* 10DE */
+ {0x10E0,0x10E0},{0x10E1,0x10E1}, /* 10E0 */
+ {0x10E2,0x10E2},{0x10E3,0x10E3}, /* 10E2 */
+ {0x10E4,0x10E4},{0x10E5,0x10E5}, /* 10E4 */
+ {0x10E6,0x10E6},{0x10E7,0x10E7}, /* 10E6 */
+ {0x10E8,0x10E8},{0x10E9,0x10E9}, /* 10E8 */
+ {0x10EA,0x10EA},{0x10EB,0x10EB}, /* 10EA */
+ {0x10EC,0x10EC},{0x10ED,0x10ED}, /* 10EC */
+ {0x10EE,0x10EE},{0x10EF,0x10EF}, /* 10EE */
+ {0x10F0,0x10F0},{0x10F1,0x10F1}, /* 10F0 */
+ {0x10F2,0x10F2},{0x10F3,0x10F3}, /* 10F2 */
+ {0x10F4,0x10F4},{0x10F5,0x10F5}, /* 10F4 */
+ {0x10F6,0x10F6},{0x10F7,0x10F7}, /* 10F6 */
+ {0x10F8,0x10F8},{0x10F9,0x10F9}, /* 10F8 */
+ {0x10FA,0x10FA},{0x10FB,0x10FB}, /* 10FA */
+ {0x10FC,0x10FC},{0x10FD,0x10FD}, /* 10FC */
+ {0x10FE,0x10FE},{0x10FF,0x10FF} /* 10FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_page1D[256]={
+ {0x1D00,0x1D00},{0x1D01,0x1D01}, /* 1D00 */
+ {0x1D02,0x1D02},{0x1D03,0x1D03}, /* 1D02 */
+ {0x1D04,0x1D04},{0x1D05,0x1D05}, /* 1D04 */
+ {0x1D06,0x1D06},{0x1D07,0x1D07}, /* 1D06 */
+ {0x1D08,0x1D08},{0x1D09,0x1D09}, /* 1D08 */
+ {0x1D0A,0x1D0A},{0x1D0B,0x1D0B}, /* 1D0A */
+ {0x1D0C,0x1D0C},{0x1D0D,0x1D0D}, /* 1D0C */
+ {0x1D0E,0x1D0E},{0x1D0F,0x1D0F}, /* 1D0E */
+ {0x1D10,0x1D10},{0x1D11,0x1D11}, /* 1D10 */
+ {0x1D12,0x1D12},{0x1D13,0x1D13}, /* 1D12 */
+ {0x1D14,0x1D14},{0x1D15,0x1D15}, /* 1D14 */
+ {0x1D16,0x1D16},{0x1D17,0x1D17}, /* 1D16 */
+ {0x1D18,0x1D18},{0x1D19,0x1D19}, /* 1D18 */
+ {0x1D1A,0x1D1A},{0x1D1B,0x1D1B}, /* 1D1A */
+ {0x1D1C,0x1D1C},{0x1D1D,0x1D1D}, /* 1D1C */
+ {0x1D1E,0x1D1E},{0x1D1F,0x1D1F}, /* 1D1E */
+ {0x1D20,0x1D20},{0x1D21,0x1D21}, /* 1D20 */
+ {0x1D22,0x1D22},{0x1D23,0x1D23}, /* 1D22 */
+ {0x1D24,0x1D24},{0x1D25,0x1D25}, /* 1D24 */
+ {0x1D26,0x1D26},{0x1D27,0x1D27}, /* 1D26 */
+ {0x1D28,0x1D28},{0x1D29,0x1D29}, /* 1D28 */
+ {0x1D2A,0x1D2A},{0x1D2B,0x1D2B}, /* 1D2A */
+ {0x1D2C,0x1D2C},{0x1D2D,0x1D2D}, /* 1D2C */
+ {0x1D2E,0x1D2E},{0x1D2F,0x1D2F}, /* 1D2E */
+ {0x1D30,0x1D30},{0x1D31,0x1D31}, /* 1D30 */
+ {0x1D32,0x1D32},{0x1D33,0x1D33}, /* 1D32 */
+ {0x1D34,0x1D34},{0x1D35,0x1D35}, /* 1D34 */
+ {0x1D36,0x1D36},{0x1D37,0x1D37}, /* 1D36 */
+ {0x1D38,0x1D38},{0x1D39,0x1D39}, /* 1D38 */
+ {0x1D3A,0x1D3A},{0x1D3B,0x1D3B}, /* 1D3A */
+ {0x1D3C,0x1D3C},{0x1D3D,0x1D3D}, /* 1D3C */
+ {0x1D3E,0x1D3E},{0x1D3F,0x1D3F}, /* 1D3E */
+ {0x1D40,0x1D40},{0x1D41,0x1D41}, /* 1D40 */
+ {0x1D42,0x1D42},{0x1D43,0x1D43}, /* 1D42 */
+ {0x1D44,0x1D44},{0x1D45,0x1D45}, /* 1D44 */
+ {0x1D46,0x1D46},{0x1D47,0x1D47}, /* 1D46 */
+ {0x1D48,0x1D48},{0x1D49,0x1D49}, /* 1D48 */
+ {0x1D4A,0x1D4A},{0x1D4B,0x1D4B}, /* 1D4A */
+ {0x1D4C,0x1D4C},{0x1D4D,0x1D4D}, /* 1D4C */
+ {0x1D4E,0x1D4E},{0x1D4F,0x1D4F}, /* 1D4E */
+ {0x1D50,0x1D50},{0x1D51,0x1D51}, /* 1D50 */
+ {0x1D52,0x1D52},{0x1D53,0x1D53}, /* 1D52 */
+ {0x1D54,0x1D54},{0x1D55,0x1D55}, /* 1D54 */
+ {0x1D56,0x1D56},{0x1D57,0x1D57}, /* 1D56 */
+ {0x1D58,0x1D58},{0x1D59,0x1D59}, /* 1D58 */
+ {0x1D5A,0x1D5A},{0x1D5B,0x1D5B}, /* 1D5A */
+ {0x1D5C,0x1D5C},{0x1D5D,0x1D5D}, /* 1D5C */
+ {0x1D5E,0x1D5E},{0x1D5F,0x1D5F}, /* 1D5E */
+ {0x1D60,0x1D60},{0x1D61,0x1D61}, /* 1D60 */
+ {0x1D62,0x1D62},{0x1D63,0x1D63}, /* 1D62 */
+ {0x1D64,0x1D64},{0x1D65,0x1D65}, /* 1D64 */
+ {0x1D66,0x1D66},{0x1D67,0x1D67}, /* 1D66 */
+ {0x1D68,0x1D68},{0x1D69,0x1D69}, /* 1D68 */
+ {0x1D6A,0x1D6A},{0x1D6B,0x1D6B}, /* 1D6A */
+ {0x1D6C,0x1D6C},{0x1D6D,0x1D6D}, /* 1D6C */
+ {0x1D6E,0x1D6E},{0x1D6F,0x1D6F}, /* 1D6E */
+ {0x1D70,0x1D70},{0x1D71,0x1D71}, /* 1D70 */
+ {0x1D72,0x1D72},{0x1D73,0x1D73}, /* 1D72 */
+ {0x1D74,0x1D74},{0x1D75,0x1D75}, /* 1D74 */
+ {0x1D76,0x1D76},{0x1D77,0x1D77}, /* 1D76 */
+ {0x1D78,0x1D78},{0xA77D,0x1D79}, /* 1D78 */
+ {0x1D7A,0x1D7A},{0x1D7B,0x1D7B}, /* 1D7A */
+ {0x1D7C,0x1D7C},{0x2C63,0x1D7D}, /* 1D7C */
+ {0x1D7E,0x1D7E},{0x1D7F,0x1D7F}, /* 1D7E */
+ {0x1D80,0x1D80},{0x1D81,0x1D81}, /* 1D80 */
+ {0x1D82,0x1D82},{0x1D83,0x1D83}, /* 1D82 */
+ {0x1D84,0x1D84},{0x1D85,0x1D85}, /* 1D84 */
+ {0x1D86,0x1D86},{0x1D87,0x1D87}, /* 1D86 */
+ {0x1D88,0x1D88},{0x1D89,0x1D89}, /* 1D88 */
+ {0x1D8A,0x1D8A},{0x1D8B,0x1D8B}, /* 1D8A */
+ {0x1D8C,0x1D8C},{0x1D8D,0x1D8D}, /* 1D8C */
+ {0x1D8E,0x1D8E},{0x1D8F,0x1D8F}, /* 1D8E */
+ {0x1D90,0x1D90},{0x1D91,0x1D91}, /* 1D90 */
+ {0x1D92,0x1D92},{0x1D93,0x1D93}, /* 1D92 */
+ {0x1D94,0x1D94},{0x1D95,0x1D95}, /* 1D94 */
+ {0x1D96,0x1D96},{0x1D97,0x1D97}, /* 1D96 */
+ {0x1D98,0x1D98},{0x1D99,0x1D99}, /* 1D98 */
+ {0x1D9A,0x1D9A},{0x1D9B,0x1D9B}, /* 1D9A */
+ {0x1D9C,0x1D9C},{0x1D9D,0x1D9D}, /* 1D9C */
+ {0x1D9E,0x1D9E},{0x1D9F,0x1D9F}, /* 1D9E */
+ {0x1DA0,0x1DA0},{0x1DA1,0x1DA1}, /* 1DA0 */
+ {0x1DA2,0x1DA2},{0x1DA3,0x1DA3}, /* 1DA2 */
+ {0x1DA4,0x1DA4},{0x1DA5,0x1DA5}, /* 1DA4 */
+ {0x1DA6,0x1DA6},{0x1DA7,0x1DA7}, /* 1DA6 */
+ {0x1DA8,0x1DA8},{0x1DA9,0x1DA9}, /* 1DA8 */
+ {0x1DAA,0x1DAA},{0x1DAB,0x1DAB}, /* 1DAA */
+ {0x1DAC,0x1DAC},{0x1DAD,0x1DAD}, /* 1DAC */
+ {0x1DAE,0x1DAE},{0x1DAF,0x1DAF}, /* 1DAE */
+ {0x1DB0,0x1DB0},{0x1DB1,0x1DB1}, /* 1DB0 */
+ {0x1DB2,0x1DB2},{0x1DB3,0x1DB3}, /* 1DB2 */
+ {0x1DB4,0x1DB4},{0x1DB5,0x1DB5}, /* 1DB4 */
+ {0x1DB6,0x1DB6},{0x1DB7,0x1DB7}, /* 1DB6 */
+ {0x1DB8,0x1DB8},{0x1DB9,0x1DB9}, /* 1DB8 */
+ {0x1DBA,0x1DBA},{0x1DBB,0x1DBB}, /* 1DBA */
+ {0x1DBC,0x1DBC},{0x1DBD,0x1DBD}, /* 1DBC */
+ {0x1DBE,0x1DBE},{0x1DBF,0x1DBF}, /* 1DBE */
+ {0x1DC0,0x1DC0},{0x1DC1,0x1DC1}, /* 1DC0 */
+ {0x1DC2,0x1DC2},{0x1DC3,0x1DC3}, /* 1DC2 */
+ {0x1DC4,0x1DC4},{0x1DC5,0x1DC5}, /* 1DC4 */
+ {0x1DC6,0x1DC6},{0x1DC7,0x1DC7}, /* 1DC6 */
+ {0x1DC8,0x1DC8},{0x1DC9,0x1DC9}, /* 1DC8 */
+ {0x1DCA,0x1DCA},{0x1DCB,0x1DCB}, /* 1DCA */
+ {0x1DCC,0x1DCC},{0x1DCD,0x1DCD}, /* 1DCC */
+ {0x1DCE,0x1DCE},{0x1DCF,0x1DCF}, /* 1DCE */
+ {0x1DD0,0x1DD0},{0x1DD1,0x1DD1}, /* 1DD0 */
+ {0x1DD2,0x1DD2},{0x1DD3,0x1DD3}, /* 1DD2 */
+ {0x1DD4,0x1DD4},{0x1DD5,0x1DD5}, /* 1DD4 */
+ {0x1DD6,0x1DD6},{0x1DD7,0x1DD7}, /* 1DD6 */
+ {0x1DD8,0x1DD8},{0x1DD9,0x1DD9}, /* 1DD8 */
+ {0x1DDA,0x1DDA},{0x1DDB,0x1DDB}, /* 1DDA */
+ {0x1DDC,0x1DDC},{0x1DDD,0x1DDD}, /* 1DDC */
+ {0x1DDE,0x1DDE},{0x1DDF,0x1DDF}, /* 1DDE */
+ {0x1DE0,0x1DE0},{0x1DE1,0x1DE1}, /* 1DE0 */
+ {0x1DE2,0x1DE2},{0x1DE3,0x1DE3}, /* 1DE2 */
+ {0x1DE4,0x1DE4},{0x1DE5,0x1DE5}, /* 1DE4 */
+ {0x1DE6,0x1DE6},{0x1DE7,0x1DE7}, /* 1DE6 */
+ {0x1DE8,0x1DE8},{0x1DE9,0x1DE9}, /* 1DE8 */
+ {0x1DEA,0x1DEA},{0x1DEB,0x1DEB}, /* 1DEA */
+ {0x1DEC,0x1DEC},{0x1DED,0x1DED}, /* 1DEC */
+ {0x1DEE,0x1DEE},{0x1DEF,0x1DEF}, /* 1DEE */
+ {0x1DF0,0x1DF0},{0x1DF1,0x1DF1}, /* 1DF0 */
+ {0x1DF2,0x1DF2},{0x1DF3,0x1DF3}, /* 1DF2 */
+ {0x1DF4,0x1DF4},{0x1DF5,0x1DF5}, /* 1DF4 */
+ {0x1DF6,0x1DF6},{0x1DF7,0x1DF7}, /* 1DF6 */
+ {0x1DF8,0x1DF8},{0x1DF9,0x1DF9}, /* 1DF8 */
+ {0x1DFA,0x1DFA},{0x1DFB,0x1DFB}, /* 1DFA */
+ {0x1DFC,0x1DFC},{0x1DFD,0x1DFD}, /* 1DFC */
+ {0x1DFE,0x1DFE},{0x1DFF,0x1DFF} /* 1DFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_page1E[256]={
+ {0x1E00,0x1E01},{0x1E00,0x1E01}, /* 1E00 */
+ {0x1E02,0x1E03},{0x1E02,0x1E03}, /* 1E02 */
+ {0x1E04,0x1E05},{0x1E04,0x1E05}, /* 1E04 */
+ {0x1E06,0x1E07},{0x1E06,0x1E07}, /* 1E06 */
+ {0x1E08,0x1E09},{0x1E08,0x1E09}, /* 1E08 */
+ {0x1E0A,0x1E0B},{0x1E0A,0x1E0B}, /* 1E0A */
+ {0x1E0C,0x1E0D},{0x1E0C,0x1E0D}, /* 1E0C */
+ {0x1E0E,0x1E0F},{0x1E0E,0x1E0F}, /* 1E0E */
+ {0x1E10,0x1E11},{0x1E10,0x1E11}, /* 1E10 */
+ {0x1E12,0x1E13},{0x1E12,0x1E13}, /* 1E12 */
+ {0x1E14,0x1E15},{0x1E14,0x1E15}, /* 1E14 */
+ {0x1E16,0x1E17},{0x1E16,0x1E17}, /* 1E16 */
+ {0x1E18,0x1E19},{0x1E18,0x1E19}, /* 1E18 */
+ {0x1E1A,0x1E1B},{0x1E1A,0x1E1B}, /* 1E1A */
+ {0x1E1C,0x1E1D},{0x1E1C,0x1E1D}, /* 1E1C */
+ {0x1E1E,0x1E1F},{0x1E1E,0x1E1F}, /* 1E1E */
+ {0x1E20,0x1E21},{0x1E20,0x1E21}, /* 1E20 */
+ {0x1E22,0x1E23},{0x1E22,0x1E23}, /* 1E22 */
+ {0x1E24,0x1E25},{0x1E24,0x1E25}, /* 1E24 */
+ {0x1E26,0x1E27},{0x1E26,0x1E27}, /* 1E26 */
+ {0x1E28,0x1E29},{0x1E28,0x1E29}, /* 1E28 */
+ {0x1E2A,0x1E2B},{0x1E2A,0x1E2B}, /* 1E2A */
+ {0x1E2C,0x1E2D},{0x1E2C,0x1E2D}, /* 1E2C */
+ {0x1E2E,0x1E2F},{0x1E2E,0x1E2F}, /* 1E2E */
+ {0x1E30,0x1E31},{0x1E30,0x1E31}, /* 1E30 */
+ {0x1E32,0x1E33},{0x1E32,0x1E33}, /* 1E32 */
+ {0x1E34,0x1E35},{0x1E34,0x1E35}, /* 1E34 */
+ {0x1E36,0x1E37},{0x1E36,0x1E37}, /* 1E36 */
+ {0x1E38,0x1E39},{0x1E38,0x1E39}, /* 1E38 */
+ {0x1E3A,0x1E3B},{0x1E3A,0x1E3B}, /* 1E3A */
+ {0x1E3C,0x1E3D},{0x1E3C,0x1E3D}, /* 1E3C */
+ {0x1E3E,0x1E3F},{0x1E3E,0x1E3F}, /* 1E3E */
+ {0x1E40,0x1E41},{0x1E40,0x1E41}, /* 1E40 */
+ {0x1E42,0x1E43},{0x1E42,0x1E43}, /* 1E42 */
+ {0x1E44,0x1E45},{0x1E44,0x1E45}, /* 1E44 */
+ {0x1E46,0x1E47},{0x1E46,0x1E47}, /* 1E46 */
+ {0x1E48,0x1E49},{0x1E48,0x1E49}, /* 1E48 */
+ {0x1E4A,0x1E4B},{0x1E4A,0x1E4B}, /* 1E4A */
+ {0x1E4C,0x1E4D},{0x1E4C,0x1E4D}, /* 1E4C */
+ {0x1E4E,0x1E4F},{0x1E4E,0x1E4F}, /* 1E4E */
+ {0x1E50,0x1E51},{0x1E50,0x1E51}, /* 1E50 */
+ {0x1E52,0x1E53},{0x1E52,0x1E53}, /* 1E52 */
+ {0x1E54,0x1E55},{0x1E54,0x1E55}, /* 1E54 */
+ {0x1E56,0x1E57},{0x1E56,0x1E57}, /* 1E56 */
+ {0x1E58,0x1E59},{0x1E58,0x1E59}, /* 1E58 */
+ {0x1E5A,0x1E5B},{0x1E5A,0x1E5B}, /* 1E5A */
+ {0x1E5C,0x1E5D},{0x1E5C,0x1E5D}, /* 1E5C */
+ {0x1E5E,0x1E5F},{0x1E5E,0x1E5F}, /* 1E5E */
+ {0x1E60,0x1E61},{0x1E60,0x1E61}, /* 1E60 */
+ {0x1E62,0x1E63},{0x1E62,0x1E63}, /* 1E62 */
+ {0x1E64,0x1E65},{0x1E64,0x1E65}, /* 1E64 */
+ {0x1E66,0x1E67},{0x1E66,0x1E67}, /* 1E66 */
+ {0x1E68,0x1E69},{0x1E68,0x1E69}, /* 1E68 */
+ {0x1E6A,0x1E6B},{0x1E6A,0x1E6B}, /* 1E6A */
+ {0x1E6C,0x1E6D},{0x1E6C,0x1E6D}, /* 1E6C */
+ {0x1E6E,0x1E6F},{0x1E6E,0x1E6F}, /* 1E6E */
+ {0x1E70,0x1E71},{0x1E70,0x1E71}, /* 1E70 */
+ {0x1E72,0x1E73},{0x1E72,0x1E73}, /* 1E72 */
+ {0x1E74,0x1E75},{0x1E74,0x1E75}, /* 1E74 */
+ {0x1E76,0x1E77},{0x1E76,0x1E77}, /* 1E76 */
+ {0x1E78,0x1E79},{0x1E78,0x1E79}, /* 1E78 */
+ {0x1E7A,0x1E7B},{0x1E7A,0x1E7B}, /* 1E7A */
+ {0x1E7C,0x1E7D},{0x1E7C,0x1E7D}, /* 1E7C */
+ {0x1E7E,0x1E7F},{0x1E7E,0x1E7F}, /* 1E7E */
+ {0x1E80,0x1E81},{0x1E80,0x1E81}, /* 1E80 */
+ {0x1E82,0x1E83},{0x1E82,0x1E83}, /* 1E82 */
+ {0x1E84,0x1E85},{0x1E84,0x1E85}, /* 1E84 */
+ {0x1E86,0x1E87},{0x1E86,0x1E87}, /* 1E86 */
+ {0x1E88,0x1E89},{0x1E88,0x1E89}, /* 1E88 */
+ {0x1E8A,0x1E8B},{0x1E8A,0x1E8B}, /* 1E8A */
+ {0x1E8C,0x1E8D},{0x1E8C,0x1E8D}, /* 1E8C */
+ {0x1E8E,0x1E8F},{0x1E8E,0x1E8F}, /* 1E8E */
+ {0x1E90,0x1E91},{0x1E90,0x1E91}, /* 1E90 */
+ {0x1E92,0x1E93},{0x1E92,0x1E93}, /* 1E92 */
+ {0x1E94,0x1E95},{0x1E94,0x1E95}, /* 1E94 */
+ {0x1E96,0x1E96},{0x1E97,0x1E97}, /* 1E96 */
+ {0x1E98,0x1E98},{0x1E99,0x1E99}, /* 1E98 */
+ {0x1E9A,0x1E9A},{0x1E60,0x1E9B}, /* 1E9A */
+ {0x1E9C,0x1E9C},{0x1E9D,0x1E9D}, /* 1E9C */
+ {0x1E9E,0x00DF},{0x1E9F,0x1E9F}, /* 1E9E */
+ {0x1EA0,0x1EA1},{0x1EA0,0x1EA1}, /* 1EA0 */
+ {0x1EA2,0x1EA3},{0x1EA2,0x1EA3}, /* 1EA2 */
+ {0x1EA4,0x1EA5},{0x1EA4,0x1EA5}, /* 1EA4 */
+ {0x1EA6,0x1EA7},{0x1EA6,0x1EA7}, /* 1EA6 */
+ {0x1EA8,0x1EA9},{0x1EA8,0x1EA9}, /* 1EA8 */
+ {0x1EAA,0x1EAB},{0x1EAA,0x1EAB}, /* 1EAA */
+ {0x1EAC,0x1EAD},{0x1EAC,0x1EAD}, /* 1EAC */
+ {0x1EAE,0x1EAF},{0x1EAE,0x1EAF}, /* 1EAE */
+ {0x1EB0,0x1EB1},{0x1EB0,0x1EB1}, /* 1EB0 */
+ {0x1EB2,0x1EB3},{0x1EB2,0x1EB3}, /* 1EB2 */
+ {0x1EB4,0x1EB5},{0x1EB4,0x1EB5}, /* 1EB4 */
+ {0x1EB6,0x1EB7},{0x1EB6,0x1EB7}, /* 1EB6 */
+ {0x1EB8,0x1EB9},{0x1EB8,0x1EB9}, /* 1EB8 */
+ {0x1EBA,0x1EBB},{0x1EBA,0x1EBB}, /* 1EBA */
+ {0x1EBC,0x1EBD},{0x1EBC,0x1EBD}, /* 1EBC */
+ {0x1EBE,0x1EBF},{0x1EBE,0x1EBF}, /* 1EBE */
+ {0x1EC0,0x1EC1},{0x1EC0,0x1EC1}, /* 1EC0 */
+ {0x1EC2,0x1EC3},{0x1EC2,0x1EC3}, /* 1EC2 */
+ {0x1EC4,0x1EC5},{0x1EC4,0x1EC5}, /* 1EC4 */
+ {0x1EC6,0x1EC7},{0x1EC6,0x1EC7}, /* 1EC6 */
+ {0x1EC8,0x1EC9},{0x1EC8,0x1EC9}, /* 1EC8 */
+ {0x1ECA,0x1ECB},{0x1ECA,0x1ECB}, /* 1ECA */
+ {0x1ECC,0x1ECD},{0x1ECC,0x1ECD}, /* 1ECC */
+ {0x1ECE,0x1ECF},{0x1ECE,0x1ECF}, /* 1ECE */
+ {0x1ED0,0x1ED1},{0x1ED0,0x1ED1}, /* 1ED0 */
+ {0x1ED2,0x1ED3},{0x1ED2,0x1ED3}, /* 1ED2 */
+ {0x1ED4,0x1ED5},{0x1ED4,0x1ED5}, /* 1ED4 */
+ {0x1ED6,0x1ED7},{0x1ED6,0x1ED7}, /* 1ED6 */
+ {0x1ED8,0x1ED9},{0x1ED8,0x1ED9}, /* 1ED8 */
+ {0x1EDA,0x1EDB},{0x1EDA,0x1EDB}, /* 1EDA */
+ {0x1EDC,0x1EDD},{0x1EDC,0x1EDD}, /* 1EDC */
+ {0x1EDE,0x1EDF},{0x1EDE,0x1EDF}, /* 1EDE */
+ {0x1EE0,0x1EE1},{0x1EE0,0x1EE1}, /* 1EE0 */
+ {0x1EE2,0x1EE3},{0x1EE2,0x1EE3}, /* 1EE2 */
+ {0x1EE4,0x1EE5},{0x1EE4,0x1EE5}, /* 1EE4 */
+ {0x1EE6,0x1EE7},{0x1EE6,0x1EE7}, /* 1EE6 */
+ {0x1EE8,0x1EE9},{0x1EE8,0x1EE9}, /* 1EE8 */
+ {0x1EEA,0x1EEB},{0x1EEA,0x1EEB}, /* 1EEA */
+ {0x1EEC,0x1EED},{0x1EEC,0x1EED}, /* 1EEC */
+ {0x1EEE,0x1EEF},{0x1EEE,0x1EEF}, /* 1EEE */
+ {0x1EF0,0x1EF1},{0x1EF0,0x1EF1}, /* 1EF0 */
+ {0x1EF2,0x1EF3},{0x1EF2,0x1EF3}, /* 1EF2 */
+ {0x1EF4,0x1EF5},{0x1EF4,0x1EF5}, /* 1EF4 */
+ {0x1EF6,0x1EF7},{0x1EF6,0x1EF7}, /* 1EF6 */
+ {0x1EF8,0x1EF9},{0x1EF8,0x1EF9}, /* 1EF8 */
+ {0x1EFA,0x1EFB},{0x1EFA,0x1EFB}, /* 1EFA */
+ {0x1EFC,0x1EFD},{0x1EFC,0x1EFD}, /* 1EFC */
+ {0x1EFE,0x1EFF},{0x1EFE,0x1EFF} /* 1EFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_page1F[256]={
+ {0x1F08,0x1F00},{0x1F09,0x1F01}, /* 1F00 */
+ {0x1F0A,0x1F02},{0x1F0B,0x1F03}, /* 1F02 */
+ {0x1F0C,0x1F04},{0x1F0D,0x1F05}, /* 1F04 */
+ {0x1F0E,0x1F06},{0x1F0F,0x1F07}, /* 1F06 */
+ {0x1F08,0x1F00},{0x1F09,0x1F01}, /* 1F08 */
+ {0x1F0A,0x1F02},{0x1F0B,0x1F03}, /* 1F0A */
+ {0x1F0C,0x1F04},{0x1F0D,0x1F05}, /* 1F0C */
+ {0x1F0E,0x1F06},{0x1F0F,0x1F07}, /* 1F0E */
+ {0x1F18,0x1F10},{0x1F19,0x1F11}, /* 1F10 */
+ {0x1F1A,0x1F12},{0x1F1B,0x1F13}, /* 1F12 */
+ {0x1F1C,0x1F14},{0x1F1D,0x1F15}, /* 1F14 */
+ {0x1F16,0x1F16},{0x1F17,0x1F17}, /* 1F16 */
+ {0x1F18,0x1F10},{0x1F19,0x1F11}, /* 1F18 */
+ {0x1F1A,0x1F12},{0x1F1B,0x1F13}, /* 1F1A */
+ {0x1F1C,0x1F14},{0x1F1D,0x1F15}, /* 1F1C */
+ {0x1F1E,0x1F1E},{0x1F1F,0x1F1F}, /* 1F1E */
+ {0x1F28,0x1F20},{0x1F29,0x1F21}, /* 1F20 */
+ {0x1F2A,0x1F22},{0x1F2B,0x1F23}, /* 1F22 */
+ {0x1F2C,0x1F24},{0x1F2D,0x1F25}, /* 1F24 */
+ {0x1F2E,0x1F26},{0x1F2F,0x1F27}, /* 1F26 */
+ {0x1F28,0x1F20},{0x1F29,0x1F21}, /* 1F28 */
+ {0x1F2A,0x1F22},{0x1F2B,0x1F23}, /* 1F2A */
+ {0x1F2C,0x1F24},{0x1F2D,0x1F25}, /* 1F2C */
+ {0x1F2E,0x1F26},{0x1F2F,0x1F27}, /* 1F2E */
+ {0x1F38,0x1F30},{0x1F39,0x1F31}, /* 1F30 */
+ {0x1F3A,0x1F32},{0x1F3B,0x1F33}, /* 1F32 */
+ {0x1F3C,0x1F34},{0x1F3D,0x1F35}, /* 1F34 */
+ {0x1F3E,0x1F36},{0x1F3F,0x1F37}, /* 1F36 */
+ {0x1F38,0x1F30},{0x1F39,0x1F31}, /* 1F38 */
+ {0x1F3A,0x1F32},{0x1F3B,0x1F33}, /* 1F3A */
+ {0x1F3C,0x1F34},{0x1F3D,0x1F35}, /* 1F3C */
+ {0x1F3E,0x1F36},{0x1F3F,0x1F37}, /* 1F3E */
+ {0x1F48,0x1F40},{0x1F49,0x1F41}, /* 1F40 */
+ {0x1F4A,0x1F42},{0x1F4B,0x1F43}, /* 1F42 */
+ {0x1F4C,0x1F44},{0x1F4D,0x1F45}, /* 1F44 */
+ {0x1F46,0x1F46},{0x1F47,0x1F47}, /* 1F46 */
+ {0x1F48,0x1F40},{0x1F49,0x1F41}, /* 1F48 */
+ {0x1F4A,0x1F42},{0x1F4B,0x1F43}, /* 1F4A */
+ {0x1F4C,0x1F44},{0x1F4D,0x1F45}, /* 1F4C */
+ {0x1F4E,0x1F4E},{0x1F4F,0x1F4F}, /* 1F4E */
+ {0x1F50,0x1F50},{0x1F59,0x1F51}, /* 1F50 */
+ {0x1F52,0x1F52},{0x1F5B,0x1F53}, /* 1F52 */
+ {0x1F54,0x1F54},{0x1F5D,0x1F55}, /* 1F54 */
+ {0x1F56,0x1F56},{0x1F5F,0x1F57}, /* 1F56 */
+ {0x1F58,0x1F58},{0x1F59,0x1F51}, /* 1F58 */
+ {0x1F5A,0x1F5A},{0x1F5B,0x1F53}, /* 1F5A */
+ {0x1F5C,0x1F5C},{0x1F5D,0x1F55}, /* 1F5C */
+ {0x1F5E,0x1F5E},{0x1F5F,0x1F57}, /* 1F5E */
+ {0x1F68,0x1F60},{0x1F69,0x1F61}, /* 1F60 */
+ {0x1F6A,0x1F62},{0x1F6B,0x1F63}, /* 1F62 */
+ {0x1F6C,0x1F64},{0x1F6D,0x1F65}, /* 1F64 */
+ {0x1F6E,0x1F66},{0x1F6F,0x1F67}, /* 1F66 */
+ {0x1F68,0x1F60},{0x1F69,0x1F61}, /* 1F68 */
+ {0x1F6A,0x1F62},{0x1F6B,0x1F63}, /* 1F6A */
+ {0x1F6C,0x1F64},{0x1F6D,0x1F65}, /* 1F6C */
+ {0x1F6E,0x1F66},{0x1F6F,0x1F67}, /* 1F6E */
+ {0x1FBA,0x1F70},{0x1FBB,0x1F71}, /* 1F70 */
+ {0x1FC8,0x1F72},{0x1FC9,0x1F73}, /* 1F72 */
+ {0x1FCA,0x1F74},{0x1FCB,0x1F75}, /* 1F74 */
+ {0x1FDA,0x1F76},{0x1FDB,0x1F77}, /* 1F76 */
+ {0x1FF8,0x1F78},{0x1FF9,0x1F79}, /* 1F78 */
+ {0x1FEA,0x1F7A},{0x1FEB,0x1F7B}, /* 1F7A */
+ {0x1FFA,0x1F7C},{0x1FFB,0x1F7D}, /* 1F7C */
+ {0x1F7E,0x1F7E},{0x1F7F,0x1F7F}, /* 1F7E */
+ {0x1F88,0x1F80},{0x1F89,0x1F81}, /* 1F80 */
+ {0x1F8A,0x1F82},{0x1F8B,0x1F83}, /* 1F82 */
+ {0x1F8C,0x1F84},{0x1F8D,0x1F85}, /* 1F84 */
+ {0x1F8E,0x1F86},{0x1F8F,0x1F87}, /* 1F86 */
+ {0x1F88,0x1F80},{0x1F89,0x1F81}, /* 1F88 */
+ {0x1F8A,0x1F82},{0x1F8B,0x1F83}, /* 1F8A */
+ {0x1F8C,0x1F84},{0x1F8D,0x1F85}, /* 1F8C */
+ {0x1F8E,0x1F86},{0x1F8F,0x1F87}, /* 1F8E */
+ {0x1F98,0x1F90},{0x1F99,0x1F91}, /* 1F90 */
+ {0x1F9A,0x1F92},{0x1F9B,0x1F93}, /* 1F92 */
+ {0x1F9C,0x1F94},{0x1F9D,0x1F95}, /* 1F94 */
+ {0x1F9E,0x1F96},{0x1F9F,0x1F97}, /* 1F96 */
+ {0x1F98,0x1F90},{0x1F99,0x1F91}, /* 1F98 */
+ {0x1F9A,0x1F92},{0x1F9B,0x1F93}, /* 1F9A */
+ {0x1F9C,0x1F94},{0x1F9D,0x1F95}, /* 1F9C */
+ {0x1F9E,0x1F96},{0x1F9F,0x1F97}, /* 1F9E */
+ {0x1FA8,0x1FA0},{0x1FA9,0x1FA1}, /* 1FA0 */
+ {0x1FAA,0x1FA2},{0x1FAB,0x1FA3}, /* 1FA2 */
+ {0x1FAC,0x1FA4},{0x1FAD,0x1FA5}, /* 1FA4 */
+ {0x1FAE,0x1FA6},{0x1FAF,0x1FA7}, /* 1FA6 */
+ {0x1FA8,0x1FA0},{0x1FA9,0x1FA1}, /* 1FA8 */
+ {0x1FAA,0x1FA2},{0x1FAB,0x1FA3}, /* 1FAA */
+ {0x1FAC,0x1FA4},{0x1FAD,0x1FA5}, /* 1FAC */
+ {0x1FAE,0x1FA6},{0x1FAF,0x1FA7}, /* 1FAE */
+ {0x1FB8,0x1FB0},{0x1FB9,0x1FB1}, /* 1FB0 */
+ {0x1FB2,0x1FB2},{0x1FBC,0x1FB3}, /* 1FB2 */
+ {0x1FB4,0x1FB4},{0x1FB5,0x1FB5}, /* 1FB4 */
+ {0x1FB6,0x1FB6},{0x1FB7,0x1FB7}, /* 1FB6 */
+ {0x1FB8,0x1FB0},{0x1FB9,0x1FB1}, /* 1FB8 */
+ {0x1FBA,0x1F70},{0x1FBB,0x1F71}, /* 1FBA */
+ {0x1FBC,0x1FB3},{0x1FBD,0x1FBD}, /* 1FBC */
+ {0x0399,0x1FBE},{0x1FBF,0x1FBF}, /* 1FBE */
+ {0x1FC0,0x1FC0},{0x1FC1,0x1FC1}, /* 1FC0 */
+ {0x1FC2,0x1FC2},{0x1FCC,0x1FC3}, /* 1FC2 */
+ {0x1FC4,0x1FC4},{0x1FC5,0x1FC5}, /* 1FC4 */
+ {0x1FC6,0x1FC6},{0x1FC7,0x1FC7}, /* 1FC6 */
+ {0x1FC8,0x1F72},{0x1FC9,0x1F73}, /* 1FC8 */
+ {0x1FCA,0x1F74},{0x1FCB,0x1F75}, /* 1FCA */
+ {0x1FCC,0x1FC3},{0x1FCD,0x1FCD}, /* 1FCC */
+ {0x1FCE,0x1FCE},{0x1FCF,0x1FCF}, /* 1FCE */
+ {0x1FD8,0x1FD0},{0x1FD9,0x1FD1}, /* 1FD0 */
+ {0x1FD2,0x1FD2},{0x1FD3,0x1FD3}, /* 1FD2 */
+ {0x1FD4,0x1FD4},{0x1FD5,0x1FD5}, /* 1FD4 */
+ {0x1FD6,0x1FD6},{0x1FD7,0x1FD7}, /* 1FD6 */
+ {0x1FD8,0x1FD0},{0x1FD9,0x1FD1}, /* 1FD8 */
+ {0x1FDA,0x1F76},{0x1FDB,0x1F77}, /* 1FDA */
+ {0x1FDC,0x1FDC},{0x1FDD,0x1FDD}, /* 1FDC */
+ {0x1FDE,0x1FDE},{0x1FDF,0x1FDF}, /* 1FDE */
+ {0x1FE8,0x1FE0},{0x1FE9,0x1FE1}, /* 1FE0 */
+ {0x1FE2,0x1FE2},{0x1FE3,0x1FE3}, /* 1FE2 */
+ {0x1FE4,0x1FE4},{0x1FEC,0x1FE5}, /* 1FE4 */
+ {0x1FE6,0x1FE6},{0x1FE7,0x1FE7}, /* 1FE6 */
+ {0x1FE8,0x1FE0},{0x1FE9,0x1FE1}, /* 1FE8 */
+ {0x1FEA,0x1F7A},{0x1FEB,0x1F7B}, /* 1FEA */
+ {0x1FEC,0x1FE5},{0x1FED,0x1FED}, /* 1FEC */
+ {0x1FEE,0x1FEE},{0x1FEF,0x1FEF}, /* 1FEE */
+ {0x1FF0,0x1FF0},{0x1FF1,0x1FF1}, /* 1FF0 */
+ {0x1FF2,0x1FF2},{0x1FFC,0x1FF3}, /* 1FF2 */
+ {0x1FF4,0x1FF4},{0x1FF5,0x1FF5}, /* 1FF4 */
+ {0x1FF6,0x1FF6},{0x1FF7,0x1FF7}, /* 1FF6 */
+ {0x1FF8,0x1F78},{0x1FF9,0x1F79}, /* 1FF8 */
+ {0x1FFA,0x1F7C},{0x1FFB,0x1F7D}, /* 1FFA */
+ {0x1FFC,0x1FF3},{0x1FFD,0x1FFD}, /* 1FFC */
+ {0x1FFE,0x1FFE},{0x1FFF,0x1FFF} /* 1FFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_page21[256]={
+ {0x2100,0x2100},{0x2101,0x2101}, /* 2100 */
+ {0x2102,0x2102},{0x2103,0x2103}, /* 2102 */
+ {0x2104,0x2104},{0x2105,0x2105}, /* 2104 */
+ {0x2106,0x2106},{0x2107,0x2107}, /* 2106 */
+ {0x2108,0x2108},{0x2109,0x2109}, /* 2108 */
+ {0x210A,0x210A},{0x210B,0x210B}, /* 210A */
+ {0x210C,0x210C},{0x210D,0x210D}, /* 210C */
+ {0x210E,0x210E},{0x210F,0x210F}, /* 210E */
+ {0x2110,0x2110},{0x2111,0x2111}, /* 2110 */
+ {0x2112,0x2112},{0x2113,0x2113}, /* 2112 */
+ {0x2114,0x2114},{0x2115,0x2115}, /* 2114 */
+ {0x2116,0x2116},{0x2117,0x2117}, /* 2116 */
+ {0x2118,0x2118},{0x2119,0x2119}, /* 2118 */
+ {0x211A,0x211A},{0x211B,0x211B}, /* 211A */
+ {0x211C,0x211C},{0x211D,0x211D}, /* 211C */
+ {0x211E,0x211E},{0x211F,0x211F}, /* 211E */
+ {0x2120,0x2120},{0x2121,0x2121}, /* 2120 */
+ {0x2122,0x2122},{0x2123,0x2123}, /* 2122 */
+ {0x2124,0x2124},{0x2125,0x2125}, /* 2124 */
+ {0x2126,0x03C9},{0x2127,0x2127}, /* 2126 */
+ {0x2128,0x2128},{0x2129,0x2129}, /* 2128 */
+ {0x212A,0x006B},{0x212B,0x00E5}, /* 212A */
+ {0x212C,0x212C},{0x212D,0x212D}, /* 212C */
+ {0x212E,0x212E},{0x212F,0x212F}, /* 212E */
+ {0x2130,0x2130},{0x2131,0x2131}, /* 2130 */
+ {0x2132,0x214E},{0x2133,0x2133}, /* 2132 */
+ {0x2134,0x2134},{0x2135,0x2135}, /* 2134 */
+ {0x2136,0x2136},{0x2137,0x2137}, /* 2136 */
+ {0x2138,0x2138},{0x2139,0x2139}, /* 2138 */
+ {0x213A,0x213A},{0x213B,0x213B}, /* 213A */
+ {0x213C,0x213C},{0x213D,0x213D}, /* 213C */
+ {0x213E,0x213E},{0x213F,0x213F}, /* 213E */
+ {0x2140,0x2140},{0x2141,0x2141}, /* 2140 */
+ {0x2142,0x2142},{0x2143,0x2143}, /* 2142 */
+ {0x2144,0x2144},{0x2145,0x2145}, /* 2144 */
+ {0x2146,0x2146},{0x2147,0x2147}, /* 2146 */
+ {0x2148,0x2148},{0x2149,0x2149}, /* 2148 */
+ {0x214A,0x214A},{0x214B,0x214B}, /* 214A */
+ {0x214C,0x214C},{0x214D,0x214D}, /* 214C */
+ {0x2132,0x214E},{0x214F,0x214F}, /* 214E */
+ {0x2150,0x2150},{0x2151,0x2151}, /* 2150 */
+ {0x2152,0x2152},{0x2153,0x2153}, /* 2152 */
+ {0x2154,0x2154},{0x2155,0x2155}, /* 2154 */
+ {0x2156,0x2156},{0x2157,0x2157}, /* 2156 */
+ {0x2158,0x2158},{0x2159,0x2159}, /* 2158 */
+ {0x215A,0x215A},{0x215B,0x215B}, /* 215A */
+ {0x215C,0x215C},{0x215D,0x215D}, /* 215C */
+ {0x215E,0x215E},{0x215F,0x215F}, /* 215E */
+ {0x2160,0x2170},{0x2161,0x2171}, /* 2160 */
+ {0x2162,0x2172},{0x2163,0x2173}, /* 2162 */
+ {0x2164,0x2174},{0x2165,0x2175}, /* 2164 */
+ {0x2166,0x2176},{0x2167,0x2177}, /* 2166 */
+ {0x2168,0x2178},{0x2169,0x2179}, /* 2168 */
+ {0x216A,0x217A},{0x216B,0x217B}, /* 216A */
+ {0x216C,0x217C},{0x216D,0x217D}, /* 216C */
+ {0x216E,0x217E},{0x216F,0x217F}, /* 216E */
+ {0x2160,0x2170},{0x2161,0x2171}, /* 2170 */
+ {0x2162,0x2172},{0x2163,0x2173}, /* 2172 */
+ {0x2164,0x2174},{0x2165,0x2175}, /* 2174 */
+ {0x2166,0x2176},{0x2167,0x2177}, /* 2176 */
+ {0x2168,0x2178},{0x2169,0x2179}, /* 2178 */
+ {0x216A,0x217A},{0x216B,0x217B}, /* 217A */
+ {0x216C,0x217C},{0x216D,0x217D}, /* 217C */
+ {0x216E,0x217E},{0x216F,0x217F}, /* 217E */
+ {0x2180,0x2180},{0x2181,0x2181}, /* 2180 */
+ {0x2182,0x2182},{0x2183,0x2184}, /* 2182 */
+ {0x2183,0x2184},{0x2185,0x2185}, /* 2184 */
+ {0x2186,0x2186},{0x2187,0x2187}, /* 2186 */
+ {0x2188,0x2188},{0x2189,0x2189}, /* 2188 */
+ {0x218A,0x218A},{0x218B,0x218B}, /* 218A */
+ {0x218C,0x218C},{0x218D,0x218D}, /* 218C */
+ {0x218E,0x218E},{0x218F,0x218F}, /* 218E */
+ {0x2190,0x2190},{0x2191,0x2191}, /* 2190 */
+ {0x2192,0x2192},{0x2193,0x2193}, /* 2192 */
+ {0x2194,0x2194},{0x2195,0x2195}, /* 2194 */
+ {0x2196,0x2196},{0x2197,0x2197}, /* 2196 */
+ {0x2198,0x2198},{0x2199,0x2199}, /* 2198 */
+ {0x219A,0x219A},{0x219B,0x219B}, /* 219A */
+ {0x219C,0x219C},{0x219D,0x219D}, /* 219C */
+ {0x219E,0x219E},{0x219F,0x219F}, /* 219E */
+ {0x21A0,0x21A0},{0x21A1,0x21A1}, /* 21A0 */
+ {0x21A2,0x21A2},{0x21A3,0x21A3}, /* 21A2 */
+ {0x21A4,0x21A4},{0x21A5,0x21A5}, /* 21A4 */
+ {0x21A6,0x21A6},{0x21A7,0x21A7}, /* 21A6 */
+ {0x21A8,0x21A8},{0x21A9,0x21A9}, /* 21A8 */
+ {0x21AA,0x21AA},{0x21AB,0x21AB}, /* 21AA */
+ {0x21AC,0x21AC},{0x21AD,0x21AD}, /* 21AC */
+ {0x21AE,0x21AE},{0x21AF,0x21AF}, /* 21AE */
+ {0x21B0,0x21B0},{0x21B1,0x21B1}, /* 21B0 */
+ {0x21B2,0x21B2},{0x21B3,0x21B3}, /* 21B2 */
+ {0x21B4,0x21B4},{0x21B5,0x21B5}, /* 21B4 */
+ {0x21B6,0x21B6},{0x21B7,0x21B7}, /* 21B6 */
+ {0x21B8,0x21B8},{0x21B9,0x21B9}, /* 21B8 */
+ {0x21BA,0x21BA},{0x21BB,0x21BB}, /* 21BA */
+ {0x21BC,0x21BC},{0x21BD,0x21BD}, /* 21BC */
+ {0x21BE,0x21BE},{0x21BF,0x21BF}, /* 21BE */
+ {0x21C0,0x21C0},{0x21C1,0x21C1}, /* 21C0 */
+ {0x21C2,0x21C2},{0x21C3,0x21C3}, /* 21C2 */
+ {0x21C4,0x21C4},{0x21C5,0x21C5}, /* 21C4 */
+ {0x21C6,0x21C6},{0x21C7,0x21C7}, /* 21C6 */
+ {0x21C8,0x21C8},{0x21C9,0x21C9}, /* 21C8 */
+ {0x21CA,0x21CA},{0x21CB,0x21CB}, /* 21CA */
+ {0x21CC,0x21CC},{0x21CD,0x21CD}, /* 21CC */
+ {0x21CE,0x21CE},{0x21CF,0x21CF}, /* 21CE */
+ {0x21D0,0x21D0},{0x21D1,0x21D1}, /* 21D0 */
+ {0x21D2,0x21D2},{0x21D3,0x21D3}, /* 21D2 */
+ {0x21D4,0x21D4},{0x21D5,0x21D5}, /* 21D4 */
+ {0x21D6,0x21D6},{0x21D7,0x21D7}, /* 21D6 */
+ {0x21D8,0x21D8},{0x21D9,0x21D9}, /* 21D8 */
+ {0x21DA,0x21DA},{0x21DB,0x21DB}, /* 21DA */
+ {0x21DC,0x21DC},{0x21DD,0x21DD}, /* 21DC */
+ {0x21DE,0x21DE},{0x21DF,0x21DF}, /* 21DE */
+ {0x21E0,0x21E0},{0x21E1,0x21E1}, /* 21E0 */
+ {0x21E2,0x21E2},{0x21E3,0x21E3}, /* 21E2 */
+ {0x21E4,0x21E4},{0x21E5,0x21E5}, /* 21E4 */
+ {0x21E6,0x21E6},{0x21E7,0x21E7}, /* 21E6 */
+ {0x21E8,0x21E8},{0x21E9,0x21E9}, /* 21E8 */
+ {0x21EA,0x21EA},{0x21EB,0x21EB}, /* 21EA */
+ {0x21EC,0x21EC},{0x21ED,0x21ED}, /* 21EC */
+ {0x21EE,0x21EE},{0x21EF,0x21EF}, /* 21EE */
+ {0x21F0,0x21F0},{0x21F1,0x21F1}, /* 21F0 */
+ {0x21F2,0x21F2},{0x21F3,0x21F3}, /* 21F2 */
+ {0x21F4,0x21F4},{0x21F5,0x21F5}, /* 21F4 */
+ {0x21F6,0x21F6},{0x21F7,0x21F7}, /* 21F6 */
+ {0x21F8,0x21F8},{0x21F9,0x21F9}, /* 21F8 */
+ {0x21FA,0x21FA},{0x21FB,0x21FB}, /* 21FA */
+ {0x21FC,0x21FC},{0x21FD,0x21FD}, /* 21FC */
+ {0x21FE,0x21FE},{0x21FF,0x21FF} /* 21FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_page24[256]={
+ {0x2400,0x2400},{0x2401,0x2401}, /* 2400 */
+ {0x2402,0x2402},{0x2403,0x2403}, /* 2402 */
+ {0x2404,0x2404},{0x2405,0x2405}, /* 2404 */
+ {0x2406,0x2406},{0x2407,0x2407}, /* 2406 */
+ {0x2408,0x2408},{0x2409,0x2409}, /* 2408 */
+ {0x240A,0x240A},{0x240B,0x240B}, /* 240A */
+ {0x240C,0x240C},{0x240D,0x240D}, /* 240C */
+ {0x240E,0x240E},{0x240F,0x240F}, /* 240E */
+ {0x2410,0x2410},{0x2411,0x2411}, /* 2410 */
+ {0x2412,0x2412},{0x2413,0x2413}, /* 2412 */
+ {0x2414,0x2414},{0x2415,0x2415}, /* 2414 */
+ {0x2416,0x2416},{0x2417,0x2417}, /* 2416 */
+ {0x2418,0x2418},{0x2419,0x2419}, /* 2418 */
+ {0x241A,0x241A},{0x241B,0x241B}, /* 241A */
+ {0x241C,0x241C},{0x241D,0x241D}, /* 241C */
+ {0x241E,0x241E},{0x241F,0x241F}, /* 241E */
+ {0x2420,0x2420},{0x2421,0x2421}, /* 2420 */
+ {0x2422,0x2422},{0x2423,0x2423}, /* 2422 */
+ {0x2424,0x2424},{0x2425,0x2425}, /* 2424 */
+ {0x2426,0x2426},{0x2427,0x2427}, /* 2426 */
+ {0x2428,0x2428},{0x2429,0x2429}, /* 2428 */
+ {0x242A,0x242A},{0x242B,0x242B}, /* 242A */
+ {0x242C,0x242C},{0x242D,0x242D}, /* 242C */
+ {0x242E,0x242E},{0x242F,0x242F}, /* 242E */
+ {0x2430,0x2430},{0x2431,0x2431}, /* 2430 */
+ {0x2432,0x2432},{0x2433,0x2433}, /* 2432 */
+ {0x2434,0x2434},{0x2435,0x2435}, /* 2434 */
+ {0x2436,0x2436},{0x2437,0x2437}, /* 2436 */
+ {0x2438,0x2438},{0x2439,0x2439}, /* 2438 */
+ {0x243A,0x243A},{0x243B,0x243B}, /* 243A */
+ {0x243C,0x243C},{0x243D,0x243D}, /* 243C */
+ {0x243E,0x243E},{0x243F,0x243F}, /* 243E */
+ {0x2440,0x2440},{0x2441,0x2441}, /* 2440 */
+ {0x2442,0x2442},{0x2443,0x2443}, /* 2442 */
+ {0x2444,0x2444},{0x2445,0x2445}, /* 2444 */
+ {0x2446,0x2446},{0x2447,0x2447}, /* 2446 */
+ {0x2448,0x2448},{0x2449,0x2449}, /* 2448 */
+ {0x244A,0x244A},{0x244B,0x244B}, /* 244A */
+ {0x244C,0x244C},{0x244D,0x244D}, /* 244C */
+ {0x244E,0x244E},{0x244F,0x244F}, /* 244E */
+ {0x2450,0x2450},{0x2451,0x2451}, /* 2450 */
+ {0x2452,0x2452},{0x2453,0x2453}, /* 2452 */
+ {0x2454,0x2454},{0x2455,0x2455}, /* 2454 */
+ {0x2456,0x2456},{0x2457,0x2457}, /* 2456 */
+ {0x2458,0x2458},{0x2459,0x2459}, /* 2458 */
+ {0x245A,0x245A},{0x245B,0x245B}, /* 245A */
+ {0x245C,0x245C},{0x245D,0x245D}, /* 245C */
+ {0x245E,0x245E},{0x245F,0x245F}, /* 245E */
+ {0x2460,0x2460},{0x2461,0x2461}, /* 2460 */
+ {0x2462,0x2462},{0x2463,0x2463}, /* 2462 */
+ {0x2464,0x2464},{0x2465,0x2465}, /* 2464 */
+ {0x2466,0x2466},{0x2467,0x2467}, /* 2466 */
+ {0x2468,0x2468},{0x2469,0x2469}, /* 2468 */
+ {0x246A,0x246A},{0x246B,0x246B}, /* 246A */
+ {0x246C,0x246C},{0x246D,0x246D}, /* 246C */
+ {0x246E,0x246E},{0x246F,0x246F}, /* 246E */
+ {0x2470,0x2470},{0x2471,0x2471}, /* 2470 */
+ {0x2472,0x2472},{0x2473,0x2473}, /* 2472 */
+ {0x2474,0x2474},{0x2475,0x2475}, /* 2474 */
+ {0x2476,0x2476},{0x2477,0x2477}, /* 2476 */
+ {0x2478,0x2478},{0x2479,0x2479}, /* 2478 */
+ {0x247A,0x247A},{0x247B,0x247B}, /* 247A */
+ {0x247C,0x247C},{0x247D,0x247D}, /* 247C */
+ {0x247E,0x247E},{0x247F,0x247F}, /* 247E */
+ {0x2480,0x2480},{0x2481,0x2481}, /* 2480 */
+ {0x2482,0x2482},{0x2483,0x2483}, /* 2482 */
+ {0x2484,0x2484},{0x2485,0x2485}, /* 2484 */
+ {0x2486,0x2486},{0x2487,0x2487}, /* 2486 */
+ {0x2488,0x2488},{0x2489,0x2489}, /* 2488 */
+ {0x248A,0x248A},{0x248B,0x248B}, /* 248A */
+ {0x248C,0x248C},{0x248D,0x248D}, /* 248C */
+ {0x248E,0x248E},{0x248F,0x248F}, /* 248E */
+ {0x2490,0x2490},{0x2491,0x2491}, /* 2490 */
+ {0x2492,0x2492},{0x2493,0x2493}, /* 2492 */
+ {0x2494,0x2494},{0x2495,0x2495}, /* 2494 */
+ {0x2496,0x2496},{0x2497,0x2497}, /* 2496 */
+ {0x2498,0x2498},{0x2499,0x2499}, /* 2498 */
+ {0x249A,0x249A},{0x249B,0x249B}, /* 249A */
+ {0x249C,0x249C},{0x249D,0x249D}, /* 249C */
+ {0x249E,0x249E},{0x249F,0x249F}, /* 249E */
+ {0x24A0,0x24A0},{0x24A1,0x24A1}, /* 24A0 */
+ {0x24A2,0x24A2},{0x24A3,0x24A3}, /* 24A2 */
+ {0x24A4,0x24A4},{0x24A5,0x24A5}, /* 24A4 */
+ {0x24A6,0x24A6},{0x24A7,0x24A7}, /* 24A6 */
+ {0x24A8,0x24A8},{0x24A9,0x24A9}, /* 24A8 */
+ {0x24AA,0x24AA},{0x24AB,0x24AB}, /* 24AA */
+ {0x24AC,0x24AC},{0x24AD,0x24AD}, /* 24AC */
+ {0x24AE,0x24AE},{0x24AF,0x24AF}, /* 24AE */
+ {0x24B0,0x24B0},{0x24B1,0x24B1}, /* 24B0 */
+ {0x24B2,0x24B2},{0x24B3,0x24B3}, /* 24B2 */
+ {0x24B4,0x24B4},{0x24B5,0x24B5}, /* 24B4 */
+ {0x24B6,0x24D0},{0x24B7,0x24D1}, /* 24B6 */
+ {0x24B8,0x24D2},{0x24B9,0x24D3}, /* 24B8 */
+ {0x24BA,0x24D4},{0x24BB,0x24D5}, /* 24BA */
+ {0x24BC,0x24D6},{0x24BD,0x24D7}, /* 24BC */
+ {0x24BE,0x24D8},{0x24BF,0x24D9}, /* 24BE */
+ {0x24C0,0x24DA},{0x24C1,0x24DB}, /* 24C0 */
+ {0x24C2,0x24DC},{0x24C3,0x24DD}, /* 24C2 */
+ {0x24C4,0x24DE},{0x24C5,0x24DF}, /* 24C4 */
+ {0x24C6,0x24E0},{0x24C7,0x24E1}, /* 24C6 */
+ {0x24C8,0x24E2},{0x24C9,0x24E3}, /* 24C8 */
+ {0x24CA,0x24E4},{0x24CB,0x24E5}, /* 24CA */
+ {0x24CC,0x24E6},{0x24CD,0x24E7}, /* 24CC */
+ {0x24CE,0x24E8},{0x24CF,0x24E9}, /* 24CE */
+ {0x24B6,0x24D0},{0x24B7,0x24D1}, /* 24D0 */
+ {0x24B8,0x24D2},{0x24B9,0x24D3}, /* 24D2 */
+ {0x24BA,0x24D4},{0x24BB,0x24D5}, /* 24D4 */
+ {0x24BC,0x24D6},{0x24BD,0x24D7}, /* 24D6 */
+ {0x24BE,0x24D8},{0x24BF,0x24D9}, /* 24D8 */
+ {0x24C0,0x24DA},{0x24C1,0x24DB}, /* 24DA */
+ {0x24C2,0x24DC},{0x24C3,0x24DD}, /* 24DC */
+ {0x24C4,0x24DE},{0x24C5,0x24DF}, /* 24DE */
+ {0x24C6,0x24E0},{0x24C7,0x24E1}, /* 24E0 */
+ {0x24C8,0x24E2},{0x24C9,0x24E3}, /* 24E2 */
+ {0x24CA,0x24E4},{0x24CB,0x24E5}, /* 24E4 */
+ {0x24CC,0x24E6},{0x24CD,0x24E7}, /* 24E6 */
+ {0x24CE,0x24E8},{0x24CF,0x24E9}, /* 24E8 */
+ {0x24EA,0x24EA},{0x24EB,0x24EB}, /* 24EA */
+ {0x24EC,0x24EC},{0x24ED,0x24ED}, /* 24EC */
+ {0x24EE,0x24EE},{0x24EF,0x24EF}, /* 24EE */
+ {0x24F0,0x24F0},{0x24F1,0x24F1}, /* 24F0 */
+ {0x24F2,0x24F2},{0x24F3,0x24F3}, /* 24F2 */
+ {0x24F4,0x24F4},{0x24F5,0x24F5}, /* 24F4 */
+ {0x24F6,0x24F6},{0x24F7,0x24F7}, /* 24F6 */
+ {0x24F8,0x24F8},{0x24F9,0x24F9}, /* 24F8 */
+ {0x24FA,0x24FA},{0x24FB,0x24FB}, /* 24FA */
+ {0x24FC,0x24FC},{0x24FD,0x24FD}, /* 24FC */
+ {0x24FE,0x24FE},{0x24FF,0x24FF} /* 24FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_page2C[256]={
+ {0x2C00,0x2C30},{0x2C01,0x2C31}, /* 2C00 */
+ {0x2C02,0x2C32},{0x2C03,0x2C33}, /* 2C02 */
+ {0x2C04,0x2C34},{0x2C05,0x2C35}, /* 2C04 */
+ {0x2C06,0x2C36},{0x2C07,0x2C37}, /* 2C06 */
+ {0x2C08,0x2C38},{0x2C09,0x2C39}, /* 2C08 */
+ {0x2C0A,0x2C3A},{0x2C0B,0x2C3B}, /* 2C0A */
+ {0x2C0C,0x2C3C},{0x2C0D,0x2C3D}, /* 2C0C */
+ {0x2C0E,0x2C3E},{0x2C0F,0x2C3F}, /* 2C0E */
+ {0x2C10,0x2C40},{0x2C11,0x2C41}, /* 2C10 */
+ {0x2C12,0x2C42},{0x2C13,0x2C43}, /* 2C12 */
+ {0x2C14,0x2C44},{0x2C15,0x2C45}, /* 2C14 */
+ {0x2C16,0x2C46},{0x2C17,0x2C47}, /* 2C16 */
+ {0x2C18,0x2C48},{0x2C19,0x2C49}, /* 2C18 */
+ {0x2C1A,0x2C4A},{0x2C1B,0x2C4B}, /* 2C1A */
+ {0x2C1C,0x2C4C},{0x2C1D,0x2C4D}, /* 2C1C */
+ {0x2C1E,0x2C4E},{0x2C1F,0x2C4F}, /* 2C1E */
+ {0x2C20,0x2C50},{0x2C21,0x2C51}, /* 2C20 */
+ {0x2C22,0x2C52},{0x2C23,0x2C53}, /* 2C22 */
+ {0x2C24,0x2C54},{0x2C25,0x2C55}, /* 2C24 */
+ {0x2C26,0x2C56},{0x2C27,0x2C57}, /* 2C26 */
+ {0x2C28,0x2C58},{0x2C29,0x2C59}, /* 2C28 */
+ {0x2C2A,0x2C5A},{0x2C2B,0x2C5B}, /* 2C2A */
+ {0x2C2C,0x2C5C},{0x2C2D,0x2C5D}, /* 2C2C */
+ {0x2C2E,0x2C5E},{0x2C2F,0x2C2F}, /* 2C2E */
+ {0x2C00,0x2C30},{0x2C01,0x2C31}, /* 2C30 */
+ {0x2C02,0x2C32},{0x2C03,0x2C33}, /* 2C32 */
+ {0x2C04,0x2C34},{0x2C05,0x2C35}, /* 2C34 */
+ {0x2C06,0x2C36},{0x2C07,0x2C37}, /* 2C36 */
+ {0x2C08,0x2C38},{0x2C09,0x2C39}, /* 2C38 */
+ {0x2C0A,0x2C3A},{0x2C0B,0x2C3B}, /* 2C3A */
+ {0x2C0C,0x2C3C},{0x2C0D,0x2C3D}, /* 2C3C */
+ {0x2C0E,0x2C3E},{0x2C0F,0x2C3F}, /* 2C3E */
+ {0x2C10,0x2C40},{0x2C11,0x2C41}, /* 2C40 */
+ {0x2C12,0x2C42},{0x2C13,0x2C43}, /* 2C42 */
+ {0x2C14,0x2C44},{0x2C15,0x2C45}, /* 2C44 */
+ {0x2C16,0x2C46},{0x2C17,0x2C47}, /* 2C46 */
+ {0x2C18,0x2C48},{0x2C19,0x2C49}, /* 2C48 */
+ {0x2C1A,0x2C4A},{0x2C1B,0x2C4B}, /* 2C4A */
+ {0x2C1C,0x2C4C},{0x2C1D,0x2C4D}, /* 2C4C */
+ {0x2C1E,0x2C4E},{0x2C1F,0x2C4F}, /* 2C4E */
+ {0x2C20,0x2C50},{0x2C21,0x2C51}, /* 2C50 */
+ {0x2C22,0x2C52},{0x2C23,0x2C53}, /* 2C52 */
+ {0x2C24,0x2C54},{0x2C25,0x2C55}, /* 2C54 */
+ {0x2C26,0x2C56},{0x2C27,0x2C57}, /* 2C56 */
+ {0x2C28,0x2C58},{0x2C29,0x2C59}, /* 2C58 */
+ {0x2C2A,0x2C5A},{0x2C2B,0x2C5B}, /* 2C5A */
+ {0x2C2C,0x2C5C},{0x2C2D,0x2C5D}, /* 2C5C */
+ {0x2C2E,0x2C5E},{0x2C5F,0x2C5F}, /* 2C5E */
+ {0x2C60,0x2C61},{0x2C60,0x2C61}, /* 2C60 */
+ {0x2C62,0x026B},{0x2C63,0x1D7D}, /* 2C62 */
+ {0x2C64,0x027D},{0x023A,0x2C65}, /* 2C64 */
+ {0x023E,0x2C66},{0x2C67,0x2C68}, /* 2C66 */
+ {0x2C67,0x2C68},{0x2C69,0x2C6A}, /* 2C68 */
+ {0x2C69,0x2C6A},{0x2C6B,0x2C6C}, /* 2C6A */
+ {0x2C6B,0x2C6C},{0x2C6D,0x0251}, /* 2C6C */
+ {0x2C6E,0x0271},{0x2C6F,0x0250}, /* 2C6E */
+ {0x2C70,0x0252},{0x2C71,0x2C71}, /* 2C70 */
+ {0x2C72,0x2C73},{0x2C72,0x2C73}, /* 2C72 */
+ {0x2C74,0x2C74},{0x2C75,0x2C76}, /* 2C74 */
+ {0x2C75,0x2C76},{0x2C77,0x2C77}, /* 2C76 */
+ {0x2C78,0x2C78},{0x2C79,0x2C79}, /* 2C78 */
+ {0x2C7A,0x2C7A},{0x2C7B,0x2C7B}, /* 2C7A */
+ {0x2C7C,0x2C7C},{0x2C7D,0x2C7D}, /* 2C7C */
+ {0x2C7E,0x023F},{0x2C7F,0x0240}, /* 2C7E */
+ {0x2C80,0x2C81},{0x2C80,0x2C81}, /* 2C80 */
+ {0x2C82,0x2C83},{0x2C82,0x2C83}, /* 2C82 */
+ {0x2C84,0x2C85},{0x2C84,0x2C85}, /* 2C84 */
+ {0x2C86,0x2C87},{0x2C86,0x2C87}, /* 2C86 */
+ {0x2C88,0x2C89},{0x2C88,0x2C89}, /* 2C88 */
+ {0x2C8A,0x2C8B},{0x2C8A,0x2C8B}, /* 2C8A */
+ {0x2C8C,0x2C8D},{0x2C8C,0x2C8D}, /* 2C8C */
+ {0x2C8E,0x2C8F},{0x2C8E,0x2C8F}, /* 2C8E */
+ {0x2C90,0x2C91},{0x2C90,0x2C91}, /* 2C90 */
+ {0x2C92,0x2C93},{0x2C92,0x2C93}, /* 2C92 */
+ {0x2C94,0x2C95},{0x2C94,0x2C95}, /* 2C94 */
+ {0x2C96,0x2C97},{0x2C96,0x2C97}, /* 2C96 */
+ {0x2C98,0x2C99},{0x2C98,0x2C99}, /* 2C98 */
+ {0x2C9A,0x2C9B},{0x2C9A,0x2C9B}, /* 2C9A */
+ {0x2C9C,0x2C9D},{0x2C9C,0x2C9D}, /* 2C9C */
+ {0x2C9E,0x2C9F},{0x2C9E,0x2C9F}, /* 2C9E */
+ {0x2CA0,0x2CA1},{0x2CA0,0x2CA1}, /* 2CA0 */
+ {0x2CA2,0x2CA3},{0x2CA2,0x2CA3}, /* 2CA2 */
+ {0x2CA4,0x2CA5},{0x2CA4,0x2CA5}, /* 2CA4 */
+ {0x2CA6,0x2CA7},{0x2CA6,0x2CA7}, /* 2CA6 */
+ {0x2CA8,0x2CA9},{0x2CA8,0x2CA9}, /* 2CA8 */
+ {0x2CAA,0x2CAB},{0x2CAA,0x2CAB}, /* 2CAA */
+ {0x2CAC,0x2CAD},{0x2CAC,0x2CAD}, /* 2CAC */
+ {0x2CAE,0x2CAF},{0x2CAE,0x2CAF}, /* 2CAE */
+ {0x2CB0,0x2CB1},{0x2CB0,0x2CB1}, /* 2CB0 */
+ {0x2CB2,0x2CB3},{0x2CB2,0x2CB3}, /* 2CB2 */
+ {0x2CB4,0x2CB5},{0x2CB4,0x2CB5}, /* 2CB4 */
+ {0x2CB6,0x2CB7},{0x2CB6,0x2CB7}, /* 2CB6 */
+ {0x2CB8,0x2CB9},{0x2CB8,0x2CB9}, /* 2CB8 */
+ {0x2CBA,0x2CBB},{0x2CBA,0x2CBB}, /* 2CBA */
+ {0x2CBC,0x2CBD},{0x2CBC,0x2CBD}, /* 2CBC */
+ {0x2CBE,0x2CBF},{0x2CBE,0x2CBF}, /* 2CBE */
+ {0x2CC0,0x2CC1},{0x2CC0,0x2CC1}, /* 2CC0 */
+ {0x2CC2,0x2CC3},{0x2CC2,0x2CC3}, /* 2CC2 */
+ {0x2CC4,0x2CC5},{0x2CC4,0x2CC5}, /* 2CC4 */
+ {0x2CC6,0x2CC7},{0x2CC6,0x2CC7}, /* 2CC6 */
+ {0x2CC8,0x2CC9},{0x2CC8,0x2CC9}, /* 2CC8 */
+ {0x2CCA,0x2CCB},{0x2CCA,0x2CCB}, /* 2CCA */
+ {0x2CCC,0x2CCD},{0x2CCC,0x2CCD}, /* 2CCC */
+ {0x2CCE,0x2CCF},{0x2CCE,0x2CCF}, /* 2CCE */
+ {0x2CD0,0x2CD1},{0x2CD0,0x2CD1}, /* 2CD0 */
+ {0x2CD2,0x2CD3},{0x2CD2,0x2CD3}, /* 2CD2 */
+ {0x2CD4,0x2CD5},{0x2CD4,0x2CD5}, /* 2CD4 */
+ {0x2CD6,0x2CD7},{0x2CD6,0x2CD7}, /* 2CD6 */
+ {0x2CD8,0x2CD9},{0x2CD8,0x2CD9}, /* 2CD8 */
+ {0x2CDA,0x2CDB},{0x2CDA,0x2CDB}, /* 2CDA */
+ {0x2CDC,0x2CDD},{0x2CDC,0x2CDD}, /* 2CDC */
+ {0x2CDE,0x2CDF},{0x2CDE,0x2CDF}, /* 2CDE */
+ {0x2CE0,0x2CE1},{0x2CE0,0x2CE1}, /* 2CE0 */
+ {0x2CE2,0x2CE3},{0x2CE2,0x2CE3}, /* 2CE2 */
+ {0x2CE4,0x2CE4},{0x2CE5,0x2CE5}, /* 2CE4 */
+ {0x2CE6,0x2CE6},{0x2CE7,0x2CE7}, /* 2CE6 */
+ {0x2CE8,0x2CE8},{0x2CE9,0x2CE9}, /* 2CE8 */
+ {0x2CEA,0x2CEA},{0x2CEB,0x2CEC}, /* 2CEA */
+ {0x2CEB,0x2CEC},{0x2CED,0x2CEE}, /* 2CEC */
+ {0x2CED,0x2CEE},{0x2CEF,0x2CEF}, /* 2CEE */
+ {0x2CF0,0x2CF0},{0x2CF1,0x2CF1}, /* 2CF0 */
+ {0x2CF2,0x2CF2},{0x2CF3,0x2CF3}, /* 2CF2 */
+ {0x2CF4,0x2CF4},{0x2CF5,0x2CF5}, /* 2CF4 */
+ {0x2CF6,0x2CF6},{0x2CF7,0x2CF7}, /* 2CF6 */
+ {0x2CF8,0x2CF8},{0x2CF9,0x2CF9}, /* 2CF8 */
+ {0x2CFA,0x2CFA},{0x2CFB,0x2CFB}, /* 2CFA */
+ {0x2CFC,0x2CFC},{0x2CFD,0x2CFD}, /* 2CFC */
+ {0x2CFE,0x2CFE},{0x2CFF,0x2CFF} /* 2CFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_page2D[256]={
+ {0x10A0,0x2D00},{0x10A1,0x2D01}, /* 2D00 */
+ {0x10A2,0x2D02},{0x10A3,0x2D03}, /* 2D02 */
+ {0x10A4,0x2D04},{0x10A5,0x2D05}, /* 2D04 */
+ {0x10A6,0x2D06},{0x10A7,0x2D07}, /* 2D06 */
+ {0x10A8,0x2D08},{0x10A9,0x2D09}, /* 2D08 */
+ {0x10AA,0x2D0A},{0x10AB,0x2D0B}, /* 2D0A */
+ {0x10AC,0x2D0C},{0x10AD,0x2D0D}, /* 2D0C */
+ {0x10AE,0x2D0E},{0x10AF,0x2D0F}, /* 2D0E */
+ {0x10B0,0x2D10},{0x10B1,0x2D11}, /* 2D10 */
+ {0x10B2,0x2D12},{0x10B3,0x2D13}, /* 2D12 */
+ {0x10B4,0x2D14},{0x10B5,0x2D15}, /* 2D14 */
+ {0x10B6,0x2D16},{0x10B7,0x2D17}, /* 2D16 */
+ {0x10B8,0x2D18},{0x10B9,0x2D19}, /* 2D18 */
+ {0x10BA,0x2D1A},{0x10BB,0x2D1B}, /* 2D1A */
+ {0x10BC,0x2D1C},{0x10BD,0x2D1D}, /* 2D1C */
+ {0x10BE,0x2D1E},{0x10BF,0x2D1F}, /* 2D1E */
+ {0x10C0,0x2D20},{0x10C1,0x2D21}, /* 2D20 */
+ {0x10C2,0x2D22},{0x10C3,0x2D23}, /* 2D22 */
+ {0x10C4,0x2D24},{0x10C5,0x2D25}, /* 2D24 */
+ {0x2D26,0x2D26},{0x2D27,0x2D27}, /* 2D26 */
+ {0x2D28,0x2D28},{0x2D29,0x2D29}, /* 2D28 */
+ {0x2D2A,0x2D2A},{0x2D2B,0x2D2B}, /* 2D2A */
+ {0x2D2C,0x2D2C},{0x2D2D,0x2D2D}, /* 2D2C */
+ {0x2D2E,0x2D2E},{0x2D2F,0x2D2F}, /* 2D2E */
+ {0x2D30,0x2D30},{0x2D31,0x2D31}, /* 2D30 */
+ {0x2D32,0x2D32},{0x2D33,0x2D33}, /* 2D32 */
+ {0x2D34,0x2D34},{0x2D35,0x2D35}, /* 2D34 */
+ {0x2D36,0x2D36},{0x2D37,0x2D37}, /* 2D36 */
+ {0x2D38,0x2D38},{0x2D39,0x2D39}, /* 2D38 */
+ {0x2D3A,0x2D3A},{0x2D3B,0x2D3B}, /* 2D3A */
+ {0x2D3C,0x2D3C},{0x2D3D,0x2D3D}, /* 2D3C */
+ {0x2D3E,0x2D3E},{0x2D3F,0x2D3F}, /* 2D3E */
+ {0x2D40,0x2D40},{0x2D41,0x2D41}, /* 2D40 */
+ {0x2D42,0x2D42},{0x2D43,0x2D43}, /* 2D42 */
+ {0x2D44,0x2D44},{0x2D45,0x2D45}, /* 2D44 */
+ {0x2D46,0x2D46},{0x2D47,0x2D47}, /* 2D46 */
+ {0x2D48,0x2D48},{0x2D49,0x2D49}, /* 2D48 */
+ {0x2D4A,0x2D4A},{0x2D4B,0x2D4B}, /* 2D4A */
+ {0x2D4C,0x2D4C},{0x2D4D,0x2D4D}, /* 2D4C */
+ {0x2D4E,0x2D4E},{0x2D4F,0x2D4F}, /* 2D4E */
+ {0x2D50,0x2D50},{0x2D51,0x2D51}, /* 2D50 */
+ {0x2D52,0x2D52},{0x2D53,0x2D53}, /* 2D52 */
+ {0x2D54,0x2D54},{0x2D55,0x2D55}, /* 2D54 */
+ {0x2D56,0x2D56},{0x2D57,0x2D57}, /* 2D56 */
+ {0x2D58,0x2D58},{0x2D59,0x2D59}, /* 2D58 */
+ {0x2D5A,0x2D5A},{0x2D5B,0x2D5B}, /* 2D5A */
+ {0x2D5C,0x2D5C},{0x2D5D,0x2D5D}, /* 2D5C */
+ {0x2D5E,0x2D5E},{0x2D5F,0x2D5F}, /* 2D5E */
+ {0x2D60,0x2D60},{0x2D61,0x2D61}, /* 2D60 */
+ {0x2D62,0x2D62},{0x2D63,0x2D63}, /* 2D62 */
+ {0x2D64,0x2D64},{0x2D65,0x2D65}, /* 2D64 */
+ {0x2D66,0x2D66},{0x2D67,0x2D67}, /* 2D66 */
+ {0x2D68,0x2D68},{0x2D69,0x2D69}, /* 2D68 */
+ {0x2D6A,0x2D6A},{0x2D6B,0x2D6B}, /* 2D6A */
+ {0x2D6C,0x2D6C},{0x2D6D,0x2D6D}, /* 2D6C */
+ {0x2D6E,0x2D6E},{0x2D6F,0x2D6F}, /* 2D6E */
+ {0x2D70,0x2D70},{0x2D71,0x2D71}, /* 2D70 */
+ {0x2D72,0x2D72},{0x2D73,0x2D73}, /* 2D72 */
+ {0x2D74,0x2D74},{0x2D75,0x2D75}, /* 2D74 */
+ {0x2D76,0x2D76},{0x2D77,0x2D77}, /* 2D76 */
+ {0x2D78,0x2D78},{0x2D79,0x2D79}, /* 2D78 */
+ {0x2D7A,0x2D7A},{0x2D7B,0x2D7B}, /* 2D7A */
+ {0x2D7C,0x2D7C},{0x2D7D,0x2D7D}, /* 2D7C */
+ {0x2D7E,0x2D7E},{0x2D7F,0x2D7F}, /* 2D7E */
+ {0x2D80,0x2D80},{0x2D81,0x2D81}, /* 2D80 */
+ {0x2D82,0x2D82},{0x2D83,0x2D83}, /* 2D82 */
+ {0x2D84,0x2D84},{0x2D85,0x2D85}, /* 2D84 */
+ {0x2D86,0x2D86},{0x2D87,0x2D87}, /* 2D86 */
+ {0x2D88,0x2D88},{0x2D89,0x2D89}, /* 2D88 */
+ {0x2D8A,0x2D8A},{0x2D8B,0x2D8B}, /* 2D8A */
+ {0x2D8C,0x2D8C},{0x2D8D,0x2D8D}, /* 2D8C */
+ {0x2D8E,0x2D8E},{0x2D8F,0x2D8F}, /* 2D8E */
+ {0x2D90,0x2D90},{0x2D91,0x2D91}, /* 2D90 */
+ {0x2D92,0x2D92},{0x2D93,0x2D93}, /* 2D92 */
+ {0x2D94,0x2D94},{0x2D95,0x2D95}, /* 2D94 */
+ {0x2D96,0x2D96},{0x2D97,0x2D97}, /* 2D96 */
+ {0x2D98,0x2D98},{0x2D99,0x2D99}, /* 2D98 */
+ {0x2D9A,0x2D9A},{0x2D9B,0x2D9B}, /* 2D9A */
+ {0x2D9C,0x2D9C},{0x2D9D,0x2D9D}, /* 2D9C */
+ {0x2D9E,0x2D9E},{0x2D9F,0x2D9F}, /* 2D9E */
+ {0x2DA0,0x2DA0},{0x2DA1,0x2DA1}, /* 2DA0 */
+ {0x2DA2,0x2DA2},{0x2DA3,0x2DA3}, /* 2DA2 */
+ {0x2DA4,0x2DA4},{0x2DA5,0x2DA5}, /* 2DA4 */
+ {0x2DA6,0x2DA6},{0x2DA7,0x2DA7}, /* 2DA6 */
+ {0x2DA8,0x2DA8},{0x2DA9,0x2DA9}, /* 2DA8 */
+ {0x2DAA,0x2DAA},{0x2DAB,0x2DAB}, /* 2DAA */
+ {0x2DAC,0x2DAC},{0x2DAD,0x2DAD}, /* 2DAC */
+ {0x2DAE,0x2DAE},{0x2DAF,0x2DAF}, /* 2DAE */
+ {0x2DB0,0x2DB0},{0x2DB1,0x2DB1}, /* 2DB0 */
+ {0x2DB2,0x2DB2},{0x2DB3,0x2DB3}, /* 2DB2 */
+ {0x2DB4,0x2DB4},{0x2DB5,0x2DB5}, /* 2DB4 */
+ {0x2DB6,0x2DB6},{0x2DB7,0x2DB7}, /* 2DB6 */
+ {0x2DB8,0x2DB8},{0x2DB9,0x2DB9}, /* 2DB8 */
+ {0x2DBA,0x2DBA},{0x2DBB,0x2DBB}, /* 2DBA */
+ {0x2DBC,0x2DBC},{0x2DBD,0x2DBD}, /* 2DBC */
+ {0x2DBE,0x2DBE},{0x2DBF,0x2DBF}, /* 2DBE */
+ {0x2DC0,0x2DC0},{0x2DC1,0x2DC1}, /* 2DC0 */
+ {0x2DC2,0x2DC2},{0x2DC3,0x2DC3}, /* 2DC2 */
+ {0x2DC4,0x2DC4},{0x2DC5,0x2DC5}, /* 2DC4 */
+ {0x2DC6,0x2DC6},{0x2DC7,0x2DC7}, /* 2DC6 */
+ {0x2DC8,0x2DC8},{0x2DC9,0x2DC9}, /* 2DC8 */
+ {0x2DCA,0x2DCA},{0x2DCB,0x2DCB}, /* 2DCA */
+ {0x2DCC,0x2DCC},{0x2DCD,0x2DCD}, /* 2DCC */
+ {0x2DCE,0x2DCE},{0x2DCF,0x2DCF}, /* 2DCE */
+ {0x2DD0,0x2DD0},{0x2DD1,0x2DD1}, /* 2DD0 */
+ {0x2DD2,0x2DD2},{0x2DD3,0x2DD3}, /* 2DD2 */
+ {0x2DD4,0x2DD4},{0x2DD5,0x2DD5}, /* 2DD4 */
+ {0x2DD6,0x2DD6},{0x2DD7,0x2DD7}, /* 2DD6 */
+ {0x2DD8,0x2DD8},{0x2DD9,0x2DD9}, /* 2DD8 */
+ {0x2DDA,0x2DDA},{0x2DDB,0x2DDB}, /* 2DDA */
+ {0x2DDC,0x2DDC},{0x2DDD,0x2DDD}, /* 2DDC */
+ {0x2DDE,0x2DDE},{0x2DDF,0x2DDF}, /* 2DDE */
+ {0x2DE0,0x2DE0},{0x2DE1,0x2DE1}, /* 2DE0 */
+ {0x2DE2,0x2DE2},{0x2DE3,0x2DE3}, /* 2DE2 */
+ {0x2DE4,0x2DE4},{0x2DE5,0x2DE5}, /* 2DE4 */
+ {0x2DE6,0x2DE6},{0x2DE7,0x2DE7}, /* 2DE6 */
+ {0x2DE8,0x2DE8},{0x2DE9,0x2DE9}, /* 2DE8 */
+ {0x2DEA,0x2DEA},{0x2DEB,0x2DEB}, /* 2DEA */
+ {0x2DEC,0x2DEC},{0x2DED,0x2DED}, /* 2DEC */
+ {0x2DEE,0x2DEE},{0x2DEF,0x2DEF}, /* 2DEE */
+ {0x2DF0,0x2DF0},{0x2DF1,0x2DF1}, /* 2DF0 */
+ {0x2DF2,0x2DF2},{0x2DF3,0x2DF3}, /* 2DF2 */
+ {0x2DF4,0x2DF4},{0x2DF5,0x2DF5}, /* 2DF4 */
+ {0x2DF6,0x2DF6},{0x2DF7,0x2DF7}, /* 2DF6 */
+ {0x2DF8,0x2DF8},{0x2DF9,0x2DF9}, /* 2DF8 */
+ {0x2DFA,0x2DFA},{0x2DFB,0x2DFB}, /* 2DFA */
+ {0x2DFC,0x2DFC},{0x2DFD,0x2DFD}, /* 2DFC */
+ {0x2DFE,0x2DFE},{0x2DFF,0x2DFF} /* 2DFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_pageA6[256]={
+ {0xA600,0xA600},{0xA601,0xA601}, /* A600 */
+ {0xA602,0xA602},{0xA603,0xA603}, /* A602 */
+ {0xA604,0xA604},{0xA605,0xA605}, /* A604 */
+ {0xA606,0xA606},{0xA607,0xA607}, /* A606 */
+ {0xA608,0xA608},{0xA609,0xA609}, /* A608 */
+ {0xA60A,0xA60A},{0xA60B,0xA60B}, /* A60A */
+ {0xA60C,0xA60C},{0xA60D,0xA60D}, /* A60C */
+ {0xA60E,0xA60E},{0xA60F,0xA60F}, /* A60E */
+ {0xA610,0xA610},{0xA611,0xA611}, /* A610 */
+ {0xA612,0xA612},{0xA613,0xA613}, /* A612 */
+ {0xA614,0xA614},{0xA615,0xA615}, /* A614 */
+ {0xA616,0xA616},{0xA617,0xA617}, /* A616 */
+ {0xA618,0xA618},{0xA619,0xA619}, /* A618 */
+ {0xA61A,0xA61A},{0xA61B,0xA61B}, /* A61A */
+ {0xA61C,0xA61C},{0xA61D,0xA61D}, /* A61C */
+ {0xA61E,0xA61E},{0xA61F,0xA61F}, /* A61E */
+ {0xA620,0xA620},{0xA621,0xA621}, /* A620 */
+ {0xA622,0xA622},{0xA623,0xA623}, /* A622 */
+ {0xA624,0xA624},{0xA625,0xA625}, /* A624 */
+ {0xA626,0xA626},{0xA627,0xA627}, /* A626 */
+ {0xA628,0xA628},{0xA629,0xA629}, /* A628 */
+ {0xA62A,0xA62A},{0xA62B,0xA62B}, /* A62A */
+ {0xA62C,0xA62C},{0xA62D,0xA62D}, /* A62C */
+ {0xA62E,0xA62E},{0xA62F,0xA62F}, /* A62E */
+ {0xA630,0xA630},{0xA631,0xA631}, /* A630 */
+ {0xA632,0xA632},{0xA633,0xA633}, /* A632 */
+ {0xA634,0xA634},{0xA635,0xA635}, /* A634 */
+ {0xA636,0xA636},{0xA637,0xA637}, /* A636 */
+ {0xA638,0xA638},{0xA639,0xA639}, /* A638 */
+ {0xA63A,0xA63A},{0xA63B,0xA63B}, /* A63A */
+ {0xA63C,0xA63C},{0xA63D,0xA63D}, /* A63C */
+ {0xA63E,0xA63E},{0xA63F,0xA63F}, /* A63E */
+ {0xA640,0xA641},{0xA640,0xA641}, /* A640 */
+ {0xA642,0xA643},{0xA642,0xA643}, /* A642 */
+ {0xA644,0xA645},{0xA644,0xA645}, /* A644 */
+ {0xA646,0xA647},{0xA646,0xA647}, /* A646 */
+ {0xA648,0xA649},{0xA648,0xA649}, /* A648 */
+ {0xA64A,0xA64B},{0xA64A,0xA64B}, /* A64A */
+ {0xA64C,0xA64D},{0xA64C,0xA64D}, /* A64C */
+ {0xA64E,0xA64F},{0xA64E,0xA64F}, /* A64E */
+ {0xA650,0xA651},{0xA650,0xA651}, /* A650 */
+ {0xA652,0xA653},{0xA652,0xA653}, /* A652 */
+ {0xA654,0xA655},{0xA654,0xA655}, /* A654 */
+ {0xA656,0xA657},{0xA656,0xA657}, /* A656 */
+ {0xA658,0xA659},{0xA658,0xA659}, /* A658 */
+ {0xA65A,0xA65B},{0xA65A,0xA65B}, /* A65A */
+ {0xA65C,0xA65D},{0xA65C,0xA65D}, /* A65C */
+ {0xA65E,0xA65F},{0xA65E,0xA65F}, /* A65E */
+ {0xA660,0xA660},{0xA661,0xA661}, /* A660 */
+ {0xA662,0xA663},{0xA662,0xA663}, /* A662 */
+ {0xA664,0xA665},{0xA664,0xA665}, /* A664 */
+ {0xA666,0xA667},{0xA666,0xA667}, /* A666 */
+ {0xA668,0xA669},{0xA668,0xA669}, /* A668 */
+ {0xA66A,0xA66B},{0xA66A,0xA66B}, /* A66A */
+ {0xA66C,0xA66D},{0xA66C,0xA66D}, /* A66C */
+ {0xA66E,0xA66E},{0xA66F,0xA66F}, /* A66E */
+ {0xA670,0xA670},{0xA671,0xA671}, /* A670 */
+ {0xA672,0xA672},{0xA673,0xA673}, /* A672 */
+ {0xA674,0xA674},{0xA675,0xA675}, /* A674 */
+ {0xA676,0xA676},{0xA677,0xA677}, /* A676 */
+ {0xA678,0xA678},{0xA679,0xA679}, /* A678 */
+ {0xA67A,0xA67A},{0xA67B,0xA67B}, /* A67A */
+ {0xA67C,0xA67C},{0xA67D,0xA67D}, /* A67C */
+ {0xA67E,0xA67E},{0xA67F,0xA67F}, /* A67E */
+ {0xA680,0xA681},{0xA680,0xA681}, /* A680 */
+ {0xA682,0xA683},{0xA682,0xA683}, /* A682 */
+ {0xA684,0xA685},{0xA684,0xA685}, /* A684 */
+ {0xA686,0xA687},{0xA686,0xA687}, /* A686 */
+ {0xA688,0xA689},{0xA688,0xA689}, /* A688 */
+ {0xA68A,0xA68B},{0xA68A,0xA68B}, /* A68A */
+ {0xA68C,0xA68D},{0xA68C,0xA68D}, /* A68C */
+ {0xA68E,0xA68F},{0xA68E,0xA68F}, /* A68E */
+ {0xA690,0xA691},{0xA690,0xA691}, /* A690 */
+ {0xA692,0xA693},{0xA692,0xA693}, /* A692 */
+ {0xA694,0xA695},{0xA694,0xA695}, /* A694 */
+ {0xA696,0xA697},{0xA696,0xA697}, /* A696 */
+ {0xA698,0xA698},{0xA699,0xA699}, /* A698 */
+ {0xA69A,0xA69A},{0xA69B,0xA69B}, /* A69A */
+ {0xA69C,0xA69C},{0xA69D,0xA69D}, /* A69C */
+ {0xA69E,0xA69E},{0xA69F,0xA69F}, /* A69E */
+ {0xA6A0,0xA6A0},{0xA6A1,0xA6A1}, /* A6A0 */
+ {0xA6A2,0xA6A2},{0xA6A3,0xA6A3}, /* A6A2 */
+ {0xA6A4,0xA6A4},{0xA6A5,0xA6A5}, /* A6A4 */
+ {0xA6A6,0xA6A6},{0xA6A7,0xA6A7}, /* A6A6 */
+ {0xA6A8,0xA6A8},{0xA6A9,0xA6A9}, /* A6A8 */
+ {0xA6AA,0xA6AA},{0xA6AB,0xA6AB}, /* A6AA */
+ {0xA6AC,0xA6AC},{0xA6AD,0xA6AD}, /* A6AC */
+ {0xA6AE,0xA6AE},{0xA6AF,0xA6AF}, /* A6AE */
+ {0xA6B0,0xA6B0},{0xA6B1,0xA6B1}, /* A6B0 */
+ {0xA6B2,0xA6B2},{0xA6B3,0xA6B3}, /* A6B2 */
+ {0xA6B4,0xA6B4},{0xA6B5,0xA6B5}, /* A6B4 */
+ {0xA6B6,0xA6B6},{0xA6B7,0xA6B7}, /* A6B6 */
+ {0xA6B8,0xA6B8},{0xA6B9,0xA6B9}, /* A6B8 */
+ {0xA6BA,0xA6BA},{0xA6BB,0xA6BB}, /* A6BA */
+ {0xA6BC,0xA6BC},{0xA6BD,0xA6BD}, /* A6BC */
+ {0xA6BE,0xA6BE},{0xA6BF,0xA6BF}, /* A6BE */
+ {0xA6C0,0xA6C0},{0xA6C1,0xA6C1}, /* A6C0 */
+ {0xA6C2,0xA6C2},{0xA6C3,0xA6C3}, /* A6C2 */
+ {0xA6C4,0xA6C4},{0xA6C5,0xA6C5}, /* A6C4 */
+ {0xA6C6,0xA6C6},{0xA6C7,0xA6C7}, /* A6C6 */
+ {0xA6C8,0xA6C8},{0xA6C9,0xA6C9}, /* A6C8 */
+ {0xA6CA,0xA6CA},{0xA6CB,0xA6CB}, /* A6CA */
+ {0xA6CC,0xA6CC},{0xA6CD,0xA6CD}, /* A6CC */
+ {0xA6CE,0xA6CE},{0xA6CF,0xA6CF}, /* A6CE */
+ {0xA6D0,0xA6D0},{0xA6D1,0xA6D1}, /* A6D0 */
+ {0xA6D2,0xA6D2},{0xA6D3,0xA6D3}, /* A6D2 */
+ {0xA6D4,0xA6D4},{0xA6D5,0xA6D5}, /* A6D4 */
+ {0xA6D6,0xA6D6},{0xA6D7,0xA6D7}, /* A6D6 */
+ {0xA6D8,0xA6D8},{0xA6D9,0xA6D9}, /* A6D8 */
+ {0xA6DA,0xA6DA},{0xA6DB,0xA6DB}, /* A6DA */
+ {0xA6DC,0xA6DC},{0xA6DD,0xA6DD}, /* A6DC */
+ {0xA6DE,0xA6DE},{0xA6DF,0xA6DF}, /* A6DE */
+ {0xA6E0,0xA6E0},{0xA6E1,0xA6E1}, /* A6E0 */
+ {0xA6E2,0xA6E2},{0xA6E3,0xA6E3}, /* A6E2 */
+ {0xA6E4,0xA6E4},{0xA6E5,0xA6E5}, /* A6E4 */
+ {0xA6E6,0xA6E6},{0xA6E7,0xA6E7}, /* A6E6 */
+ {0xA6E8,0xA6E8},{0xA6E9,0xA6E9}, /* A6E8 */
+ {0xA6EA,0xA6EA},{0xA6EB,0xA6EB}, /* A6EA */
+ {0xA6EC,0xA6EC},{0xA6ED,0xA6ED}, /* A6EC */
+ {0xA6EE,0xA6EE},{0xA6EF,0xA6EF}, /* A6EE */
+ {0xA6F0,0xA6F0},{0xA6F1,0xA6F1}, /* A6F0 */
+ {0xA6F2,0xA6F2},{0xA6F3,0xA6F3}, /* A6F2 */
+ {0xA6F4,0xA6F4},{0xA6F5,0xA6F5}, /* A6F4 */
+ {0xA6F6,0xA6F6},{0xA6F7,0xA6F7}, /* A6F6 */
+ {0xA6F8,0xA6F8},{0xA6F9,0xA6F9}, /* A6F8 */
+ {0xA6FA,0xA6FA},{0xA6FB,0xA6FB}, /* A6FA */
+ {0xA6FC,0xA6FC},{0xA6FD,0xA6FD}, /* A6FC */
+ {0xA6FE,0xA6FE},{0xA6FF,0xA6FF} /* A6FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_pageA7[256]={
+ {0xA700,0xA700},{0xA701,0xA701}, /* A700 */
+ {0xA702,0xA702},{0xA703,0xA703}, /* A702 */
+ {0xA704,0xA704},{0xA705,0xA705}, /* A704 */
+ {0xA706,0xA706},{0xA707,0xA707}, /* A706 */
+ {0xA708,0xA708},{0xA709,0xA709}, /* A708 */
+ {0xA70A,0xA70A},{0xA70B,0xA70B}, /* A70A */
+ {0xA70C,0xA70C},{0xA70D,0xA70D}, /* A70C */
+ {0xA70E,0xA70E},{0xA70F,0xA70F}, /* A70E */
+ {0xA710,0xA710},{0xA711,0xA711}, /* A710 */
+ {0xA712,0xA712},{0xA713,0xA713}, /* A712 */
+ {0xA714,0xA714},{0xA715,0xA715}, /* A714 */
+ {0xA716,0xA716},{0xA717,0xA717}, /* A716 */
+ {0xA718,0xA718},{0xA719,0xA719}, /* A718 */
+ {0xA71A,0xA71A},{0xA71B,0xA71B}, /* A71A */
+ {0xA71C,0xA71C},{0xA71D,0xA71D}, /* A71C */
+ {0xA71E,0xA71E},{0xA71F,0xA71F}, /* A71E */
+ {0xA720,0xA720},{0xA721,0xA721}, /* A720 */
+ {0xA722,0xA723},{0xA722,0xA723}, /* A722 */
+ {0xA724,0xA725},{0xA724,0xA725}, /* A724 */
+ {0xA726,0xA727},{0xA726,0xA727}, /* A726 */
+ {0xA728,0xA729},{0xA728,0xA729}, /* A728 */
+ {0xA72A,0xA72B},{0xA72A,0xA72B}, /* A72A */
+ {0xA72C,0xA72D},{0xA72C,0xA72D}, /* A72C */
+ {0xA72E,0xA72F},{0xA72E,0xA72F}, /* A72E */
+ {0xA730,0xA730},{0xA731,0xA731}, /* A730 */
+ {0xA732,0xA733},{0xA732,0xA733}, /* A732 */
+ {0xA734,0xA735},{0xA734,0xA735}, /* A734 */
+ {0xA736,0xA737},{0xA736,0xA737}, /* A736 */
+ {0xA738,0xA739},{0xA738,0xA739}, /* A738 */
+ {0xA73A,0xA73B},{0xA73A,0xA73B}, /* A73A */
+ {0xA73C,0xA73D},{0xA73C,0xA73D}, /* A73C */
+ {0xA73E,0xA73F},{0xA73E,0xA73F}, /* A73E */
+ {0xA740,0xA741},{0xA740,0xA741}, /* A740 */
+ {0xA742,0xA743},{0xA742,0xA743}, /* A742 */
+ {0xA744,0xA745},{0xA744,0xA745}, /* A744 */
+ {0xA746,0xA747},{0xA746,0xA747}, /* A746 */
+ {0xA748,0xA749},{0xA748,0xA749}, /* A748 */
+ {0xA74A,0xA74B},{0xA74A,0xA74B}, /* A74A */
+ {0xA74C,0xA74D},{0xA74C,0xA74D}, /* A74C */
+ {0xA74E,0xA74F},{0xA74E,0xA74F}, /* A74E */
+ {0xA750,0xA751},{0xA750,0xA751}, /* A750 */
+ {0xA752,0xA753},{0xA752,0xA753}, /* A752 */
+ {0xA754,0xA755},{0xA754,0xA755}, /* A754 */
+ {0xA756,0xA757},{0xA756,0xA757}, /* A756 */
+ {0xA758,0xA759},{0xA758,0xA759}, /* A758 */
+ {0xA75A,0xA75B},{0xA75A,0xA75B}, /* A75A */
+ {0xA75C,0xA75D},{0xA75C,0xA75D}, /* A75C */
+ {0xA75E,0xA75F},{0xA75E,0xA75F}, /* A75E */
+ {0xA760,0xA761},{0xA760,0xA761}, /* A760 */
+ {0xA762,0xA763},{0xA762,0xA763}, /* A762 */
+ {0xA764,0xA765},{0xA764,0xA765}, /* A764 */
+ {0xA766,0xA767},{0xA766,0xA767}, /* A766 */
+ {0xA768,0xA769},{0xA768,0xA769}, /* A768 */
+ {0xA76A,0xA76B},{0xA76A,0xA76B}, /* A76A */
+ {0xA76C,0xA76D},{0xA76C,0xA76D}, /* A76C */
+ {0xA76E,0xA76F},{0xA76E,0xA76F}, /* A76E */
+ {0xA770,0xA770},{0xA771,0xA771}, /* A770 */
+ {0xA772,0xA772},{0xA773,0xA773}, /* A772 */
+ {0xA774,0xA774},{0xA775,0xA775}, /* A774 */
+ {0xA776,0xA776},{0xA777,0xA777}, /* A776 */
+ {0xA778,0xA778},{0xA779,0xA77A}, /* A778 */
+ {0xA779,0xA77A},{0xA77B,0xA77C}, /* A77A */
+ {0xA77B,0xA77C},{0xA77D,0x1D79}, /* A77C */
+ {0xA77E,0xA77F},{0xA77E,0xA77F}, /* A77E */
+ {0xA780,0xA781},{0xA780,0xA781}, /* A780 */
+ {0xA782,0xA783},{0xA782,0xA783}, /* A782 */
+ {0xA784,0xA785},{0xA784,0xA785}, /* A784 */
+ {0xA786,0xA787},{0xA786,0xA787}, /* A786 */
+ {0xA788,0xA788},{0xA789,0xA789}, /* A788 */
+ {0xA78A,0xA78A},{0xA78B,0xA78C}, /* A78A */
+ {0xA78B,0xA78C},{0xA78D,0xA78D}, /* A78C */
+ {0xA78E,0xA78E},{0xA78F,0xA78F}, /* A78E */
+ {0xA790,0xA790},{0xA791,0xA791}, /* A790 */
+ {0xA792,0xA792},{0xA793,0xA793}, /* A792 */
+ {0xA794,0xA794},{0xA795,0xA795}, /* A794 */
+ {0xA796,0xA796},{0xA797,0xA797}, /* A796 */
+ {0xA798,0xA798},{0xA799,0xA799}, /* A798 */
+ {0xA79A,0xA79A},{0xA79B,0xA79B}, /* A79A */
+ {0xA79C,0xA79C},{0xA79D,0xA79D}, /* A79C */
+ {0xA79E,0xA79E},{0xA79F,0xA79F}, /* A79E */
+ {0xA7A0,0xA7A0},{0xA7A1,0xA7A1}, /* A7A0 */
+ {0xA7A2,0xA7A2},{0xA7A3,0xA7A3}, /* A7A2 */
+ {0xA7A4,0xA7A4},{0xA7A5,0xA7A5}, /* A7A4 */
+ {0xA7A6,0xA7A6},{0xA7A7,0xA7A7}, /* A7A6 */
+ {0xA7A8,0xA7A8},{0xA7A9,0xA7A9}, /* A7A8 */
+ {0xA7AA,0xA7AA},{0xA7AB,0xA7AB}, /* A7AA */
+ {0xA7AC,0xA7AC},{0xA7AD,0xA7AD}, /* A7AC */
+ {0xA7AE,0xA7AE},{0xA7AF,0xA7AF}, /* A7AE */
+ {0xA7B0,0xA7B0},{0xA7B1,0xA7B1}, /* A7B0 */
+ {0xA7B2,0xA7B2},{0xA7B3,0xA7B3}, /* A7B2 */
+ {0xA7B4,0xA7B4},{0xA7B5,0xA7B5}, /* A7B4 */
+ {0xA7B6,0xA7B6},{0xA7B7,0xA7B7}, /* A7B6 */
+ {0xA7B8,0xA7B8},{0xA7B9,0xA7B9}, /* A7B8 */
+ {0xA7BA,0xA7BA},{0xA7BB,0xA7BB}, /* A7BA */
+ {0xA7BC,0xA7BC},{0xA7BD,0xA7BD}, /* A7BC */
+ {0xA7BE,0xA7BE},{0xA7BF,0xA7BF}, /* A7BE */
+ {0xA7C0,0xA7C0},{0xA7C1,0xA7C1}, /* A7C0 */
+ {0xA7C2,0xA7C2},{0xA7C3,0xA7C3}, /* A7C2 */
+ {0xA7C4,0xA7C4},{0xA7C5,0xA7C5}, /* A7C4 */
+ {0xA7C6,0xA7C6},{0xA7C7,0xA7C7}, /* A7C6 */
+ {0xA7C8,0xA7C8},{0xA7C9,0xA7C9}, /* A7C8 */
+ {0xA7CA,0xA7CA},{0xA7CB,0xA7CB}, /* A7CA */
+ {0xA7CC,0xA7CC},{0xA7CD,0xA7CD}, /* A7CC */
+ {0xA7CE,0xA7CE},{0xA7CF,0xA7CF}, /* A7CE */
+ {0xA7D0,0xA7D0},{0xA7D1,0xA7D1}, /* A7D0 */
+ {0xA7D2,0xA7D2},{0xA7D3,0xA7D3}, /* A7D2 */
+ {0xA7D4,0xA7D4},{0xA7D5,0xA7D5}, /* A7D4 */
+ {0xA7D6,0xA7D6},{0xA7D7,0xA7D7}, /* A7D6 */
+ {0xA7D8,0xA7D8},{0xA7D9,0xA7D9}, /* A7D8 */
+ {0xA7DA,0xA7DA},{0xA7DB,0xA7DB}, /* A7DA */
+ {0xA7DC,0xA7DC},{0xA7DD,0xA7DD}, /* A7DC */
+ {0xA7DE,0xA7DE},{0xA7DF,0xA7DF}, /* A7DE */
+ {0xA7E0,0xA7E0},{0xA7E1,0xA7E1}, /* A7E0 */
+ {0xA7E2,0xA7E2},{0xA7E3,0xA7E3}, /* A7E2 */
+ {0xA7E4,0xA7E4},{0xA7E5,0xA7E5}, /* A7E4 */
+ {0xA7E6,0xA7E6},{0xA7E7,0xA7E7}, /* A7E6 */
+ {0xA7E8,0xA7E8},{0xA7E9,0xA7E9}, /* A7E8 */
+ {0xA7EA,0xA7EA},{0xA7EB,0xA7EB}, /* A7EA */
+ {0xA7EC,0xA7EC},{0xA7ED,0xA7ED}, /* A7EC */
+ {0xA7EE,0xA7EE},{0xA7EF,0xA7EF}, /* A7EE */
+ {0xA7F0,0xA7F0},{0xA7F1,0xA7F1}, /* A7F0 */
+ {0xA7F2,0xA7F2},{0xA7F3,0xA7F3}, /* A7F2 */
+ {0xA7F4,0xA7F4},{0xA7F5,0xA7F5}, /* A7F4 */
+ {0xA7F6,0xA7F6},{0xA7F7,0xA7F7}, /* A7F6 */
+ {0xA7F8,0xA7F8},{0xA7F9,0xA7F9}, /* A7F8 */
+ {0xA7FA,0xA7FA},{0xA7FB,0xA7FB}, /* A7FA */
+ {0xA7FC,0xA7FC},{0xA7FD,0xA7FD}, /* A7FC */
+ {0xA7FE,0xA7FE},{0xA7FF,0xA7FF} /* A7FE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_pageFF[256]={
+ {0xFF00,0xFF00},{0xFF01,0xFF01}, /* FF00 */
+ {0xFF02,0xFF02},{0xFF03,0xFF03}, /* FF02 */
+ {0xFF04,0xFF04},{0xFF05,0xFF05}, /* FF04 */
+ {0xFF06,0xFF06},{0xFF07,0xFF07}, /* FF06 */
+ {0xFF08,0xFF08},{0xFF09,0xFF09}, /* FF08 */
+ {0xFF0A,0xFF0A},{0xFF0B,0xFF0B}, /* FF0A */
+ {0xFF0C,0xFF0C},{0xFF0D,0xFF0D}, /* FF0C */
+ {0xFF0E,0xFF0E},{0xFF0F,0xFF0F}, /* FF0E */
+ {0xFF10,0xFF10},{0xFF11,0xFF11}, /* FF10 */
+ {0xFF12,0xFF12},{0xFF13,0xFF13}, /* FF12 */
+ {0xFF14,0xFF14},{0xFF15,0xFF15}, /* FF14 */
+ {0xFF16,0xFF16},{0xFF17,0xFF17}, /* FF16 */
+ {0xFF18,0xFF18},{0xFF19,0xFF19}, /* FF18 */
+ {0xFF1A,0xFF1A},{0xFF1B,0xFF1B}, /* FF1A */
+ {0xFF1C,0xFF1C},{0xFF1D,0xFF1D}, /* FF1C */
+ {0xFF1E,0xFF1E},{0xFF1F,0xFF1F}, /* FF1E */
+ {0xFF20,0xFF20},{0xFF21,0xFF41}, /* FF20 */
+ {0xFF22,0xFF42},{0xFF23,0xFF43}, /* FF22 */
+ {0xFF24,0xFF44},{0xFF25,0xFF45}, /* FF24 */
+ {0xFF26,0xFF46},{0xFF27,0xFF47}, /* FF26 */
+ {0xFF28,0xFF48},{0xFF29,0xFF49}, /* FF28 */
+ {0xFF2A,0xFF4A},{0xFF2B,0xFF4B}, /* FF2A */
+ {0xFF2C,0xFF4C},{0xFF2D,0xFF4D}, /* FF2C */
+ {0xFF2E,0xFF4E},{0xFF2F,0xFF4F}, /* FF2E */
+ {0xFF30,0xFF50},{0xFF31,0xFF51}, /* FF30 */
+ {0xFF32,0xFF52},{0xFF33,0xFF53}, /* FF32 */
+ {0xFF34,0xFF54},{0xFF35,0xFF55}, /* FF34 */
+ {0xFF36,0xFF56},{0xFF37,0xFF57}, /* FF36 */
+ {0xFF38,0xFF58},{0xFF39,0xFF59}, /* FF38 */
+ {0xFF3A,0xFF5A},{0xFF3B,0xFF3B}, /* FF3A */
+ {0xFF3C,0xFF3C},{0xFF3D,0xFF3D}, /* FF3C */
+ {0xFF3E,0xFF3E},{0xFF3F,0xFF3F}, /* FF3E */
+ {0xFF40,0xFF40},{0xFF21,0xFF41}, /* FF40 */
+ {0xFF22,0xFF42},{0xFF23,0xFF43}, /* FF42 */
+ {0xFF24,0xFF44},{0xFF25,0xFF45}, /* FF44 */
+ {0xFF26,0xFF46},{0xFF27,0xFF47}, /* FF46 */
+ {0xFF28,0xFF48},{0xFF29,0xFF49}, /* FF48 */
+ {0xFF2A,0xFF4A},{0xFF2B,0xFF4B}, /* FF4A */
+ {0xFF2C,0xFF4C},{0xFF2D,0xFF4D}, /* FF4C */
+ {0xFF2E,0xFF4E},{0xFF2F,0xFF4F}, /* FF4E */
+ {0xFF30,0xFF50},{0xFF31,0xFF51}, /* FF50 */
+ {0xFF32,0xFF52},{0xFF33,0xFF53}, /* FF52 */
+ {0xFF34,0xFF54},{0xFF35,0xFF55}, /* FF54 */
+ {0xFF36,0xFF56},{0xFF37,0xFF57}, /* FF56 */
+ {0xFF38,0xFF58},{0xFF39,0xFF59}, /* FF58 */
+ {0xFF3A,0xFF5A},{0xFF5B,0xFF5B}, /* FF5A */
+ {0xFF5C,0xFF5C},{0xFF5D,0xFF5D}, /* FF5C */
+ {0xFF5E,0xFF5E},{0xFF5F,0xFF5F}, /* FF5E */
+ {0xFF60,0xFF60},{0xFF61,0xFF61}, /* FF60 */
+ {0xFF62,0xFF62},{0xFF63,0xFF63}, /* FF62 */
+ {0xFF64,0xFF64},{0xFF65,0xFF65}, /* FF64 */
+ {0xFF66,0xFF66},{0xFF67,0xFF67}, /* FF66 */
+ {0xFF68,0xFF68},{0xFF69,0xFF69}, /* FF68 */
+ {0xFF6A,0xFF6A},{0xFF6B,0xFF6B}, /* FF6A */
+ {0xFF6C,0xFF6C},{0xFF6D,0xFF6D}, /* FF6C */
+ {0xFF6E,0xFF6E},{0xFF6F,0xFF6F}, /* FF6E */
+ {0xFF70,0xFF70},{0xFF71,0xFF71}, /* FF70 */
+ {0xFF72,0xFF72},{0xFF73,0xFF73}, /* FF72 */
+ {0xFF74,0xFF74},{0xFF75,0xFF75}, /* FF74 */
+ {0xFF76,0xFF76},{0xFF77,0xFF77}, /* FF76 */
+ {0xFF78,0xFF78},{0xFF79,0xFF79}, /* FF78 */
+ {0xFF7A,0xFF7A},{0xFF7B,0xFF7B}, /* FF7A */
+ {0xFF7C,0xFF7C},{0xFF7D,0xFF7D}, /* FF7C */
+ {0xFF7E,0xFF7E},{0xFF7F,0xFF7F}, /* FF7E */
+ {0xFF80,0xFF80},{0xFF81,0xFF81}, /* FF80 */
+ {0xFF82,0xFF82},{0xFF83,0xFF83}, /* FF82 */
+ {0xFF84,0xFF84},{0xFF85,0xFF85}, /* FF84 */
+ {0xFF86,0xFF86},{0xFF87,0xFF87}, /* FF86 */
+ {0xFF88,0xFF88},{0xFF89,0xFF89}, /* FF88 */
+ {0xFF8A,0xFF8A},{0xFF8B,0xFF8B}, /* FF8A */
+ {0xFF8C,0xFF8C},{0xFF8D,0xFF8D}, /* FF8C */
+ {0xFF8E,0xFF8E},{0xFF8F,0xFF8F}, /* FF8E */
+ {0xFF90,0xFF90},{0xFF91,0xFF91}, /* FF90 */
+ {0xFF92,0xFF92},{0xFF93,0xFF93}, /* FF92 */
+ {0xFF94,0xFF94},{0xFF95,0xFF95}, /* FF94 */
+ {0xFF96,0xFF96},{0xFF97,0xFF97}, /* FF96 */
+ {0xFF98,0xFF98},{0xFF99,0xFF99}, /* FF98 */
+ {0xFF9A,0xFF9A},{0xFF9B,0xFF9B}, /* FF9A */
+ {0xFF9C,0xFF9C},{0xFF9D,0xFF9D}, /* FF9C */
+ {0xFF9E,0xFF9E},{0xFF9F,0xFF9F}, /* FF9E */
+ {0xFFA0,0xFFA0},{0xFFA1,0xFFA1}, /* FFA0 */
+ {0xFFA2,0xFFA2},{0xFFA3,0xFFA3}, /* FFA2 */
+ {0xFFA4,0xFFA4},{0xFFA5,0xFFA5}, /* FFA4 */
+ {0xFFA6,0xFFA6},{0xFFA7,0xFFA7}, /* FFA6 */
+ {0xFFA8,0xFFA8},{0xFFA9,0xFFA9}, /* FFA8 */
+ {0xFFAA,0xFFAA},{0xFFAB,0xFFAB}, /* FFAA */
+ {0xFFAC,0xFFAC},{0xFFAD,0xFFAD}, /* FFAC */
+ {0xFFAE,0xFFAE},{0xFFAF,0xFFAF}, /* FFAE */
+ {0xFFB0,0xFFB0},{0xFFB1,0xFFB1}, /* FFB0 */
+ {0xFFB2,0xFFB2},{0xFFB3,0xFFB3}, /* FFB2 */
+ {0xFFB4,0xFFB4},{0xFFB5,0xFFB5}, /* FFB4 */
+ {0xFFB6,0xFFB6},{0xFFB7,0xFFB7}, /* FFB6 */
+ {0xFFB8,0xFFB8},{0xFFB9,0xFFB9}, /* FFB8 */
+ {0xFFBA,0xFFBA},{0xFFBB,0xFFBB}, /* FFBA */
+ {0xFFBC,0xFFBC},{0xFFBD,0xFFBD}, /* FFBC */
+ {0xFFBE,0xFFBE},{0xFFBF,0xFFBF}, /* FFBE */
+ {0xFFC0,0xFFC0},{0xFFC1,0xFFC1}, /* FFC0 */
+ {0xFFC2,0xFFC2},{0xFFC3,0xFFC3}, /* FFC2 */
+ {0xFFC4,0xFFC4},{0xFFC5,0xFFC5}, /* FFC4 */
+ {0xFFC6,0xFFC6},{0xFFC7,0xFFC7}, /* FFC6 */
+ {0xFFC8,0xFFC8},{0xFFC9,0xFFC9}, /* FFC8 */
+ {0xFFCA,0xFFCA},{0xFFCB,0xFFCB}, /* FFCA */
+ {0xFFCC,0xFFCC},{0xFFCD,0xFFCD}, /* FFCC */
+ {0xFFCE,0xFFCE},{0xFFCF,0xFFCF}, /* FFCE */
+ {0xFFD0,0xFFD0},{0xFFD1,0xFFD1}, /* FFD0 */
+ {0xFFD2,0xFFD2},{0xFFD3,0xFFD3}, /* FFD2 */
+ {0xFFD4,0xFFD4},{0xFFD5,0xFFD5}, /* FFD4 */
+ {0xFFD6,0xFFD6},{0xFFD7,0xFFD7}, /* FFD6 */
+ {0xFFD8,0xFFD8},{0xFFD9,0xFFD9}, /* FFD8 */
+ {0xFFDA,0xFFDA},{0xFFDB,0xFFDB}, /* FFDA */
+ {0xFFDC,0xFFDC},{0xFFDD,0xFFDD}, /* FFDC */
+ {0xFFDE,0xFFDE},{0xFFDF,0xFFDF}, /* FFDE */
+ {0xFFE0,0xFFE0},{0xFFE1,0xFFE1}, /* FFE0 */
+ {0xFFE2,0xFFE2},{0xFFE3,0xFFE3}, /* FFE2 */
+ {0xFFE4,0xFFE4},{0xFFE5,0xFFE5}, /* FFE4 */
+ {0xFFE6,0xFFE6},{0xFFE7,0xFFE7}, /* FFE6 */
+ {0xFFE8,0xFFE8},{0xFFE9,0xFFE9}, /* FFE8 */
+ {0xFFEA,0xFFEA},{0xFFEB,0xFFEB}, /* FFEA */
+ {0xFFEC,0xFFEC},{0xFFED,0xFFED}, /* FFEC */
+ {0xFFEE,0xFFEE},{0xFFEF,0xFFEF}, /* FFEE */
+ {0xFFF0,0xFFF0},{0xFFF1,0xFFF1}, /* FFF0 */
+ {0xFFF2,0xFFF2},{0xFFF3,0xFFF3}, /* FFF2 */
+ {0xFFF4,0xFFF4},{0xFFF5,0xFFF5}, /* FFF4 */
+ {0xFFF6,0xFFF6},{0xFFF7,0xFFF7}, /* FFF6 */
+ {0xFFF8,0xFFF8},{0xFFF9,0xFFF9}, /* FFF8 */
+ {0xFFFA,0xFFFA},{0xFFFB,0xFFFB}, /* FFFA */
+ {0xFFFC,0xFFFC},{0xFFFD,0xFFFD}, /* FFFC */
+ {0xFFFE,0xFFFE},{0xFFFF,0xFFFF} /* FFFE */
+};
+
+static const MY_CASEFOLD_CHARACTER u520_casefold_page104[256]={
+ {0x10400,0x10428},{0x10401,0x10429}, /* 10400 */
+ {0x10402,0x1042A},{0x10403,0x1042B}, /* 10402 */
+ {0x10404,0x1042C},{0x10405,0x1042D}, /* 10404 */
+ {0x10406,0x1042E},{0x10407,0x1042F}, /* 10406 */
+ {0x10408,0x10430},{0x10409,0x10431}, /* 10408 */
+ {0x1040A,0x10432},{0x1040B,0x10433}, /* 1040A */
+ {0x1040C,0x10434},{0x1040D,0x10435}, /* 1040C */
+ {0x1040E,0x10436},{0x1040F,0x10437}, /* 1040E */
+ {0x10410,0x10438},{0x10411,0x10439}, /* 10410 */
+ {0x10412,0x1043A},{0x10413,0x1043B}, /* 10412 */
+ {0x10414,0x1043C},{0x10415,0x1043D}, /* 10414 */
+ {0x10416,0x1043E},{0x10417,0x1043F}, /* 10416 */
+ {0x10418,0x10440},{0x10419,0x10441}, /* 10418 */
+ {0x1041A,0x10442},{0x1041B,0x10443}, /* 1041A */
+ {0x1041C,0x10444},{0x1041D,0x10445}, /* 1041C */
+ {0x1041E,0x10446},{0x1041F,0x10447}, /* 1041E */
+ {0x10420,0x10448},{0x10421,0x10449}, /* 10420 */
+ {0x10422,0x1044A},{0x10423,0x1044B}, /* 10422 */
+ {0x10424,0x1044C},{0x10425,0x1044D}, /* 10424 */
+ {0x10426,0x1044E},{0x10427,0x1044F}, /* 10426 */
+ {0x10400,0x10428},{0x10401,0x10429}, /* 10428 */
+ {0x10402,0x1042A},{0x10403,0x1042B}, /* 1042A */
+ {0x10404,0x1042C},{0x10405,0x1042D}, /* 1042C */
+ {0x10406,0x1042E},{0x10407,0x1042F}, /* 1042E */
+ {0x10408,0x10430},{0x10409,0x10431}, /* 10430 */
+ {0x1040A,0x10432},{0x1040B,0x10433}, /* 10432 */
+ {0x1040C,0x10434},{0x1040D,0x10435}, /* 10434 */
+ {0x1040E,0x10436},{0x1040F,0x10437}, /* 10436 */
+ {0x10410,0x10438},{0x10411,0x10439}, /* 10438 */
+ {0x10412,0x1043A},{0x10413,0x1043B}, /* 1043A */
+ {0x10414,0x1043C},{0x10415,0x1043D}, /* 1043C */
+ {0x10416,0x1043E},{0x10417,0x1043F}, /* 1043E */
+ {0x10418,0x10440},{0x10419,0x10441}, /* 10440 */
+ {0x1041A,0x10442},{0x1041B,0x10443}, /* 10442 */
+ {0x1041C,0x10444},{0x1041D,0x10445}, /* 10444 */
+ {0x1041E,0x10446},{0x1041F,0x10447}, /* 10446 */
+ {0x10420,0x10448},{0x10421,0x10449}, /* 10448 */
+ {0x10422,0x1044A},{0x10423,0x1044B}, /* 1044A */
+ {0x10424,0x1044C},{0x10425,0x1044D}, /* 1044C */
+ {0x10426,0x1044E},{0x10427,0x1044F}, /* 1044E */
+ {0x10450,0x10450},{0x10451,0x10451}, /* 10450 */
+ {0x10452,0x10452},{0x10453,0x10453}, /* 10452 */
+ {0x10454,0x10454},{0x10455,0x10455}, /* 10454 */
+ {0x10456,0x10456},{0x10457,0x10457}, /* 10456 */
+ {0x10458,0x10458},{0x10459,0x10459}, /* 10458 */
+ {0x1045A,0x1045A},{0x1045B,0x1045B}, /* 1045A */
+ {0x1045C,0x1045C},{0x1045D,0x1045D}, /* 1045C */
+ {0x1045E,0x1045E},{0x1045F,0x1045F}, /* 1045E */
+ {0x10460,0x10460},{0x10461,0x10461}, /* 10460 */
+ {0x10462,0x10462},{0x10463,0x10463}, /* 10462 */
+ {0x10464,0x10464},{0x10465,0x10465}, /* 10464 */
+ {0x10466,0x10466},{0x10467,0x10467}, /* 10466 */
+ {0x10468,0x10468},{0x10469,0x10469}, /* 10468 */
+ {0x1046A,0x1046A},{0x1046B,0x1046B}, /* 1046A */
+ {0x1046C,0x1046C},{0x1046D,0x1046D}, /* 1046C */
+ {0x1046E,0x1046E},{0x1046F,0x1046F}, /* 1046E */
+ {0x10470,0x10470},{0x10471,0x10471}, /* 10470 */
+ {0x10472,0x10472},{0x10473,0x10473}, /* 10472 */
+ {0x10474,0x10474},{0x10475,0x10475}, /* 10474 */
+ {0x10476,0x10476},{0x10477,0x10477}, /* 10476 */
+ {0x10478,0x10478},{0x10479,0x10479}, /* 10478 */
+ {0x1047A,0x1047A},{0x1047B,0x1047B}, /* 1047A */
+ {0x1047C,0x1047C},{0x1047D,0x1047D}, /* 1047C */
+ {0x1047E,0x1047E},{0x1047F,0x1047F}, /* 1047E */
+ {0x10480,0x10480},{0x10481,0x10481}, /* 10480 */
+ {0x10482,0x10482},{0x10483,0x10483}, /* 10482 */
+ {0x10484,0x10484},{0x10485,0x10485}, /* 10484 */
+ {0x10486,0x10486},{0x10487,0x10487}, /* 10486 */
+ {0x10488,0x10488},{0x10489,0x10489}, /* 10488 */
+ {0x1048A,0x1048A},{0x1048B,0x1048B}, /* 1048A */
+ {0x1048C,0x1048C},{0x1048D,0x1048D}, /* 1048C */
+ {0x1048E,0x1048E},{0x1048F,0x1048F}, /* 1048E */
+ {0x10490,0x10490},{0x10491,0x10491}, /* 10490 */
+ {0x10492,0x10492},{0x10493,0x10493}, /* 10492 */
+ {0x10494,0x10494},{0x10495,0x10495}, /* 10494 */
+ {0x10496,0x10496},{0x10497,0x10497}, /* 10496 */
+ {0x10498,0x10498},{0x10499,0x10499}, /* 10498 */
+ {0x1049A,0x1049A},{0x1049B,0x1049B}, /* 1049A */
+ {0x1049C,0x1049C},{0x1049D,0x1049D}, /* 1049C */
+ {0x1049E,0x1049E},{0x1049F,0x1049F}, /* 1049E */
+ {0x104A0,0x104A0},{0x104A1,0x104A1}, /* 104A0 */
+ {0x104A2,0x104A2},{0x104A3,0x104A3}, /* 104A2 */
+ {0x104A4,0x104A4},{0x104A5,0x104A5}, /* 104A4 */
+ {0x104A6,0x104A6},{0x104A7,0x104A7}, /* 104A6 */
+ {0x104A8,0x104A8},{0x104A9,0x104A9}, /* 104A8 */
+ {0x104AA,0x104AA},{0x104AB,0x104AB}, /* 104AA */
+ {0x104AC,0x104AC},{0x104AD,0x104AD}, /* 104AC */
+ {0x104AE,0x104AE},{0x104AF,0x104AF}, /* 104AE */
+ {0x104B0,0x104B0},{0x104B1,0x104B1}, /* 104B0 */
+ {0x104B2,0x104B2},{0x104B3,0x104B3}, /* 104B2 */
+ {0x104B4,0x104B4},{0x104B5,0x104B5}, /* 104B4 */
+ {0x104B6,0x104B6},{0x104B7,0x104B7}, /* 104B6 */
+ {0x104B8,0x104B8},{0x104B9,0x104B9}, /* 104B8 */
+ {0x104BA,0x104BA},{0x104BB,0x104BB}, /* 104BA */
+ {0x104BC,0x104BC},{0x104BD,0x104BD}, /* 104BC */
+ {0x104BE,0x104BE},{0x104BF,0x104BF}, /* 104BE */
+ {0x104C0,0x104C0},{0x104C1,0x104C1}, /* 104C0 */
+ {0x104C2,0x104C2},{0x104C3,0x104C3}, /* 104C2 */
+ {0x104C4,0x104C4},{0x104C5,0x104C5}, /* 104C4 */
+ {0x104C6,0x104C6},{0x104C7,0x104C7}, /* 104C6 */
+ {0x104C8,0x104C8},{0x104C9,0x104C9}, /* 104C8 */
+ {0x104CA,0x104CA},{0x104CB,0x104CB}, /* 104CA */
+ {0x104CC,0x104CC},{0x104CD,0x104CD}, /* 104CC */
+ {0x104CE,0x104CE},{0x104CF,0x104CF}, /* 104CE */
+ {0x104D0,0x104D0},{0x104D1,0x104D1}, /* 104D0 */
+ {0x104D2,0x104D2},{0x104D3,0x104D3}, /* 104D2 */
+ {0x104D4,0x104D4},{0x104D5,0x104D5}, /* 104D4 */
+ {0x104D6,0x104D6},{0x104D7,0x104D7}, /* 104D6 */
+ {0x104D8,0x104D8},{0x104D9,0x104D9}, /* 104D8 */
+ {0x104DA,0x104DA},{0x104DB,0x104DB}, /* 104DA */
+ {0x104DC,0x104DC},{0x104DD,0x104DD}, /* 104DC */
+ {0x104DE,0x104DE},{0x104DF,0x104DF}, /* 104DE */
+ {0x104E0,0x104E0},{0x104E1,0x104E1}, /* 104E0 */
+ {0x104E2,0x104E2},{0x104E3,0x104E3}, /* 104E2 */
+ {0x104E4,0x104E4},{0x104E5,0x104E5}, /* 104E4 */
+ {0x104E6,0x104E6},{0x104E7,0x104E7}, /* 104E6 */
+ {0x104E8,0x104E8},{0x104E9,0x104E9}, /* 104E8 */
+ {0x104EA,0x104EA},{0x104EB,0x104EB}, /* 104EA */
+ {0x104EC,0x104EC},{0x104ED,0x104ED}, /* 104EC */
+ {0x104EE,0x104EE},{0x104EF,0x104EF}, /* 104EE */
+ {0x104F0,0x104F0},{0x104F1,0x104F1}, /* 104F0 */
+ {0x104F2,0x104F2},{0x104F3,0x104F3}, /* 104F2 */
+ {0x104F4,0x104F4},{0x104F5,0x104F5}, /* 104F4 */
+ {0x104F6,0x104F6},{0x104F7,0x104F7}, /* 104F6 */
+ {0x104F8,0x104F8},{0x104F9,0x104F9}, /* 104F8 */
+ {0x104FA,0x104FA},{0x104FB,0x104FB}, /* 104FA */
+ {0x104FC,0x104FC},{0x104FD,0x104FD}, /* 104FC */
+ {0x104FE,0x104FE},{0x104FF,0x104FF} /* 104FE */
+};
+
+const MY_CASEFOLD_CHARACTER * my_u520_casefold_index[4352]={
+ u520_casefold_page00, u520_casefold_page01, u520_casefold_page02, u520_casefold_page03, u520_casefold_page04, u520_casefold_page05, u520_casefold_page06, u520_casefold_page07,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ u520_casefold_page10, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, u520_casefold_page1D, u520_casefold_page1E, u520_casefold_page1F,
+ NULL, u520_casefold_page21, NULL, NULL, u520_casefold_page24, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, u520_casefold_page2C, u520_casefold_page2D, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, u520_casefold_pageA6, u520_casefold_pageA7,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, u520_casefold_pageFF,
+ NULL, NULL, NULL, NULL, u520_casefold_page104, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+};
diff --git a/strings/ctype-unidata.c b/strings/ctype-unidata.c
new file mode 100644
index 00000000000..77bec5418c4
--- /dev/null
+++ b/strings/ctype-unidata.c
@@ -0,0 +1,97 @@
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2020, MariaDB
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; version 2
+ of the License.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1335 USA */
+
+#include "strings_def.h"
+#include <m_ctype.h>
+#include "ctype-mb.h"
+
+#ifndef EILSEQ
+#define EILSEQ ENOENT
+#endif
+
+
+#include "ctype-unidata.h"
+#include "ctype-unicode300-general_ci.h"
+#include "ctype-unicode300-general_mysql500_ci.h"
+#include "ctype-unicode300-casefold.h"
+#include "ctype-unicode300-casefold-tr.h"
+#include "ctype-unicode520-casefold.h"
+#include "ctype-unicode1400-casefold.h"
+#include "ctype-unicode1400-casefold-tr.h"
+
+
+
+MY_CASEFOLD_INFO my_casefold_default=
+{
+ 0xFFFF,
+ my_u300_casefold_index,
+ weight_general_ci_index
+};
+
+
+/*
+ Turkish lower/upper mapping:
+ 1. LOWER(0x0049 LATIN CAPITAL LETTER I) ->
+ 0x0131 LATIN SMALL LETTER DOTLESS I
+ 2. UPPER(0x0069 LATIN SMALL LETTER I) ->
+ 0x0130 LATIN CAPITAL LETTER I WITH DOT ABOVE
+*/
+
+MY_CASEFOLD_INFO my_casefold_turkish=
+{
+ 0xFFFF,
+ my_u300tr_casefold_index,
+ weight_general_ci_index
+};
+
+
+/*
+ general_mysql500_ci is very similar to general_ci, but maps sorting order
+ for U+00DF to 0x00DF instead of 0x0053.
+*/
+MY_CASEFOLD_INFO my_casefold_mysql500=
+{
+ 0xFFFF,
+ my_u300_casefold_index,
+ weight_general_mysql500_ci_index
+};
+
+
+
+MY_CASEFOLD_INFO my_casefold_unicode520=
+{
+ 0x10FFFF,
+ my_u520_casefold_index,
+ NULL
+};
+
+
+MY_CASEFOLD_INFO my_casefold_unicode1400=
+{
+ 0x10FFFF,
+ my_u1400_casefold_index,
+ NULL
+};
+
+
+MY_CASEFOLD_INFO my_casefold_unicode1400tr=
+{
+ 0x10FFFF,
+ my_u1400tr_casefold_index,
+ NULL
+};
diff --git a/strings/ctype-unidata.h b/strings/ctype-unidata.h
index 6712f5e1d79..0bcf96c09a0 100644
--- a/strings/ctype-unidata.h
+++ b/strings/ctype-unidata.h
@@ -1,7 +1,7 @@
#ifndef CTYPE_UNIDATA_H_INCLUDED
#define CTYPE_UNIDATA_H_INCLUDED
/*
- Copyright (c) 2018 MariaDB Corporation
+ Copyright (c) 2018, 2023 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
@@ -17,9 +17,128 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define MY_UNICASE_INFO_DEFAULT_MAXCHAR 0xFFFF
-extern MY_UNICASE_CHARACTER my_unicase_default_page00[256];
-extern MY_UNICASE_CHARACTER *my_unicase_default_pages[256];
+
+extern const uint16 weight_general_ci_page00[256];
+extern const uint16 *weight_general_ci_index[256];
+extern const uint16 weight_general_mysql500_ci_page00[256];
+extern const uint16 *weight_general_mysql500_ci_index[256];
+
+extern const MY_CASEFOLD_CHARACTER u300_casefold_page00[256];
+
+static inline my_wc_t my_u300_tolower_7bit(uchar ch)
+{
+ return u300_casefold_page00[ch].tolower;
+}
+
+static inline my_wc_t my_u300_toupper_7bit(uchar ch)
+{
+ return u300_casefold_page00[ch].toupper;
+}
+
+
+static inline my_wc_t my_general_ci_bmp_char_to_weight(my_wc_t wc)
+{
+ const uint16 *page;
+ DBUG_ASSERT((wc >> 8) < array_elements(weight_general_ci_index));
+ page= weight_general_ci_index[wc >> 8];
+ return page ? page[wc & 0xFF] : wc;
+}
+
+
+static inline my_wc_t my_general_ci_char_to_weight(my_wc_t wc)
+{
+ if ((wc >> 8) < array_elements(weight_general_ci_index))
+ return my_general_ci_bmp_char_to_weight(wc);
+ return MY_CS_REPLACEMENT_CHARACTER;
+}
+
+
+static inline my_wc_t my_general_mysql500_ci_bmp_char_to_weight(my_wc_t wc)
+{
+ const uint16 *page;
+ DBUG_ASSERT((wc >> 8) < array_elements(weight_general_mysql500_ci_index));
+ page= weight_general_mysql500_ci_index[wc >> 8];
+ return page ? page[wc & 0xFF] : wc;
+}
+
+
+static inline void my_tosort_unicode_bmp(MY_CASEFOLD_INFO *uni_plane,
+ my_wc_t *wc)
+{
+ const uint16 *page;
+ DBUG_ASSERT(*wc <= uni_plane->maxchar);
+ if ((page= uni_plane->simple_weight[*wc >> 8]))
+ *wc= page[*wc & 0xFF];
+}
+
+
+static inline void my_tosort_unicode(MY_CASEFOLD_INFO *uni_plane,
+ my_wc_t *wc)
+{
+ if (*wc <= uni_plane->maxchar)
+ {
+ const uint16 *page;
+ if ((page= uni_plane->simple_weight[*wc >> 8]))
+ *wc= page[*wc & 0xFF];
+ }
+ else
+ {
+ *wc= MY_CS_REPLACEMENT_CHARACTER;
+ }
+}
+
+
+static inline void
+my_tolower_unicode_bmp(MY_CASEFOLD_INFO *uni_plane, my_wc_t *wc)
+{
+ const MY_CASEFOLD_CHARACTER *page;
+ DBUG_ASSERT(*wc <= uni_plane->maxchar);
+ if ((page= uni_plane->page[*wc >> 8]))
+ *wc= page[*wc & 0xFF].tolower;
+}
+
+
+static inline void
+my_toupper_unicode_bmp(MY_CASEFOLD_INFO *uni_plane, my_wc_t *wc)
+{
+ const MY_CASEFOLD_CHARACTER *page;
+ DBUG_ASSERT(*wc <= uni_plane->maxchar);
+ if ((page= uni_plane->page[*wc >> 8]))
+ *wc= page[*wc & 0xFF].toupper;
+}
+
+
+static inline void
+my_tolower_unicode(MY_CASEFOLD_INFO *uni_plane, my_wc_t *wc)
+{
+ if (*wc <= uni_plane->maxchar)
+ {
+ const MY_CASEFOLD_CHARACTER *page;
+ if ((page= uni_plane->page[(*wc >> 8)]))
+ *wc= page[*wc & 0xFF].tolower;
+ }
+}
+
+
+static inline void
+my_toupper_unicode(MY_CASEFOLD_INFO *uni_plane, my_wc_t *wc)
+{
+ if (*wc <= uni_plane->maxchar)
+ {
+ const MY_CASEFOLD_CHARACTER *page;
+ if ((page= uni_plane->page[(*wc >> 8)]))
+ *wc= page[*wc & 0xFF].toupper;
+ }
+}
+
+
+extern MY_CASEFOLD_INFO my_casefold_default;
+extern MY_CASEFOLD_INFO my_casefold_turkish;
+extern MY_CASEFOLD_INFO my_casefold_mysql500;
+extern MY_CASEFOLD_INFO my_casefold_unicode520;
+extern MY_CASEFOLD_INFO my_casefold_unicode1400;
+extern MY_CASEFOLD_INFO my_casefold_unicode1400tr;
+
size_t my_strxfrm_pad_nweights_unicode(uchar *str, uchar *strend, size_t nweights);
size_t my_strxfrm_pad_unicode(uchar *str, uchar *strend);
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 1238f849078..121a3f945f6 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -113,4560 +113,20 @@ int my_valid_mbcharlen_utf8mb3(const uchar *s, const uchar *e)
#include "my_uctype.h"
-MY_UNICASE_CHARACTER my_unicase_default_page00[]={
- {0x0000,0x0000,0x0000}, {0x0001,0x0001,0x0001},
- {0x0002,0x0002,0x0002}, {0x0003,0x0003,0x0003},
- {0x0004,0x0004,0x0004}, {0x0005,0x0005,0x0005},
- {0x0006,0x0006,0x0006}, {0x0007,0x0007,0x0007},
- {0x0008,0x0008,0x0008}, {0x0009,0x0009,0x0009},
- {0x000A,0x000A,0x000A}, {0x000B,0x000B,0x000B},
- {0x000C,0x000C,0x000C}, {0x000D,0x000D,0x000D},
- {0x000E,0x000E,0x000E}, {0x000F,0x000F,0x000F},
- {0x0010,0x0010,0x0010}, {0x0011,0x0011,0x0011},
- {0x0012,0x0012,0x0012}, {0x0013,0x0013,0x0013},
- {0x0014,0x0014,0x0014}, {0x0015,0x0015,0x0015},
- {0x0016,0x0016,0x0016}, {0x0017,0x0017,0x0017},
- {0x0018,0x0018,0x0018}, {0x0019,0x0019,0x0019},
- {0x001A,0x001A,0x001A}, {0x001B,0x001B,0x001B},
- {0x001C,0x001C,0x001C}, {0x001D,0x001D,0x001D},
- {0x001E,0x001E,0x001E}, {0x001F,0x001F,0x001F},
- {0x0020,0x0020,0x0020}, {0x0021,0x0021,0x0021},
- {0x0022,0x0022,0x0022}, {0x0023,0x0023,0x0023},
- {0x0024,0x0024,0x0024}, {0x0025,0x0025,0x0025},
- {0x0026,0x0026,0x0026}, {0x0027,0x0027,0x0027},
- {0x0028,0x0028,0x0028}, {0x0029,0x0029,0x0029},
- {0x002A,0x002A,0x002A}, {0x002B,0x002B,0x002B},
- {0x002C,0x002C,0x002C}, {0x002D,0x002D,0x002D},
- {0x002E,0x002E,0x002E}, {0x002F,0x002F,0x002F},
- {0x0030,0x0030,0x0030}, {0x0031,0x0031,0x0031},
- {0x0032,0x0032,0x0032}, {0x0033,0x0033,0x0033},
- {0x0034,0x0034,0x0034}, {0x0035,0x0035,0x0035},
- {0x0036,0x0036,0x0036}, {0x0037,0x0037,0x0037},
- {0x0038,0x0038,0x0038}, {0x0039,0x0039,0x0039},
- {0x003A,0x003A,0x003A}, {0x003B,0x003B,0x003B},
- {0x003C,0x003C,0x003C}, {0x003D,0x003D,0x003D},
- {0x003E,0x003E,0x003E}, {0x003F,0x003F,0x003F},
- {0x0040,0x0040,0x0040}, {0x0041,0x0061,0x0041},
- {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043},
- {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045},
- {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047},
- {0x0048,0x0068,0x0048}, {0x0049,0x0069,0x0049},
- {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B},
- {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D},
- {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F},
- {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051},
- {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053},
- {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055},
- {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057},
- {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059},
- {0x005A,0x007A,0x005A}, {0x005B,0x005B,0x005B},
- {0x005C,0x005C,0x005C}, {0x005D,0x005D,0x005D},
- {0x005E,0x005E,0x005E}, {0x005F,0x005F,0x005F},
- {0x0060,0x0060,0x0060}, {0x0041,0x0061,0x0041},
- {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043},
- {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045},
- {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047},
- {0x0048,0x0068,0x0048}, {0x0049,0x0069,0x0049},
- {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B},
- {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D},
- {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F},
- {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051},
- {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053},
- {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055},
- {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057},
- {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059},
- {0x005A,0x007A,0x005A}, {0x007B,0x007B,0x007B},
- {0x007C,0x007C,0x007C}, {0x007D,0x007D,0x007D},
- {0x007E,0x007E,0x007E}, {0x007F,0x007F,0x007F},
- {0x0080,0x0080,0x0080}, {0x0081,0x0081,0x0081},
- {0x0082,0x0082,0x0082}, {0x0083,0x0083,0x0083},
- {0x0084,0x0084,0x0084}, {0x0085,0x0085,0x0085},
- {0x0086,0x0086,0x0086}, {0x0087,0x0087,0x0087},
- {0x0088,0x0088,0x0088}, {0x0089,0x0089,0x0089},
- {0x008A,0x008A,0x008A}, {0x008B,0x008B,0x008B},
- {0x008C,0x008C,0x008C}, {0x008D,0x008D,0x008D},
- {0x008E,0x008E,0x008E}, {0x008F,0x008F,0x008F},
- {0x0090,0x0090,0x0090}, {0x0091,0x0091,0x0091},
- {0x0092,0x0092,0x0092}, {0x0093,0x0093,0x0093},
- {0x0094,0x0094,0x0094}, {0x0095,0x0095,0x0095},
- {0x0096,0x0096,0x0096}, {0x0097,0x0097,0x0097},
- {0x0098,0x0098,0x0098}, {0x0099,0x0099,0x0099},
- {0x009A,0x009A,0x009A}, {0x009B,0x009B,0x009B},
- {0x009C,0x009C,0x009C}, {0x009D,0x009D,0x009D},
- {0x009E,0x009E,0x009E}, {0x009F,0x009F,0x009F},
- {0x00A0,0x00A0,0x00A0}, {0x00A1,0x00A1,0x00A1},
- {0x00A2,0x00A2,0x00A2}, {0x00A3,0x00A3,0x00A3},
- {0x00A4,0x00A4,0x00A4}, {0x00A5,0x00A5,0x00A5},
- {0x00A6,0x00A6,0x00A6}, {0x00A7,0x00A7,0x00A7},
- {0x00A8,0x00A8,0x00A8}, {0x00A9,0x00A9,0x00A9},
- {0x00AA,0x00AA,0x00AA}, {0x00AB,0x00AB,0x00AB},
- {0x00AC,0x00AC,0x00AC}, {0x00AD,0x00AD,0x00AD},
- {0x00AE,0x00AE,0x00AE}, {0x00AF,0x00AF,0x00AF},
- {0x00B0,0x00B0,0x00B0}, {0x00B1,0x00B1,0x00B1},
- {0x00B2,0x00B2,0x00B2}, {0x00B3,0x00B3,0x00B3},
- {0x00B4,0x00B4,0x00B4}, {0x039C,0x00B5,0x039C},
- {0x00B6,0x00B6,0x00B6}, {0x00B7,0x00B7,0x00B7},
- {0x00B8,0x00B8,0x00B8}, {0x00B9,0x00B9,0x00B9},
- {0x00BA,0x00BA,0x00BA}, {0x00BB,0x00BB,0x00BB},
- {0x00BC,0x00BC,0x00BC}, {0x00BD,0x00BD,0x00BD},
- {0x00BE,0x00BE,0x00BE}, {0x00BF,0x00BF,0x00BF},
- {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041},
- {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041},
- {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041},
- {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043},
- {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045},
- {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045},
- {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049},
- {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049},
- {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E},
- {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F},
- {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F},
- {0x00D6,0x00F6,0x004F}, {0x00D7,0x00D7,0x00D7},
- {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055},
- {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055},
- {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059},
- {0x00DE,0x00FE,0x00DE}, {0x00DF,0x00DF,0x0053},
- {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041},
- {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041},
- {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041},
- {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043},
- {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045},
- {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045},
- {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049},
- {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049},
- {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E},
- {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F},
- {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F},
- {0x00D6,0x00F6,0x004F}, {0x00F7,0x00F7,0x00F7},
- {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055},
- {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055},
- {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059},
- {0x00DE,0x00FE,0x00DE}, {0x0178,0x00FF,0x0059}
-};
-
-
-/*
- Almost similar to my_unicase_default_page00, but maps sorting order
- for U+00DF to 0x00DF instead of 0x0053.
-*/
-static MY_UNICASE_CHARACTER plane00_mysql500[]={
- {0x0000,0x0000,0x0000}, {0x0001,0x0001,0x0001},
- {0x0002,0x0002,0x0002}, {0x0003,0x0003,0x0003},
- {0x0004,0x0004,0x0004}, {0x0005,0x0005,0x0005},
- {0x0006,0x0006,0x0006}, {0x0007,0x0007,0x0007},
- {0x0008,0x0008,0x0008}, {0x0009,0x0009,0x0009},
- {0x000A,0x000A,0x000A}, {0x000B,0x000B,0x000B},
- {0x000C,0x000C,0x000C}, {0x000D,0x000D,0x000D},
- {0x000E,0x000E,0x000E}, {0x000F,0x000F,0x000F},
- {0x0010,0x0010,0x0010}, {0x0011,0x0011,0x0011},
- {0x0012,0x0012,0x0012}, {0x0013,0x0013,0x0013},
- {0x0014,0x0014,0x0014}, {0x0015,0x0015,0x0015},
- {0x0016,0x0016,0x0016}, {0x0017,0x0017,0x0017},
- {0x0018,0x0018,0x0018}, {0x0019,0x0019,0x0019},
- {0x001A,0x001A,0x001A}, {0x001B,0x001B,0x001B},
- {0x001C,0x001C,0x001C}, {0x001D,0x001D,0x001D},
- {0x001E,0x001E,0x001E}, {0x001F,0x001F,0x001F},
- {0x0020,0x0020,0x0020}, {0x0021,0x0021,0x0021},
- {0x0022,0x0022,0x0022}, {0x0023,0x0023,0x0023},
- {0x0024,0x0024,0x0024}, {0x0025,0x0025,0x0025},
- {0x0026,0x0026,0x0026}, {0x0027,0x0027,0x0027},
- {0x0028,0x0028,0x0028}, {0x0029,0x0029,0x0029},
- {0x002A,0x002A,0x002A}, {0x002B,0x002B,0x002B},
- {0x002C,0x002C,0x002C}, {0x002D,0x002D,0x002D},
- {0x002E,0x002E,0x002E}, {0x002F,0x002F,0x002F},
- {0x0030,0x0030,0x0030}, {0x0031,0x0031,0x0031},
- {0x0032,0x0032,0x0032}, {0x0033,0x0033,0x0033},
- {0x0034,0x0034,0x0034}, {0x0035,0x0035,0x0035},
- {0x0036,0x0036,0x0036}, {0x0037,0x0037,0x0037},
- {0x0038,0x0038,0x0038}, {0x0039,0x0039,0x0039},
- {0x003A,0x003A,0x003A}, {0x003B,0x003B,0x003B},
- {0x003C,0x003C,0x003C}, {0x003D,0x003D,0x003D},
- {0x003E,0x003E,0x003E}, {0x003F,0x003F,0x003F},
- {0x0040,0x0040,0x0040}, {0x0041,0x0061,0x0041},
- {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043},
- {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045},
- {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047},
- {0x0048,0x0068,0x0048}, {0x0049,0x0069,0x0049},
- {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B},
- {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D},
- {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F},
- {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051},
- {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053},
- {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055},
- {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057},
- {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059},
- {0x005A,0x007A,0x005A}, {0x005B,0x005B,0x005B},
- {0x005C,0x005C,0x005C}, {0x005D,0x005D,0x005D},
- {0x005E,0x005E,0x005E}, {0x005F,0x005F,0x005F},
- {0x0060,0x0060,0x0060}, {0x0041,0x0061,0x0041},
- {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043},
- {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045},
- {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047},
- {0x0048,0x0068,0x0048}, {0x0049,0x0069,0x0049},
- {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B},
- {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D},
- {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F},
- {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051},
- {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053},
- {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055},
- {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057},
- {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059},
- {0x005A,0x007A,0x005A}, {0x007B,0x007B,0x007B},
- {0x007C,0x007C,0x007C}, {0x007D,0x007D,0x007D},
- {0x007E,0x007E,0x007E}, {0x007F,0x007F,0x007F},
- {0x0080,0x0080,0x0080}, {0x0081,0x0081,0x0081},
- {0x0082,0x0082,0x0082}, {0x0083,0x0083,0x0083},
- {0x0084,0x0084,0x0084}, {0x0085,0x0085,0x0085},
- {0x0086,0x0086,0x0086}, {0x0087,0x0087,0x0087},
- {0x0088,0x0088,0x0088}, {0x0089,0x0089,0x0089},
- {0x008A,0x008A,0x008A}, {0x008B,0x008B,0x008B},
- {0x008C,0x008C,0x008C}, {0x008D,0x008D,0x008D},
- {0x008E,0x008E,0x008E}, {0x008F,0x008F,0x008F},
- {0x0090,0x0090,0x0090}, {0x0091,0x0091,0x0091},
- {0x0092,0x0092,0x0092}, {0x0093,0x0093,0x0093},
- {0x0094,0x0094,0x0094}, {0x0095,0x0095,0x0095},
- {0x0096,0x0096,0x0096}, {0x0097,0x0097,0x0097},
- {0x0098,0x0098,0x0098}, {0x0099,0x0099,0x0099},
- {0x009A,0x009A,0x009A}, {0x009B,0x009B,0x009B},
- {0x009C,0x009C,0x009C}, {0x009D,0x009D,0x009D},
- {0x009E,0x009E,0x009E}, {0x009F,0x009F,0x009F},
- {0x00A0,0x00A0,0x00A0}, {0x00A1,0x00A1,0x00A1},
- {0x00A2,0x00A2,0x00A2}, {0x00A3,0x00A3,0x00A3},
- {0x00A4,0x00A4,0x00A4}, {0x00A5,0x00A5,0x00A5},
- {0x00A6,0x00A6,0x00A6}, {0x00A7,0x00A7,0x00A7},
- {0x00A8,0x00A8,0x00A8}, {0x00A9,0x00A9,0x00A9},
- {0x00AA,0x00AA,0x00AA}, {0x00AB,0x00AB,0x00AB},
- {0x00AC,0x00AC,0x00AC}, {0x00AD,0x00AD,0x00AD},
- {0x00AE,0x00AE,0x00AE}, {0x00AF,0x00AF,0x00AF},
- {0x00B0,0x00B0,0x00B0}, {0x00B1,0x00B1,0x00B1},
- {0x00B2,0x00B2,0x00B2}, {0x00B3,0x00B3,0x00B3},
- {0x00B4,0x00B4,0x00B4}, {0x039C,0x00B5,0x039C},
- {0x00B6,0x00B6,0x00B6}, {0x00B7,0x00B7,0x00B7},
- {0x00B8,0x00B8,0x00B8}, {0x00B9,0x00B9,0x00B9},
- {0x00BA,0x00BA,0x00BA}, {0x00BB,0x00BB,0x00BB},
- {0x00BC,0x00BC,0x00BC}, {0x00BD,0x00BD,0x00BD},
- {0x00BE,0x00BE,0x00BE}, {0x00BF,0x00BF,0x00BF},
- {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041},
- {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041},
- {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041},
- {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043},
- {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045},
- {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045},
- {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049},
- {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049},
- {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E},
- {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F},
- {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F},
- {0x00D6,0x00F6,0x004F}, {0x00D7,0x00D7,0x00D7},
- {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055},
- {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055},
- {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059},
- {0x00DE,0x00FE,0x00DE}, {0x00DF,0x00DF,0x00DF},
- {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041},
- {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041},
- {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041},
- {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043},
- {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045},
- {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045},
- {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049},
- {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049},
- {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E},
- {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F},
- {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F},
- {0x00D6,0x00F6,0x004F}, {0x00F7,0x00F7,0x00F7},
- {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055},
- {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055},
- {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059},
- {0x00DE,0x00FE,0x00DE}, {0x0178,0x00FF,0x0059}
-};
-
-
-static MY_UNICASE_CHARACTER plane01[]={
- {0x0100,0x0101,0x0041}, {0x0100,0x0101,0x0041},
- {0x0102,0x0103,0x0041}, {0x0102,0x0103,0x0041},
- {0x0104,0x0105,0x0041}, {0x0104,0x0105,0x0041},
- {0x0106,0x0107,0x0043}, {0x0106,0x0107,0x0043},
- {0x0108,0x0109,0x0043}, {0x0108,0x0109,0x0043},
- {0x010A,0x010B,0x0043}, {0x010A,0x010B,0x0043},
- {0x010C,0x010D,0x0043}, {0x010C,0x010D,0x0043},
- {0x010E,0x010F,0x0044}, {0x010E,0x010F,0x0044},
- {0x0110,0x0111,0x0110}, {0x0110,0x0111,0x0110},
- {0x0112,0x0113,0x0045}, {0x0112,0x0113,0x0045},
- {0x0114,0x0115,0x0045}, {0x0114,0x0115,0x0045},
- {0x0116,0x0117,0x0045}, {0x0116,0x0117,0x0045},
- {0x0118,0x0119,0x0045}, {0x0118,0x0119,0x0045},
- {0x011A,0x011B,0x0045}, {0x011A,0x011B,0x0045},
- {0x011C,0x011D,0x0047}, {0x011C,0x011D,0x0047},
- {0x011E,0x011F,0x0047}, {0x011E,0x011F,0x0047},
- {0x0120,0x0121,0x0047}, {0x0120,0x0121,0x0047},
- {0x0122,0x0123,0x0047}, {0x0122,0x0123,0x0047},
- {0x0124,0x0125,0x0048}, {0x0124,0x0125,0x0048},
- {0x0126,0x0127,0x0126}, {0x0126,0x0127,0x0126},
- {0x0128,0x0129,0x0049}, {0x0128,0x0129,0x0049},
- {0x012A,0x012B,0x0049}, {0x012A,0x012B,0x0049},
- {0x012C,0x012D,0x0049}, {0x012C,0x012D,0x0049},
- {0x012E,0x012F,0x0049}, {0x012E,0x012F,0x0049},
- {0x0130,0x0069,0x0049}, {0x0049,0x0131,0x0049},
- {0x0132,0x0133,0x0132}, {0x0132,0x0133,0x0132},
- {0x0134,0x0135,0x004A}, {0x0134,0x0135,0x004A},
- {0x0136,0x0137,0x004B}, {0x0136,0x0137,0x004B},
- {0x0138,0x0138,0x0138}, {0x0139,0x013A,0x004C},
- {0x0139,0x013A,0x004C}, {0x013B,0x013C,0x004C},
- {0x013B,0x013C,0x004C}, {0x013D,0x013E,0x004C},
- {0x013D,0x013E,0x004C}, {0x013F,0x0140,0x013F},
- {0x013F,0x0140,0x013F}, {0x0141,0x0142,0x0141},
- {0x0141,0x0142,0x0141}, {0x0143,0x0144,0x004E},
- {0x0143,0x0144,0x004E}, {0x0145,0x0146,0x004E},
- {0x0145,0x0146,0x004E}, {0x0147,0x0148,0x004E},
- {0x0147,0x0148,0x004E}, {0x0149,0x0149,0x0149},
- {0x014A,0x014B,0x014A}, {0x014A,0x014B,0x014A},
- {0x014C,0x014D,0x004F}, {0x014C,0x014D,0x004F},
- {0x014E,0x014F,0x004F}, {0x014E,0x014F,0x004F},
- {0x0150,0x0151,0x004F}, {0x0150,0x0151,0x004F},
- {0x0152,0x0153,0x0152}, {0x0152,0x0153,0x0152},
- {0x0154,0x0155,0x0052}, {0x0154,0x0155,0x0052},
- {0x0156,0x0157,0x0052}, {0x0156,0x0157,0x0052},
- {0x0158,0x0159,0x0052}, {0x0158,0x0159,0x0052},
- {0x015A,0x015B,0x0053}, {0x015A,0x015B,0x0053},
- {0x015C,0x015D,0x0053}, {0x015C,0x015D,0x0053},
- {0x015E,0x015F,0x0053}, {0x015E,0x015F,0x0053},
- {0x0160,0x0161,0x0053}, {0x0160,0x0161,0x0053},
- {0x0162,0x0163,0x0054}, {0x0162,0x0163,0x0054},
- {0x0164,0x0165,0x0054}, {0x0164,0x0165,0x0054},
- {0x0166,0x0167,0x0166}, {0x0166,0x0167,0x0166},
- {0x0168,0x0169,0x0055}, {0x0168,0x0169,0x0055},
- {0x016A,0x016B,0x0055}, {0x016A,0x016B,0x0055},
- {0x016C,0x016D,0x0055}, {0x016C,0x016D,0x0055},
- {0x016E,0x016F,0x0055}, {0x016E,0x016F,0x0055},
- {0x0170,0x0171,0x0055}, {0x0170,0x0171,0x0055},
- {0x0172,0x0173,0x0055}, {0x0172,0x0173,0x0055},
- {0x0174,0x0175,0x0057}, {0x0174,0x0175,0x0057},
- {0x0176,0x0177,0x0059}, {0x0176,0x0177,0x0059},
- {0x0178,0x00FF,0x0059}, {0x0179,0x017A,0x005A},
- {0x0179,0x017A,0x005A}, {0x017B,0x017C,0x005A},
- {0x017B,0x017C,0x005A}, {0x017D,0x017E,0x005A},
- {0x017D,0x017E,0x005A}, {0x0053,0x017F,0x0053},
- {0x0180,0x0180,0x0180}, {0x0181,0x0253,0x0181},
- {0x0182,0x0183,0x0182}, {0x0182,0x0183,0x0182},
- {0x0184,0x0185,0x0184}, {0x0184,0x0185,0x0184},
- {0x0186,0x0254,0x0186}, {0x0187,0x0188,0x0187},
- {0x0187,0x0188,0x0187}, {0x0189,0x0256,0x0189},
- {0x018A,0x0257,0x018A}, {0x018B,0x018C,0x018B},
- {0x018B,0x018C,0x018B}, {0x018D,0x018D,0x018D},
- {0x018E,0x01DD,0x018E}, {0x018F,0x0259,0x018F},
- {0x0190,0x025B,0x0190}, {0x0191,0x0192,0x0191},
- {0x0191,0x0192,0x0191}, {0x0193,0x0260,0x0193},
- {0x0194,0x0263,0x0194}, {0x01F6,0x0195,0x01F6},
- {0x0196,0x0269,0x0196}, {0x0197,0x0268,0x0197},
- {0x0198,0x0199,0x0198}, {0x0198,0x0199,0x0198},
- {0x019A,0x019A,0x019A}, {0x019B,0x019B,0x019B},
- {0x019C,0x026F,0x019C}, {0x019D,0x0272,0x019D},
- {0x019E,0x019E,0x019E}, {0x019F,0x0275,0x019F},
- {0x01A0,0x01A1,0x004F}, {0x01A0,0x01A1,0x004F},
- {0x01A2,0x01A3,0x01A2}, {0x01A2,0x01A3,0x01A2},
- {0x01A4,0x01A5,0x01A4}, {0x01A4,0x01A5,0x01A4},
- {0x01A6,0x0280,0x01A6}, {0x01A7,0x01A8,0x01A7},
- {0x01A7,0x01A8,0x01A7}, {0x01A9,0x0283,0x01A9},
- {0x01AA,0x01AA,0x01AA}, {0x01AB,0x01AB,0x01AB},
- {0x01AC,0x01AD,0x01AC}, {0x01AC,0x01AD,0x01AC},
- {0x01AE,0x0288,0x01AE}, {0x01AF,0x01B0,0x0055},
- {0x01AF,0x01B0,0x0055}, {0x01B1,0x028A,0x01B1},
- {0x01B2,0x028B,0x01B2}, {0x01B3,0x01B4,0x01B3},
- {0x01B3,0x01B4,0x01B3}, {0x01B5,0x01B6,0x01B5},
- {0x01B5,0x01B6,0x01B5}, {0x01B7,0x0292,0x01B7},
- {0x01B8,0x01B9,0x01B8}, {0x01B8,0x01B9,0x01B8},
- {0x01BA,0x01BA,0x01BA}, {0x01BB,0x01BB,0x01BB},
- {0x01BC,0x01BD,0x01BC}, {0x01BC,0x01BD,0x01BC},
- {0x01BE,0x01BE,0x01BE}, {0x01F7,0x01BF,0x01F7},
- {0x01C0,0x01C0,0x01C0}, {0x01C1,0x01C1,0x01C1},
- {0x01C2,0x01C2,0x01C2}, {0x01C3,0x01C3,0x01C3},
- {0x01C4,0x01C6,0x01C4}, {0x01C4,0x01C6,0x01C4},
- {0x01C4,0x01C6,0x01C4}, {0x01C7,0x01C9,0x01C7},
- {0x01C7,0x01C9,0x01C7}, {0x01C7,0x01C9,0x01C7},
- {0x01CA,0x01CC,0x01CA}, {0x01CA,0x01CC,0x01CA},
- {0x01CA,0x01CC,0x01CA}, {0x01CD,0x01CE,0x0041},
- {0x01CD,0x01CE,0x0041}, {0x01CF,0x01D0,0x0049},
- {0x01CF,0x01D0,0x0049}, {0x01D1,0x01D2,0x004F},
- {0x01D1,0x01D2,0x004F}, {0x01D3,0x01D4,0x0055},
- {0x01D3,0x01D4,0x0055}, {0x01D5,0x01D6,0x0055},
- {0x01D5,0x01D6,0x0055}, {0x01D7,0x01D8,0x0055},
- {0x01D7,0x01D8,0x0055}, {0x01D9,0x01DA,0x0055},
- {0x01D9,0x01DA,0x0055}, {0x01DB,0x01DC,0x0055},
- {0x01DB,0x01DC,0x0055}, {0x018E,0x01DD,0x018E},
- {0x01DE,0x01DF,0x0041}, {0x01DE,0x01DF,0x0041},
- {0x01E0,0x01E1,0x0041}, {0x01E0,0x01E1,0x0041},
- {0x01E2,0x01E3,0x00C6}, {0x01E2,0x01E3,0x00C6},
- {0x01E4,0x01E5,0x01E4}, {0x01E4,0x01E5,0x01E4},
- {0x01E6,0x01E7,0x0047}, {0x01E6,0x01E7,0x0047},
- {0x01E8,0x01E9,0x004B}, {0x01E8,0x01E9,0x004B},
- {0x01EA,0x01EB,0x004F}, {0x01EA,0x01EB,0x004F},
- {0x01EC,0x01ED,0x004F}, {0x01EC,0x01ED,0x004F},
- {0x01EE,0x01EF,0x01B7}, {0x01EE,0x01EF,0x01B7},
- {0x01F0,0x01F0,0x004A}, {0x01F1,0x01F3,0x01F1},
- {0x01F1,0x01F3,0x01F1}, {0x01F1,0x01F3,0x01F1},
- {0x01F4,0x01F5,0x0047}, {0x01F4,0x01F5,0x0047},
- {0x01F6,0x0195,0x01F6}, {0x01F7,0x01BF,0x01F7},
- {0x01F8,0x01F9,0x004E}, {0x01F8,0x01F9,0x004E},
- {0x01FA,0x01FB,0x0041}, {0x01FA,0x01FB,0x0041},
- {0x01FC,0x01FD,0x00C6}, {0x01FC,0x01FD,0x00C6},
- {0x01FE,0x01FF,0x00D8}, {0x01FE,0x01FF,0x00D8}
-};
-
-static MY_UNICASE_CHARACTER plane02[]={
- {0x0200,0x0201,0x0041}, {0x0200,0x0201,0x0041},
- {0x0202,0x0203,0x0041}, {0x0202,0x0203,0x0041},
- {0x0204,0x0205,0x0045}, {0x0204,0x0205,0x0045},
- {0x0206,0x0207,0x0045}, {0x0206,0x0207,0x0045},
- {0x0208,0x0209,0x0049}, {0x0208,0x0209,0x0049},
- {0x020A,0x020B,0x0049}, {0x020A,0x020B,0x0049},
- {0x020C,0x020D,0x004F}, {0x020C,0x020D,0x004F},
- {0x020E,0x020F,0x004F}, {0x020E,0x020F,0x004F},
- {0x0210,0x0211,0x0052}, {0x0210,0x0211,0x0052},
- {0x0212,0x0213,0x0052}, {0x0212,0x0213,0x0052},
- {0x0214,0x0215,0x0055}, {0x0214,0x0215,0x0055},
- {0x0216,0x0217,0x0055}, {0x0216,0x0217,0x0055},
- {0x0218,0x0219,0x0053}, {0x0218,0x0219,0x0053},
- {0x021A,0x021B,0x0054}, {0x021A,0x021B,0x0054},
- {0x021C,0x021D,0x021C}, {0x021C,0x021D,0x021C},
- {0x021E,0x021F,0x0048}, {0x021E,0x021F,0x0048},
- {0x0220,0x0220,0x0220}, {0x0221,0x0221,0x0221},
- {0x0222,0x0223,0x0222}, {0x0222,0x0223,0x0222},
- {0x0224,0x0225,0x0224}, {0x0224,0x0225,0x0224},
- {0x0226,0x0227,0x0041}, {0x0226,0x0227,0x0041},
- {0x0228,0x0229,0x0045}, {0x0228,0x0229,0x0045},
- {0x022A,0x022B,0x004F}, {0x022A,0x022B,0x004F},
- {0x022C,0x022D,0x004F}, {0x022C,0x022D,0x004F},
- {0x022E,0x022F,0x004F}, {0x022E,0x022F,0x004F},
- {0x0230,0x0231,0x004F}, {0x0230,0x0231,0x004F},
- {0x0232,0x0233,0x0059}, {0x0232,0x0233,0x0059},
- {0x0234,0x0234,0x0234}, {0x0235,0x0235,0x0235},
- {0x0236,0x0236,0x0236}, {0x0237,0x0237,0x0237},
- {0x0238,0x0238,0x0238}, {0x0239,0x0239,0x0239},
- {0x023A,0x023A,0x023A}, {0x023B,0x023B,0x023B},
- {0x023C,0x023C,0x023C}, {0x023D,0x023D,0x023D},
- {0x023E,0x023E,0x023E}, {0x023F,0x023F,0x023F},
- {0x0240,0x0240,0x0240}, {0x0241,0x0241,0x0241},
- {0x0242,0x0242,0x0242}, {0x0243,0x0243,0x0243},
- {0x0244,0x0244,0x0244}, {0x0245,0x0245,0x0245},
- {0x0246,0x0246,0x0246}, {0x0247,0x0247,0x0247},
- {0x0248,0x0248,0x0248}, {0x0249,0x0249,0x0249},
- {0x024A,0x024A,0x024A}, {0x024B,0x024B,0x024B},
- {0x024C,0x024C,0x024C}, {0x024D,0x024D,0x024D},
- {0x024E,0x024E,0x024E}, {0x024F,0x024F,0x024F},
- {0x0250,0x0250,0x0250}, {0x0251,0x0251,0x0251},
- {0x0252,0x0252,0x0252}, {0x0181,0x0253,0x0181},
- {0x0186,0x0254,0x0186}, {0x0255,0x0255,0x0255},
- {0x0189,0x0256,0x0189}, {0x018A,0x0257,0x018A},
- {0x0258,0x0258,0x0258}, {0x018F,0x0259,0x018F},
- {0x025A,0x025A,0x025A}, {0x0190,0x025B,0x0190},
- {0x025C,0x025C,0x025C}, {0x025D,0x025D,0x025D},
- {0x025E,0x025E,0x025E}, {0x025F,0x025F,0x025F},
- {0x0193,0x0260,0x0193}, {0x0261,0x0261,0x0261},
- {0x0262,0x0262,0x0262}, {0x0194,0x0263,0x0194},
- {0x0264,0x0264,0x0264}, {0x0265,0x0265,0x0265},
- {0x0266,0x0266,0x0266}, {0x0267,0x0267,0x0267},
- {0x0197,0x0268,0x0197}, {0x0196,0x0269,0x0196},
- {0x026A,0x026A,0x026A}, {0x026B,0x026B,0x026B},
- {0x026C,0x026C,0x026C}, {0x026D,0x026D,0x026D},
- {0x026E,0x026E,0x026E}, {0x019C,0x026F,0x019C},
- {0x0270,0x0270,0x0270}, {0x0271,0x0271,0x0271},
- {0x019D,0x0272,0x019D}, {0x0273,0x0273,0x0273},
- {0x0274,0x0274,0x0274}, {0x019F,0x0275,0x019F},
- {0x0276,0x0276,0x0276}, {0x0277,0x0277,0x0277},
- {0x0278,0x0278,0x0278}, {0x0279,0x0279,0x0279},
- {0x027A,0x027A,0x027A}, {0x027B,0x027B,0x027B},
- {0x027C,0x027C,0x027C}, {0x027D,0x027D,0x027D},
- {0x027E,0x027E,0x027E}, {0x027F,0x027F,0x027F},
- {0x01A6,0x0280,0x01A6}, {0x0281,0x0281,0x0281},
- {0x0282,0x0282,0x0282}, {0x01A9,0x0283,0x01A9},
- {0x0284,0x0284,0x0284}, {0x0285,0x0285,0x0285},
- {0x0286,0x0286,0x0286}, {0x0287,0x0287,0x0287},
- {0x01AE,0x0288,0x01AE}, {0x0289,0x0289,0x0289},
- {0x01B1,0x028A,0x01B1}, {0x01B2,0x028B,0x01B2},
- {0x028C,0x028C,0x028C}, {0x028D,0x028D,0x028D},
- {0x028E,0x028E,0x028E}, {0x028F,0x028F,0x028F},
- {0x0290,0x0290,0x0290}, {0x0291,0x0291,0x0291},
- {0x01B7,0x0292,0x01B7}, {0x0293,0x0293,0x0293},
- {0x0294,0x0294,0x0294}, {0x0295,0x0295,0x0295},
- {0x0296,0x0296,0x0296}, {0x0297,0x0297,0x0297},
- {0x0298,0x0298,0x0298}, {0x0299,0x0299,0x0299},
- {0x029A,0x029A,0x029A}, {0x029B,0x029B,0x029B},
- {0x029C,0x029C,0x029C}, {0x029D,0x029D,0x029D},
- {0x029E,0x029E,0x029E}, {0x029F,0x029F,0x029F},
- {0x02A0,0x02A0,0x02A0}, {0x02A1,0x02A1,0x02A1},
- {0x02A2,0x02A2,0x02A2}, {0x02A3,0x02A3,0x02A3},
- {0x02A4,0x02A4,0x02A4}, {0x02A5,0x02A5,0x02A5},
- {0x02A6,0x02A6,0x02A6}, {0x02A7,0x02A7,0x02A7},
- {0x02A8,0x02A8,0x02A8}, {0x02A9,0x02A9,0x02A9},
- {0x02AA,0x02AA,0x02AA}, {0x02AB,0x02AB,0x02AB},
- {0x02AC,0x02AC,0x02AC}, {0x02AD,0x02AD,0x02AD},
- {0x02AE,0x02AE,0x02AE}, {0x02AF,0x02AF,0x02AF},
- {0x02B0,0x02B0,0x02B0}, {0x02B1,0x02B1,0x02B1},
- {0x02B2,0x02B2,0x02B2}, {0x02B3,0x02B3,0x02B3},
- {0x02B4,0x02B4,0x02B4}, {0x02B5,0x02B5,0x02B5},
- {0x02B6,0x02B6,0x02B6}, {0x02B7,0x02B7,0x02B7},
- {0x02B8,0x02B8,0x02B8}, {0x02B9,0x02B9,0x02B9},
- {0x02BA,0x02BA,0x02BA}, {0x02BB,0x02BB,0x02BB},
- {0x02BC,0x02BC,0x02BC}, {0x02BD,0x02BD,0x02BD},
- {0x02BE,0x02BE,0x02BE}, {0x02BF,0x02BF,0x02BF},
- {0x02C0,0x02C0,0x02C0}, {0x02C1,0x02C1,0x02C1},
- {0x02C2,0x02C2,0x02C2}, {0x02C3,0x02C3,0x02C3},
- {0x02C4,0x02C4,0x02C4}, {0x02C5,0x02C5,0x02C5},
- {0x02C6,0x02C6,0x02C6}, {0x02C7,0x02C7,0x02C7},
- {0x02C8,0x02C8,0x02C8}, {0x02C9,0x02C9,0x02C9},
- {0x02CA,0x02CA,0x02CA}, {0x02CB,0x02CB,0x02CB},
- {0x02CC,0x02CC,0x02CC}, {0x02CD,0x02CD,0x02CD},
- {0x02CE,0x02CE,0x02CE}, {0x02CF,0x02CF,0x02CF},
- {0x02D0,0x02D0,0x02D0}, {0x02D1,0x02D1,0x02D1},
- {0x02D2,0x02D2,0x02D2}, {0x02D3,0x02D3,0x02D3},
- {0x02D4,0x02D4,0x02D4}, {0x02D5,0x02D5,0x02D5},
- {0x02D6,0x02D6,0x02D6}, {0x02D7,0x02D7,0x02D7},
- {0x02D8,0x02D8,0x02D8}, {0x02D9,0x02D9,0x02D9},
- {0x02DA,0x02DA,0x02DA}, {0x02DB,0x02DB,0x02DB},
- {0x02DC,0x02DC,0x02DC}, {0x02DD,0x02DD,0x02DD},
- {0x02DE,0x02DE,0x02DE}, {0x02DF,0x02DF,0x02DF},
- {0x02E0,0x02E0,0x02E0}, {0x02E1,0x02E1,0x02E1},
- {0x02E2,0x02E2,0x02E2}, {0x02E3,0x02E3,0x02E3},
- {0x02E4,0x02E4,0x02E4}, {0x02E5,0x02E5,0x02E5},
- {0x02E6,0x02E6,0x02E6}, {0x02E7,0x02E7,0x02E7},
- {0x02E8,0x02E8,0x02E8}, {0x02E9,0x02E9,0x02E9},
- {0x02EA,0x02EA,0x02EA}, {0x02EB,0x02EB,0x02EB},
- {0x02EC,0x02EC,0x02EC}, {0x02ED,0x02ED,0x02ED},
- {0x02EE,0x02EE,0x02EE}, {0x02EF,0x02EF,0x02EF},
- {0x02F0,0x02F0,0x02F0}, {0x02F1,0x02F1,0x02F1},
- {0x02F2,0x02F2,0x02F2}, {0x02F3,0x02F3,0x02F3},
- {0x02F4,0x02F4,0x02F4}, {0x02F5,0x02F5,0x02F5},
- {0x02F6,0x02F6,0x02F6}, {0x02F7,0x02F7,0x02F7},
- {0x02F8,0x02F8,0x02F8}, {0x02F9,0x02F9,0x02F9},
- {0x02FA,0x02FA,0x02FA}, {0x02FB,0x02FB,0x02FB},
- {0x02FC,0x02FC,0x02FC}, {0x02FD,0x02FD,0x02FD},
- {0x02FE,0x02FE,0x02FE}, {0x02FF,0x02FF,0x02FF}
-};
-
-static MY_UNICASE_CHARACTER plane03[]={
- {0x0300,0x0300,0x0300}, {0x0301,0x0301,0x0301},
- {0x0302,0x0302,0x0302}, {0x0303,0x0303,0x0303},
- {0x0304,0x0304,0x0304}, {0x0305,0x0305,0x0305},
- {0x0306,0x0306,0x0306}, {0x0307,0x0307,0x0307},
- {0x0308,0x0308,0x0308}, {0x0309,0x0309,0x0309},
- {0x030A,0x030A,0x030A}, {0x030B,0x030B,0x030B},
- {0x030C,0x030C,0x030C}, {0x030D,0x030D,0x030D},
- {0x030E,0x030E,0x030E}, {0x030F,0x030F,0x030F},
- {0x0310,0x0310,0x0310}, {0x0311,0x0311,0x0311},
- {0x0312,0x0312,0x0312}, {0x0313,0x0313,0x0313},
- {0x0314,0x0314,0x0314}, {0x0315,0x0315,0x0315},
- {0x0316,0x0316,0x0316}, {0x0317,0x0317,0x0317},
- {0x0318,0x0318,0x0318}, {0x0319,0x0319,0x0319},
- {0x031A,0x031A,0x031A}, {0x031B,0x031B,0x031B},
- {0x031C,0x031C,0x031C}, {0x031D,0x031D,0x031D},
- {0x031E,0x031E,0x031E}, {0x031F,0x031F,0x031F},
- {0x0320,0x0320,0x0320}, {0x0321,0x0321,0x0321},
- {0x0322,0x0322,0x0322}, {0x0323,0x0323,0x0323},
- {0x0324,0x0324,0x0324}, {0x0325,0x0325,0x0325},
- {0x0326,0x0326,0x0326}, {0x0327,0x0327,0x0327},
- {0x0328,0x0328,0x0328}, {0x0329,0x0329,0x0329},
- {0x032A,0x032A,0x032A}, {0x032B,0x032B,0x032B},
- {0x032C,0x032C,0x032C}, {0x032D,0x032D,0x032D},
- {0x032E,0x032E,0x032E}, {0x032F,0x032F,0x032F},
- {0x0330,0x0330,0x0330}, {0x0331,0x0331,0x0331},
- {0x0332,0x0332,0x0332}, {0x0333,0x0333,0x0333},
- {0x0334,0x0334,0x0334}, {0x0335,0x0335,0x0335},
- {0x0336,0x0336,0x0336}, {0x0337,0x0337,0x0337},
- {0x0338,0x0338,0x0338}, {0x0339,0x0339,0x0339},
- {0x033A,0x033A,0x033A}, {0x033B,0x033B,0x033B},
- {0x033C,0x033C,0x033C}, {0x033D,0x033D,0x033D},
- {0x033E,0x033E,0x033E}, {0x033F,0x033F,0x033F},
- {0x0340,0x0340,0x0340}, {0x0341,0x0341,0x0341},
- {0x0342,0x0342,0x0342}, {0x0343,0x0343,0x0343},
- {0x0344,0x0344,0x0344}, {0x0399,0x0345,0x0399},
- {0x0346,0x0346,0x0346}, {0x0347,0x0347,0x0347},
- {0x0348,0x0348,0x0348}, {0x0349,0x0349,0x0349},
- {0x034A,0x034A,0x034A}, {0x034B,0x034B,0x034B},
- {0x034C,0x034C,0x034C}, {0x034D,0x034D,0x034D},
- {0x034E,0x034E,0x034E}, {0x034F,0x034F,0x034F},
- {0x0350,0x0350,0x0350}, {0x0351,0x0351,0x0351},
- {0x0352,0x0352,0x0352}, {0x0353,0x0353,0x0353},
- {0x0354,0x0354,0x0354}, {0x0355,0x0355,0x0355},
- {0x0356,0x0356,0x0356}, {0x0357,0x0357,0x0357},
- {0x0358,0x0358,0x0358}, {0x0359,0x0359,0x0359},
- {0x035A,0x035A,0x035A}, {0x035B,0x035B,0x035B},
- {0x035C,0x035C,0x035C}, {0x035D,0x035D,0x035D},
- {0x035E,0x035E,0x035E}, {0x035F,0x035F,0x035F},
- {0x0360,0x0360,0x0360}, {0x0361,0x0361,0x0361},
- {0x0362,0x0362,0x0362}, {0x0363,0x0363,0x0363},
- {0x0364,0x0364,0x0364}, {0x0365,0x0365,0x0365},
- {0x0366,0x0366,0x0366}, {0x0367,0x0367,0x0367},
- {0x0368,0x0368,0x0368}, {0x0369,0x0369,0x0369},
- {0x036A,0x036A,0x036A}, {0x036B,0x036B,0x036B},
- {0x036C,0x036C,0x036C}, {0x036D,0x036D,0x036D},
- {0x036E,0x036E,0x036E}, {0x036F,0x036F,0x036F},
- {0x0370,0x0370,0x0370}, {0x0371,0x0371,0x0371},
- {0x0372,0x0372,0x0372}, {0x0373,0x0373,0x0373},
- {0x0374,0x0374,0x0374}, {0x0375,0x0375,0x0375},
- {0x0376,0x0376,0x0376}, {0x0377,0x0377,0x0377},
- {0x0378,0x0378,0x0378}, {0x0379,0x0379,0x0379},
- {0x037A,0x037A,0x037A}, {0x037B,0x037B,0x037B},
- {0x037C,0x037C,0x037C}, {0x037D,0x037D,0x037D},
- {0x037E,0x037E,0x037E}, {0x037F,0x037F,0x037F},
- {0x0380,0x0380,0x0380}, {0x0381,0x0381,0x0381},
- {0x0382,0x0382,0x0382}, {0x0383,0x0383,0x0383},
- {0x0384,0x0384,0x0384}, {0x0385,0x0385,0x0385},
- {0x0386,0x03AC,0x0391}, {0x0387,0x0387,0x0387},
- {0x0388,0x03AD,0x0395}, {0x0389,0x03AE,0x0397},
- {0x038A,0x03AF,0x0399}, {0x038B,0x038B,0x038B},
- {0x038C,0x03CC,0x039F}, {0x038D,0x038D,0x038D},
- {0x038E,0x03CD,0x03A5}, {0x038F,0x03CE,0x03A9},
- {0x0390,0x0390,0x0399}, {0x0391,0x03B1,0x0391},
- {0x0392,0x03B2,0x0392}, {0x0393,0x03B3,0x0393},
- {0x0394,0x03B4,0x0394}, {0x0395,0x03B5,0x0395},
- {0x0396,0x03B6,0x0396}, {0x0397,0x03B7,0x0397},
- {0x0398,0x03B8,0x0398}, {0x0399,0x03B9,0x0399},
- {0x039A,0x03BA,0x039A}, {0x039B,0x03BB,0x039B},
- {0x039C,0x03BC,0x039C}, {0x039D,0x03BD,0x039D},
- {0x039E,0x03BE,0x039E}, {0x039F,0x03BF,0x039F},
- {0x03A0,0x03C0,0x03A0}, {0x03A1,0x03C1,0x03A1},
- {0x03A2,0x03A2,0x03A2}, {0x03A3,0x03C3,0x03A3},
- {0x03A4,0x03C4,0x03A4}, {0x03A5,0x03C5,0x03A5},
- {0x03A6,0x03C6,0x03A6}, {0x03A7,0x03C7,0x03A7},
- {0x03A8,0x03C8,0x03A8}, {0x03A9,0x03C9,0x03A9},
- {0x03AA,0x03CA,0x0399}, {0x03AB,0x03CB,0x03A5},
- {0x0386,0x03AC,0x0391}, {0x0388,0x03AD,0x0395},
- {0x0389,0x03AE,0x0397}, {0x038A,0x03AF,0x0399},
- {0x03B0,0x03B0,0x03A5}, {0x0391,0x03B1,0x0391},
- {0x0392,0x03B2,0x0392}, {0x0393,0x03B3,0x0393},
- {0x0394,0x03B4,0x0394}, {0x0395,0x03B5,0x0395},
- {0x0396,0x03B6,0x0396}, {0x0397,0x03B7,0x0397},
- {0x0398,0x03B8,0x0398}, {0x0399,0x03B9,0x0399},
- {0x039A,0x03BA,0x039A}, {0x039B,0x03BB,0x039B},
- {0x039C,0x03BC,0x039C}, {0x039D,0x03BD,0x039D},
- {0x039E,0x03BE,0x039E}, {0x039F,0x03BF,0x039F},
- {0x03A0,0x03C0,0x03A0}, {0x03A1,0x03C1,0x03A1},
- {0x03A3,0x03C2,0x03A3}, {0x03A3,0x03C3,0x03A3},
- {0x03A4,0x03C4,0x03A4}, {0x03A5,0x03C5,0x03A5},
- {0x03A6,0x03C6,0x03A6}, {0x03A7,0x03C7,0x03A7},
- {0x03A8,0x03C8,0x03A8}, {0x03A9,0x03C9,0x03A9},
- {0x03AA,0x03CA,0x0399}, {0x03AB,0x03CB,0x03A5},
- {0x038C,0x03CC,0x039F}, {0x038E,0x03CD,0x03A5},
- {0x038F,0x03CE,0x03A9}, {0x03CF,0x03CF,0x03CF},
- {0x0392,0x03D0,0x0392}, {0x0398,0x03D1,0x0398},
- {0x03D2,0x03D2,0x03D2}, {0x03D3,0x03D3,0x03D2},
- {0x03D4,0x03D4,0x03D2}, {0x03A6,0x03D5,0x03A6},
- {0x03A0,0x03D6,0x03A0}, {0x03D7,0x03D7,0x03D7},
- {0x03D8,0x03D8,0x03D8}, {0x03D9,0x03D9,0x03D9},
- {0x03DA,0x03DB,0x03DA}, {0x03DA,0x03DB,0x03DA},
- {0x03DC,0x03DD,0x03DC}, {0x03DC,0x03DD,0x03DC},
- {0x03DE,0x03DF,0x03DE}, {0x03DE,0x03DF,0x03DE},
- {0x03E0,0x03E1,0x03E0}, {0x03E0,0x03E1,0x03E0},
- {0x03E2,0x03E3,0x03E2}, {0x03E2,0x03E3,0x03E2},
- {0x03E4,0x03E5,0x03E4}, {0x03E4,0x03E5,0x03E4},
- {0x03E6,0x03E7,0x03E6}, {0x03E6,0x03E7,0x03E6},
- {0x03E8,0x03E9,0x03E8}, {0x03E8,0x03E9,0x03E8},
- {0x03EA,0x03EB,0x03EA}, {0x03EA,0x03EB,0x03EA},
- {0x03EC,0x03ED,0x03EC}, {0x03EC,0x03ED,0x03EC},
- {0x03EE,0x03EF,0x03EE}, {0x03EE,0x03EF,0x03EE},
- {0x039A,0x03F0,0x039A}, {0x03A1,0x03F1,0x03A1},
- {0x03A3,0x03F2,0x03A3}, {0x03F3,0x03F3,0x03F3},
- {0x03F4,0x03F4,0x03F4}, {0x03F5,0x03F5,0x03F5},
- {0x03F6,0x03F6,0x03F6}, {0x03F7,0x03F7,0x03F7},
- {0x03F8,0x03F8,0x03F8}, {0x03F9,0x03F9,0x03F9},
- {0x03FA,0x03FA,0x03FA}, {0x03FB,0x03FB,0x03FB},
- {0x03FC,0x03FC,0x03FC}, {0x03FD,0x03FD,0x03FD},
- {0x03FE,0x03FE,0x03FE}, {0x03FF,0x03FF,0x03FF}
-};
-
-static MY_UNICASE_CHARACTER plane04[]={
- {0x0400,0x0450,0x0415}, {0x0401,0x0451,0x0415},
- {0x0402,0x0452,0x0402}, {0x0403,0x0453,0x0413},
- {0x0404,0x0454,0x0404}, {0x0405,0x0455,0x0405},
- {0x0406,0x0456,0x0406}, {0x0407,0x0457,0x0406},
- {0x0408,0x0458,0x0408}, {0x0409,0x0459,0x0409},
- {0x040A,0x045A,0x040A}, {0x040B,0x045B,0x040B},
- {0x040C,0x045C,0x041A}, {0x040D,0x045D,0x0418},
- {0x040E,0x045E,0x0423}, {0x040F,0x045F,0x040F},
- {0x0410,0x0430,0x0410}, {0x0411,0x0431,0x0411},
- {0x0412,0x0432,0x0412}, {0x0413,0x0433,0x0413},
- {0x0414,0x0434,0x0414}, {0x0415,0x0435,0x0415},
- {0x0416,0x0436,0x0416}, {0x0417,0x0437,0x0417},
- {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0419},
- {0x041A,0x043A,0x041A}, {0x041B,0x043B,0x041B},
- {0x041C,0x043C,0x041C}, {0x041D,0x043D,0x041D},
- {0x041E,0x043E,0x041E}, {0x041F,0x043F,0x041F},
- {0x0420,0x0440,0x0420}, {0x0421,0x0441,0x0421},
- {0x0422,0x0442,0x0422}, {0x0423,0x0443,0x0423},
- {0x0424,0x0444,0x0424}, {0x0425,0x0445,0x0425},
- {0x0426,0x0446,0x0426}, {0x0427,0x0447,0x0427},
- {0x0428,0x0448,0x0428}, {0x0429,0x0449,0x0429},
- {0x042A,0x044A,0x042A}, {0x042B,0x044B,0x042B},
- {0x042C,0x044C,0x042C}, {0x042D,0x044D,0x042D},
- {0x042E,0x044E,0x042E}, {0x042F,0x044F,0x042F},
- {0x0410,0x0430,0x0410}, {0x0411,0x0431,0x0411},
- {0x0412,0x0432,0x0412}, {0x0413,0x0433,0x0413},
- {0x0414,0x0434,0x0414}, {0x0415,0x0435,0x0415},
- {0x0416,0x0436,0x0416}, {0x0417,0x0437,0x0417},
- {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0419},
- {0x041A,0x043A,0x041A}, {0x041B,0x043B,0x041B},
- {0x041C,0x043C,0x041C}, {0x041D,0x043D,0x041D},
- {0x041E,0x043E,0x041E}, {0x041F,0x043F,0x041F},
- {0x0420,0x0440,0x0420}, {0x0421,0x0441,0x0421},
- {0x0422,0x0442,0x0422}, {0x0423,0x0443,0x0423},
- {0x0424,0x0444,0x0424}, {0x0425,0x0445,0x0425},
- {0x0426,0x0446,0x0426}, {0x0427,0x0447,0x0427},
- {0x0428,0x0448,0x0428}, {0x0429,0x0449,0x0429},
- {0x042A,0x044A,0x042A}, {0x042B,0x044B,0x042B},
- {0x042C,0x044C,0x042C}, {0x042D,0x044D,0x042D},
- {0x042E,0x044E,0x042E}, {0x042F,0x044F,0x042F},
- {0x0400,0x0450,0x0415}, {0x0401,0x0451,0x0415},
- {0x0402,0x0452,0x0402}, {0x0403,0x0453,0x0413},
- {0x0404,0x0454,0x0404}, {0x0405,0x0455,0x0405},
- {0x0406,0x0456,0x0406}, {0x0407,0x0457,0x0406},
- {0x0408,0x0458,0x0408}, {0x0409,0x0459,0x0409},
- {0x040A,0x045A,0x040A}, {0x040B,0x045B,0x040B},
- {0x040C,0x045C,0x041A}, {0x040D,0x045D,0x0418},
- {0x040E,0x045E,0x0423}, {0x040F,0x045F,0x040F},
- {0x0460,0x0461,0x0460}, {0x0460,0x0461,0x0460},
- {0x0462,0x0463,0x0462}, {0x0462,0x0463,0x0462},
- {0x0464,0x0465,0x0464}, {0x0464,0x0465,0x0464},
- {0x0466,0x0467,0x0466}, {0x0466,0x0467,0x0466},
- {0x0468,0x0469,0x0468}, {0x0468,0x0469,0x0468},
- {0x046A,0x046B,0x046A}, {0x046A,0x046B,0x046A},
- {0x046C,0x046D,0x046C}, {0x046C,0x046D,0x046C},
- {0x046E,0x046F,0x046E}, {0x046E,0x046F,0x046E},
- {0x0470,0x0471,0x0470}, {0x0470,0x0471,0x0470},
- {0x0472,0x0473,0x0472}, {0x0472,0x0473,0x0472},
- {0x0474,0x0475,0x0474}, {0x0474,0x0475,0x0474},
- {0x0476,0x0477,0x0474}, {0x0476,0x0477,0x0474},
- {0x0478,0x0479,0x0478}, {0x0478,0x0479,0x0478},
- {0x047A,0x047B,0x047A}, {0x047A,0x047B,0x047A},
- {0x047C,0x047D,0x047C}, {0x047C,0x047D,0x047C},
- {0x047E,0x047F,0x047E}, {0x047E,0x047F,0x047E},
- {0x0480,0x0481,0x0480}, {0x0480,0x0481,0x0480},
- {0x0482,0x0482,0x0482}, {0x0483,0x0483,0x0483},
- {0x0484,0x0484,0x0484}, {0x0485,0x0485,0x0485},
- {0x0486,0x0486,0x0486}, {0x0487,0x0487,0x0487},
- {0x0488,0x0488,0x0488}, {0x0489,0x0489,0x0489},
- {0x048A,0x048A,0x048A}, {0x048B,0x048B,0x048B},
- {0x048C,0x048D,0x048C}, {0x048C,0x048D,0x048C},
- {0x048E,0x048F,0x048E}, {0x048E,0x048F,0x048E},
- {0x0490,0x0491,0x0490}, {0x0490,0x0491,0x0490},
- {0x0492,0x0493,0x0492}, {0x0492,0x0493,0x0492},
- {0x0494,0x0495,0x0494}, {0x0494,0x0495,0x0494},
- {0x0496,0x0497,0x0496}, {0x0496,0x0497,0x0496},
- {0x0498,0x0499,0x0498}, {0x0498,0x0499,0x0498},
- {0x049A,0x049B,0x049A}, {0x049A,0x049B,0x049A},
- {0x049C,0x049D,0x049C}, {0x049C,0x049D,0x049C},
- {0x049E,0x049F,0x049E}, {0x049E,0x049F,0x049E},
- {0x04A0,0x04A1,0x04A0}, {0x04A0,0x04A1,0x04A0},
- {0x04A2,0x04A3,0x04A2}, {0x04A2,0x04A3,0x04A2},
- {0x04A4,0x04A5,0x04A4}, {0x04A4,0x04A5,0x04A4},
- {0x04A6,0x04A7,0x04A6}, {0x04A6,0x04A7,0x04A6},
- {0x04A8,0x04A9,0x04A8}, {0x04A8,0x04A9,0x04A8},
- {0x04AA,0x04AB,0x04AA}, {0x04AA,0x04AB,0x04AA},
- {0x04AC,0x04AD,0x04AC}, {0x04AC,0x04AD,0x04AC},
- {0x04AE,0x04AF,0x04AE}, {0x04AE,0x04AF,0x04AE},
- {0x04B0,0x04B1,0x04B0}, {0x04B0,0x04B1,0x04B0},
- {0x04B2,0x04B3,0x04B2}, {0x04B2,0x04B3,0x04B2},
- {0x04B4,0x04B5,0x04B4}, {0x04B4,0x04B5,0x04B4},
- {0x04B6,0x04B7,0x04B6}, {0x04B6,0x04B7,0x04B6},
- {0x04B8,0x04B9,0x04B8}, {0x04B8,0x04B9,0x04B8},
- {0x04BA,0x04BB,0x04BA}, {0x04BA,0x04BB,0x04BA},
- {0x04BC,0x04BD,0x04BC}, {0x04BC,0x04BD,0x04BC},
- {0x04BE,0x04BF,0x04BE}, {0x04BE,0x04BF,0x04BE},
- {0x04C0,0x04C0,0x04C0}, {0x04C1,0x04C2,0x0416},
- {0x04C1,0x04C2,0x0416}, {0x04C3,0x04C4,0x04C3},
- {0x04C3,0x04C4,0x04C3}, {0x04C5,0x04C5,0x04C5},
- {0x04C6,0x04C6,0x04C6}, {0x04C7,0x04C8,0x04C7},
- {0x04C7,0x04C8,0x04C7}, {0x04C9,0x04C9,0x04C9},
- {0x04CA,0x04CA,0x04CA}, {0x04CB,0x04CC,0x04CB},
- {0x04CB,0x04CC,0x04CB}, {0x04CD,0x04CD,0x04CD},
- {0x04CE,0x04CE,0x04CE}, {0x04CF,0x04CF,0x04CF},
- {0x04D0,0x04D1,0x0410}, {0x04D0,0x04D1,0x0410},
- {0x04D2,0x04D3,0x0410}, {0x04D2,0x04D3,0x0410},
- {0x04D4,0x04D5,0x04D4}, {0x04D4,0x04D5,0x04D4},
- {0x04D6,0x04D7,0x0415}, {0x04D6,0x04D7,0x0415},
- {0x04D8,0x04D9,0x04D8}, {0x04D8,0x04D9,0x04D8},
- {0x04DA,0x04DB,0x04D8}, {0x04DA,0x04DB,0x04D8},
- {0x04DC,0x04DD,0x0416}, {0x04DC,0x04DD,0x0416},
- {0x04DE,0x04DF,0x0417}, {0x04DE,0x04DF,0x0417},
- {0x04E0,0x04E1,0x04E0}, {0x04E0,0x04E1,0x04E0},
- {0x04E2,0x04E3,0x0418}, {0x04E2,0x04E3,0x0418},
- {0x04E4,0x04E5,0x0418}, {0x04E4,0x04E5,0x0418},
- {0x04E6,0x04E7,0x041E}, {0x04E6,0x04E7,0x041E},
- {0x04E8,0x04E9,0x04E8}, {0x04E8,0x04E9,0x04E8},
- {0x04EA,0x04EB,0x04E8}, {0x04EA,0x04EB,0x04E8},
- {0x04EC,0x04ED,0x042D}, {0x04EC,0x04ED,0x042D},
- {0x04EE,0x04EF,0x0423}, {0x04EE,0x04EF,0x0423},
- {0x04F0,0x04F1,0x0423}, {0x04F0,0x04F1,0x0423},
- {0x04F2,0x04F3,0x0423}, {0x04F2,0x04F3,0x0423},
- {0x04F4,0x04F5,0x0427}, {0x04F4,0x04F5,0x0427},
- {0x04F6,0x04F6,0x04F6}, {0x04F7,0x04F7,0x04F7},
- {0x04F8,0x04F9,0x042B}, {0x04F8,0x04F9,0x042B},
- {0x04FA,0x04FA,0x04FA}, {0x04FB,0x04FB,0x04FB},
- {0x04FC,0x04FC,0x04FC}, {0x04FD,0x04FD,0x04FD},
- {0x04FE,0x04FE,0x04FE}, {0x04FF,0x04FF,0x04FF}
-};
-
-static MY_UNICASE_CHARACTER plane05[]={
- {0x0500,0x0500,0x0500}, {0x0501,0x0501,0x0501},
- {0x0502,0x0502,0x0502}, {0x0503,0x0503,0x0503},
- {0x0504,0x0504,0x0504}, {0x0505,0x0505,0x0505},
- {0x0506,0x0506,0x0506}, {0x0507,0x0507,0x0507},
- {0x0508,0x0508,0x0508}, {0x0509,0x0509,0x0509},
- {0x050A,0x050A,0x050A}, {0x050B,0x050B,0x050B},
- {0x050C,0x050C,0x050C}, {0x050D,0x050D,0x050D},
- {0x050E,0x050E,0x050E}, {0x050F,0x050F,0x050F},
- {0x0510,0x0510,0x0510}, {0x0511,0x0511,0x0511},
- {0x0512,0x0512,0x0512}, {0x0513,0x0513,0x0513},
- {0x0514,0x0514,0x0514}, {0x0515,0x0515,0x0515},
- {0x0516,0x0516,0x0516}, {0x0517,0x0517,0x0517},
- {0x0518,0x0518,0x0518}, {0x0519,0x0519,0x0519},
- {0x051A,0x051A,0x051A}, {0x051B,0x051B,0x051B},
- {0x051C,0x051C,0x051C}, {0x051D,0x051D,0x051D},
- {0x051E,0x051E,0x051E}, {0x051F,0x051F,0x051F},
- {0x0520,0x0520,0x0520}, {0x0521,0x0521,0x0521},
- {0x0522,0x0522,0x0522}, {0x0523,0x0523,0x0523},
- {0x0524,0x0524,0x0524}, {0x0525,0x0525,0x0525},
- {0x0526,0x0526,0x0526}, {0x0527,0x0527,0x0527},
- {0x0528,0x0528,0x0528}, {0x0529,0x0529,0x0529},
- {0x052A,0x052A,0x052A}, {0x052B,0x052B,0x052B},
- {0x052C,0x052C,0x052C}, {0x052D,0x052D,0x052D},
- {0x052E,0x052E,0x052E}, {0x052F,0x052F,0x052F},
- {0x0530,0x0530,0x0530}, {0x0531,0x0561,0x0531},
- {0x0532,0x0562,0x0532}, {0x0533,0x0563,0x0533},
- {0x0534,0x0564,0x0534}, {0x0535,0x0565,0x0535},
- {0x0536,0x0566,0x0536}, {0x0537,0x0567,0x0537},
- {0x0538,0x0568,0x0538}, {0x0539,0x0569,0x0539},
- {0x053A,0x056A,0x053A}, {0x053B,0x056B,0x053B},
- {0x053C,0x056C,0x053C}, {0x053D,0x056D,0x053D},
- {0x053E,0x056E,0x053E}, {0x053F,0x056F,0x053F},
- {0x0540,0x0570,0x0540}, {0x0541,0x0571,0x0541},
- {0x0542,0x0572,0x0542}, {0x0543,0x0573,0x0543},
- {0x0544,0x0574,0x0544}, {0x0545,0x0575,0x0545},
- {0x0546,0x0576,0x0546}, {0x0547,0x0577,0x0547},
- {0x0548,0x0578,0x0548}, {0x0549,0x0579,0x0549},
- {0x054A,0x057A,0x054A}, {0x054B,0x057B,0x054B},
- {0x054C,0x057C,0x054C}, {0x054D,0x057D,0x054D},
- {0x054E,0x057E,0x054E}, {0x054F,0x057F,0x054F},
- {0x0550,0x0580,0x0550}, {0x0551,0x0581,0x0551},
- {0x0552,0x0582,0x0552}, {0x0553,0x0583,0x0553},
- {0x0554,0x0584,0x0554}, {0x0555,0x0585,0x0555},
- {0x0556,0x0586,0x0556}, {0x0557,0x0557,0x0557},
- {0x0558,0x0558,0x0558}, {0x0559,0x0559,0x0559},
- {0x055A,0x055A,0x055A}, {0x055B,0x055B,0x055B},
- {0x055C,0x055C,0x055C}, {0x055D,0x055D,0x055D},
- {0x055E,0x055E,0x055E}, {0x055F,0x055F,0x055F},
- {0x0560,0x0560,0x0560}, {0x0531,0x0561,0x0531},
- {0x0532,0x0562,0x0532}, {0x0533,0x0563,0x0533},
- {0x0534,0x0564,0x0534}, {0x0535,0x0565,0x0535},
- {0x0536,0x0566,0x0536}, {0x0537,0x0567,0x0537},
- {0x0538,0x0568,0x0538}, {0x0539,0x0569,0x0539},
- {0x053A,0x056A,0x053A}, {0x053B,0x056B,0x053B},
- {0x053C,0x056C,0x053C}, {0x053D,0x056D,0x053D},
- {0x053E,0x056E,0x053E}, {0x053F,0x056F,0x053F},
- {0x0540,0x0570,0x0540}, {0x0541,0x0571,0x0541},
- {0x0542,0x0572,0x0542}, {0x0543,0x0573,0x0543},
- {0x0544,0x0574,0x0544}, {0x0545,0x0575,0x0545},
- {0x0546,0x0576,0x0546}, {0x0547,0x0577,0x0547},
- {0x0548,0x0578,0x0548}, {0x0549,0x0579,0x0549},
- {0x054A,0x057A,0x054A}, {0x054B,0x057B,0x054B},
- {0x054C,0x057C,0x054C}, {0x054D,0x057D,0x054D},
- {0x054E,0x057E,0x054E}, {0x054F,0x057F,0x054F},
- {0x0550,0x0580,0x0550}, {0x0551,0x0581,0x0551},
- {0x0552,0x0582,0x0552}, {0x0553,0x0583,0x0553},
- {0x0554,0x0584,0x0554}, {0x0555,0x0585,0x0555},
- {0x0556,0x0586,0x0556}, {0x0587,0x0587,0x0587},
- {0x0588,0x0588,0x0588}, {0x0589,0x0589,0x0589},
- {0x058A,0x058A,0x058A}, {0x058B,0x058B,0x058B},
- {0x058C,0x058C,0x058C}, {0x058D,0x058D,0x058D},
- {0x058E,0x058E,0x058E}, {0x058F,0x058F,0x058F},
- {0x0590,0x0590,0x0590}, {0x0591,0x0591,0x0591},
- {0x0592,0x0592,0x0592}, {0x0593,0x0593,0x0593},
- {0x0594,0x0594,0x0594}, {0x0595,0x0595,0x0595},
- {0x0596,0x0596,0x0596}, {0x0597,0x0597,0x0597},
- {0x0598,0x0598,0x0598}, {0x0599,0x0599,0x0599},
- {0x059A,0x059A,0x059A}, {0x059B,0x059B,0x059B},
- {0x059C,0x059C,0x059C}, {0x059D,0x059D,0x059D},
- {0x059E,0x059E,0x059E}, {0x059F,0x059F,0x059F},
- {0x05A0,0x05A0,0x05A0}, {0x05A1,0x05A1,0x05A1},
- {0x05A2,0x05A2,0x05A2}, {0x05A3,0x05A3,0x05A3},
- {0x05A4,0x05A4,0x05A4}, {0x05A5,0x05A5,0x05A5},
- {0x05A6,0x05A6,0x05A6}, {0x05A7,0x05A7,0x05A7},
- {0x05A8,0x05A8,0x05A8}, {0x05A9,0x05A9,0x05A9},
- {0x05AA,0x05AA,0x05AA}, {0x05AB,0x05AB,0x05AB},
- {0x05AC,0x05AC,0x05AC}, {0x05AD,0x05AD,0x05AD},
- {0x05AE,0x05AE,0x05AE}, {0x05AF,0x05AF,0x05AF},
- {0x05B0,0x05B0,0x05B0}, {0x05B1,0x05B1,0x05B1},
- {0x05B2,0x05B2,0x05B2}, {0x05B3,0x05B3,0x05B3},
- {0x05B4,0x05B4,0x05B4}, {0x05B5,0x05B5,0x05B5},
- {0x05B6,0x05B6,0x05B6}, {0x05B7,0x05B7,0x05B7},
- {0x05B8,0x05B8,0x05B8}, {0x05B9,0x05B9,0x05B9},
- {0x05BA,0x05BA,0x05BA}, {0x05BB,0x05BB,0x05BB},
- {0x05BC,0x05BC,0x05BC}, {0x05BD,0x05BD,0x05BD},
- {0x05BE,0x05BE,0x05BE}, {0x05BF,0x05BF,0x05BF},
- {0x05C0,0x05C0,0x05C0}, {0x05C1,0x05C1,0x05C1},
- {0x05C2,0x05C2,0x05C2}, {0x05C3,0x05C3,0x05C3},
- {0x05C4,0x05C4,0x05C4}, {0x05C5,0x05C5,0x05C5},
- {0x05C6,0x05C6,0x05C6}, {0x05C7,0x05C7,0x05C7},
- {0x05C8,0x05C8,0x05C8}, {0x05C9,0x05C9,0x05C9},
- {0x05CA,0x05CA,0x05CA}, {0x05CB,0x05CB,0x05CB},
- {0x05CC,0x05CC,0x05CC}, {0x05CD,0x05CD,0x05CD},
- {0x05CE,0x05CE,0x05CE}, {0x05CF,0x05CF,0x05CF},
- {0x05D0,0x05D0,0x05D0}, {0x05D1,0x05D1,0x05D1},
- {0x05D2,0x05D2,0x05D2}, {0x05D3,0x05D3,0x05D3},
- {0x05D4,0x05D4,0x05D4}, {0x05D5,0x05D5,0x05D5},
- {0x05D6,0x05D6,0x05D6}, {0x05D7,0x05D7,0x05D7},
- {0x05D8,0x05D8,0x05D8}, {0x05D9,0x05D9,0x05D9},
- {0x05DA,0x05DA,0x05DA}, {0x05DB,0x05DB,0x05DB},
- {0x05DC,0x05DC,0x05DC}, {0x05DD,0x05DD,0x05DD},
- {0x05DE,0x05DE,0x05DE}, {0x05DF,0x05DF,0x05DF},
- {0x05E0,0x05E0,0x05E0}, {0x05E1,0x05E1,0x05E1},
- {0x05E2,0x05E2,0x05E2}, {0x05E3,0x05E3,0x05E3},
- {0x05E4,0x05E4,0x05E4}, {0x05E5,0x05E5,0x05E5},
- {0x05E6,0x05E6,0x05E6}, {0x05E7,0x05E7,0x05E7},
- {0x05E8,0x05E8,0x05E8}, {0x05E9,0x05E9,0x05E9},
- {0x05EA,0x05EA,0x05EA}, {0x05EB,0x05EB,0x05EB},
- {0x05EC,0x05EC,0x05EC}, {0x05ED,0x05ED,0x05ED},
- {0x05EE,0x05EE,0x05EE}, {0x05EF,0x05EF,0x05EF},
- {0x05F0,0x05F0,0x05F0}, {0x05F1,0x05F1,0x05F1},
- {0x05F2,0x05F2,0x05F2}, {0x05F3,0x05F3,0x05F3},
- {0x05F4,0x05F4,0x05F4}, {0x05F5,0x05F5,0x05F5},
- {0x05F6,0x05F6,0x05F6}, {0x05F7,0x05F7,0x05F7},
- {0x05F8,0x05F8,0x05F8}, {0x05F9,0x05F9,0x05F9},
- {0x05FA,0x05FA,0x05FA}, {0x05FB,0x05FB,0x05FB},
- {0x05FC,0x05FC,0x05FC}, {0x05FD,0x05FD,0x05FD},
- {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},
- {0x1E04,0x1E05,0x0042}, {0x1E04,0x1E05,0x0042},
- {0x1E06,0x1E07,0x0042}, {0x1E06,0x1E07,0x0042},
- {0x1E08,0x1E09,0x0043}, {0x1E08,0x1E09,0x0043},
- {0x1E0A,0x1E0B,0x0044}, {0x1E0A,0x1E0B,0x0044},
- {0x1E0C,0x1E0D,0x0044}, {0x1E0C,0x1E0D,0x0044},
- {0x1E0E,0x1E0F,0x0044}, {0x1E0E,0x1E0F,0x0044},
- {0x1E10,0x1E11,0x0044}, {0x1E10,0x1E11,0x0044},
- {0x1E12,0x1E13,0x0044}, {0x1E12,0x1E13,0x0044},
- {0x1E14,0x1E15,0x0045}, {0x1E14,0x1E15,0x0045},
- {0x1E16,0x1E17,0x0045}, {0x1E16,0x1E17,0x0045},
- {0x1E18,0x1E19,0x0045}, {0x1E18,0x1E19,0x0045},
- {0x1E1A,0x1E1B,0x0045}, {0x1E1A,0x1E1B,0x0045},
- {0x1E1C,0x1E1D,0x0045}, {0x1E1C,0x1E1D,0x0045},
- {0x1E1E,0x1E1F,0x0046}, {0x1E1E,0x1E1F,0x0046},
- {0x1E20,0x1E21,0x0047}, {0x1E20,0x1E21,0x0047},
- {0x1E22,0x1E23,0x0048}, {0x1E22,0x1E23,0x0048},
- {0x1E24,0x1E25,0x0048}, {0x1E24,0x1E25,0x0048},
- {0x1E26,0x1E27,0x0048}, {0x1E26,0x1E27,0x0048},
- {0x1E28,0x1E29,0x0048}, {0x1E28,0x1E29,0x0048},
- {0x1E2A,0x1E2B,0x0048}, {0x1E2A,0x1E2B,0x0048},
- {0x1E2C,0x1E2D,0x0049}, {0x1E2C,0x1E2D,0x0049},
- {0x1E2E,0x1E2F,0x0049}, {0x1E2E,0x1E2F,0x0049},
- {0x1E30,0x1E31,0x004B}, {0x1E30,0x1E31,0x004B},
- {0x1E32,0x1E33,0x004B}, {0x1E32,0x1E33,0x004B},
- {0x1E34,0x1E35,0x004B}, {0x1E34,0x1E35,0x004B},
- {0x1E36,0x1E37,0x004C}, {0x1E36,0x1E37,0x004C},
- {0x1E38,0x1E39,0x004C}, {0x1E38,0x1E39,0x004C},
- {0x1E3A,0x1E3B,0x004C}, {0x1E3A,0x1E3B,0x004C},
- {0x1E3C,0x1E3D,0x004C}, {0x1E3C,0x1E3D,0x004C},
- {0x1E3E,0x1E3F,0x004D}, {0x1E3E,0x1E3F,0x004D},
- {0x1E40,0x1E41,0x004D}, {0x1E40,0x1E41,0x004D},
- {0x1E42,0x1E43,0x004D}, {0x1E42,0x1E43,0x004D},
- {0x1E44,0x1E45,0x004E}, {0x1E44,0x1E45,0x004E},
- {0x1E46,0x1E47,0x004E}, {0x1E46,0x1E47,0x004E},
- {0x1E48,0x1E49,0x004E}, {0x1E48,0x1E49,0x004E},
- {0x1E4A,0x1E4B,0x004E}, {0x1E4A,0x1E4B,0x004E},
- {0x1E4C,0x1E4D,0x004F}, {0x1E4C,0x1E4D,0x004F},
- {0x1E4E,0x1E4F,0x004F}, {0x1E4E,0x1E4F,0x004F},
- {0x1E50,0x1E51,0x004F}, {0x1E50,0x1E51,0x004F},
- {0x1E52,0x1E53,0x004F}, {0x1E52,0x1E53,0x004F},
- {0x1E54,0x1E55,0x0050}, {0x1E54,0x1E55,0x0050},
- {0x1E56,0x1E57,0x0050}, {0x1E56,0x1E57,0x0050},
- {0x1E58,0x1E59,0x0052}, {0x1E58,0x1E59,0x0052},
- {0x1E5A,0x1E5B,0x0052}, {0x1E5A,0x1E5B,0x0052},
- {0x1E5C,0x1E5D,0x0052}, {0x1E5C,0x1E5D,0x0052},
- {0x1E5E,0x1E5F,0x0052}, {0x1E5E,0x1E5F,0x0052},
- {0x1E60,0x1E61,0x0053}, {0x1E60,0x1E61,0x0053},
- {0x1E62,0x1E63,0x0053}, {0x1E62,0x1E63,0x0053},
- {0x1E64,0x1E65,0x0053}, {0x1E64,0x1E65,0x0053},
- {0x1E66,0x1E67,0x0053}, {0x1E66,0x1E67,0x0053},
- {0x1E68,0x1E69,0x0053}, {0x1E68,0x1E69,0x0053},
- {0x1E6A,0x1E6B,0x0054}, {0x1E6A,0x1E6B,0x0054},
- {0x1E6C,0x1E6D,0x0054}, {0x1E6C,0x1E6D,0x0054},
- {0x1E6E,0x1E6F,0x0054}, {0x1E6E,0x1E6F,0x0054},
- {0x1E70,0x1E71,0x0054}, {0x1E70,0x1E71,0x0054},
- {0x1E72,0x1E73,0x0055}, {0x1E72,0x1E73,0x0055},
- {0x1E74,0x1E75,0x0055}, {0x1E74,0x1E75,0x0055},
- {0x1E76,0x1E77,0x0055}, {0x1E76,0x1E77,0x0055},
- {0x1E78,0x1E79,0x0055}, {0x1E78,0x1E79,0x0055},
- {0x1E7A,0x1E7B,0x0055}, {0x1E7A,0x1E7B,0x0055},
- {0x1E7C,0x1E7D,0x0056}, {0x1E7C,0x1E7D,0x0056},
- {0x1E7E,0x1E7F,0x0056}, {0x1E7E,0x1E7F,0x0056},
- {0x1E80,0x1E81,0x0057}, {0x1E80,0x1E81,0x0057},
- {0x1E82,0x1E83,0x0057}, {0x1E82,0x1E83,0x0057},
- {0x1E84,0x1E85,0x0057}, {0x1E84,0x1E85,0x0057},
- {0x1E86,0x1E87,0x0057}, {0x1E86,0x1E87,0x0057},
- {0x1E88,0x1E89,0x0057}, {0x1E88,0x1E89,0x0057},
- {0x1E8A,0x1E8B,0x0058}, {0x1E8A,0x1E8B,0x0058},
- {0x1E8C,0x1E8D,0x0058}, {0x1E8C,0x1E8D,0x0058},
- {0x1E8E,0x1E8F,0x0059}, {0x1E8E,0x1E8F,0x0059},
- {0x1E90,0x1E91,0x005A}, {0x1E90,0x1E91,0x005A},
- {0x1E92,0x1E93,0x005A}, {0x1E92,0x1E93,0x005A},
- {0x1E94,0x1E95,0x005A}, {0x1E94,0x1E95,0x005A},
- {0x1E96,0x1E96,0x0048}, {0x1E97,0x1E97,0x0054},
- {0x1E98,0x1E98,0x0057}, {0x1E99,0x1E99,0x0059},
- {0x1E9A,0x1E9A,0x1E9A}, {0x1E60,0x1E9B,0x0053},
- {0x1E9C,0x1E9C,0x1E9C}, {0x1E9D,0x1E9D,0x1E9D},
- {0x1E9E,0x1E9E,0x1E9E}, {0x1E9F,0x1E9F,0x1E9F},
- {0x1EA0,0x1EA1,0x0041}, {0x1EA0,0x1EA1,0x0041},
- {0x1EA2,0x1EA3,0x0041}, {0x1EA2,0x1EA3,0x0041},
- {0x1EA4,0x1EA5,0x0041}, {0x1EA4,0x1EA5,0x0041},
- {0x1EA6,0x1EA7,0x0041}, {0x1EA6,0x1EA7,0x0041},
- {0x1EA8,0x1EA9,0x0041}, {0x1EA8,0x1EA9,0x0041},
- {0x1EAA,0x1EAB,0x0041}, {0x1EAA,0x1EAB,0x0041},
- {0x1EAC,0x1EAD,0x0041}, {0x1EAC,0x1EAD,0x0041},
- {0x1EAE,0x1EAF,0x0041}, {0x1EAE,0x1EAF,0x0041},
- {0x1EB0,0x1EB1,0x0041}, {0x1EB0,0x1EB1,0x0041},
- {0x1EB2,0x1EB3,0x0041}, {0x1EB2,0x1EB3,0x0041},
- {0x1EB4,0x1EB5,0x0041}, {0x1EB4,0x1EB5,0x0041},
- {0x1EB6,0x1EB7,0x0041}, {0x1EB6,0x1EB7,0x0041},
- {0x1EB8,0x1EB9,0x0045}, {0x1EB8,0x1EB9,0x0045},
- {0x1EBA,0x1EBB,0x0045}, {0x1EBA,0x1EBB,0x0045},
- {0x1EBC,0x1EBD,0x0045}, {0x1EBC,0x1EBD,0x0045},
- {0x1EBE,0x1EBF,0x0045}, {0x1EBE,0x1EBF,0x0045},
- {0x1EC0,0x1EC1,0x0045}, {0x1EC0,0x1EC1,0x0045},
- {0x1EC2,0x1EC3,0x0045}, {0x1EC2,0x1EC3,0x0045},
- {0x1EC4,0x1EC5,0x0045}, {0x1EC4,0x1EC5,0x0045},
- {0x1EC6,0x1EC7,0x0045}, {0x1EC6,0x1EC7,0x0045},
- {0x1EC8,0x1EC9,0x0049}, {0x1EC8,0x1EC9,0x0049},
- {0x1ECA,0x1ECB,0x0049}, {0x1ECA,0x1ECB,0x0049},
- {0x1ECC,0x1ECD,0x004F}, {0x1ECC,0x1ECD,0x004F},
- {0x1ECE,0x1ECF,0x004F}, {0x1ECE,0x1ECF,0x004F},
- {0x1ED0,0x1ED1,0x004F}, {0x1ED0,0x1ED1,0x004F},
- {0x1ED2,0x1ED3,0x004F}, {0x1ED2,0x1ED3,0x004F},
- {0x1ED4,0x1ED5,0x004F}, {0x1ED4,0x1ED5,0x004F},
- {0x1ED6,0x1ED7,0x004F}, {0x1ED6,0x1ED7,0x004F},
- {0x1ED8,0x1ED9,0x004F}, {0x1ED8,0x1ED9,0x004F},
- {0x1EDA,0x1EDB,0x004F}, {0x1EDA,0x1EDB,0x004F},
- {0x1EDC,0x1EDD,0x004F}, {0x1EDC,0x1EDD,0x004F},
- {0x1EDE,0x1EDF,0x004F}, {0x1EDE,0x1EDF,0x004F},
- {0x1EE0,0x1EE1,0x004F}, {0x1EE0,0x1EE1,0x004F},
- {0x1EE2,0x1EE3,0x004F}, {0x1EE2,0x1EE3,0x004F},
- {0x1EE4,0x1EE5,0x0055}, {0x1EE4,0x1EE5,0x0055},
- {0x1EE6,0x1EE7,0x0055}, {0x1EE6,0x1EE7,0x0055},
- {0x1EE8,0x1EE9,0x0055}, {0x1EE8,0x1EE9,0x0055},
- {0x1EEA,0x1EEB,0x0055}, {0x1EEA,0x1EEB,0x0055},
- {0x1EEC,0x1EED,0x0055}, {0x1EEC,0x1EED,0x0055},
- {0x1EEE,0x1EEF,0x0055}, {0x1EEE,0x1EEF,0x0055},
- {0x1EF0,0x1EF1,0x0055}, {0x1EF0,0x1EF1,0x0055},
- {0x1EF2,0x1EF3,0x0059}, {0x1EF2,0x1EF3,0x0059},
- {0x1EF4,0x1EF5,0x0059}, {0x1EF4,0x1EF5,0x0059},
- {0x1EF6,0x1EF7,0x0059}, {0x1EF6,0x1EF7,0x0059},
- {0x1EF8,0x1EF9,0x0059}, {0x1EF8,0x1EF9,0x0059},
- {0x1EFA,0x1EFA,0x1EFA}, {0x1EFB,0x1EFB,0x1EFB},
- {0x1EFC,0x1EFC,0x1EFC}, {0x1EFD,0x1EFD,0x1EFD},
- {0x1EFE,0x1EFE,0x1EFE}, {0x1EFF,0x1EFF,0x1EFF}
-};
-
-static MY_UNICASE_CHARACTER plane1F[]={
- {0x1F08,0x1F00,0x0391}, {0x1F09,0x1F01,0x0391},
- {0x1F0A,0x1F02,0x0391}, {0x1F0B,0x1F03,0x0391},
- {0x1F0C,0x1F04,0x0391}, {0x1F0D,0x1F05,0x0391},
- {0x1F0E,0x1F06,0x0391}, {0x1F0F,0x1F07,0x0391},
- {0x1F08,0x1F00,0x0391}, {0x1F09,0x1F01,0x0391},
- {0x1F0A,0x1F02,0x0391}, {0x1F0B,0x1F03,0x0391},
- {0x1F0C,0x1F04,0x0391}, {0x1F0D,0x1F05,0x0391},
- {0x1F0E,0x1F06,0x0391}, {0x1F0F,0x1F07,0x0391},
- {0x1F18,0x1F10,0x0395}, {0x1F19,0x1F11,0x0395},
- {0x1F1A,0x1F12,0x0395}, {0x1F1B,0x1F13,0x0395},
- {0x1F1C,0x1F14,0x0395}, {0x1F1D,0x1F15,0x0395},
- {0x1F16,0x1F16,0x1F16}, {0x1F17,0x1F17,0x1F17},
- {0x1F18,0x1F10,0x0395}, {0x1F19,0x1F11,0x0395},
- {0x1F1A,0x1F12,0x0395}, {0x1F1B,0x1F13,0x0395},
- {0x1F1C,0x1F14,0x0395}, {0x1F1D,0x1F15,0x0395},
- {0x1F1E,0x1F1E,0x1F1E}, {0x1F1F,0x1F1F,0x1F1F},
- {0x1F28,0x1F20,0x0397}, {0x1F29,0x1F21,0x0397},
- {0x1F2A,0x1F22,0x0397}, {0x1F2B,0x1F23,0x0397},
- {0x1F2C,0x1F24,0x0397}, {0x1F2D,0x1F25,0x0397},
- {0x1F2E,0x1F26,0x0397}, {0x1F2F,0x1F27,0x0397},
- {0x1F28,0x1F20,0x0397}, {0x1F29,0x1F21,0x0397},
- {0x1F2A,0x1F22,0x0397}, {0x1F2B,0x1F23,0x0397},
- {0x1F2C,0x1F24,0x0397}, {0x1F2D,0x1F25,0x0397},
- {0x1F2E,0x1F26,0x0397}, {0x1F2F,0x1F27,0x0397},
- {0x1F38,0x1F30,0x0399}, {0x1F39,0x1F31,0x0399},
- {0x1F3A,0x1F32,0x0399}, {0x1F3B,0x1F33,0x0399},
- {0x1F3C,0x1F34,0x0399}, {0x1F3D,0x1F35,0x0399},
- {0x1F3E,0x1F36,0x0399}, {0x1F3F,0x1F37,0x0399},
- {0x1F38,0x1F30,0x0399}, {0x1F39,0x1F31,0x0399},
- {0x1F3A,0x1F32,0x0399}, {0x1F3B,0x1F33,0x0399},
- {0x1F3C,0x1F34,0x0399}, {0x1F3D,0x1F35,0x0399},
- {0x1F3E,0x1F36,0x0399}, {0x1F3F,0x1F37,0x0399},
- {0x1F48,0x1F40,0x039F}, {0x1F49,0x1F41,0x039F},
- {0x1F4A,0x1F42,0x039F}, {0x1F4B,0x1F43,0x039F},
- {0x1F4C,0x1F44,0x039F}, {0x1F4D,0x1F45,0x039F},
- {0x1F46,0x1F46,0x1F46}, {0x1F47,0x1F47,0x1F47},
- {0x1F48,0x1F40,0x039F}, {0x1F49,0x1F41,0x039F},
- {0x1F4A,0x1F42,0x039F}, {0x1F4B,0x1F43,0x039F},
- {0x1F4C,0x1F44,0x039F}, {0x1F4D,0x1F45,0x039F},
- {0x1F4E,0x1F4E,0x1F4E}, {0x1F4F,0x1F4F,0x1F4F},
- {0x1F50,0x1F50,0x03A5}, {0x1F59,0x1F51,0x03A5},
- {0x1F52,0x1F52,0x03A5}, {0x1F5B,0x1F53,0x03A5},
- {0x1F54,0x1F54,0x03A5}, {0x1F5D,0x1F55,0x03A5},
- {0x1F56,0x1F56,0x03A5}, {0x1F5F,0x1F57,0x03A5},
- {0x1F58,0x1F58,0x1F58}, {0x1F59,0x1F51,0x03A5},
- {0x1F5A,0x1F5A,0x1F5A}, {0x1F5B,0x1F53,0x03A5},
- {0x1F5C,0x1F5C,0x1F5C}, {0x1F5D,0x1F55,0x03A5},
- {0x1F5E,0x1F5E,0x1F5E}, {0x1F5F,0x1F57,0x03A5},
- {0x1F68,0x1F60,0x03A9}, {0x1F69,0x1F61,0x03A9},
- {0x1F6A,0x1F62,0x03A9}, {0x1F6B,0x1F63,0x03A9},
- {0x1F6C,0x1F64,0x03A9}, {0x1F6D,0x1F65,0x03A9},
- {0x1F6E,0x1F66,0x03A9}, {0x1F6F,0x1F67,0x03A9},
- {0x1F68,0x1F60,0x03A9}, {0x1F69,0x1F61,0x03A9},
- {0x1F6A,0x1F62,0x03A9}, {0x1F6B,0x1F63,0x03A9},
- {0x1F6C,0x1F64,0x03A9}, {0x1F6D,0x1F65,0x03A9},
- {0x1F6E,0x1F66,0x03A9}, {0x1F6F,0x1F67,0x03A9},
- {0x1FBA,0x1F70,0x0391}, {0x1FBB,0x1F71,0x1FBB},
- {0x1FC8,0x1F72,0x0395}, {0x1FC9,0x1F73,0x1FC9},
- {0x1FCA,0x1F74,0x0397}, {0x1FCB,0x1F75,0x1FCB},
- {0x1FDA,0x1F76,0x0399}, {0x1FDB,0x1F77,0x1FDB},
- {0x1FF8,0x1F78,0x039F}, {0x1FF9,0x1F79,0x1FF9},
- {0x1FEA,0x1F7A,0x03A5}, {0x1FEB,0x1F7B,0x1FEB},
- {0x1FFA,0x1F7C,0x03A9}, {0x1FFB,0x1F7D,0x1FFB},
- {0x1F7E,0x1F7E,0x1F7E}, {0x1F7F,0x1F7F,0x1F7F},
- {0x1F88,0x1F80,0x0391}, {0x1F89,0x1F81,0x0391},
- {0x1F8A,0x1F82,0x0391}, {0x1F8B,0x1F83,0x0391},
- {0x1F8C,0x1F84,0x0391}, {0x1F8D,0x1F85,0x0391},
- {0x1F8E,0x1F86,0x0391}, {0x1F8F,0x1F87,0x0391},
- {0x1F88,0x1F80,0x0391}, {0x1F89,0x1F81,0x0391},
- {0x1F8A,0x1F82,0x0391}, {0x1F8B,0x1F83,0x0391},
- {0x1F8C,0x1F84,0x0391}, {0x1F8D,0x1F85,0x0391},
- {0x1F8E,0x1F86,0x0391}, {0x1F8F,0x1F87,0x0391},
- {0x1F98,0x1F90,0x0397}, {0x1F99,0x1F91,0x0397},
- {0x1F9A,0x1F92,0x0397}, {0x1F9B,0x1F93,0x0397},
- {0x1F9C,0x1F94,0x0397}, {0x1F9D,0x1F95,0x0397},
- {0x1F9E,0x1F96,0x0397}, {0x1F9F,0x1F97,0x0397},
- {0x1F98,0x1F90,0x0397}, {0x1F99,0x1F91,0x0397},
- {0x1F9A,0x1F92,0x0397}, {0x1F9B,0x1F93,0x0397},
- {0x1F9C,0x1F94,0x0397}, {0x1F9D,0x1F95,0x0397},
- {0x1F9E,0x1F96,0x0397}, {0x1F9F,0x1F97,0x0397},
- {0x1FA8,0x1FA0,0x03A9}, {0x1FA9,0x1FA1,0x03A9},
- {0x1FAA,0x1FA2,0x03A9}, {0x1FAB,0x1FA3,0x03A9},
- {0x1FAC,0x1FA4,0x03A9}, {0x1FAD,0x1FA5,0x03A9},
- {0x1FAE,0x1FA6,0x03A9}, {0x1FAF,0x1FA7,0x03A9},
- {0x1FA8,0x1FA0,0x03A9}, {0x1FA9,0x1FA1,0x03A9},
- {0x1FAA,0x1FA2,0x03A9}, {0x1FAB,0x1FA3,0x03A9},
- {0x1FAC,0x1FA4,0x03A9}, {0x1FAD,0x1FA5,0x03A9},
- {0x1FAE,0x1FA6,0x03A9}, {0x1FAF,0x1FA7,0x03A9},
- {0x1FB8,0x1FB0,0x0391}, {0x1FB9,0x1FB1,0x0391},
- {0x1FB2,0x1FB2,0x0391}, {0x1FBC,0x1FB3,0x0391},
- {0x1FB4,0x1FB4,0x0391}, {0x1FB5,0x1FB5,0x1FB5},
- {0x1FB6,0x1FB6,0x0391}, {0x1FB7,0x1FB7,0x0391},
- {0x1FB8,0x1FB0,0x0391}, {0x1FB9,0x1FB1,0x0391},
- {0x1FBA,0x1F70,0x0391}, {0x1FBB,0x1F71,0x1FBB},
- {0x1FBC,0x1FB3,0x0391}, {0x1FBD,0x1FBD,0x1FBD},
- {0x0399,0x1FBE,0x0399}, {0x1FBF,0x1FBF,0x1FBF},
- {0x1FC0,0x1FC0,0x1FC0}, {0x1FC1,0x1FC1,0x1FC1},
- {0x1FC2,0x1FC2,0x0397}, {0x1FCC,0x1FC3,0x0397},
- {0x1FC4,0x1FC4,0x0397}, {0x1FC5,0x1FC5,0x1FC5},
- {0x1FC6,0x1FC6,0x0397}, {0x1FC7,0x1FC7,0x0397},
- {0x1FC8,0x1F72,0x0395}, {0x1FC9,0x1F73,0x1FC9},
- {0x1FCA,0x1F74,0x0397}, {0x1FCB,0x1F75,0x1FCB},
- {0x1FCC,0x1FC3,0x0397}, {0x1FCD,0x1FCD,0x1FCD},
- {0x1FCE,0x1FCE,0x1FCE}, {0x1FCF,0x1FCF,0x1FCF},
- {0x1FD8,0x1FD0,0x0399}, {0x1FD9,0x1FD1,0x0399},
- {0x1FD2,0x1FD2,0x0399}, {0x1FD3,0x1FD3,0x1FD3},
- {0x1FD4,0x1FD4,0x1FD4}, {0x1FD5,0x1FD5,0x1FD5},
- {0x1FD6,0x1FD6,0x0399}, {0x1FD7,0x1FD7,0x0399},
- {0x1FD8,0x1FD0,0x0399}, {0x1FD9,0x1FD1,0x0399},
- {0x1FDA,0x1F76,0x0399}, {0x1FDB,0x1F77,0x1FDB},
- {0x1FDC,0x1FDC,0x1FDC}, {0x1FDD,0x1FDD,0x1FDD},
- {0x1FDE,0x1FDE,0x1FDE}, {0x1FDF,0x1FDF,0x1FDF},
- {0x1FE8,0x1FE0,0x03A5}, {0x1FE9,0x1FE1,0x03A5},
- {0x1FE2,0x1FE2,0x03A5}, {0x1FE3,0x1FE3,0x1FE3},
- {0x1FE4,0x1FE4,0x03A1}, {0x1FEC,0x1FE5,0x03A1},
- {0x1FE6,0x1FE6,0x03A5}, {0x1FE7,0x1FE7,0x03A5},
- {0x1FE8,0x1FE0,0x03A5}, {0x1FE9,0x1FE1,0x03A5},
- {0x1FEA,0x1F7A,0x03A5}, {0x1FEB,0x1F7B,0x1FEB},
- {0x1FEC,0x1FE5,0x03A1}, {0x1FED,0x1FED,0x1FED},
- {0x1FEE,0x1FEE,0x1FEE}, {0x1FEF,0x1FEF,0x1FEF},
- {0x1FF0,0x1FF0,0x1FF0}, {0x1FF1,0x1FF1,0x1FF1},
- {0x1FF2,0x1FF2,0x03A9}, {0x1FFC,0x1FF3,0x03A9},
- {0x1FF4,0x1FF4,0x03A9}, {0x1FF5,0x1FF5,0x1FF5},
- {0x1FF6,0x1FF6,0x03A9}, {0x1FF7,0x1FF7,0x03A9},
- {0x1FF8,0x1F78,0x039F}, {0x1FF9,0x1F79,0x1FF9},
- {0x1FFA,0x1F7C,0x03A9}, {0x1FFB,0x1F7D,0x1FFB},
- {0x1FFC,0x1FF3,0x03A9}, {0x1FFD,0x1FFD,0x1FFD},
- {0x1FFE,0x1FFE,0x1FFE}, {0x1FFF,0x1FFF,0x1FFF}
-};
-
-static MY_UNICASE_CHARACTER plane21[]={
- {0x2100,0x2100,0x2100}, {0x2101,0x2101,0x2101},
- {0x2102,0x2102,0x2102}, {0x2103,0x2103,0x2103},
- {0x2104,0x2104,0x2104}, {0x2105,0x2105,0x2105},
- {0x2106,0x2106,0x2106}, {0x2107,0x2107,0x2107},
- {0x2108,0x2108,0x2108}, {0x2109,0x2109,0x2109},
- {0x210A,0x210A,0x210A}, {0x210B,0x210B,0x210B},
- {0x210C,0x210C,0x210C}, {0x210D,0x210D,0x210D},
- {0x210E,0x210E,0x210E}, {0x210F,0x210F,0x210F},
- {0x2110,0x2110,0x2110}, {0x2111,0x2111,0x2111},
- {0x2112,0x2112,0x2112}, {0x2113,0x2113,0x2113},
- {0x2114,0x2114,0x2114}, {0x2115,0x2115,0x2115},
- {0x2116,0x2116,0x2116}, {0x2117,0x2117,0x2117},
- {0x2118,0x2118,0x2118}, {0x2119,0x2119,0x2119},
- {0x211A,0x211A,0x211A}, {0x211B,0x211B,0x211B},
- {0x211C,0x211C,0x211C}, {0x211D,0x211D,0x211D},
- {0x211E,0x211E,0x211E}, {0x211F,0x211F,0x211F},
- {0x2120,0x2120,0x2120}, {0x2121,0x2121,0x2121},
- {0x2122,0x2122,0x2122}, {0x2123,0x2123,0x2123},
- {0x2124,0x2124,0x2124}, {0x2125,0x2125,0x2125},
- {0x2126,0x03C9,0x2126}, {0x2127,0x2127,0x2127},
- {0x2128,0x2128,0x2128}, {0x2129,0x2129,0x2129},
- {0x212A,0x006B,0x212A}, {0x212B,0x00E5,0x212B},
- {0x212C,0x212C,0x212C}, {0x212D,0x212D,0x212D},
- {0x212E,0x212E,0x212E}, {0x212F,0x212F,0x212F},
- {0x2130,0x2130,0x2130}, {0x2131,0x2131,0x2131},
- {0x2132,0x2132,0x2132}, {0x2133,0x2133,0x2133},
- {0x2134,0x2134,0x2134}, {0x2135,0x2135,0x2135},
- {0x2136,0x2136,0x2136}, {0x2137,0x2137,0x2137},
- {0x2138,0x2138,0x2138}, {0x2139,0x2139,0x2139},
- {0x213A,0x213A,0x213A}, {0x213B,0x213B,0x213B},
- {0x213C,0x213C,0x213C}, {0x213D,0x213D,0x213D},
- {0x213E,0x213E,0x213E}, {0x213F,0x213F,0x213F},
- {0x2140,0x2140,0x2140}, {0x2141,0x2141,0x2141},
- {0x2142,0x2142,0x2142}, {0x2143,0x2143,0x2143},
- {0x2144,0x2144,0x2144}, {0x2145,0x2145,0x2145},
- {0x2146,0x2146,0x2146}, {0x2147,0x2147,0x2147},
- {0x2148,0x2148,0x2148}, {0x2149,0x2149,0x2149},
- {0x214A,0x214A,0x214A}, {0x214B,0x214B,0x214B},
- {0x214C,0x214C,0x214C}, {0x214D,0x214D,0x214D},
- {0x214E,0x214E,0x214E}, {0x214F,0x214F,0x214F},
- {0x2150,0x2150,0x2150}, {0x2151,0x2151,0x2151},
- {0x2152,0x2152,0x2152}, {0x2153,0x2153,0x2153},
- {0x2154,0x2154,0x2154}, {0x2155,0x2155,0x2155},
- {0x2156,0x2156,0x2156}, {0x2157,0x2157,0x2157},
- {0x2158,0x2158,0x2158}, {0x2159,0x2159,0x2159},
- {0x215A,0x215A,0x215A}, {0x215B,0x215B,0x215B},
- {0x215C,0x215C,0x215C}, {0x215D,0x215D,0x215D},
- {0x215E,0x215E,0x215E}, {0x215F,0x215F,0x215F},
- {0x2160,0x2170,0x2160}, {0x2161,0x2171,0x2161},
- {0x2162,0x2172,0x2162}, {0x2163,0x2173,0x2163},
- {0x2164,0x2174,0x2164}, {0x2165,0x2175,0x2165},
- {0x2166,0x2176,0x2166}, {0x2167,0x2177,0x2167},
- {0x2168,0x2178,0x2168}, {0x2169,0x2179,0x2169},
- {0x216A,0x217A,0x216A}, {0x216B,0x217B,0x216B},
- {0x216C,0x217C,0x216C}, {0x216D,0x217D,0x216D},
- {0x216E,0x217E,0x216E}, {0x216F,0x217F,0x216F},
- {0x2160,0x2170,0x2160}, {0x2161,0x2171,0x2161},
- {0x2162,0x2172,0x2162}, {0x2163,0x2173,0x2163},
- {0x2164,0x2174,0x2164}, {0x2165,0x2175,0x2165},
- {0x2166,0x2176,0x2166}, {0x2167,0x2177,0x2167},
- {0x2168,0x2178,0x2168}, {0x2169,0x2179,0x2169},
- {0x216A,0x217A,0x216A}, {0x216B,0x217B,0x216B},
- {0x216C,0x217C,0x216C}, {0x216D,0x217D,0x216D},
- {0x216E,0x217E,0x216E}, {0x216F,0x217F,0x216F},
- {0x2180,0x2180,0x2180}, {0x2181,0x2181,0x2181},
- {0x2182,0x2182,0x2182}, {0x2183,0x2183,0x2183},
- {0x2184,0x2184,0x2184}, {0x2185,0x2185,0x2185},
- {0x2186,0x2186,0x2186}, {0x2187,0x2187,0x2187},
- {0x2188,0x2188,0x2188}, {0x2189,0x2189,0x2189},
- {0x218A,0x218A,0x218A}, {0x218B,0x218B,0x218B},
- {0x218C,0x218C,0x218C}, {0x218D,0x218D,0x218D},
- {0x218E,0x218E,0x218E}, {0x218F,0x218F,0x218F},
- {0x2190,0x2190,0x2190}, {0x2191,0x2191,0x2191},
- {0x2192,0x2192,0x2192}, {0x2193,0x2193,0x2193},
- {0x2194,0x2194,0x2194}, {0x2195,0x2195,0x2195},
- {0x2196,0x2196,0x2196}, {0x2197,0x2197,0x2197},
- {0x2198,0x2198,0x2198}, {0x2199,0x2199,0x2199},
- {0x219A,0x219A,0x219A}, {0x219B,0x219B,0x219B},
- {0x219C,0x219C,0x219C}, {0x219D,0x219D,0x219D},
- {0x219E,0x219E,0x219E}, {0x219F,0x219F,0x219F},
- {0x21A0,0x21A0,0x21A0}, {0x21A1,0x21A1,0x21A1},
- {0x21A2,0x21A2,0x21A2}, {0x21A3,0x21A3,0x21A3},
- {0x21A4,0x21A4,0x21A4}, {0x21A5,0x21A5,0x21A5},
- {0x21A6,0x21A6,0x21A6}, {0x21A7,0x21A7,0x21A7},
- {0x21A8,0x21A8,0x21A8}, {0x21A9,0x21A9,0x21A9},
- {0x21AA,0x21AA,0x21AA}, {0x21AB,0x21AB,0x21AB},
- {0x21AC,0x21AC,0x21AC}, {0x21AD,0x21AD,0x21AD},
- {0x21AE,0x21AE,0x21AE}, {0x21AF,0x21AF,0x21AF},
- {0x21B0,0x21B0,0x21B0}, {0x21B1,0x21B1,0x21B1},
- {0x21B2,0x21B2,0x21B2}, {0x21B3,0x21B3,0x21B3},
- {0x21B4,0x21B4,0x21B4}, {0x21B5,0x21B5,0x21B5},
- {0x21B6,0x21B6,0x21B6}, {0x21B7,0x21B7,0x21B7},
- {0x21B8,0x21B8,0x21B8}, {0x21B9,0x21B9,0x21B9},
- {0x21BA,0x21BA,0x21BA}, {0x21BB,0x21BB,0x21BB},
- {0x21BC,0x21BC,0x21BC}, {0x21BD,0x21BD,0x21BD},
- {0x21BE,0x21BE,0x21BE}, {0x21BF,0x21BF,0x21BF},
- {0x21C0,0x21C0,0x21C0}, {0x21C1,0x21C1,0x21C1},
- {0x21C2,0x21C2,0x21C2}, {0x21C3,0x21C3,0x21C3},
- {0x21C4,0x21C4,0x21C4}, {0x21C5,0x21C5,0x21C5},
- {0x21C6,0x21C6,0x21C6}, {0x21C7,0x21C7,0x21C7},
- {0x21C8,0x21C8,0x21C8}, {0x21C9,0x21C9,0x21C9},
- {0x21CA,0x21CA,0x21CA}, {0x21CB,0x21CB,0x21CB},
- {0x21CC,0x21CC,0x21CC}, {0x21CD,0x21CD,0x21CD},
- {0x21CE,0x21CE,0x21CE}, {0x21CF,0x21CF,0x21CF},
- {0x21D0,0x21D0,0x21D0}, {0x21D1,0x21D1,0x21D1},
- {0x21D2,0x21D2,0x21D2}, {0x21D3,0x21D3,0x21D3},
- {0x21D4,0x21D4,0x21D4}, {0x21D5,0x21D5,0x21D5},
- {0x21D6,0x21D6,0x21D6}, {0x21D7,0x21D7,0x21D7},
- {0x21D8,0x21D8,0x21D8}, {0x21D9,0x21D9,0x21D9},
- {0x21DA,0x21DA,0x21DA}, {0x21DB,0x21DB,0x21DB},
- {0x21DC,0x21DC,0x21DC}, {0x21DD,0x21DD,0x21DD},
- {0x21DE,0x21DE,0x21DE}, {0x21DF,0x21DF,0x21DF},
- {0x21E0,0x21E0,0x21E0}, {0x21E1,0x21E1,0x21E1},
- {0x21E2,0x21E2,0x21E2}, {0x21E3,0x21E3,0x21E3},
- {0x21E4,0x21E4,0x21E4}, {0x21E5,0x21E5,0x21E5},
- {0x21E6,0x21E6,0x21E6}, {0x21E7,0x21E7,0x21E7},
- {0x21E8,0x21E8,0x21E8}, {0x21E9,0x21E9,0x21E9},
- {0x21EA,0x21EA,0x21EA}, {0x21EB,0x21EB,0x21EB},
- {0x21EC,0x21EC,0x21EC}, {0x21ED,0x21ED,0x21ED},
- {0x21EE,0x21EE,0x21EE}, {0x21EF,0x21EF,0x21EF},
- {0x21F0,0x21F0,0x21F0}, {0x21F1,0x21F1,0x21F1},
- {0x21F2,0x21F2,0x21F2}, {0x21F3,0x21F3,0x21F3},
- {0x21F4,0x21F4,0x21F4}, {0x21F5,0x21F5,0x21F5},
- {0x21F6,0x21F6,0x21F6}, {0x21F7,0x21F7,0x21F7},
- {0x21F8,0x21F8,0x21F8}, {0x21F9,0x21F9,0x21F9},
- {0x21FA,0x21FA,0x21FA}, {0x21FB,0x21FB,0x21FB},
- {0x21FC,0x21FC,0x21FC}, {0x21FD,0x21FD,0x21FD},
- {0x21FE,0x21FE,0x21FE}, {0x21FF,0x21FF,0x21FF}
-};
-
-static MY_UNICASE_CHARACTER plane24[]={
- {0x2400,0x2400,0x2400}, {0x2401,0x2401,0x2401},
- {0x2402,0x2402,0x2402}, {0x2403,0x2403,0x2403},
- {0x2404,0x2404,0x2404}, {0x2405,0x2405,0x2405},
- {0x2406,0x2406,0x2406}, {0x2407,0x2407,0x2407},
- {0x2408,0x2408,0x2408}, {0x2409,0x2409,0x2409},
- {0x240A,0x240A,0x240A}, {0x240B,0x240B,0x240B},
- {0x240C,0x240C,0x240C}, {0x240D,0x240D,0x240D},
- {0x240E,0x240E,0x240E}, {0x240F,0x240F,0x240F},
- {0x2410,0x2410,0x2410}, {0x2411,0x2411,0x2411},
- {0x2412,0x2412,0x2412}, {0x2413,0x2413,0x2413},
- {0x2414,0x2414,0x2414}, {0x2415,0x2415,0x2415},
- {0x2416,0x2416,0x2416}, {0x2417,0x2417,0x2417},
- {0x2418,0x2418,0x2418}, {0x2419,0x2419,0x2419},
- {0x241A,0x241A,0x241A}, {0x241B,0x241B,0x241B},
- {0x241C,0x241C,0x241C}, {0x241D,0x241D,0x241D},
- {0x241E,0x241E,0x241E}, {0x241F,0x241F,0x241F},
- {0x2420,0x2420,0x2420}, {0x2421,0x2421,0x2421},
- {0x2422,0x2422,0x2422}, {0x2423,0x2423,0x2423},
- {0x2424,0x2424,0x2424}, {0x2425,0x2425,0x2425},
- {0x2426,0x2426,0x2426}, {0x2427,0x2427,0x2427},
- {0x2428,0x2428,0x2428}, {0x2429,0x2429,0x2429},
- {0x242A,0x242A,0x242A}, {0x242B,0x242B,0x242B},
- {0x242C,0x242C,0x242C}, {0x242D,0x242D,0x242D},
- {0x242E,0x242E,0x242E}, {0x242F,0x242F,0x242F},
- {0x2430,0x2430,0x2430}, {0x2431,0x2431,0x2431},
- {0x2432,0x2432,0x2432}, {0x2433,0x2433,0x2433},
- {0x2434,0x2434,0x2434}, {0x2435,0x2435,0x2435},
- {0x2436,0x2436,0x2436}, {0x2437,0x2437,0x2437},
- {0x2438,0x2438,0x2438}, {0x2439,0x2439,0x2439},
- {0x243A,0x243A,0x243A}, {0x243B,0x243B,0x243B},
- {0x243C,0x243C,0x243C}, {0x243D,0x243D,0x243D},
- {0x243E,0x243E,0x243E}, {0x243F,0x243F,0x243F},
- {0x2440,0x2440,0x2440}, {0x2441,0x2441,0x2441},
- {0x2442,0x2442,0x2442}, {0x2443,0x2443,0x2443},
- {0x2444,0x2444,0x2444}, {0x2445,0x2445,0x2445},
- {0x2446,0x2446,0x2446}, {0x2447,0x2447,0x2447},
- {0x2448,0x2448,0x2448}, {0x2449,0x2449,0x2449},
- {0x244A,0x244A,0x244A}, {0x244B,0x244B,0x244B},
- {0x244C,0x244C,0x244C}, {0x244D,0x244D,0x244D},
- {0x244E,0x244E,0x244E}, {0x244F,0x244F,0x244F},
- {0x2450,0x2450,0x2450}, {0x2451,0x2451,0x2451},
- {0x2452,0x2452,0x2452}, {0x2453,0x2453,0x2453},
- {0x2454,0x2454,0x2454}, {0x2455,0x2455,0x2455},
- {0x2456,0x2456,0x2456}, {0x2457,0x2457,0x2457},
- {0x2458,0x2458,0x2458}, {0x2459,0x2459,0x2459},
- {0x245A,0x245A,0x245A}, {0x245B,0x245B,0x245B},
- {0x245C,0x245C,0x245C}, {0x245D,0x245D,0x245D},
- {0x245E,0x245E,0x245E}, {0x245F,0x245F,0x245F},
- {0x2460,0x2460,0x2460}, {0x2461,0x2461,0x2461},
- {0x2462,0x2462,0x2462}, {0x2463,0x2463,0x2463},
- {0x2464,0x2464,0x2464}, {0x2465,0x2465,0x2465},
- {0x2466,0x2466,0x2466}, {0x2467,0x2467,0x2467},
- {0x2468,0x2468,0x2468}, {0x2469,0x2469,0x2469},
- {0x246A,0x246A,0x246A}, {0x246B,0x246B,0x246B},
- {0x246C,0x246C,0x246C}, {0x246D,0x246D,0x246D},
- {0x246E,0x246E,0x246E}, {0x246F,0x246F,0x246F},
- {0x2470,0x2470,0x2470}, {0x2471,0x2471,0x2471},
- {0x2472,0x2472,0x2472}, {0x2473,0x2473,0x2473},
- {0x2474,0x2474,0x2474}, {0x2475,0x2475,0x2475},
- {0x2476,0x2476,0x2476}, {0x2477,0x2477,0x2477},
- {0x2478,0x2478,0x2478}, {0x2479,0x2479,0x2479},
- {0x247A,0x247A,0x247A}, {0x247B,0x247B,0x247B},
- {0x247C,0x247C,0x247C}, {0x247D,0x247D,0x247D},
- {0x247E,0x247E,0x247E}, {0x247F,0x247F,0x247F},
- {0x2480,0x2480,0x2480}, {0x2481,0x2481,0x2481},
- {0x2482,0x2482,0x2482}, {0x2483,0x2483,0x2483},
- {0x2484,0x2484,0x2484}, {0x2485,0x2485,0x2485},
- {0x2486,0x2486,0x2486}, {0x2487,0x2487,0x2487},
- {0x2488,0x2488,0x2488}, {0x2489,0x2489,0x2489},
- {0x248A,0x248A,0x248A}, {0x248B,0x248B,0x248B},
- {0x248C,0x248C,0x248C}, {0x248D,0x248D,0x248D},
- {0x248E,0x248E,0x248E}, {0x248F,0x248F,0x248F},
- {0x2490,0x2490,0x2490}, {0x2491,0x2491,0x2491},
- {0x2492,0x2492,0x2492}, {0x2493,0x2493,0x2493},
- {0x2494,0x2494,0x2494}, {0x2495,0x2495,0x2495},
- {0x2496,0x2496,0x2496}, {0x2497,0x2497,0x2497},
- {0x2498,0x2498,0x2498}, {0x2499,0x2499,0x2499},
- {0x249A,0x249A,0x249A}, {0x249B,0x249B,0x249B},
- {0x249C,0x249C,0x249C}, {0x249D,0x249D,0x249D},
- {0x249E,0x249E,0x249E}, {0x249F,0x249F,0x249F},
- {0x24A0,0x24A0,0x24A0}, {0x24A1,0x24A1,0x24A1},
- {0x24A2,0x24A2,0x24A2}, {0x24A3,0x24A3,0x24A3},
- {0x24A4,0x24A4,0x24A4}, {0x24A5,0x24A5,0x24A5},
- {0x24A6,0x24A6,0x24A6}, {0x24A7,0x24A7,0x24A7},
- {0x24A8,0x24A8,0x24A8}, {0x24A9,0x24A9,0x24A9},
- {0x24AA,0x24AA,0x24AA}, {0x24AB,0x24AB,0x24AB},
- {0x24AC,0x24AC,0x24AC}, {0x24AD,0x24AD,0x24AD},
- {0x24AE,0x24AE,0x24AE}, {0x24AF,0x24AF,0x24AF},
- {0x24B0,0x24B0,0x24B0}, {0x24B1,0x24B1,0x24B1},
- {0x24B2,0x24B2,0x24B2}, {0x24B3,0x24B3,0x24B3},
- {0x24B4,0x24B4,0x24B4}, {0x24B5,0x24B5,0x24B5},
- {0x24B6,0x24D0,0x24B6}, {0x24B7,0x24D1,0x24B7},
- {0x24B8,0x24D2,0x24B8}, {0x24B9,0x24D3,0x24B9},
- {0x24BA,0x24D4,0x24BA}, {0x24BB,0x24D5,0x24BB},
- {0x24BC,0x24D6,0x24BC}, {0x24BD,0x24D7,0x24BD},
- {0x24BE,0x24D8,0x24BE}, {0x24BF,0x24D9,0x24BF},
- {0x24C0,0x24DA,0x24C0}, {0x24C1,0x24DB,0x24C1},
- {0x24C2,0x24DC,0x24C2}, {0x24C3,0x24DD,0x24C3},
- {0x24C4,0x24DE,0x24C4}, {0x24C5,0x24DF,0x24C5},
- {0x24C6,0x24E0,0x24C6}, {0x24C7,0x24E1,0x24C7},
- {0x24C8,0x24E2,0x24C8}, {0x24C9,0x24E3,0x24C9},
- {0x24CA,0x24E4,0x24CA}, {0x24CB,0x24E5,0x24CB},
- {0x24CC,0x24E6,0x24CC}, {0x24CD,0x24E7,0x24CD},
- {0x24CE,0x24E8,0x24CE}, {0x24CF,0x24E9,0x24CF},
- {0x24B6,0x24D0,0x24B6}, {0x24B7,0x24D1,0x24B7},
- {0x24B8,0x24D2,0x24B8}, {0x24B9,0x24D3,0x24B9},
- {0x24BA,0x24D4,0x24BA}, {0x24BB,0x24D5,0x24BB},
- {0x24BC,0x24D6,0x24BC}, {0x24BD,0x24D7,0x24BD},
- {0x24BE,0x24D8,0x24BE}, {0x24BF,0x24D9,0x24BF},
- {0x24C0,0x24DA,0x24C0}, {0x24C1,0x24DB,0x24C1},
- {0x24C2,0x24DC,0x24C2}, {0x24C3,0x24DD,0x24C3},
- {0x24C4,0x24DE,0x24C4}, {0x24C5,0x24DF,0x24C5},
- {0x24C6,0x24E0,0x24C6}, {0x24C7,0x24E1,0x24C7},
- {0x24C8,0x24E2,0x24C8}, {0x24C9,0x24E3,0x24C9},
- {0x24CA,0x24E4,0x24CA}, {0x24CB,0x24E5,0x24CB},
- {0x24CC,0x24E6,0x24CC}, {0x24CD,0x24E7,0x24CD},
- {0x24CE,0x24E8,0x24CE}, {0x24CF,0x24E9,0x24CF},
- {0x24EA,0x24EA,0x24EA}, {0x24EB,0x24EB,0x24EB},
- {0x24EC,0x24EC,0x24EC}, {0x24ED,0x24ED,0x24ED},
- {0x24EE,0x24EE,0x24EE}, {0x24EF,0x24EF,0x24EF},
- {0x24F0,0x24F0,0x24F0}, {0x24F1,0x24F1,0x24F1},
- {0x24F2,0x24F2,0x24F2}, {0x24F3,0x24F3,0x24F3},
- {0x24F4,0x24F4,0x24F4}, {0x24F5,0x24F5,0x24F5},
- {0x24F6,0x24F6,0x24F6}, {0x24F7,0x24F7,0x24F7},
- {0x24F8,0x24F8,0x24F8}, {0x24F9,0x24F9,0x24F9},
- {0x24FA,0x24FA,0x24FA}, {0x24FB,0x24FB,0x24FB},
- {0x24FC,0x24FC,0x24FC}, {0x24FD,0x24FD,0x24FD},
- {0x24FE,0x24FE,0x24FE}, {0x24FF,0x24FF,0x24FF}
-};
-
-static MY_UNICASE_CHARACTER planeFF[]={
- {0xFF00,0xFF00,0xFF00}, {0xFF01,0xFF01,0xFF01},
- {0xFF02,0xFF02,0xFF02}, {0xFF03,0xFF03,0xFF03},
- {0xFF04,0xFF04,0xFF04}, {0xFF05,0xFF05,0xFF05},
- {0xFF06,0xFF06,0xFF06}, {0xFF07,0xFF07,0xFF07},
- {0xFF08,0xFF08,0xFF08}, {0xFF09,0xFF09,0xFF09},
- {0xFF0A,0xFF0A,0xFF0A}, {0xFF0B,0xFF0B,0xFF0B},
- {0xFF0C,0xFF0C,0xFF0C}, {0xFF0D,0xFF0D,0xFF0D},
- {0xFF0E,0xFF0E,0xFF0E}, {0xFF0F,0xFF0F,0xFF0F},
- {0xFF10,0xFF10,0xFF10}, {0xFF11,0xFF11,0xFF11},
- {0xFF12,0xFF12,0xFF12}, {0xFF13,0xFF13,0xFF13},
- {0xFF14,0xFF14,0xFF14}, {0xFF15,0xFF15,0xFF15},
- {0xFF16,0xFF16,0xFF16}, {0xFF17,0xFF17,0xFF17},
- {0xFF18,0xFF18,0xFF18}, {0xFF19,0xFF19,0xFF19},
- {0xFF1A,0xFF1A,0xFF1A}, {0xFF1B,0xFF1B,0xFF1B},
- {0xFF1C,0xFF1C,0xFF1C}, {0xFF1D,0xFF1D,0xFF1D},
- {0xFF1E,0xFF1E,0xFF1E}, {0xFF1F,0xFF1F,0xFF1F},
- {0xFF20,0xFF20,0xFF20}, {0xFF21,0xFF41,0xFF21},
- {0xFF22,0xFF42,0xFF22}, {0xFF23,0xFF43,0xFF23},
- {0xFF24,0xFF44,0xFF24}, {0xFF25,0xFF45,0xFF25},
- {0xFF26,0xFF46,0xFF26}, {0xFF27,0xFF47,0xFF27},
- {0xFF28,0xFF48,0xFF28}, {0xFF29,0xFF49,0xFF29},
- {0xFF2A,0xFF4A,0xFF2A}, {0xFF2B,0xFF4B,0xFF2B},
- {0xFF2C,0xFF4C,0xFF2C}, {0xFF2D,0xFF4D,0xFF2D},
- {0xFF2E,0xFF4E,0xFF2E}, {0xFF2F,0xFF4F,0xFF2F},
- {0xFF30,0xFF50,0xFF30}, {0xFF31,0xFF51,0xFF31},
- {0xFF32,0xFF52,0xFF32}, {0xFF33,0xFF53,0xFF33},
- {0xFF34,0xFF54,0xFF34}, {0xFF35,0xFF55,0xFF35},
- {0xFF36,0xFF56,0xFF36}, {0xFF37,0xFF57,0xFF37},
- {0xFF38,0xFF58,0xFF38}, {0xFF39,0xFF59,0xFF39},
- {0xFF3A,0xFF5A,0xFF3A}, {0xFF3B,0xFF3B,0xFF3B},
- {0xFF3C,0xFF3C,0xFF3C}, {0xFF3D,0xFF3D,0xFF3D},
- {0xFF3E,0xFF3E,0xFF3E}, {0xFF3F,0xFF3F,0xFF3F},
- {0xFF40,0xFF40,0xFF40}, {0xFF21,0xFF41,0xFF21},
- {0xFF22,0xFF42,0xFF22}, {0xFF23,0xFF43,0xFF23},
- {0xFF24,0xFF44,0xFF24}, {0xFF25,0xFF45,0xFF25},
- {0xFF26,0xFF46,0xFF26}, {0xFF27,0xFF47,0xFF27},
- {0xFF28,0xFF48,0xFF28}, {0xFF29,0xFF49,0xFF29},
- {0xFF2A,0xFF4A,0xFF2A}, {0xFF2B,0xFF4B,0xFF2B},
- {0xFF2C,0xFF4C,0xFF2C}, {0xFF2D,0xFF4D,0xFF2D},
- {0xFF2E,0xFF4E,0xFF2E}, {0xFF2F,0xFF4F,0xFF2F},
- {0xFF30,0xFF50,0xFF30}, {0xFF31,0xFF51,0xFF31},
- {0xFF32,0xFF52,0xFF32}, {0xFF33,0xFF53,0xFF33},
- {0xFF34,0xFF54,0xFF34}, {0xFF35,0xFF55,0xFF35},
- {0xFF36,0xFF56,0xFF36}, {0xFF37,0xFF57,0xFF37},
- {0xFF38,0xFF58,0xFF38}, {0xFF39,0xFF59,0xFF39},
- {0xFF3A,0xFF5A,0xFF3A}, {0xFF5B,0xFF5B,0xFF5B},
- {0xFF5C,0xFF5C,0xFF5C}, {0xFF5D,0xFF5D,0xFF5D},
- {0xFF5E,0xFF5E,0xFF5E}, {0xFF5F,0xFF5F,0xFF5F},
- {0xFF60,0xFF60,0xFF60}, {0xFF61,0xFF61,0xFF61},
- {0xFF62,0xFF62,0xFF62}, {0xFF63,0xFF63,0xFF63},
- {0xFF64,0xFF64,0xFF64}, {0xFF65,0xFF65,0xFF65},
- {0xFF66,0xFF66,0xFF66}, {0xFF67,0xFF67,0xFF67},
- {0xFF68,0xFF68,0xFF68}, {0xFF69,0xFF69,0xFF69},
- {0xFF6A,0xFF6A,0xFF6A}, {0xFF6B,0xFF6B,0xFF6B},
- {0xFF6C,0xFF6C,0xFF6C}, {0xFF6D,0xFF6D,0xFF6D},
- {0xFF6E,0xFF6E,0xFF6E}, {0xFF6F,0xFF6F,0xFF6F},
- {0xFF70,0xFF70,0xFF70}, {0xFF71,0xFF71,0xFF71},
- {0xFF72,0xFF72,0xFF72}, {0xFF73,0xFF73,0xFF73},
- {0xFF74,0xFF74,0xFF74}, {0xFF75,0xFF75,0xFF75},
- {0xFF76,0xFF76,0xFF76}, {0xFF77,0xFF77,0xFF77},
- {0xFF78,0xFF78,0xFF78}, {0xFF79,0xFF79,0xFF79},
- {0xFF7A,0xFF7A,0xFF7A}, {0xFF7B,0xFF7B,0xFF7B},
- {0xFF7C,0xFF7C,0xFF7C}, {0xFF7D,0xFF7D,0xFF7D},
- {0xFF7E,0xFF7E,0xFF7E}, {0xFF7F,0xFF7F,0xFF7F},
- {0xFF80,0xFF80,0xFF80}, {0xFF81,0xFF81,0xFF81},
- {0xFF82,0xFF82,0xFF82}, {0xFF83,0xFF83,0xFF83},
- {0xFF84,0xFF84,0xFF84}, {0xFF85,0xFF85,0xFF85},
- {0xFF86,0xFF86,0xFF86}, {0xFF87,0xFF87,0xFF87},
- {0xFF88,0xFF88,0xFF88}, {0xFF89,0xFF89,0xFF89},
- {0xFF8A,0xFF8A,0xFF8A}, {0xFF8B,0xFF8B,0xFF8B},
- {0xFF8C,0xFF8C,0xFF8C}, {0xFF8D,0xFF8D,0xFF8D},
- {0xFF8E,0xFF8E,0xFF8E}, {0xFF8F,0xFF8F,0xFF8F},
- {0xFF90,0xFF90,0xFF90}, {0xFF91,0xFF91,0xFF91},
- {0xFF92,0xFF92,0xFF92}, {0xFF93,0xFF93,0xFF93},
- {0xFF94,0xFF94,0xFF94}, {0xFF95,0xFF95,0xFF95},
- {0xFF96,0xFF96,0xFF96}, {0xFF97,0xFF97,0xFF97},
- {0xFF98,0xFF98,0xFF98}, {0xFF99,0xFF99,0xFF99},
- {0xFF9A,0xFF9A,0xFF9A}, {0xFF9B,0xFF9B,0xFF9B},
- {0xFF9C,0xFF9C,0xFF9C}, {0xFF9D,0xFF9D,0xFF9D},
- {0xFF9E,0xFF9E,0xFF9E}, {0xFF9F,0xFF9F,0xFF9F},
- {0xFFA0,0xFFA0,0xFFA0}, {0xFFA1,0xFFA1,0xFFA1},
- {0xFFA2,0xFFA2,0xFFA2}, {0xFFA3,0xFFA3,0xFFA3},
- {0xFFA4,0xFFA4,0xFFA4}, {0xFFA5,0xFFA5,0xFFA5},
- {0xFFA6,0xFFA6,0xFFA6}, {0xFFA7,0xFFA7,0xFFA7},
- {0xFFA8,0xFFA8,0xFFA8}, {0xFFA9,0xFFA9,0xFFA9},
- {0xFFAA,0xFFAA,0xFFAA}, {0xFFAB,0xFFAB,0xFFAB},
- {0xFFAC,0xFFAC,0xFFAC}, {0xFFAD,0xFFAD,0xFFAD},
- {0xFFAE,0xFFAE,0xFFAE}, {0xFFAF,0xFFAF,0xFFAF},
- {0xFFB0,0xFFB0,0xFFB0}, {0xFFB1,0xFFB1,0xFFB1},
- {0xFFB2,0xFFB2,0xFFB2}, {0xFFB3,0xFFB3,0xFFB3},
- {0xFFB4,0xFFB4,0xFFB4}, {0xFFB5,0xFFB5,0xFFB5},
- {0xFFB6,0xFFB6,0xFFB6}, {0xFFB7,0xFFB7,0xFFB7},
- {0xFFB8,0xFFB8,0xFFB8}, {0xFFB9,0xFFB9,0xFFB9},
- {0xFFBA,0xFFBA,0xFFBA}, {0xFFBB,0xFFBB,0xFFBB},
- {0xFFBC,0xFFBC,0xFFBC}, {0xFFBD,0xFFBD,0xFFBD},
- {0xFFBE,0xFFBE,0xFFBE}, {0xFFBF,0xFFBF,0xFFBF},
- {0xFFC0,0xFFC0,0xFFC0}, {0xFFC1,0xFFC1,0xFFC1},
- {0xFFC2,0xFFC2,0xFFC2}, {0xFFC3,0xFFC3,0xFFC3},
- {0xFFC4,0xFFC4,0xFFC4}, {0xFFC5,0xFFC5,0xFFC5},
- {0xFFC6,0xFFC6,0xFFC6}, {0xFFC7,0xFFC7,0xFFC7},
- {0xFFC8,0xFFC8,0xFFC8}, {0xFFC9,0xFFC9,0xFFC9},
- {0xFFCA,0xFFCA,0xFFCA}, {0xFFCB,0xFFCB,0xFFCB},
- {0xFFCC,0xFFCC,0xFFCC}, {0xFFCD,0xFFCD,0xFFCD},
- {0xFFCE,0xFFCE,0xFFCE}, {0xFFCF,0xFFCF,0xFFCF},
- {0xFFD0,0xFFD0,0xFFD0}, {0xFFD1,0xFFD1,0xFFD1},
- {0xFFD2,0xFFD2,0xFFD2}, {0xFFD3,0xFFD3,0xFFD3},
- {0xFFD4,0xFFD4,0xFFD4}, {0xFFD5,0xFFD5,0xFFD5},
- {0xFFD6,0xFFD6,0xFFD6}, {0xFFD7,0xFFD7,0xFFD7},
- {0xFFD8,0xFFD8,0xFFD8}, {0xFFD9,0xFFD9,0xFFD9},
- {0xFFDA,0xFFDA,0xFFDA}, {0xFFDB,0xFFDB,0xFFDB},
- {0xFFDC,0xFFDC,0xFFDC}, {0xFFDD,0xFFDD,0xFFDD},
- {0xFFDE,0xFFDE,0xFFDE}, {0xFFDF,0xFFDF,0xFFDF},
- {0xFFE0,0xFFE0,0xFFE0}, {0xFFE1,0xFFE1,0xFFE1},
- {0xFFE2,0xFFE2,0xFFE2}, {0xFFE3,0xFFE3,0xFFE3},
- {0xFFE4,0xFFE4,0xFFE4}, {0xFFE5,0xFFE5,0xFFE5},
- {0xFFE6,0xFFE6,0xFFE6}, {0xFFE7,0xFFE7,0xFFE7},
- {0xFFE8,0xFFE8,0xFFE8}, {0xFFE9,0xFFE9,0xFFE9},
- {0xFFEA,0xFFEA,0xFFEA}, {0xFFEB,0xFFEB,0xFFEB},
- {0xFFEC,0xFFEC,0xFFEC}, {0xFFED,0xFFED,0xFFED},
- {0xFFEE,0xFFEE,0xFFEE}, {0xFFEF,0xFFEF,0xFFEF},
- {0xFFF0,0xFFF0,0xFFF0}, {0xFFF1,0xFFF1,0xFFF1},
- {0xFFF2,0xFFF2,0xFFF2}, {0xFFF3,0xFFF3,0xFFF3},
- {0xFFF4,0xFFF4,0xFFF4}, {0xFFF5,0xFFF5,0xFFF5},
- {0xFFF6,0xFFF6,0xFFF6}, {0xFFF7,0xFFF7,0xFFF7},
- {0xFFF8,0xFFF8,0xFFF8}, {0xFFF9,0xFFF9,0xFFF9},
- {0xFFFA,0xFFFA,0xFFFA}, {0xFFFB,0xFFFB,0xFFFB},
- {0xFFFC,0xFFFC,0xFFFC}, {0xFFFD,0xFFFD,0xFFFD},
- {0xFFFE,0xFFFE,0xFFFE}, {0xFFFF,0xFFFF,0xFFFF}
-};
-
-
-MY_UNICASE_CHARACTER *my_unicase_default_pages[256]=
-{
- my_unicase_default_page00,
- 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,
- NULL, plane21, NULL, NULL, plane24, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, planeFF
-};
-
-
-MY_UNICASE_INFO my_unicase_default=
-{
- MY_UNICASE_INFO_DEFAULT_MAXCHAR,
- my_unicase_default_pages
-};
-
-
-/*
- Reproduce old utf8mb3_general_ci behaviour before we fixed Bug#27877.
-*/
-MY_UNICASE_CHARACTER *my_unicase_pages_mysql500[256]={
- plane00_mysql500,
- 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,
- NULL, plane21, NULL, NULL, plane24, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, planeFF
-
-};
-
-
-MY_UNICASE_INFO my_unicase_mysql500=
-{
- 0xFFFF,
- my_unicase_pages_mysql500
-};
-
-
-/*
- Turkish lower/upper mapping:
- 1. LOWER(0x0049 LATIN CAPITAL LETTER I) ->
- 0x0131 LATIN SMALL LETTER DOTLESS I
- 2. UPPER(0x0069 LATIN SMALL LETTER I) ->
- 0x0130 LATIN CAPITAL LETTER I WITH DOT ABOVE
-*/
-
-static MY_UNICASE_CHARACTER turk00[]=
-{
- {0x0000,0x0000,0x0000}, {0x0001,0x0001,0x0001},
- {0x0002,0x0002,0x0002}, {0x0003,0x0003,0x0003},
- {0x0004,0x0004,0x0004}, {0x0005,0x0005,0x0005},
- {0x0006,0x0006,0x0006}, {0x0007,0x0007,0x0007},
- {0x0008,0x0008,0x0008}, {0x0009,0x0009,0x0009},
- {0x000A,0x000A,0x000A}, {0x000B,0x000B,0x000B},
- {0x000C,0x000C,0x000C}, {0x000D,0x000D,0x000D},
- {0x000E,0x000E,0x000E}, {0x000F,0x000F,0x000F},
- {0x0010,0x0010,0x0010}, {0x0011,0x0011,0x0011},
- {0x0012,0x0012,0x0012}, {0x0013,0x0013,0x0013},
- {0x0014,0x0014,0x0014}, {0x0015,0x0015,0x0015},
- {0x0016,0x0016,0x0016}, {0x0017,0x0017,0x0017},
- {0x0018,0x0018,0x0018}, {0x0019,0x0019,0x0019},
- {0x001A,0x001A,0x001A}, {0x001B,0x001B,0x001B},
- {0x001C,0x001C,0x001C}, {0x001D,0x001D,0x001D},
- {0x001E,0x001E,0x001E}, {0x001F,0x001F,0x001F},
- {0x0020,0x0020,0x0020}, {0x0021,0x0021,0x0021},
- {0x0022,0x0022,0x0022}, {0x0023,0x0023,0x0023},
- {0x0024,0x0024,0x0024}, {0x0025,0x0025,0x0025},
- {0x0026,0x0026,0x0026}, {0x0027,0x0027,0x0027},
- {0x0028,0x0028,0x0028}, {0x0029,0x0029,0x0029},
- {0x002A,0x002A,0x002A}, {0x002B,0x002B,0x002B},
- {0x002C,0x002C,0x002C}, {0x002D,0x002D,0x002D},
- {0x002E,0x002E,0x002E}, {0x002F,0x002F,0x002F},
- {0x0030,0x0030,0x0030}, {0x0031,0x0031,0x0031},
- {0x0032,0x0032,0x0032}, {0x0033,0x0033,0x0033},
- {0x0034,0x0034,0x0034}, {0x0035,0x0035,0x0035},
- {0x0036,0x0036,0x0036}, {0x0037,0x0037,0x0037},
- {0x0038,0x0038,0x0038}, {0x0039,0x0039,0x0039},
- {0x003A,0x003A,0x003A}, {0x003B,0x003B,0x003B},
- {0x003C,0x003C,0x003C}, {0x003D,0x003D,0x003D},
- {0x003E,0x003E,0x003E}, {0x003F,0x003F,0x003F},
- {0x0040,0x0040,0x0040}, {0x0041,0x0061,0x0041},
- {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043},
- {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045},
- {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047},
- {0x0048,0x0068,0x0048}, {0x0049,0x0131,0x0049},
- {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B},
- {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D},
- {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F},
- {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051},
- {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053},
- {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055},
- {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057},
- {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059},
- {0x005A,0x007A,0x005A}, {0x005B,0x005B,0x005B},
- {0x005C,0x005C,0x005C}, {0x005D,0x005D,0x005D},
- {0x005E,0x005E,0x005E}, {0x005F,0x005F,0x005F},
- {0x0060,0x0060,0x0060}, {0x0041,0x0061,0x0041},
- {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043},
- {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045},
- {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047},
- {0x0048,0x0068,0x0048}, {0x0130,0x0069,0x0049},
- {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B},
- {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D},
- {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F},
- {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051},
- {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053},
- {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055},
- {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057},
- {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059},
- {0x005A,0x007A,0x005A}, {0x007B,0x007B,0x007B},
- {0x007C,0x007C,0x007C}, {0x007D,0x007D,0x007D},
- {0x007E,0x007E,0x007E}, {0x007F,0x007F,0x007F},
- {0x0080,0x0080,0x0080}, {0x0081,0x0081,0x0081},
- {0x0082,0x0082,0x0082}, {0x0083,0x0083,0x0083},
- {0x0084,0x0084,0x0084}, {0x0085,0x0085,0x0085},
- {0x0086,0x0086,0x0086}, {0x0087,0x0087,0x0087},
- {0x0088,0x0088,0x0088}, {0x0089,0x0089,0x0089},
- {0x008A,0x008A,0x008A}, {0x008B,0x008B,0x008B},
- {0x008C,0x008C,0x008C}, {0x008D,0x008D,0x008D},
- {0x008E,0x008E,0x008E}, {0x008F,0x008F,0x008F},
- {0x0090,0x0090,0x0090}, {0x0091,0x0091,0x0091},
- {0x0092,0x0092,0x0092}, {0x0093,0x0093,0x0093},
- {0x0094,0x0094,0x0094}, {0x0095,0x0095,0x0095},
- {0x0096,0x0096,0x0096}, {0x0097,0x0097,0x0097},
- {0x0098,0x0098,0x0098}, {0x0099,0x0099,0x0099},
- {0x009A,0x009A,0x009A}, {0x009B,0x009B,0x009B},
- {0x009C,0x009C,0x009C}, {0x009D,0x009D,0x009D},
- {0x009E,0x009E,0x009E}, {0x009F,0x009F,0x009F},
- {0x00A0,0x00A0,0x00A0}, {0x00A1,0x00A1,0x00A1},
- {0x00A2,0x00A2,0x00A2}, {0x00A3,0x00A3,0x00A3},
- {0x00A4,0x00A4,0x00A4}, {0x00A5,0x00A5,0x00A5},
- {0x00A6,0x00A6,0x00A6}, {0x00A7,0x00A7,0x00A7},
- {0x00A8,0x00A8,0x00A8}, {0x00A9,0x00A9,0x00A9},
- {0x00AA,0x00AA,0x00AA}, {0x00AB,0x00AB,0x00AB},
- {0x00AC,0x00AC,0x00AC}, {0x00AD,0x00AD,0x00AD},
- {0x00AE,0x00AE,0x00AE}, {0x00AF,0x00AF,0x00AF},
- {0x00B0,0x00B0,0x00B0}, {0x00B1,0x00B1,0x00B1},
- {0x00B2,0x00B2,0x00B2}, {0x00B3,0x00B3,0x00B3},
- {0x00B4,0x00B4,0x00B4}, {0x039C,0x00B5,0x039C},
- {0x00B6,0x00B6,0x00B6}, {0x00B7,0x00B7,0x00B7},
- {0x00B8,0x00B8,0x00B8}, {0x00B9,0x00B9,0x00B9},
- {0x00BA,0x00BA,0x00BA}, {0x00BB,0x00BB,0x00BB},
- {0x00BC,0x00BC,0x00BC}, {0x00BD,0x00BD,0x00BD},
- {0x00BE,0x00BE,0x00BE}, {0x00BF,0x00BF,0x00BF},
- {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041},
- {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041},
- {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041},
- {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043},
- {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045},
- {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045},
- {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049},
- {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049},
- {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E},
- {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F},
- {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F},
- {0x00D6,0x00F6,0x004F}, {0x00D7,0x00D7,0x00D7},
- {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055},
- {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055},
- {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059},
- {0x00DE,0x00FE,0x00DE}, {0x00DF,0x00DF,0x00DF},
- {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041},
- {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041},
- {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041},
- {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043},
- {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045},
- {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045},
- {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049},
- {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049},
- {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E},
- {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F},
- {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F},
- {0x00D6,0x00F6,0x004F}, {0x00F7,0x00F7,0x00F7},
- {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055},
- {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055},
- {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059},
- {0x00DE,0x00FE,0x00DE}, {0x0178,0x00FF,0x0059}
-};
-
-
-
-static MY_UNICASE_CHARACTER *my_unicase_pages_turkish[256]=
-{
- 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,
- NULL, plane21, NULL, NULL, plane24, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, planeFF
-};
-
-
-MY_UNICASE_INFO my_unicase_turkish=
-{
- 0xFFFF,
- my_unicase_pages_turkish
-};
-
-
-/* Unicode-5.2.0 case folding information */
-static MY_UNICASE_CHARACTER u520p00[]={
- {0x0000,0x0000,0x0000}, {0x0001,0x0001,0x0001}, /* 0000 */
- {0x0002,0x0002,0x0002}, {0x0003,0x0003,0x0003}, /* 0002 */
- {0x0004,0x0004,0x0004}, {0x0005,0x0005,0x0005}, /* 0004 */
- {0x0006,0x0006,0x0006}, {0x0007,0x0007,0x0007}, /* 0006 */
- {0x0008,0x0008,0x0008}, {0x0009,0x0009,0x0009}, /* 0008 */
- {0x000A,0x000A,0x000A}, {0x000B,0x000B,0x000B}, /* 000A */
- {0x000C,0x000C,0x000C}, {0x000D,0x000D,0x000D}, /* 000C */
- {0x000E,0x000E,0x000E}, {0x000F,0x000F,0x000F}, /* 000E */
- {0x0010,0x0010,0x0010}, {0x0011,0x0011,0x0011}, /* 0010 */
- {0x0012,0x0012,0x0012}, {0x0013,0x0013,0x0013}, /* 0012 */
- {0x0014,0x0014,0x0014}, {0x0015,0x0015,0x0015}, /* 0014 */
- {0x0016,0x0016,0x0016}, {0x0017,0x0017,0x0017}, /* 0016 */
- {0x0018,0x0018,0x0018}, {0x0019,0x0019,0x0019}, /* 0018 */
- {0x001A,0x001A,0x001A}, {0x001B,0x001B,0x001B}, /* 001A */
- {0x001C,0x001C,0x001C}, {0x001D,0x001D,0x001D}, /* 001C */
- {0x001E,0x001E,0x001E}, {0x001F,0x001F,0x001F}, /* 001E */
- {0x0020,0x0020,0x0020}, {0x0021,0x0021,0x0021}, /* 0020 */
- {0x0022,0x0022,0x0022}, {0x0023,0x0023,0x0023}, /* 0022 */
- {0x0024,0x0024,0x0024}, {0x0025,0x0025,0x0025}, /* 0024 */
- {0x0026,0x0026,0x0026}, {0x0027,0x0027,0x0027}, /* 0026 */
- {0x0028,0x0028,0x0028}, {0x0029,0x0029,0x0029}, /* 0028 */
- {0x002A,0x002A,0x002A}, {0x002B,0x002B,0x002B}, /* 002A */
- {0x002C,0x002C,0x002C}, {0x002D,0x002D,0x002D}, /* 002C */
- {0x002E,0x002E,0x002E}, {0x002F,0x002F,0x002F}, /* 002E */
- {0x0030,0x0030,0x0030}, {0x0031,0x0031,0x0031}, /* 0030 */
- {0x0032,0x0032,0x0032}, {0x0033,0x0033,0x0033}, /* 0032 */
- {0x0034,0x0034,0x0034}, {0x0035,0x0035,0x0035}, /* 0034 */
- {0x0036,0x0036,0x0036}, {0x0037,0x0037,0x0037}, /* 0036 */
- {0x0038,0x0038,0x0038}, {0x0039,0x0039,0x0039}, /* 0038 */
- {0x003A,0x003A,0x003A}, {0x003B,0x003B,0x003B}, /* 003A */
- {0x003C,0x003C,0x003C}, {0x003D,0x003D,0x003D}, /* 003C */
- {0x003E,0x003E,0x003E}, {0x003F,0x003F,0x003F}, /* 003E */
- {0x0040,0x0040,0x0040}, {0x0041,0x0061,0x0041}, /* 0040 */
- {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043}, /* 0042 */
- {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045}, /* 0044 */
- {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047}, /* 0046 */
- {0x0048,0x0068,0x0048}, {0x0049,0x0069,0x0049}, /* 0048 */
- {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B}, /* 004A */
- {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D}, /* 004C */
- {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F}, /* 004E */
- {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051}, /* 0050 */
- {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053}, /* 0052 */
- {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055}, /* 0054 */
- {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057}, /* 0056 */
- {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059}, /* 0058 */
- {0x005A,0x007A,0x005A}, {0x005B,0x005B,0x005B}, /* 005A */
- {0x005C,0x005C,0x005C}, {0x005D,0x005D,0x005D}, /* 005C */
- {0x005E,0x005E,0x005E}, {0x005F,0x005F,0x005F}, /* 005E */
- {0x0060,0x0060,0x0060}, {0x0041,0x0061,0x0041}, /* 0060 */
- {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043}, /* 0062 */
- {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045}, /* 0064 */
- {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047}, /* 0066 */
- {0x0048,0x0068,0x0048}, {0x0049,0x0069,0x0049}, /* 0068 */
- {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B}, /* 006A */
- {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D}, /* 006C */
- {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F}, /* 006E */
- {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051}, /* 0070 */
- {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053}, /* 0072 */
- {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055}, /* 0074 */
- {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057}, /* 0076 */
- {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059}, /* 0078 */
- {0x005A,0x007A,0x005A}, {0x007B,0x007B,0x007B}, /* 007A */
- {0x007C,0x007C,0x007C}, {0x007D,0x007D,0x007D}, /* 007C */
- {0x007E,0x007E,0x007E}, {0x007F,0x007F,0x007F}, /* 007E */
- {0x0080,0x0080,0x0080}, {0x0081,0x0081,0x0081}, /* 0080 */
- {0x0082,0x0082,0x0082}, {0x0083,0x0083,0x0083}, /* 0082 */
- {0x0084,0x0084,0x0084}, {0x0085,0x0085,0x0085}, /* 0084 */
- {0x0086,0x0086,0x0086}, {0x0087,0x0087,0x0087}, /* 0086 */
- {0x0088,0x0088,0x0088}, {0x0089,0x0089,0x0089}, /* 0088 */
- {0x008A,0x008A,0x008A}, {0x008B,0x008B,0x008B}, /* 008A */
- {0x008C,0x008C,0x008C}, {0x008D,0x008D,0x008D}, /* 008C */
- {0x008E,0x008E,0x008E}, {0x008F,0x008F,0x008F}, /* 008E */
- {0x0090,0x0090,0x0090}, {0x0091,0x0091,0x0091}, /* 0090 */
- {0x0092,0x0092,0x0092}, {0x0093,0x0093,0x0093}, /* 0092 */
- {0x0094,0x0094,0x0094}, {0x0095,0x0095,0x0095}, /* 0094 */
- {0x0096,0x0096,0x0096}, {0x0097,0x0097,0x0097}, /* 0096 */
- {0x0098,0x0098,0x0098}, {0x0099,0x0099,0x0099}, /* 0098 */
- {0x009A,0x009A,0x009A}, {0x009B,0x009B,0x009B}, /* 009A */
- {0x009C,0x009C,0x009C}, {0x009D,0x009D,0x009D}, /* 009C */
- {0x009E,0x009E,0x009E}, {0x009F,0x009F,0x009F}, /* 009E */
- {0x00A0,0x00A0,0x00A0}, {0x00A1,0x00A1,0x00A1}, /* 00A0 */
- {0x00A2,0x00A2,0x00A2}, {0x00A3,0x00A3,0x00A3}, /* 00A2 */
- {0x00A4,0x00A4,0x00A4}, {0x00A5,0x00A5,0x00A5}, /* 00A4 */
- {0x00A6,0x00A6,0x00A6}, {0x00A7,0x00A7,0x00A7}, /* 00A6 */
- {0x00A8,0x00A8,0x00A8}, {0x00A9,0x00A9,0x00A9}, /* 00A8 */
- {0x00AA,0x00AA,0x00AA}, {0x00AB,0x00AB,0x00AB}, /* 00AA */
- {0x00AC,0x00AC,0x00AC}, {0x00AD,0x00AD,0x00AD}, /* 00AC */
- {0x00AE,0x00AE,0x00AE}, {0x00AF,0x00AF,0x00AF}, /* 00AE */
- {0x00B0,0x00B0,0x00B0}, {0x00B1,0x00B1,0x00B1}, /* 00B0 */
- {0x00B2,0x00B2,0x00B2}, {0x00B3,0x00B3,0x00B3}, /* 00B2 */
- {0x00B4,0x00B4,0x00B4}, {0x039C,0x00B5,0x039C}, /* 00B4 */
- {0x00B6,0x00B6,0x00B6}, {0x00B7,0x00B7,0x00B7}, /* 00B6 */
- {0x00B8,0x00B8,0x00B8}, {0x00B9,0x00B9,0x00B9}, /* 00B8 */
- {0x00BA,0x00BA,0x00BA}, {0x00BB,0x00BB,0x00BB}, /* 00BA */
- {0x00BC,0x00BC,0x00BC}, {0x00BD,0x00BD,0x00BD}, /* 00BC */
- {0x00BE,0x00BE,0x00BE}, {0x00BF,0x00BF,0x00BF}, /* 00BE */
- {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041}, /* 00C0 */
- {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041}, /* 00C2 */
- {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041}, /* 00C4 */
- {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043}, /* 00C6 */
- {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045}, /* 00C8 */
- {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045}, /* 00CA */
- {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049}, /* 00CC */
- {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049}, /* 00CE */
- {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E}, /* 00D0 */
- {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F}, /* 00D2 */
- {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F}, /* 00D4 */
- {0x00D6,0x00F6,0x004F}, {0x00D7,0x00D7,0x00D7}, /* 00D6 */
- {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055}, /* 00D8 */
- {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055}, /* 00DA */
- {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059}, /* 00DC */
- {0x00DE,0x00FE,0x00DE}, {0x00DF,0x00DF,0x0053}, /* 00DE */
- {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041}, /* 00E0 */
- {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041}, /* 00E2 */
- {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041}, /* 00E4 */
- {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043}, /* 00E6 */
- {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045}, /* 00E8 */
- {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045}, /* 00EA */
- {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049}, /* 00EC */
- {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049}, /* 00EE */
- {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E}, /* 00F0 */
- {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F}, /* 00F2 */
- {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F}, /* 00F4 */
- {0x00D6,0x00F6,0x004F}, {0x00F7,0x00F7,0x00F7}, /* 00F6 */
- {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055}, /* 00F8 */
- {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055}, /* 00FA */
- {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059}, /* 00FC */
- {0x00DE,0x00FE,0x00DE}, {0x0178,0x00FF,0x0059} /* 00FE */
-};
-
-static MY_UNICASE_CHARACTER u520p01[]={
- {0x0100,0x0101,0x0041}, {0x0100,0x0101,0x0041}, /* 0100 */
- {0x0102,0x0103,0x0041}, {0x0102,0x0103,0x0041}, /* 0102 */
- {0x0104,0x0105,0x0041}, {0x0104,0x0105,0x0041}, /* 0104 */
- {0x0106,0x0107,0x0043}, {0x0106,0x0107,0x0043}, /* 0106 */
- {0x0108,0x0109,0x0043}, {0x0108,0x0109,0x0043}, /* 0108 */
- {0x010A,0x010B,0x0043}, {0x010A,0x010B,0x0043}, /* 010A */
- {0x010C,0x010D,0x0043}, {0x010C,0x010D,0x0043}, /* 010C */
- {0x010E,0x010F,0x0044}, {0x010E,0x010F,0x0044}, /* 010E */
- {0x0110,0x0111,0x0110}, {0x0110,0x0111,0x0110}, /* 0110 */
- {0x0112,0x0113,0x0045}, {0x0112,0x0113,0x0045}, /* 0112 */
- {0x0114,0x0115,0x0045}, {0x0114,0x0115,0x0045}, /* 0114 */
- {0x0116,0x0117,0x0045}, {0x0116,0x0117,0x0045}, /* 0116 */
- {0x0118,0x0119,0x0045}, {0x0118,0x0119,0x0045}, /* 0118 */
- {0x011A,0x011B,0x0045}, {0x011A,0x011B,0x0045}, /* 011A */
- {0x011C,0x011D,0x0047}, {0x011C,0x011D,0x0047}, /* 011C */
- {0x011E,0x011F,0x0047}, {0x011E,0x011F,0x0047}, /* 011E */
- {0x0120,0x0121,0x0047}, {0x0120,0x0121,0x0047}, /* 0120 */
- {0x0122,0x0123,0x0047}, {0x0122,0x0123,0x0047}, /* 0122 */
- {0x0124,0x0125,0x0048}, {0x0124,0x0125,0x0048}, /* 0124 */
- {0x0126,0x0127,0x0126}, {0x0126,0x0127,0x0126}, /* 0126 */
- {0x0128,0x0129,0x0049}, {0x0128,0x0129,0x0049}, /* 0128 */
- {0x012A,0x012B,0x0049}, {0x012A,0x012B,0x0049}, /* 012A */
- {0x012C,0x012D,0x0049}, {0x012C,0x012D,0x0049}, /* 012C */
- {0x012E,0x012F,0x0049}, {0x012E,0x012F,0x0049}, /* 012E */
- {0x0130,0x0069,0x0049}, {0x0049,0x0131,0x0049}, /* 0130 */
- {0x0132,0x0133,0x0132}, {0x0132,0x0133,0x0132}, /* 0132 */
- {0x0134,0x0135,0x004A}, {0x0134,0x0135,0x004A}, /* 0134 */
- {0x0136,0x0137,0x004B}, {0x0136,0x0137,0x004B}, /* 0136 */
- {0x0138,0x0138,0x0138}, {0x0139,0x013A,0x004C}, /* 0138 */
- {0x0139,0x013A,0x004C}, {0x013B,0x013C,0x004C}, /* 013A */
- {0x013B,0x013C,0x004C}, {0x013D,0x013E,0x004C}, /* 013C */
- {0x013D,0x013E,0x004C}, {0x013F,0x0140,0x013F}, /* 013E */
- {0x013F,0x0140,0x013F}, {0x0141,0x0142,0x0141}, /* 0140 */
- {0x0141,0x0142,0x0141}, {0x0143,0x0144,0x004E}, /* 0142 */
- {0x0143,0x0144,0x004E}, {0x0145,0x0146,0x004E}, /* 0144 */
- {0x0145,0x0146,0x004E}, {0x0147,0x0148,0x004E}, /* 0146 */
- {0x0147,0x0148,0x004E}, {0x0149,0x0149,0x0149}, /* 0148 */
- {0x014A,0x014B,0x014A}, {0x014A,0x014B,0x014A}, /* 014A */
- {0x014C,0x014D,0x004F}, {0x014C,0x014D,0x004F}, /* 014C */
- {0x014E,0x014F,0x004F}, {0x014E,0x014F,0x004F}, /* 014E */
- {0x0150,0x0151,0x004F}, {0x0150,0x0151,0x004F}, /* 0150 */
- {0x0152,0x0153,0x0152}, {0x0152,0x0153,0x0152}, /* 0152 */
- {0x0154,0x0155,0x0052}, {0x0154,0x0155,0x0052}, /* 0154 */
- {0x0156,0x0157,0x0052}, {0x0156,0x0157,0x0052}, /* 0156 */
- {0x0158,0x0159,0x0052}, {0x0158,0x0159,0x0052}, /* 0158 */
- {0x015A,0x015B,0x0053}, {0x015A,0x015B,0x0053}, /* 015A */
- {0x015C,0x015D,0x0053}, {0x015C,0x015D,0x0053}, /* 015C */
- {0x015E,0x015F,0x0053}, {0x015E,0x015F,0x0053}, /* 015E */
- {0x0160,0x0161,0x0053}, {0x0160,0x0161,0x0053}, /* 0160 */
- {0x0162,0x0163,0x0054}, {0x0162,0x0163,0x0054}, /* 0162 */
- {0x0164,0x0165,0x0054}, {0x0164,0x0165,0x0054}, /* 0164 */
- {0x0166,0x0167,0x0166}, {0x0166,0x0167,0x0166}, /* 0166 */
- {0x0168,0x0169,0x0055}, {0x0168,0x0169,0x0055}, /* 0168 */
- {0x016A,0x016B,0x0055}, {0x016A,0x016B,0x0055}, /* 016A */
- {0x016C,0x016D,0x0055}, {0x016C,0x016D,0x0055}, /* 016C */
- {0x016E,0x016F,0x0055}, {0x016E,0x016F,0x0055}, /* 016E */
- {0x0170,0x0171,0x0055}, {0x0170,0x0171,0x0055}, /* 0170 */
- {0x0172,0x0173,0x0055}, {0x0172,0x0173,0x0055}, /* 0172 */
- {0x0174,0x0175,0x0057}, {0x0174,0x0175,0x0057}, /* 0174 */
- {0x0176,0x0177,0x0059}, {0x0176,0x0177,0x0059}, /* 0176 */
- {0x0178,0x00FF,0x0059}, {0x0179,0x017A,0x005A}, /* 0178 */
- {0x0179,0x017A,0x005A}, {0x017B,0x017C,0x005A}, /* 017A */
- {0x017B,0x017C,0x005A}, {0x017D,0x017E,0x005A}, /* 017C */
- {0x017D,0x017E,0x005A}, {0x0053,0x017F,0x0053}, /* 017E */
- {0x0243,0x0180,0x0243}, {0x0181,0x0253,0x0181}, /* 0180 */
- {0x0182,0x0183,0x0182}, {0x0182,0x0183,0x0182}, /* 0182 */
- {0x0184,0x0185,0x0184}, {0x0184,0x0185,0x0184}, /* 0184 */
- {0x0186,0x0254,0x0186}, {0x0187,0x0188,0x0187}, /* 0186 */
- {0x0187,0x0188,0x0187}, {0x0189,0x0256,0x0189}, /* 0188 */
- {0x018A,0x0257,0x018A}, {0x018B,0x018C,0x018B}, /* 018A */
- {0x018B,0x018C,0x018B}, {0x018D,0x018D,0x018D}, /* 018C */
- {0x018E,0x01DD,0x018E}, {0x018F,0x0259,0x018F}, /* 018E */
- {0x0190,0x025B,0x0190}, {0x0191,0x0192,0x0191}, /* 0190 */
- {0x0191,0x0192,0x0191}, {0x0193,0x0260,0x0193}, /* 0192 */
- {0x0194,0x0263,0x0194}, {0x01F6,0x0195,0x01F6}, /* 0194 */
- {0x0196,0x0269,0x0196}, {0x0197,0x0268,0x0197}, /* 0196 */
- {0x0198,0x0199,0x0198}, {0x0198,0x0199,0x0198}, /* 0198 */
- {0x023D,0x019A,0x023D}, {0x019B,0x019B,0x019B}, /* 019A */
- {0x019C,0x026F,0x019C}, {0x019D,0x0272,0x019D}, /* 019C */
- {0x0220,0x019E,0x0220}, {0x019F,0x0275,0x019F}, /* 019E */
- {0x01A0,0x01A1,0x004F}, {0x01A0,0x01A1,0x004F}, /* 01A0 */
- {0x01A2,0x01A3,0x01A2}, {0x01A2,0x01A3,0x01A2}, /* 01A2 */
- {0x01A4,0x01A5,0x01A4}, {0x01A4,0x01A5,0x01A4}, /* 01A4 */
- {0x01A6,0x0280,0x01A6}, {0x01A7,0x01A8,0x01A7}, /* 01A6 */
- {0x01A7,0x01A8,0x01A7}, {0x01A9,0x0283,0x01A9}, /* 01A8 */
- {0x01AA,0x01AA,0x01AA}, {0x01AB,0x01AB,0x01AB}, /* 01AA */
- {0x01AC,0x01AD,0x01AC}, {0x01AC,0x01AD,0x01AC}, /* 01AC */
- {0x01AE,0x0288,0x01AE}, {0x01AF,0x01B0,0x0055}, /* 01AE */
- {0x01AF,0x01B0,0x0055}, {0x01B1,0x028A,0x01B1}, /* 01B0 */
- {0x01B2,0x028B,0x01B2}, {0x01B3,0x01B4,0x01B3}, /* 01B2 */
- {0x01B3,0x01B4,0x01B3}, {0x01B5,0x01B6,0x01B5}, /* 01B4 */
- {0x01B5,0x01B6,0x01B5}, {0x01B7,0x0292,0x01B7}, /* 01B6 */
- {0x01B8,0x01B9,0x01B8}, {0x01B8,0x01B9,0x01B8}, /* 01B8 */
- {0x01BA,0x01BA,0x01BA}, {0x01BB,0x01BB,0x01BB}, /* 01BA */
- {0x01BC,0x01BD,0x01BC}, {0x01BC,0x01BD,0x01BC}, /* 01BC */
- {0x01BE,0x01BE,0x01BE}, {0x01F7,0x01BF,0x01F7}, /* 01BE */
- {0x01C0,0x01C0,0x01C0}, {0x01C1,0x01C1,0x01C1}, /* 01C0 */
- {0x01C2,0x01C2,0x01C2}, {0x01C3,0x01C3,0x01C3}, /* 01C2 */
- {0x01C4,0x01C6,0x01C4}, {0x01C4,0x01C6,0x01C4}, /* 01C4 */
- {0x01C4,0x01C6,0x01C4}, {0x01C7,0x01C9,0x01C7}, /* 01C6 */
- {0x01C7,0x01C9,0x01C7}, {0x01C7,0x01C9,0x01C7}, /* 01C8 */
- {0x01CA,0x01CC,0x01CA}, {0x01CA,0x01CC,0x01CA}, /* 01CA */
- {0x01CA,0x01CC,0x01CA}, {0x01CD,0x01CE,0x0041}, /* 01CC */
- {0x01CD,0x01CE,0x0041}, {0x01CF,0x01D0,0x0049}, /* 01CE */
- {0x01CF,0x01D0,0x0049}, {0x01D1,0x01D2,0x004F}, /* 01D0 */
- {0x01D1,0x01D2,0x004F}, {0x01D3,0x01D4,0x0055}, /* 01D2 */
- {0x01D3,0x01D4,0x0055}, {0x01D5,0x01D6,0x0055}, /* 01D4 */
- {0x01D5,0x01D6,0x0055}, {0x01D7,0x01D8,0x0055}, /* 01D6 */
- {0x01D7,0x01D8,0x0055}, {0x01D9,0x01DA,0x0055}, /* 01D8 */
- {0x01D9,0x01DA,0x0055}, {0x01DB,0x01DC,0x0055}, /* 01DA */
- {0x01DB,0x01DC,0x0055}, {0x018E,0x01DD,0x018E}, /* 01DC */
- {0x01DE,0x01DF,0x0041}, {0x01DE,0x01DF,0x0041}, /* 01DE */
- {0x01E0,0x01E1,0x0041}, {0x01E0,0x01E1,0x0041}, /* 01E0 */
- {0x01E2,0x01E3,0x00C6}, {0x01E2,0x01E3,0x00C6}, /* 01E2 */
- {0x01E4,0x01E5,0x01E4}, {0x01E4,0x01E5,0x01E4}, /* 01E4 */
- {0x01E6,0x01E7,0x0047}, {0x01E6,0x01E7,0x0047}, /* 01E6 */
- {0x01E8,0x01E9,0x004B}, {0x01E8,0x01E9,0x004B}, /* 01E8 */
- {0x01EA,0x01EB,0x004F}, {0x01EA,0x01EB,0x004F}, /* 01EA */
- {0x01EC,0x01ED,0x004F}, {0x01EC,0x01ED,0x004F}, /* 01EC */
- {0x01EE,0x01EF,0x01B7}, {0x01EE,0x01EF,0x01B7}, /* 01EE */
- {0x01F0,0x01F0,0x004A}, {0x01F1,0x01F3,0x01F1}, /* 01F0 */
- {0x01F1,0x01F3,0x01F1}, {0x01F1,0x01F3,0x01F1}, /* 01F2 */
- {0x01F4,0x01F5,0x0047}, {0x01F4,0x01F5,0x0047}, /* 01F4 */
- {0x01F6,0x0195,0x01F6}, {0x01F7,0x01BF,0x01F7}, /* 01F6 */
- {0x01F8,0x01F9,0x004E}, {0x01F8,0x01F9,0x004E}, /* 01F8 */
- {0x01FA,0x01FB,0x0041}, {0x01FA,0x01FB,0x0041}, /* 01FA */
- {0x01FC,0x01FD,0x00C6}, {0x01FC,0x01FD,0x00C6}, /* 01FC */
- {0x01FE,0x01FF,0x00D8}, {0x01FE,0x01FF,0x00D8} /* 01FE */
-};
-
-static MY_UNICASE_CHARACTER u520p02[]={
- {0x0200,0x0201,0x0041}, {0x0200,0x0201,0x0041}, /* 0200 */
- {0x0202,0x0203,0x0041}, {0x0202,0x0203,0x0041}, /* 0202 */
- {0x0204,0x0205,0x0045}, {0x0204,0x0205,0x0045}, /* 0204 */
- {0x0206,0x0207,0x0045}, {0x0206,0x0207,0x0045}, /* 0206 */
- {0x0208,0x0209,0x0049}, {0x0208,0x0209,0x0049}, /* 0208 */
- {0x020A,0x020B,0x0049}, {0x020A,0x020B,0x0049}, /* 020A */
- {0x020C,0x020D,0x004F}, {0x020C,0x020D,0x004F}, /* 020C */
- {0x020E,0x020F,0x004F}, {0x020E,0x020F,0x004F}, /* 020E */
- {0x0210,0x0211,0x0052}, {0x0210,0x0211,0x0052}, /* 0210 */
- {0x0212,0x0213,0x0052}, {0x0212,0x0213,0x0052}, /* 0212 */
- {0x0214,0x0215,0x0055}, {0x0214,0x0215,0x0055}, /* 0214 */
- {0x0216,0x0217,0x0055}, {0x0216,0x0217,0x0055}, /* 0216 */
- {0x0218,0x0219,0x0053}, {0x0218,0x0219,0x0053}, /* 0218 */
- {0x021A,0x021B,0x0054}, {0x021A,0x021B,0x0054}, /* 021A */
- {0x021C,0x021D,0x021C}, {0x021C,0x021D,0x021C}, /* 021C */
- {0x021E,0x021F,0x0048}, {0x021E,0x021F,0x0048}, /* 021E */
- {0x0220,0x019E,0x0220}, {0x0221,0x0221,0x0221}, /* 0220 */
- {0x0222,0x0223,0x0222}, {0x0222,0x0223,0x0222}, /* 0222 */
- {0x0224,0x0225,0x0224}, {0x0224,0x0225,0x0224}, /* 0224 */
- {0x0226,0x0227,0x0041}, {0x0226,0x0227,0x0041}, /* 0226 */
- {0x0228,0x0229,0x0045}, {0x0228,0x0229,0x0045}, /* 0228 */
- {0x022A,0x022B,0x004F}, {0x022A,0x022B,0x004F}, /* 022A */
- {0x022C,0x022D,0x004F}, {0x022C,0x022D,0x004F}, /* 022C */
- {0x022E,0x022F,0x004F}, {0x022E,0x022F,0x004F}, /* 022E */
- {0x0230,0x0231,0x004F}, {0x0230,0x0231,0x004F}, /* 0230 */
- {0x0232,0x0233,0x0059}, {0x0232,0x0233,0x0059}, /* 0232 */
- {0x0234,0x0234,0x0234}, {0x0235,0x0235,0x0235}, /* 0234 */
- {0x0236,0x0236,0x0236}, {0x0237,0x0237,0x0237}, /* 0236 */
- {0x0238,0x0238,0x0238}, {0x0239,0x0239,0x0239}, /* 0238 */
- {0x023A,0x2C65,0x023A}, {0x023B,0x023C,0x023B}, /* 023A */
- {0x023B,0x023C,0x023B}, {0x023D,0x019A,0x023D}, /* 023C */
- {0x023E,0x2C66,0x023E}, {0x2C7E,0x023F,0x2C7E}, /* 023E */
- {0x2C7F,0x0240,0x2C7F}, {0x0241,0x0242,0x0241}, /* 0240 */
- {0x0241,0x0242,0x0241}, {0x0243,0x0180,0x0243}, /* 0242 */
- {0x0244,0x0289,0x0244}, {0x0245,0x028C,0x0245}, /* 0244 */
- {0x0246,0x0247,0x0246}, {0x0246,0x0247,0x0246}, /* 0246 */
- {0x0248,0x0249,0x0248}, {0x0248,0x0249,0x0248}, /* 0248 */
- {0x024A,0x024B,0x024A}, {0x024A,0x024B,0x024A}, /* 024A */
- {0x024C,0x024D,0x024C}, {0x024C,0x024D,0x024C}, /* 024C */
- {0x024E,0x024F,0x024E}, {0x024E,0x024F,0x024E}, /* 024E */
- {0x2C6F,0x0250,0x2C6F}, {0x2C6D,0x0251,0x2C6D}, /* 0250 */
- {0x2C70,0x0252,0x2C70}, {0x0181,0x0253,0x0181}, /* 0252 */
- {0x0186,0x0254,0x0186}, {0x0255,0x0255,0x0255}, /* 0254 */
- {0x0189,0x0256,0x0189}, {0x018A,0x0257,0x018A}, /* 0256 */
- {0x0258,0x0258,0x0258}, {0x018F,0x0259,0x018F}, /* 0258 */
- {0x025A,0x025A,0x025A}, {0x0190,0x025B,0x0190}, /* 025A */
- {0x025C,0x025C,0x025C}, {0x025D,0x025D,0x025D}, /* 025C */
- {0x025E,0x025E,0x025E}, {0x025F,0x025F,0x025F}, /* 025E */
- {0x0193,0x0260,0x0193}, {0x0261,0x0261,0x0261}, /* 0260 */
- {0x0262,0x0262,0x0262}, {0x0194,0x0263,0x0194}, /* 0262 */
- {0x0264,0x0264,0x0264}, {0x0265,0x0265,0x0265}, /* 0264 */
- {0x0266,0x0266,0x0266}, {0x0267,0x0267,0x0267}, /* 0266 */
- {0x0197,0x0268,0x0197}, {0x0196,0x0269,0x0196}, /* 0268 */
- {0x026A,0x026A,0x026A}, {0x2C62,0x026B,0x2C62}, /* 026A */
- {0x026C,0x026C,0x026C}, {0x026D,0x026D,0x026D}, /* 026C */
- {0x026E,0x026E,0x026E}, {0x019C,0x026F,0x019C}, /* 026E */
- {0x0270,0x0270,0x0270}, {0x2C6E,0x0271,0x2C6E}, /* 0270 */
- {0x019D,0x0272,0x019D}, {0x0273,0x0273,0x0273}, /* 0272 */
- {0x0274,0x0274,0x0274}, {0x019F,0x0275,0x019F}, /* 0274 */
- {0x0276,0x0276,0x0276}, {0x0277,0x0277,0x0277}, /* 0276 */
- {0x0278,0x0278,0x0278}, {0x0279,0x0279,0x0279}, /* 0278 */
- {0x027A,0x027A,0x027A}, {0x027B,0x027B,0x027B}, /* 027A */
- {0x027C,0x027C,0x027C}, {0x2C64,0x027D,0x2C64}, /* 027C */
- {0x027E,0x027E,0x027E}, {0x027F,0x027F,0x027F}, /* 027E */
- {0x01A6,0x0280,0x01A6}, {0x0281,0x0281,0x0281}, /* 0280 */
- {0x0282,0x0282,0x0282}, {0x01A9,0x0283,0x01A9}, /* 0282 */
- {0x0284,0x0284,0x0284}, {0x0285,0x0285,0x0285}, /* 0284 */
- {0x0286,0x0286,0x0286}, {0x0287,0x0287,0x0287}, /* 0286 */
- {0x01AE,0x0288,0x01AE}, {0x0244,0x0289,0x0244}, /* 0288 */
- {0x01B1,0x028A,0x01B1}, {0x01B2,0x028B,0x01B2}, /* 028A */
- {0x0245,0x028C,0x0245}, {0x028D,0x028D,0x028D}, /* 028C */
- {0x028E,0x028E,0x028E}, {0x028F,0x028F,0x028F}, /* 028E */
- {0x0290,0x0290,0x0290}, {0x0291,0x0291,0x0291}, /* 0290 */
- {0x01B7,0x0292,0x01B7}, {0x0293,0x0293,0x0293}, /* 0292 */
- {0x0294,0x0294,0x0294}, {0x0295,0x0295,0x0295}, /* 0294 */
- {0x0296,0x0296,0x0296}, {0x0297,0x0297,0x0297}, /* 0296 */
- {0x0298,0x0298,0x0298}, {0x0299,0x0299,0x0299}, /* 0298 */
- {0x029A,0x029A,0x029A}, {0x029B,0x029B,0x029B}, /* 029A */
- {0x029C,0x029C,0x029C}, {0x029D,0x029D,0x029D}, /* 029C */
- {0x029E,0x029E,0x029E}, {0x029F,0x029F,0x029F}, /* 029E */
- {0x02A0,0x02A0,0x02A0}, {0x02A1,0x02A1,0x02A1}, /* 02A0 */
- {0x02A2,0x02A2,0x02A2}, {0x02A3,0x02A3,0x02A3}, /* 02A2 */
- {0x02A4,0x02A4,0x02A4}, {0x02A5,0x02A5,0x02A5}, /* 02A4 */
- {0x02A6,0x02A6,0x02A6}, {0x02A7,0x02A7,0x02A7}, /* 02A6 */
- {0x02A8,0x02A8,0x02A8}, {0x02A9,0x02A9,0x02A9}, /* 02A8 */
- {0x02AA,0x02AA,0x02AA}, {0x02AB,0x02AB,0x02AB}, /* 02AA */
- {0x02AC,0x02AC,0x02AC}, {0x02AD,0x02AD,0x02AD}, /* 02AC */
- {0x02AE,0x02AE,0x02AE}, {0x02AF,0x02AF,0x02AF}, /* 02AE */
- {0x02B0,0x02B0,0x02B0}, {0x02B1,0x02B1,0x02B1}, /* 02B0 */
- {0x02B2,0x02B2,0x02B2}, {0x02B3,0x02B3,0x02B3}, /* 02B2 */
- {0x02B4,0x02B4,0x02B4}, {0x02B5,0x02B5,0x02B5}, /* 02B4 */
- {0x02B6,0x02B6,0x02B6}, {0x02B7,0x02B7,0x02B7}, /* 02B6 */
- {0x02B8,0x02B8,0x02B8}, {0x02B9,0x02B9,0x02B9}, /* 02B8 */
- {0x02BA,0x02BA,0x02BA}, {0x02BB,0x02BB,0x02BB}, /* 02BA */
- {0x02BC,0x02BC,0x02BC}, {0x02BD,0x02BD,0x02BD}, /* 02BC */
- {0x02BE,0x02BE,0x02BE}, {0x02BF,0x02BF,0x02BF}, /* 02BE */
- {0x02C0,0x02C0,0x02C0}, {0x02C1,0x02C1,0x02C1}, /* 02C0 */
- {0x02C2,0x02C2,0x02C2}, {0x02C3,0x02C3,0x02C3}, /* 02C2 */
- {0x02C4,0x02C4,0x02C4}, {0x02C5,0x02C5,0x02C5}, /* 02C4 */
- {0x02C6,0x02C6,0x02C6}, {0x02C7,0x02C7,0x02C7}, /* 02C6 */
- {0x02C8,0x02C8,0x02C8}, {0x02C9,0x02C9,0x02C9}, /* 02C8 */
- {0x02CA,0x02CA,0x02CA}, {0x02CB,0x02CB,0x02CB}, /* 02CA */
- {0x02CC,0x02CC,0x02CC}, {0x02CD,0x02CD,0x02CD}, /* 02CC */
- {0x02CE,0x02CE,0x02CE}, {0x02CF,0x02CF,0x02CF}, /* 02CE */
- {0x02D0,0x02D0,0x02D0}, {0x02D1,0x02D1,0x02D1}, /* 02D0 */
- {0x02D2,0x02D2,0x02D2}, {0x02D3,0x02D3,0x02D3}, /* 02D2 */
- {0x02D4,0x02D4,0x02D4}, {0x02D5,0x02D5,0x02D5}, /* 02D4 */
- {0x02D6,0x02D6,0x02D6}, {0x02D7,0x02D7,0x02D7}, /* 02D6 */
- {0x02D8,0x02D8,0x02D8}, {0x02D9,0x02D9,0x02D9}, /* 02D8 */
- {0x02DA,0x02DA,0x02DA}, {0x02DB,0x02DB,0x02DB}, /* 02DA */
- {0x02DC,0x02DC,0x02DC}, {0x02DD,0x02DD,0x02DD}, /* 02DC */
- {0x02DE,0x02DE,0x02DE}, {0x02DF,0x02DF,0x02DF}, /* 02DE */
- {0x02E0,0x02E0,0x02E0}, {0x02E1,0x02E1,0x02E1}, /* 02E0 */
- {0x02E2,0x02E2,0x02E2}, {0x02E3,0x02E3,0x02E3}, /* 02E2 */
- {0x02E4,0x02E4,0x02E4}, {0x02E5,0x02E5,0x02E5}, /* 02E4 */
- {0x02E6,0x02E6,0x02E6}, {0x02E7,0x02E7,0x02E7}, /* 02E6 */
- {0x02E8,0x02E8,0x02E8}, {0x02E9,0x02E9,0x02E9}, /* 02E8 */
- {0x02EA,0x02EA,0x02EA}, {0x02EB,0x02EB,0x02EB}, /* 02EA */
- {0x02EC,0x02EC,0x02EC}, {0x02ED,0x02ED,0x02ED}, /* 02EC */
- {0x02EE,0x02EE,0x02EE}, {0x02EF,0x02EF,0x02EF}, /* 02EE */
- {0x02F0,0x02F0,0x02F0}, {0x02F1,0x02F1,0x02F1}, /* 02F0 */
- {0x02F2,0x02F2,0x02F2}, {0x02F3,0x02F3,0x02F3}, /* 02F2 */
- {0x02F4,0x02F4,0x02F4}, {0x02F5,0x02F5,0x02F5}, /* 02F4 */
- {0x02F6,0x02F6,0x02F6}, {0x02F7,0x02F7,0x02F7}, /* 02F6 */
- {0x02F8,0x02F8,0x02F8}, {0x02F9,0x02F9,0x02F9}, /* 02F8 */
- {0x02FA,0x02FA,0x02FA}, {0x02FB,0x02FB,0x02FB}, /* 02FA */
- {0x02FC,0x02FC,0x02FC}, {0x02FD,0x02FD,0x02FD}, /* 02FC */
- {0x02FE,0x02FE,0x02FE}, {0x02FF,0x02FF,0x02FF} /* 02FE */
-};
-
-static MY_UNICASE_CHARACTER u520p03[]={
- {0x0300,0x0300,0x0300}, {0x0301,0x0301,0x0301}, /* 0300 */
- {0x0302,0x0302,0x0302}, {0x0303,0x0303,0x0303}, /* 0302 */
- {0x0304,0x0304,0x0304}, {0x0305,0x0305,0x0305}, /* 0304 */
- {0x0306,0x0306,0x0306}, {0x0307,0x0307,0x0307}, /* 0306 */
- {0x0308,0x0308,0x0308}, {0x0309,0x0309,0x0309}, /* 0308 */
- {0x030A,0x030A,0x030A}, {0x030B,0x030B,0x030B}, /* 030A */
- {0x030C,0x030C,0x030C}, {0x030D,0x030D,0x030D}, /* 030C */
- {0x030E,0x030E,0x030E}, {0x030F,0x030F,0x030F}, /* 030E */
- {0x0310,0x0310,0x0310}, {0x0311,0x0311,0x0311}, /* 0310 */
- {0x0312,0x0312,0x0312}, {0x0313,0x0313,0x0313}, /* 0312 */
- {0x0314,0x0314,0x0314}, {0x0315,0x0315,0x0315}, /* 0314 */
- {0x0316,0x0316,0x0316}, {0x0317,0x0317,0x0317}, /* 0316 */
- {0x0318,0x0318,0x0318}, {0x0319,0x0319,0x0319}, /* 0318 */
- {0x031A,0x031A,0x031A}, {0x031B,0x031B,0x031B}, /* 031A */
- {0x031C,0x031C,0x031C}, {0x031D,0x031D,0x031D}, /* 031C */
- {0x031E,0x031E,0x031E}, {0x031F,0x031F,0x031F}, /* 031E */
- {0x0320,0x0320,0x0320}, {0x0321,0x0321,0x0321}, /* 0320 */
- {0x0322,0x0322,0x0322}, {0x0323,0x0323,0x0323}, /* 0322 */
- {0x0324,0x0324,0x0324}, {0x0325,0x0325,0x0325}, /* 0324 */
- {0x0326,0x0326,0x0326}, {0x0327,0x0327,0x0327}, /* 0326 */
- {0x0328,0x0328,0x0328}, {0x0329,0x0329,0x0329}, /* 0328 */
- {0x032A,0x032A,0x032A}, {0x032B,0x032B,0x032B}, /* 032A */
- {0x032C,0x032C,0x032C}, {0x032D,0x032D,0x032D}, /* 032C */
- {0x032E,0x032E,0x032E}, {0x032F,0x032F,0x032F}, /* 032E */
- {0x0330,0x0330,0x0330}, {0x0331,0x0331,0x0331}, /* 0330 */
- {0x0332,0x0332,0x0332}, {0x0333,0x0333,0x0333}, /* 0332 */
- {0x0334,0x0334,0x0334}, {0x0335,0x0335,0x0335}, /* 0334 */
- {0x0336,0x0336,0x0336}, {0x0337,0x0337,0x0337}, /* 0336 */
- {0x0338,0x0338,0x0338}, {0x0339,0x0339,0x0339}, /* 0338 */
- {0x033A,0x033A,0x033A}, {0x033B,0x033B,0x033B}, /* 033A */
- {0x033C,0x033C,0x033C}, {0x033D,0x033D,0x033D}, /* 033C */
- {0x033E,0x033E,0x033E}, {0x033F,0x033F,0x033F}, /* 033E */
- {0x0340,0x0340,0x0340}, {0x0341,0x0341,0x0341}, /* 0340 */
- {0x0342,0x0342,0x0342}, {0x0343,0x0343,0x0343}, /* 0342 */
- {0x0344,0x0344,0x0344}, {0x0399,0x0345,0x0399}, /* 0344 */
- {0x0346,0x0346,0x0346}, {0x0347,0x0347,0x0347}, /* 0346 */
- {0x0348,0x0348,0x0348}, {0x0349,0x0349,0x0349}, /* 0348 */
- {0x034A,0x034A,0x034A}, {0x034B,0x034B,0x034B}, /* 034A */
- {0x034C,0x034C,0x034C}, {0x034D,0x034D,0x034D}, /* 034C */
- {0x034E,0x034E,0x034E}, {0x034F,0x034F,0x034F}, /* 034E */
- {0x0350,0x0350,0x0350}, {0x0351,0x0351,0x0351}, /* 0350 */
- {0x0352,0x0352,0x0352}, {0x0353,0x0353,0x0353}, /* 0352 */
- {0x0354,0x0354,0x0354}, {0x0355,0x0355,0x0355}, /* 0354 */
- {0x0356,0x0356,0x0356}, {0x0357,0x0357,0x0357}, /* 0356 */
- {0x0358,0x0358,0x0358}, {0x0359,0x0359,0x0359}, /* 0358 */
- {0x035A,0x035A,0x035A}, {0x035B,0x035B,0x035B}, /* 035A */
- {0x035C,0x035C,0x035C}, {0x035D,0x035D,0x035D}, /* 035C */
- {0x035E,0x035E,0x035E}, {0x035F,0x035F,0x035F}, /* 035E */
- {0x0360,0x0360,0x0360}, {0x0361,0x0361,0x0361}, /* 0360 */
- {0x0362,0x0362,0x0362}, {0x0363,0x0363,0x0363}, /* 0362 */
- {0x0364,0x0364,0x0364}, {0x0365,0x0365,0x0365}, /* 0364 */
- {0x0366,0x0366,0x0366}, {0x0367,0x0367,0x0367}, /* 0366 */
- {0x0368,0x0368,0x0368}, {0x0369,0x0369,0x0369}, /* 0368 */
- {0x036A,0x036A,0x036A}, {0x036B,0x036B,0x036B}, /* 036A */
- {0x036C,0x036C,0x036C}, {0x036D,0x036D,0x036D}, /* 036C */
- {0x036E,0x036E,0x036E}, {0x036F,0x036F,0x036F}, /* 036E */
- {0x0370,0x0371,0x0370}, {0x0370,0x0371,0x0370}, /* 0370 */
- {0x0372,0x0373,0x0372}, {0x0372,0x0373,0x0372}, /* 0372 */
- {0x0374,0x0374,0x0374}, {0x0375,0x0375,0x0375}, /* 0374 */
- {0x0376,0x0377,0x0376}, {0x0376,0x0377,0x0376}, /* 0376 */
- {0x0378,0x0378,0x0378}, {0x0379,0x0379,0x0379}, /* 0378 */
- {0x037A,0x037A,0x037A}, {0x03FD,0x037B,0x03FD}, /* 037A */
- {0x03FE,0x037C,0x03FE}, {0x03FF,0x037D,0x03FF}, /* 037C */
- {0x037E,0x037E,0x037E}, {0x037F,0x037F,0x037F}, /* 037E */
- {0x0380,0x0380,0x0380}, {0x0381,0x0381,0x0381}, /* 0380 */
- {0x0382,0x0382,0x0382}, {0x0383,0x0383,0x0383}, /* 0382 */
- {0x0384,0x0384,0x0384}, {0x0385,0x0385,0x0385}, /* 0384 */
- {0x0386,0x03AC,0x0391}, {0x0387,0x0387,0x0387}, /* 0386 */
- {0x0388,0x03AD,0x0395}, {0x0389,0x03AE,0x0397}, /* 0388 */
- {0x038A,0x03AF,0x0399}, {0x038B,0x038B,0x038B}, /* 038A */
- {0x038C,0x03CC,0x039F}, {0x038D,0x038D,0x038D}, /* 038C */
- {0x038E,0x03CD,0x03A5}, {0x038F,0x03CE,0x03A9}, /* 038E */
- {0x0390,0x0390,0x0399}, {0x0391,0x03B1,0x0391}, /* 0390 */
- {0x0392,0x03B2,0x0392}, {0x0393,0x03B3,0x0393}, /* 0392 */
- {0x0394,0x03B4,0x0394}, {0x0395,0x03B5,0x0395}, /* 0394 */
- {0x0396,0x03B6,0x0396}, {0x0397,0x03B7,0x0397}, /* 0396 */
- {0x0398,0x03B8,0x0398}, {0x0399,0x03B9,0x0399}, /* 0398 */
- {0x039A,0x03BA,0x039A}, {0x039B,0x03BB,0x039B}, /* 039A */
- {0x039C,0x03BC,0x039C}, {0x039D,0x03BD,0x039D}, /* 039C */
- {0x039E,0x03BE,0x039E}, {0x039F,0x03BF,0x039F}, /* 039E */
- {0x03A0,0x03C0,0x03A0}, {0x03A1,0x03C1,0x03A1}, /* 03A0 */
- {0x03A2,0x03A2,0x03A2}, {0x03A3,0x03C3,0x03A3}, /* 03A2 */
- {0x03A4,0x03C4,0x03A4}, {0x03A5,0x03C5,0x03A5}, /* 03A4 */
- {0x03A6,0x03C6,0x03A6}, {0x03A7,0x03C7,0x03A7}, /* 03A6 */
- {0x03A8,0x03C8,0x03A8}, {0x03A9,0x03C9,0x03A9}, /* 03A8 */
- {0x03AA,0x03CA,0x0399}, {0x03AB,0x03CB,0x03A5}, /* 03AA */
- {0x0386,0x03AC,0x0391}, {0x0388,0x03AD,0x0395}, /* 03AC */
- {0x0389,0x03AE,0x0397}, {0x038A,0x03AF,0x0399}, /* 03AE */
- {0x03B0,0x03B0,0x03A5}, {0x0391,0x03B1,0x0391}, /* 03B0 */
- {0x0392,0x03B2,0x0392}, {0x0393,0x03B3,0x0393}, /* 03B2 */
- {0x0394,0x03B4,0x0394}, {0x0395,0x03B5,0x0395}, /* 03B4 */
- {0x0396,0x03B6,0x0396}, {0x0397,0x03B7,0x0397}, /* 03B6 */
- {0x0398,0x03B8,0x0398}, {0x0399,0x03B9,0x0399}, /* 03B8 */
- {0x039A,0x03BA,0x039A}, {0x039B,0x03BB,0x039B}, /* 03BA */
- {0x039C,0x03BC,0x039C}, {0x039D,0x03BD,0x039D}, /* 03BC */
- {0x039E,0x03BE,0x039E}, {0x039F,0x03BF,0x039F}, /* 03BE */
- {0x03A0,0x03C0,0x03A0}, {0x03A1,0x03C1,0x03A1}, /* 03C0 */
- {0x03A3,0x03C2,0x03A3}, {0x03A3,0x03C3,0x03A3}, /* 03C2 */
- {0x03A4,0x03C4,0x03A4}, {0x03A5,0x03C5,0x03A5}, /* 03C4 */
- {0x03A6,0x03C6,0x03A6}, {0x03A7,0x03C7,0x03A7}, /* 03C6 */
- {0x03A8,0x03C8,0x03A8}, {0x03A9,0x03C9,0x03A9}, /* 03C8 */
- {0x03AA,0x03CA,0x0399}, {0x03AB,0x03CB,0x03A5}, /* 03CA */
- {0x038C,0x03CC,0x039F}, {0x038E,0x03CD,0x03A5}, /* 03CC */
- {0x038F,0x03CE,0x03A9}, {0x03CF,0x03D7,0x03CF}, /* 03CE */
- {0x0392,0x03D0,0x0392}, {0x0398,0x03D1,0x0398}, /* 03D0 */
- {0x03D2,0x03D2,0x03D2}, {0x03D3,0x03D3,0x03D2}, /* 03D2 */
- {0x03D4,0x03D4,0x03D2}, {0x03A6,0x03D5,0x03A6}, /* 03D4 */
- {0x03A0,0x03D6,0x03A0}, {0x03CF,0x03D7,0x03CF}, /* 03D6 */
- {0x03D8,0x03D9,0x03D8}, {0x03D8,0x03D9,0x03D8}, /* 03D8 */
- {0x03DA,0x03DB,0x03DA}, {0x03DA,0x03DB,0x03DA}, /* 03DA */
- {0x03DC,0x03DD,0x03DC}, {0x03DC,0x03DD,0x03DC}, /* 03DC */
- {0x03DE,0x03DF,0x03DE}, {0x03DE,0x03DF,0x03DE}, /* 03DE */
- {0x03E0,0x03E1,0x03E0}, {0x03E0,0x03E1,0x03E0}, /* 03E0 */
- {0x03E2,0x03E3,0x03E2}, {0x03E2,0x03E3,0x03E2}, /* 03E2 */
- {0x03E4,0x03E5,0x03E4}, {0x03E4,0x03E5,0x03E4}, /* 03E4 */
- {0x03E6,0x03E7,0x03E6}, {0x03E6,0x03E7,0x03E6}, /* 03E6 */
- {0x03E8,0x03E9,0x03E8}, {0x03E8,0x03E9,0x03E8}, /* 03E8 */
- {0x03EA,0x03EB,0x03EA}, {0x03EA,0x03EB,0x03EA}, /* 03EA */
- {0x03EC,0x03ED,0x03EC}, {0x03EC,0x03ED,0x03EC}, /* 03EC */
- {0x03EE,0x03EF,0x03EE}, {0x03EE,0x03EF,0x03EE}, /* 03EE */
- {0x039A,0x03F0,0x039A}, {0x03A1,0x03F1,0x03A1}, /* 03F0 */
- {0x03F9,0x03F2,0x03F9}, {0x03F3,0x03F3,0x03F3}, /* 03F2 */
- {0x03F4,0x03B8,0x03F4}, {0x0395,0x03F5,0x0395}, /* 03F4 */
- {0x03F6,0x03F6,0x03F6}, {0x03F7,0x03F8,0x03F7}, /* 03F6 */
- {0x03F7,0x03F8,0x03F7}, {0x03F9,0x03F2,0x03F9}, /* 03F8 */
- {0x03FA,0x03FB,0x03FA}, {0x03FA,0x03FB,0x03FA}, /* 03FA */
- {0x03FC,0x03FC,0x03FC}, {0x03FD,0x037B,0x03FD}, /* 03FC */
- {0x03FE,0x037C,0x03FE}, {0x03FF,0x037D,0x03FF} /* 03FE */
-};
-
-static MY_UNICASE_CHARACTER u520p04[]={
- {0x0400,0x0450,0x0415}, {0x0401,0x0451,0x0415}, /* 0400 */
- {0x0402,0x0452,0x0402}, {0x0403,0x0453,0x0413}, /* 0402 */
- {0x0404,0x0454,0x0404}, {0x0405,0x0455,0x0405}, /* 0404 */
- {0x0406,0x0456,0x0406}, {0x0407,0x0457,0x0406}, /* 0406 */
- {0x0408,0x0458,0x0408}, {0x0409,0x0459,0x0409}, /* 0408 */
- {0x040A,0x045A,0x040A}, {0x040B,0x045B,0x040B}, /* 040A */
- {0x040C,0x045C,0x041A}, {0x040D,0x045D,0x0418}, /* 040C */
- {0x040E,0x045E,0x0423}, {0x040F,0x045F,0x040F}, /* 040E */
- {0x0410,0x0430,0x0410}, {0x0411,0x0431,0x0411}, /* 0410 */
- {0x0412,0x0432,0x0412}, {0x0413,0x0433,0x0413}, /* 0412 */
- {0x0414,0x0434,0x0414}, {0x0415,0x0435,0x0415}, /* 0414 */
- {0x0416,0x0436,0x0416}, {0x0417,0x0437,0x0417}, /* 0416 */
- {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0419}, /* 0418 */
- {0x041A,0x043A,0x041A}, {0x041B,0x043B,0x041B}, /* 041A */
- {0x041C,0x043C,0x041C}, {0x041D,0x043D,0x041D}, /* 041C */
- {0x041E,0x043E,0x041E}, {0x041F,0x043F,0x041F}, /* 041E */
- {0x0420,0x0440,0x0420}, {0x0421,0x0441,0x0421}, /* 0420 */
- {0x0422,0x0442,0x0422}, {0x0423,0x0443,0x0423}, /* 0422 */
- {0x0424,0x0444,0x0424}, {0x0425,0x0445,0x0425}, /* 0424 */
- {0x0426,0x0446,0x0426}, {0x0427,0x0447,0x0427}, /* 0426 */
- {0x0428,0x0448,0x0428}, {0x0429,0x0449,0x0429}, /* 0428 */
- {0x042A,0x044A,0x042A}, {0x042B,0x044B,0x042B}, /* 042A */
- {0x042C,0x044C,0x042C}, {0x042D,0x044D,0x042D}, /* 042C */
- {0x042E,0x044E,0x042E}, {0x042F,0x044F,0x042F}, /* 042E */
- {0x0410,0x0430,0x0410}, {0x0411,0x0431,0x0411}, /* 0430 */
- {0x0412,0x0432,0x0412}, {0x0413,0x0433,0x0413}, /* 0432 */
- {0x0414,0x0434,0x0414}, {0x0415,0x0435,0x0415}, /* 0434 */
- {0x0416,0x0436,0x0416}, {0x0417,0x0437,0x0417}, /* 0436 */
- {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0419}, /* 0438 */
- {0x041A,0x043A,0x041A}, {0x041B,0x043B,0x041B}, /* 043A */
- {0x041C,0x043C,0x041C}, {0x041D,0x043D,0x041D}, /* 043C */
- {0x041E,0x043E,0x041E}, {0x041F,0x043F,0x041F}, /* 043E */
- {0x0420,0x0440,0x0420}, {0x0421,0x0441,0x0421}, /* 0440 */
- {0x0422,0x0442,0x0422}, {0x0423,0x0443,0x0423}, /* 0442 */
- {0x0424,0x0444,0x0424}, {0x0425,0x0445,0x0425}, /* 0444 */
- {0x0426,0x0446,0x0426}, {0x0427,0x0447,0x0427}, /* 0446 */
- {0x0428,0x0448,0x0428}, {0x0429,0x0449,0x0429}, /* 0448 */
- {0x042A,0x044A,0x042A}, {0x042B,0x044B,0x042B}, /* 044A */
- {0x042C,0x044C,0x042C}, {0x042D,0x044D,0x042D}, /* 044C */
- {0x042E,0x044E,0x042E}, {0x042F,0x044F,0x042F}, /* 044E */
- {0x0400,0x0450,0x0415}, {0x0401,0x0451,0x0415}, /* 0450 */
- {0x0402,0x0452,0x0402}, {0x0403,0x0453,0x0413}, /* 0452 */
- {0x0404,0x0454,0x0404}, {0x0405,0x0455,0x0405}, /* 0454 */
- {0x0406,0x0456,0x0406}, {0x0407,0x0457,0x0406}, /* 0456 */
- {0x0408,0x0458,0x0408}, {0x0409,0x0459,0x0409}, /* 0458 */
- {0x040A,0x045A,0x040A}, {0x040B,0x045B,0x040B}, /* 045A */
- {0x040C,0x045C,0x041A}, {0x040D,0x045D,0x0418}, /* 045C */
- {0x040E,0x045E,0x0423}, {0x040F,0x045F,0x040F}, /* 045E */
- {0x0460,0x0461,0x0460}, {0x0460,0x0461,0x0460}, /* 0460 */
- {0x0462,0x0463,0x0462}, {0x0462,0x0463,0x0462}, /* 0462 */
- {0x0464,0x0465,0x0464}, {0x0464,0x0465,0x0464}, /* 0464 */
- {0x0466,0x0467,0x0466}, {0x0466,0x0467,0x0466}, /* 0466 */
- {0x0468,0x0469,0x0468}, {0x0468,0x0469,0x0468}, /* 0468 */
- {0x046A,0x046B,0x046A}, {0x046A,0x046B,0x046A}, /* 046A */
- {0x046C,0x046D,0x046C}, {0x046C,0x046D,0x046C}, /* 046C */
- {0x046E,0x046F,0x046E}, {0x046E,0x046F,0x046E}, /* 046E */
- {0x0470,0x0471,0x0470}, {0x0470,0x0471,0x0470}, /* 0470 */
- {0x0472,0x0473,0x0472}, {0x0472,0x0473,0x0472}, /* 0472 */
- {0x0474,0x0475,0x0474}, {0x0474,0x0475,0x0474}, /* 0474 */
- {0x0476,0x0477,0x0474}, {0x0476,0x0477,0x0474}, /* 0476 */
- {0x0478,0x0479,0x0478}, {0x0478,0x0479,0x0478}, /* 0478 */
- {0x047A,0x047B,0x047A}, {0x047A,0x047B,0x047A}, /* 047A */
- {0x047C,0x047D,0x047C}, {0x047C,0x047D,0x047C}, /* 047C */
- {0x047E,0x047F,0x047E}, {0x047E,0x047F,0x047E}, /* 047E */
- {0x0480,0x0481,0x0480}, {0x0480,0x0481,0x0480}, /* 0480 */
- {0x0482,0x0482,0x0482}, {0x0483,0x0483,0x0483}, /* 0482 */
- {0x0484,0x0484,0x0484}, {0x0485,0x0485,0x0485}, /* 0484 */
- {0x0486,0x0486,0x0486}, {0x0487,0x0487,0x0487}, /* 0486 */
- {0x0488,0x0488,0x0488}, {0x0489,0x0489,0x0489}, /* 0488 */
- {0x048A,0x048B,0x048A}, {0x048A,0x048B,0x048A}, /* 048A */
- {0x048C,0x048D,0x048C}, {0x048C,0x048D,0x048C}, /* 048C */
- {0x048E,0x048F,0x048E}, {0x048E,0x048F,0x048E}, /* 048E */
- {0x0490,0x0491,0x0490}, {0x0490,0x0491,0x0490}, /* 0490 */
- {0x0492,0x0493,0x0492}, {0x0492,0x0493,0x0492}, /* 0492 */
- {0x0494,0x0495,0x0494}, {0x0494,0x0495,0x0494}, /* 0494 */
- {0x0496,0x0497,0x0496}, {0x0496,0x0497,0x0496}, /* 0496 */
- {0x0498,0x0499,0x0498}, {0x0498,0x0499,0x0498}, /* 0498 */
- {0x049A,0x049B,0x049A}, {0x049A,0x049B,0x049A}, /* 049A */
- {0x049C,0x049D,0x049C}, {0x049C,0x049D,0x049C}, /* 049C */
- {0x049E,0x049F,0x049E}, {0x049E,0x049F,0x049E}, /* 049E */
- {0x04A0,0x04A1,0x04A0}, {0x04A0,0x04A1,0x04A0}, /* 04A0 */
- {0x04A2,0x04A3,0x04A2}, {0x04A2,0x04A3,0x04A2}, /* 04A2 */
- {0x04A4,0x04A5,0x04A4}, {0x04A4,0x04A5,0x04A4}, /* 04A4 */
- {0x04A6,0x04A7,0x04A6}, {0x04A6,0x04A7,0x04A6}, /* 04A6 */
- {0x04A8,0x04A9,0x04A8}, {0x04A8,0x04A9,0x04A8}, /* 04A8 */
- {0x04AA,0x04AB,0x04AA}, {0x04AA,0x04AB,0x04AA}, /* 04AA */
- {0x04AC,0x04AD,0x04AC}, {0x04AC,0x04AD,0x04AC}, /* 04AC */
- {0x04AE,0x04AF,0x04AE}, {0x04AE,0x04AF,0x04AE}, /* 04AE */
- {0x04B0,0x04B1,0x04B0}, {0x04B0,0x04B1,0x04B0}, /* 04B0 */
- {0x04B2,0x04B3,0x04B2}, {0x04B2,0x04B3,0x04B2}, /* 04B2 */
- {0x04B4,0x04B5,0x04B4}, {0x04B4,0x04B5,0x04B4}, /* 04B4 */
- {0x04B6,0x04B7,0x04B6}, {0x04B6,0x04B7,0x04B6}, /* 04B6 */
- {0x04B8,0x04B9,0x04B8}, {0x04B8,0x04B9,0x04B8}, /* 04B8 */
- {0x04BA,0x04BB,0x04BA}, {0x04BA,0x04BB,0x04BA}, /* 04BA */
- {0x04BC,0x04BD,0x04BC}, {0x04BC,0x04BD,0x04BC}, /* 04BC */
- {0x04BE,0x04BF,0x04BE}, {0x04BE,0x04BF,0x04BE}, /* 04BE */
- {0x04C0,0x04CF,0x04C0}, {0x04C1,0x04C2,0x0416}, /* 04C0 */
- {0x04C1,0x04C2,0x0416}, {0x04C3,0x04C4,0x04C3}, /* 04C2 */
- {0x04C3,0x04C4,0x04C3}, {0x04C5,0x04C6,0x04C5}, /* 04C4 */
- {0x04C5,0x04C6,0x04C5}, {0x04C7,0x04C8,0x04C7}, /* 04C6 */
- {0x04C7,0x04C8,0x04C7}, {0x04C9,0x04CA,0x04C9}, /* 04C8 */
- {0x04C9,0x04CA,0x04C9}, {0x04CB,0x04CC,0x04CB}, /* 04CA */
- {0x04CB,0x04CC,0x04CB}, {0x04CD,0x04CE,0x04CD}, /* 04CC */
- {0x04CD,0x04CE,0x04CD}, {0x04C0,0x04CF,0x04C0}, /* 04CE */
- {0x04D0,0x04D1,0x0410}, {0x04D0,0x04D1,0x0410}, /* 04D0 */
- {0x04D2,0x04D3,0x0410}, {0x04D2,0x04D3,0x0410}, /* 04D2 */
- {0x04D4,0x04D5,0x04D4}, {0x04D4,0x04D5,0x04D4}, /* 04D4 */
- {0x04D6,0x04D7,0x0415}, {0x04D6,0x04D7,0x0415}, /* 04D6 */
- {0x04D8,0x04D9,0x04D8}, {0x04D8,0x04D9,0x04D8}, /* 04D8 */
- {0x04DA,0x04DB,0x04D8}, {0x04DA,0x04DB,0x04D8}, /* 04DA */
- {0x04DC,0x04DD,0x0416}, {0x04DC,0x04DD,0x0416}, /* 04DC */
- {0x04DE,0x04DF,0x0417}, {0x04DE,0x04DF,0x0417}, /* 04DE */
- {0x04E0,0x04E1,0x04E0}, {0x04E0,0x04E1,0x04E0}, /* 04E0 */
- {0x04E2,0x04E3,0x0418}, {0x04E2,0x04E3,0x0418}, /* 04E2 */
- {0x04E4,0x04E5,0x0418}, {0x04E4,0x04E5,0x0418}, /* 04E4 */
- {0x04E6,0x04E7,0x041E}, {0x04E6,0x04E7,0x041E}, /* 04E6 */
- {0x04E8,0x04E9,0x04E8}, {0x04E8,0x04E9,0x04E8}, /* 04E8 */
- {0x04EA,0x04EB,0x04E8}, {0x04EA,0x04EB,0x04E8}, /* 04EA */
- {0x04EC,0x04ED,0x042D}, {0x04EC,0x04ED,0x042D}, /* 04EC */
- {0x04EE,0x04EF,0x0423}, {0x04EE,0x04EF,0x0423}, /* 04EE */
- {0x04F0,0x04F1,0x0423}, {0x04F0,0x04F1,0x0423}, /* 04F0 */
- {0x04F2,0x04F3,0x0423}, {0x04F2,0x04F3,0x0423}, /* 04F2 */
- {0x04F4,0x04F5,0x0427}, {0x04F4,0x04F5,0x0427}, /* 04F4 */
- {0x04F6,0x04F7,0x04F6}, {0x04F6,0x04F7,0x04F6}, /* 04F6 */
- {0x04F8,0x04F9,0x042B}, {0x04F8,0x04F9,0x042B}, /* 04F8 */
- {0x04FA,0x04FB,0x04FA}, {0x04FA,0x04FB,0x04FA}, /* 04FA */
- {0x04FC,0x04FD,0x04FC}, {0x04FC,0x04FD,0x04FC}, /* 04FC */
- {0x04FE,0x04FF,0x04FE}, {0x04FE,0x04FF,0x04FE} /* 04FE */
-};
-
-static MY_UNICASE_CHARACTER u520p05[]={
- {0x0500,0x0501,0x0500}, {0x0500,0x0501,0x0500}, /* 0500 */
- {0x0502,0x0503,0x0502}, {0x0502,0x0503,0x0502}, /* 0502 */
- {0x0504,0x0505,0x0504}, {0x0504,0x0505,0x0504}, /* 0504 */
- {0x0506,0x0507,0x0506}, {0x0506,0x0507,0x0506}, /* 0506 */
- {0x0508,0x0509,0x0508}, {0x0508,0x0509,0x0508}, /* 0508 */
- {0x050A,0x050B,0x050A}, {0x050A,0x050B,0x050A}, /* 050A */
- {0x050C,0x050D,0x050C}, {0x050C,0x050D,0x050C}, /* 050C */
- {0x050E,0x050F,0x050E}, {0x050E,0x050F,0x050E}, /* 050E */
- {0x0510,0x0511,0x0510}, {0x0510,0x0511,0x0510}, /* 0510 */
- {0x0512,0x0513,0x0512}, {0x0512,0x0513,0x0512}, /* 0512 */
- {0x0514,0x0515,0x0514}, {0x0514,0x0515,0x0514}, /* 0514 */
- {0x0516,0x0517,0x0516}, {0x0516,0x0517,0x0516}, /* 0516 */
- {0x0518,0x0519,0x0518}, {0x0518,0x0519,0x0518}, /* 0518 */
- {0x051A,0x051B,0x051A}, {0x051A,0x051B,0x051A}, /* 051A */
- {0x051C,0x051D,0x051C}, {0x051C,0x051D,0x051C}, /* 051C */
- {0x051E,0x051F,0x051E}, {0x051E,0x051F,0x051E}, /* 051E */
- {0x0520,0x0521,0x0520}, {0x0520,0x0521,0x0520}, /* 0520 */
- {0x0522,0x0523,0x0522}, {0x0522,0x0523,0x0522}, /* 0522 */
- {0x0524,0x0525,0x0524}, {0x0524,0x0525,0x0524}, /* 0524 */
- {0x0526,0x0526,0x0526}, {0x0527,0x0527,0x0527}, /* 0526 */
- {0x0528,0x0528,0x0528}, {0x0529,0x0529,0x0529}, /* 0528 */
- {0x052A,0x052A,0x052A}, {0x052B,0x052B,0x052B}, /* 052A */
- {0x052C,0x052C,0x052C}, {0x052D,0x052D,0x052D}, /* 052C */
- {0x052E,0x052E,0x052E}, {0x052F,0x052F,0x052F}, /* 052E */
- {0x0530,0x0530,0x0530}, {0x0531,0x0561,0x0531}, /* 0530 */
- {0x0532,0x0562,0x0532}, {0x0533,0x0563,0x0533}, /* 0532 */
- {0x0534,0x0564,0x0534}, {0x0535,0x0565,0x0535}, /* 0534 */
- {0x0536,0x0566,0x0536}, {0x0537,0x0567,0x0537}, /* 0536 */
- {0x0538,0x0568,0x0538}, {0x0539,0x0569,0x0539}, /* 0538 */
- {0x053A,0x056A,0x053A}, {0x053B,0x056B,0x053B}, /* 053A */
- {0x053C,0x056C,0x053C}, {0x053D,0x056D,0x053D}, /* 053C */
- {0x053E,0x056E,0x053E}, {0x053F,0x056F,0x053F}, /* 053E */
- {0x0540,0x0570,0x0540}, {0x0541,0x0571,0x0541}, /* 0540 */
- {0x0542,0x0572,0x0542}, {0x0543,0x0573,0x0543}, /* 0542 */
- {0x0544,0x0574,0x0544}, {0x0545,0x0575,0x0545}, /* 0544 */
- {0x0546,0x0576,0x0546}, {0x0547,0x0577,0x0547}, /* 0546 */
- {0x0548,0x0578,0x0548}, {0x0549,0x0579,0x0549}, /* 0548 */
- {0x054A,0x057A,0x054A}, {0x054B,0x057B,0x054B}, /* 054A */
- {0x054C,0x057C,0x054C}, {0x054D,0x057D,0x054D}, /* 054C */
- {0x054E,0x057E,0x054E}, {0x054F,0x057F,0x054F}, /* 054E */
- {0x0550,0x0580,0x0550}, {0x0551,0x0581,0x0551}, /* 0550 */
- {0x0552,0x0582,0x0552}, {0x0553,0x0583,0x0553}, /* 0552 */
- {0x0554,0x0584,0x0554}, {0x0555,0x0585,0x0555}, /* 0554 */
- {0x0556,0x0586,0x0556}, {0x0557,0x0557,0x0557}, /* 0556 */
- {0x0558,0x0558,0x0558}, {0x0559,0x0559,0x0559}, /* 0558 */
- {0x055A,0x055A,0x055A}, {0x055B,0x055B,0x055B}, /* 055A */
- {0x055C,0x055C,0x055C}, {0x055D,0x055D,0x055D}, /* 055C */
- {0x055E,0x055E,0x055E}, {0x055F,0x055F,0x055F}, /* 055E */
- {0x0560,0x0560,0x0560}, {0x0531,0x0561,0x0531}, /* 0560 */
- {0x0532,0x0562,0x0532}, {0x0533,0x0563,0x0533}, /* 0562 */
- {0x0534,0x0564,0x0534}, {0x0535,0x0565,0x0535}, /* 0564 */
- {0x0536,0x0566,0x0536}, {0x0537,0x0567,0x0537}, /* 0566 */
- {0x0538,0x0568,0x0538}, {0x0539,0x0569,0x0539}, /* 0568 */
- {0x053A,0x056A,0x053A}, {0x053B,0x056B,0x053B}, /* 056A */
- {0x053C,0x056C,0x053C}, {0x053D,0x056D,0x053D}, /* 056C */
- {0x053E,0x056E,0x053E}, {0x053F,0x056F,0x053F}, /* 056E */
- {0x0540,0x0570,0x0540}, {0x0541,0x0571,0x0541}, /* 0570 */
- {0x0542,0x0572,0x0542}, {0x0543,0x0573,0x0543}, /* 0572 */
- {0x0544,0x0574,0x0544}, {0x0545,0x0575,0x0545}, /* 0574 */
- {0x0546,0x0576,0x0546}, {0x0547,0x0577,0x0547}, /* 0576 */
- {0x0548,0x0578,0x0548}, {0x0549,0x0579,0x0549}, /* 0578 */
- {0x054A,0x057A,0x054A}, {0x054B,0x057B,0x054B}, /* 057A */
- {0x054C,0x057C,0x054C}, {0x054D,0x057D,0x054D}, /* 057C */
- {0x054E,0x057E,0x054E}, {0x054F,0x057F,0x054F}, /* 057E */
- {0x0550,0x0580,0x0550}, {0x0551,0x0581,0x0551}, /* 0580 */
- {0x0552,0x0582,0x0552}, {0x0553,0x0583,0x0553}, /* 0582 */
- {0x0554,0x0584,0x0554}, {0x0555,0x0585,0x0555}, /* 0584 */
- {0x0556,0x0586,0x0556}, {0x0587,0x0587,0x0587}, /* 0586 */
- {0x0588,0x0588,0x0588}, {0x0589,0x0589,0x0589}, /* 0588 */
- {0x058A,0x058A,0x058A}, {0x058B,0x058B,0x058B}, /* 058A */
- {0x058C,0x058C,0x058C}, {0x058D,0x058D,0x058D}, /* 058C */
- {0x058E,0x058E,0x058E}, {0x058F,0x058F,0x058F}, /* 058E */
- {0x0590,0x0590,0x0590}, {0x0591,0x0591,0x0591}, /* 0590 */
- {0x0592,0x0592,0x0592}, {0x0593,0x0593,0x0593}, /* 0592 */
- {0x0594,0x0594,0x0594}, {0x0595,0x0595,0x0595}, /* 0594 */
- {0x0596,0x0596,0x0596}, {0x0597,0x0597,0x0597}, /* 0596 */
- {0x0598,0x0598,0x0598}, {0x0599,0x0599,0x0599}, /* 0598 */
- {0x059A,0x059A,0x059A}, {0x059B,0x059B,0x059B}, /* 059A */
- {0x059C,0x059C,0x059C}, {0x059D,0x059D,0x059D}, /* 059C */
- {0x059E,0x059E,0x059E}, {0x059F,0x059F,0x059F}, /* 059E */
- {0x05A0,0x05A0,0x05A0}, {0x05A1,0x05A1,0x05A1}, /* 05A0 */
- {0x05A2,0x05A2,0x05A2}, {0x05A3,0x05A3,0x05A3}, /* 05A2 */
- {0x05A4,0x05A4,0x05A4}, {0x05A5,0x05A5,0x05A5}, /* 05A4 */
- {0x05A6,0x05A6,0x05A6}, {0x05A7,0x05A7,0x05A7}, /* 05A6 */
- {0x05A8,0x05A8,0x05A8}, {0x05A9,0x05A9,0x05A9}, /* 05A8 */
- {0x05AA,0x05AA,0x05AA}, {0x05AB,0x05AB,0x05AB}, /* 05AA */
- {0x05AC,0x05AC,0x05AC}, {0x05AD,0x05AD,0x05AD}, /* 05AC */
- {0x05AE,0x05AE,0x05AE}, {0x05AF,0x05AF,0x05AF}, /* 05AE */
- {0x05B0,0x05B0,0x05B0}, {0x05B1,0x05B1,0x05B1}, /* 05B0 */
- {0x05B2,0x05B2,0x05B2}, {0x05B3,0x05B3,0x05B3}, /* 05B2 */
- {0x05B4,0x05B4,0x05B4}, {0x05B5,0x05B5,0x05B5}, /* 05B4 */
- {0x05B6,0x05B6,0x05B6}, {0x05B7,0x05B7,0x05B7}, /* 05B6 */
- {0x05B8,0x05B8,0x05B8}, {0x05B9,0x05B9,0x05B9}, /* 05B8 */
- {0x05BA,0x05BA,0x05BA}, {0x05BB,0x05BB,0x05BB}, /* 05BA */
- {0x05BC,0x05BC,0x05BC}, {0x05BD,0x05BD,0x05BD}, /* 05BC */
- {0x05BE,0x05BE,0x05BE}, {0x05BF,0x05BF,0x05BF}, /* 05BE */
- {0x05C0,0x05C0,0x05C0}, {0x05C1,0x05C1,0x05C1}, /* 05C0 */
- {0x05C2,0x05C2,0x05C2}, {0x05C3,0x05C3,0x05C3}, /* 05C2 */
- {0x05C4,0x05C4,0x05C4}, {0x05C5,0x05C5,0x05C5}, /* 05C4 */
- {0x05C6,0x05C6,0x05C6}, {0x05C7,0x05C7,0x05C7}, /* 05C6 */
- {0x05C8,0x05C8,0x05C8}, {0x05C9,0x05C9,0x05C9}, /* 05C8 */
- {0x05CA,0x05CA,0x05CA}, {0x05CB,0x05CB,0x05CB}, /* 05CA */
- {0x05CC,0x05CC,0x05CC}, {0x05CD,0x05CD,0x05CD}, /* 05CC */
- {0x05CE,0x05CE,0x05CE}, {0x05CF,0x05CF,0x05CF}, /* 05CE */
- {0x05D0,0x05D0,0x05D0}, {0x05D1,0x05D1,0x05D1}, /* 05D0 */
- {0x05D2,0x05D2,0x05D2}, {0x05D3,0x05D3,0x05D3}, /* 05D2 */
- {0x05D4,0x05D4,0x05D4}, {0x05D5,0x05D5,0x05D5}, /* 05D4 */
- {0x05D6,0x05D6,0x05D6}, {0x05D7,0x05D7,0x05D7}, /* 05D6 */
- {0x05D8,0x05D8,0x05D8}, {0x05D9,0x05D9,0x05D9}, /* 05D8 */
- {0x05DA,0x05DA,0x05DA}, {0x05DB,0x05DB,0x05DB}, /* 05DA */
- {0x05DC,0x05DC,0x05DC}, {0x05DD,0x05DD,0x05DD}, /* 05DC */
- {0x05DE,0x05DE,0x05DE}, {0x05DF,0x05DF,0x05DF}, /* 05DE */
- {0x05E0,0x05E0,0x05E0}, {0x05E1,0x05E1,0x05E1}, /* 05E0 */
- {0x05E2,0x05E2,0x05E2}, {0x05E3,0x05E3,0x05E3}, /* 05E2 */
- {0x05E4,0x05E4,0x05E4}, {0x05E5,0x05E5,0x05E5}, /* 05E4 */
- {0x05E6,0x05E6,0x05E6}, {0x05E7,0x05E7,0x05E7}, /* 05E6 */
- {0x05E8,0x05E8,0x05E8}, {0x05E9,0x05E9,0x05E9}, /* 05E8 */
- {0x05EA,0x05EA,0x05EA}, {0x05EB,0x05EB,0x05EB}, /* 05EA */
- {0x05EC,0x05EC,0x05EC}, {0x05ED,0x05ED,0x05ED}, /* 05EC */
- {0x05EE,0x05EE,0x05EE}, {0x05EF,0x05EF,0x05EF}, /* 05EE */
- {0x05F0,0x05F0,0x05F0}, {0x05F1,0x05F1,0x05F1}, /* 05F0 */
- {0x05F2,0x05F2,0x05F2}, {0x05F3,0x05F3,0x05F3}, /* 05F2 */
- {0x05F4,0x05F4,0x05F4}, {0x05F5,0x05F5,0x05F5}, /* 05F4 */
- {0x05F6,0x05F6,0x05F6}, {0x05F7,0x05F7,0x05F7}, /* 05F6 */
- {0x05F8,0x05F8,0x05F8}, {0x05F9,0x05F9,0x05F9}, /* 05F8 */
- {0x05FA,0x05FA,0x05FA}, {0x05FB,0x05FB,0x05FB}, /* 05FA */
- {0x05FC,0x05FC,0x05FC}, {0x05FD,0x05FD,0x05FD}, /* 05FC */
- {0x05FE,0x05FE,0x05FE}, {0x05FF,0x05FF,0x05FF} /* 05FE */
-};
-
-static MY_UNICASE_CHARACTER u520p10[]={
- {0x1000,0x1000,0x1000}, {0x1001,0x1001,0x1001}, /* 1000 */
- {0x1002,0x1002,0x1002}, {0x1003,0x1003,0x1003}, /* 1002 */
- {0x1004,0x1004,0x1004}, {0x1005,0x1005,0x1005}, /* 1004 */
- {0x1006,0x1006,0x1006}, {0x1007,0x1007,0x1007}, /* 1006 */
- {0x1008,0x1008,0x1008}, {0x1009,0x1009,0x1009}, /* 1008 */
- {0x100A,0x100A,0x100A}, {0x100B,0x100B,0x100B}, /* 100A */
- {0x100C,0x100C,0x100C}, {0x100D,0x100D,0x100D}, /* 100C */
- {0x100E,0x100E,0x100E}, {0x100F,0x100F,0x100F}, /* 100E */
- {0x1010,0x1010,0x1010}, {0x1011,0x1011,0x1011}, /* 1010 */
- {0x1012,0x1012,0x1012}, {0x1013,0x1013,0x1013}, /* 1012 */
- {0x1014,0x1014,0x1014}, {0x1015,0x1015,0x1015}, /* 1014 */
- {0x1016,0x1016,0x1016}, {0x1017,0x1017,0x1017}, /* 1016 */
- {0x1018,0x1018,0x1018}, {0x1019,0x1019,0x1019}, /* 1018 */
- {0x101A,0x101A,0x101A}, {0x101B,0x101B,0x101B}, /* 101A */
- {0x101C,0x101C,0x101C}, {0x101D,0x101D,0x101D}, /* 101C */
- {0x101E,0x101E,0x101E}, {0x101F,0x101F,0x101F}, /* 101E */
- {0x1020,0x1020,0x1020}, {0x1021,0x1021,0x1021}, /* 1020 */
- {0x1022,0x1022,0x1022}, {0x1023,0x1023,0x1023}, /* 1022 */
- {0x1024,0x1024,0x1024}, {0x1025,0x1025,0x1025}, /* 1024 */
- {0x1026,0x1026,0x1026}, {0x1027,0x1027,0x1027}, /* 1026 */
- {0x1028,0x1028,0x1028}, {0x1029,0x1029,0x1029}, /* 1028 */
- {0x102A,0x102A,0x102A}, {0x102B,0x102B,0x102B}, /* 102A */
- {0x102C,0x102C,0x102C}, {0x102D,0x102D,0x102D}, /* 102C */
- {0x102E,0x102E,0x102E}, {0x102F,0x102F,0x102F}, /* 102E */
- {0x1030,0x1030,0x1030}, {0x1031,0x1031,0x1031}, /* 1030 */
- {0x1032,0x1032,0x1032}, {0x1033,0x1033,0x1033}, /* 1032 */
- {0x1034,0x1034,0x1034}, {0x1035,0x1035,0x1035}, /* 1034 */
- {0x1036,0x1036,0x1036}, {0x1037,0x1037,0x1037}, /* 1036 */
- {0x1038,0x1038,0x1038}, {0x1039,0x1039,0x1039}, /* 1038 */
- {0x103A,0x103A,0x103A}, {0x103B,0x103B,0x103B}, /* 103A */
- {0x103C,0x103C,0x103C}, {0x103D,0x103D,0x103D}, /* 103C */
- {0x103E,0x103E,0x103E}, {0x103F,0x103F,0x103F}, /* 103E */
- {0x1040,0x1040,0x1040}, {0x1041,0x1041,0x1041}, /* 1040 */
- {0x1042,0x1042,0x1042}, {0x1043,0x1043,0x1043}, /* 1042 */
- {0x1044,0x1044,0x1044}, {0x1045,0x1045,0x1045}, /* 1044 */
- {0x1046,0x1046,0x1046}, {0x1047,0x1047,0x1047}, /* 1046 */
- {0x1048,0x1048,0x1048}, {0x1049,0x1049,0x1049}, /* 1048 */
- {0x104A,0x104A,0x104A}, {0x104B,0x104B,0x104B}, /* 104A */
- {0x104C,0x104C,0x104C}, {0x104D,0x104D,0x104D}, /* 104C */
- {0x104E,0x104E,0x104E}, {0x104F,0x104F,0x104F}, /* 104E */
- {0x1050,0x1050,0x1050}, {0x1051,0x1051,0x1051}, /* 1050 */
- {0x1052,0x1052,0x1052}, {0x1053,0x1053,0x1053}, /* 1052 */
- {0x1054,0x1054,0x1054}, {0x1055,0x1055,0x1055}, /* 1054 */
- {0x1056,0x1056,0x1056}, {0x1057,0x1057,0x1057}, /* 1056 */
- {0x1058,0x1058,0x1058}, {0x1059,0x1059,0x1059}, /* 1058 */
- {0x105A,0x105A,0x105A}, {0x105B,0x105B,0x105B}, /* 105A */
- {0x105C,0x105C,0x105C}, {0x105D,0x105D,0x105D}, /* 105C */
- {0x105E,0x105E,0x105E}, {0x105F,0x105F,0x105F}, /* 105E */
- {0x1060,0x1060,0x1060}, {0x1061,0x1061,0x1061}, /* 1060 */
- {0x1062,0x1062,0x1062}, {0x1063,0x1063,0x1063}, /* 1062 */
- {0x1064,0x1064,0x1064}, {0x1065,0x1065,0x1065}, /* 1064 */
- {0x1066,0x1066,0x1066}, {0x1067,0x1067,0x1067}, /* 1066 */
- {0x1068,0x1068,0x1068}, {0x1069,0x1069,0x1069}, /* 1068 */
- {0x106A,0x106A,0x106A}, {0x106B,0x106B,0x106B}, /* 106A */
- {0x106C,0x106C,0x106C}, {0x106D,0x106D,0x106D}, /* 106C */
- {0x106E,0x106E,0x106E}, {0x106F,0x106F,0x106F}, /* 106E */
- {0x1070,0x1070,0x1070}, {0x1071,0x1071,0x1071}, /* 1070 */
- {0x1072,0x1072,0x1072}, {0x1073,0x1073,0x1073}, /* 1072 */
- {0x1074,0x1074,0x1074}, {0x1075,0x1075,0x1075}, /* 1074 */
- {0x1076,0x1076,0x1076}, {0x1077,0x1077,0x1077}, /* 1076 */
- {0x1078,0x1078,0x1078}, {0x1079,0x1079,0x1079}, /* 1078 */
- {0x107A,0x107A,0x107A}, {0x107B,0x107B,0x107B}, /* 107A */
- {0x107C,0x107C,0x107C}, {0x107D,0x107D,0x107D}, /* 107C */
- {0x107E,0x107E,0x107E}, {0x107F,0x107F,0x107F}, /* 107E */
- {0x1080,0x1080,0x1080}, {0x1081,0x1081,0x1081}, /* 1080 */
- {0x1082,0x1082,0x1082}, {0x1083,0x1083,0x1083}, /* 1082 */
- {0x1084,0x1084,0x1084}, {0x1085,0x1085,0x1085}, /* 1084 */
- {0x1086,0x1086,0x1086}, {0x1087,0x1087,0x1087}, /* 1086 */
- {0x1088,0x1088,0x1088}, {0x1089,0x1089,0x1089}, /* 1088 */
- {0x108A,0x108A,0x108A}, {0x108B,0x108B,0x108B}, /* 108A */
- {0x108C,0x108C,0x108C}, {0x108D,0x108D,0x108D}, /* 108C */
- {0x108E,0x108E,0x108E}, {0x108F,0x108F,0x108F}, /* 108E */
- {0x1090,0x1090,0x1090}, {0x1091,0x1091,0x1091}, /* 1090 */
- {0x1092,0x1092,0x1092}, {0x1093,0x1093,0x1093}, /* 1092 */
- {0x1094,0x1094,0x1094}, {0x1095,0x1095,0x1095}, /* 1094 */
- {0x1096,0x1096,0x1096}, {0x1097,0x1097,0x1097}, /* 1096 */
- {0x1098,0x1098,0x1098}, {0x1099,0x1099,0x1099}, /* 1098 */
- {0x109A,0x109A,0x109A}, {0x109B,0x109B,0x109B}, /* 109A */
- {0x109C,0x109C,0x109C}, {0x109D,0x109D,0x109D}, /* 109C */
- {0x109E,0x109E,0x109E}, {0x109F,0x109F,0x109F}, /* 109E */
- {0x10A0,0x2D00,0x10A0}, {0x10A1,0x2D01,0x10A1}, /* 10A0 */
- {0x10A2,0x2D02,0x10A2}, {0x10A3,0x2D03,0x10A3}, /* 10A2 */
- {0x10A4,0x2D04,0x10A4}, {0x10A5,0x2D05,0x10A5}, /* 10A4 */
- {0x10A6,0x2D06,0x10A6}, {0x10A7,0x2D07,0x10A7}, /* 10A6 */
- {0x10A8,0x2D08,0x10A8}, {0x10A9,0x2D09,0x10A9}, /* 10A8 */
- {0x10AA,0x2D0A,0x10AA}, {0x10AB,0x2D0B,0x10AB}, /* 10AA */
- {0x10AC,0x2D0C,0x10AC}, {0x10AD,0x2D0D,0x10AD}, /* 10AC */
- {0x10AE,0x2D0E,0x10AE}, {0x10AF,0x2D0F,0x10AF}, /* 10AE */
- {0x10B0,0x2D10,0x10B0}, {0x10B1,0x2D11,0x10B1}, /* 10B0 */
- {0x10B2,0x2D12,0x10B2}, {0x10B3,0x2D13,0x10B3}, /* 10B2 */
- {0x10B4,0x2D14,0x10B4}, {0x10B5,0x2D15,0x10B5}, /* 10B4 */
- {0x10B6,0x2D16,0x10B6}, {0x10B7,0x2D17,0x10B7}, /* 10B6 */
- {0x10B8,0x2D18,0x10B8}, {0x10B9,0x2D19,0x10B9}, /* 10B8 */
- {0x10BA,0x2D1A,0x10BA}, {0x10BB,0x2D1B,0x10BB}, /* 10BA */
- {0x10BC,0x2D1C,0x10BC}, {0x10BD,0x2D1D,0x10BD}, /* 10BC */
- {0x10BE,0x2D1E,0x10BE}, {0x10BF,0x2D1F,0x10BF}, /* 10BE */
- {0x10C0,0x2D20,0x10C0}, {0x10C1,0x2D21,0x10C1}, /* 10C0 */
- {0x10C2,0x2D22,0x10C2}, {0x10C3,0x2D23,0x10C3}, /* 10C2 */
- {0x10C4,0x2D24,0x10C4}, {0x10C5,0x2D25,0x10C5}, /* 10C4 */
- {0x10C6,0x10C6,0x10C6}, {0x10C7,0x10C7,0x10C7}, /* 10C6 */
- {0x10C8,0x10C8,0x10C8}, {0x10C9,0x10C9,0x10C9}, /* 10C8 */
- {0x10CA,0x10CA,0x10CA}, {0x10CB,0x10CB,0x10CB}, /* 10CA */
- {0x10CC,0x10CC,0x10CC}, {0x10CD,0x10CD,0x10CD}, /* 10CC */
- {0x10CE,0x10CE,0x10CE}, {0x10CF,0x10CF,0x10CF}, /* 10CE */
- {0x10D0,0x10D0,0x10D0}, {0x10D1,0x10D1,0x10D1}, /* 10D0 */
- {0x10D2,0x10D2,0x10D2}, {0x10D3,0x10D3,0x10D3}, /* 10D2 */
- {0x10D4,0x10D4,0x10D4}, {0x10D5,0x10D5,0x10D5}, /* 10D4 */
- {0x10D6,0x10D6,0x10D6}, {0x10D7,0x10D7,0x10D7}, /* 10D6 */
- {0x10D8,0x10D8,0x10D8}, {0x10D9,0x10D9,0x10D9}, /* 10D8 */
- {0x10DA,0x10DA,0x10DA}, {0x10DB,0x10DB,0x10DB}, /* 10DA */
- {0x10DC,0x10DC,0x10DC}, {0x10DD,0x10DD,0x10DD}, /* 10DC */
- {0x10DE,0x10DE,0x10DE}, {0x10DF,0x10DF,0x10DF}, /* 10DE */
- {0x10E0,0x10E0,0x10E0}, {0x10E1,0x10E1,0x10E1}, /* 10E0 */
- {0x10E2,0x10E2,0x10E2}, {0x10E3,0x10E3,0x10E3}, /* 10E2 */
- {0x10E4,0x10E4,0x10E4}, {0x10E5,0x10E5,0x10E5}, /* 10E4 */
- {0x10E6,0x10E6,0x10E6}, {0x10E7,0x10E7,0x10E7}, /* 10E6 */
- {0x10E8,0x10E8,0x10E8}, {0x10E9,0x10E9,0x10E9}, /* 10E8 */
- {0x10EA,0x10EA,0x10EA}, {0x10EB,0x10EB,0x10EB}, /* 10EA */
- {0x10EC,0x10EC,0x10EC}, {0x10ED,0x10ED,0x10ED}, /* 10EC */
- {0x10EE,0x10EE,0x10EE}, {0x10EF,0x10EF,0x10EF}, /* 10EE */
- {0x10F0,0x10F0,0x10F0}, {0x10F1,0x10F1,0x10F1}, /* 10F0 */
- {0x10F2,0x10F2,0x10F2}, {0x10F3,0x10F3,0x10F3}, /* 10F2 */
- {0x10F4,0x10F4,0x10F4}, {0x10F5,0x10F5,0x10F5}, /* 10F4 */
- {0x10F6,0x10F6,0x10F6}, {0x10F7,0x10F7,0x10F7}, /* 10F6 */
- {0x10F8,0x10F8,0x10F8}, {0x10F9,0x10F9,0x10F9}, /* 10F8 */
- {0x10FA,0x10FA,0x10FA}, {0x10FB,0x10FB,0x10FB}, /* 10FA */
- {0x10FC,0x10FC,0x10FC}, {0x10FD,0x10FD,0x10FD}, /* 10FC */
- {0x10FE,0x10FE,0x10FE}, {0x10FF,0x10FF,0x10FF} /* 10FE */
-};
-
-static MY_UNICASE_CHARACTER u520p1D[]={
- {0x1D00,0x1D00,0x1D00}, {0x1D01,0x1D01,0x1D01}, /* 1D00 */
- {0x1D02,0x1D02,0x1D02}, {0x1D03,0x1D03,0x1D03}, /* 1D02 */
- {0x1D04,0x1D04,0x1D04}, {0x1D05,0x1D05,0x1D05}, /* 1D04 */
- {0x1D06,0x1D06,0x1D06}, {0x1D07,0x1D07,0x1D07}, /* 1D06 */
- {0x1D08,0x1D08,0x1D08}, {0x1D09,0x1D09,0x1D09}, /* 1D08 */
- {0x1D0A,0x1D0A,0x1D0A}, {0x1D0B,0x1D0B,0x1D0B}, /* 1D0A */
- {0x1D0C,0x1D0C,0x1D0C}, {0x1D0D,0x1D0D,0x1D0D}, /* 1D0C */
- {0x1D0E,0x1D0E,0x1D0E}, {0x1D0F,0x1D0F,0x1D0F}, /* 1D0E */
- {0x1D10,0x1D10,0x1D10}, {0x1D11,0x1D11,0x1D11}, /* 1D10 */
- {0x1D12,0x1D12,0x1D12}, {0x1D13,0x1D13,0x1D13}, /* 1D12 */
- {0x1D14,0x1D14,0x1D14}, {0x1D15,0x1D15,0x1D15}, /* 1D14 */
- {0x1D16,0x1D16,0x1D16}, {0x1D17,0x1D17,0x1D17}, /* 1D16 */
- {0x1D18,0x1D18,0x1D18}, {0x1D19,0x1D19,0x1D19}, /* 1D18 */
- {0x1D1A,0x1D1A,0x1D1A}, {0x1D1B,0x1D1B,0x1D1B}, /* 1D1A */
- {0x1D1C,0x1D1C,0x1D1C}, {0x1D1D,0x1D1D,0x1D1D}, /* 1D1C */
- {0x1D1E,0x1D1E,0x1D1E}, {0x1D1F,0x1D1F,0x1D1F}, /* 1D1E */
- {0x1D20,0x1D20,0x1D20}, {0x1D21,0x1D21,0x1D21}, /* 1D20 */
- {0x1D22,0x1D22,0x1D22}, {0x1D23,0x1D23,0x1D23}, /* 1D22 */
- {0x1D24,0x1D24,0x1D24}, {0x1D25,0x1D25,0x1D25}, /* 1D24 */
- {0x1D26,0x1D26,0x1D26}, {0x1D27,0x1D27,0x1D27}, /* 1D26 */
- {0x1D28,0x1D28,0x1D28}, {0x1D29,0x1D29,0x1D29}, /* 1D28 */
- {0x1D2A,0x1D2A,0x1D2A}, {0x1D2B,0x1D2B,0x1D2B}, /* 1D2A */
- {0x1D2C,0x1D2C,0x1D2C}, {0x1D2D,0x1D2D,0x1D2D}, /* 1D2C */
- {0x1D2E,0x1D2E,0x1D2E}, {0x1D2F,0x1D2F,0x1D2F}, /* 1D2E */
- {0x1D30,0x1D30,0x1D30}, {0x1D31,0x1D31,0x1D31}, /* 1D30 */
- {0x1D32,0x1D32,0x1D32}, {0x1D33,0x1D33,0x1D33}, /* 1D32 */
- {0x1D34,0x1D34,0x1D34}, {0x1D35,0x1D35,0x1D35}, /* 1D34 */
- {0x1D36,0x1D36,0x1D36}, {0x1D37,0x1D37,0x1D37}, /* 1D36 */
- {0x1D38,0x1D38,0x1D38}, {0x1D39,0x1D39,0x1D39}, /* 1D38 */
- {0x1D3A,0x1D3A,0x1D3A}, {0x1D3B,0x1D3B,0x1D3B}, /* 1D3A */
- {0x1D3C,0x1D3C,0x1D3C}, {0x1D3D,0x1D3D,0x1D3D}, /* 1D3C */
- {0x1D3E,0x1D3E,0x1D3E}, {0x1D3F,0x1D3F,0x1D3F}, /* 1D3E */
- {0x1D40,0x1D40,0x1D40}, {0x1D41,0x1D41,0x1D41}, /* 1D40 */
- {0x1D42,0x1D42,0x1D42}, {0x1D43,0x1D43,0x1D43}, /* 1D42 */
- {0x1D44,0x1D44,0x1D44}, {0x1D45,0x1D45,0x1D45}, /* 1D44 */
- {0x1D46,0x1D46,0x1D46}, {0x1D47,0x1D47,0x1D47}, /* 1D46 */
- {0x1D48,0x1D48,0x1D48}, {0x1D49,0x1D49,0x1D49}, /* 1D48 */
- {0x1D4A,0x1D4A,0x1D4A}, {0x1D4B,0x1D4B,0x1D4B}, /* 1D4A */
- {0x1D4C,0x1D4C,0x1D4C}, {0x1D4D,0x1D4D,0x1D4D}, /* 1D4C */
- {0x1D4E,0x1D4E,0x1D4E}, {0x1D4F,0x1D4F,0x1D4F}, /* 1D4E */
- {0x1D50,0x1D50,0x1D50}, {0x1D51,0x1D51,0x1D51}, /* 1D50 */
- {0x1D52,0x1D52,0x1D52}, {0x1D53,0x1D53,0x1D53}, /* 1D52 */
- {0x1D54,0x1D54,0x1D54}, {0x1D55,0x1D55,0x1D55}, /* 1D54 */
- {0x1D56,0x1D56,0x1D56}, {0x1D57,0x1D57,0x1D57}, /* 1D56 */
- {0x1D58,0x1D58,0x1D58}, {0x1D59,0x1D59,0x1D59}, /* 1D58 */
- {0x1D5A,0x1D5A,0x1D5A}, {0x1D5B,0x1D5B,0x1D5B}, /* 1D5A */
- {0x1D5C,0x1D5C,0x1D5C}, {0x1D5D,0x1D5D,0x1D5D}, /* 1D5C */
- {0x1D5E,0x1D5E,0x1D5E}, {0x1D5F,0x1D5F,0x1D5F}, /* 1D5E */
- {0x1D60,0x1D60,0x1D60}, {0x1D61,0x1D61,0x1D61}, /* 1D60 */
- {0x1D62,0x1D62,0x1D62}, {0x1D63,0x1D63,0x1D63}, /* 1D62 */
- {0x1D64,0x1D64,0x1D64}, {0x1D65,0x1D65,0x1D65}, /* 1D64 */
- {0x1D66,0x1D66,0x1D66}, {0x1D67,0x1D67,0x1D67}, /* 1D66 */
- {0x1D68,0x1D68,0x1D68}, {0x1D69,0x1D69,0x1D69}, /* 1D68 */
- {0x1D6A,0x1D6A,0x1D6A}, {0x1D6B,0x1D6B,0x1D6B}, /* 1D6A */
- {0x1D6C,0x1D6C,0x1D6C}, {0x1D6D,0x1D6D,0x1D6D}, /* 1D6C */
- {0x1D6E,0x1D6E,0x1D6E}, {0x1D6F,0x1D6F,0x1D6F}, /* 1D6E */
- {0x1D70,0x1D70,0x1D70}, {0x1D71,0x1D71,0x1D71}, /* 1D70 */
- {0x1D72,0x1D72,0x1D72}, {0x1D73,0x1D73,0x1D73}, /* 1D72 */
- {0x1D74,0x1D74,0x1D74}, {0x1D75,0x1D75,0x1D75}, /* 1D74 */
- {0x1D76,0x1D76,0x1D76}, {0x1D77,0x1D77,0x1D77}, /* 1D76 */
- {0x1D78,0x1D78,0x1D78}, {0xA77D,0x1D79,0xA77D}, /* 1D78 */
- {0x1D7A,0x1D7A,0x1D7A}, {0x1D7B,0x1D7B,0x1D7B}, /* 1D7A */
- {0x1D7C,0x1D7C,0x1D7C}, {0x2C63,0x1D7D,0x2C63}, /* 1D7C */
- {0x1D7E,0x1D7E,0x1D7E}, {0x1D7F,0x1D7F,0x1D7F}, /* 1D7E */
- {0x1D80,0x1D80,0x1D80}, {0x1D81,0x1D81,0x1D81}, /* 1D80 */
- {0x1D82,0x1D82,0x1D82}, {0x1D83,0x1D83,0x1D83}, /* 1D82 */
- {0x1D84,0x1D84,0x1D84}, {0x1D85,0x1D85,0x1D85}, /* 1D84 */
- {0x1D86,0x1D86,0x1D86}, {0x1D87,0x1D87,0x1D87}, /* 1D86 */
- {0x1D88,0x1D88,0x1D88}, {0x1D89,0x1D89,0x1D89}, /* 1D88 */
- {0x1D8A,0x1D8A,0x1D8A}, {0x1D8B,0x1D8B,0x1D8B}, /* 1D8A */
- {0x1D8C,0x1D8C,0x1D8C}, {0x1D8D,0x1D8D,0x1D8D}, /* 1D8C */
- {0x1D8E,0x1D8E,0x1D8E}, {0x1D8F,0x1D8F,0x1D8F}, /* 1D8E */
- {0x1D90,0x1D90,0x1D90}, {0x1D91,0x1D91,0x1D91}, /* 1D90 */
- {0x1D92,0x1D92,0x1D92}, {0x1D93,0x1D93,0x1D93}, /* 1D92 */
- {0x1D94,0x1D94,0x1D94}, {0x1D95,0x1D95,0x1D95}, /* 1D94 */
- {0x1D96,0x1D96,0x1D96}, {0x1D97,0x1D97,0x1D97}, /* 1D96 */
- {0x1D98,0x1D98,0x1D98}, {0x1D99,0x1D99,0x1D99}, /* 1D98 */
- {0x1D9A,0x1D9A,0x1D9A}, {0x1D9B,0x1D9B,0x1D9B}, /* 1D9A */
- {0x1D9C,0x1D9C,0x1D9C}, {0x1D9D,0x1D9D,0x1D9D}, /* 1D9C */
- {0x1D9E,0x1D9E,0x1D9E}, {0x1D9F,0x1D9F,0x1D9F}, /* 1D9E */
- {0x1DA0,0x1DA0,0x1DA0}, {0x1DA1,0x1DA1,0x1DA1}, /* 1DA0 */
- {0x1DA2,0x1DA2,0x1DA2}, {0x1DA3,0x1DA3,0x1DA3}, /* 1DA2 */
- {0x1DA4,0x1DA4,0x1DA4}, {0x1DA5,0x1DA5,0x1DA5}, /* 1DA4 */
- {0x1DA6,0x1DA6,0x1DA6}, {0x1DA7,0x1DA7,0x1DA7}, /* 1DA6 */
- {0x1DA8,0x1DA8,0x1DA8}, {0x1DA9,0x1DA9,0x1DA9}, /* 1DA8 */
- {0x1DAA,0x1DAA,0x1DAA}, {0x1DAB,0x1DAB,0x1DAB}, /* 1DAA */
- {0x1DAC,0x1DAC,0x1DAC}, {0x1DAD,0x1DAD,0x1DAD}, /* 1DAC */
- {0x1DAE,0x1DAE,0x1DAE}, {0x1DAF,0x1DAF,0x1DAF}, /* 1DAE */
- {0x1DB0,0x1DB0,0x1DB0}, {0x1DB1,0x1DB1,0x1DB1}, /* 1DB0 */
- {0x1DB2,0x1DB2,0x1DB2}, {0x1DB3,0x1DB3,0x1DB3}, /* 1DB2 */
- {0x1DB4,0x1DB4,0x1DB4}, {0x1DB5,0x1DB5,0x1DB5}, /* 1DB4 */
- {0x1DB6,0x1DB6,0x1DB6}, {0x1DB7,0x1DB7,0x1DB7}, /* 1DB6 */
- {0x1DB8,0x1DB8,0x1DB8}, {0x1DB9,0x1DB9,0x1DB9}, /* 1DB8 */
- {0x1DBA,0x1DBA,0x1DBA}, {0x1DBB,0x1DBB,0x1DBB}, /* 1DBA */
- {0x1DBC,0x1DBC,0x1DBC}, {0x1DBD,0x1DBD,0x1DBD}, /* 1DBC */
- {0x1DBE,0x1DBE,0x1DBE}, {0x1DBF,0x1DBF,0x1DBF}, /* 1DBE */
- {0x1DC0,0x1DC0,0x1DC0}, {0x1DC1,0x1DC1,0x1DC1}, /* 1DC0 */
- {0x1DC2,0x1DC2,0x1DC2}, {0x1DC3,0x1DC3,0x1DC3}, /* 1DC2 */
- {0x1DC4,0x1DC4,0x1DC4}, {0x1DC5,0x1DC5,0x1DC5}, /* 1DC4 */
- {0x1DC6,0x1DC6,0x1DC6}, {0x1DC7,0x1DC7,0x1DC7}, /* 1DC6 */
- {0x1DC8,0x1DC8,0x1DC8}, {0x1DC9,0x1DC9,0x1DC9}, /* 1DC8 */
- {0x1DCA,0x1DCA,0x1DCA}, {0x1DCB,0x1DCB,0x1DCB}, /* 1DCA */
- {0x1DCC,0x1DCC,0x1DCC}, {0x1DCD,0x1DCD,0x1DCD}, /* 1DCC */
- {0x1DCE,0x1DCE,0x1DCE}, {0x1DCF,0x1DCF,0x1DCF}, /* 1DCE */
- {0x1DD0,0x1DD0,0x1DD0}, {0x1DD1,0x1DD1,0x1DD1}, /* 1DD0 */
- {0x1DD2,0x1DD2,0x1DD2}, {0x1DD3,0x1DD3,0x1DD3}, /* 1DD2 */
- {0x1DD4,0x1DD4,0x1DD4}, {0x1DD5,0x1DD5,0x1DD5}, /* 1DD4 */
- {0x1DD6,0x1DD6,0x1DD6}, {0x1DD7,0x1DD7,0x1DD7}, /* 1DD6 */
- {0x1DD8,0x1DD8,0x1DD8}, {0x1DD9,0x1DD9,0x1DD9}, /* 1DD8 */
- {0x1DDA,0x1DDA,0x1DDA}, {0x1DDB,0x1DDB,0x1DDB}, /* 1DDA */
- {0x1DDC,0x1DDC,0x1DDC}, {0x1DDD,0x1DDD,0x1DDD}, /* 1DDC */
- {0x1DDE,0x1DDE,0x1DDE}, {0x1DDF,0x1DDF,0x1DDF}, /* 1DDE */
- {0x1DE0,0x1DE0,0x1DE0}, {0x1DE1,0x1DE1,0x1DE1}, /* 1DE0 */
- {0x1DE2,0x1DE2,0x1DE2}, {0x1DE3,0x1DE3,0x1DE3}, /* 1DE2 */
- {0x1DE4,0x1DE4,0x1DE4}, {0x1DE5,0x1DE5,0x1DE5}, /* 1DE4 */
- {0x1DE6,0x1DE6,0x1DE6}, {0x1DE7,0x1DE7,0x1DE7}, /* 1DE6 */
- {0x1DE8,0x1DE8,0x1DE8}, {0x1DE9,0x1DE9,0x1DE9}, /* 1DE8 */
- {0x1DEA,0x1DEA,0x1DEA}, {0x1DEB,0x1DEB,0x1DEB}, /* 1DEA */
- {0x1DEC,0x1DEC,0x1DEC}, {0x1DED,0x1DED,0x1DED}, /* 1DEC */
- {0x1DEE,0x1DEE,0x1DEE}, {0x1DEF,0x1DEF,0x1DEF}, /* 1DEE */
- {0x1DF0,0x1DF0,0x1DF0}, {0x1DF1,0x1DF1,0x1DF1}, /* 1DF0 */
- {0x1DF2,0x1DF2,0x1DF2}, {0x1DF3,0x1DF3,0x1DF3}, /* 1DF2 */
- {0x1DF4,0x1DF4,0x1DF4}, {0x1DF5,0x1DF5,0x1DF5}, /* 1DF4 */
- {0x1DF6,0x1DF6,0x1DF6}, {0x1DF7,0x1DF7,0x1DF7}, /* 1DF6 */
- {0x1DF8,0x1DF8,0x1DF8}, {0x1DF9,0x1DF9,0x1DF9}, /* 1DF8 */
- {0x1DFA,0x1DFA,0x1DFA}, {0x1DFB,0x1DFB,0x1DFB}, /* 1DFA */
- {0x1DFC,0x1DFC,0x1DFC}, {0x1DFD,0x1DFD,0x1DFD}, /* 1DFC */
- {0x1DFE,0x1DFE,0x1DFE}, {0x1DFF,0x1DFF,0x1DFF} /* 1DFE */
-};
-
-static MY_UNICASE_CHARACTER u520p1E[]={
- {0x1E00,0x1E01,0x0041}, {0x1E00,0x1E01,0x0041}, /* 1E00 */
- {0x1E02,0x1E03,0x0042}, {0x1E02,0x1E03,0x0042}, /* 1E02 */
- {0x1E04,0x1E05,0x0042}, {0x1E04,0x1E05,0x0042}, /* 1E04 */
- {0x1E06,0x1E07,0x0042}, {0x1E06,0x1E07,0x0042}, /* 1E06 */
- {0x1E08,0x1E09,0x0043}, {0x1E08,0x1E09,0x0043}, /* 1E08 */
- {0x1E0A,0x1E0B,0x0044}, {0x1E0A,0x1E0B,0x0044}, /* 1E0A */
- {0x1E0C,0x1E0D,0x0044}, {0x1E0C,0x1E0D,0x0044}, /* 1E0C */
- {0x1E0E,0x1E0F,0x0044}, {0x1E0E,0x1E0F,0x0044}, /* 1E0E */
- {0x1E10,0x1E11,0x0044}, {0x1E10,0x1E11,0x0044}, /* 1E10 */
- {0x1E12,0x1E13,0x0044}, {0x1E12,0x1E13,0x0044}, /* 1E12 */
- {0x1E14,0x1E15,0x0045}, {0x1E14,0x1E15,0x0045}, /* 1E14 */
- {0x1E16,0x1E17,0x0045}, {0x1E16,0x1E17,0x0045}, /* 1E16 */
- {0x1E18,0x1E19,0x0045}, {0x1E18,0x1E19,0x0045}, /* 1E18 */
- {0x1E1A,0x1E1B,0x0045}, {0x1E1A,0x1E1B,0x0045}, /* 1E1A */
- {0x1E1C,0x1E1D,0x0045}, {0x1E1C,0x1E1D,0x0045}, /* 1E1C */
- {0x1E1E,0x1E1F,0x0046}, {0x1E1E,0x1E1F,0x0046}, /* 1E1E */
- {0x1E20,0x1E21,0x0047}, {0x1E20,0x1E21,0x0047}, /* 1E20 */
- {0x1E22,0x1E23,0x0048}, {0x1E22,0x1E23,0x0048}, /* 1E22 */
- {0x1E24,0x1E25,0x0048}, {0x1E24,0x1E25,0x0048}, /* 1E24 */
- {0x1E26,0x1E27,0x0048}, {0x1E26,0x1E27,0x0048}, /* 1E26 */
- {0x1E28,0x1E29,0x0048}, {0x1E28,0x1E29,0x0048}, /* 1E28 */
- {0x1E2A,0x1E2B,0x0048}, {0x1E2A,0x1E2B,0x0048}, /* 1E2A */
- {0x1E2C,0x1E2D,0x0049}, {0x1E2C,0x1E2D,0x0049}, /* 1E2C */
- {0x1E2E,0x1E2F,0x0049}, {0x1E2E,0x1E2F,0x0049}, /* 1E2E */
- {0x1E30,0x1E31,0x004B}, {0x1E30,0x1E31,0x004B}, /* 1E30 */
- {0x1E32,0x1E33,0x004B}, {0x1E32,0x1E33,0x004B}, /* 1E32 */
- {0x1E34,0x1E35,0x004B}, {0x1E34,0x1E35,0x004B}, /* 1E34 */
- {0x1E36,0x1E37,0x004C}, {0x1E36,0x1E37,0x004C}, /* 1E36 */
- {0x1E38,0x1E39,0x004C}, {0x1E38,0x1E39,0x004C}, /* 1E38 */
- {0x1E3A,0x1E3B,0x004C}, {0x1E3A,0x1E3B,0x004C}, /* 1E3A */
- {0x1E3C,0x1E3D,0x004C}, {0x1E3C,0x1E3D,0x004C}, /* 1E3C */
- {0x1E3E,0x1E3F,0x004D}, {0x1E3E,0x1E3F,0x004D}, /* 1E3E */
- {0x1E40,0x1E41,0x004D}, {0x1E40,0x1E41,0x004D}, /* 1E40 */
- {0x1E42,0x1E43,0x004D}, {0x1E42,0x1E43,0x004D}, /* 1E42 */
- {0x1E44,0x1E45,0x004E}, {0x1E44,0x1E45,0x004E}, /* 1E44 */
- {0x1E46,0x1E47,0x004E}, {0x1E46,0x1E47,0x004E}, /* 1E46 */
- {0x1E48,0x1E49,0x004E}, {0x1E48,0x1E49,0x004E}, /* 1E48 */
- {0x1E4A,0x1E4B,0x004E}, {0x1E4A,0x1E4B,0x004E}, /* 1E4A */
- {0x1E4C,0x1E4D,0x004F}, {0x1E4C,0x1E4D,0x004F}, /* 1E4C */
- {0x1E4E,0x1E4F,0x004F}, {0x1E4E,0x1E4F,0x004F}, /* 1E4E */
- {0x1E50,0x1E51,0x004F}, {0x1E50,0x1E51,0x004F}, /* 1E50 */
- {0x1E52,0x1E53,0x004F}, {0x1E52,0x1E53,0x004F}, /* 1E52 */
- {0x1E54,0x1E55,0x0050}, {0x1E54,0x1E55,0x0050}, /* 1E54 */
- {0x1E56,0x1E57,0x0050}, {0x1E56,0x1E57,0x0050}, /* 1E56 */
- {0x1E58,0x1E59,0x0052}, {0x1E58,0x1E59,0x0052}, /* 1E58 */
- {0x1E5A,0x1E5B,0x0052}, {0x1E5A,0x1E5B,0x0052}, /* 1E5A */
- {0x1E5C,0x1E5D,0x0052}, {0x1E5C,0x1E5D,0x0052}, /* 1E5C */
- {0x1E5E,0x1E5F,0x0052}, {0x1E5E,0x1E5F,0x0052}, /* 1E5E */
- {0x1E60,0x1E61,0x0053}, {0x1E60,0x1E61,0x0053}, /* 1E60 */
- {0x1E62,0x1E63,0x0053}, {0x1E62,0x1E63,0x0053}, /* 1E62 */
- {0x1E64,0x1E65,0x0053}, {0x1E64,0x1E65,0x0053}, /* 1E64 */
- {0x1E66,0x1E67,0x0053}, {0x1E66,0x1E67,0x0053}, /* 1E66 */
- {0x1E68,0x1E69,0x0053}, {0x1E68,0x1E69,0x0053}, /* 1E68 */
- {0x1E6A,0x1E6B,0x0054}, {0x1E6A,0x1E6B,0x0054}, /* 1E6A */
- {0x1E6C,0x1E6D,0x0054}, {0x1E6C,0x1E6D,0x0054}, /* 1E6C */
- {0x1E6E,0x1E6F,0x0054}, {0x1E6E,0x1E6F,0x0054}, /* 1E6E */
- {0x1E70,0x1E71,0x0054}, {0x1E70,0x1E71,0x0054}, /* 1E70 */
- {0x1E72,0x1E73,0x0055}, {0x1E72,0x1E73,0x0055}, /* 1E72 */
- {0x1E74,0x1E75,0x0055}, {0x1E74,0x1E75,0x0055}, /* 1E74 */
- {0x1E76,0x1E77,0x0055}, {0x1E76,0x1E77,0x0055}, /* 1E76 */
- {0x1E78,0x1E79,0x0055}, {0x1E78,0x1E79,0x0055}, /* 1E78 */
- {0x1E7A,0x1E7B,0x0055}, {0x1E7A,0x1E7B,0x0055}, /* 1E7A */
- {0x1E7C,0x1E7D,0x0056}, {0x1E7C,0x1E7D,0x0056}, /* 1E7C */
- {0x1E7E,0x1E7F,0x0056}, {0x1E7E,0x1E7F,0x0056}, /* 1E7E */
- {0x1E80,0x1E81,0x0057}, {0x1E80,0x1E81,0x0057}, /* 1E80 */
- {0x1E82,0x1E83,0x0057}, {0x1E82,0x1E83,0x0057}, /* 1E82 */
- {0x1E84,0x1E85,0x0057}, {0x1E84,0x1E85,0x0057}, /* 1E84 */
- {0x1E86,0x1E87,0x0057}, {0x1E86,0x1E87,0x0057}, /* 1E86 */
- {0x1E88,0x1E89,0x0057}, {0x1E88,0x1E89,0x0057}, /* 1E88 */
- {0x1E8A,0x1E8B,0x0058}, {0x1E8A,0x1E8B,0x0058}, /* 1E8A */
- {0x1E8C,0x1E8D,0x0058}, {0x1E8C,0x1E8D,0x0058}, /* 1E8C */
- {0x1E8E,0x1E8F,0x0059}, {0x1E8E,0x1E8F,0x0059}, /* 1E8E */
- {0x1E90,0x1E91,0x005A}, {0x1E90,0x1E91,0x005A}, /* 1E90 */
- {0x1E92,0x1E93,0x005A}, {0x1E92,0x1E93,0x005A}, /* 1E92 */
- {0x1E94,0x1E95,0x005A}, {0x1E94,0x1E95,0x005A}, /* 1E94 */
- {0x1E96,0x1E96,0x0048}, {0x1E97,0x1E97,0x0054}, /* 1E96 */
- {0x1E98,0x1E98,0x0057}, {0x1E99,0x1E99,0x0059}, /* 1E98 */
- {0x1E9A,0x1E9A,0x1E9A}, {0x1E60,0x1E9B,0x0053}, /* 1E9A */
- {0x1E9C,0x1E9C,0x1E9C}, {0x1E9D,0x1E9D,0x1E9D}, /* 1E9C */
- {0x1E9E,0x00DF,0x1E9E}, {0x1E9F,0x1E9F,0x1E9F}, /* 1E9E */
- {0x1EA0,0x1EA1,0x0041}, {0x1EA0,0x1EA1,0x0041}, /* 1EA0 */
- {0x1EA2,0x1EA3,0x0041}, {0x1EA2,0x1EA3,0x0041}, /* 1EA2 */
- {0x1EA4,0x1EA5,0x0041}, {0x1EA4,0x1EA5,0x0041}, /* 1EA4 */
- {0x1EA6,0x1EA7,0x0041}, {0x1EA6,0x1EA7,0x0041}, /* 1EA6 */
- {0x1EA8,0x1EA9,0x0041}, {0x1EA8,0x1EA9,0x0041}, /* 1EA8 */
- {0x1EAA,0x1EAB,0x0041}, {0x1EAA,0x1EAB,0x0041}, /* 1EAA */
- {0x1EAC,0x1EAD,0x0041}, {0x1EAC,0x1EAD,0x0041}, /* 1EAC */
- {0x1EAE,0x1EAF,0x0041}, {0x1EAE,0x1EAF,0x0041}, /* 1EAE */
- {0x1EB0,0x1EB1,0x0041}, {0x1EB0,0x1EB1,0x0041}, /* 1EB0 */
- {0x1EB2,0x1EB3,0x0041}, {0x1EB2,0x1EB3,0x0041}, /* 1EB2 */
- {0x1EB4,0x1EB5,0x0041}, {0x1EB4,0x1EB5,0x0041}, /* 1EB4 */
- {0x1EB6,0x1EB7,0x0041}, {0x1EB6,0x1EB7,0x0041}, /* 1EB6 */
- {0x1EB8,0x1EB9,0x0045}, {0x1EB8,0x1EB9,0x0045}, /* 1EB8 */
- {0x1EBA,0x1EBB,0x0045}, {0x1EBA,0x1EBB,0x0045}, /* 1EBA */
- {0x1EBC,0x1EBD,0x0045}, {0x1EBC,0x1EBD,0x0045}, /* 1EBC */
- {0x1EBE,0x1EBF,0x0045}, {0x1EBE,0x1EBF,0x0045}, /* 1EBE */
- {0x1EC0,0x1EC1,0x0045}, {0x1EC0,0x1EC1,0x0045}, /* 1EC0 */
- {0x1EC2,0x1EC3,0x0045}, {0x1EC2,0x1EC3,0x0045}, /* 1EC2 */
- {0x1EC4,0x1EC5,0x0045}, {0x1EC4,0x1EC5,0x0045}, /* 1EC4 */
- {0x1EC6,0x1EC7,0x0045}, {0x1EC6,0x1EC7,0x0045}, /* 1EC6 */
- {0x1EC8,0x1EC9,0x0049}, {0x1EC8,0x1EC9,0x0049}, /* 1EC8 */
- {0x1ECA,0x1ECB,0x0049}, {0x1ECA,0x1ECB,0x0049}, /* 1ECA */
- {0x1ECC,0x1ECD,0x004F}, {0x1ECC,0x1ECD,0x004F}, /* 1ECC */
- {0x1ECE,0x1ECF,0x004F}, {0x1ECE,0x1ECF,0x004F}, /* 1ECE */
- {0x1ED0,0x1ED1,0x004F}, {0x1ED0,0x1ED1,0x004F}, /* 1ED0 */
- {0x1ED2,0x1ED3,0x004F}, {0x1ED2,0x1ED3,0x004F}, /* 1ED2 */
- {0x1ED4,0x1ED5,0x004F}, {0x1ED4,0x1ED5,0x004F}, /* 1ED4 */
- {0x1ED6,0x1ED7,0x004F}, {0x1ED6,0x1ED7,0x004F}, /* 1ED6 */
- {0x1ED8,0x1ED9,0x004F}, {0x1ED8,0x1ED9,0x004F}, /* 1ED8 */
- {0x1EDA,0x1EDB,0x004F}, {0x1EDA,0x1EDB,0x004F}, /* 1EDA */
- {0x1EDC,0x1EDD,0x004F}, {0x1EDC,0x1EDD,0x004F}, /* 1EDC */
- {0x1EDE,0x1EDF,0x004F}, {0x1EDE,0x1EDF,0x004F}, /* 1EDE */
- {0x1EE0,0x1EE1,0x004F}, {0x1EE0,0x1EE1,0x004F}, /* 1EE0 */
- {0x1EE2,0x1EE3,0x004F}, {0x1EE2,0x1EE3,0x004F}, /* 1EE2 */
- {0x1EE4,0x1EE5,0x0055}, {0x1EE4,0x1EE5,0x0055}, /* 1EE4 */
- {0x1EE6,0x1EE7,0x0055}, {0x1EE6,0x1EE7,0x0055}, /* 1EE6 */
- {0x1EE8,0x1EE9,0x0055}, {0x1EE8,0x1EE9,0x0055}, /* 1EE8 */
- {0x1EEA,0x1EEB,0x0055}, {0x1EEA,0x1EEB,0x0055}, /* 1EEA */
- {0x1EEC,0x1EED,0x0055}, {0x1EEC,0x1EED,0x0055}, /* 1EEC */
- {0x1EEE,0x1EEF,0x0055}, {0x1EEE,0x1EEF,0x0055}, /* 1EEE */
- {0x1EF0,0x1EF1,0x0055}, {0x1EF0,0x1EF1,0x0055}, /* 1EF0 */
- {0x1EF2,0x1EF3,0x0059}, {0x1EF2,0x1EF3,0x0059}, /* 1EF2 */
- {0x1EF4,0x1EF5,0x0059}, {0x1EF4,0x1EF5,0x0059}, /* 1EF4 */
- {0x1EF6,0x1EF7,0x0059}, {0x1EF6,0x1EF7,0x0059}, /* 1EF6 */
- {0x1EF8,0x1EF9,0x0059}, {0x1EF8,0x1EF9,0x0059}, /* 1EF8 */
- {0x1EFA,0x1EFB,0x1EFA}, {0x1EFA,0x1EFB,0x1EFA}, /* 1EFA */
- {0x1EFC,0x1EFD,0x1EFC}, {0x1EFC,0x1EFD,0x1EFC}, /* 1EFC */
- {0x1EFE,0x1EFF,0x1EFE}, {0x1EFE,0x1EFF,0x1EFE} /* 1EFE */
-};
-
-static MY_UNICASE_CHARACTER u520p1F[]={
- {0x1F08,0x1F00,0x0391}, {0x1F09,0x1F01,0x0391}, /* 1F00 */
- {0x1F0A,0x1F02,0x0391}, {0x1F0B,0x1F03,0x0391}, /* 1F02 */
- {0x1F0C,0x1F04,0x0391}, {0x1F0D,0x1F05,0x0391}, /* 1F04 */
- {0x1F0E,0x1F06,0x0391}, {0x1F0F,0x1F07,0x0391}, /* 1F06 */
- {0x1F08,0x1F00,0x0391}, {0x1F09,0x1F01,0x0391}, /* 1F08 */
- {0x1F0A,0x1F02,0x0391}, {0x1F0B,0x1F03,0x0391}, /* 1F0A */
- {0x1F0C,0x1F04,0x0391}, {0x1F0D,0x1F05,0x0391}, /* 1F0C */
- {0x1F0E,0x1F06,0x0391}, {0x1F0F,0x1F07,0x0391}, /* 1F0E */
- {0x1F18,0x1F10,0x0395}, {0x1F19,0x1F11,0x0395}, /* 1F10 */
- {0x1F1A,0x1F12,0x0395}, {0x1F1B,0x1F13,0x0395}, /* 1F12 */
- {0x1F1C,0x1F14,0x0395}, {0x1F1D,0x1F15,0x0395}, /* 1F14 */
- {0x1F16,0x1F16,0x1F16}, {0x1F17,0x1F17,0x1F17}, /* 1F16 */
- {0x1F18,0x1F10,0x0395}, {0x1F19,0x1F11,0x0395}, /* 1F18 */
- {0x1F1A,0x1F12,0x0395}, {0x1F1B,0x1F13,0x0395}, /* 1F1A */
- {0x1F1C,0x1F14,0x0395}, {0x1F1D,0x1F15,0x0395}, /* 1F1C */
- {0x1F1E,0x1F1E,0x1F1E}, {0x1F1F,0x1F1F,0x1F1F}, /* 1F1E */
- {0x1F28,0x1F20,0x0397}, {0x1F29,0x1F21,0x0397}, /* 1F20 */
- {0x1F2A,0x1F22,0x0397}, {0x1F2B,0x1F23,0x0397}, /* 1F22 */
- {0x1F2C,0x1F24,0x0397}, {0x1F2D,0x1F25,0x0397}, /* 1F24 */
- {0x1F2E,0x1F26,0x0397}, {0x1F2F,0x1F27,0x0397}, /* 1F26 */
- {0x1F28,0x1F20,0x0397}, {0x1F29,0x1F21,0x0397}, /* 1F28 */
- {0x1F2A,0x1F22,0x0397}, {0x1F2B,0x1F23,0x0397}, /* 1F2A */
- {0x1F2C,0x1F24,0x0397}, {0x1F2D,0x1F25,0x0397}, /* 1F2C */
- {0x1F2E,0x1F26,0x0397}, {0x1F2F,0x1F27,0x0397}, /* 1F2E */
- {0x1F38,0x1F30,0x0399}, {0x1F39,0x1F31,0x0399}, /* 1F30 */
- {0x1F3A,0x1F32,0x0399}, {0x1F3B,0x1F33,0x0399}, /* 1F32 */
- {0x1F3C,0x1F34,0x0399}, {0x1F3D,0x1F35,0x0399}, /* 1F34 */
- {0x1F3E,0x1F36,0x0399}, {0x1F3F,0x1F37,0x0399}, /* 1F36 */
- {0x1F38,0x1F30,0x0399}, {0x1F39,0x1F31,0x0399}, /* 1F38 */
- {0x1F3A,0x1F32,0x0399}, {0x1F3B,0x1F33,0x0399}, /* 1F3A */
- {0x1F3C,0x1F34,0x0399}, {0x1F3D,0x1F35,0x0399}, /* 1F3C */
- {0x1F3E,0x1F36,0x0399}, {0x1F3F,0x1F37,0x0399}, /* 1F3E */
- {0x1F48,0x1F40,0x039F}, {0x1F49,0x1F41,0x039F}, /* 1F40 */
- {0x1F4A,0x1F42,0x039F}, {0x1F4B,0x1F43,0x039F}, /* 1F42 */
- {0x1F4C,0x1F44,0x039F}, {0x1F4D,0x1F45,0x039F}, /* 1F44 */
- {0x1F46,0x1F46,0x1F46}, {0x1F47,0x1F47,0x1F47}, /* 1F46 */
- {0x1F48,0x1F40,0x039F}, {0x1F49,0x1F41,0x039F}, /* 1F48 */
- {0x1F4A,0x1F42,0x039F}, {0x1F4B,0x1F43,0x039F}, /* 1F4A */
- {0x1F4C,0x1F44,0x039F}, {0x1F4D,0x1F45,0x039F}, /* 1F4C */
- {0x1F4E,0x1F4E,0x1F4E}, {0x1F4F,0x1F4F,0x1F4F}, /* 1F4E */
- {0x1F50,0x1F50,0x03A5}, {0x1F59,0x1F51,0x03A5}, /* 1F50 */
- {0x1F52,0x1F52,0x03A5}, {0x1F5B,0x1F53,0x03A5}, /* 1F52 */
- {0x1F54,0x1F54,0x03A5}, {0x1F5D,0x1F55,0x03A5}, /* 1F54 */
- {0x1F56,0x1F56,0x03A5}, {0x1F5F,0x1F57,0x03A5}, /* 1F56 */
- {0x1F58,0x1F58,0x1F58}, {0x1F59,0x1F51,0x03A5}, /* 1F58 */
- {0x1F5A,0x1F5A,0x1F5A}, {0x1F5B,0x1F53,0x03A5}, /* 1F5A */
- {0x1F5C,0x1F5C,0x1F5C}, {0x1F5D,0x1F55,0x03A5}, /* 1F5C */
- {0x1F5E,0x1F5E,0x1F5E}, {0x1F5F,0x1F57,0x03A5}, /* 1F5E */
- {0x1F68,0x1F60,0x03A9}, {0x1F69,0x1F61,0x03A9}, /* 1F60 */
- {0x1F6A,0x1F62,0x03A9}, {0x1F6B,0x1F63,0x03A9}, /* 1F62 */
- {0x1F6C,0x1F64,0x03A9}, {0x1F6D,0x1F65,0x03A9}, /* 1F64 */
- {0x1F6E,0x1F66,0x03A9}, {0x1F6F,0x1F67,0x03A9}, /* 1F66 */
- {0x1F68,0x1F60,0x03A9}, {0x1F69,0x1F61,0x03A9}, /* 1F68 */
- {0x1F6A,0x1F62,0x03A9}, {0x1F6B,0x1F63,0x03A9}, /* 1F6A */
- {0x1F6C,0x1F64,0x03A9}, {0x1F6D,0x1F65,0x03A9}, /* 1F6C */
- {0x1F6E,0x1F66,0x03A9}, {0x1F6F,0x1F67,0x03A9}, /* 1F6E */
- {0x1FBA,0x1F70,0x0391}, {0x1FBB,0x1F71,0x1FBB}, /* 1F70 */
- {0x1FC8,0x1F72,0x0395}, {0x1FC9,0x1F73,0x1FC9}, /* 1F72 */
- {0x1FCA,0x1F74,0x0397}, {0x1FCB,0x1F75,0x1FCB}, /* 1F74 */
- {0x1FDA,0x1F76,0x0399}, {0x1FDB,0x1F77,0x1FDB}, /* 1F76 */
- {0x1FF8,0x1F78,0x039F}, {0x1FF9,0x1F79,0x1FF9}, /* 1F78 */
- {0x1FEA,0x1F7A,0x03A5}, {0x1FEB,0x1F7B,0x1FEB}, /* 1F7A */
- {0x1FFA,0x1F7C,0x03A9}, {0x1FFB,0x1F7D,0x1FFB}, /* 1F7C */
- {0x1F7E,0x1F7E,0x1F7E}, {0x1F7F,0x1F7F,0x1F7F}, /* 1F7E */
- {0x1F88,0x1F80,0x0391}, {0x1F89,0x1F81,0x0391}, /* 1F80 */
- {0x1F8A,0x1F82,0x0391}, {0x1F8B,0x1F83,0x0391}, /* 1F82 */
- {0x1F8C,0x1F84,0x0391}, {0x1F8D,0x1F85,0x0391}, /* 1F84 */
- {0x1F8E,0x1F86,0x0391}, {0x1F8F,0x1F87,0x0391}, /* 1F86 */
- {0x1F88,0x1F80,0x0391}, {0x1F89,0x1F81,0x0391}, /* 1F88 */
- {0x1F8A,0x1F82,0x0391}, {0x1F8B,0x1F83,0x0391}, /* 1F8A */
- {0x1F8C,0x1F84,0x0391}, {0x1F8D,0x1F85,0x0391}, /* 1F8C */
- {0x1F8E,0x1F86,0x0391}, {0x1F8F,0x1F87,0x0391}, /* 1F8E */
- {0x1F98,0x1F90,0x0397}, {0x1F99,0x1F91,0x0397}, /* 1F90 */
- {0x1F9A,0x1F92,0x0397}, {0x1F9B,0x1F93,0x0397}, /* 1F92 */
- {0x1F9C,0x1F94,0x0397}, {0x1F9D,0x1F95,0x0397}, /* 1F94 */
- {0x1F9E,0x1F96,0x0397}, {0x1F9F,0x1F97,0x0397}, /* 1F96 */
- {0x1F98,0x1F90,0x0397}, {0x1F99,0x1F91,0x0397}, /* 1F98 */
- {0x1F9A,0x1F92,0x0397}, {0x1F9B,0x1F93,0x0397}, /* 1F9A */
- {0x1F9C,0x1F94,0x0397}, {0x1F9D,0x1F95,0x0397}, /* 1F9C */
- {0x1F9E,0x1F96,0x0397}, {0x1F9F,0x1F97,0x0397}, /* 1F9E */
- {0x1FA8,0x1FA0,0x03A9}, {0x1FA9,0x1FA1,0x03A9}, /* 1FA0 */
- {0x1FAA,0x1FA2,0x03A9}, {0x1FAB,0x1FA3,0x03A9}, /* 1FA2 */
- {0x1FAC,0x1FA4,0x03A9}, {0x1FAD,0x1FA5,0x03A9}, /* 1FA4 */
- {0x1FAE,0x1FA6,0x03A9}, {0x1FAF,0x1FA7,0x03A9}, /* 1FA6 */
- {0x1FA8,0x1FA0,0x03A9}, {0x1FA9,0x1FA1,0x03A9}, /* 1FA8 */
- {0x1FAA,0x1FA2,0x03A9}, {0x1FAB,0x1FA3,0x03A9}, /* 1FAA */
- {0x1FAC,0x1FA4,0x03A9}, {0x1FAD,0x1FA5,0x03A9}, /* 1FAC */
- {0x1FAE,0x1FA6,0x03A9}, {0x1FAF,0x1FA7,0x03A9}, /* 1FAE */
- {0x1FB8,0x1FB0,0x0391}, {0x1FB9,0x1FB1,0x0391}, /* 1FB0 */
- {0x1FB2,0x1FB2,0x0391}, {0x1FBC,0x1FB3,0x0391}, /* 1FB2 */
- {0x1FB4,0x1FB4,0x0391}, {0x1FB5,0x1FB5,0x1FB5}, /* 1FB4 */
- {0x1FB6,0x1FB6,0x0391}, {0x1FB7,0x1FB7,0x0391}, /* 1FB6 */
- {0x1FB8,0x1FB0,0x0391}, {0x1FB9,0x1FB1,0x0391}, /* 1FB8 */
- {0x1FBA,0x1F70,0x0391}, {0x1FBB,0x1F71,0x1FBB}, /* 1FBA */
- {0x1FBC,0x1FB3,0x0391}, {0x1FBD,0x1FBD,0x1FBD}, /* 1FBC */
- {0x0399,0x1FBE,0x0399}, {0x1FBF,0x1FBF,0x1FBF}, /* 1FBE */
- {0x1FC0,0x1FC0,0x1FC0}, {0x1FC1,0x1FC1,0x1FC1}, /* 1FC0 */
- {0x1FC2,0x1FC2,0x0397}, {0x1FCC,0x1FC3,0x0397}, /* 1FC2 */
- {0x1FC4,0x1FC4,0x0397}, {0x1FC5,0x1FC5,0x1FC5}, /* 1FC4 */
- {0x1FC6,0x1FC6,0x0397}, {0x1FC7,0x1FC7,0x0397}, /* 1FC6 */
- {0x1FC8,0x1F72,0x0395}, {0x1FC9,0x1F73,0x1FC9}, /* 1FC8 */
- {0x1FCA,0x1F74,0x0397}, {0x1FCB,0x1F75,0x1FCB}, /* 1FCA */
- {0x1FCC,0x1FC3,0x0397}, {0x1FCD,0x1FCD,0x1FCD}, /* 1FCC */
- {0x1FCE,0x1FCE,0x1FCE}, {0x1FCF,0x1FCF,0x1FCF}, /* 1FCE */
- {0x1FD8,0x1FD0,0x0399}, {0x1FD9,0x1FD1,0x0399}, /* 1FD0 */
- {0x1FD2,0x1FD2,0x0399}, {0x1FD3,0x1FD3,0x1FD3}, /* 1FD2 */
- {0x1FD4,0x1FD4,0x1FD4}, {0x1FD5,0x1FD5,0x1FD5}, /* 1FD4 */
- {0x1FD6,0x1FD6,0x0399}, {0x1FD7,0x1FD7,0x0399}, /* 1FD6 */
- {0x1FD8,0x1FD0,0x0399}, {0x1FD9,0x1FD1,0x0399}, /* 1FD8 */
- {0x1FDA,0x1F76,0x0399}, {0x1FDB,0x1F77,0x1FDB}, /* 1FDA */
- {0x1FDC,0x1FDC,0x1FDC}, {0x1FDD,0x1FDD,0x1FDD}, /* 1FDC */
- {0x1FDE,0x1FDE,0x1FDE}, {0x1FDF,0x1FDF,0x1FDF}, /* 1FDE */
- {0x1FE8,0x1FE0,0x03A5}, {0x1FE9,0x1FE1,0x03A5}, /* 1FE0 */
- {0x1FE2,0x1FE2,0x03A5}, {0x1FE3,0x1FE3,0x1FE3}, /* 1FE2 */
- {0x1FE4,0x1FE4,0x03A1}, {0x1FEC,0x1FE5,0x03A1}, /* 1FE4 */
- {0x1FE6,0x1FE6,0x03A5}, {0x1FE7,0x1FE7,0x03A5}, /* 1FE6 */
- {0x1FE8,0x1FE0,0x03A5}, {0x1FE9,0x1FE1,0x03A5}, /* 1FE8 */
- {0x1FEA,0x1F7A,0x03A5}, {0x1FEB,0x1F7B,0x1FEB}, /* 1FEA */
- {0x1FEC,0x1FE5,0x03A1}, {0x1FED,0x1FED,0x1FED}, /* 1FEC */
- {0x1FEE,0x1FEE,0x1FEE}, {0x1FEF,0x1FEF,0x1FEF}, /* 1FEE */
- {0x1FF0,0x1FF0,0x1FF0}, {0x1FF1,0x1FF1,0x1FF1}, /* 1FF0 */
- {0x1FF2,0x1FF2,0x03A9}, {0x1FFC,0x1FF3,0x03A9}, /* 1FF2 */
- {0x1FF4,0x1FF4,0x03A9}, {0x1FF5,0x1FF5,0x1FF5}, /* 1FF4 */
- {0x1FF6,0x1FF6,0x03A9}, {0x1FF7,0x1FF7,0x03A9}, /* 1FF6 */
- {0x1FF8,0x1F78,0x039F}, {0x1FF9,0x1F79,0x1FF9}, /* 1FF8 */
- {0x1FFA,0x1F7C,0x03A9}, {0x1FFB,0x1F7D,0x1FFB}, /* 1FFA */
- {0x1FFC,0x1FF3,0x03A9}, {0x1FFD,0x1FFD,0x1FFD}, /* 1FFC */
- {0x1FFE,0x1FFE,0x1FFE}, {0x1FFF,0x1FFF,0x1FFF} /* 1FFE */
-};
-
-static MY_UNICASE_CHARACTER u520p21[]={
- {0x2100,0x2100,0x2100}, {0x2101,0x2101,0x2101}, /* 2100 */
- {0x2102,0x2102,0x2102}, {0x2103,0x2103,0x2103}, /* 2102 */
- {0x2104,0x2104,0x2104}, {0x2105,0x2105,0x2105}, /* 2104 */
- {0x2106,0x2106,0x2106}, {0x2107,0x2107,0x2107}, /* 2106 */
- {0x2108,0x2108,0x2108}, {0x2109,0x2109,0x2109}, /* 2108 */
- {0x210A,0x210A,0x210A}, {0x210B,0x210B,0x210B}, /* 210A */
- {0x210C,0x210C,0x210C}, {0x210D,0x210D,0x210D}, /* 210C */
- {0x210E,0x210E,0x210E}, {0x210F,0x210F,0x210F}, /* 210E */
- {0x2110,0x2110,0x2110}, {0x2111,0x2111,0x2111}, /* 2110 */
- {0x2112,0x2112,0x2112}, {0x2113,0x2113,0x2113}, /* 2112 */
- {0x2114,0x2114,0x2114}, {0x2115,0x2115,0x2115}, /* 2114 */
- {0x2116,0x2116,0x2116}, {0x2117,0x2117,0x2117}, /* 2116 */
- {0x2118,0x2118,0x2118}, {0x2119,0x2119,0x2119}, /* 2118 */
- {0x211A,0x211A,0x211A}, {0x211B,0x211B,0x211B}, /* 211A */
- {0x211C,0x211C,0x211C}, {0x211D,0x211D,0x211D}, /* 211C */
- {0x211E,0x211E,0x211E}, {0x211F,0x211F,0x211F}, /* 211E */
- {0x2120,0x2120,0x2120}, {0x2121,0x2121,0x2121}, /* 2120 */
- {0x2122,0x2122,0x2122}, {0x2123,0x2123,0x2123}, /* 2122 */
- {0x2124,0x2124,0x2124}, {0x2125,0x2125,0x2125}, /* 2124 */
- {0x2126,0x03C9,0x2126}, {0x2127,0x2127,0x2127}, /* 2126 */
- {0x2128,0x2128,0x2128}, {0x2129,0x2129,0x2129}, /* 2128 */
- {0x212A,0x006B,0x212A}, {0x212B,0x00E5,0x212B}, /* 212A */
- {0x212C,0x212C,0x212C}, {0x212D,0x212D,0x212D}, /* 212C */
- {0x212E,0x212E,0x212E}, {0x212F,0x212F,0x212F}, /* 212E */
- {0x2130,0x2130,0x2130}, {0x2131,0x2131,0x2131}, /* 2130 */
- {0x2132,0x214E,0x2132}, {0x2133,0x2133,0x2133}, /* 2132 */
- {0x2134,0x2134,0x2134}, {0x2135,0x2135,0x2135}, /* 2134 */
- {0x2136,0x2136,0x2136}, {0x2137,0x2137,0x2137}, /* 2136 */
- {0x2138,0x2138,0x2138}, {0x2139,0x2139,0x2139}, /* 2138 */
- {0x213A,0x213A,0x213A}, {0x213B,0x213B,0x213B}, /* 213A */
- {0x213C,0x213C,0x213C}, {0x213D,0x213D,0x213D}, /* 213C */
- {0x213E,0x213E,0x213E}, {0x213F,0x213F,0x213F}, /* 213E */
- {0x2140,0x2140,0x2140}, {0x2141,0x2141,0x2141}, /* 2140 */
- {0x2142,0x2142,0x2142}, {0x2143,0x2143,0x2143}, /* 2142 */
- {0x2144,0x2144,0x2144}, {0x2145,0x2145,0x2145}, /* 2144 */
- {0x2146,0x2146,0x2146}, {0x2147,0x2147,0x2147}, /* 2146 */
- {0x2148,0x2148,0x2148}, {0x2149,0x2149,0x2149}, /* 2148 */
- {0x214A,0x214A,0x214A}, {0x214B,0x214B,0x214B}, /* 214A */
- {0x214C,0x214C,0x214C}, {0x214D,0x214D,0x214D}, /* 214C */
- {0x2132,0x214E,0x2132}, {0x214F,0x214F,0x214F}, /* 214E */
- {0x2150,0x2150,0x2150}, {0x2151,0x2151,0x2151}, /* 2150 */
- {0x2152,0x2152,0x2152}, {0x2153,0x2153,0x2153}, /* 2152 */
- {0x2154,0x2154,0x2154}, {0x2155,0x2155,0x2155}, /* 2154 */
- {0x2156,0x2156,0x2156}, {0x2157,0x2157,0x2157}, /* 2156 */
- {0x2158,0x2158,0x2158}, {0x2159,0x2159,0x2159}, /* 2158 */
- {0x215A,0x215A,0x215A}, {0x215B,0x215B,0x215B}, /* 215A */
- {0x215C,0x215C,0x215C}, {0x215D,0x215D,0x215D}, /* 215C */
- {0x215E,0x215E,0x215E}, {0x215F,0x215F,0x215F}, /* 215E */
- {0x2160,0x2170,0x2160}, {0x2161,0x2171,0x2161}, /* 2160 */
- {0x2162,0x2172,0x2162}, {0x2163,0x2173,0x2163}, /* 2162 */
- {0x2164,0x2174,0x2164}, {0x2165,0x2175,0x2165}, /* 2164 */
- {0x2166,0x2176,0x2166}, {0x2167,0x2177,0x2167}, /* 2166 */
- {0x2168,0x2178,0x2168}, {0x2169,0x2179,0x2169}, /* 2168 */
- {0x216A,0x217A,0x216A}, {0x216B,0x217B,0x216B}, /* 216A */
- {0x216C,0x217C,0x216C}, {0x216D,0x217D,0x216D}, /* 216C */
- {0x216E,0x217E,0x216E}, {0x216F,0x217F,0x216F}, /* 216E */
- {0x2160,0x2170,0x2160}, {0x2161,0x2171,0x2161}, /* 2170 */
- {0x2162,0x2172,0x2162}, {0x2163,0x2173,0x2163}, /* 2172 */
- {0x2164,0x2174,0x2164}, {0x2165,0x2175,0x2165}, /* 2174 */
- {0x2166,0x2176,0x2166}, {0x2167,0x2177,0x2167}, /* 2176 */
- {0x2168,0x2178,0x2168}, {0x2169,0x2179,0x2169}, /* 2178 */
- {0x216A,0x217A,0x216A}, {0x216B,0x217B,0x216B}, /* 217A */
- {0x216C,0x217C,0x216C}, {0x216D,0x217D,0x216D}, /* 217C */
- {0x216E,0x217E,0x216E}, {0x216F,0x217F,0x216F}, /* 217E */
- {0x2180,0x2180,0x2180}, {0x2181,0x2181,0x2181}, /* 2180 */
- {0x2182,0x2182,0x2182}, {0x2183,0x2184,0x2183}, /* 2182 */
- {0x2183,0x2184,0x2183}, {0x2185,0x2185,0x2185}, /* 2184 */
- {0x2186,0x2186,0x2186}, {0x2187,0x2187,0x2187}, /* 2186 */
- {0x2188,0x2188,0x2188}, {0x2189,0x2189,0x2189}, /* 2188 */
- {0x218A,0x218A,0x218A}, {0x218B,0x218B,0x218B}, /* 218A */
- {0x218C,0x218C,0x218C}, {0x218D,0x218D,0x218D}, /* 218C */
- {0x218E,0x218E,0x218E}, {0x218F,0x218F,0x218F}, /* 218E */
- {0x2190,0x2190,0x2190}, {0x2191,0x2191,0x2191}, /* 2190 */
- {0x2192,0x2192,0x2192}, {0x2193,0x2193,0x2193}, /* 2192 */
- {0x2194,0x2194,0x2194}, {0x2195,0x2195,0x2195}, /* 2194 */
- {0x2196,0x2196,0x2196}, {0x2197,0x2197,0x2197}, /* 2196 */
- {0x2198,0x2198,0x2198}, {0x2199,0x2199,0x2199}, /* 2198 */
- {0x219A,0x219A,0x219A}, {0x219B,0x219B,0x219B}, /* 219A */
- {0x219C,0x219C,0x219C}, {0x219D,0x219D,0x219D}, /* 219C */
- {0x219E,0x219E,0x219E}, {0x219F,0x219F,0x219F}, /* 219E */
- {0x21A0,0x21A0,0x21A0}, {0x21A1,0x21A1,0x21A1}, /* 21A0 */
- {0x21A2,0x21A2,0x21A2}, {0x21A3,0x21A3,0x21A3}, /* 21A2 */
- {0x21A4,0x21A4,0x21A4}, {0x21A5,0x21A5,0x21A5}, /* 21A4 */
- {0x21A6,0x21A6,0x21A6}, {0x21A7,0x21A7,0x21A7}, /* 21A6 */
- {0x21A8,0x21A8,0x21A8}, {0x21A9,0x21A9,0x21A9}, /* 21A8 */
- {0x21AA,0x21AA,0x21AA}, {0x21AB,0x21AB,0x21AB}, /* 21AA */
- {0x21AC,0x21AC,0x21AC}, {0x21AD,0x21AD,0x21AD}, /* 21AC */
- {0x21AE,0x21AE,0x21AE}, {0x21AF,0x21AF,0x21AF}, /* 21AE */
- {0x21B0,0x21B0,0x21B0}, {0x21B1,0x21B1,0x21B1}, /* 21B0 */
- {0x21B2,0x21B2,0x21B2}, {0x21B3,0x21B3,0x21B3}, /* 21B2 */
- {0x21B4,0x21B4,0x21B4}, {0x21B5,0x21B5,0x21B5}, /* 21B4 */
- {0x21B6,0x21B6,0x21B6}, {0x21B7,0x21B7,0x21B7}, /* 21B6 */
- {0x21B8,0x21B8,0x21B8}, {0x21B9,0x21B9,0x21B9}, /* 21B8 */
- {0x21BA,0x21BA,0x21BA}, {0x21BB,0x21BB,0x21BB}, /* 21BA */
- {0x21BC,0x21BC,0x21BC}, {0x21BD,0x21BD,0x21BD}, /* 21BC */
- {0x21BE,0x21BE,0x21BE}, {0x21BF,0x21BF,0x21BF}, /* 21BE */
- {0x21C0,0x21C0,0x21C0}, {0x21C1,0x21C1,0x21C1}, /* 21C0 */
- {0x21C2,0x21C2,0x21C2}, {0x21C3,0x21C3,0x21C3}, /* 21C2 */
- {0x21C4,0x21C4,0x21C4}, {0x21C5,0x21C5,0x21C5}, /* 21C4 */
- {0x21C6,0x21C6,0x21C6}, {0x21C7,0x21C7,0x21C7}, /* 21C6 */
- {0x21C8,0x21C8,0x21C8}, {0x21C9,0x21C9,0x21C9}, /* 21C8 */
- {0x21CA,0x21CA,0x21CA}, {0x21CB,0x21CB,0x21CB}, /* 21CA */
- {0x21CC,0x21CC,0x21CC}, {0x21CD,0x21CD,0x21CD}, /* 21CC */
- {0x21CE,0x21CE,0x21CE}, {0x21CF,0x21CF,0x21CF}, /* 21CE */
- {0x21D0,0x21D0,0x21D0}, {0x21D1,0x21D1,0x21D1}, /* 21D0 */
- {0x21D2,0x21D2,0x21D2}, {0x21D3,0x21D3,0x21D3}, /* 21D2 */
- {0x21D4,0x21D4,0x21D4}, {0x21D5,0x21D5,0x21D5}, /* 21D4 */
- {0x21D6,0x21D6,0x21D6}, {0x21D7,0x21D7,0x21D7}, /* 21D6 */
- {0x21D8,0x21D8,0x21D8}, {0x21D9,0x21D9,0x21D9}, /* 21D8 */
- {0x21DA,0x21DA,0x21DA}, {0x21DB,0x21DB,0x21DB}, /* 21DA */
- {0x21DC,0x21DC,0x21DC}, {0x21DD,0x21DD,0x21DD}, /* 21DC */
- {0x21DE,0x21DE,0x21DE}, {0x21DF,0x21DF,0x21DF}, /* 21DE */
- {0x21E0,0x21E0,0x21E0}, {0x21E1,0x21E1,0x21E1}, /* 21E0 */
- {0x21E2,0x21E2,0x21E2}, {0x21E3,0x21E3,0x21E3}, /* 21E2 */
- {0x21E4,0x21E4,0x21E4}, {0x21E5,0x21E5,0x21E5}, /* 21E4 */
- {0x21E6,0x21E6,0x21E6}, {0x21E7,0x21E7,0x21E7}, /* 21E6 */
- {0x21E8,0x21E8,0x21E8}, {0x21E9,0x21E9,0x21E9}, /* 21E8 */
- {0x21EA,0x21EA,0x21EA}, {0x21EB,0x21EB,0x21EB}, /* 21EA */
- {0x21EC,0x21EC,0x21EC}, {0x21ED,0x21ED,0x21ED}, /* 21EC */
- {0x21EE,0x21EE,0x21EE}, {0x21EF,0x21EF,0x21EF}, /* 21EE */
- {0x21F0,0x21F0,0x21F0}, {0x21F1,0x21F1,0x21F1}, /* 21F0 */
- {0x21F2,0x21F2,0x21F2}, {0x21F3,0x21F3,0x21F3}, /* 21F2 */
- {0x21F4,0x21F4,0x21F4}, {0x21F5,0x21F5,0x21F5}, /* 21F4 */
- {0x21F6,0x21F6,0x21F6}, {0x21F7,0x21F7,0x21F7}, /* 21F6 */
- {0x21F8,0x21F8,0x21F8}, {0x21F9,0x21F9,0x21F9}, /* 21F8 */
- {0x21FA,0x21FA,0x21FA}, {0x21FB,0x21FB,0x21FB}, /* 21FA */
- {0x21FC,0x21FC,0x21FC}, {0x21FD,0x21FD,0x21FD}, /* 21FC */
- {0x21FE,0x21FE,0x21FE}, {0x21FF,0x21FF,0x21FF} /* 21FE */
-};
-
-static MY_UNICASE_CHARACTER u520p24[]={
- {0x2400,0x2400,0x2400}, {0x2401,0x2401,0x2401}, /* 2400 */
- {0x2402,0x2402,0x2402}, {0x2403,0x2403,0x2403}, /* 2402 */
- {0x2404,0x2404,0x2404}, {0x2405,0x2405,0x2405}, /* 2404 */
- {0x2406,0x2406,0x2406}, {0x2407,0x2407,0x2407}, /* 2406 */
- {0x2408,0x2408,0x2408}, {0x2409,0x2409,0x2409}, /* 2408 */
- {0x240A,0x240A,0x240A}, {0x240B,0x240B,0x240B}, /* 240A */
- {0x240C,0x240C,0x240C}, {0x240D,0x240D,0x240D}, /* 240C */
- {0x240E,0x240E,0x240E}, {0x240F,0x240F,0x240F}, /* 240E */
- {0x2410,0x2410,0x2410}, {0x2411,0x2411,0x2411}, /* 2410 */
- {0x2412,0x2412,0x2412}, {0x2413,0x2413,0x2413}, /* 2412 */
- {0x2414,0x2414,0x2414}, {0x2415,0x2415,0x2415}, /* 2414 */
- {0x2416,0x2416,0x2416}, {0x2417,0x2417,0x2417}, /* 2416 */
- {0x2418,0x2418,0x2418}, {0x2419,0x2419,0x2419}, /* 2418 */
- {0x241A,0x241A,0x241A}, {0x241B,0x241B,0x241B}, /* 241A */
- {0x241C,0x241C,0x241C}, {0x241D,0x241D,0x241D}, /* 241C */
- {0x241E,0x241E,0x241E}, {0x241F,0x241F,0x241F}, /* 241E */
- {0x2420,0x2420,0x2420}, {0x2421,0x2421,0x2421}, /* 2420 */
- {0x2422,0x2422,0x2422}, {0x2423,0x2423,0x2423}, /* 2422 */
- {0x2424,0x2424,0x2424}, {0x2425,0x2425,0x2425}, /* 2424 */
- {0x2426,0x2426,0x2426}, {0x2427,0x2427,0x2427}, /* 2426 */
- {0x2428,0x2428,0x2428}, {0x2429,0x2429,0x2429}, /* 2428 */
- {0x242A,0x242A,0x242A}, {0x242B,0x242B,0x242B}, /* 242A */
- {0x242C,0x242C,0x242C}, {0x242D,0x242D,0x242D}, /* 242C */
- {0x242E,0x242E,0x242E}, {0x242F,0x242F,0x242F}, /* 242E */
- {0x2430,0x2430,0x2430}, {0x2431,0x2431,0x2431}, /* 2430 */
- {0x2432,0x2432,0x2432}, {0x2433,0x2433,0x2433}, /* 2432 */
- {0x2434,0x2434,0x2434}, {0x2435,0x2435,0x2435}, /* 2434 */
- {0x2436,0x2436,0x2436}, {0x2437,0x2437,0x2437}, /* 2436 */
- {0x2438,0x2438,0x2438}, {0x2439,0x2439,0x2439}, /* 2438 */
- {0x243A,0x243A,0x243A}, {0x243B,0x243B,0x243B}, /* 243A */
- {0x243C,0x243C,0x243C}, {0x243D,0x243D,0x243D}, /* 243C */
- {0x243E,0x243E,0x243E}, {0x243F,0x243F,0x243F}, /* 243E */
- {0x2440,0x2440,0x2440}, {0x2441,0x2441,0x2441}, /* 2440 */
- {0x2442,0x2442,0x2442}, {0x2443,0x2443,0x2443}, /* 2442 */
- {0x2444,0x2444,0x2444}, {0x2445,0x2445,0x2445}, /* 2444 */
- {0x2446,0x2446,0x2446}, {0x2447,0x2447,0x2447}, /* 2446 */
- {0x2448,0x2448,0x2448}, {0x2449,0x2449,0x2449}, /* 2448 */
- {0x244A,0x244A,0x244A}, {0x244B,0x244B,0x244B}, /* 244A */
- {0x244C,0x244C,0x244C}, {0x244D,0x244D,0x244D}, /* 244C */
- {0x244E,0x244E,0x244E}, {0x244F,0x244F,0x244F}, /* 244E */
- {0x2450,0x2450,0x2450}, {0x2451,0x2451,0x2451}, /* 2450 */
- {0x2452,0x2452,0x2452}, {0x2453,0x2453,0x2453}, /* 2452 */
- {0x2454,0x2454,0x2454}, {0x2455,0x2455,0x2455}, /* 2454 */
- {0x2456,0x2456,0x2456}, {0x2457,0x2457,0x2457}, /* 2456 */
- {0x2458,0x2458,0x2458}, {0x2459,0x2459,0x2459}, /* 2458 */
- {0x245A,0x245A,0x245A}, {0x245B,0x245B,0x245B}, /* 245A */
- {0x245C,0x245C,0x245C}, {0x245D,0x245D,0x245D}, /* 245C */
- {0x245E,0x245E,0x245E}, {0x245F,0x245F,0x245F}, /* 245E */
- {0x2460,0x2460,0x2460}, {0x2461,0x2461,0x2461}, /* 2460 */
- {0x2462,0x2462,0x2462}, {0x2463,0x2463,0x2463}, /* 2462 */
- {0x2464,0x2464,0x2464}, {0x2465,0x2465,0x2465}, /* 2464 */
- {0x2466,0x2466,0x2466}, {0x2467,0x2467,0x2467}, /* 2466 */
- {0x2468,0x2468,0x2468}, {0x2469,0x2469,0x2469}, /* 2468 */
- {0x246A,0x246A,0x246A}, {0x246B,0x246B,0x246B}, /* 246A */
- {0x246C,0x246C,0x246C}, {0x246D,0x246D,0x246D}, /* 246C */
- {0x246E,0x246E,0x246E}, {0x246F,0x246F,0x246F}, /* 246E */
- {0x2470,0x2470,0x2470}, {0x2471,0x2471,0x2471}, /* 2470 */
- {0x2472,0x2472,0x2472}, {0x2473,0x2473,0x2473}, /* 2472 */
- {0x2474,0x2474,0x2474}, {0x2475,0x2475,0x2475}, /* 2474 */
- {0x2476,0x2476,0x2476}, {0x2477,0x2477,0x2477}, /* 2476 */
- {0x2478,0x2478,0x2478}, {0x2479,0x2479,0x2479}, /* 2478 */
- {0x247A,0x247A,0x247A}, {0x247B,0x247B,0x247B}, /* 247A */
- {0x247C,0x247C,0x247C}, {0x247D,0x247D,0x247D}, /* 247C */
- {0x247E,0x247E,0x247E}, {0x247F,0x247F,0x247F}, /* 247E */
- {0x2480,0x2480,0x2480}, {0x2481,0x2481,0x2481}, /* 2480 */
- {0x2482,0x2482,0x2482}, {0x2483,0x2483,0x2483}, /* 2482 */
- {0x2484,0x2484,0x2484}, {0x2485,0x2485,0x2485}, /* 2484 */
- {0x2486,0x2486,0x2486}, {0x2487,0x2487,0x2487}, /* 2486 */
- {0x2488,0x2488,0x2488}, {0x2489,0x2489,0x2489}, /* 2488 */
- {0x248A,0x248A,0x248A}, {0x248B,0x248B,0x248B}, /* 248A */
- {0x248C,0x248C,0x248C}, {0x248D,0x248D,0x248D}, /* 248C */
- {0x248E,0x248E,0x248E}, {0x248F,0x248F,0x248F}, /* 248E */
- {0x2490,0x2490,0x2490}, {0x2491,0x2491,0x2491}, /* 2490 */
- {0x2492,0x2492,0x2492}, {0x2493,0x2493,0x2493}, /* 2492 */
- {0x2494,0x2494,0x2494}, {0x2495,0x2495,0x2495}, /* 2494 */
- {0x2496,0x2496,0x2496}, {0x2497,0x2497,0x2497}, /* 2496 */
- {0x2498,0x2498,0x2498}, {0x2499,0x2499,0x2499}, /* 2498 */
- {0x249A,0x249A,0x249A}, {0x249B,0x249B,0x249B}, /* 249A */
- {0x249C,0x249C,0x249C}, {0x249D,0x249D,0x249D}, /* 249C */
- {0x249E,0x249E,0x249E}, {0x249F,0x249F,0x249F}, /* 249E */
- {0x24A0,0x24A0,0x24A0}, {0x24A1,0x24A1,0x24A1}, /* 24A0 */
- {0x24A2,0x24A2,0x24A2}, {0x24A3,0x24A3,0x24A3}, /* 24A2 */
- {0x24A4,0x24A4,0x24A4}, {0x24A5,0x24A5,0x24A5}, /* 24A4 */
- {0x24A6,0x24A6,0x24A6}, {0x24A7,0x24A7,0x24A7}, /* 24A6 */
- {0x24A8,0x24A8,0x24A8}, {0x24A9,0x24A9,0x24A9}, /* 24A8 */
- {0x24AA,0x24AA,0x24AA}, {0x24AB,0x24AB,0x24AB}, /* 24AA */
- {0x24AC,0x24AC,0x24AC}, {0x24AD,0x24AD,0x24AD}, /* 24AC */
- {0x24AE,0x24AE,0x24AE}, {0x24AF,0x24AF,0x24AF}, /* 24AE */
- {0x24B0,0x24B0,0x24B0}, {0x24B1,0x24B1,0x24B1}, /* 24B0 */
- {0x24B2,0x24B2,0x24B2}, {0x24B3,0x24B3,0x24B3}, /* 24B2 */
- {0x24B4,0x24B4,0x24B4}, {0x24B5,0x24B5,0x24B5}, /* 24B4 */
- {0x24B6,0x24D0,0x24B6}, {0x24B7,0x24D1,0x24B7}, /* 24B6 */
- {0x24B8,0x24D2,0x24B8}, {0x24B9,0x24D3,0x24B9}, /* 24B8 */
- {0x24BA,0x24D4,0x24BA}, {0x24BB,0x24D5,0x24BB}, /* 24BA */
- {0x24BC,0x24D6,0x24BC}, {0x24BD,0x24D7,0x24BD}, /* 24BC */
- {0x24BE,0x24D8,0x24BE}, {0x24BF,0x24D9,0x24BF}, /* 24BE */
- {0x24C0,0x24DA,0x24C0}, {0x24C1,0x24DB,0x24C1}, /* 24C0 */
- {0x24C2,0x24DC,0x24C2}, {0x24C3,0x24DD,0x24C3}, /* 24C2 */
- {0x24C4,0x24DE,0x24C4}, {0x24C5,0x24DF,0x24C5}, /* 24C4 */
- {0x24C6,0x24E0,0x24C6}, {0x24C7,0x24E1,0x24C7}, /* 24C6 */
- {0x24C8,0x24E2,0x24C8}, {0x24C9,0x24E3,0x24C9}, /* 24C8 */
- {0x24CA,0x24E4,0x24CA}, {0x24CB,0x24E5,0x24CB}, /* 24CA */
- {0x24CC,0x24E6,0x24CC}, {0x24CD,0x24E7,0x24CD}, /* 24CC */
- {0x24CE,0x24E8,0x24CE}, {0x24CF,0x24E9,0x24CF}, /* 24CE */
- {0x24B6,0x24D0,0x24B6}, {0x24B7,0x24D1,0x24B7}, /* 24D0 */
- {0x24B8,0x24D2,0x24B8}, {0x24B9,0x24D3,0x24B9}, /* 24D2 */
- {0x24BA,0x24D4,0x24BA}, {0x24BB,0x24D5,0x24BB}, /* 24D4 */
- {0x24BC,0x24D6,0x24BC}, {0x24BD,0x24D7,0x24BD}, /* 24D6 */
- {0x24BE,0x24D8,0x24BE}, {0x24BF,0x24D9,0x24BF}, /* 24D8 */
- {0x24C0,0x24DA,0x24C0}, {0x24C1,0x24DB,0x24C1}, /* 24DA */
- {0x24C2,0x24DC,0x24C2}, {0x24C3,0x24DD,0x24C3}, /* 24DC */
- {0x24C4,0x24DE,0x24C4}, {0x24C5,0x24DF,0x24C5}, /* 24DE */
- {0x24C6,0x24E0,0x24C6}, {0x24C7,0x24E1,0x24C7}, /* 24E0 */
- {0x24C8,0x24E2,0x24C8}, {0x24C9,0x24E3,0x24C9}, /* 24E2 */
- {0x24CA,0x24E4,0x24CA}, {0x24CB,0x24E5,0x24CB}, /* 24E4 */
- {0x24CC,0x24E6,0x24CC}, {0x24CD,0x24E7,0x24CD}, /* 24E6 */
- {0x24CE,0x24E8,0x24CE}, {0x24CF,0x24E9,0x24CF}, /* 24E8 */
- {0x24EA,0x24EA,0x24EA}, {0x24EB,0x24EB,0x24EB}, /* 24EA */
- {0x24EC,0x24EC,0x24EC}, {0x24ED,0x24ED,0x24ED}, /* 24EC */
- {0x24EE,0x24EE,0x24EE}, {0x24EF,0x24EF,0x24EF}, /* 24EE */
- {0x24F0,0x24F0,0x24F0}, {0x24F1,0x24F1,0x24F1}, /* 24F0 */
- {0x24F2,0x24F2,0x24F2}, {0x24F3,0x24F3,0x24F3}, /* 24F2 */
- {0x24F4,0x24F4,0x24F4}, {0x24F5,0x24F5,0x24F5}, /* 24F4 */
- {0x24F6,0x24F6,0x24F6}, {0x24F7,0x24F7,0x24F7}, /* 24F6 */
- {0x24F8,0x24F8,0x24F8}, {0x24F9,0x24F9,0x24F9}, /* 24F8 */
- {0x24FA,0x24FA,0x24FA}, {0x24FB,0x24FB,0x24FB}, /* 24FA */
- {0x24FC,0x24FC,0x24FC}, {0x24FD,0x24FD,0x24FD}, /* 24FC */
- {0x24FE,0x24FE,0x24FE}, {0x24FF,0x24FF,0x24FF} /* 24FE */
-};
-
-static MY_UNICASE_CHARACTER u520p2C[]={
- {0x2C00,0x2C30,0x2C00}, {0x2C01,0x2C31,0x2C01}, /* 2C00 */
- {0x2C02,0x2C32,0x2C02}, {0x2C03,0x2C33,0x2C03}, /* 2C02 */
- {0x2C04,0x2C34,0x2C04}, {0x2C05,0x2C35,0x2C05}, /* 2C04 */
- {0x2C06,0x2C36,0x2C06}, {0x2C07,0x2C37,0x2C07}, /* 2C06 */
- {0x2C08,0x2C38,0x2C08}, {0x2C09,0x2C39,0x2C09}, /* 2C08 */
- {0x2C0A,0x2C3A,0x2C0A}, {0x2C0B,0x2C3B,0x2C0B}, /* 2C0A */
- {0x2C0C,0x2C3C,0x2C0C}, {0x2C0D,0x2C3D,0x2C0D}, /* 2C0C */
- {0x2C0E,0x2C3E,0x2C0E}, {0x2C0F,0x2C3F,0x2C0F}, /* 2C0E */
- {0x2C10,0x2C40,0x2C10}, {0x2C11,0x2C41,0x2C11}, /* 2C10 */
- {0x2C12,0x2C42,0x2C12}, {0x2C13,0x2C43,0x2C13}, /* 2C12 */
- {0x2C14,0x2C44,0x2C14}, {0x2C15,0x2C45,0x2C15}, /* 2C14 */
- {0x2C16,0x2C46,0x2C16}, {0x2C17,0x2C47,0x2C17}, /* 2C16 */
- {0x2C18,0x2C48,0x2C18}, {0x2C19,0x2C49,0x2C19}, /* 2C18 */
- {0x2C1A,0x2C4A,0x2C1A}, {0x2C1B,0x2C4B,0x2C1B}, /* 2C1A */
- {0x2C1C,0x2C4C,0x2C1C}, {0x2C1D,0x2C4D,0x2C1D}, /* 2C1C */
- {0x2C1E,0x2C4E,0x2C1E}, {0x2C1F,0x2C4F,0x2C1F}, /* 2C1E */
- {0x2C20,0x2C50,0x2C20}, {0x2C21,0x2C51,0x2C21}, /* 2C20 */
- {0x2C22,0x2C52,0x2C22}, {0x2C23,0x2C53,0x2C23}, /* 2C22 */
- {0x2C24,0x2C54,0x2C24}, {0x2C25,0x2C55,0x2C25}, /* 2C24 */
- {0x2C26,0x2C56,0x2C26}, {0x2C27,0x2C57,0x2C27}, /* 2C26 */
- {0x2C28,0x2C58,0x2C28}, {0x2C29,0x2C59,0x2C29}, /* 2C28 */
- {0x2C2A,0x2C5A,0x2C2A}, {0x2C2B,0x2C5B,0x2C2B}, /* 2C2A */
- {0x2C2C,0x2C5C,0x2C2C}, {0x2C2D,0x2C5D,0x2C2D}, /* 2C2C */
- {0x2C2E,0x2C5E,0x2C2E}, {0x2C2F,0x2C2F,0x2C2F}, /* 2C2E */
- {0x2C00,0x2C30,0x2C00}, {0x2C01,0x2C31,0x2C01}, /* 2C30 */
- {0x2C02,0x2C32,0x2C02}, {0x2C03,0x2C33,0x2C03}, /* 2C32 */
- {0x2C04,0x2C34,0x2C04}, {0x2C05,0x2C35,0x2C05}, /* 2C34 */
- {0x2C06,0x2C36,0x2C06}, {0x2C07,0x2C37,0x2C07}, /* 2C36 */
- {0x2C08,0x2C38,0x2C08}, {0x2C09,0x2C39,0x2C09}, /* 2C38 */
- {0x2C0A,0x2C3A,0x2C0A}, {0x2C0B,0x2C3B,0x2C0B}, /* 2C3A */
- {0x2C0C,0x2C3C,0x2C0C}, {0x2C0D,0x2C3D,0x2C0D}, /* 2C3C */
- {0x2C0E,0x2C3E,0x2C0E}, {0x2C0F,0x2C3F,0x2C0F}, /* 2C3E */
- {0x2C10,0x2C40,0x2C10}, {0x2C11,0x2C41,0x2C11}, /* 2C40 */
- {0x2C12,0x2C42,0x2C12}, {0x2C13,0x2C43,0x2C13}, /* 2C42 */
- {0x2C14,0x2C44,0x2C14}, {0x2C15,0x2C45,0x2C15}, /* 2C44 */
- {0x2C16,0x2C46,0x2C16}, {0x2C17,0x2C47,0x2C17}, /* 2C46 */
- {0x2C18,0x2C48,0x2C18}, {0x2C19,0x2C49,0x2C19}, /* 2C48 */
- {0x2C1A,0x2C4A,0x2C1A}, {0x2C1B,0x2C4B,0x2C1B}, /* 2C4A */
- {0x2C1C,0x2C4C,0x2C1C}, {0x2C1D,0x2C4D,0x2C1D}, /* 2C4C */
- {0x2C1E,0x2C4E,0x2C1E}, {0x2C1F,0x2C4F,0x2C1F}, /* 2C4E */
- {0x2C20,0x2C50,0x2C20}, {0x2C21,0x2C51,0x2C21}, /* 2C50 */
- {0x2C22,0x2C52,0x2C22}, {0x2C23,0x2C53,0x2C23}, /* 2C52 */
- {0x2C24,0x2C54,0x2C24}, {0x2C25,0x2C55,0x2C25}, /* 2C54 */
- {0x2C26,0x2C56,0x2C26}, {0x2C27,0x2C57,0x2C27}, /* 2C56 */
- {0x2C28,0x2C58,0x2C28}, {0x2C29,0x2C59,0x2C29}, /* 2C58 */
- {0x2C2A,0x2C5A,0x2C2A}, {0x2C2B,0x2C5B,0x2C2B}, /* 2C5A */
- {0x2C2C,0x2C5C,0x2C2C}, {0x2C2D,0x2C5D,0x2C2D}, /* 2C5C */
- {0x2C2E,0x2C5E,0x2C2E}, {0x2C5F,0x2C5F,0x2C5F}, /* 2C5E */
- {0x2C60,0x2C61,0x2C60}, {0x2C60,0x2C61,0x2C60}, /* 2C60 */
- {0x2C62,0x026B,0x2C62}, {0x2C63,0x1D7D,0x2C63}, /* 2C62 */
- {0x2C64,0x027D,0x2C64}, {0x023A,0x2C65,0x023A}, /* 2C64 */
- {0x023E,0x2C66,0x023E}, {0x2C67,0x2C68,0x2C67}, /* 2C66 */
- {0x2C67,0x2C68,0x2C67}, {0x2C69,0x2C6A,0x2C69}, /* 2C68 */
- {0x2C69,0x2C6A,0x2C69}, {0x2C6B,0x2C6C,0x2C6B}, /* 2C6A */
- {0x2C6B,0x2C6C,0x2C6B}, {0x2C6D,0x0251,0x2C6D}, /* 2C6C */
- {0x2C6E,0x0271,0x2C6E}, {0x2C6F,0x0250,0x2C6F}, /* 2C6E */
- {0x2C70,0x0252,0x2C70}, {0x2C71,0x2C71,0x2C71}, /* 2C70 */
- {0x2C72,0x2C73,0x2C72}, {0x2C72,0x2C73,0x2C72}, /* 2C72 */
- {0x2C74,0x2C74,0x2C74}, {0x2C75,0x2C76,0x2C75}, /* 2C74 */
- {0x2C75,0x2C76,0x2C75}, {0x2C77,0x2C77,0x2C77}, /* 2C76 */
- {0x2C78,0x2C78,0x2C78}, {0x2C79,0x2C79,0x2C79}, /* 2C78 */
- {0x2C7A,0x2C7A,0x2C7A}, {0x2C7B,0x2C7B,0x2C7B}, /* 2C7A */
- {0x2C7C,0x2C7C,0x2C7C}, {0x2C7D,0x2C7D,0x2C7D}, /* 2C7C */
- {0x2C7E,0x023F,0x2C7E}, {0x2C7F,0x0240,0x2C7F}, /* 2C7E */
- {0x2C80,0x2C81,0x2C80}, {0x2C80,0x2C81,0x2C80}, /* 2C80 */
- {0x2C82,0x2C83,0x2C82}, {0x2C82,0x2C83,0x2C82}, /* 2C82 */
- {0x2C84,0x2C85,0x2C84}, {0x2C84,0x2C85,0x2C84}, /* 2C84 */
- {0x2C86,0x2C87,0x2C86}, {0x2C86,0x2C87,0x2C86}, /* 2C86 */
- {0x2C88,0x2C89,0x2C88}, {0x2C88,0x2C89,0x2C88}, /* 2C88 */
- {0x2C8A,0x2C8B,0x2C8A}, {0x2C8A,0x2C8B,0x2C8A}, /* 2C8A */
- {0x2C8C,0x2C8D,0x2C8C}, {0x2C8C,0x2C8D,0x2C8C}, /* 2C8C */
- {0x2C8E,0x2C8F,0x2C8E}, {0x2C8E,0x2C8F,0x2C8E}, /* 2C8E */
- {0x2C90,0x2C91,0x2C90}, {0x2C90,0x2C91,0x2C90}, /* 2C90 */
- {0x2C92,0x2C93,0x2C92}, {0x2C92,0x2C93,0x2C92}, /* 2C92 */
- {0x2C94,0x2C95,0x2C94}, {0x2C94,0x2C95,0x2C94}, /* 2C94 */
- {0x2C96,0x2C97,0x2C96}, {0x2C96,0x2C97,0x2C96}, /* 2C96 */
- {0x2C98,0x2C99,0x2C98}, {0x2C98,0x2C99,0x2C98}, /* 2C98 */
- {0x2C9A,0x2C9B,0x2C9A}, {0x2C9A,0x2C9B,0x2C9A}, /* 2C9A */
- {0x2C9C,0x2C9D,0x2C9C}, {0x2C9C,0x2C9D,0x2C9C}, /* 2C9C */
- {0x2C9E,0x2C9F,0x2C9E}, {0x2C9E,0x2C9F,0x2C9E}, /* 2C9E */
- {0x2CA0,0x2CA1,0x2CA0}, {0x2CA0,0x2CA1,0x2CA0}, /* 2CA0 */
- {0x2CA2,0x2CA3,0x2CA2}, {0x2CA2,0x2CA3,0x2CA2}, /* 2CA2 */
- {0x2CA4,0x2CA5,0x2CA4}, {0x2CA4,0x2CA5,0x2CA4}, /* 2CA4 */
- {0x2CA6,0x2CA7,0x2CA6}, {0x2CA6,0x2CA7,0x2CA6}, /* 2CA6 */
- {0x2CA8,0x2CA9,0x2CA8}, {0x2CA8,0x2CA9,0x2CA8}, /* 2CA8 */
- {0x2CAA,0x2CAB,0x2CAA}, {0x2CAA,0x2CAB,0x2CAA}, /* 2CAA */
- {0x2CAC,0x2CAD,0x2CAC}, {0x2CAC,0x2CAD,0x2CAC}, /* 2CAC */
- {0x2CAE,0x2CAF,0x2CAE}, {0x2CAE,0x2CAF,0x2CAE}, /* 2CAE */
- {0x2CB0,0x2CB1,0x2CB0}, {0x2CB0,0x2CB1,0x2CB0}, /* 2CB0 */
- {0x2CB2,0x2CB3,0x2CB2}, {0x2CB2,0x2CB3,0x2CB2}, /* 2CB2 */
- {0x2CB4,0x2CB5,0x2CB4}, {0x2CB4,0x2CB5,0x2CB4}, /* 2CB4 */
- {0x2CB6,0x2CB7,0x2CB6}, {0x2CB6,0x2CB7,0x2CB6}, /* 2CB6 */
- {0x2CB8,0x2CB9,0x2CB8}, {0x2CB8,0x2CB9,0x2CB8}, /* 2CB8 */
- {0x2CBA,0x2CBB,0x2CBA}, {0x2CBA,0x2CBB,0x2CBA}, /* 2CBA */
- {0x2CBC,0x2CBD,0x2CBC}, {0x2CBC,0x2CBD,0x2CBC}, /* 2CBC */
- {0x2CBE,0x2CBF,0x2CBE}, {0x2CBE,0x2CBF,0x2CBE}, /* 2CBE */
- {0x2CC0,0x2CC1,0x2CC0}, {0x2CC0,0x2CC1,0x2CC0}, /* 2CC0 */
- {0x2CC2,0x2CC3,0x2CC2}, {0x2CC2,0x2CC3,0x2CC2}, /* 2CC2 */
- {0x2CC4,0x2CC5,0x2CC4}, {0x2CC4,0x2CC5,0x2CC4}, /* 2CC4 */
- {0x2CC6,0x2CC7,0x2CC6}, {0x2CC6,0x2CC7,0x2CC6}, /* 2CC6 */
- {0x2CC8,0x2CC9,0x2CC8}, {0x2CC8,0x2CC9,0x2CC8}, /* 2CC8 */
- {0x2CCA,0x2CCB,0x2CCA}, {0x2CCA,0x2CCB,0x2CCA}, /* 2CCA */
- {0x2CCC,0x2CCD,0x2CCC}, {0x2CCC,0x2CCD,0x2CCC}, /* 2CCC */
- {0x2CCE,0x2CCF,0x2CCE}, {0x2CCE,0x2CCF,0x2CCE}, /* 2CCE */
- {0x2CD0,0x2CD1,0x2CD0}, {0x2CD0,0x2CD1,0x2CD0}, /* 2CD0 */
- {0x2CD2,0x2CD3,0x2CD2}, {0x2CD2,0x2CD3,0x2CD2}, /* 2CD2 */
- {0x2CD4,0x2CD5,0x2CD4}, {0x2CD4,0x2CD5,0x2CD4}, /* 2CD4 */
- {0x2CD6,0x2CD7,0x2CD6}, {0x2CD6,0x2CD7,0x2CD6}, /* 2CD6 */
- {0x2CD8,0x2CD9,0x2CD8}, {0x2CD8,0x2CD9,0x2CD8}, /* 2CD8 */
- {0x2CDA,0x2CDB,0x2CDA}, {0x2CDA,0x2CDB,0x2CDA}, /* 2CDA */
- {0x2CDC,0x2CDD,0x2CDC}, {0x2CDC,0x2CDD,0x2CDC}, /* 2CDC */
- {0x2CDE,0x2CDF,0x2CDE}, {0x2CDE,0x2CDF,0x2CDE}, /* 2CDE */
- {0x2CE0,0x2CE1,0x2CE0}, {0x2CE0,0x2CE1,0x2CE0}, /* 2CE0 */
- {0x2CE2,0x2CE3,0x2CE2}, {0x2CE2,0x2CE3,0x2CE2}, /* 2CE2 */
- {0x2CE4,0x2CE4,0x2CE4}, {0x2CE5,0x2CE5,0x2CE5}, /* 2CE4 */
- {0x2CE6,0x2CE6,0x2CE6}, {0x2CE7,0x2CE7,0x2CE7}, /* 2CE6 */
- {0x2CE8,0x2CE8,0x2CE8}, {0x2CE9,0x2CE9,0x2CE9}, /* 2CE8 */
- {0x2CEA,0x2CEA,0x2CEA}, {0x2CEB,0x2CEC,0x2CEB}, /* 2CEA */
- {0x2CEB,0x2CEC,0x2CEB}, {0x2CED,0x2CEE,0x2CED}, /* 2CEC */
- {0x2CED,0x2CEE,0x2CED}, {0x2CEF,0x2CEF,0x2CEF}, /* 2CEE */
- {0x2CF0,0x2CF0,0x2CF0}, {0x2CF1,0x2CF1,0x2CF1}, /* 2CF0 */
- {0x2CF2,0x2CF2,0x2CF2}, {0x2CF3,0x2CF3,0x2CF3}, /* 2CF2 */
- {0x2CF4,0x2CF4,0x2CF4}, {0x2CF5,0x2CF5,0x2CF5}, /* 2CF4 */
- {0x2CF6,0x2CF6,0x2CF6}, {0x2CF7,0x2CF7,0x2CF7}, /* 2CF6 */
- {0x2CF8,0x2CF8,0x2CF8}, {0x2CF9,0x2CF9,0x2CF9}, /* 2CF8 */
- {0x2CFA,0x2CFA,0x2CFA}, {0x2CFB,0x2CFB,0x2CFB}, /* 2CFA */
- {0x2CFC,0x2CFC,0x2CFC}, {0x2CFD,0x2CFD,0x2CFD}, /* 2CFC */
- {0x2CFE,0x2CFE,0x2CFE}, {0x2CFF,0x2CFF,0x2CFF} /* 2CFE */
-};
-
-static MY_UNICASE_CHARACTER u520p2D[]={
- {0x10A0,0x2D00,0x10A0}, {0x10A1,0x2D01,0x10A1}, /* 2D00 */
- {0x10A2,0x2D02,0x10A2}, {0x10A3,0x2D03,0x10A3}, /* 2D02 */
- {0x10A4,0x2D04,0x10A4}, {0x10A5,0x2D05,0x10A5}, /* 2D04 */
- {0x10A6,0x2D06,0x10A6}, {0x10A7,0x2D07,0x10A7}, /* 2D06 */
- {0x10A8,0x2D08,0x10A8}, {0x10A9,0x2D09,0x10A9}, /* 2D08 */
- {0x10AA,0x2D0A,0x10AA}, {0x10AB,0x2D0B,0x10AB}, /* 2D0A */
- {0x10AC,0x2D0C,0x10AC}, {0x10AD,0x2D0D,0x10AD}, /* 2D0C */
- {0x10AE,0x2D0E,0x10AE}, {0x10AF,0x2D0F,0x10AF}, /* 2D0E */
- {0x10B0,0x2D10,0x10B0}, {0x10B1,0x2D11,0x10B1}, /* 2D10 */
- {0x10B2,0x2D12,0x10B2}, {0x10B3,0x2D13,0x10B3}, /* 2D12 */
- {0x10B4,0x2D14,0x10B4}, {0x10B5,0x2D15,0x10B5}, /* 2D14 */
- {0x10B6,0x2D16,0x10B6}, {0x10B7,0x2D17,0x10B7}, /* 2D16 */
- {0x10B8,0x2D18,0x10B8}, {0x10B9,0x2D19,0x10B9}, /* 2D18 */
- {0x10BA,0x2D1A,0x10BA}, {0x10BB,0x2D1B,0x10BB}, /* 2D1A */
- {0x10BC,0x2D1C,0x10BC}, {0x10BD,0x2D1D,0x10BD}, /* 2D1C */
- {0x10BE,0x2D1E,0x10BE}, {0x10BF,0x2D1F,0x10BF}, /* 2D1E */
- {0x10C0,0x2D20,0x10C0}, {0x10C1,0x2D21,0x10C1}, /* 2D20 */
- {0x10C2,0x2D22,0x10C2}, {0x10C3,0x2D23,0x10C3}, /* 2D22 */
- {0x10C4,0x2D24,0x10C4}, {0x10C5,0x2D25,0x10C5}, /* 2D24 */
- {0x2D26,0x2D26,0x2D26}, {0x2D27,0x2D27,0x2D27}, /* 2D26 */
- {0x2D28,0x2D28,0x2D28}, {0x2D29,0x2D29,0x2D29}, /* 2D28 */
- {0x2D2A,0x2D2A,0x2D2A}, {0x2D2B,0x2D2B,0x2D2B}, /* 2D2A */
- {0x2D2C,0x2D2C,0x2D2C}, {0x2D2D,0x2D2D,0x2D2D}, /* 2D2C */
- {0x2D2E,0x2D2E,0x2D2E}, {0x2D2F,0x2D2F,0x2D2F}, /* 2D2E */
- {0x2D30,0x2D30,0x2D30}, {0x2D31,0x2D31,0x2D31}, /* 2D30 */
- {0x2D32,0x2D32,0x2D32}, {0x2D33,0x2D33,0x2D33}, /* 2D32 */
- {0x2D34,0x2D34,0x2D34}, {0x2D35,0x2D35,0x2D35}, /* 2D34 */
- {0x2D36,0x2D36,0x2D36}, {0x2D37,0x2D37,0x2D37}, /* 2D36 */
- {0x2D38,0x2D38,0x2D38}, {0x2D39,0x2D39,0x2D39}, /* 2D38 */
- {0x2D3A,0x2D3A,0x2D3A}, {0x2D3B,0x2D3B,0x2D3B}, /* 2D3A */
- {0x2D3C,0x2D3C,0x2D3C}, {0x2D3D,0x2D3D,0x2D3D}, /* 2D3C */
- {0x2D3E,0x2D3E,0x2D3E}, {0x2D3F,0x2D3F,0x2D3F}, /* 2D3E */
- {0x2D40,0x2D40,0x2D40}, {0x2D41,0x2D41,0x2D41}, /* 2D40 */
- {0x2D42,0x2D42,0x2D42}, {0x2D43,0x2D43,0x2D43}, /* 2D42 */
- {0x2D44,0x2D44,0x2D44}, {0x2D45,0x2D45,0x2D45}, /* 2D44 */
- {0x2D46,0x2D46,0x2D46}, {0x2D47,0x2D47,0x2D47}, /* 2D46 */
- {0x2D48,0x2D48,0x2D48}, {0x2D49,0x2D49,0x2D49}, /* 2D48 */
- {0x2D4A,0x2D4A,0x2D4A}, {0x2D4B,0x2D4B,0x2D4B}, /* 2D4A */
- {0x2D4C,0x2D4C,0x2D4C}, {0x2D4D,0x2D4D,0x2D4D}, /* 2D4C */
- {0x2D4E,0x2D4E,0x2D4E}, {0x2D4F,0x2D4F,0x2D4F}, /* 2D4E */
- {0x2D50,0x2D50,0x2D50}, {0x2D51,0x2D51,0x2D51}, /* 2D50 */
- {0x2D52,0x2D52,0x2D52}, {0x2D53,0x2D53,0x2D53}, /* 2D52 */
- {0x2D54,0x2D54,0x2D54}, {0x2D55,0x2D55,0x2D55}, /* 2D54 */
- {0x2D56,0x2D56,0x2D56}, {0x2D57,0x2D57,0x2D57}, /* 2D56 */
- {0x2D58,0x2D58,0x2D58}, {0x2D59,0x2D59,0x2D59}, /* 2D58 */
- {0x2D5A,0x2D5A,0x2D5A}, {0x2D5B,0x2D5B,0x2D5B}, /* 2D5A */
- {0x2D5C,0x2D5C,0x2D5C}, {0x2D5D,0x2D5D,0x2D5D}, /* 2D5C */
- {0x2D5E,0x2D5E,0x2D5E}, {0x2D5F,0x2D5F,0x2D5F}, /* 2D5E */
- {0x2D60,0x2D60,0x2D60}, {0x2D61,0x2D61,0x2D61}, /* 2D60 */
- {0x2D62,0x2D62,0x2D62}, {0x2D63,0x2D63,0x2D63}, /* 2D62 */
- {0x2D64,0x2D64,0x2D64}, {0x2D65,0x2D65,0x2D65}, /* 2D64 */
- {0x2D66,0x2D66,0x2D66}, {0x2D67,0x2D67,0x2D67}, /* 2D66 */
- {0x2D68,0x2D68,0x2D68}, {0x2D69,0x2D69,0x2D69}, /* 2D68 */
- {0x2D6A,0x2D6A,0x2D6A}, {0x2D6B,0x2D6B,0x2D6B}, /* 2D6A */
- {0x2D6C,0x2D6C,0x2D6C}, {0x2D6D,0x2D6D,0x2D6D}, /* 2D6C */
- {0x2D6E,0x2D6E,0x2D6E}, {0x2D6F,0x2D6F,0x2D6F}, /* 2D6E */
- {0x2D70,0x2D70,0x2D70}, {0x2D71,0x2D71,0x2D71}, /* 2D70 */
- {0x2D72,0x2D72,0x2D72}, {0x2D73,0x2D73,0x2D73}, /* 2D72 */
- {0x2D74,0x2D74,0x2D74}, {0x2D75,0x2D75,0x2D75}, /* 2D74 */
- {0x2D76,0x2D76,0x2D76}, {0x2D77,0x2D77,0x2D77}, /* 2D76 */
- {0x2D78,0x2D78,0x2D78}, {0x2D79,0x2D79,0x2D79}, /* 2D78 */
- {0x2D7A,0x2D7A,0x2D7A}, {0x2D7B,0x2D7B,0x2D7B}, /* 2D7A */
- {0x2D7C,0x2D7C,0x2D7C}, {0x2D7D,0x2D7D,0x2D7D}, /* 2D7C */
- {0x2D7E,0x2D7E,0x2D7E}, {0x2D7F,0x2D7F,0x2D7F}, /* 2D7E */
- {0x2D80,0x2D80,0x2D80}, {0x2D81,0x2D81,0x2D81}, /* 2D80 */
- {0x2D82,0x2D82,0x2D82}, {0x2D83,0x2D83,0x2D83}, /* 2D82 */
- {0x2D84,0x2D84,0x2D84}, {0x2D85,0x2D85,0x2D85}, /* 2D84 */
- {0x2D86,0x2D86,0x2D86}, {0x2D87,0x2D87,0x2D87}, /* 2D86 */
- {0x2D88,0x2D88,0x2D88}, {0x2D89,0x2D89,0x2D89}, /* 2D88 */
- {0x2D8A,0x2D8A,0x2D8A}, {0x2D8B,0x2D8B,0x2D8B}, /* 2D8A */
- {0x2D8C,0x2D8C,0x2D8C}, {0x2D8D,0x2D8D,0x2D8D}, /* 2D8C */
- {0x2D8E,0x2D8E,0x2D8E}, {0x2D8F,0x2D8F,0x2D8F}, /* 2D8E */
- {0x2D90,0x2D90,0x2D90}, {0x2D91,0x2D91,0x2D91}, /* 2D90 */
- {0x2D92,0x2D92,0x2D92}, {0x2D93,0x2D93,0x2D93}, /* 2D92 */
- {0x2D94,0x2D94,0x2D94}, {0x2D95,0x2D95,0x2D95}, /* 2D94 */
- {0x2D96,0x2D96,0x2D96}, {0x2D97,0x2D97,0x2D97}, /* 2D96 */
- {0x2D98,0x2D98,0x2D98}, {0x2D99,0x2D99,0x2D99}, /* 2D98 */
- {0x2D9A,0x2D9A,0x2D9A}, {0x2D9B,0x2D9B,0x2D9B}, /* 2D9A */
- {0x2D9C,0x2D9C,0x2D9C}, {0x2D9D,0x2D9D,0x2D9D}, /* 2D9C */
- {0x2D9E,0x2D9E,0x2D9E}, {0x2D9F,0x2D9F,0x2D9F}, /* 2D9E */
- {0x2DA0,0x2DA0,0x2DA0}, {0x2DA1,0x2DA1,0x2DA1}, /* 2DA0 */
- {0x2DA2,0x2DA2,0x2DA2}, {0x2DA3,0x2DA3,0x2DA3}, /* 2DA2 */
- {0x2DA4,0x2DA4,0x2DA4}, {0x2DA5,0x2DA5,0x2DA5}, /* 2DA4 */
- {0x2DA6,0x2DA6,0x2DA6}, {0x2DA7,0x2DA7,0x2DA7}, /* 2DA6 */
- {0x2DA8,0x2DA8,0x2DA8}, {0x2DA9,0x2DA9,0x2DA9}, /* 2DA8 */
- {0x2DAA,0x2DAA,0x2DAA}, {0x2DAB,0x2DAB,0x2DAB}, /* 2DAA */
- {0x2DAC,0x2DAC,0x2DAC}, {0x2DAD,0x2DAD,0x2DAD}, /* 2DAC */
- {0x2DAE,0x2DAE,0x2DAE}, {0x2DAF,0x2DAF,0x2DAF}, /* 2DAE */
- {0x2DB0,0x2DB0,0x2DB0}, {0x2DB1,0x2DB1,0x2DB1}, /* 2DB0 */
- {0x2DB2,0x2DB2,0x2DB2}, {0x2DB3,0x2DB3,0x2DB3}, /* 2DB2 */
- {0x2DB4,0x2DB4,0x2DB4}, {0x2DB5,0x2DB5,0x2DB5}, /* 2DB4 */
- {0x2DB6,0x2DB6,0x2DB6}, {0x2DB7,0x2DB7,0x2DB7}, /* 2DB6 */
- {0x2DB8,0x2DB8,0x2DB8}, {0x2DB9,0x2DB9,0x2DB9}, /* 2DB8 */
- {0x2DBA,0x2DBA,0x2DBA}, {0x2DBB,0x2DBB,0x2DBB}, /* 2DBA */
- {0x2DBC,0x2DBC,0x2DBC}, {0x2DBD,0x2DBD,0x2DBD}, /* 2DBC */
- {0x2DBE,0x2DBE,0x2DBE}, {0x2DBF,0x2DBF,0x2DBF}, /* 2DBE */
- {0x2DC0,0x2DC0,0x2DC0}, {0x2DC1,0x2DC1,0x2DC1}, /* 2DC0 */
- {0x2DC2,0x2DC2,0x2DC2}, {0x2DC3,0x2DC3,0x2DC3}, /* 2DC2 */
- {0x2DC4,0x2DC4,0x2DC4}, {0x2DC5,0x2DC5,0x2DC5}, /* 2DC4 */
- {0x2DC6,0x2DC6,0x2DC6}, {0x2DC7,0x2DC7,0x2DC7}, /* 2DC6 */
- {0x2DC8,0x2DC8,0x2DC8}, {0x2DC9,0x2DC9,0x2DC9}, /* 2DC8 */
- {0x2DCA,0x2DCA,0x2DCA}, {0x2DCB,0x2DCB,0x2DCB}, /* 2DCA */
- {0x2DCC,0x2DCC,0x2DCC}, {0x2DCD,0x2DCD,0x2DCD}, /* 2DCC */
- {0x2DCE,0x2DCE,0x2DCE}, {0x2DCF,0x2DCF,0x2DCF}, /* 2DCE */
- {0x2DD0,0x2DD0,0x2DD0}, {0x2DD1,0x2DD1,0x2DD1}, /* 2DD0 */
- {0x2DD2,0x2DD2,0x2DD2}, {0x2DD3,0x2DD3,0x2DD3}, /* 2DD2 */
- {0x2DD4,0x2DD4,0x2DD4}, {0x2DD5,0x2DD5,0x2DD5}, /* 2DD4 */
- {0x2DD6,0x2DD6,0x2DD6}, {0x2DD7,0x2DD7,0x2DD7}, /* 2DD6 */
- {0x2DD8,0x2DD8,0x2DD8}, {0x2DD9,0x2DD9,0x2DD9}, /* 2DD8 */
- {0x2DDA,0x2DDA,0x2DDA}, {0x2DDB,0x2DDB,0x2DDB}, /* 2DDA */
- {0x2DDC,0x2DDC,0x2DDC}, {0x2DDD,0x2DDD,0x2DDD}, /* 2DDC */
- {0x2DDE,0x2DDE,0x2DDE}, {0x2DDF,0x2DDF,0x2DDF}, /* 2DDE */
- {0x2DE0,0x2DE0,0x2DE0}, {0x2DE1,0x2DE1,0x2DE1}, /* 2DE0 */
- {0x2DE2,0x2DE2,0x2DE2}, {0x2DE3,0x2DE3,0x2DE3}, /* 2DE2 */
- {0x2DE4,0x2DE4,0x2DE4}, {0x2DE5,0x2DE5,0x2DE5}, /* 2DE4 */
- {0x2DE6,0x2DE6,0x2DE6}, {0x2DE7,0x2DE7,0x2DE7}, /* 2DE6 */
- {0x2DE8,0x2DE8,0x2DE8}, {0x2DE9,0x2DE9,0x2DE9}, /* 2DE8 */
- {0x2DEA,0x2DEA,0x2DEA}, {0x2DEB,0x2DEB,0x2DEB}, /* 2DEA */
- {0x2DEC,0x2DEC,0x2DEC}, {0x2DED,0x2DED,0x2DED}, /* 2DEC */
- {0x2DEE,0x2DEE,0x2DEE}, {0x2DEF,0x2DEF,0x2DEF}, /* 2DEE */
- {0x2DF0,0x2DF0,0x2DF0}, {0x2DF1,0x2DF1,0x2DF1}, /* 2DF0 */
- {0x2DF2,0x2DF2,0x2DF2}, {0x2DF3,0x2DF3,0x2DF3}, /* 2DF2 */
- {0x2DF4,0x2DF4,0x2DF4}, {0x2DF5,0x2DF5,0x2DF5}, /* 2DF4 */
- {0x2DF6,0x2DF6,0x2DF6}, {0x2DF7,0x2DF7,0x2DF7}, /* 2DF6 */
- {0x2DF8,0x2DF8,0x2DF8}, {0x2DF9,0x2DF9,0x2DF9}, /* 2DF8 */
- {0x2DFA,0x2DFA,0x2DFA}, {0x2DFB,0x2DFB,0x2DFB}, /* 2DFA */
- {0x2DFC,0x2DFC,0x2DFC}, {0x2DFD,0x2DFD,0x2DFD}, /* 2DFC */
- {0x2DFE,0x2DFE,0x2DFE}, {0x2DFF,0x2DFF,0x2DFF} /* 2DFE */
-};
-
-static MY_UNICASE_CHARACTER u520pA6[]={
- {0xA600,0xA600,0xA600}, {0xA601,0xA601,0xA601}, /* A600 */
- {0xA602,0xA602,0xA602}, {0xA603,0xA603,0xA603}, /* A602 */
- {0xA604,0xA604,0xA604}, {0xA605,0xA605,0xA605}, /* A604 */
- {0xA606,0xA606,0xA606}, {0xA607,0xA607,0xA607}, /* A606 */
- {0xA608,0xA608,0xA608}, {0xA609,0xA609,0xA609}, /* A608 */
- {0xA60A,0xA60A,0xA60A}, {0xA60B,0xA60B,0xA60B}, /* A60A */
- {0xA60C,0xA60C,0xA60C}, {0xA60D,0xA60D,0xA60D}, /* A60C */
- {0xA60E,0xA60E,0xA60E}, {0xA60F,0xA60F,0xA60F}, /* A60E */
- {0xA610,0xA610,0xA610}, {0xA611,0xA611,0xA611}, /* A610 */
- {0xA612,0xA612,0xA612}, {0xA613,0xA613,0xA613}, /* A612 */
- {0xA614,0xA614,0xA614}, {0xA615,0xA615,0xA615}, /* A614 */
- {0xA616,0xA616,0xA616}, {0xA617,0xA617,0xA617}, /* A616 */
- {0xA618,0xA618,0xA618}, {0xA619,0xA619,0xA619}, /* A618 */
- {0xA61A,0xA61A,0xA61A}, {0xA61B,0xA61B,0xA61B}, /* A61A */
- {0xA61C,0xA61C,0xA61C}, {0xA61D,0xA61D,0xA61D}, /* A61C */
- {0xA61E,0xA61E,0xA61E}, {0xA61F,0xA61F,0xA61F}, /* A61E */
- {0xA620,0xA620,0xA620}, {0xA621,0xA621,0xA621}, /* A620 */
- {0xA622,0xA622,0xA622}, {0xA623,0xA623,0xA623}, /* A622 */
- {0xA624,0xA624,0xA624}, {0xA625,0xA625,0xA625}, /* A624 */
- {0xA626,0xA626,0xA626}, {0xA627,0xA627,0xA627}, /* A626 */
- {0xA628,0xA628,0xA628}, {0xA629,0xA629,0xA629}, /* A628 */
- {0xA62A,0xA62A,0xA62A}, {0xA62B,0xA62B,0xA62B}, /* A62A */
- {0xA62C,0xA62C,0xA62C}, {0xA62D,0xA62D,0xA62D}, /* A62C */
- {0xA62E,0xA62E,0xA62E}, {0xA62F,0xA62F,0xA62F}, /* A62E */
- {0xA630,0xA630,0xA630}, {0xA631,0xA631,0xA631}, /* A630 */
- {0xA632,0xA632,0xA632}, {0xA633,0xA633,0xA633}, /* A632 */
- {0xA634,0xA634,0xA634}, {0xA635,0xA635,0xA635}, /* A634 */
- {0xA636,0xA636,0xA636}, {0xA637,0xA637,0xA637}, /* A636 */
- {0xA638,0xA638,0xA638}, {0xA639,0xA639,0xA639}, /* A638 */
- {0xA63A,0xA63A,0xA63A}, {0xA63B,0xA63B,0xA63B}, /* A63A */
- {0xA63C,0xA63C,0xA63C}, {0xA63D,0xA63D,0xA63D}, /* A63C */
- {0xA63E,0xA63E,0xA63E}, {0xA63F,0xA63F,0xA63F}, /* A63E */
- {0xA640,0xA641,0xA640}, {0xA640,0xA641,0xA640}, /* A640 */
- {0xA642,0xA643,0xA642}, {0xA642,0xA643,0xA642}, /* A642 */
- {0xA644,0xA645,0xA644}, {0xA644,0xA645,0xA644}, /* A644 */
- {0xA646,0xA647,0xA646}, {0xA646,0xA647,0xA646}, /* A646 */
- {0xA648,0xA649,0xA648}, {0xA648,0xA649,0xA648}, /* A648 */
- {0xA64A,0xA64B,0xA64A}, {0xA64A,0xA64B,0xA64A}, /* A64A */
- {0xA64C,0xA64D,0xA64C}, {0xA64C,0xA64D,0xA64C}, /* A64C */
- {0xA64E,0xA64F,0xA64E}, {0xA64E,0xA64F,0xA64E}, /* A64E */
- {0xA650,0xA651,0xA650}, {0xA650,0xA651,0xA650}, /* A650 */
- {0xA652,0xA653,0xA652}, {0xA652,0xA653,0xA652}, /* A652 */
- {0xA654,0xA655,0xA654}, {0xA654,0xA655,0xA654}, /* A654 */
- {0xA656,0xA657,0xA656}, {0xA656,0xA657,0xA656}, /* A656 */
- {0xA658,0xA659,0xA658}, {0xA658,0xA659,0xA658}, /* A658 */
- {0xA65A,0xA65B,0xA65A}, {0xA65A,0xA65B,0xA65A}, /* A65A */
- {0xA65C,0xA65D,0xA65C}, {0xA65C,0xA65D,0xA65C}, /* A65C */
- {0xA65E,0xA65F,0xA65E}, {0xA65E,0xA65F,0xA65E}, /* A65E */
- {0xA660,0xA660,0xA660}, {0xA661,0xA661,0xA661}, /* A660 */
- {0xA662,0xA663,0xA662}, {0xA662,0xA663,0xA662}, /* A662 */
- {0xA664,0xA665,0xA664}, {0xA664,0xA665,0xA664}, /* A664 */
- {0xA666,0xA667,0xA666}, {0xA666,0xA667,0xA666}, /* A666 */
- {0xA668,0xA669,0xA668}, {0xA668,0xA669,0xA668}, /* A668 */
- {0xA66A,0xA66B,0xA66A}, {0xA66A,0xA66B,0xA66A}, /* A66A */
- {0xA66C,0xA66D,0xA66C}, {0xA66C,0xA66D,0xA66C}, /* A66C */
- {0xA66E,0xA66E,0xA66E}, {0xA66F,0xA66F,0xA66F}, /* A66E */
- {0xA670,0xA670,0xA670}, {0xA671,0xA671,0xA671}, /* A670 */
- {0xA672,0xA672,0xA672}, {0xA673,0xA673,0xA673}, /* A672 */
- {0xA674,0xA674,0xA674}, {0xA675,0xA675,0xA675}, /* A674 */
- {0xA676,0xA676,0xA676}, {0xA677,0xA677,0xA677}, /* A676 */
- {0xA678,0xA678,0xA678}, {0xA679,0xA679,0xA679}, /* A678 */
- {0xA67A,0xA67A,0xA67A}, {0xA67B,0xA67B,0xA67B}, /* A67A */
- {0xA67C,0xA67C,0xA67C}, {0xA67D,0xA67D,0xA67D}, /* A67C */
- {0xA67E,0xA67E,0xA67E}, {0xA67F,0xA67F,0xA67F}, /* A67E */
- {0xA680,0xA681,0xA680}, {0xA680,0xA681,0xA680}, /* A680 */
- {0xA682,0xA683,0xA682}, {0xA682,0xA683,0xA682}, /* A682 */
- {0xA684,0xA685,0xA684}, {0xA684,0xA685,0xA684}, /* A684 */
- {0xA686,0xA687,0xA686}, {0xA686,0xA687,0xA686}, /* A686 */
- {0xA688,0xA689,0xA688}, {0xA688,0xA689,0xA688}, /* A688 */
- {0xA68A,0xA68B,0xA68A}, {0xA68A,0xA68B,0xA68A}, /* A68A */
- {0xA68C,0xA68D,0xA68C}, {0xA68C,0xA68D,0xA68C}, /* A68C */
- {0xA68E,0xA68F,0xA68E}, {0xA68E,0xA68F,0xA68E}, /* A68E */
- {0xA690,0xA691,0xA690}, {0xA690,0xA691,0xA690}, /* A690 */
- {0xA692,0xA693,0xA692}, {0xA692,0xA693,0xA692}, /* A692 */
- {0xA694,0xA695,0xA694}, {0xA694,0xA695,0xA694}, /* A694 */
- {0xA696,0xA697,0xA696}, {0xA696,0xA697,0xA696}, /* A696 */
- {0xA698,0xA698,0xA698}, {0xA699,0xA699,0xA699}, /* A698 */
- {0xA69A,0xA69A,0xA69A}, {0xA69B,0xA69B,0xA69B}, /* A69A */
- {0xA69C,0xA69C,0xA69C}, {0xA69D,0xA69D,0xA69D}, /* A69C */
- {0xA69E,0xA69E,0xA69E}, {0xA69F,0xA69F,0xA69F}, /* A69E */
- {0xA6A0,0xA6A0,0xA6A0}, {0xA6A1,0xA6A1,0xA6A1}, /* A6A0 */
- {0xA6A2,0xA6A2,0xA6A2}, {0xA6A3,0xA6A3,0xA6A3}, /* A6A2 */
- {0xA6A4,0xA6A4,0xA6A4}, {0xA6A5,0xA6A5,0xA6A5}, /* A6A4 */
- {0xA6A6,0xA6A6,0xA6A6}, {0xA6A7,0xA6A7,0xA6A7}, /* A6A6 */
- {0xA6A8,0xA6A8,0xA6A8}, {0xA6A9,0xA6A9,0xA6A9}, /* A6A8 */
- {0xA6AA,0xA6AA,0xA6AA}, {0xA6AB,0xA6AB,0xA6AB}, /* A6AA */
- {0xA6AC,0xA6AC,0xA6AC}, {0xA6AD,0xA6AD,0xA6AD}, /* A6AC */
- {0xA6AE,0xA6AE,0xA6AE}, {0xA6AF,0xA6AF,0xA6AF}, /* A6AE */
- {0xA6B0,0xA6B0,0xA6B0}, {0xA6B1,0xA6B1,0xA6B1}, /* A6B0 */
- {0xA6B2,0xA6B2,0xA6B2}, {0xA6B3,0xA6B3,0xA6B3}, /* A6B2 */
- {0xA6B4,0xA6B4,0xA6B4}, {0xA6B5,0xA6B5,0xA6B5}, /* A6B4 */
- {0xA6B6,0xA6B6,0xA6B6}, {0xA6B7,0xA6B7,0xA6B7}, /* A6B6 */
- {0xA6B8,0xA6B8,0xA6B8}, {0xA6B9,0xA6B9,0xA6B9}, /* A6B8 */
- {0xA6BA,0xA6BA,0xA6BA}, {0xA6BB,0xA6BB,0xA6BB}, /* A6BA */
- {0xA6BC,0xA6BC,0xA6BC}, {0xA6BD,0xA6BD,0xA6BD}, /* A6BC */
- {0xA6BE,0xA6BE,0xA6BE}, {0xA6BF,0xA6BF,0xA6BF}, /* A6BE */
- {0xA6C0,0xA6C0,0xA6C0}, {0xA6C1,0xA6C1,0xA6C1}, /* A6C0 */
- {0xA6C2,0xA6C2,0xA6C2}, {0xA6C3,0xA6C3,0xA6C3}, /* A6C2 */
- {0xA6C4,0xA6C4,0xA6C4}, {0xA6C5,0xA6C5,0xA6C5}, /* A6C4 */
- {0xA6C6,0xA6C6,0xA6C6}, {0xA6C7,0xA6C7,0xA6C7}, /* A6C6 */
- {0xA6C8,0xA6C8,0xA6C8}, {0xA6C9,0xA6C9,0xA6C9}, /* A6C8 */
- {0xA6CA,0xA6CA,0xA6CA}, {0xA6CB,0xA6CB,0xA6CB}, /* A6CA */
- {0xA6CC,0xA6CC,0xA6CC}, {0xA6CD,0xA6CD,0xA6CD}, /* A6CC */
- {0xA6CE,0xA6CE,0xA6CE}, {0xA6CF,0xA6CF,0xA6CF}, /* A6CE */
- {0xA6D0,0xA6D0,0xA6D0}, {0xA6D1,0xA6D1,0xA6D1}, /* A6D0 */
- {0xA6D2,0xA6D2,0xA6D2}, {0xA6D3,0xA6D3,0xA6D3}, /* A6D2 */
- {0xA6D4,0xA6D4,0xA6D4}, {0xA6D5,0xA6D5,0xA6D5}, /* A6D4 */
- {0xA6D6,0xA6D6,0xA6D6}, {0xA6D7,0xA6D7,0xA6D7}, /* A6D6 */
- {0xA6D8,0xA6D8,0xA6D8}, {0xA6D9,0xA6D9,0xA6D9}, /* A6D8 */
- {0xA6DA,0xA6DA,0xA6DA}, {0xA6DB,0xA6DB,0xA6DB}, /* A6DA */
- {0xA6DC,0xA6DC,0xA6DC}, {0xA6DD,0xA6DD,0xA6DD}, /* A6DC */
- {0xA6DE,0xA6DE,0xA6DE}, {0xA6DF,0xA6DF,0xA6DF}, /* A6DE */
- {0xA6E0,0xA6E0,0xA6E0}, {0xA6E1,0xA6E1,0xA6E1}, /* A6E0 */
- {0xA6E2,0xA6E2,0xA6E2}, {0xA6E3,0xA6E3,0xA6E3}, /* A6E2 */
- {0xA6E4,0xA6E4,0xA6E4}, {0xA6E5,0xA6E5,0xA6E5}, /* A6E4 */
- {0xA6E6,0xA6E6,0xA6E6}, {0xA6E7,0xA6E7,0xA6E7}, /* A6E6 */
- {0xA6E8,0xA6E8,0xA6E8}, {0xA6E9,0xA6E9,0xA6E9}, /* A6E8 */
- {0xA6EA,0xA6EA,0xA6EA}, {0xA6EB,0xA6EB,0xA6EB}, /* A6EA */
- {0xA6EC,0xA6EC,0xA6EC}, {0xA6ED,0xA6ED,0xA6ED}, /* A6EC */
- {0xA6EE,0xA6EE,0xA6EE}, {0xA6EF,0xA6EF,0xA6EF}, /* A6EE */
- {0xA6F0,0xA6F0,0xA6F0}, {0xA6F1,0xA6F1,0xA6F1}, /* A6F0 */
- {0xA6F2,0xA6F2,0xA6F2}, {0xA6F3,0xA6F3,0xA6F3}, /* A6F2 */
- {0xA6F4,0xA6F4,0xA6F4}, {0xA6F5,0xA6F5,0xA6F5}, /* A6F4 */
- {0xA6F6,0xA6F6,0xA6F6}, {0xA6F7,0xA6F7,0xA6F7}, /* A6F6 */
- {0xA6F8,0xA6F8,0xA6F8}, {0xA6F9,0xA6F9,0xA6F9}, /* A6F8 */
- {0xA6FA,0xA6FA,0xA6FA}, {0xA6FB,0xA6FB,0xA6FB}, /* A6FA */
- {0xA6FC,0xA6FC,0xA6FC}, {0xA6FD,0xA6FD,0xA6FD}, /* A6FC */
- {0xA6FE,0xA6FE,0xA6FE}, {0xA6FF,0xA6FF,0xA6FF} /* A6FE */
-};
-
-static MY_UNICASE_CHARACTER u520pA7[]={
- {0xA700,0xA700,0xA700}, {0xA701,0xA701,0xA701}, /* A700 */
- {0xA702,0xA702,0xA702}, {0xA703,0xA703,0xA703}, /* A702 */
- {0xA704,0xA704,0xA704}, {0xA705,0xA705,0xA705}, /* A704 */
- {0xA706,0xA706,0xA706}, {0xA707,0xA707,0xA707}, /* A706 */
- {0xA708,0xA708,0xA708}, {0xA709,0xA709,0xA709}, /* A708 */
- {0xA70A,0xA70A,0xA70A}, {0xA70B,0xA70B,0xA70B}, /* A70A */
- {0xA70C,0xA70C,0xA70C}, {0xA70D,0xA70D,0xA70D}, /* A70C */
- {0xA70E,0xA70E,0xA70E}, {0xA70F,0xA70F,0xA70F}, /* A70E */
- {0xA710,0xA710,0xA710}, {0xA711,0xA711,0xA711}, /* A710 */
- {0xA712,0xA712,0xA712}, {0xA713,0xA713,0xA713}, /* A712 */
- {0xA714,0xA714,0xA714}, {0xA715,0xA715,0xA715}, /* A714 */
- {0xA716,0xA716,0xA716}, {0xA717,0xA717,0xA717}, /* A716 */
- {0xA718,0xA718,0xA718}, {0xA719,0xA719,0xA719}, /* A718 */
- {0xA71A,0xA71A,0xA71A}, {0xA71B,0xA71B,0xA71B}, /* A71A */
- {0xA71C,0xA71C,0xA71C}, {0xA71D,0xA71D,0xA71D}, /* A71C */
- {0xA71E,0xA71E,0xA71E}, {0xA71F,0xA71F,0xA71F}, /* A71E */
- {0xA720,0xA720,0xA720}, {0xA721,0xA721,0xA721}, /* A720 */
- {0xA722,0xA723,0xA722}, {0xA722,0xA723,0xA722}, /* A722 */
- {0xA724,0xA725,0xA724}, {0xA724,0xA725,0xA724}, /* A724 */
- {0xA726,0xA727,0xA726}, {0xA726,0xA727,0xA726}, /* A726 */
- {0xA728,0xA729,0xA728}, {0xA728,0xA729,0xA728}, /* A728 */
- {0xA72A,0xA72B,0xA72A}, {0xA72A,0xA72B,0xA72A}, /* A72A */
- {0xA72C,0xA72D,0xA72C}, {0xA72C,0xA72D,0xA72C}, /* A72C */
- {0xA72E,0xA72F,0xA72E}, {0xA72E,0xA72F,0xA72E}, /* A72E */
- {0xA730,0xA730,0xA730}, {0xA731,0xA731,0xA731}, /* A730 */
- {0xA732,0xA733,0xA732}, {0xA732,0xA733,0xA732}, /* A732 */
- {0xA734,0xA735,0xA734}, {0xA734,0xA735,0xA734}, /* A734 */
- {0xA736,0xA737,0xA736}, {0xA736,0xA737,0xA736}, /* A736 */
- {0xA738,0xA739,0xA738}, {0xA738,0xA739,0xA738}, /* A738 */
- {0xA73A,0xA73B,0xA73A}, {0xA73A,0xA73B,0xA73A}, /* A73A */
- {0xA73C,0xA73D,0xA73C}, {0xA73C,0xA73D,0xA73C}, /* A73C */
- {0xA73E,0xA73F,0xA73E}, {0xA73E,0xA73F,0xA73E}, /* A73E */
- {0xA740,0xA741,0xA740}, {0xA740,0xA741,0xA740}, /* A740 */
- {0xA742,0xA743,0xA742}, {0xA742,0xA743,0xA742}, /* A742 */
- {0xA744,0xA745,0xA744}, {0xA744,0xA745,0xA744}, /* A744 */
- {0xA746,0xA747,0xA746}, {0xA746,0xA747,0xA746}, /* A746 */
- {0xA748,0xA749,0xA748}, {0xA748,0xA749,0xA748}, /* A748 */
- {0xA74A,0xA74B,0xA74A}, {0xA74A,0xA74B,0xA74A}, /* A74A */
- {0xA74C,0xA74D,0xA74C}, {0xA74C,0xA74D,0xA74C}, /* A74C */
- {0xA74E,0xA74F,0xA74E}, {0xA74E,0xA74F,0xA74E}, /* A74E */
- {0xA750,0xA751,0xA750}, {0xA750,0xA751,0xA750}, /* A750 */
- {0xA752,0xA753,0xA752}, {0xA752,0xA753,0xA752}, /* A752 */
- {0xA754,0xA755,0xA754}, {0xA754,0xA755,0xA754}, /* A754 */
- {0xA756,0xA757,0xA756}, {0xA756,0xA757,0xA756}, /* A756 */
- {0xA758,0xA759,0xA758}, {0xA758,0xA759,0xA758}, /* A758 */
- {0xA75A,0xA75B,0xA75A}, {0xA75A,0xA75B,0xA75A}, /* A75A */
- {0xA75C,0xA75D,0xA75C}, {0xA75C,0xA75D,0xA75C}, /* A75C */
- {0xA75E,0xA75F,0xA75E}, {0xA75E,0xA75F,0xA75E}, /* A75E */
- {0xA760,0xA761,0xA760}, {0xA760,0xA761,0xA760}, /* A760 */
- {0xA762,0xA763,0xA762}, {0xA762,0xA763,0xA762}, /* A762 */
- {0xA764,0xA765,0xA764}, {0xA764,0xA765,0xA764}, /* A764 */
- {0xA766,0xA767,0xA766}, {0xA766,0xA767,0xA766}, /* A766 */
- {0xA768,0xA769,0xA768}, {0xA768,0xA769,0xA768}, /* A768 */
- {0xA76A,0xA76B,0xA76A}, {0xA76A,0xA76B,0xA76A}, /* A76A */
- {0xA76C,0xA76D,0xA76C}, {0xA76C,0xA76D,0xA76C}, /* A76C */
- {0xA76E,0xA76F,0xA76E}, {0xA76E,0xA76F,0xA76E}, /* A76E */
- {0xA770,0xA770,0xA770}, {0xA771,0xA771,0xA771}, /* A770 */
- {0xA772,0xA772,0xA772}, {0xA773,0xA773,0xA773}, /* A772 */
- {0xA774,0xA774,0xA774}, {0xA775,0xA775,0xA775}, /* A774 */
- {0xA776,0xA776,0xA776}, {0xA777,0xA777,0xA777}, /* A776 */
- {0xA778,0xA778,0xA778}, {0xA779,0xA77A,0xA779}, /* A778 */
- {0xA779,0xA77A,0xA779}, {0xA77B,0xA77C,0xA77B}, /* A77A */
- {0xA77B,0xA77C,0xA77B}, {0xA77D,0x1D79,0xA77D}, /* A77C */
- {0xA77E,0xA77F,0xA77E}, {0xA77E,0xA77F,0xA77E}, /* A77E */
- {0xA780,0xA781,0xA780}, {0xA780,0xA781,0xA780}, /* A780 */
- {0xA782,0xA783,0xA782}, {0xA782,0xA783,0xA782}, /* A782 */
- {0xA784,0xA785,0xA784}, {0xA784,0xA785,0xA784}, /* A784 */
- {0xA786,0xA787,0xA786}, {0xA786,0xA787,0xA786}, /* A786 */
- {0xA788,0xA788,0xA788}, {0xA789,0xA789,0xA789}, /* A788 */
- {0xA78A,0xA78A,0xA78A}, {0xA78B,0xA78C,0xA78B}, /* A78A */
- {0xA78B,0xA78C,0xA78B}, {0xA78D,0xA78D,0xA78D}, /* A78C */
- {0xA78E,0xA78E,0xA78E}, {0xA78F,0xA78F,0xA78F}, /* A78E */
- {0xA790,0xA790,0xA790}, {0xA791,0xA791,0xA791}, /* A790 */
- {0xA792,0xA792,0xA792}, {0xA793,0xA793,0xA793}, /* A792 */
- {0xA794,0xA794,0xA794}, {0xA795,0xA795,0xA795}, /* A794 */
- {0xA796,0xA796,0xA796}, {0xA797,0xA797,0xA797}, /* A796 */
- {0xA798,0xA798,0xA798}, {0xA799,0xA799,0xA799}, /* A798 */
- {0xA79A,0xA79A,0xA79A}, {0xA79B,0xA79B,0xA79B}, /* A79A */
- {0xA79C,0xA79C,0xA79C}, {0xA79D,0xA79D,0xA79D}, /* A79C */
- {0xA79E,0xA79E,0xA79E}, {0xA79F,0xA79F,0xA79F}, /* A79E */
- {0xA7A0,0xA7A0,0xA7A0}, {0xA7A1,0xA7A1,0xA7A1}, /* A7A0 */
- {0xA7A2,0xA7A2,0xA7A2}, {0xA7A3,0xA7A3,0xA7A3}, /* A7A2 */
- {0xA7A4,0xA7A4,0xA7A4}, {0xA7A5,0xA7A5,0xA7A5}, /* A7A4 */
- {0xA7A6,0xA7A6,0xA7A6}, {0xA7A7,0xA7A7,0xA7A7}, /* A7A6 */
- {0xA7A8,0xA7A8,0xA7A8}, {0xA7A9,0xA7A9,0xA7A9}, /* A7A8 */
- {0xA7AA,0xA7AA,0xA7AA}, {0xA7AB,0xA7AB,0xA7AB}, /* A7AA */
- {0xA7AC,0xA7AC,0xA7AC}, {0xA7AD,0xA7AD,0xA7AD}, /* A7AC */
- {0xA7AE,0xA7AE,0xA7AE}, {0xA7AF,0xA7AF,0xA7AF}, /* A7AE */
- {0xA7B0,0xA7B0,0xA7B0}, {0xA7B1,0xA7B1,0xA7B1}, /* A7B0 */
- {0xA7B2,0xA7B2,0xA7B2}, {0xA7B3,0xA7B3,0xA7B3}, /* A7B2 */
- {0xA7B4,0xA7B4,0xA7B4}, {0xA7B5,0xA7B5,0xA7B5}, /* A7B4 */
- {0xA7B6,0xA7B6,0xA7B6}, {0xA7B7,0xA7B7,0xA7B7}, /* A7B6 */
- {0xA7B8,0xA7B8,0xA7B8}, {0xA7B9,0xA7B9,0xA7B9}, /* A7B8 */
- {0xA7BA,0xA7BA,0xA7BA}, {0xA7BB,0xA7BB,0xA7BB}, /* A7BA */
- {0xA7BC,0xA7BC,0xA7BC}, {0xA7BD,0xA7BD,0xA7BD}, /* A7BC */
- {0xA7BE,0xA7BE,0xA7BE}, {0xA7BF,0xA7BF,0xA7BF}, /* A7BE */
- {0xA7C0,0xA7C0,0xA7C0}, {0xA7C1,0xA7C1,0xA7C1}, /* A7C0 */
- {0xA7C2,0xA7C2,0xA7C2}, {0xA7C3,0xA7C3,0xA7C3}, /* A7C2 */
- {0xA7C4,0xA7C4,0xA7C4}, {0xA7C5,0xA7C5,0xA7C5}, /* A7C4 */
- {0xA7C6,0xA7C6,0xA7C6}, {0xA7C7,0xA7C7,0xA7C7}, /* A7C6 */
- {0xA7C8,0xA7C8,0xA7C8}, {0xA7C9,0xA7C9,0xA7C9}, /* A7C8 */
- {0xA7CA,0xA7CA,0xA7CA}, {0xA7CB,0xA7CB,0xA7CB}, /* A7CA */
- {0xA7CC,0xA7CC,0xA7CC}, {0xA7CD,0xA7CD,0xA7CD}, /* A7CC */
- {0xA7CE,0xA7CE,0xA7CE}, {0xA7CF,0xA7CF,0xA7CF}, /* A7CE */
- {0xA7D0,0xA7D0,0xA7D0}, {0xA7D1,0xA7D1,0xA7D1}, /* A7D0 */
- {0xA7D2,0xA7D2,0xA7D2}, {0xA7D3,0xA7D3,0xA7D3}, /* A7D2 */
- {0xA7D4,0xA7D4,0xA7D4}, {0xA7D5,0xA7D5,0xA7D5}, /* A7D4 */
- {0xA7D6,0xA7D6,0xA7D6}, {0xA7D7,0xA7D7,0xA7D7}, /* A7D6 */
- {0xA7D8,0xA7D8,0xA7D8}, {0xA7D9,0xA7D9,0xA7D9}, /* A7D8 */
- {0xA7DA,0xA7DA,0xA7DA}, {0xA7DB,0xA7DB,0xA7DB}, /* A7DA */
- {0xA7DC,0xA7DC,0xA7DC}, {0xA7DD,0xA7DD,0xA7DD}, /* A7DC */
- {0xA7DE,0xA7DE,0xA7DE}, {0xA7DF,0xA7DF,0xA7DF}, /* A7DE */
- {0xA7E0,0xA7E0,0xA7E0}, {0xA7E1,0xA7E1,0xA7E1}, /* A7E0 */
- {0xA7E2,0xA7E2,0xA7E2}, {0xA7E3,0xA7E3,0xA7E3}, /* A7E2 */
- {0xA7E4,0xA7E4,0xA7E4}, {0xA7E5,0xA7E5,0xA7E5}, /* A7E4 */
- {0xA7E6,0xA7E6,0xA7E6}, {0xA7E7,0xA7E7,0xA7E7}, /* A7E6 */
- {0xA7E8,0xA7E8,0xA7E8}, {0xA7E9,0xA7E9,0xA7E9}, /* A7E8 */
- {0xA7EA,0xA7EA,0xA7EA}, {0xA7EB,0xA7EB,0xA7EB}, /* A7EA */
- {0xA7EC,0xA7EC,0xA7EC}, {0xA7ED,0xA7ED,0xA7ED}, /* A7EC */
- {0xA7EE,0xA7EE,0xA7EE}, {0xA7EF,0xA7EF,0xA7EF}, /* A7EE */
- {0xA7F0,0xA7F0,0xA7F0}, {0xA7F1,0xA7F1,0xA7F1}, /* A7F0 */
- {0xA7F2,0xA7F2,0xA7F2}, {0xA7F3,0xA7F3,0xA7F3}, /* A7F2 */
- {0xA7F4,0xA7F4,0xA7F4}, {0xA7F5,0xA7F5,0xA7F5}, /* A7F4 */
- {0xA7F6,0xA7F6,0xA7F6}, {0xA7F7,0xA7F7,0xA7F7}, /* A7F6 */
- {0xA7F8,0xA7F8,0xA7F8}, {0xA7F9,0xA7F9,0xA7F9}, /* A7F8 */
- {0xA7FA,0xA7FA,0xA7FA}, {0xA7FB,0xA7FB,0xA7FB}, /* A7FA */
- {0xA7FC,0xA7FC,0xA7FC}, {0xA7FD,0xA7FD,0xA7FD}, /* A7FC */
- {0xA7FE,0xA7FE,0xA7FE}, {0xA7FF,0xA7FF,0xA7FF} /* A7FE */
-};
-
-static MY_UNICASE_CHARACTER u520pFF[]={
- {0xFF00,0xFF00,0xFF00}, {0xFF01,0xFF01,0xFF01}, /* FF00 */
- {0xFF02,0xFF02,0xFF02}, {0xFF03,0xFF03,0xFF03}, /* FF02 */
- {0xFF04,0xFF04,0xFF04}, {0xFF05,0xFF05,0xFF05}, /* FF04 */
- {0xFF06,0xFF06,0xFF06}, {0xFF07,0xFF07,0xFF07}, /* FF06 */
- {0xFF08,0xFF08,0xFF08}, {0xFF09,0xFF09,0xFF09}, /* FF08 */
- {0xFF0A,0xFF0A,0xFF0A}, {0xFF0B,0xFF0B,0xFF0B}, /* FF0A */
- {0xFF0C,0xFF0C,0xFF0C}, {0xFF0D,0xFF0D,0xFF0D}, /* FF0C */
- {0xFF0E,0xFF0E,0xFF0E}, {0xFF0F,0xFF0F,0xFF0F}, /* FF0E */
- {0xFF10,0xFF10,0xFF10}, {0xFF11,0xFF11,0xFF11}, /* FF10 */
- {0xFF12,0xFF12,0xFF12}, {0xFF13,0xFF13,0xFF13}, /* FF12 */
- {0xFF14,0xFF14,0xFF14}, {0xFF15,0xFF15,0xFF15}, /* FF14 */
- {0xFF16,0xFF16,0xFF16}, {0xFF17,0xFF17,0xFF17}, /* FF16 */
- {0xFF18,0xFF18,0xFF18}, {0xFF19,0xFF19,0xFF19}, /* FF18 */
- {0xFF1A,0xFF1A,0xFF1A}, {0xFF1B,0xFF1B,0xFF1B}, /* FF1A */
- {0xFF1C,0xFF1C,0xFF1C}, {0xFF1D,0xFF1D,0xFF1D}, /* FF1C */
- {0xFF1E,0xFF1E,0xFF1E}, {0xFF1F,0xFF1F,0xFF1F}, /* FF1E */
- {0xFF20,0xFF20,0xFF20}, {0xFF21,0xFF41,0xFF21}, /* FF20 */
- {0xFF22,0xFF42,0xFF22}, {0xFF23,0xFF43,0xFF23}, /* FF22 */
- {0xFF24,0xFF44,0xFF24}, {0xFF25,0xFF45,0xFF25}, /* FF24 */
- {0xFF26,0xFF46,0xFF26}, {0xFF27,0xFF47,0xFF27}, /* FF26 */
- {0xFF28,0xFF48,0xFF28}, {0xFF29,0xFF49,0xFF29}, /* FF28 */
- {0xFF2A,0xFF4A,0xFF2A}, {0xFF2B,0xFF4B,0xFF2B}, /* FF2A */
- {0xFF2C,0xFF4C,0xFF2C}, {0xFF2D,0xFF4D,0xFF2D}, /* FF2C */
- {0xFF2E,0xFF4E,0xFF2E}, {0xFF2F,0xFF4F,0xFF2F}, /* FF2E */
- {0xFF30,0xFF50,0xFF30}, {0xFF31,0xFF51,0xFF31}, /* FF30 */
- {0xFF32,0xFF52,0xFF32}, {0xFF33,0xFF53,0xFF33}, /* FF32 */
- {0xFF34,0xFF54,0xFF34}, {0xFF35,0xFF55,0xFF35}, /* FF34 */
- {0xFF36,0xFF56,0xFF36}, {0xFF37,0xFF57,0xFF37}, /* FF36 */
- {0xFF38,0xFF58,0xFF38}, {0xFF39,0xFF59,0xFF39}, /* FF38 */
- {0xFF3A,0xFF5A,0xFF3A}, {0xFF3B,0xFF3B,0xFF3B}, /* FF3A */
- {0xFF3C,0xFF3C,0xFF3C}, {0xFF3D,0xFF3D,0xFF3D}, /* FF3C */
- {0xFF3E,0xFF3E,0xFF3E}, {0xFF3F,0xFF3F,0xFF3F}, /* FF3E */
- {0xFF40,0xFF40,0xFF40}, {0xFF21,0xFF41,0xFF21}, /* FF40 */
- {0xFF22,0xFF42,0xFF22}, {0xFF23,0xFF43,0xFF23}, /* FF42 */
- {0xFF24,0xFF44,0xFF24}, {0xFF25,0xFF45,0xFF25}, /* FF44 */
- {0xFF26,0xFF46,0xFF26}, {0xFF27,0xFF47,0xFF27}, /* FF46 */
- {0xFF28,0xFF48,0xFF28}, {0xFF29,0xFF49,0xFF29}, /* FF48 */
- {0xFF2A,0xFF4A,0xFF2A}, {0xFF2B,0xFF4B,0xFF2B}, /* FF4A */
- {0xFF2C,0xFF4C,0xFF2C}, {0xFF2D,0xFF4D,0xFF2D}, /* FF4C */
- {0xFF2E,0xFF4E,0xFF2E}, {0xFF2F,0xFF4F,0xFF2F}, /* FF4E */
- {0xFF30,0xFF50,0xFF30}, {0xFF31,0xFF51,0xFF31}, /* FF50 */
- {0xFF32,0xFF52,0xFF32}, {0xFF33,0xFF53,0xFF33}, /* FF52 */
- {0xFF34,0xFF54,0xFF34}, {0xFF35,0xFF55,0xFF35}, /* FF54 */
- {0xFF36,0xFF56,0xFF36}, {0xFF37,0xFF57,0xFF37}, /* FF56 */
- {0xFF38,0xFF58,0xFF38}, {0xFF39,0xFF59,0xFF39}, /* FF58 */
- {0xFF3A,0xFF5A,0xFF3A}, {0xFF5B,0xFF5B,0xFF5B}, /* FF5A */
- {0xFF5C,0xFF5C,0xFF5C}, {0xFF5D,0xFF5D,0xFF5D}, /* FF5C */
- {0xFF5E,0xFF5E,0xFF5E}, {0xFF5F,0xFF5F,0xFF5F}, /* FF5E */
- {0xFF60,0xFF60,0xFF60}, {0xFF61,0xFF61,0xFF61}, /* FF60 */
- {0xFF62,0xFF62,0xFF62}, {0xFF63,0xFF63,0xFF63}, /* FF62 */
- {0xFF64,0xFF64,0xFF64}, {0xFF65,0xFF65,0xFF65}, /* FF64 */
- {0xFF66,0xFF66,0xFF66}, {0xFF67,0xFF67,0xFF67}, /* FF66 */
- {0xFF68,0xFF68,0xFF68}, {0xFF69,0xFF69,0xFF69}, /* FF68 */
- {0xFF6A,0xFF6A,0xFF6A}, {0xFF6B,0xFF6B,0xFF6B}, /* FF6A */
- {0xFF6C,0xFF6C,0xFF6C}, {0xFF6D,0xFF6D,0xFF6D}, /* FF6C */
- {0xFF6E,0xFF6E,0xFF6E}, {0xFF6F,0xFF6F,0xFF6F}, /* FF6E */
- {0xFF70,0xFF70,0xFF70}, {0xFF71,0xFF71,0xFF71}, /* FF70 */
- {0xFF72,0xFF72,0xFF72}, {0xFF73,0xFF73,0xFF73}, /* FF72 */
- {0xFF74,0xFF74,0xFF74}, {0xFF75,0xFF75,0xFF75}, /* FF74 */
- {0xFF76,0xFF76,0xFF76}, {0xFF77,0xFF77,0xFF77}, /* FF76 */
- {0xFF78,0xFF78,0xFF78}, {0xFF79,0xFF79,0xFF79}, /* FF78 */
- {0xFF7A,0xFF7A,0xFF7A}, {0xFF7B,0xFF7B,0xFF7B}, /* FF7A */
- {0xFF7C,0xFF7C,0xFF7C}, {0xFF7D,0xFF7D,0xFF7D}, /* FF7C */
- {0xFF7E,0xFF7E,0xFF7E}, {0xFF7F,0xFF7F,0xFF7F}, /* FF7E */
- {0xFF80,0xFF80,0xFF80}, {0xFF81,0xFF81,0xFF81}, /* FF80 */
- {0xFF82,0xFF82,0xFF82}, {0xFF83,0xFF83,0xFF83}, /* FF82 */
- {0xFF84,0xFF84,0xFF84}, {0xFF85,0xFF85,0xFF85}, /* FF84 */
- {0xFF86,0xFF86,0xFF86}, {0xFF87,0xFF87,0xFF87}, /* FF86 */
- {0xFF88,0xFF88,0xFF88}, {0xFF89,0xFF89,0xFF89}, /* FF88 */
- {0xFF8A,0xFF8A,0xFF8A}, {0xFF8B,0xFF8B,0xFF8B}, /* FF8A */
- {0xFF8C,0xFF8C,0xFF8C}, {0xFF8D,0xFF8D,0xFF8D}, /* FF8C */
- {0xFF8E,0xFF8E,0xFF8E}, {0xFF8F,0xFF8F,0xFF8F}, /* FF8E */
- {0xFF90,0xFF90,0xFF90}, {0xFF91,0xFF91,0xFF91}, /* FF90 */
- {0xFF92,0xFF92,0xFF92}, {0xFF93,0xFF93,0xFF93}, /* FF92 */
- {0xFF94,0xFF94,0xFF94}, {0xFF95,0xFF95,0xFF95}, /* FF94 */
- {0xFF96,0xFF96,0xFF96}, {0xFF97,0xFF97,0xFF97}, /* FF96 */
- {0xFF98,0xFF98,0xFF98}, {0xFF99,0xFF99,0xFF99}, /* FF98 */
- {0xFF9A,0xFF9A,0xFF9A}, {0xFF9B,0xFF9B,0xFF9B}, /* FF9A */
- {0xFF9C,0xFF9C,0xFF9C}, {0xFF9D,0xFF9D,0xFF9D}, /* FF9C */
- {0xFF9E,0xFF9E,0xFF9E}, {0xFF9F,0xFF9F,0xFF9F}, /* FF9E */
- {0xFFA0,0xFFA0,0xFFA0}, {0xFFA1,0xFFA1,0xFFA1}, /* FFA0 */
- {0xFFA2,0xFFA2,0xFFA2}, {0xFFA3,0xFFA3,0xFFA3}, /* FFA2 */
- {0xFFA4,0xFFA4,0xFFA4}, {0xFFA5,0xFFA5,0xFFA5}, /* FFA4 */
- {0xFFA6,0xFFA6,0xFFA6}, {0xFFA7,0xFFA7,0xFFA7}, /* FFA6 */
- {0xFFA8,0xFFA8,0xFFA8}, {0xFFA9,0xFFA9,0xFFA9}, /* FFA8 */
- {0xFFAA,0xFFAA,0xFFAA}, {0xFFAB,0xFFAB,0xFFAB}, /* FFAA */
- {0xFFAC,0xFFAC,0xFFAC}, {0xFFAD,0xFFAD,0xFFAD}, /* FFAC */
- {0xFFAE,0xFFAE,0xFFAE}, {0xFFAF,0xFFAF,0xFFAF}, /* FFAE */
- {0xFFB0,0xFFB0,0xFFB0}, {0xFFB1,0xFFB1,0xFFB1}, /* FFB0 */
- {0xFFB2,0xFFB2,0xFFB2}, {0xFFB3,0xFFB3,0xFFB3}, /* FFB2 */
- {0xFFB4,0xFFB4,0xFFB4}, {0xFFB5,0xFFB5,0xFFB5}, /* FFB4 */
- {0xFFB6,0xFFB6,0xFFB6}, {0xFFB7,0xFFB7,0xFFB7}, /* FFB6 */
- {0xFFB8,0xFFB8,0xFFB8}, {0xFFB9,0xFFB9,0xFFB9}, /* FFB8 */
- {0xFFBA,0xFFBA,0xFFBA}, {0xFFBB,0xFFBB,0xFFBB}, /* FFBA */
- {0xFFBC,0xFFBC,0xFFBC}, {0xFFBD,0xFFBD,0xFFBD}, /* FFBC */
- {0xFFBE,0xFFBE,0xFFBE}, {0xFFBF,0xFFBF,0xFFBF}, /* FFBE */
- {0xFFC0,0xFFC0,0xFFC0}, {0xFFC1,0xFFC1,0xFFC1}, /* FFC0 */
- {0xFFC2,0xFFC2,0xFFC2}, {0xFFC3,0xFFC3,0xFFC3}, /* FFC2 */
- {0xFFC4,0xFFC4,0xFFC4}, {0xFFC5,0xFFC5,0xFFC5}, /* FFC4 */
- {0xFFC6,0xFFC6,0xFFC6}, {0xFFC7,0xFFC7,0xFFC7}, /* FFC6 */
- {0xFFC8,0xFFC8,0xFFC8}, {0xFFC9,0xFFC9,0xFFC9}, /* FFC8 */
- {0xFFCA,0xFFCA,0xFFCA}, {0xFFCB,0xFFCB,0xFFCB}, /* FFCA */
- {0xFFCC,0xFFCC,0xFFCC}, {0xFFCD,0xFFCD,0xFFCD}, /* FFCC */
- {0xFFCE,0xFFCE,0xFFCE}, {0xFFCF,0xFFCF,0xFFCF}, /* FFCE */
- {0xFFD0,0xFFD0,0xFFD0}, {0xFFD1,0xFFD1,0xFFD1}, /* FFD0 */
- {0xFFD2,0xFFD2,0xFFD2}, {0xFFD3,0xFFD3,0xFFD3}, /* FFD2 */
- {0xFFD4,0xFFD4,0xFFD4}, {0xFFD5,0xFFD5,0xFFD5}, /* FFD4 */
- {0xFFD6,0xFFD6,0xFFD6}, {0xFFD7,0xFFD7,0xFFD7}, /* FFD6 */
- {0xFFD8,0xFFD8,0xFFD8}, {0xFFD9,0xFFD9,0xFFD9}, /* FFD8 */
- {0xFFDA,0xFFDA,0xFFDA}, {0xFFDB,0xFFDB,0xFFDB}, /* FFDA */
- {0xFFDC,0xFFDC,0xFFDC}, {0xFFDD,0xFFDD,0xFFDD}, /* FFDC */
- {0xFFDE,0xFFDE,0xFFDE}, {0xFFDF,0xFFDF,0xFFDF}, /* FFDE */
- {0xFFE0,0xFFE0,0xFFE0}, {0xFFE1,0xFFE1,0xFFE1}, /* FFE0 */
- {0xFFE2,0xFFE2,0xFFE2}, {0xFFE3,0xFFE3,0xFFE3}, /* FFE2 */
- {0xFFE4,0xFFE4,0xFFE4}, {0xFFE5,0xFFE5,0xFFE5}, /* FFE4 */
- {0xFFE6,0xFFE6,0xFFE6}, {0xFFE7,0xFFE7,0xFFE7}, /* FFE6 */
- {0xFFE8,0xFFE8,0xFFE8}, {0xFFE9,0xFFE9,0xFFE9}, /* FFE8 */
- {0xFFEA,0xFFEA,0xFFEA}, {0xFFEB,0xFFEB,0xFFEB}, /* FFEA */
- {0xFFEC,0xFFEC,0xFFEC}, {0xFFED,0xFFED,0xFFED}, /* FFEC */
- {0xFFEE,0xFFEE,0xFFEE}, {0xFFEF,0xFFEF,0xFFEF}, /* FFEE */
- {0xFFF0,0xFFF0,0xFFF0}, {0xFFF1,0xFFF1,0xFFF1}, /* FFF0 */
- {0xFFF2,0xFFF2,0xFFF2}, {0xFFF3,0xFFF3,0xFFF3}, /* FFF2 */
- {0xFFF4,0xFFF4,0xFFF4}, {0xFFF5,0xFFF5,0xFFF5}, /* FFF4 */
- {0xFFF6,0xFFF6,0xFFF6}, {0xFFF7,0xFFF7,0xFFF7}, /* FFF6 */
- {0xFFF8,0xFFF8,0xFFF8}, {0xFFF9,0xFFF9,0xFFF9}, /* FFF8 */
- {0xFFFA,0xFFFA,0xFFFA}, {0xFFFB,0xFFFB,0xFFFB}, /* FFFA */
- {0xFFFC,0xFFFC,0xFFFC}, {0xFFFD,0xFFFD,0xFFFD}, /* FFFC */
- {0xFFFE,0xFFFE,0xFFFE}, {0xFFFF,0xFFFF,0xFFFF} /* FFFE */
-};
-
-static MY_UNICASE_CHARACTER u520p104[]={
- {0x10400,0x10428,0x10400}, {0x10401,0x10429,0x10401}, /* 10400 */
- {0x10402,0x1042A,0x10402}, {0x10403,0x1042B,0x10403}, /* 10402 */
- {0x10404,0x1042C,0x10404}, {0x10405,0x1042D,0x10405}, /* 10404 */
- {0x10406,0x1042E,0x10406}, {0x10407,0x1042F,0x10407}, /* 10406 */
- {0x10408,0x10430,0x10408}, {0x10409,0x10431,0x10409}, /* 10408 */
- {0x1040A,0x10432,0x1040A}, {0x1040B,0x10433,0x1040B}, /* 1040A */
- {0x1040C,0x10434,0x1040C}, {0x1040D,0x10435,0x1040D}, /* 1040C */
- {0x1040E,0x10436,0x1040E}, {0x1040F,0x10437,0x1040F}, /* 1040E */
- {0x10410,0x10438,0x10410}, {0x10411,0x10439,0x10411}, /* 10410 */
- {0x10412,0x1043A,0x10412}, {0x10413,0x1043B,0x10413}, /* 10412 */
- {0x10414,0x1043C,0x10414}, {0x10415,0x1043D,0x10415}, /* 10414 */
- {0x10416,0x1043E,0x10416}, {0x10417,0x1043F,0x10417}, /* 10416 */
- {0x10418,0x10440,0x10418}, {0x10419,0x10441,0x10419}, /* 10418 */
- {0x1041A,0x10442,0x1041A}, {0x1041B,0x10443,0x1041B}, /* 1041A */
- {0x1041C,0x10444,0x1041C}, {0x1041D,0x10445,0x1041D}, /* 1041C */
- {0x1041E,0x10446,0x1041E}, {0x1041F,0x10447,0x1041F}, /* 1041E */
- {0x10420,0x10448,0x10420}, {0x10421,0x10449,0x10421}, /* 10420 */
- {0x10422,0x1044A,0x10422}, {0x10423,0x1044B,0x10423}, /* 10422 */
- {0x10424,0x1044C,0x10424}, {0x10425,0x1044D,0x10425}, /* 10424 */
- {0x10426,0x1044E,0x10426}, {0x10427,0x1044F,0x10427}, /* 10426 */
- {0x10400,0x10428,0x10400}, {0x10401,0x10429,0x10401}, /* 10428 */
- {0x10402,0x1042A,0x10402}, {0x10403,0x1042B,0x10403}, /* 1042A */
- {0x10404,0x1042C,0x10404}, {0x10405,0x1042D,0x10405}, /* 1042C */
- {0x10406,0x1042E,0x10406}, {0x10407,0x1042F,0x10407}, /* 1042E */
- {0x10408,0x10430,0x10408}, {0x10409,0x10431,0x10409}, /* 10430 */
- {0x1040A,0x10432,0x1040A}, {0x1040B,0x10433,0x1040B}, /* 10432 */
- {0x1040C,0x10434,0x1040C}, {0x1040D,0x10435,0x1040D}, /* 10434 */
- {0x1040E,0x10436,0x1040E}, {0x1040F,0x10437,0x1040F}, /* 10436 */
- {0x10410,0x10438,0x10410}, {0x10411,0x10439,0x10411}, /* 10438 */
- {0x10412,0x1043A,0x10412}, {0x10413,0x1043B,0x10413}, /* 1043A */
- {0x10414,0x1043C,0x10414}, {0x10415,0x1043D,0x10415}, /* 1043C */
- {0x10416,0x1043E,0x10416}, {0x10417,0x1043F,0x10417}, /* 1043E */
- {0x10418,0x10440,0x10418}, {0x10419,0x10441,0x10419}, /* 10440 */
- {0x1041A,0x10442,0x1041A}, {0x1041B,0x10443,0x1041B}, /* 10442 */
- {0x1041C,0x10444,0x1041C}, {0x1041D,0x10445,0x1041D}, /* 10444 */
- {0x1041E,0x10446,0x1041E}, {0x1041F,0x10447,0x1041F}, /* 10446 */
- {0x10420,0x10448,0x10420}, {0x10421,0x10449,0x10421}, /* 10448 */
- {0x10422,0x1044A,0x10422}, {0x10423,0x1044B,0x10423}, /* 1044A */
- {0x10424,0x1044C,0x10424}, {0x10425,0x1044D,0x10425}, /* 1044C */
- {0x10426,0x1044E,0x10426}, {0x10427,0x1044F,0x10427}, /* 1044E */
- {0x10450,0x10450,0x10450}, {0x10451,0x10451,0x10451}, /* 10450 */
- {0x10452,0x10452,0x10452}, {0x10453,0x10453,0x10453}, /* 10452 */
- {0x10454,0x10454,0x10454}, {0x10455,0x10455,0x10455}, /* 10454 */
- {0x10456,0x10456,0x10456}, {0x10457,0x10457,0x10457}, /* 10456 */
- {0x10458,0x10458,0x10458}, {0x10459,0x10459,0x10459}, /* 10458 */
- {0x1045A,0x1045A,0x1045A}, {0x1045B,0x1045B,0x1045B}, /* 1045A */
- {0x1045C,0x1045C,0x1045C}, {0x1045D,0x1045D,0x1045D}, /* 1045C */
- {0x1045E,0x1045E,0x1045E}, {0x1045F,0x1045F,0x1045F}, /* 1045E */
- {0x10460,0x10460,0x10460}, {0x10461,0x10461,0x10461}, /* 10460 */
- {0x10462,0x10462,0x10462}, {0x10463,0x10463,0x10463}, /* 10462 */
- {0x10464,0x10464,0x10464}, {0x10465,0x10465,0x10465}, /* 10464 */
- {0x10466,0x10466,0x10466}, {0x10467,0x10467,0x10467}, /* 10466 */
- {0x10468,0x10468,0x10468}, {0x10469,0x10469,0x10469}, /* 10468 */
- {0x1046A,0x1046A,0x1046A}, {0x1046B,0x1046B,0x1046B}, /* 1046A */
- {0x1046C,0x1046C,0x1046C}, {0x1046D,0x1046D,0x1046D}, /* 1046C */
- {0x1046E,0x1046E,0x1046E}, {0x1046F,0x1046F,0x1046F}, /* 1046E */
- {0x10470,0x10470,0x10470}, {0x10471,0x10471,0x10471}, /* 10470 */
- {0x10472,0x10472,0x10472}, {0x10473,0x10473,0x10473}, /* 10472 */
- {0x10474,0x10474,0x10474}, {0x10475,0x10475,0x10475}, /* 10474 */
- {0x10476,0x10476,0x10476}, {0x10477,0x10477,0x10477}, /* 10476 */
- {0x10478,0x10478,0x10478}, {0x10479,0x10479,0x10479}, /* 10478 */
- {0x1047A,0x1047A,0x1047A}, {0x1047B,0x1047B,0x1047B}, /* 1047A */
- {0x1047C,0x1047C,0x1047C}, {0x1047D,0x1047D,0x1047D}, /* 1047C */
- {0x1047E,0x1047E,0x1047E}, {0x1047F,0x1047F,0x1047F}, /* 1047E */
- {0x10480,0x10480,0x10480}, {0x10481,0x10481,0x10481}, /* 10480 */
- {0x10482,0x10482,0x10482}, {0x10483,0x10483,0x10483}, /* 10482 */
- {0x10484,0x10484,0x10484}, {0x10485,0x10485,0x10485}, /* 10484 */
- {0x10486,0x10486,0x10486}, {0x10487,0x10487,0x10487}, /* 10486 */
- {0x10488,0x10488,0x10488}, {0x10489,0x10489,0x10489}, /* 10488 */
- {0x1048A,0x1048A,0x1048A}, {0x1048B,0x1048B,0x1048B}, /* 1048A */
- {0x1048C,0x1048C,0x1048C}, {0x1048D,0x1048D,0x1048D}, /* 1048C */
- {0x1048E,0x1048E,0x1048E}, {0x1048F,0x1048F,0x1048F}, /* 1048E */
- {0x10490,0x10490,0x10490}, {0x10491,0x10491,0x10491}, /* 10490 */
- {0x10492,0x10492,0x10492}, {0x10493,0x10493,0x10493}, /* 10492 */
- {0x10494,0x10494,0x10494}, {0x10495,0x10495,0x10495}, /* 10494 */
- {0x10496,0x10496,0x10496}, {0x10497,0x10497,0x10497}, /* 10496 */
- {0x10498,0x10498,0x10498}, {0x10499,0x10499,0x10499}, /* 10498 */
- {0x1049A,0x1049A,0x1049A}, {0x1049B,0x1049B,0x1049B}, /* 1049A */
- {0x1049C,0x1049C,0x1049C}, {0x1049D,0x1049D,0x1049D}, /* 1049C */
- {0x1049E,0x1049E,0x1049E}, {0x1049F,0x1049F,0x1049F}, /* 1049E */
- {0x104A0,0x104A0,0x104A0}, {0x104A1,0x104A1,0x104A1}, /* 104A0 */
- {0x104A2,0x104A2,0x104A2}, {0x104A3,0x104A3,0x104A3}, /* 104A2 */
- {0x104A4,0x104A4,0x104A4}, {0x104A5,0x104A5,0x104A5}, /* 104A4 */
- {0x104A6,0x104A6,0x104A6}, {0x104A7,0x104A7,0x104A7}, /* 104A6 */
- {0x104A8,0x104A8,0x104A8}, {0x104A9,0x104A9,0x104A9}, /* 104A8 */
- {0x104AA,0x104AA,0x104AA}, {0x104AB,0x104AB,0x104AB}, /* 104AA */
- {0x104AC,0x104AC,0x104AC}, {0x104AD,0x104AD,0x104AD}, /* 104AC */
- {0x104AE,0x104AE,0x104AE}, {0x104AF,0x104AF,0x104AF}, /* 104AE */
- {0x104B0,0x104B0,0x104B0}, {0x104B1,0x104B1,0x104B1}, /* 104B0 */
- {0x104B2,0x104B2,0x104B2}, {0x104B3,0x104B3,0x104B3}, /* 104B2 */
- {0x104B4,0x104B4,0x104B4}, {0x104B5,0x104B5,0x104B5}, /* 104B4 */
- {0x104B6,0x104B6,0x104B6}, {0x104B7,0x104B7,0x104B7}, /* 104B6 */
- {0x104B8,0x104B8,0x104B8}, {0x104B9,0x104B9,0x104B9}, /* 104B8 */
- {0x104BA,0x104BA,0x104BA}, {0x104BB,0x104BB,0x104BB}, /* 104BA */
- {0x104BC,0x104BC,0x104BC}, {0x104BD,0x104BD,0x104BD}, /* 104BC */
- {0x104BE,0x104BE,0x104BE}, {0x104BF,0x104BF,0x104BF}, /* 104BE */
- {0x104C0,0x104C0,0x104C0}, {0x104C1,0x104C1,0x104C1}, /* 104C0 */
- {0x104C2,0x104C2,0x104C2}, {0x104C3,0x104C3,0x104C3}, /* 104C2 */
- {0x104C4,0x104C4,0x104C4}, {0x104C5,0x104C5,0x104C5}, /* 104C4 */
- {0x104C6,0x104C6,0x104C6}, {0x104C7,0x104C7,0x104C7}, /* 104C6 */
- {0x104C8,0x104C8,0x104C8}, {0x104C9,0x104C9,0x104C9}, /* 104C8 */
- {0x104CA,0x104CA,0x104CA}, {0x104CB,0x104CB,0x104CB}, /* 104CA */
- {0x104CC,0x104CC,0x104CC}, {0x104CD,0x104CD,0x104CD}, /* 104CC */
- {0x104CE,0x104CE,0x104CE}, {0x104CF,0x104CF,0x104CF}, /* 104CE */
- {0x104D0,0x104D0,0x104D0}, {0x104D1,0x104D1,0x104D1}, /* 104D0 */
- {0x104D2,0x104D2,0x104D2}, {0x104D3,0x104D3,0x104D3}, /* 104D2 */
- {0x104D4,0x104D4,0x104D4}, {0x104D5,0x104D5,0x104D5}, /* 104D4 */
- {0x104D6,0x104D6,0x104D6}, {0x104D7,0x104D7,0x104D7}, /* 104D6 */
- {0x104D8,0x104D8,0x104D8}, {0x104D9,0x104D9,0x104D9}, /* 104D8 */
- {0x104DA,0x104DA,0x104DA}, {0x104DB,0x104DB,0x104DB}, /* 104DA */
- {0x104DC,0x104DC,0x104DC}, {0x104DD,0x104DD,0x104DD}, /* 104DC */
- {0x104DE,0x104DE,0x104DE}, {0x104DF,0x104DF,0x104DF}, /* 104DE */
- {0x104E0,0x104E0,0x104E0}, {0x104E1,0x104E1,0x104E1}, /* 104E0 */
- {0x104E2,0x104E2,0x104E2}, {0x104E3,0x104E3,0x104E3}, /* 104E2 */
- {0x104E4,0x104E4,0x104E4}, {0x104E5,0x104E5,0x104E5}, /* 104E4 */
- {0x104E6,0x104E6,0x104E6}, {0x104E7,0x104E7,0x104E7}, /* 104E6 */
- {0x104E8,0x104E8,0x104E8}, {0x104E9,0x104E9,0x104E9}, /* 104E8 */
- {0x104EA,0x104EA,0x104EA}, {0x104EB,0x104EB,0x104EB}, /* 104EA */
- {0x104EC,0x104EC,0x104EC}, {0x104ED,0x104ED,0x104ED}, /* 104EC */
- {0x104EE,0x104EE,0x104EE}, {0x104EF,0x104EF,0x104EF}, /* 104EE */
- {0x104F0,0x104F0,0x104F0}, {0x104F1,0x104F1,0x104F1}, /* 104F0 */
- {0x104F2,0x104F2,0x104F2}, {0x104F3,0x104F3,0x104F3}, /* 104F2 */
- {0x104F4,0x104F4,0x104F4}, {0x104F5,0x104F5,0x104F5}, /* 104F4 */
- {0x104F6,0x104F6,0x104F6}, {0x104F7,0x104F7,0x104F7}, /* 104F6 */
- {0x104F8,0x104F8,0x104F8}, {0x104F9,0x104F9,0x104F9}, /* 104F8 */
- {0x104FA,0x104FA,0x104FA}, {0x104FB,0x104FB,0x104FB}, /* 104FA */
- {0x104FC,0x104FC,0x104FC}, {0x104FD,0x104FD,0x104FD}, /* 104FC */
- {0x104FE,0x104FE,0x104FE}, {0x104FF,0x104FF,0x104FF} /* 104FE */
-};
-
-
-MY_UNICASE_CHARACTER *my_unicase_pages_unicode520[4352]=
-{
- u520p00, u520p01, u520p02, u520p03, u520p04, u520p05, plane06, plane07,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- u520p10, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, u520p1D, u520p1E, u520p1F,
- NULL, u520p21, NULL, NULL, u520p24, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, u520p2C, u520p2D, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, u520pA6, u520pA7,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, u520pFF,
- NULL, NULL, NULL, NULL,u520p104, NULL, NULL, NULL,
-};
-
-
-MY_UNICASE_INFO my_unicase_unicode520=
-{
- 0x104FF,
- my_unicase_pages_unicode520
-};
-
-
-static inline void
-my_tosort_unicode(MY_UNICASE_INFO *uni_plane, my_wc_t *wc, uint flags)
-{
- if (*wc <= uni_plane->maxchar)
- {
- MY_UNICASE_CHARACTER *page;
- if ((page= uni_plane->page[*wc >> 8]))
- *wc= (flags & MY_CS_LOWER_SORT) ?
- page[*wc & 0xFF].tolower :
- page[*wc & 0xFF].sort;
- }
- else
- {
- *wc= MY_CS_REPLACEMENT_CHARACTER;
- }
-}
-
static uint
my_casefold_multiply_utf8mbx(CHARSET_INFO *cs)
{
DBUG_ASSERT(cs->mbminlen == 1 && cs->mbmaxlen >= 3);
- if (cs->caseinfo == &my_unicase_unicode520)
+ if (cs->casefold == &my_casefold_unicode520 ||
+ cs->casefold == &my_casefold_unicode1400 ||
+ cs->casefold == &my_casefold_unicode1400tr)
return 2;
- if (cs->caseinfo == &my_unicase_turkish)
+ if (cs->casefold == &my_casefold_turkish)
return 2;
- if (cs->caseinfo == &my_unicase_default)
+ if (cs->casefold == &my_casefold_default)
return 1;
- if (cs->caseinfo == &my_unicase_mysql500)
+ if (cs->casefold == &my_casefold_mysql500)
return 1;
DBUG_ASSERT(0); /*Unknown case folding data */
return 1;
@@ -4687,7 +147,7 @@ int my_wildcmp_unicode_impl(CHARSET_INFO *cs,
const char *str,const char *str_end,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many,
- MY_UNICASE_INFO *weights, int recurse_level)
+ MY_CASEFOLD_INFO *weights, int recurse_level)
{
int result= -1; /* Not found, using wildcards */
my_wc_t s_wc, w_wc;
@@ -4734,8 +194,8 @@ int my_wildcmp_unicode_impl(CHARSET_INFO *cs,
{
if (weights)
{
- my_tosort_unicode(weights, &s_wc, cs->state);
- my_tosort_unicode(weights, &w_wc, cs->state);
+ my_tosort_unicode(weights, &s_wc);
+ my_tosort_unicode(weights, &w_wc);
}
if (s_wc != w_wc)
return 1; /* No match */
@@ -4803,8 +263,8 @@ int my_wildcmp_unicode_impl(CHARSET_INFO *cs,
return 1;
if (weights)
{
- my_tosort_unicode(weights, &s_wc, cs->state);
- my_tosort_unicode(weights, &w_wc, cs->state);
+ my_tosort_unicode(weights, &s_wc);
+ my_tosort_unicode(weights, &w_wc);
}
if (s_wc == w_wc)
@@ -4832,7 +292,7 @@ my_wildcmp_unicode(CHARSET_INFO *cs,
const char *str,const char *str_end,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many,
- MY_UNICASE_INFO *weights)
+ MY_CASEFOLD_INFO *weights)
{
return my_wildcmp_unicode_impl(cs, str, str_end,
wildstr, wildend,
@@ -5207,24 +667,6 @@ static int my_uni_utf8mb3_no_range(CHARSET_INFO *cs __attribute__((unused)),
}
-static inline void
-my_tolower_utf8mb3(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
-{
- MY_UNICASE_CHARACTER *page;
- if ((page= uni_plane->page[(*wc >> 8) & 0xFF]))
- *wc= page[*wc & 0xFF].tolower;
-}
-
-
-static inline void
-my_toupper_utf8mb3(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
-{
- MY_UNICASE_CHARACTER *page;
- if ((page= uni_plane->page[(*wc >> 8) & 0xFF]))
- *wc= page[*wc & 0xFF].toupper;
-}
-
-
static size_t my_caseup_utf8mb3(CHARSET_INFO *cs,
const char *src, size_t srclen,
char *dst, size_t dstlen)
@@ -5233,13 +675,13 @@ static size_t my_caseup_utf8mb3(CHARSET_INFO *cs,
int srcres, dstres;
const char *srcend= src + srclen;
char *dstend= dst + dstlen, *dst0= dst;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
DBUG_ASSERT(src != dst || cs->cset->caseup_multiply(cs) == 1);
while ((src < srcend) &&
(srcres= my_utf8mb3_uni(cs, &wc, (uchar *) src, (uchar*) srcend)) > 0)
{
- my_toupper_utf8mb3(uni_plane, &wc);
+ my_toupper_unicode_bmp(uni_plane, &wc);
if ((dstres= my_uni_utf8mb3(cs, wc, (uchar*) dst, (uchar*) dstend)) <= 0)
break;
src+= srcres;
@@ -5255,12 +697,12 @@ static void my_hash_sort_utf8mb3_nopad(CHARSET_INFO *cs, const uchar *s, size_t
my_wc_t wc;
int res;
const uchar *e= s+slen;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
register ulong m1= *nr1, m2= *nr2;
while ((s < e) && (res=my_utf8mb3_uni(cs,&wc, (uchar *)s, (uchar*)e))>0 )
{
- my_tosort_unicode(uni_plane, &wc, cs->state);
+ my_tosort_unicode(uni_plane, &wc);
MY_HASH_ADD_16(m1, m2, wc);
s+= res;
}
@@ -5286,13 +728,13 @@ static size_t my_caseup_str_utf8mb3(CHARSET_INFO *cs, char *src)
my_wc_t wc;
int srcres, dstres;
char *dst= src, *dst0= src;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
DBUG_ASSERT(cs->cset->caseup_multiply(cs) == 1);
while (*src &&
(srcres= my_utf8mb3_uni_no_range(cs, &wc, (uchar *) src)) > 0)
{
- my_toupper_utf8mb3(uni_plane, &wc);
+ my_toupper_unicode_bmp(uni_plane, &wc);
if ((dstres= my_uni_utf8mb3_no_range(cs, wc, (uchar*) dst)) <= 0)
break;
src+= srcres;
@@ -5311,13 +753,13 @@ static size_t my_casedn_utf8mb3(CHARSET_INFO *cs,
int srcres, dstres;
const char *srcend= src + srclen;
char *dstend= dst + dstlen, *dst0= dst;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
DBUG_ASSERT(src != dst || cs->cset->casedn_multiply(cs) == 1);
while ((src < srcend) &&
(srcres= my_utf8mb3_uni(cs, &wc, (uchar*) src, (uchar*)srcend)) > 0)
{
- my_tolower_utf8mb3(uni_plane, &wc);
+ my_tolower_unicode_bmp(uni_plane, &wc);
if ((dstres= my_uni_utf8mb3(cs, wc, (uchar*) dst, (uchar*) dstend)) <= 0)
break;
src+= srcres;
@@ -5332,13 +774,13 @@ static size_t my_casedn_str_utf8mb3(CHARSET_INFO *cs, char *src)
my_wc_t wc;
int srcres, dstres;
char *dst= src, *dst0= src;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
DBUG_ASSERT(cs->cset->casedn_multiply(cs) == 1);
while (*src &&
(srcres= my_utf8mb3_uni_no_range(cs, &wc, (uchar *) src)) > 0)
{
- my_tolower_utf8mb3(uni_plane, &wc);
+ my_tolower_unicode_bmp(uni_plane, &wc);
if ((dstres= my_uni_utf8mb3_no_range(cs, wc, (uchar*) dst)) <= 0)
break;
src+= srcres;
@@ -5385,7 +827,7 @@ static size_t my_casedn_str_utf8mb3(CHARSET_INFO *cs, char *src)
static
int my_strcasecmp_utf8mb3(CHARSET_INFO *cs, const char *s, const char *t)
{
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
while (s[0] && t[0])
{
my_wc_t s_wc,t_wc;
@@ -5397,7 +839,7 @@ int my_strcasecmp_utf8mb3(CHARSET_INFO *cs, const char *s, const char *t)
It represents a single byte character.
Convert it into weight according to collation.
*/
- s_wc= my_unicase_default_page00[(uchar) s[0]].tolower;
+ s_wc= my_u300_tolower_7bit((uchar) s[0]);
s++;
}
else
@@ -5430,7 +872,7 @@ int my_strcasecmp_utf8mb3(CHARSET_INFO *cs, const char *s, const char *t)
s+= res;
/* Convert Unicode code into weight according to collation */
- my_tolower_utf8mb3(uni_plane, &s_wc);
+ my_tolower_unicode_bmp(uni_plane, &s_wc);
}
@@ -5439,7 +881,7 @@ int my_strcasecmp_utf8mb3(CHARSET_INFO *cs, const char *s, const char *t)
if ((uchar) t[0] < 128)
{
/* Convert single byte character into weight */
- t_wc= my_unicase_default_page00[(uchar) t[0]].tolower;
+ t_wc= my_u300_tolower_7bit((uchar) t[0]);
t++;
}
else
@@ -5450,7 +892,7 @@ int my_strcasecmp_utf8mb3(CHARSET_INFO *cs, const char *s, const char *t)
t+= res;
/* Convert code into weight */
- my_tolower_utf8mb3(uni_plane, &t_wc);
+ my_tolower_unicode_bmp(uni_plane, &t_wc);
}
/* Now we have two weights, let's compare them */
@@ -5467,7 +909,7 @@ int my_wildcmp_utf8mb3(CHARSET_INFO *cs,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many)
{
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
return my_wildcmp_unicode(cs,str,str_end,wildstr,wildend,
escape,w_one,w_many,uni_plane);
}
@@ -5502,33 +944,32 @@ int my_charlen_utf8mb3(CHARSET_INFO *cs __attribute__((unused)),
static inline int my_weight_mb1_utf8mb3_general_ci(uchar b)
{
- return (int) my_unicase_default_page00[b & 0xFF].sort;
+ return (int) weight_general_ci_page00[b & 0xFF];
}
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];
+ const uint16 *page= weight_general_ci_index[wc >> 8];
/*
2-byte utf8 sequences encode Unicode characters up to U+07FF.
- my_unicase_default_pages[N] has non-NULL page pointers
+ weight_general_ci_index[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
+ - weight_general_ci_index[0..5] point to real translation data
+ - weight_general_ci_index[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;
+ return (int) page[wc & 0xFF];
}
static inline int my_weight_mb3_utf8mb3_general_ci(uchar b0, uchar b1, uchar b2)
{
my_wc_t wc= UTF8MB3_CODE(b0, b1, b2);
- MY_UNICASE_CHARACTER *page= my_unicase_default_pages[wc >> 8];
- return (int) (page ? page[wc & 0xFF].sort : wc);
+ return my_general_ci_bmp_char_to_weight((uint16) wc);
}
@@ -5537,9 +978,7 @@ static inline int my_weight_mb3_utf8mb3_general_ci(uchar b0, uchar b1, uchar b2)
#define DEFINE_STRNXFRM_UNICODE_NOPAD
#define MY_MB_WC(cs, pwc, s, e) my_mb_wc_utf8mb3_quick(pwc, s, e)
#define OPTIMIZE_ASCII 1
-#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR
-#define UNICASE_PAGE0 my_unicase_default_page00
-#define UNICASE_PAGES my_unicase_default_pages
+#define MY_WC_WEIGHT(x) my_general_ci_bmp_char_to_weight(x)
#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x))
#define WEIGHT_MB1(x) my_weight_mb1_utf8mb3_general_ci(x)
#define WEIGHT_MB2(x,y) my_weight_mb2_utf8mb3_general_ci(x,y)
@@ -5560,19 +999,19 @@ static inline int my_weight_mb3_utf8mb3_general_ci(uchar b0, uchar b1, uchar b2)
static inline int my_weight_mb1_utf8mb3_general_mysql500_ci(uchar b)
{
- return (int) plane00_mysql500[b & 0xFF].sort;
+ return (int) weight_general_mysql500_ci_page00[b & 0xFF];
}
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];
+ const uint16 *page= weight_general_mysql500_ci_index[wc >> 8];
/*
`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;
+ return (int) page[wc & 0xFF];
}
@@ -5580,8 +1019,16 @@ static inline int
my_weight_mb3_utf8mb3_general_mysql500_ci(uchar b0, uchar b1, uchar b2)
{
my_wc_t wc= UTF8MB3_CODE(b0, b1, b2);
- MY_UNICASE_CHARACTER *page= my_unicase_pages_mysql500[wc >> 8];
- return (int) (page ? page[wc & 0xFF].sort : wc);
+ const uint16 *page= weight_general_mysql500_ci_index[wc >> 8];
+ return (int) (page ? page[wc & 0xFF] : wc);
+}
+
+
+static inline int
+my_wc_weight_utf8mb3_general_mysql500_ci(my_wc_t wc)
+{
+ const uint16 *page= weight_general_mysql500_ci_index[wc >> 8];
+ return (int) (page ? page[wc & 0xFF] : wc);
}
@@ -5589,10 +1036,8 @@ my_weight_mb3_utf8mb3_general_mysql500_ci(uchar b0, uchar b1, uchar b2)
#define DEFINE_STRNXFRM_UNICODE
#define MY_MB_WC(cs, pwc, s, e) my_mb_wc_utf8mb3_quick(pwc, s, e)
#define OPTIMIZE_ASCII 1
-#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR
-#define UNICASE_PAGE0 plane00_mysql500
-#define UNICASE_PAGES my_unicase_pages_mysql500
#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x))
+#define MY_WC_WEIGHT(x) my_wc_weight_utf8mb3_general_mysql500_ci(x)
#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)
@@ -5810,8 +1255,7 @@ struct charset_info_st my_charset_utf8mb3_general_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -5842,8 +1286,7 @@ struct charset_info_st my_charset_utf8mb3_general_mysql500_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_mysql500, /* caseinfo */
+ &my_casefold_mysql500, /* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -5874,8 +1317,7 @@ struct charset_info_st my_charset_utf8mb3_bin=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -5906,8 +1348,7 @@ struct charset_info_st my_charset_utf8mb3_general_nopad_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
+ &my_casefold_default, /* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -5938,8 +1379,7 @@ struct charset_info_st my_charset_utf8mb3_nopad_bin=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -5975,7 +1415,7 @@ static int my_strnncoll_utf8mb3_cs(CHARSET_INFO *cs,
const uchar *te=t+tlen;
int save_diff = 0;
int diff;
- MY_UNICASE_INFO *const *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *const *uni_plane= cs->casefold;
while ( s < se && t < te )
{
@@ -5994,8 +1434,8 @@ static int my_strnncoll_utf8mb3_cs(CHARSET_INFO *cs,
save_diff = ((int)s_wc) - ((int)t_wc);
}
- my_tosort_unicode(uni_plane, &s_wc, cs->state);
- my_tosort_unicode(uni_plane, &t_wc, cs->state);
+ my_tosort_unicode(uni_plane, &s_wc);
+ my_tosort_unicode(uni_plane, &t_wc);
if ( s_wc != t_wc )
{
@@ -6018,7 +1458,7 @@ static int my_strnncollsp_utf8mb3_cs(CHARSET_INFO *cs,
const uchar *se= s + slen;
const uchar *te= t + tlen;
int save_diff= 0;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
while ( s < se && t < te )
{
@@ -6036,8 +1476,8 @@ static int my_strnncollsp_utf8mb3_cs(CHARSET_INFO *cs,
save_diff = ((int)s_wc) - ((int)t_wc);
}
- my_tosort_unicode(uni_plane, &s_wc, cs->state);
- my_tosort_unicode(uni_plane, &t_wc, cs->state);
+ my_tosort_unicode(uni_plane, &s_wc);
+ my_tosort_unicode(uni_plane, &t_wc);
if ( s_wc != t_wc )
{
@@ -6102,8 +1542,7 @@ struct charset_info_st my_charset_utf8mb3_general_cs=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -7376,9 +2815,7 @@ my_wc_to_printable_filename(CHARSET_INFO *cs, my_wc_t wc,
#define DEFINE_STRNXFRM_UNICODE
#define MY_MB_WC(cs, pwc, s, e) my_mb_wc_filename(cs, pwc, s, e)
#define OPTIMIZE_ASCII 0
-#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR
-#define UNICASE_PAGE0 my_unicase_default_page00
-#define UNICASE_PAGES my_unicase_default_pages
+#define MY_WC_WEIGHT(x) my_general_ci_char_to_weight(x)
/*
#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x))
@@ -7461,8 +2898,7 @@ struct charset_info_st my_charset_filename=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -7678,30 +3114,6 @@ my_wc_mb_utf8mb4_no_range(CHARSET_INFO *cs __attribute__((unused)),
}
-static inline void
-my_tolower_utf8mb4(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
-{
- if (*wc <= uni_plane->maxchar)
- {
- MY_UNICASE_CHARACTER *page;
- if ((page= uni_plane->page[(*wc >> 8)]))
- *wc= page[*wc & 0xFF].tolower;
- }
-}
-
-
-static inline void
-my_toupper_utf8mb4(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
-{
- if (*wc <= uni_plane->maxchar)
- {
- MY_UNICASE_CHARACTER *page;
- if ((page= uni_plane->page[(*wc >> 8)]))
- *wc= page[*wc & 0xFF].toupper;
- }
-}
-
-
static size_t
my_caseup_utf8mb4(CHARSET_INFO *cs, const char *src, size_t srclen,
char *dst, size_t dstlen)
@@ -7710,14 +3122,14 @@ my_caseup_utf8mb4(CHARSET_INFO *cs, const char *src, size_t srclen,
int srcres, dstres;
const char *srcend= src + srclen;
char *dstend= dst + dstlen, *dst0= dst;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
DBUG_ASSERT(src != dst || cs->cset->caseup_multiply(cs) == 1);
while ((src < srcend) &&
(srcres= my_mb_wc_utf8mb4(cs, &wc,
(uchar *) src, (uchar*) srcend)) > 0)
{
- my_toupper_utf8mb4(uni_plane, &wc);
+ my_toupper_unicode(uni_plane, &wc);
if ((dstres= my_wc_mb_utf8mb4(cs, wc, (uchar*) dst, (uchar*) dstend)) <= 0)
break;
src+= srcres;
@@ -7734,12 +3146,12 @@ my_hash_sort_utf8mb4_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen,
my_wc_t wc;
int res;
const uchar *e= s + slen;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
register ulong m1= *nr1, m2= *nr2;
while ((res= my_mb_wc_utf8mb4(cs, &wc, (uchar*) s, (uchar*) e)) > 0)
{
- my_tosort_unicode(uni_plane, &wc, cs->state);
+ my_tosort_unicode(uni_plane, &wc);
MY_HASH_ADD_16(m1, m2, (uint) (wc & 0xFFFF));
if (wc > 0xFFFF)
{
@@ -7778,13 +3190,13 @@ my_caseup_str_utf8mb4(CHARSET_INFO *cs, char *src)
my_wc_t wc;
int srcres, dstres;
char *dst= src, *dst0= src;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
DBUG_ASSERT(cs->cset->caseup_multiply(cs) == 1);
while (*src &&
(srcres= my_mb_wc_utf8mb4_no_range(cs, &wc, (uchar *) src)) > 0)
{
- my_toupper_utf8mb4(uni_plane, &wc);
+ my_toupper_unicode(uni_plane, &wc);
if ((dstres= my_wc_mb_utf8mb4_no_range(cs, wc, (uchar*) dst)) <= 0)
break;
src+= srcres;
@@ -7804,14 +3216,14 @@ my_casedn_utf8mb4(CHARSET_INFO *cs,
int srcres, dstres;
const char *srcend= src + srclen;
char *dstend= dst + dstlen, *dst0= dst;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
DBUG_ASSERT(src != dst || cs->cset->casedn_multiply(cs) == 1);
while ((src < srcend) &&
(srcres= my_mb_wc_utf8mb4(cs, &wc,
(uchar*) src, (uchar*) srcend)) > 0)
{
- my_tolower_utf8mb4(uni_plane, &wc);
+ my_tolower_unicode(uni_plane, &wc);
if ((dstres= my_wc_mb_utf8mb4(cs, wc, (uchar*) dst, (uchar*) dstend)) <= 0)
break;
src+= srcres;
@@ -7827,13 +3239,13 @@ my_casedn_str_utf8mb4(CHARSET_INFO *cs, char *src)
my_wc_t wc;
int srcres, dstres;
char *dst= src, *dst0= src;
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
DBUG_ASSERT(cs->cset->casedn_multiply(cs) == 1);
while (*src &&
(srcres= my_mb_wc_utf8mb4_no_range(cs, &wc, (uchar *) src)) > 0)
{
- my_tolower_utf8mb4(uni_plane, &wc);
+ my_tolower_unicode(uni_plane, &wc);
if ((dstres= my_wc_mb_utf8mb4_no_range(cs, wc, (uchar*) dst)) <= 0)
break;
src+= srcres;
@@ -7876,7 +3288,7 @@ my_casedn_str_utf8mb4(CHARSET_INFO *cs, char *src)
static int
my_strcasecmp_utf8mb4(CHARSET_INFO *cs, const char *s, const char *t)
{
- MY_UNICASE_INFO *uni_plane= cs->caseinfo;
+ MY_CASEFOLD_INFO *uni_plane= cs->casefold;
while (s[0] && t[0])
{
my_wc_t s_wc,t_wc;
@@ -7888,7 +3300,7 @@ my_strcasecmp_utf8mb4(CHARSET_INFO *cs, const char *s, const char *t)
It represents a single byte character.
Convert it into weight according to collation.
*/
- s_wc= my_unicase_default_page00[(uchar) s[0]].tolower;
+ s_wc= my_u300_tolower_7bit((uchar) s[0]);
s++;
}
else
@@ -7903,7 +3315,7 @@ my_strcasecmp_utf8mb4(CHARSET_INFO *cs, const char *s, const char *t)
return strcmp(s, t);
s+= res;
- my_tolower_utf8mb4(uni_plane, &s_wc);
+ my_tolower_unicode(uni_plane, &s_wc);
}
@@ -7912,7 +3324,7 @@ my_strcasecmp_utf8mb4(CHARSET_INFO *cs, const char *s, const char *t)
if ((uchar) t[0] < 128)
{
/* Convert single byte character into weight */
- t_wc= my_unicase_default_page00[(uchar) t[0]].tolower;
+ t_wc= my_u300_tolower_7bit((uchar) t[0]);
t++;
}
else
@@ -7922,7 +3334,7 @@ my_strcasecmp_utf8mb4(CHARSET_INFO *cs, const char *s, const char *t)
return strcmp(s, t);
t+= res;
- my_tolower_utf8mb4(uni_plane, &t_wc);
+ my_tolower_unicode(uni_plane, &t_wc);
}
/* Now we have two weights, let's compare them */
@@ -7940,7 +3352,7 @@ my_wildcmp_utf8mb4(CHARSET_INFO *cs,
int escape, int w_one, int w_many)
{
return my_wildcmp_unicode(cs, str, strend, wildstr, wildend,
- escape, w_one, w_many, cs->caseinfo);
+ escape, w_one, w_many, cs->casefold);
}
@@ -7987,9 +3399,7 @@ my_charlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)),
#define DEFINE_STRNXFRM_UNICODE_NOPAD
#define MY_MB_WC(cs, pwc, s, e) my_mb_wc_utf8mb4_quick(pwc, s, e)
#define OPTIMIZE_ASCII 1
-#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR
-#define UNICASE_PAGE0 my_unicase_default_page00
-#define UNICASE_PAGES my_unicase_default_pages
+#define MY_WC_WEIGHT(x) my_general_ci_char_to_weight(x)
#define IS_MB4_CHAR(b0,b1,b2,b3) IS_UTF8MB4_STEP3(b0,b1,b2,b3)
#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x))
#define WEIGHT_MB1(b0) my_weight_mb1_utf8mb3_general_ci(b0)
@@ -8175,8 +3585,7 @@ struct charset_info_st my_charset_utf8mb4_general_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -8208,8 +3617,7 @@ struct charset_info_st my_charset_utf8mb4_bin=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -8241,8 +3649,7 @@ struct charset_info_st my_charset_utf8mb4_general_nopad_ci=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
@@ -8274,8 +3681,7 @@ struct charset_info_st my_charset_utf8mb4_nopad_bin=
NULL, /* uca */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
- NULL, /* casefold */
- &my_unicase_default,/* caseinfo */
+ &my_casefold_default,/* casefold */
NULL, /* state_map */
NULL, /* ident_map */
1, /* strxfrm_multiply */
diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c
index 86b7de97010..a908bdd2b95 100644
--- a/strings/ctype-win1250ch.c
+++ b/strings/ctype-win1250ch.c
@@ -711,7 +711,6 @@ struct charset_info_st my_charset_cp1250_czech_cs =
tab_cp1250_uni, /* tab_to_uni */
idx_uni_cp1250, /* tab_from_uni */
NULL, /* casefold */
- &my_unicase_default, /* caseinfo */
NULL, /* state_map */
NULL, /* ident_map */
2, /* strxfrm_multiply */
diff --git a/strings/ctype.c b/strings/ctype.c
index 7ff7e36ce2a..3d13fe55be8 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -1360,7 +1360,8 @@ outp:
int my_strnncollsp_nchars_generic(CHARSET_INFO *cs,
const uchar *str1, size_t len1,
const uchar *str2, size_t len2,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
int error;
len1= my_well_formed_length(cs, (const char *) str1,
@@ -1377,7 +1378,8 @@ int my_strnncollsp_nchars_generic(CHARSET_INFO *cs,
int my_strnncollsp_nchars_generic_8bit(CHARSET_INFO *cs,
const uchar *str1, size_t len1,
const uchar *str2, size_t len2,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
set_if_smaller(len1, nchars);
set_if_smaller(len2, nchars);
diff --git a/strings/json_normalize.c b/strings/json_normalize.c
index 0b7f172dae6..2c66c712e81 100644
--- a/strings/json_normalize.c
+++ b/strings/json_normalize.c
@@ -147,13 +147,16 @@ json_normalize_number(DYNAMIC_STRING *out, const char *str, size_t str_len)
magnitude = (long)(j - 1);
- /* skip the . */
- if (str[i] == '.')
- ++i;
+ if (i < str_len)
+ {
+ /* 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];
+ /* 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)
@@ -187,7 +190,7 @@ json_normalize_number(DYNAMIC_STRING *out, const char *str, size_t str_len)
err|= dynstr_append_mem(out, STRING_WITH_LEN("E"));
- if (str[i] == 'e' || str[i] == 'E')
+ if (i < str_len && (str[i] == 'e' || str[i] == 'E'))
{
char *endptr = NULL;
/* skip the [eE] */
diff --git a/strings/strcoll.inl b/strings/strcoll.inl
index eb5c6e3c717..a70009991df 100644
--- a/strings/strcoll.inl
+++ b/strings/strcoll.inl
@@ -390,7 +390,8 @@ static int
MY_FUNCTION_NAME(strnncollsp_nchars)(CHARSET_INFO *cs __attribute__((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
const uchar *a_end= a + a_length;
const uchar *b_end= b + b_length;
@@ -489,16 +490,12 @@ MY_FUNCTION_NAME(strnxfrm)(CHARSET_INFO *cs,
#error OPTIMIZE_ASCII must be defined for DEFINE_STRNXFRM_UNICODE
#endif
-#ifndef UNICASE_MAXCHAR
-#error UNICASE_MAXCHAR must be defined for DEFINE_STRNXFRM_UNICODE
+#if OPTIMIZE_ASCII && !defined(WEIGHT_MB1)
+#error WEIGHT_MB1 must be defined for DEFINE_STRNXFRM_UNICODE
#endif
-#ifndef UNICASE_PAGE0
-#error UNICASE_PAGE0 must be defined for DEFINE_STRNXFRM_UNICODE
-#endif
-
-#ifndef UNICASE_PAGES
-#error UNICASE_PAGES must be defined for DEFINE_STRNXFRM_UNICODE
+#ifndef MY_WC_WEIGHT
+#error MY_WC_WEIGHT must be defined for DEFINE_STRNXFRM_UNICODE
#endif
@@ -513,7 +510,6 @@ MY_FUNCTION_NAME(strnxfrm_internal)(CHARSET_INFO *cs __attribute__((unused)),
DBUG_ASSERT(src || !se);
DBUG_ASSERT((cs->state & MY_CS_LOWER_SORT) == 0);
- DBUG_ASSERT(0x7F <= UNICASE_MAXCHAR);
for (; dst < de && *nweights; (*nweights)--)
{
@@ -523,7 +519,7 @@ MY_FUNCTION_NAME(strnxfrm_internal)(CHARSET_INFO *cs __attribute__((unused)),
break;
if (src[0] <= 0x7F)
{
- wc= UNICASE_PAGE0[*src++].sort;
+ wc= WEIGHT_MB1(*src++);
PUT_WC_BE2_HAVE_1BYTE(dst, de, wc);
continue;
}
@@ -531,14 +527,7 @@ MY_FUNCTION_NAME(strnxfrm_internal)(CHARSET_INFO *cs __attribute__((unused)),
if ((res= MY_MB_WC(cs, &wc, src, se)) <= 0)
break;
src+= res;
- if (wc <= UNICASE_MAXCHAR)
- {
- MY_UNICASE_CHARACTER *page;
- if ((page= UNICASE_PAGES[wc >> 8]))
- wc= page[wc & 0xFF].sort;
- }
- else
- wc= MY_CS_REPLACEMENT_CHARACTER;
+ wc= MY_WC_WEIGHT(wc);
PUT_WC_BE2_HAVE_1BYTE(dst, de, wc);
}
return dst - dst0;
@@ -721,9 +710,7 @@ MY_FUNCTION_NAME(strnxfrm_nopad)(CHARSET_INFO *cs,
#undef MY_FUNCTION_NAME
#undef MY_MB_WC
#undef OPTIMIZE_ASCII
-#undef UNICASE_MAXCHAR
-#undef UNICASE_PAGE0
-#undef UNICASE_PAGES
+#undef MY_WC_WEIGHT
#undef WEIGHT_ILSEQ
#undef WEIGHT_MB1
#undef WEIGHT_MB2
diff --git a/strings/strings_def.h b/strings/strings_def.h
index c919861d8aa..39fdd1780a4 100644
--- a/strings/strings_def.h
+++ b/strings/strings_def.h
@@ -108,12 +108,14 @@ static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len)
int my_strnncollsp_nchars_generic(CHARSET_INFO *cs,
const uchar *str1, size_t len1,
const uchar *str2, size_t len2,
- size_t nchars);
+ size_t nchars,
+ uint flags);
int my_strnncollsp_nchars_generic_8bit(CHARSET_INFO *cs,
const uchar *str1, size_t len1,
const uchar *str2, size_t len2,
- size_t nchars);
+ size_t nchars,
+ uint flags);
uint my_8bit_charset_flags_from_data(CHARSET_INFO *cs);
uint my_8bit_collation_flags_from_data(CHARSET_INFO *cs);
diff --git a/strings/uctypedump.c b/strings/uctypedump.c
index 30ae33afee1..397b6e586f1 100644
--- a/strings/uctypedump.c
+++ b/strings/uctypedump.c
@@ -120,7 +120,7 @@ int main(int ac, char ** av)
}
else
{
- strcpy(tok,s);
+ safe_strcpy(tok, sizeof(tok), s);
}
end=tok+strlen(tok);
@@ -225,7 +225,7 @@ int main(int ac, char ** av)
{
char plane_name[128]="NULL";
if(uctype[plane].ctype){
- sprintf(plane_name,"uctype_page%02X",(uint) plane);
+ snprintf(plane_name,sizeof(plane_name),"uctype_page%02X",(uint) plane);
}
printf("\t{%d,%s}%s\n",uctype[plane].pctype,plane_name,plane<255?",":"");
}
diff --git a/strings/unidata-dump.c b/strings/unidata-dump.c
new file mode 100644
index 00000000000..5ecc8cb0c8c
--- /dev/null
+++ b/strings/unidata-dump.c
@@ -0,0 +1,1110 @@
+const char COPYING[]= "\
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.\n\
+ Copyright (c) 2009, 2023, MariaDB Corporation.\n\
+\n\
+ This program is free software; you can redistribute it and/or modify\n\
+ it under the terms of the GNU General Public License as published by\n\
+ the Free Software Foundation; version 2 of the License.\n\
+\n\
+ This program is distributed in the hope that it will be useful,\n\
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
+ GNU General Public License for more details.\n\
+\n\
+ You should have received a copy of the GNU General Public License\n\
+ along with this program; if not, write to the Free Software\n\
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA\n\
+*/\n";
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define MAX_UNI_CHAR 0x10FFFF
+#define MAX_UNI_PAGE 0x10FF
+
+#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1))
+
+
+typedef unsigned int my_wchar_t;
+
+/* Character types, as in m_ctype.h */
+#define _MY_U 01 /* Upper case */
+#define _MY_L 02 /* Lower case */
+#define _MY_NMR 04 /* Numeral (digit) */
+#define _MY_SPC 010 /* Spacing character */
+#define _MY_PNT 020 /* Punctuation */
+#define _MY_CTR 040 /* Control character */
+#define _MY_B 0100 /* Blank */
+#define _MY_X 0200 /* heXadecimal digit */
+
+#define CT_MAX _MY_X
+#define CT_CJK _MY_L | _MY_U
+#define CT_HANGUL _MY_L | _MY_U
+#define CT_NONE 0
+
+
+/* Decomposition types */
+typedef enum
+{
+ DT_UNKNOWN,
+ DT_FONT,
+ DT_NOBREAK,
+ DT_INITIAL,
+ DT_MEDIAL,
+ DT_FINAL,
+ DT_ISOLATED,
+ DT_CIRCLE,
+ DT_SUPER,
+ DT_SUB,
+ DT_VERTICAL,
+ DT_WIDE,
+ DT_NARROW,
+ DT_SMALL,
+ DT_SQUARE,
+ DT_FRACTION,
+ DT_COMPAT
+} decomposition_type_t;
+
+
+typedef enum
+{
+ PAGE_DATA_USELESS= 0,
+ PAGE_DATA_IMPORTANT= 1,
+ PAGE_DATA_DUMMY= 2
+} page_data_type_t;
+
+
+typedef struct
+{
+ page_data_type_t page_tab;
+ int page_overridden;
+ int page_ctype;
+} PAGE_STAT;
+
+
+typedef struct
+{
+ const char *mode_name;
+ int print_ctype;
+ int print_toupper;
+ int print_tolower;
+ int print_noaccent;
+ int print_noaccent_tolower;
+ int print_noaccent_toupper;
+ int print_curly_brackets_in_items;
+ int print_curly_brackets_in_index;
+ int chars_per_line;
+ int single_array;
+ int pages_per_line_in_index;
+ int const_data;
+ const char *page_data_type_name;
+ const char *page_name;
+ const char *page_name_derived;
+ const char *index_data_type_name;
+ const char *index_name;
+} UNIDATA_OPT_MODE;
+
+
+typedef struct
+{
+ my_wchar_t max_char;
+ my_wchar_t dummy_pages_codepoint_max;
+ const char *filename;
+ UNIDATA_OPT_MODE mode;
+} UNIDATA_OPT;
+
+
+my_wchar_t npages_by_opt(const UNIDATA_OPT *opt)
+{
+ return (opt->max_char + 1) / 256;
+}
+
+
+typedef struct my_ctype_name_st
+{
+ const char *name;
+ int val;
+ int to_be_decomposed;
+} MY_CTYPE_NAME_ST;
+
+
+static MY_CTYPE_NAME_ST my_ctype_name[]=
+{
+ {"Lu", _MY_U, 1}, /* Letter, Uppercase */
+ {"Ll", _MY_L, 1}, /* Letter, Lowercase */
+ {"Lt", _MY_U, 1}, /* Letter, Titlecase */
+ {"Lo", _MY_L, 1}, /* Letter, other */
+ {"Lm", _MY_L, 0}, /* Letter, Modifier */
+
+ {"Nd", _MY_NMR, 0}, /* Number, Decimal Digit */
+ {"Nl", _MY_NMR|_MY_U|_MY_L, 0}, /* Number, Letter */
+ {"No", _MY_NMR|_MY_PNT, 0}, /* Number, Other */
+
+ {"Mn", _MY_L|_MY_PNT, 0}, /* Mark, Nonspacing */
+ {"Mc", _MY_L|_MY_PNT, 1}, /* Mark, Spacing Combining */
+ {"Me", _MY_L|_MY_PNT, 0}, /* Mark, Enclosing */
+
+ {"Pc", _MY_PNT, 0}, /* Punctuation, Connector */
+ {"Pd", _MY_PNT, 0}, /* Punctuation, Dash */
+ {"Ps", _MY_PNT, 0}, /* Punctuation, Open */
+ {"Pe", _MY_PNT, 0}, /* Punctuation, Close */
+ {"Pi", _MY_PNT, 0}, /* Punctuation, Initial quote */
+ {"Pf", _MY_PNT, 0}, /* Punctuation, Final quote */
+ {"Po", _MY_PNT, 0}, /* Punctuation, Other */
+
+ {"Sm", _MY_PNT, 0}, /* Symbol, Math */
+ {"Sc", _MY_PNT, 0}, /* Symbol, Currency */
+ {"Sk", _MY_PNT, 0}, /* Symbol, Modifier */
+ {"So", _MY_PNT, 0}, /* Symbol, Other */
+
+ {"Zs", _MY_SPC, 0}, /* Separator, Space */
+ {"Zl", _MY_SPC, 0}, /* Separator, Line */
+ {"Zp", _MY_SPC, 0}, /* Separator, Paragraph */
+
+ {"Cc", _MY_CTR, 0}, /* Other, Control */
+ {"Cf", _MY_CTR, 0}, /* Other, Format */
+ {"Cs", _MY_CTR, 0}, /* Other, Surrogate */
+ {"Co", _MY_CTR, 0}, /* Other, Private Use */
+ {"Cn", _MY_CTR, 0}, /* Other, Not Assigned */
+ {NULL, 0, 0}
+};
+
+
+static const MY_CTYPE_NAME_ST *
+ctype_name_st_find(my_wchar_t codepoint, const char *tok)
+{
+ MY_CTYPE_NAME_ST *p;
+ for (p= my_ctype_name; p->name; p++)
+ {
+ if (!strncasecmp(p->name, tok, 2))
+ return p;
+ }
+ return NULL;
+}
+
+
+static int
+ctype_name_st_to_num(const MY_CTYPE_NAME_ST *st, my_wchar_t codepoint)
+{
+ if ((codepoint >= 'a' && codepoint <= 'z') ||
+ (codepoint >= 'A' && codepoint <= 'Z'))
+ return st->val | _MY_X;
+ return st->val;
+}
+
+
+static UNIDATA_OPT opt_caseinfo=
+{
+ 0x10FFFF, /* max_char */
+ 0x7FF, /* dummy_pages_codepoint_max == utf8 mb2 range */
+ NULL, /*filename*/
+ {
+ "caseinfo", /* mode name */
+ 0, /* print_ctype */
+ 1, /* print_toupper */
+ 1, /* print_tolower */
+ 0, /* print_noaccent */
+ 0, /* print_noaccent_tolower */
+ 1, /* print_noaccent_toupper */
+ 1, /* print_curly_brackets_in_items */
+ 0, /* print_curly_brackets_in_index */
+ 2, /* chars_per_line */
+ 0, /* single_array */
+ 8, /* pages_per_line_in_index */
+ 0, /* const_data */
+ "MY_UNICASE_CHARACTER", /* page_data_type_name */
+ "plane", /* page_name */
+ NULL, /* page_name_derived */
+ "MY_UNICASE_CHARACTER *", /* index_data_type_name */
+ "my_unicase_default_pages" /* index_name */
+ }
+};
+
+
+static UNIDATA_OPT opt_casefold=
+{
+ 0x10FFFF, /* max_char */
+ 0x7FF, /* dummy_pages_codepoint_max == utf8 mb2 range */
+ NULL, /*filename*/
+ {
+ "casefold", /* mode name */
+ 0, /* print_ctype */
+ 1, /* print_toupper */
+ 1, /* print_tolower */
+ 0, /* print_noaccent */
+ 0, /* print_noaccent_tolower */
+ 0, /* print_noaccent_toupper */
+ 1, /* print_curly_brackets_in_items */
+ 0, /* print_curly_brackets_in_index */
+ 2, /* chars_per_line */
+ 0, /* single_array */
+ 8, /* pages_per_line_in_index */
+ 1, /* const_data */
+ "MY_CASEFOLD_CHARACTER" , /* page_data_type_name */
+ "page", /* page_name */
+ NULL, /* page_name_derived */
+ "MY_CASEFOLD_CHARACTER *", /* index_data_type_name */
+ "my_casefold_default_pages" /* index_name */
+ }
+};
+
+
+static UNIDATA_OPT opt_casefold_tr=
+{
+ 0x10FFFF, /* max_char */
+ 0x7FF, /* dummy_pages_codepoint_max == utf8 mb2 range */
+ NULL, /*filename*/
+ {
+ "casefold-tr", /* mode name */
+ 0, /* print_ctype */
+ 1, /* print_toupper */
+ 1, /* print_tolower */
+ 0, /* print_noaccent */
+ 0, /* print_noaccent_tolower */
+ 0, /* print_noaccent_toupper */
+ 1, /* print_curly_brackets_in_items */
+ 0, /* print_curly_brackets_in_index */
+ 2, /* chars_per_line */
+ 0, /* single_array */
+ 8, /* pages_per_line_in_index */
+ 1, /* const_data */
+ "MY_CASEFOLD_CHARACTER" , /* page_data_type_name */
+ "page_tr", /* page_name */
+ "page", /* page_name_derived */
+ "MY_CASEFOLD_CHARACTER *", /* index_data_type_name */
+ "my_casefold_tr_pages" /* index_name */
+ }
+};
+
+
+static UNIDATA_OPT opt_weight_general_ci=
+{
+ 0xFFFF, /* max_char */
+ 0x7FF, /* dummy_pages_codepoint_max == utf8 mb2 range */
+ NULL, /*filename*/
+ {
+ "weight_general_ci", /* mode name */
+ 0, /* print_ctype */
+ 0, /* print_toupper */
+ 0, /* print_tolower */
+ 0, /* print_noaccent */
+ 0, /* print_noaccent_tolower */
+ 1, /* print_noaccent_toupper */
+ 0, /* print_curly_brackets_in_items */
+ 0, /* print_curly_brackets_in_index */
+ 8, /* chars_per_line */
+ 0, /* single_array */
+ 2, /* pages_per_line_in_index */
+ 1, /* const_data */
+ "uint16", /* page_data_type_name */
+ "weight_general_ci_page", /* page_name */
+ NULL, /* page_name_derived */
+ "uint16 *", /* index_data_type_name */
+ "weight_general_ci_index" /* index_name */
+ }
+};
+
+
+static UNIDATA_OPT opt_weight_general_mysql500_ci=
+{
+ 0xFFFF, /* max_char */
+ 0x7FF, /* dummy_pages_codepoint_max == utf8 mb2 range */
+ NULL, /*filename*/
+ {
+ "weight_general_mysql500_ci", /* mode name */
+ 0, /* print_ctype */
+ 0, /* print_toupper */
+ 0, /* print_tolower */
+ 0, /* print_noaccent */
+ 0, /* print_noaccent_tolower */
+ 1, /* print_noaccent_toupper */
+ 0, /* print_curly_brackets_in_items */
+ 0, /* print_curly_brackets_in_index */
+ 8, /* chars_per_line */
+ 0, /* single_array */
+ 2, /* pages_per_line_in_index */
+ 1, /* const_data */
+ "uint16", /* page_data_type_name */
+ "weight_general_mysql500_ci_page", /* page_name */
+ "weight_general_ci_page", /* page_name_derived */
+ "uint16 *", /* index_data_type_name */
+ "weight_general_mysql500_ci_index" /* index_name */
+ }
+};
+
+
+static UNIDATA_OPT opt_ctype=
+{
+ 0x10FFFF, /* max_char */
+ 0x7FF, /* dummy_pages_codepoint_max == utf8 mb2 range */
+ NULL, /*filename*/
+ {
+ "ctype", /* mode name */
+ 1, /* print_ctype */
+ 0, /* print_toupper */
+ 0, /* print_tolower */
+ 0, /* print_noaccent */
+ 0, /* print_noaccent_tolower */
+ 0, /* print_noaccent_toupper */
+ 0, /* print_curly_brackets_in_items */
+ 1, /* print_curly_brackets_in_index */
+ 16, /* chars_per_line */
+ 0, /* single_array */
+ 1, /* pages_per_line_in_index */
+ 1, /* const_data */
+ "unsigned char", /* page_data_type_name */
+ "uctype_page", /* page_name */
+ NULL, /* page_name_derived */
+ "MY_UNI_CTYPE", /* index_data_type_name */
+ "my_uni_ctype" /* index_name */
+ }
+};
+
+
+int opt_set_mode(UNIDATA_OPT *to, const char *name_and_value, const char *value)
+{
+ if (!strcmp(value, "casefold"))
+ {
+ to->mode= opt_casefold.mode;
+ return 0;
+ }
+ else if (!strcmp(value, "casefold-tr"))
+ {
+ to->mode= opt_casefold_tr.mode;
+ return 0;
+ }
+ else if (!strcmp(value, "caseinfo"))
+ {
+ to->mode= opt_caseinfo.mode;
+ return 0;
+ }
+ else if (!strcmp(value, "weight_general_ci"))
+ {
+ to->mode= opt_weight_general_ci.mode;
+ return 0;
+ }
+ else if (!strcmp(value, "weight_general_mysql500_ci"))
+ {
+ to->mode= opt_weight_general_mysql500_ci.mode;
+ return 0;
+ }
+ else if (!strcmp(value, "ctype"))
+ {
+ to->mode= opt_ctype.mode;
+ return 0;
+ }
+ fprintf(stderr, "Bad option: %s\n", name_and_value);
+ return 1;
+}
+
+
+static decomposition_type_t
+get_decomposition_type(const char *str)
+{
+ if (!strcmp(str, "<font>")) return DT_FONT;
+ if (!strcmp(str, "<noBreak>")) return DT_NOBREAK;
+ if (!strcmp(str, "<initial>")) return DT_INITIAL;
+ if (!strcmp(str, "<medial>")) return DT_MEDIAL;
+ if (!strcmp(str, "<final>")) return DT_FINAL;
+ if (!strcmp(str, "<isolated>")) return DT_ISOLATED;
+ if (!strcmp(str, "<circle>")) return DT_CIRCLE;
+ if (!strcmp(str, "<super>")) return DT_SUPER;
+ if (!strcmp(str, "<sub>")) return DT_SUB;
+ if (!strcmp(str, "<vertical>")) return DT_VERTICAL;
+ if (!strcmp(str, "<wide>")) return DT_WIDE;
+ if (!strcmp(str, "<narrow>")) return DT_NARROW;
+ if (!strcmp(str, "<small>")) return DT_SMALL;
+ if (!strcmp(str, "<square>")) return DT_SQUARE;
+ if (!strcmp(str, "<fraction>")) return DT_FRACTION;
+ if (!strcmp(str, "<compat>")) return DT_COMPAT;
+ return DT_UNKNOWN;
+}
+
+
+#define MAX_DECOMP 20
+
+
+typedef struct
+{
+ int ctype;
+ int toupper;
+ int tolower;
+ int noaccent;
+ int noaccent_tolower;
+ int noaccent_toupper;
+ int decomp_type;
+ int decomp[MAX_DECOMP];
+ int to_be_decomposed;
+} UNIDATA_CHAR;
+
+
+
+/************* Initialization functions *********/
+
+
+static int
+strip_accent(UNIDATA_CHAR *code, int i)
+{
+ if (code[i].decomp[0] &&
+ code[i].decomp[1] >= 0x0300 &&
+ code[i].decomp[1] <= 0x036F &&
+ code[i].decomp[2] == 0)
+ return strip_accent(code, code[i].decomp[0]);
+ return i;
+}
+
+
+static void
+set_noaccent(const UNIDATA_OPT *opt, UNIDATA_CHAR *code)
+{
+ my_wchar_t i;
+ for (i= 0; i <= opt->max_char; i++)
+ {
+ code[i].noaccent= strip_accent(code, i);
+ }
+}
+
+
+static void
+set_noaccent_tolower(const UNIDATA_OPT *opt, UNIDATA_CHAR *code)
+{
+ my_wchar_t i;
+ for (i= 0; i <= opt->max_char; i++)
+ {
+ code[i].noaccent_tolower= code[code[i].noaccent].tolower;
+ }
+}
+
+
+static void
+set_noaccent_toupper(const UNIDATA_OPT *opt, UNIDATA_CHAR *code)
+{
+ my_wchar_t i;
+ for (i= 0; i <= opt->max_char; i++)
+ {
+ code[i].noaccent_toupper= code[code[i].noaccent].toupper;
+ }
+}
+
+
+static void
+set_default_case_folding(const UNIDATA_OPT *opt, UNIDATA_CHAR *code)
+{
+ my_wchar_t i;
+ for (i= 0; i <= opt->max_char; i++)
+ {
+ code[i].tolower= i;
+ code[i].toupper= i;
+ }
+}
+
+
+/*
+ Fill ideographs
+*/
+
+static void
+fill_cjk(UNIDATA_CHAR *code)
+{
+ size_t i;
+ /* CJK Ideographs Extension A (U+3400 - U+4DB5) */
+ for(i=0x3400;i<=0x4DB5;i++)
+ {
+ code[i].tolower=i;
+ code[i].ctype= CT_CJK;
+ }
+ /* CJK Ideographs (U+4E00 - U+9FA5) */
+ for(i=0x4E00;i<=0x9FA5;i++)
+ {
+ code[i].tolower=i;
+ code[i].ctype= CT_CJK;
+ }
+ /* Hangul Syllables (U+AC00 - U+D7A3) */
+ for(i=0xAC00;i<=0xD7A3;i++)
+ {
+ code[i].tolower=i;
+ code[i].ctype= CT_HANGUL;
+ }
+}
+
+
+/************* Loading functions ***************/
+
+
+static void handle_general_category(const UNIDATA_OPT *opt,
+ UNIDATA_CHAR *ch,
+ const char *tok,
+ my_wchar_t codepoint)
+{
+ /*
+ TODO: check if ctype is set correctly.
+ A difference can break fulltext indexes.
+ */
+
+ const MY_CTYPE_NAME_ST *ct= ctype_name_st_find(
+ (my_wchar_t) codepoint, tok);
+ if (ct)
+ {
+ ch->ctype|= ctype_name_st_to_num(
+ ct,
+ (my_wchar_t) codepoint);
+ ch->to_be_decomposed= ct->to_be_decomposed;
+ }
+}
+
+
+int handle_decomposition(UNIDATA_CHAR *ch, char *tok, const char *str)
+{
+ char *lt, *part;
+ size_t num;
+
+ if (!ch->to_be_decomposed)
+ return 0; /* Decompose only letters */
+
+ for (part= strtok_r(tok, " ", &lt), num= 0;
+ part;
+ part= strtok_r(NULL, " ", &lt))
+ {
+ char *end;
+ if (part[0] == '<')
+ {
+ if ((ch->decomp_type= get_decomposition_type(part)) == DT_UNKNOWN)
+ {
+ fprintf(stderr, "Unknown decomposition type:\n%s\n", str);
+ return 1;
+ }
+ continue;
+ }
+
+ if (num + 1 >= MAX_DECOMP)
+ {
+ fprintf(stderr, "Too many decomposition parts:\n%s\n", str);
+ return 1;
+ }
+ ch->decomp[num]= strtol(part,&end,16);
+ ch->decomp[num+1]= 0;
+ num++;
+ }
+ return 0;
+}
+
+
+static int
+parse_unidata_line(const UNIDATA_OPT *opt, char *str, UNIDATA_CHAR *unidata)
+{
+ unsigned long codepoint= 0;
+ int fieldno= 0;
+ char *s;
+
+ for (s= str; *s; fieldno++)
+ {
+ char *tok= s, *e;
+
+ if ((e= strchr(s,';')))
+ {
+ *e= '\0';
+ s= e + 1;
+ }
+ else
+ {
+ s+= strlen(s);
+ }
+
+ switch (fieldno)
+ {
+ case 0: /* Code point */
+ codepoint= strtoul(tok, NULL, 16);
+ if (codepoint > opt->max_char)
+ return 1;
+ break;
+ case 1: /* name */
+ break;
+ case 2: /* general category */
+ handle_general_category(opt, &unidata[codepoint],
+ tok, (my_wchar_t) codepoint);
+ break;
+ case 3: /* Canonical combining class */
+ break;
+ case 4: /* BiDi class */
+ break;
+ case 5: /* Decomposition type */
+ if (tok[0] && handle_decomposition(&unidata[codepoint], tok, str))
+ return -1;
+ break;
+ case 6: /* Numeric_Type, Numeric Value */
+ break;
+ case 7: /* Numeric_Type, Numeric Value */
+ break;
+ case 8: /* Numeric_Type, Numeric Value */
+ break;
+ case 9: /* BiDi mirrored */
+ break;
+ case 10: /* Unicode_1_Name */
+ break;
+ case 11: /* ISO_Comment */
+ break;
+ case 12: /*Simple_Uppercase_Mapping*/
+ if (tok[0])
+ unidata[codepoint].toupper= strtol(tok, NULL, 16);
+ break;
+ case 13: /*Simple_Lowercase_Mapping*/
+ if (tok[0])
+ unidata[codepoint].tolower= strtol(tok, NULL, 16);
+ break;
+ case 14: /* Simple_Titlecase_Mapping */
+ break;
+ }
+ }
+
+ return 0;
+}
+
+
+static int
+load_unidata_file(const UNIDATA_OPT *opt, FILE *f, UNIDATA_CHAR *unidata)
+{
+ char str[1024];
+
+ while (fgets(str, sizeof(str), f))
+ {
+ if (parse_unidata_line(opt, str, unidata) < 0)
+ return 1;
+ }
+ return 0;
+}
+
+
+static int
+load_unidata(const UNIDATA_OPT *opt, UNIDATA_CHAR *unidata)
+{
+ FILE *f;
+ int rc;
+ if (!(f= fopen(opt->filename, "r")))
+ {
+ fprintf(stderr, "Could not open file '%s'\n", opt->filename);
+ return 1;
+ }
+ rc= load_unidata_file(opt, f, unidata);
+ fclose(f);
+ return rc;
+}
+
+/************** Printing functions ********************/
+
+static void
+print_one_char(const UNIDATA_OPT *opt, UNIDATA_CHAR *data, int code)
+{
+ UNIDATA_CHAR *ch= &data[code];
+ const char *comma= "";
+
+ if (opt->mode.print_curly_brackets_in_items)
+ printf("{");
+
+ if (opt->mode.print_ctype)
+ {
+ printf("%s", comma);
+ printf("%3d", ch->ctype);
+ comma= ",";
+ }
+
+ if (opt->mode.print_toupper)
+ {
+ printf("%s", comma);
+ printf("0x%04X", ch->toupper);
+ comma= ",";
+ }
+
+ if (opt->mode.print_tolower)
+ {
+ printf("%s", comma);
+ printf("0x%04X", ch->tolower);
+ comma= ",";
+ }
+
+ if (opt->mode.print_noaccent)
+ {
+ printf("%s", comma);
+ printf("0x%04X", ch->noaccent);
+ comma= ",";
+ }
+
+ if (opt->mode.print_noaccent_tolower)
+ {
+ printf("%s", comma);
+ printf("0x%04X", ch->noaccent_tolower);
+ comma= ",";
+ }
+
+ if (opt->mode.print_noaccent_toupper)
+ {
+ printf("%s", comma);
+ printf("0x%04X", ch->noaccent_toupper);
+ comma= ",";
+ }
+
+ if (opt->mode.print_curly_brackets_in_items)
+ printf("}");
+
+ if (opt->mode.single_array ||
+ (code & 0xFF) != 0xFF) /* Don't print comma for the last char in a page */
+ printf(",");
+ else
+ printf(" ");
+}
+
+
+static void
+print_one_page(const UNIDATA_OPT *opt, UNIDATA_CHAR *data,
+ my_wchar_t pageno, const PAGE_STAT *pstat)
+{
+ my_wchar_t charnum;
+
+ if (!opt->mode.single_array || pageno == 0)
+ {
+ printf("%s%s%s %s%02X[256]={%s\n",
+ pageno == 0 ? "" : "static ",
+ opt->mode.const_data ? "const " : "",
+ opt->mode.page_data_type_name, opt->mode.page_name,
+ (unsigned int) pageno,
+ pstat[pageno].page_tab == PAGE_DATA_DUMMY ?
+ " /* This page is dummy */" : "");
+ }
+
+ for (charnum= 0; charnum < 256; charnum++)
+ {
+ my_wchar_t codepoint= (pageno << 8) + charnum;
+ my_wchar_t rem= charnum % opt->mode.chars_per_line;
+ if (!rem)
+ printf(" ");
+ print_one_char(opt, data, codepoint);
+ if (rem + 1 == opt->mode.chars_per_line)
+ {
+ printf(" /* %04X */", (codepoint + 1) - opt->mode.chars_per_line);
+ printf("\n");
+ }
+ }
+ if (!opt->mode.single_array)
+ printf("};\n\n");
+}
+
+
+static const char *page_name_in_index(const UNIDATA_OPT *opt,
+ const PAGE_STAT *pstat,
+ my_wchar_t pageno)
+{
+ if (!opt->mode.page_name_derived)
+ return opt->mode.page_name;
+
+ return pstat[pageno].page_overridden ?
+ opt->mode.page_name :
+ opt->mode.page_name_derived;
+}
+
+
+static void print_page_index(const UNIDATA_OPT *opt,
+ const PAGE_STAT *pstat)
+{
+ my_wchar_t page;
+ my_wchar_t npages= npages_by_opt(opt);
+ int printing_ctype= !strcmp(opt->mode.index_data_type_name, "MY_UNI_CTYPE");
+
+ printf("%s%s %s[%d]={\n",
+ opt->mode.const_data ? "const " : "",
+ opt->mode.index_data_type_name, opt->mode.index_name,
+ (unsigned int) npages);
+
+ for (page= 0; page < npages; page++)
+ {
+ my_wchar_t rem= page % opt->mode.pages_per_line_in_index;
+ if (!rem)
+ printf(" ");
+ if (opt->mode.print_curly_brackets_in_index)
+ printf("{");
+ if (printing_ctype)
+ printf("%d,", pstat[page].page_ctype);
+
+ if (pstat[page].page_tab)
+ printf("%s%02X", page_name_in_index(opt, pstat, page), page);
+ else
+ printf("NULL");
+
+ if (opt->mode.print_curly_brackets_in_index)
+ printf("}");
+
+ if (page + 1 < npages)
+ printf(",");
+
+ if (rem + 1 == opt->mode.pages_per_line_in_index)
+ printf("\n");
+ else
+ printf(" ");
+ }
+ printf("};\n");
+}
+
+
+static void print(UNIDATA_OPT *opt, UNIDATA_CHAR *unidata, const PAGE_STAT *pstat)
+{
+ my_wchar_t npages= npages_by_opt(opt);
+ my_wchar_t page;
+
+ /* Print all pages */
+ for (page= 0; page < npages; page++)
+ {
+ if (opt->mode.page_name_derived && !pstat[page].page_overridden)
+ continue;
+ if (opt->mode.single_array || pstat[page].page_tab)
+ print_one_page(opt, unidata, page, pstat);
+ }
+
+ /* Print index */
+ if (!opt->mode.single_array)
+ print_page_index(opt, pstat);
+}
+
+
+void print_command_line_options(int ac, char **av)
+{
+ int i;
+ printf("/*\n");
+ printf(" Generated by:\n");
+ for (i= 0; i < ac; i++)
+ {
+ printf(" %s%s%s\n", i > 0 ? " " : "", av[i], i+1 < ac ? " \\" :"");
+ }
+ printf("\n");
+ printf("*/\n");
+}
+
+
+static void calc_page_parameters(const UNIDATA_OPT *opt, const UNIDATA_CHAR *code,
+ PAGE_STAT *pstat)
+{
+ my_wchar_t npages= npages_by_opt(opt);
+ my_wchar_t page;
+ for(page= 0; page < npages; page++)
+ {
+ int ntype[CT_MAX + 1], t;
+ int character, done=0;
+
+ memset(ntype,0,sizeof(ntype));
+ for(character= 0;character < 256; character++)
+ {
+ size_t cod= (page << 8) + character;
+ const UNIDATA_CHAR *ch= &code[cod];
+ ntype[ch->ctype]++;
+
+ if((ch->tolower != cod ||
+ ch->toupper != cod ||
+ ch->noaccent != cod ||
+ ch->noaccent_toupper != cod) &&
+ (opt->mode.print_tolower ||
+ opt->mode.print_toupper ||
+ opt->mode.print_noaccent ||
+ opt->mode.print_noaccent_toupper))
+ {
+ pstat[page].page_tab= PAGE_DATA_IMPORTANT;
+ }
+ }
+
+ if (opt->mode.print_ctype)
+ {
+ for (t= 0; t <= CT_MAX; t++)
+ {
+ if(ntype[t]==256)
+ {
+ /* All ctypes are the same */
+ pstat[page].page_ctype= t;
+ done=1;
+ break;
+ }
+ }
+ }
+ else
+ {
+ done= 1; /* Don't need ctype */
+ }
+
+ if(!done)
+ {
+ /* Mixed page, lets create the table */
+ pstat[page].page_ctype= CT_NONE;
+ pstat[page].page_tab= PAGE_DATA_IMPORTANT;
+ }
+ if (!pstat[page].page_tab &&
+ page <= (opt->dummy_pages_codepoint_max >> 8))
+ pstat[page].page_tab= PAGE_DATA_DUMMY;
+ }
+}
+
+
+static UNIDATA_CHAR code[MAX_UNI_CHAR + 1];
+static PAGE_STAT pstat[MAX_UNI_PAGE + 1];
+
+
+int usage(int ac, char **av)
+{
+ fprintf(stderr, "Usage: %s filename\n", av[0]);
+ return 1;
+}
+
+
+const char *one_opt(const char *option, const char *name, size_t length)
+{
+ if (!strncmp(option, name, length))
+ return option + length;
+ return 0;
+}
+
+
+int get_option_bool(int *to, const char *name_and_value, const char *value)
+{
+ if (!strcmp(value, "1"))
+ *to= 1;
+ else if (!strcmp(value, "0"))
+ *to= 0;
+ else
+ {
+ fprintf(stderr, "Bad option: %s\n", name_and_value);
+ return 1;
+ }
+ return 0;
+}
+
+
+int get_option_codepoint(my_wchar_t *to, const char *name_and_value, const char *value)
+{
+ unsigned long codepoint= value[0]=='0' && value[1]=='x' ?
+ strtoul(value + 2, NULL, 16) :
+ strtoul(value, NULL, 10);
+ if (codepoint > MAX_UNI_CHAR)
+ {
+ fprintf(stderr, "Too large --max-char: %s\n", name_and_value);
+ return 1;
+ }
+ *to= (my_wchar_t) codepoint;
+ return 0;
+}
+
+
+int process_param(UNIDATA_OPT *opt, int ac, char **av)
+{
+ int i;
+ if (ac < 2)
+ return usage(ac, av);
+ for (i= 1; i < ac; i++)
+ {
+ const char *op;
+ if ((op= one_opt(av[i], STRING_WITH_LEN("--mode="))))
+ {
+ if (opt_set_mode(opt, av[i], op))
+ return 1;
+ }
+ else if ((op= one_opt(av[i], STRING_WITH_LEN("--max-char="))))
+ {
+ if (get_option_codepoint(&opt->max_char, av[i], op))
+ return 1;
+ }
+ else if ((op= one_opt(av[i], STRING_WITH_LEN("--print-toupper="))))
+ {
+ if (get_option_bool(&opt->mode.print_toupper, av[i], op))
+ return 1;
+ }
+ else if ((op= one_opt(av[i], STRING_WITH_LEN("--print-tolower="))))
+ {
+ if (get_option_bool(&opt->mode.print_tolower, av[i], op))
+ return 1;
+ }
+ else if ((op= one_opt(av[i], STRING_WITH_LEN("--print-noaccent-toupper="))))
+ {
+ if (get_option_bool(&opt->mode.print_noaccent_toupper, av[i], op))
+ return 1;
+ }
+ else if ((op= one_opt(av[i], STRING_WITH_LEN("--page-name="))))
+ {
+ opt->mode.page_name= op;
+ }
+ else if ((op= one_opt(av[i], STRING_WITH_LEN("--page-name-derived="))))
+ {
+ opt->mode.page_name_derived= op;
+ }
+ else if ((op= one_opt(av[i], STRING_WITH_LEN("--index-name="))))
+ {
+ opt->mode.index_name= op;
+ }
+ else
+ {
+ if (av[i][0] == '-' && av[i][1] == '-')
+ {
+ fprintf(stderr, "Unknown option: %s\n", av[i]);
+ return 1;
+ }
+ break;
+ }
+ }
+ if (i + 1 != ac)
+ return usage(ac, av);
+ opt->filename= av[i];
+ return 0;
+}
+
+
+int main(int ac,char **av)
+{
+ UNIDATA_OPT opt= opt_caseinfo;
+
+ if (process_param(&opt, ac, av))
+ return 1;
+
+ memset(code,0,sizeof(code));
+ memset(pstat,0,sizeof(pstat));
+
+ set_default_case_folding(&opt, code);
+
+ fill_cjk(code);
+
+ if (load_unidata(&opt, code))
+ return 1;
+
+ set_noaccent(&opt, code);
+ set_noaccent_tolower(&opt, code);
+ set_noaccent_toupper(&opt, code);
+
+ /*
+ Bug#8385: utf8_general_ci treats cyrillic letters I and SHORT I as the same
+ Because of decomposition applied, noaccent_toupper for the following letters:
+ U+0419 CYRILLIC CAPITAL LETTER SHORT I
+ U+0439 CYRILLIC SMALL LETTER SHORT I
+ was set to:
+ U+418 CYRILLIC CAPITAL LETTER I
+ Reset it back to U+0419.
+ */
+ code[0x0419].noaccent_toupper= 0x0419;
+ code[0x0439].noaccent_toupper= 0x0419;
+
+ /*
+ Bug#27877 incorrect german order in utf8_general_ci
+ */
+ if (strcmp(opt.mode.mode_name, "weight_general_mysql500_ci"))
+ {
+ code[0x00DF].noaccent_toupper= code['s'].noaccent_toupper;
+ }
+ else
+ pstat[0].page_overridden= 1;
+
+ if (!strcmp(opt.mode.mode_name, "casefold-tr"))
+ {
+ code[0x49].tolower= 0x0131;
+ code[0x69].toupper= 0x0130;
+ pstat[0].page_overridden= 1;
+ }
+
+ calc_page_parameters(&opt, code, pstat);
+
+ printf("%s\n", COPYING);
+ print_command_line_options(ac, av);
+ print(&opt, code, pstat);
+
+ return 0;
+}
diff --git a/strings/xml.c b/strings/xml.c
index d16df34bf30..7260ecadc66 100644
--- a/strings/xml.c
+++ b/strings/xml.c
@@ -304,10 +304,10 @@ static int my_xml_leave(MY_XML_PARSER *p, const char *str, size_t slen)
if (glen)
{
mstr(g, tag, sizeof(g)-1, glen);
- sprintf(p->errstr,"'</%s>' unexpected ('</%s>' wanted)",s,g);
+ snprintf(p->errstr,sizeof(p->errstr),"'</%s>' unexpected ('</%s>' wanted)",s,g);
}
else
- sprintf(p->errstr,"'</%s>' unexpected (END-OF-INPUT wanted)", s);
+ snprintf(p->errstr,sizeof(p->errstr),"'</%s>' unexpected (END-OF-INPUT wanted)", s);
return MY_XML_ERROR;
}
@@ -362,7 +362,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, size_t len)
{
if (MY_XML_IDENT != (lex=my_xml_scan(p,&a)))
{
- sprintf(p->errstr,"%s unexpected (ident wanted)",lex2str(lex));
+ snprintf(p->errstr,sizeof(p->errstr),"%s unexpected (ident wanted)",lex2str(lex));
return MY_XML_ERROR;
}
if (MY_XML_OK != my_xml_leave(p,a.beg,(size_t) (a.end-a.beg)))
@@ -390,7 +390,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, size_t len)
}
else
{
- sprintf(p->errstr,"%s unexpected (ident or '/' wanted)",
+ snprintf(p->errstr,sizeof(p->errstr),"%s unexpected (ident or '/' wanted)",
lex2str(lex));
return MY_XML_ERROR;
}
@@ -412,7 +412,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, size_t len)
}
else
{
- sprintf(p->errstr,"%s unexpected (ident or string wanted)",
+ snprintf(p->errstr,sizeof(p->errstr),"%s unexpected (ident or string wanted)",
lex2str(lex));
return MY_XML_ERROR;
}
@@ -449,7 +449,7 @@ gt:
{
if (lex != MY_XML_QUESTION)
{
- sprintf(p->errstr,"%s unexpected ('?' wanted)",lex2str(lex));
+ snprintf(p->errstr,sizeof(p->errstr),"%s unexpected ('?' wanted)",lex2str(lex));
return MY_XML_ERROR;
}
if (MY_XML_OK != my_xml_leave(p,NULL,0))
@@ -465,7 +465,7 @@ gt:
if (lex != MY_XML_GT)
{
- sprintf(p->errstr,"%s unexpected ('>' wanted)",lex2str(lex));
+ snprintf(p->errstr,sizeof(p->errstr),"%s unexpected ('>' wanted)",lex2str(lex));
return MY_XML_ERROR;
}
}
@@ -486,7 +486,7 @@ gt:
if (p->attr.start[0])
{
- sprintf(p->errstr,"unexpected END-OF-INPUT");
+ snprintf(p->errstr,sizeof(p->errstr),"unexpected END-OF-INPUT");
return MY_XML_ERROR;
}
return MY_XML_OK;
diff --git a/tests/code_quality/cppcheck_ignorelist.txt b/tests/code_quality/cppcheck_ignorelist.txt
new file mode 100644
index 00000000000..23cad81d419
--- /dev/null
+++ b/tests/code_quality/cppcheck_ignorelist.txt
@@ -0,0 +1,252 @@
+client/mysql.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it.
+client/mysql_plugin.c: error: snprintf format string requires 6 parameters but only 5 are given.
+client/mysql_upgrade.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it.
+client/mysqladmin.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it.
+client/mysqlbinlog.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it.
+client/mysqlcheck.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it.
+client/mysqlimport.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it.
+client/mysqlshow.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it.
+client/mysqltest.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it.
+dbug/tests.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+lexyy.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+mysql-test/lib/My/SafeProcess/safe_process_win.cc: error: Uninitialized variable: message_text
+mysys/crc32/crc32_arm64.c: error: Unmatched '('. Configuration: 'HAVE_ARMV8_CRC;__FreeBSD__'.
+mysys/mf_keycache.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+mysys/my_delete.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+mysys/my_fopen.c: error: Return value of allocation function 'freopen' is not stored.
+mysys/my_getsystime.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+mysys/my_largepage.c: error: syntax error: 0 =
+mysys/my_pread.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+mysys/my_rename.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+mysys/my_winfile.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+mysys/my_write.c: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+mysys/thr_lock.c: error: There is an unknown macro here somewhere. Configuration is required. If MYSQL_TABLE_WAIT_VARIABLES is a macro then please configure it.
+mysys/tree.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+plugin/audit_null/audit_null.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/auth_ed25519/server_ed25519.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/auth_examples/auth_0x0100.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/auth_examples/dialog_examples.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/auth_examples/qa_auth_interface.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/auth_examples/qa_auth_server.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/auth_examples/test_plugin.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/auth_gssapi/server_plugin.cc: error: syntax error
+plugin/auth_gssapi/sspi.h: error: #include nested too deeply
+plugin/auth_pam/auth_pam.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/auth_pam/auth_pam_v1.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/auth_pam/testing/pam_mariadb_mtr.c: error: Memory pointed to by 'resp' is freed twice.
+plugin/auth_pipe/auth_pipe.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/auth_socket/auth_socket.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/aws_key_management/aws_key_management_plugin.cc: error: syntax error
+plugin/cracklib_password_check/cracklib_password_check.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/daemon_example/daemon_example.cc: error: syntax error
+plugin/debug_key_management/debug_key_management_plugin.cc: error: syntax error
+plugin/disks/information_schema_disks.cc: error: syntax error
+plugin/example_key_management/example_key_management_plugin.cc: error: syntax error
+plugin/feedback/feedback.cc: error: syntax error
+plugin/file_key_management/file_key_management_plugin.cc: error: syntax error
+plugin/fulltext/plugin_example.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/func_test/plugin.cc: error: syntax error
+plugin/handler_socket/handlersocket/handlersocket.cpp: error: syntax error
+plugin/hashicorp_key_management/hashicorp_key_management_plugin.cc: error: syntax error
+plugin/locale_info/locale_info.cc: error: syntax error
+plugin/metadata_lock_info/metadata_lock_info.cc: error: syntax error
+plugin/password_reuse_check/password_reuse_check.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/provider_bzip2/plugin.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/provider_lz4/plugin.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/provider_lzma/plugin.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/provider_lzo/plugin.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/provider_snappy/plugin.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/qc_info/qc_info.cc: error: syntax error
+plugin/query_response_time/plugin.cc: error: syntax error
+plugin/query_response_time/query_response_time.cc: error: Array 'm_count[41]' accessed at index 43, which is out of bounds.
+plugin/query_response_time/query_response_time.cc: error: Array 'm_total[41]' accessed at index 43, which is out of bounds.
+plugin/server_audit/server_audit.c: error: Uninitialized variable: &tm_time
+plugin/server_audit/server_audit.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/server_audit/server_audit.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/server_audit/server_audit.c: error: Uninitialized variable: &tm_time
+plugin/simple_password_check/simple_password_check.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/sql_errlog/sql_errlog.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/sql_errlog/sql_errlog.c: error: Uninitialized variable: &t
+plugin/test_sql_service/test_sql_service.c: error: Found a exit path from function with non-void return type that has missing return statement
+plugin/type_geom/plugin.cc: error: syntax error
+plugin/type_inet/plugin.cc: error: syntax error
+plugin/type_mysql_json/type.cc: error: syntax error
+plugin/type_test/plugin.cc: error: syntax error
+plugin/type_uuid/plugin.cc: error: syntax error
+plugin/user_variables/user_variables.cc: error: syntax error
+plugin/userstat/userstat.cc: error: syntax error
+plugin/versioning/versioning.cc: error: syntax error
+plugin/wsrep_info/plugin.cc: error: syntax error
+sql-common/client.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+sql-common/client_plugin.c: error: va_list 'unused' used before va_start() was called.
+sql-common/client_plugin.c: error: va_list 'unused' used before va_start() was called.
+sql-common/client_plugin.c: error: va_list 'unused' used before va_start() was called.
+sql-common/client_plugin.c: error: va_list 'unused' used before va_start() was called.
+sql/debug.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+sql/debug_sync.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE is a macro then please configure it.
+sql/gcalc_slicescan.cc: warning: Possible null pointer dereference: first_bottom_point
+sql/gen_lex_hash.cc: error: Common realloc mistake: 'hash_map' nulled but not freed upon failure
+sql/handler.h: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+sql/log.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+sql/log_event.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+sql/net_serv.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+sql/opt_range.cc: error: Unmatched ')'. Configuration: 'OLD_SWEEP_COST'.
+sql/protocol.h: error: syntax error
+sql/rpl_gtid.h: error: va_list 'args' was opened but not closed by va_end().
+sql/rpl_gtid.h: error: va_list 'args' was opened but not closed by va_end().
+sql/rpl_utility.h: error: There is an unknown macro here somewhere. Configuration is required. If CPP_UNNAMED_NS_START is a macro then please configure it.
+sql/semisync_slave.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+sql/sql_base.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+sql/sql_select.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+sql/sql_string.cc: warning: Iterators to containers from different expressions 'to' and 'from' are used together.
+sql/sql_type.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+sql/table.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+sql/threadpool.h: error: syntax error
+sql/winservice.c: error: Resource leak: mariadb_upgrade_info
+sql/wsrep_thd.h: error: failed to expand 'wsrep_create_appliers', Wrong number of parameters for macro 'wsrep_create_appliers'.
+storage/archive/azio.c: error: Syntax Error: AST broken, 'if' doesn't have two operands.
+storage/archive/ha_archive.cc: error: syntax error
+storage/blackhole/ha_blackhole.cc: error: syntax error
+storage/connect/connect.cc: error: Uninitialized variable: lg
+storage/connect/domdoc.cpp: error: syntax error
+storage/connect/ha_connect.cc: error: syntax error
+storage/connect/myconn.cpp: error: Unmatched '{'. Configuration: 'ALPHA;MYSQL_PREPARED_STATEMENTS'.
+storage/connect/myconn.cpp: error: Unmatched '{'. Configuration: 'MYSQL_PREPARED_STATEMENTS'.
+storage/connect/odbconn.cpp: warning: Uninitialized variable: b
+storage/connect/odbconn.cpp: warning: Uninitialized variable: b
+storage/connect/odbconn.cpp: warning: Uninitialized variable: b
+storage/connect/plugutil.cpp: error: Width 255 given in format string (no. 2) is larger than destination buffer 'stmsg[200]', use %199[^\"] to prevent overflowing it.
+storage/connect/plugutil.cpp: error: Width 255 given in format string (no. 1) is larger than destination buffer 'stmsg[200]', use %199[^\"] to prevent overflowing it.
+storage/connect/tabjson.cpp: warning: Possible null pointer dereference: Val
+storage/connect/tabmul.cpp: error: Uninitialized variable: buf
+storage/connect/tabmul.cpp: error: Uninitialized variable: buf
+storage/connect/tabmul.cpp: error: Uninitialized variable: buf
+storage/connect/taboccur.cpp: warning: Uninitialized variable: *pcrp
+storage/connect/unzip.c: warning: Uninitialized variable: *pzlib_filefunc64_32_def.zopen32_file
+storage/connect/value.cpp: error: Signed integer overflow for expression 'n*126230400'.
+storage/connect/zip.c: warning: Uninitialized variable: *pzlib_filefunc64_32_def.zopen32_file
+storage/csv/ha_tina.cc: error: syntax error
+storage/example/ha_example.cc: error: syntax error
+storage/federated/ha_federated.cc: error: syntax error
+storage/heap/ha_heap.cc: error: syntax error
+storage/innobase/btr/btr0btr.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+storage/innobase/btr/btr0cur.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+storage/innobase/btr/btr0defragment.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+storage/innobase/btr/btr0pcur.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+storage/innobase/btr/btr0sea.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+storage/innobase/buf/buf0buf.cc: error: There is an unknown macro here somewhere. Configuration is required. If ut_d is a macro then please configure it.
+storage/innobase/buf/buf0flu.cc: error: syntax error
+storage/innobase/buf/buf0lru.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+storage/innobase/buf/buf0rea.cc: error: There is an unknown macro here somewhere. Configuration is required. If ut_d is a macro then please configure it.
+storage/innobase/dict/dict0crea.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/innobase/dict/dict0load.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+storage/innobase/fil/fil0fil.cc: error: There is an unknown macro here somewhere. Configuration is required. If IF_WIN is a macro then please configure it.
+storage/innobase/fsp/fsp0file.cc: error: Resource leak: file
+storage/innobase/fsp/fsp0fsp.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+storage/innobase/fts/fts0fts.cc: error: There is an unknown macro here somewhere. Configuration is required. If IF_WIN is a macro then please configure it.
+storage/innobase/fts/fts0opt.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/innobase/fts/fts0que.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+storage/innobase/gis/gis0rtree.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+storage/innobase/gis/gis0sea.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+storage/innobase/handler/ha_innodb.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+storage/innobase/handler/handler0alter.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+storage/innobase/handler/i_s.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/innobase/ibuf/ibuf0ibuf.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+storage/innobase/lock/lock0lock.cc: error: There is an unknown macro here somewhere. Configuration is required. If IF_WSREP is a macro then please configure it.
+storage/innobase/lock/lock0prdt.cc: error: Syntax Error: AST broken, 'g' doesn't have a parent.
+storage/innobase/log/log0log.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/innobase/log/log0log.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/innobase/log/log0recv.cc: error: There is an unknown macro here somewhere. Configuration is required. If ut_d is a macro then please configure it.
+storage/innobase/mtr/mtr0mtr.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/innobase/os/os0file.cc: error: syntax error
+storage/innobase/page/page0page.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/innobase/page/page0zip.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+storage/innobase/pars/pars0pars.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/innobase/row/row0ftsort.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/innobase/row/row0import.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/innobase/row/row0ins.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/innobase/row/row0log.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+storage/innobase/row/row0merge.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+storage/innobase/row/row0mysql.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/innobase/row/row0purge.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+storage/innobase/row/row0quiesce.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/innobase/row/row0sel.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+storage/innobase/row/row0upd.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+storage/innobase/row/row0vers.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/innobase/srv/srv0srv.cc: error: There is an unknown macro here somewhere. Configuration is required. If ut_d is a macro then please configure it.
+storage/innobase/srv/srv0start.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+storage/innobase/trx/trx0i_s.cc: error: Array 'table_cache->chunks[39]' accessed at index 39, which is out of bounds.
+storage/innobase/trx/trx0i_s.cc: error: Array 'table_cache->chunks[39]' accessed at index 39, which is out of bounds.
+storage/innobase/trx/trx0purge.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it.
+storage/innobase/trx/trx0rec.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/innobase/trx/trx0trx.cc: error: There is an unknown macro here somewhere. Configuration is required. If ut_d is a macro then please configure it.
+storage/innobase/trx/trx0undo.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/maria/aria_pack.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/maria/ha_maria.cc: error: syntax error
+storage/maria/ha_maria.cc: error: syntax error
+storage/maria/ha_s3.cc: error: syntax error
+storage/maria/ha_s3.cc: error: Unmatched '{'. Configuration: 'MOVE_FILES_TO_S3_ON_CREATE'.
+storage/maria/ma_bitmap.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/maria/ma_blockrec.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/maria/ma_check.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/maria/ma_checkpoint.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/maria/ma_delete.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/maria/ma_ft_parser.c: error: Address of local auto-variable assigned to a function parameter.
+storage/maria/ma_key.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/maria/ma_loghandler.c: warning: Uninitialized variable: data->current_offset
+storage/maria/ma_open.c: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+storage/maria/ma_pagecache.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/maria/ma_pagecache.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/maria/ma_range.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/maria/ma_recovery_util.c: error: va_start() or va_copy() called subsequently on 'args' without va_end() in between.
+storage/maria/ma_rkey.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/maria/ma_rt_index.c: error: failed to expand 'rt_PAGE_END', Wrong number of parameters for macro 'rt_PAGE_END'.
+storage/maria/ma_search.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/maria/ma_sp_key.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/maria/ma_update.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/maria/ma_write.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/myisam/ft_parser.c: error: Address of local auto-variable assigned to a function parameter.
+storage/myisam/ha_myisam.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/myisam/mi_check.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/myisam/mi_close.c: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+storage/myisam/mi_delete.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/myisam/mi_key.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/myisam/mi_locking.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/myisam/mi_open.c: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it.
+storage/myisam/mi_range.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/myisam/mi_rkey.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/myisam/mi_search.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/myisam/mi_update.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/myisam/mi_write.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/myisam/myisampack.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+storage/myisammrg/ha_myisammrg.cc: error: syntax error
+storage/oqgraph/ha_oqgraph.cc: error: syntax error
+storage/perfschema/ha_perfschema.cc: error: syntax error
+storage/perfschema/table_esgs_by_host_by_event_name.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it.
+storage/perfschema/table_esms_by_host_by_event_name.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it.
+storage/perfschema/table_events_waits.cc: error: Uninitialized struct member: wait.m_wait_class
+storage/perfschema/table_events_waits.cc: error: Uninitialized variable: wait
+storage/perfschema/table_events_waits.cc: error: Uninitialized struct member: wait.m_wait_class
+storage/perfschema/table_events_waits.cc: error: Uninitialized variable: wait->m_wait_class
+storage/perfschema/table_ews_by_host_by_event_name.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it.
+storage/perfschema/table_hosts.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it.
+storage/sequence/sequence.cc: error: syntax error
+storage/test_sql_discovery/test_sql_discovery.cc: error: syntax error
+strings/decimal.c: warning: Possible null pointer dereference: to
+strings/dump_map.c: error: Array 'fromstat[256]' accessed at index 256, which is out of bounds.
+tests/mysql_client_fw.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it.
+tests/thread_test.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it.
+unittest/mysys/dynstring-t.c: error: syntax error
+unittest/mysys/queues-t.c: error: Uninitialized variable: i
+unittest/mysys/waiting_threads-t.c: error: Uninitialized variable: m
+unittest/mytap/tap.c: error: va_list 'ap' used before va_start() was called.
+unittest/mytap/tap.c: error: va_list 'ap' used before va_start() was called.
+unittest/mytap/tap.c: error: va_list 'ap' used before va_start() was called.
+unittest/mytap/tap.c: error: va_list 'ap' used before va_start() was called.
+vio/viosocket.c: error: There is an unknown macro here somewhere. Configuration is required. If MYSQL_SOCKET_WAIT_VARIABLES is a macro then please configure it.
+vio/viosocket.c: error: There is an unknown macro here somewhere. Configuration is required. If MYSQL_SOCKET_WAIT_VARIABLES is a macro then please configure it.
+vio/viosslfactories.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it.
+vio/viotest-sslconnect.cc: error: Memory pointed to by 'vio' is freed twice.
+vio/viotest-sslconnect.cc: error: Memory pointed to by 'ssl_connector' is freed twice.
+wsrep-lib/src/server_state.cpp: error: syntax error: keyword 'try' is not allowed in global scope
+wsrep-lib/src/thread_service_v1.cpp: error: Rethrowing current exception with 'throw;', it seems there is no current exception to rethrow. If there is no current exception this calls std::terminate(). More: https://isocpp.org/wiki/faq/exceptions#throw-without-an-object
diff --git a/tests/code_quality/flawfinder_ignorelist.json b/tests/code_quality/flawfinder_ignorelist.json
new file mode 100644
index 00000000000..11acda1a29a
--- /dev/null
+++ b/tests/code_quality/flawfinder_ignorelist.json
@@ -0,0 +1,706 @@
+{
+ "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json",
+ "version": "2.1.0",
+ "runs": [
+ {
+ "tool": {
+ "driver": {
+ "name": "Flawfinder",
+ "version": "2.0.19",
+ "informationUri": "https://dwheeler.com/flawfinder/",
+ "supportedTaxonomies": [
+ {
+ "name": "CWE",
+ "guid": "FFC64C90-42B6-44CE-8BEB-F6B7DAE649E5"
+ }
+ ]
+ }
+ },
+ "columnKind": "utf16CodeUnits",
+ "results": [
+ {
+ "ruleId": "FF1035",
+ "level": "error",
+ "message": {
+ "text": "race/readlink:This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./extra/mariabackup/xtrabackup.cc",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 17,
+ "endColumn": 57,
+ "snippet": {
+ "text": " ssize_t ret = readlink(\"/proc/self/exe\", buf, size-1);"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "11523490c7f8cba115bce125bbce94de5cd5e7f66d4dd07a391aac70fbbdd353"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1033",
+ "level": "error",
+ "message": {
+ "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./client/mysqltest.cc",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 13,
+ "endColumn": 38,
+ "snippet": {
+ "text": " err_code= chmod(ds_file.str, mode);"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "12a7fa6bbd4c81be975838bae2b7b26fe841acaf9804e6d0299188683e230908"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1031",
+ "level": "error",
+ "message": {
+ "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./storage/columnstore/columnstore/writeengine/shared/we_typeext.h",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 12,
+ "endColumn": 63,
+ "snippet": {
+ "text": " if (fs.chown(fileName.c_str(), uid, gid, funcErrno) == -1)"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "16bbd2ed7b8f86182e8f66980ee23b9e0dfe63a9330b7c16a2c2b81a3e8a9377"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1031",
+ "level": "error",
+ "message": {
+ "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.cpp",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 16,
+ "endColumn": 49,
+ "snippet": {
+ "text": " if ((ret = ::chown(objectName, p_uid, p_gid)))"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "1882617c363794bedb3e70a4a3be704a3ee928778709b75f971e91ffc7a224b6"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1031",
+ "level": "error",
+ "message": {
+ "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./libmariadb/external/zlib/examples/gun.c",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 11,
+ "endColumn": 45,
+ "snippet": {
+ "text": " (void)chown(to, was.st_uid, was.st_gid);"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "29cdc74512c56c56c73604ac5fd1c08bf2b38845b3aa91f4129ef9424bdb7f7f"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1014",
+ "level": "error",
+ "message": {
+ "text": "buffer/gets:Does not check for buffer overflows (CWE-120, CWE-20)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./extra/readline/tilde.c",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 12,
+ "endColumn": 24,
+ "snippet": {
+ "text": " if (!gets (line))"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "34a940ccc6e0248a2cf725e8a0c3f808d1f36d47fc814bd9daadb17f5563d357"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1033",
+ "level": "error",
+ "message": {
+ "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./sql/sql_class.cc",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 10,
+ "endColumn": 28,
+ "snippet": {
+ "text": " (void) chmod(path, 0644);"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "3f97fd0452062ab69db87a04222a17c37c216c4e28e2ae3622730da8dd070d2e"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1033",
+ "level": "error",
+ "message": {
+ "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./mysys/my_chmod.c",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 7,
+ "endColumn": 25,
+ "snippet": {
+ "text": " if (chmod(name, mode))"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "46805eec1d288b072d4edb3214822220d394307195be79a33ec3bce455d14750"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1035",
+ "level": "error",
+ "message": {
+ "text": "race/readlink:This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./sql/signal_handler.cc",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 13,
+ "endColumn": 68,
+ "snippet": {
+ "text": " if ((len= readlink(\"/proc/self/cwd\", buff, sizeof(buff)-1)) >= 0)"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "4c4d621e451a67f86c3e999e9dd3ceb2639bf4f63b0a946b7836b01d752ca557"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1035",
+ "level": "error",
+ "message": {
+ "text": "race/readlink:This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./storage/columnstore/columnstore/primitives/blockcache/fsutils.cpp",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 25,
+ "endColumn": 77,
+ "snippet": {
+ "text": " ssize_t realnamelen = readlink(path.string().c_str(), realname, PATH_MAX);"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "52b685022ce9db6c7c332217d74745fc48b65e3e00f2cfdbde8f858d28b8aa9f"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1031",
+ "level": "error",
+ "message": {
+ "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./storage/columnstore/columnstore/utils/idbdatafile/IDBFileSystem.h",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 15,
+ "endColumn": 104,
+ "snippet": {
+ "text": " virtual int chown(const char* objectName, const uid_t p_uid, const gid_t p_pid, int& funcErrno) const"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "5eb02dbd4395b5c1a30be2665e0db914b8a6fcc6997ae18f8cc8651ec2e788cb"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1033",
+ "level": "error",
+ "message": {
+ "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./libmariadb/external/zlib/examples/gun.c",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 11,
+ "endColumn": 42,
+ "snippet": {
+ "text": " (void)chmod(to, was.st_mode & 07777);"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "6044966208b061aada8a837a2be969922745fc7d445f7429417ab77f19c40fa5"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1033",
+ "level": "error",
+ "message": {
+ "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./storage/columnstore/columnstore/tools/passwd/secrets.cpp",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 9,
+ "endColumn": 40,
+ "snippet": {
+ "text": " if (chmod(filepathc, S_IRUSR) == 0)"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "6f7b5195eb8526770ad61729bd310387d05d0407d1be5dc902f7116e365f4232"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1031",
+ "level": "error",
+ "message": {
+ "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./storage/columnstore/columnstore/tools/passwd/secrets.cpp",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 13,
+ "endColumn": 71,
+ "snippet": {
+ "text": " if (chown(filepathc, userinfo->pw_uid, userinfo->pw_gid) == 0)"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "745b105be1b6a7c1e78f52a190edb9aaa848acd9c284c18f40e8a613520ae3df"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1033",
+ "level": "error",
+ "message": {
+ "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./storage/columnstore/columnstore/versioning/BRM/oidserver.cpp",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 7,
+ "endColumn": 86,
+ "snippet": {
+ "text": " chmod(fFilename.c_str(), 0664); // XXXPAT: override umask at least for testing"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "7ccf3c7811cbce45e635a9fd32003a9477eeee78679105dd973ad921fb72672a"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1035",
+ "level": "error",
+ "message": {
+ "text": "race/readlink:This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./mysys/my_symlink.c",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 15,
+ "endColumn": 56,
+ "snippet": {
+ "text": " if ((length=readlink(filename, to, FN_REFLEN-1)) < 0)"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "7da5207ac0f5baba73c026472a2d3805eed92931852575db64f513702977dd70"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1031",
+ "level": "error",
+ "message": {
+ "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.h",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 7,
+ "endColumn": 106,
+ "snippet": {
+ "text": " int chown(const char* objectName, const uid_t p_uid, const gid_t p_pid, int& funcErrno) const override;"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "837ef3ca85cb450e25a7db58e83d60ce5268b46e9130f6e47d781aff97b9a832"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1031",
+ "level": "error",
+ "message": {
+ "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.cpp",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 22,
+ "endColumn": 111,
+ "snippet": {
+ "text": "int PosixFileSystem::chown(const char* objectName, const uid_t p_uid, const gid_t p_gid, int& funcErrno) const"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "92873ab0b24cc9dc2ab7ec959968b3d3568e0d9e92b1659c4f823c322397f33a"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1031",
+ "level": "error",
+ "message": {
+ "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./mysys/my_redel.c",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 7,
+ "endColumn": 49,
+ "snippet": {
+ "text": " if (chown(to, statbuf.st_uid, statbuf.st_gid))"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "97d2cfe4cb9428e812b796eb39c27f28dc8b198ab9655c2aff8c442de39bdcfe"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1035",
+ "level": "error",
+ "message": {
+ "text": "race/readlink:This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./storage/rocksdb/rocksdb/port/stack_trace.cc",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 15,
+ "endColumn": 54,
+ "snippet": {
+ "text": " auto read = readlink(link, name, sizeof(name) - 1);"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "acb399f2a4a15ef8da36c47631bc4ee4bcc1bb0577dfbda141d2eb5d7723af40"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1033",
+ "level": "error",
+ "message": {
+ "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./mysys/my_copy.c",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 9,
+ "endColumn": 46,
+ "snippet": {
+ "text": " if (chmod(to, stat_buff.st_mode & 07777))"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "bddb795a7efbd73a4387bbd33fd4f9e505b4f759d784e5d51f60cc43011ee610"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1031",
+ "level": "error",
+ "message": {
+ "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./mysys/my_copy.c",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 9,
+ "endColumn": 55,
+ "snippet": {
+ "text": " if (chown(to, stat_buff.st_uid, stat_buff.st_gid))"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "c63a81105d753de4762cbcab48d9700f7069da3cd9d57bf4329a6d20fad288aa"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1033",
+ "level": "error",
+ "message": {
+ "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./sql/mysqld.cc",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 12,
+ "endColumn": 71,
+ "snippet": {
+ "text": " (void) chmod(mysqld_unix_port,S_IFSOCK);\t/* Fix solaris 2.6 bug */"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "d0c4f1302290e2367e246ef7c8d3ea69589cbc4bc148e0efdd4c283fa03cbe01"
+ },
+ "rank": 1.0
+ },
+ {
+ "ruleId": "FF1033",
+ "level": "error",
+ "message": {
+ "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)."
+ },
+ "locations": [
+ {
+ "physicalLocation": {
+ "artifactLocation": {
+ "uri": "./mysys/my_redel.c",
+ "uriBaseId": "SRCROOT"
+ },
+ "region": {
+ "startColumn": 7,
+ "endColumn": 42,
+ "snippet": {
+ "text": " if (chmod(to, statbuf.st_mode & 07777))"
+ }
+ }
+ }
+ }
+ ],
+ "fingerprints": {
+ "contextHash/v1": "e11b8df9cbb9e459e4d67a0af5e627b6b1285c78fe23f5a1c823285da96495a8"
+ },
+ "rank": 1.0
+ }
+ ],
+ "externalPropertyFileReferences": {
+ "taxonomies": [
+ {
+ "location": {
+ "uri": "https://raw.githubusercontent.com/sarif-standard/taxonomies/main/CWE_v4.4.sarif"
+ },
+ "guid": "FFC64C90-42B6-44CE-8BEB-F6B7DAE649E5"
+ }
+ ]
+ }
+ }
+ ]
+}
diff --git a/tpool/tpool_structs.h b/tpool/tpool_structs.h
index 4690a615174..099ae5c7ed1 100644
--- a/tpool/tpool_structs.h
+++ b/tpool/tpool_structs.h
@@ -14,14 +14,13 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/
#pragma once
+#include <my_global.h>
+#include <my_pthread.h>
#include <vector>
#include <stack>
-#include <mutex>
-#include <condition_variable>
#include <assert.h>
#include <algorithm>
-
/* Suppress TSAN warnings, that we believe are not critical. */
#if defined(__has_feature)
#define TPOOL_HAS_FEATURE(...) __has_feature(__VA_ARGS__)
@@ -37,6 +36,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/
#define TPOOL_SUPPRESS_TSAN
#endif
+#ifdef HAVE_PSI_INTERFACE
+typedef unsigned int mysql_pfs_key_t;
+extern mysql_pfs_key_t tpool_cache_mutex_key;
+#endif
+
namespace tpool
{
@@ -55,13 +59,13 @@ namespace tpool
template<typename T> class cache
{
/** Protects updates of m_pos and m_cache members */
- std::mutex m_mtx;
+ mysql_mutex_t m_mtx;
/**
Notify waiting threads about "cache full" or "cache not empty" conditions
@see get() and wait()
*/
- std::condition_variable m_cv;
+ pthread_cond_t m_cv;
/** Cached items vector.Does not change after construction */
std::vector<T> m_base;
@@ -108,13 +112,22 @@ public:
Constructor
@param size - maximum number of items in cache
*/
- cache(size_t size) : m_mtx(), m_cv(), m_base(size), m_cache(size),
+ cache(size_t size) : m_base(size), m_cache(size),
m_waiters(), m_pos(0)
{
+ mysql_mutex_init(tpool_cache_mutex_key, &m_mtx, nullptr);
+ pthread_cond_init(&m_cv, nullptr);
+
for(size_t i= 0 ; i < size; i++)
m_cache[i]= &m_base[i];
}
+ ~cache()
+ {
+ mysql_mutex_destroy(&m_mtx);
+ pthread_cond_destroy(&m_cv);
+ }
+
/**
Retrieve an item from cache. Waits for free item, if cache is
currently empty.
@@ -122,26 +135,25 @@ public:
*/
T* get()
{
- std::unique_lock<std::mutex> lk(m_mtx);
- while(is_empty())
- m_cv.wait(lk);
+ mysql_mutex_lock(&m_mtx);
+ while (is_empty())
+ my_cond_wait(&m_cv, &m_mtx.m_mutex);
assert(m_pos < capacity());
// return last element
- return m_cache[m_pos++];
+ T *t= m_cache[m_pos++];
+ mysql_mutex_unlock(&m_mtx);
+ return t;
}
- std::mutex& mutex()
- {
- return m_mtx;
- }
+ mysql_mutex_t &mutex() { return m_mtx; }
- /**
- Put back an item to cache.
- @param item - item to put back
+ /**
+ Put back an element to cache.
+ @param ele element to put back
*/
void put(T *ele)
{
- std::unique_lock<std::mutex> lk(m_mtx);
+ mysql_mutex_lock(&m_mtx);
assert(!is_full());
// put element to the logical end of the array
m_cache[--m_pos] = ele;
@@ -149,7 +161,8 @@ public:
/* Notify waiters when the cache becomes
not empty, or when it becomes full */
if (m_pos == 1 || (m_waiters && is_full()))
- m_cv.notify_all();
+ pthread_cond_broadcast(&m_cv);
+ mysql_mutex_unlock(&m_mtx);
}
/** Check if pointer represents cached element */
@@ -159,35 +172,37 @@ public:
return ele >= &m_base[0] && ele <= &m_base[capacity() - 1];
}
- /**
- @return approximate number of "borrowed" items.
- A "dirty" read, not used in any critical functionality.
- */
- TPOOL_SUPPRESS_TSAN size_t pos()
- {
- return m_pos;
- }
-
/** Wait until cache is full
- @param[in] lk - lock for the cache mutex
- (which can be obtained with mutex()) */
- void wait(std::unique_lock<std::mutex> &lk)
+ @param m cache mutex (locked) */
+ void wait(mysql_mutex_t &m)
{
+ mysql_mutex_assert_owner(&m);
m_waiters++;
while (!is_full())
- m_cv.wait(lk);
+ my_cond_wait(&m_cv, &m.m_mutex);
m_waiters--;
}
/* Wait until cache is full.*/
void wait()
{
- std::unique_lock<std::mutex> lk(m_mtx);
- wait(lk);
+ mysql_mutex_lock(&m_mtx);
+ wait(m_mtx);
+ mysql_mutex_unlock(&m_mtx);
+ }
+
+ /**
+ @return approximate number of "borrowed" items.
+ A "dirty" read, not used in any critical functionality.
+ */
+ TPOOL_SUPPRESS_TSAN size_t pos()
+ {
+ return m_pos;
}
void resize(size_t count)
{
+ mysql_mutex_assert_owner(&m_mtx);
assert(is_full());
m_base.resize(count);
m_cache.resize(count);
diff --git a/unittest/strings/strings-t.c b/unittest/strings/strings-t.c
index ac09e116a65..be5fc085ef0 100644
--- a/unittest/strings/strings-t.c
+++ b/unittest/strings/strings-t.c
@@ -1042,9 +1042,14 @@ typedef struct
LEX_CSTRING a;
LEX_CSTRING b;
size_t nchars;
+ uint flags;
int res;
} STRNNCOLLSP_CHAR_PARAM;
+#undef TCHAR
+#define TCHAR MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES
+
+#define TVCHAR 0
/*
Some lines in the below test data are marked as follows:
@@ -1066,266 +1071,273 @@ typedef struct
*/
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_mbminlen1_xpad_common[]=
{
- {{CSTR("a")}, {CSTR("a")}, 0, 0},
- {{CSTR("a")}, {CSTR("a")}, 1, 0},
- {{CSTR("a")}, {CSTR("a")}, 2, 0},
- {{CSTR("a")}, {CSTR("a")}, 3, 0},
- {{CSTR("a")}, {CSTR("a")}, 100, 0},
-
- {{CSTR("a")}, {CSTR("ab")}, 0, 0},
- {{CSTR("a")}, {CSTR("ab")}, 1, 0},
- {{CSTR("a")}, {CSTR("ab")}, 2, -1},
- {{CSTR("a")}, {CSTR("ab")}, 3, -1},
- {{CSTR("a")}, {CSTR("ab")}, 100, -1},
-
- {{CSTR("a")}, {CSTR("a ")}, 0, 0},
- {{CSTR("a")}, {CSTR("a ")}, 1, 0},
- {{CSTR("a")}, {CSTR("a ")}, 2, 0},
- {{CSTR("a")}, {CSTR("a ")}, 3, 0},
- {{CSTR("a")}, {CSTR("a ")}, 100, 0},
-
- {{CSTR("a")}, {CSTR("a ")}, 0, 0},
- {{CSTR("a")}, {CSTR("a ")}, 1, 0},
- {{CSTR("a")}, {CSTR("a ")}, 2, 0},
- {{CSTR("a")}, {CSTR("a ")}, 3, 0},
- {{CSTR("a")}, {CSTR("a ")}, 100, 0},
-
- {{CSTR("ss")}, {CSTR("ss")}, 0, 0},
- {{CSTR("ss")}, {CSTR("ss")}, 1, 0},
- {{CSTR("ss")}, {CSTR("ss")}, 2, 0},
- {{CSTR("ss")}, {CSTR("ss")}, 3, 0},
- {{CSTR("ss")}, {CSTR("ss")}, 100, 0},
-
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{CSTR("a")}, {CSTR("a")}, 0, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a")}, 1, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a")}, 2, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a")}, 3, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a")}, 100, TCHAR, 0},
+
+ {{CSTR("a")}, {CSTR("ab")}, 0, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("ab")}, 1, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("ab")}, 2, TCHAR, -1},
+ {{CSTR("a")}, {CSTR("ab")}, 3, TCHAR, -1},
+ {{CSTR("a")}, {CSTR("ab")}, 100, TCHAR, -1},
+
+ {{CSTR("a")}, {CSTR("a ")}, 0, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a ")}, 1, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a ")}, 2, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a ")}, 3, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a ")}, 100, TCHAR, 0},
+
+ {{CSTR("a")}, {CSTR("a ")}, 0, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a ")}, 1, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a ")}, 2, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a ")}, 3, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a ")}, 100, TCHAR, 0},
+
+ {{CSTR("ss")}, {CSTR("ss")}, 0, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("ss")}, 1, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("ss")}, 2, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("ss")}, 3, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("ss")}, 100, TCHAR, 0},
+
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
/* Tests for utf8, for both PAD SPACE and NOPAD collations */
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mbx_xpad_common[]=
{
- {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 0, 0},
- {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 1, 0},
- {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 2, 0},
- {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 3, 0},
- {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 100, 0},
+ {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 0, TCHAR, 0},
+ {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 1, TCHAR, 0},
+ {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 2, TCHAR, 0},
+ {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 3, TCHAR, 0},
+ {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 100, TCHAR, 0},
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
/* Tests for latin1, for both PAD and NOPAD collations */
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_latin1_xpad_common[]=
{
- {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 0, 0},
- {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 1, 0},
- {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 2, 0},
- {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 3, 0},
- {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 100, 0},
+ {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 0, TCHAR, 0},
+ {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 1, TCHAR, 0},
+ {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 2, TCHAR, 0},
+ {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 3, TCHAR, 0},
+ {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 100, TCHAR, 0},
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
/* Tests for utf8 collations that sort "A WITH DIAERESIS" equal to "A" */
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mbx_xpad_a_eq_auml[]=
{
- {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 0, 0},
- {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 1, 0},
- {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 2, 0},
- {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 3, 0},
- {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 100, 0},
-
- {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 0, 0},
- {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 1, 0},
- {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 2, 0},
- {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 3, 0},
- {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 100, 0},
-
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 0, TCHAR, 0},
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 1, TCHAR, 0},
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 2, TCHAR, 0},
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 3, TCHAR, 0},
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 100, TCHAR, 0},
+
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 0, TCHAR, 0},
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 1, TCHAR, 0},
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 2, TCHAR, 0},
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 3, TCHAR, 0},
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 100, TCHAR, 0},
+
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mb3_unicode_ci[]=
{
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 0, 0},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 1, 0},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}/*IF*/, 2, 1},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 3, 0},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 4, 0},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 100, 0},
-
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, 0},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, -1},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, 0},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, 0},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, 0},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, 0},
-
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 0, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 1, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}/*IF*/, 2, TCHAR, 1},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 3, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 4, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 100, TCHAR, 0},
+
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, TCHAR, -1},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, TCHAR, 0},
+
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mb3_unicode_nopad_ci[]=
{
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 0, 0},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 1, 0},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}/*IF*/, 2, 1},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 3, 1},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 4, 1},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 100, 1},
-
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, 0},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, -1},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, -1},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, -1},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, -1},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, -1},
-
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 0, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 1, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}/*IF*/, 2, TCHAR, 1},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 3, TCHAR, 1},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 4, TCHAR, 1},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 100, TCHAR, 1},
+
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, TCHAR, -1},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, TCHAR, -1},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, TCHAR, -1},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, TCHAR, -1},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, TCHAR, -1},
+
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, TVCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, TVCHAR, -1},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, TVCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, TVCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, TVCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, TVCHAR, 0},
+
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mb3_danish_ci[]=
{
- {{CSTR("aa")}, {CSTR("")}, 0, 0},
- {{CSTR("aa")}/*CF*/, {CSTR("")}, 1, 1},
- {{CSTR("aa")}, {CSTR("")}, 2, 1},
- {{CSTR("aa")}, {CSTR("")}, 3, 1},
- {{CSTR("aa")}, {CSTR("")}, 100, 1},
-
- {{CSTR("aa")}, {CSTR("a")}, 0, 0},
- {{CSTR("aa")}/*CF*/, {CSTR("a")}, 1, 0},
- {{CSTR("aa")}, {CSTR("a")}, 2, 1},
- {{CSTR("aa")}, {CSTR("a")}, 3, 1},
- {{CSTR("aa")}, {CSTR("a")}, 100, 1},
-
- {{CSTR("aa")}, {CSTR("aa")}, 0, 0},
- {{CSTR("aa")}/*CF*/, {CSTR("aa")}/*CF*/, 1, 0},
- {{CSTR("aa")}, {CSTR("aa")}, 2, 0},
- {{CSTR("aa")}, {CSTR("aa")}, 3, 0},
- {{CSTR("aa")}, {CSTR("aa")}, 100, 0},
-
- {{CSTR("aa")}, {CSTR("\x00" "a")}, 0, 0},
- {{CSTR("aa")}/*CF*/, {CSTR("\x00" "a")}/*IF*/, 1, 1},
- {{CSTR("aa")}, {CSTR("\x00" "a")}, 2, 1},
- {{CSTR("aa")}, {CSTR("\x00" "a")}, 3, 1},
- {{CSTR("aa")}, {CSTR("\x00" "a")}, 100, 1},
-
- {{CSTR("aa")}, {CSTR("\x00" "aa")}, 0, 0},
- {{CSTR("aa")}/*CF*/, {CSTR("\x00" "aa")}/*IF*/, 1, 1},
- {{CSTR("aa")}, {CSTR("\x00" "aa")}/*IF*/, 2, 1},
- {{CSTR("aa")}, {CSTR("\x00" "aa")}, 3, 0},
- {{CSTR("aa")}, {CSTR("\x00" "aa")}, 100, 0},
-
- {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 0, 0},
- {{CSTR("aa")}/*CF*/, {CSTR("a" "\x00" "a")}, 1, 0},
- {{CSTR("aa")}, {CSTR("a" "\x00" "a")}/*IF*/, 2, 1},
- {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 3, 1},
- {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 100, 1},
-
- {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 0, 0},
- {{CSTR("aa")}/*CF*/, {CSTR(UTF8_ARING)}, 1, -1},
- {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 2, 0},
- {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 3, 0},
- {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 100, 0},
-
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{CSTR("aa")}, {CSTR("")}, 0, TCHAR, 0},
+ {{CSTR("aa")}/*CF*/, {CSTR("")}, 1, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("")}, 2, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("")}, 3, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("")}, 100, TCHAR, 1},
+
+ {{CSTR("aa")}, {CSTR("a")}, 0, TCHAR, 0},
+ {{CSTR("aa")}/*CF*/, {CSTR("a")}, 1, TCHAR, 0},
+ {{CSTR("aa")}, {CSTR("a")}, 2, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("a")}, 3, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("a")}, 100, TCHAR, 1},
+
+ {{CSTR("aa")}, {CSTR("aa")}, 0, TCHAR, 0},
+ {{CSTR("aa")}/*CF*/, {CSTR("aa")}/*CF*/, 1, TCHAR, 0},
+ {{CSTR("aa")}, {CSTR("aa")}, 2, TCHAR, 0},
+ {{CSTR("aa")}, {CSTR("aa")}, 3, TCHAR, 0},
+ {{CSTR("aa")}, {CSTR("aa")}, 100, TCHAR, 0},
+
+ {{CSTR("aa")}, {CSTR("\x00" "a")}, 0, TCHAR, 0},
+ {{CSTR("aa")}/*CF*/, {CSTR("\x00" "a")}/*IF*/, 1, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("\x00" "a")}, 2, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("\x00" "a")}, 3, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("\x00" "a")}, 100, TCHAR, 1},
+
+ {{CSTR("aa")}, {CSTR("\x00" "aa")}, 0, TCHAR, 0},
+ {{CSTR("aa")}/*CF*/, {CSTR("\x00" "aa")}/*IF*/, 1, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("\x00" "aa")}/*IF*/, 2, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("\x00" "aa")}, 3, TCHAR, 0},
+ {{CSTR("aa")}, {CSTR("\x00" "aa")}, 100, TCHAR, 0},
+
+ {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 0, TCHAR, 0},
+ {{CSTR("aa")}/*CF*/, {CSTR("a" "\x00" "a")}, 1, TCHAR, 0},
+ {{CSTR("aa")}, {CSTR("a" "\x00" "a")}/*IF*/, 2, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 3, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 100, TCHAR, 1},
+
+ {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 0, TCHAR, 0},
+ {{CSTR("aa")}/*CF*/, {CSTR(UTF8_ARING)}, 1, TCHAR, -1},
+ {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 2, TCHAR, 0},
+ {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 3, TCHAR, 0},
+ {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 100, TCHAR, 0},
+
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_latin1_german2_ci[]=
{
- {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 0, 0},
- {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 1, -1},
- {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 2, 0},
- {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 3, 0},
- {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 100, 0},
-
- {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 0, 0},
- {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 1, -1},
- {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 2, 0},
- {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 3, 0},
- {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 100, 0},
-
- {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 0, 0},
- {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 1, -1},
- {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 2, 0},
- {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 3, 0},
- {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 100, 0},
-
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 0, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 1, TCHAR, -1},
+ {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 2, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 3, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 100, TCHAR, 0},
+
+ {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 0, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 1, TCHAR, -1},
+ {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 2, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 3, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 100, TCHAR, 0},
+
+ {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 0, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 1, TCHAR, -1},
+ {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 2, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 3, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 100, TCHAR, 0},
+
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mbx_german2_ci[]=
{
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, 0},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, -1},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, 0},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, 0},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, 0},
-
- {{CSTR("ae")}, {CSTR(UTF8_auml)}, 0, 0},
- {{CSTR("ae")}, {CSTR(UTF8_auml)}, 1, -1},
- {{CSTR("ae")}, {CSTR(UTF8_auml)}, 2, 0},
- {{CSTR("ae")}, {CSTR(UTF8_auml)}, 3, 0},
- {{CSTR("ae")}, {CSTR(UTF8_auml)}, 100, 0},
-
- {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 0, 0},
- {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 1, -1},
- {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 2, 0},
- {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 3, 0},
- {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 100, 0},
-
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, TCHAR, -1},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, TCHAR, 0},
+
+ {{CSTR("ae")}, {CSTR(UTF8_auml)}, 0, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(UTF8_auml)}, 1, TCHAR, -1},
+ {{CSTR("ae")}, {CSTR(UTF8_auml)}, 2, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(UTF8_auml)}, 3, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(UTF8_auml)}, 100, TCHAR, 0},
+
+ {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 0, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 1, TCHAR, -1},
+ {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 2, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 3, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 100, TCHAR, 0},
+
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_mbminlen1_xpad_czech[]=
{
- {{CSTR("c")}, {CSTR("ch")}, 0, 0},
- {{CSTR("c")}, {CSTR("ch")}, 1, 0},
- {{CSTR("c")}, {CSTR("ch")}, 2, -1},
+ {{CSTR("c")}, {CSTR("ch")}, 0, TCHAR, 0},
+ {{CSTR("c")}, {CSTR("ch")}, 1, TCHAR, 0},
+ {{CSTR("c")}, {CSTR("ch")}, 2, TCHAR, -1},
- {{CSTR("h")}, {CSTR("ch")}, 0, 0},
- {{CSTR("h")}, {CSTR("ch")}, 1, 1},
- {{CSTR("h")}, {CSTR("ch")}, 2, -1},
+ {{CSTR("h")}, {CSTR("ch")}, 0, TCHAR, 0},
+ {{CSTR("h")}, {CSTR("ch")}, 1, TCHAR, 1},
+ {{CSTR("h")}, {CSTR("ch")}, 2, TCHAR, -1},
- {{CSTR("i")}, {CSTR("ch")}, 0, 0},
- {{CSTR("i")}, {CSTR("ch")}, 1, 1},
- {{CSTR("i")}, {CSTR("ch")}, 2, 1},
+ {{CSTR("i")}, {CSTR("ch")}, 0, TCHAR, 0},
+ {{CSTR("i")}, {CSTR("ch")}, 1, TCHAR, 1},
+ {{CSTR("i")}, {CSTR("ch")}, 2, TCHAR, 1},
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_mbminlen2_xpad_common[]=
{
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 0, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 1, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 2, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 3, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 100, 0},
-
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 0, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 1, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 2, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 3, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 100, 0},
-
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 0, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 1, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 2, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 3, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 100, 0},
-
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 0, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 1, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 2, -1},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 3, -1},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 100, -1},
-
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 0, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 1, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 2, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 3, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 100, TCHAR, 0},
+
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 0, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 1, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 2, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 3, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 100, TCHAR, 0},
+
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 0, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 1, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 2, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 3, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 100, TCHAR, 0},
+
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 0, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 1, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 2, TCHAR, -1},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 3, TCHAR, -1},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 100, TCHAR, -1},
+
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
@@ -1337,7 +1349,7 @@ strnncollsp_char_one(CHARSET_INFO *cs, const STRNNCOLLSP_CHAR_PARAM *p)
int res= cs->coll->strnncollsp_nchars(cs,
(uchar *) p->a.str, p->a.length,
(uchar *) p->b.str, p->b.length,
- p->nchars);
+ p->nchars, p->flags);
str2hex(ahex, sizeof(ahex), p->a.str, p->a.length);
str2hex(bhex, sizeof(bhex), p->b.str, p->b.length);
diag("%-25s %-12s %-12s %3d %7d %7d%s",
@@ -1353,7 +1365,7 @@ strnncollsp_char_one(CHARSET_INFO *cs, const STRNNCOLLSP_CHAR_PARAM *p)
res= cs->coll->strnncollsp_nchars(cs,
(uchar *) p->b.str, p->b.length,
(uchar *) p->a.str, p->a.length,
- p->nchars);
+ p->nchars, p->flags);
if (!eqres(res, -p->res))
{
diag("Comparison in reverse order failed. Expected %d, got %d",
diff --git a/wsrep-lib b/wsrep-lib
-Subproject 275a0af8c5b92f0ee33cfe9e23f3db5f59b56e9
+Subproject 4951c38357737d568b554402bc5b6abe88a38fe
diff --git a/zlib/ChangeLog b/zlib/ChangeLog
index f0b0e618092..457526bc6a5 100644
--- a/zlib/ChangeLog
+++ b/zlib/ChangeLog
@@ -1,6 +1,18 @@
ChangeLog file for zlib
+Changes in 1.2.13 (13 Oct 2022)
+- Fix configure issue that discarded provided CC definition
+- Correct incorrect inputs provided to the CRC functions
+- Repair prototypes and exporting of new CRC functions
+- Fix inflateBack to detect invalid input with distances too far
+- Have infback() deliver all of the available output up to any error
+- Fix a bug when getting a gzip header extra field with inflate()
+- Fix bug in block type selection when Z_FIXED used
+- Tighten deflateBound bounds
+- Remove deleted assembler code references
+- Various portability and appearance improvements
+
Changes in 1.2.12 (27 Mar 2022)
- Cygwin does not have _wopen(), so do not create gzopen_w() there
- Permit a deflateParams() parameter change as soon as possible
@@ -159,7 +171,7 @@ Changes in 1.2.7.1 (24 Mar 2013)
- Fix types in contrib/minizip to match result of get_crc_table()
- Simplify contrib/vstudio/vc10 with 'd' suffix
- Add TOP support to win32/Makefile.msc
-- Suport i686 and amd64 assembler builds in CMakeLists.txt
+- Support i686 and amd64 assembler builds in CMakeLists.txt
- Fix typos in the use of _LARGEFILE64_SOURCE in zconf.h
- Add vc11 and vc12 build files to contrib/vstudio
- Add gzvprintf() as an undocumented function in zlib
@@ -359,14 +371,14 @@ Changes in 1.2.5.1 (10 Sep 2011)
- Use u4 type for crc_table to avoid conversion warnings
- Apply casts in zlib.h to avoid conversion warnings
- Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller]
-- Improve inflateSync() documentation to note indeterminancy
+- Improve inflateSync() documentation to note indeterminacy
- Add deflatePending() function to return the amount of pending output
- Correct the spelling of "specification" in FAQ [Randers-Pehrson]
- Add a check in configure for stdarg.h, use for gzprintf()
- Check that pointers fit in ints when gzprint() compiled old style
- Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler]
- Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt]
-- Add debug records in assmebler code [Londer]
+- Add debug records in assembler code [Londer]
- Update RFC references to use http://tools.ietf.org/html/... [Li]
- Add --archs option, use of libtool to configure for Mac OS X [Borstel]
@@ -1033,7 +1045,7 @@ Changes in 1.2.0.1 (17 March 2003)
- Include additional header file on VMS for off_t typedef
- Try to use _vsnprintf where it supplants vsprintf [Vollant]
- Add some casts in inffast.c
-- Enchance comments in zlib.h on what happens if gzprintf() tries to
+- Enhance comments in zlib.h on what happens if gzprintf() tries to
write more than 4095 bytes before compression
- Remove unused state from inflateBackEnd()
- Remove exit(0) from minigzip.c, example.c
@@ -1211,7 +1223,7 @@ Changes in 1.0.9 (17 Feb 1998)
- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8
- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi)
- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with
- the declaration of FAR (Gilles VOllant)
+ the declaration of FAR (Gilles Vollant)
- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann)
- read_buf buf parameter of type Bytef* instead of charf*
- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout)
@@ -1567,7 +1579,7 @@ Changes in 0.4:
- renamed deflateOptions as deflateInit2, call one or the other but not both
- added the method parameter for deflateInit2
- added inflateInit2
-- simplied considerably deflateInit and inflateInit by not supporting
+- simplified considerably deflateInit and inflateInit by not supporting
user-provided history buffer. This is supported only in deflateInit2
and inflateInit2
diff --git a/zlib/LICENSE b/zlib/LICENSE
new file mode 100644
index 00000000000..ab8ee6f7142
--- /dev/null
+++ b/zlib/LICENSE
@@ -0,0 +1,22 @@
+Copyright notice:
+
+ (C) 1995-2022 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
diff --git a/zlib/README b/zlib/README
index 024b79d3d8c..ba34d1894a9 100644
--- a/zlib/README
+++ b/zlib/README
@@ -1,6 +1,6 @@
ZLIB DATA COMPRESSION LIBRARY
-zlib 1.2.12 is a general purpose data compression library. All the code is
+zlib 1.2.13 is a general purpose data compression library. All the code is
thread safe. The data format used by the zlib library is described by RFCs
(Request for Comments) 1950 to 1952 in the files
http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
@@ -31,7 +31,7 @@ Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
issue of Dr. Dobb's Journal; a copy of the article is available at
http://marknelson.us/1997/01/01/zlib-engine/ .
-The changes made in version 1.2.12 are documented in the file ChangeLog.
+The changes made in version 1.2.13 are documented in the file ChangeLog.
Unsupported third party contributions are provided in directory contrib/ .
diff --git a/zlib/compress.c b/zlib/compress.c
index e2db404abf8..2ad5326c14e 100644
--- a/zlib/compress.c
+++ b/zlib/compress.c
@@ -19,7 +19,7 @@
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
-int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
+int ZEXPORT compress2(dest, destLen, source, sourceLen, level)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
@@ -65,7 +65,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
/* ===========================================================================
*/
-int ZEXPORT compress (dest, destLen, source, sourceLen)
+int ZEXPORT compress(dest, destLen, source, sourceLen)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
@@ -78,7 +78,7 @@ int ZEXPORT compress (dest, destLen, source, sourceLen)
If the default memLevel or windowBits for deflateInit() is changed, then
this function needs to be updated.
*/
-uLong ZEXPORT compressBound (sourceLen)
+uLong ZEXPORT compressBound(sourceLen)
uLong sourceLen;
{
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
diff --git a/zlib/crc32.c b/zlib/crc32.c
index a1bdce5c23c..f8357b083f7 100644
--- a/zlib/crc32.c
+++ b/zlib/crc32.c
@@ -98,13 +98,22 @@
# endif
#endif
+/* If available, use the ARM processor CRC32 instruction. */
+#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
+# define ARMCRC32
+#endif
+
/* Local functions. */
local z_crc_t multmodp OF((z_crc_t a, z_crc_t b));
local z_crc_t x2nmodp OF((z_off64_t n, unsigned k));
-/* If available, use the ARM processor CRC32 instruction. */
-#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
-# define ARMCRC32
+#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
+ local z_word_t byte_swap OF((z_word_t word));
+#endif
+
+#if defined(W) && !defined(ARMCRC32)
+ local z_crc_t crc_word OF((z_word_t data));
+ local z_word_t crc_word_big OF((z_word_t data));
#endif
#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
@@ -630,7 +639,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
#endif /* DYNAMIC_CRC_TABLE */
/* Pre-condition the CRC */
- crc ^= 0xffffffff;
+ crc = (~crc) & 0xffffffff;
/* Compute the CRC up to a word boundary. */
while (len && ((z_size_t)buf & 7) != 0) {
@@ -645,8 +654,8 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
len &= 7;
/* Do three interleaved CRCs to realize the throughput of one crc32x
- instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three
- CRCs are combined into a single CRC after each set of batches. */
+ instruction per cycle. Each CRC is calculated on Z_BATCH words. The
+ three CRCs are combined into a single CRC after each set of batches. */
while (num >= 3 * Z_BATCH) {
crc1 = 0;
crc2 = 0;
@@ -749,7 +758,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
#endif /* DYNAMIC_CRC_TABLE */
/* Pre-condition the CRC */
- crc ^= 0xffffffff;
+ crc = (~crc) & 0xffffffff;
#ifdef W
@@ -1077,7 +1086,7 @@ uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
#ifdef DYNAMIC_CRC_TABLE
once(&made, make_crc_table);
#endif /* DYNAMIC_CRC_TABLE */
- return multmodp(x2nmodp(len2, 3), crc1) ^ crc2;
+ return multmodp(x2nmodp(len2, 3), crc1) ^ (crc2 & 0xffffffff);
}
/* ========================================================================= */
@@ -1086,7 +1095,7 @@ uLong ZEXPORT crc32_combine(crc1, crc2, len2)
uLong crc2;
z_off_t len2;
{
- return crc32_combine64(crc1, crc2, len2);
+ return crc32_combine64(crc1, crc2, (z_off64_t)len2);
}
/* ========================================================================= */
@@ -1103,14 +1112,14 @@ uLong ZEXPORT crc32_combine_gen64(len2)
uLong ZEXPORT crc32_combine_gen(len2)
z_off_t len2;
{
- return crc32_combine_gen64(len2);
+ return crc32_combine_gen64((z_off64_t)len2);
}
/* ========================================================================= */
-uLong crc32_combine_op(crc1, crc2, op)
+uLong ZEXPORT crc32_combine_op(crc1, crc2, op)
uLong crc1;
uLong crc2;
uLong op;
{
- return multmodp(op, crc1) ^ crc2;
+ return multmodp(op, crc1) ^ (crc2 & 0xffffffff);
}
diff --git a/zlib/deflate.c b/zlib/deflate.c
index 799fb93cc04..4a689db3598 100644
--- a/zlib/deflate.c
+++ b/zlib/deflate.c
@@ -52,7 +52,7 @@
#include "deflate.h"
const char deflate_copyright[] =
- " deflate 1.2.12 Copyright 1995-2022 Jean-loup Gailly and Mark Adler ";
+ " deflate 1.2.13 Copyright 1995-2022 Jean-loup Gailly and Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -87,13 +87,7 @@ local void lm_init OF((deflate_state *s));
local void putShortMSB OF((deflate_state *s, uInt b));
local void flush_pending OF((z_streamp strm));
local unsigned read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
-#ifdef ASMV
-# pragma message("Assembler code may have bugs -- use at your own risk")
- void match_init OF((void)); /* asm code initialization */
- uInt longest_match OF((deflate_state *s, IPos cur_match));
-#else
local uInt longest_match OF((deflate_state *s, IPos cur_match));
-#endif
#ifdef ZLIB_DEBUG
local void check_match OF((deflate_state *s, IPos start, IPos match,
@@ -160,7 +154,7 @@ local const config configuration_table[10] = {
* characters, so that a running hash key can be computed from the previous
* key instead of complete recalculation each time.
*/
-#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
+#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
/* ===========================================================================
@@ -191,9 +185,9 @@ local const config configuration_table[10] = {
*/
#define CLEAR_HASH(s) \
do { \
- s->head[s->hash_size-1] = NIL; \
+ s->head[s->hash_size - 1] = NIL; \
zmemzero((Bytef *)s->head, \
- (unsigned)(s->hash_size-1)*sizeof(*s->head)); \
+ (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \
} while (0)
/* ===========================================================================
@@ -285,6 +279,8 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
if (windowBits < 0) { /* suppress zlib wrapper */
wrap = 0;
+ if (windowBits < -15)
+ return Z_STREAM_ERROR;
windowBits = -windowBits;
}
#ifdef GZIP
@@ -314,7 +310,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
s->hash_bits = (uInt)memLevel + 7;
s->hash_size = 1 << s->hash_bits;
s->hash_mask = s->hash_size - 1;
- s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
+ s->hash_shift = ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH);
s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));
@@ -340,11 +336,11 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
* sym_buf value to read moves forward three bytes. From that symbol, up to
* 31 bits are written to pending_buf. The closest the written pending_buf
* bits gets to the next sym_buf symbol to read is just before the last
- * code is written. At that time, 31*(n-2) bits have been written, just
- * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at
- * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1
+ * code is written. At that time, 31*(n - 2) bits have been written, just
+ * after 24*(n - 2) bits have been consumed from sym_buf. sym_buf starts at
+ * 8*n bits into pending_buf. (Note that the symbol buffer fills when n - 1
* symbols are written.) The closest the writing gets to what is unread is
- * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and
+ * then n + 14 bits. Here n is lit_bufsize, which is 16384 by default, and
* can range from 128 to 32768.
*
* Therefore, at a minimum, there are 142 bits of space between what is
@@ -390,7 +386,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
/* =========================================================================
* Check for a valid deflate stream state. Return 0 if ok, 1 if not.
*/
-local int deflateStateCheck (strm)
+local int deflateStateCheck(strm)
z_streamp strm;
{
deflate_state *s;
@@ -413,7 +409,7 @@ local int deflateStateCheck (strm)
}
/* ========================================================================= */
-int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
+int ZEXPORT deflateSetDictionary(strm, dictionary, dictLength)
z_streamp strm;
const Bytef *dictionary;
uInt dictLength;
@@ -482,7 +478,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
}
/* ========================================================================= */
-int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength)
+int ZEXPORT deflateGetDictionary(strm, dictionary, dictLength)
z_streamp strm;
Bytef *dictionary;
uInt *dictLength;
@@ -504,7 +500,7 @@ int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength)
}
/* ========================================================================= */
-int ZEXPORT deflateResetKeep (strm)
+int ZEXPORT deflateResetKeep(strm)
z_streamp strm;
{
deflate_state *s;
@@ -542,7 +538,7 @@ int ZEXPORT deflateResetKeep (strm)
}
/* ========================================================================= */
-int ZEXPORT deflateReset (strm)
+int ZEXPORT deflateReset(strm)
z_streamp strm;
{
int ret;
@@ -554,7 +550,7 @@ int ZEXPORT deflateReset (strm)
}
/* ========================================================================= */
-int ZEXPORT deflateSetHeader (strm, head)
+int ZEXPORT deflateSetHeader(strm, head)
z_streamp strm;
gz_headerp head;
{
@@ -565,7 +561,7 @@ int ZEXPORT deflateSetHeader (strm, head)
}
/* ========================================================================= */
-int ZEXPORT deflatePending (strm, pending, bits)
+int ZEXPORT deflatePending(strm, pending, bits)
unsigned *pending;
int *bits;
z_streamp strm;
@@ -579,7 +575,7 @@ int ZEXPORT deflatePending (strm, pending, bits)
}
/* ========================================================================= */
-int ZEXPORT deflatePrime (strm, bits, value)
+int ZEXPORT deflatePrime(strm, bits, value)
z_streamp strm;
int bits;
int value;
@@ -674,36 +670,50 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
}
/* =========================================================================
- * For the default windowBits of 15 and memLevel of 8, this function returns
- * a close to exact, as well as small, upper bound on the compressed size.
- * They are coded as constants here for a reason--if the #define's are
- * changed, then this function needs to be changed as well. The return
- * value for 15 and 8 only works for those exact settings.
+ * For the default windowBits of 15 and memLevel of 8, this function returns a
+ * close to exact, as well as small, upper bound on the compressed size. This
+ * is an expansion of ~0.03%, plus a small constant.
+ *
+ * For any setting other than those defaults for windowBits and memLevel, one
+ * of two worst case bounds is returned. This is at most an expansion of ~4% or
+ * ~13%, plus a small constant.
*
- * For any setting other than those defaults for windowBits and memLevel,
- * the value returned is a conservative worst case for the maximum expansion
- * resulting from using fixed blocks instead of stored blocks, which deflate
- * can emit on compressed data for some combinations of the parameters.
+ * Both the 0.03% and 4% derive from the overhead of stored blocks. The first
+ * one is for stored blocks of 16383 bytes (memLevel == 8), whereas the second
+ * is for stored blocks of 127 bytes (the worst case memLevel == 1). The
+ * expansion results from five bytes of header for each stored block.
*
- * This function could be more sophisticated to provide closer upper bounds for
- * every combination of windowBits and memLevel. But even the conservative
- * upper bound of about 14% expansion does not seem onerous for output buffer
- * allocation.
+ * The larger expansion of 13% results from a window size less than or equal to
+ * the symbols buffer size (windowBits <= memLevel + 7). In that case some of
+ * the data being compressed may have slid out of the sliding window, impeding
+ * a stored block from being emitted. Then the only choice is a fixed or
+ * dynamic block, where a fixed block limits the maximum expansion to 9 bits
+ * per 8-bit byte, plus 10 bits for every block. The smallest block size for
+ * which this can occur is 255 (memLevel == 2).
+ *
+ * Shifts are used to approximate divisions, for speed.
*/
uLong ZEXPORT deflateBound(strm, sourceLen)
z_streamp strm;
uLong sourceLen;
{
deflate_state *s;
- uLong complen, wraplen;
+ uLong fixedlen, storelen, wraplen;
+
+ /* upper bound for fixed blocks with 9-bit literals and length 255
+ (memLevel == 2, which is the lowest that may not use stored blocks) --
+ ~13% overhead plus a small constant */
+ fixedlen = sourceLen + (sourceLen >> 3) + (sourceLen >> 8) +
+ (sourceLen >> 9) + 4;
- /* conservative upper bound for compressed data */
- complen = sourceLen +
- ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5;
+ /* upper bound for stored blocks with length 127 (memLevel == 1) --
+ ~4% overhead plus a small constant */
+ storelen = sourceLen + (sourceLen >> 5) + (sourceLen >> 7) +
+ (sourceLen >> 11) + 7;
- /* if can't get parameters, return conservative bound plus zlib wrapper */
+ /* if can't get parameters, return larger bound plus a zlib wrapper */
if (deflateStateCheck(strm))
- return complen + 6;
+ return (fixedlen > storelen ? fixedlen : storelen) + 6;
/* compute wrapper length */
s = strm->state;
@@ -740,11 +750,12 @@ uLong ZEXPORT deflateBound(strm, sourceLen)
wraplen = 6;
}
- /* if not default parameters, return conservative bound */
+ /* if not default parameters, return one of the conservative bounds */
if (s->w_bits != 15 || s->hash_bits != 8 + 7)
- return complen + wraplen;
+ return (s->w_bits <= s->hash_bits ? fixedlen : storelen) + wraplen;
- /* default settings: return tight bound for that case */
+ /* default settings: return tight bound for that case -- ~0.03% overhead
+ plus a small constant */
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
(sourceLen >> 25) + 13 - 6 + wraplen;
}
@@ -754,7 +765,7 @@ uLong ZEXPORT deflateBound(strm, sourceLen)
* IN assertion: the stream state is correct and there is enough room in
* pending_buf.
*/
-local void putShortMSB (s, b)
+local void putShortMSB(s, b)
deflate_state *s;
uInt b;
{
@@ -801,7 +812,7 @@ local void flush_pending(strm)
} while (0)
/* ========================================================================= */
-int ZEXPORT deflate (strm, flush)
+int ZEXPORT deflate(strm, flush)
z_streamp strm;
int flush;
{
@@ -856,7 +867,7 @@ int ZEXPORT deflate (strm, flush)
s->status = BUSY_STATE;
if (s->status == INIT_STATE) {
/* zlib header */
- uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
+ uInt header = (Z_DEFLATED + ((s->w_bits - 8) << 4)) << 8;
uInt level_flags;
if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
@@ -1116,7 +1127,7 @@ int ZEXPORT deflate (strm, flush)
}
/* ========================================================================= */
-int ZEXPORT deflateEnd (strm)
+int ZEXPORT deflateEnd(strm)
z_streamp strm;
{
int status;
@@ -1142,7 +1153,7 @@ int ZEXPORT deflateEnd (strm)
* To simplify the source, this is not supported for 16-bit MSDOS (which
* doesn't have enough memory anyway to duplicate compression states).
*/
-int ZEXPORT deflateCopy (dest, source)
+int ZEXPORT deflateCopy(dest, source)
z_streamp dest;
z_streamp source;
{
@@ -1231,7 +1242,7 @@ local unsigned read_buf(strm, buf, size)
/* ===========================================================================
* Initialize the "longest match" routines for a new zlib stream
*/
-local void lm_init (s)
+local void lm_init(s)
deflate_state *s;
{
s->window_size = (ulg)2L*s->w_size;
@@ -1252,11 +1263,6 @@ local void lm_init (s)
s->match_length = s->prev_length = MIN_MATCH-1;
s->match_available = 0;
s->ins_h = 0;
-#ifndef FASTEST
-#ifdef ASMV
- match_init(); /* initialize the asm code */
-#endif
-#endif
}
#ifndef FASTEST
@@ -1269,10 +1275,6 @@ local void lm_init (s)
* string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
* OUT assertion: the match length is not greater than s->lookahead.
*/
-#ifndef ASMV
-/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
- * match.S. The code will be functionally equivalent.
- */
local uInt longest_match(s, cur_match)
deflate_state *s;
IPos cur_match; /* current match */
@@ -1297,10 +1299,10 @@ local uInt longest_match(s, cur_match)
*/
register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
register ush scan_start = *(ushf*)scan;
- register ush scan_end = *(ushf*)(scan+best_len-1);
+ register ush scan_end = *(ushf*)(scan + best_len - 1);
#else
register Bytef *strend = s->window + s->strstart + MAX_MATCH;
- register Byte scan_end1 = scan[best_len-1];
+ register Byte scan_end1 = scan[best_len - 1];
register Byte scan_end = scan[best_len];
#endif
@@ -1318,7 +1320,8 @@ local uInt longest_match(s, cur_match)
*/
if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead;
- Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+ Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
+ "need lookahead");
do {
Assert(cur_match < s->strstart, "no future");
@@ -1336,43 +1339,44 @@ local uInt longest_match(s, cur_match)
/* This code assumes sizeof(unsigned short) == 2. Do not use
* UNALIGNED_OK if your compiler uses a different size.
*/
- if (*(ushf*)(match+best_len-1) != scan_end ||
+ if (*(ushf*)(match + best_len - 1) != scan_end ||
*(ushf*)match != scan_start) continue;
/* It is not necessary to compare scan[2] and match[2] since they are
* always equal when the other bytes match, given that the hash keys
* are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
- * strstart+3, +5, ... up to strstart+257. We check for insufficient
+ * strstart + 3, + 5, up to strstart + 257. We check for insufficient
* lookahead only every 4th comparison; the 128th check will be made
- * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
+ * at strstart + 257. If MAX_MATCH-2 is not a multiple of 8, it is
* necessary to put more guard bytes at the end of the window, or
* to check more often for insufficient lookahead.
*/
Assert(scan[2] == match[2], "scan[2]?");
scan++, match++;
do {
- } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ } while (*(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
+ *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
+ *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
+ *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
scan < strend);
/* The funny "do {}" generates better code on most compilers */
- /* Here, scan <= window+strstart+257 */
- Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+ /* Here, scan <= window + strstart + 257 */
+ Assert(scan <= s->window + (unsigned)(s->window_size - 1),
+ "wild scan");
if (*scan == *match) scan++;
- len = (MAX_MATCH - 1) - (int)(strend-scan);
+ len = (MAX_MATCH - 1) - (int)(strend - scan);
scan = strend - (MAX_MATCH-1);
#else /* UNALIGNED_OK */
- if (match[best_len] != scan_end ||
- match[best_len-1] != scan_end1 ||
- *match != *scan ||
- *++match != scan[1]) continue;
+ if (match[best_len] != scan_end ||
+ match[best_len - 1] != scan_end1 ||
+ *match != *scan ||
+ *++match != scan[1]) continue;
- /* The check at best_len-1 can be removed because it will be made
+ /* The check at best_len - 1 can be removed because it will be made
* again later. (This heuristic is not always a win.)
* It is not necessary to compare scan[2] and match[2] since they
* are always equal when the other bytes match, given that
@@ -1382,7 +1386,7 @@ local uInt longest_match(s, cur_match)
Assert(*scan == *match, "match[2]?");
/* We check for insufficient lookahead only every 8th comparison;
- * the 256th check will be made at strstart+258.
+ * the 256th check will be made at strstart + 258.
*/
do {
} while (*++scan == *++match && *++scan == *++match &&
@@ -1391,7 +1395,8 @@ local uInt longest_match(s, cur_match)
*++scan == *++match && *++scan == *++match &&
scan < strend);
- Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+ Assert(scan <= s->window + (unsigned)(s->window_size - 1),
+ "wild scan");
len = MAX_MATCH - (int)(strend - scan);
scan = strend - MAX_MATCH;
@@ -1403,9 +1408,9 @@ local uInt longest_match(s, cur_match)
best_len = len;
if (len >= nice_match) break;
#ifdef UNALIGNED_OK
- scan_end = *(ushf*)(scan+best_len-1);
+ scan_end = *(ushf*)(scan + best_len - 1);
#else
- scan_end1 = scan[best_len-1];
+ scan_end1 = scan[best_len - 1];
scan_end = scan[best_len];
#endif
}
@@ -1415,7 +1420,6 @@ local uInt longest_match(s, cur_match)
if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
return s->lookahead;
}
-#endif /* ASMV */
#else /* FASTEST */
@@ -1436,7 +1440,8 @@ local uInt longest_match(s, cur_match)
*/
Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
- Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+ Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
+ "need lookahead");
Assert(cur_match < s->strstart, "no future");
@@ -1446,7 +1451,7 @@ local uInt longest_match(s, cur_match)
*/
if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
- /* The check at best_len-1 can be removed because it will be made
+ /* The check at best_len - 1 can be removed because it will be made
* again later. (This heuristic is not always a win.)
* It is not necessary to compare scan[2] and match[2] since they
* are always equal when the other bytes match, given that
@@ -1456,7 +1461,7 @@ local uInt longest_match(s, cur_match)
Assert(*scan == *match, "match[2]?");
/* We check for insufficient lookahead only every 8th comparison;
- * the 256th check will be made at strstart+258.
+ * the 256th check will be made at strstart + 258.
*/
do {
} while (*++scan == *++match && *++scan == *++match &&
@@ -1465,7 +1470,7 @@ local uInt longest_match(s, cur_match)
*++scan == *++match && *++scan == *++match &&
scan < strend);
- Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+ Assert(scan <= s->window + (unsigned)(s->window_size - 1), "wild scan");
len = MAX_MATCH - (int)(strend - scan);
@@ -1501,7 +1506,7 @@ local void check_match(s, start, match, length)
z_error("invalid match");
}
if (z_verbose > 1) {
- fprintf(stderr,"\\[%d,%d]", start-match, length);
+ fprintf(stderr,"\\[%d,%d]", start - match, length);
do { putc(s->window[start++], stderr); } while (--length != 0);
}
}
@@ -1547,9 +1552,9 @@ local void fill_window(s)
/* If the window is almost full and there is insufficient lookahead,
* move the upper half to the lower one to make room in the upper half.
*/
- if (s->strstart >= wsize+MAX_DIST(s)) {
+ if (s->strstart >= wsize + MAX_DIST(s)) {
- zmemcpy(s->window, s->window+wsize, (unsigned)wsize - more);
+ zmemcpy(s->window, s->window + wsize, (unsigned)wsize - more);
s->match_start -= wsize;
s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
s->block_start -= (long) wsize;
@@ -1680,7 +1685,7 @@ local void fill_window(s)
*
* deflate_stored() is written to minimize the number of times an input byte is
* copied. It is most efficient with large input and output buffers, which
- * maximizes the opportunites to have a single copy from next_in to next_out.
+ * maximizes the opportunities to have a single copy from next_in to next_out.
*/
local block_state deflate_stored(s, flush)
deflate_state *s;
@@ -1890,7 +1895,7 @@ local block_state deflate_fast(s, flush)
if (s->lookahead == 0) break; /* flush the current block */
}
- /* Insert the string window[strstart .. strstart+2] in the
+ /* Insert the string window[strstart .. strstart + 2] in the
* dictionary, and set hash_head to the head of the hash chain:
*/
hash_head = NIL;
@@ -1938,7 +1943,7 @@ local block_state deflate_fast(s, flush)
s->strstart += s->match_length;
s->match_length = 0;
s->ins_h = s->window[s->strstart];
- UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
+ UPDATE_HASH(s, s->ins_h, s->window[s->strstart + 1]);
#if MIN_MATCH != 3
Call UPDATE_HASH() MIN_MATCH-3 more times
#endif
@@ -1949,7 +1954,7 @@ local block_state deflate_fast(s, flush)
} else {
/* No match, output a literal byte */
Tracevv((stderr,"%c", s->window[s->strstart]));
- _tr_tally_lit (s, s->window[s->strstart], bflush);
+ _tr_tally_lit(s, s->window[s->strstart], bflush);
s->lookahead--;
s->strstart++;
}
@@ -1993,7 +1998,7 @@ local block_state deflate_slow(s, flush)
if (s->lookahead == 0) break; /* flush the current block */
}
- /* Insert the string window[strstart .. strstart+2] in the
+ /* Insert the string window[strstart .. strstart + 2] in the
* dictionary, and set hash_head to the head of the hash chain:
*/
hash_head = NIL;
@@ -2035,17 +2040,17 @@ local block_state deflate_slow(s, flush)
uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
/* Do not insert strings in hash table beyond this. */
- check_match(s, s->strstart-1, s->prev_match, s->prev_length);
+ check_match(s, s->strstart - 1, s->prev_match, s->prev_length);
- _tr_tally_dist(s, s->strstart -1 - s->prev_match,
+ _tr_tally_dist(s, s->strstart - 1 - s->prev_match,
s->prev_length - MIN_MATCH, bflush);
/* Insert in hash table all strings up to the end of the match.
- * strstart-1 and strstart are already inserted. If there is not
+ * strstart - 1 and strstart are already inserted. If there is not
* enough lookahead, the last two strings are not inserted in
* the hash table.
*/
- s->lookahead -= s->prev_length-1;
+ s->lookahead -= s->prev_length - 1;
s->prev_length -= 2;
do {
if (++s->strstart <= max_insert) {
@@ -2063,8 +2068,8 @@ local block_state deflate_slow(s, flush)
* single literal. If there was a match but the current match
* is longer, truncate the previous match to a single literal.
*/
- Tracevv((stderr,"%c", s->window[s->strstart-1]));
- _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+ Tracevv((stderr,"%c", s->window[s->strstart - 1]));
+ _tr_tally_lit(s, s->window[s->strstart - 1], bflush);
if (bflush) {
FLUSH_BLOCK_ONLY(s, 0);
}
@@ -2082,8 +2087,8 @@ local block_state deflate_slow(s, flush)
}
Assert (flush != Z_NO_FLUSH, "no flush?");
if (s->match_available) {
- Tracevv((stderr,"%c", s->window[s->strstart-1]));
- _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+ Tracevv((stderr,"%c", s->window[s->strstart - 1]));
+ _tr_tally_lit(s, s->window[s->strstart - 1], bflush);
s->match_available = 0;
}
s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
@@ -2140,7 +2145,8 @@ local block_state deflate_rle(s, flush)
if (s->match_length > s->lookahead)
s->match_length = s->lookahead;
}
- Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
+ Assert(scan <= s->window + (uInt)(s->window_size - 1),
+ "wild scan");
}
/* Emit match if have run of MIN_MATCH or longer, else emit literal */
@@ -2155,7 +2161,7 @@ local block_state deflate_rle(s, flush)
} else {
/* No match, output a literal byte */
Tracevv((stderr,"%c", s->window[s->strstart]));
- _tr_tally_lit (s, s->window[s->strstart], bflush);
+ _tr_tally_lit(s, s->window[s->strstart], bflush);
s->lookahead--;
s->strstart++;
}
@@ -2195,7 +2201,7 @@ local block_state deflate_huff(s, flush)
/* Output a literal byte */
s->match_length = 0;
Tracevv((stderr,"%c", s->window[s->strstart]));
- _tr_tally_lit (s, s->window[s->strstart], bflush);
+ _tr_tally_lit(s, s->window[s->strstart], bflush);
s->lookahead--;
s->strstart++;
if (bflush) FLUSH_BLOCK(s, 0);
diff --git a/zlib/deflate.h b/zlib/deflate.h
index 3acd0750751..1a06cd5f25d 100644
--- a/zlib/deflate.h
+++ b/zlib/deflate.h
@@ -329,8 +329,8 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
# define _tr_tally_dist(s, distance, length, flush) \
{ uch len = (uch)(length); \
ush dist = (ush)(distance); \
- s->sym_buf[s->sym_next++] = (uchf) dist; \
- s->sym_buf[s->sym_next++] = dist >> 8; \
+ s->sym_buf[s->sym_next++] = (uch)dist; \
+ s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
s->sym_buf[s->sym_next++] = len; \
dist--; \
s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
diff --git a/zlib/gzlib.c b/zlib/gzlib.c
index dddaf268730..55da46a453f 100644
--- a/zlib/gzlib.c
+++ b/zlib/gzlib.c
@@ -30,7 +30,7 @@ local gzFile gz_open OF((const void *, int, const char *));
The gz_strwinerror function does not change the current setting of
GetLastError. */
-char ZLIB_INTERNAL *gz_strwinerror (error)
+char ZLIB_INTERNAL *gz_strwinerror(error)
DWORD error;
{
static char buf[1024];
diff --git a/zlib/gzread.c b/zlib/gzread.c
index a669b2d5814..a53d54a2208 100644
--- a/zlib/gzread.c
+++ b/zlib/gzread.c
@@ -157,11 +157,9 @@ local int gz_look(state)
the output buffer is larger than the input buffer, which also assures
space for gzungetc() */
state->x.next = state->out;
- if (strm->avail_in) {
- memcpy(state->x.next, strm->next_in, strm->avail_in);
- state->x.have = strm->avail_in;
- strm->avail_in = 0;
- }
+ memcpy(state->x.next, strm->next_in, strm->avail_in);
+ state->x.have = strm->avail_in;
+ strm->avail_in = 0;
state->how = COPY;
state->direct = 1;
return 0;
diff --git a/zlib/gzwrite.c b/zlib/gzwrite.c
index a928257152a..b7236f70d14 100644
--- a/zlib/gzwrite.c
+++ b/zlib/gzwrite.c
@@ -474,7 +474,7 @@ int ZEXPORTVA gzprintf(gzFile file, const char *format, ...)
#else /* !STDC && !Z_HAVE_STDARG_H */
/* -- see zlib.h -- */
-int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
+int ZEXPORTVA gzprintf(file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
gzFile file;
const char *format;
diff --git a/zlib/infback.c b/zlib/infback.c
index a390c58e816..babeaf1806f 100644
--- a/zlib/infback.c
+++ b/zlib/infback.c
@@ -66,6 +66,7 @@ int stream_size;
state->window = window;
state->wnext = 0;
state->whave = 0;
+ state->sane = 1;
return Z_OK;
}
@@ -605,25 +606,27 @@ void FAR *out_desc;
break;
case DONE:
- /* inflate stream terminated properly -- write leftover output */
+ /* inflate stream terminated properly */
ret = Z_STREAM_END;
- if (left < state->wsize) {
- if (out(out_desc, state->window, state->wsize - left))
- ret = Z_BUF_ERROR;
- }
goto inf_leave;
case BAD:
ret = Z_DATA_ERROR;
goto inf_leave;
- default: /* can't happen, but makes compilers happy */
+ default:
+ /* can't happen, but makes compilers happy */
ret = Z_STREAM_ERROR;
goto inf_leave;
}
- /* Return unused input */
+ /* Write leftover output and return unused input */
inf_leave:
+ if (left < state->wsize) {
+ if (out(out_desc, state->window, state->wsize - left) &&
+ ret == Z_STREAM_END)
+ ret = Z_BUF_ERROR;
+ }
strm->next_in = next;
strm->avail_in = have;
return ret;
diff --git a/zlib/inflate.c b/zlib/inflate.c
index 7be8c63662a..8acbef44e99 100644
--- a/zlib/inflate.c
+++ b/zlib/inflate.c
@@ -168,6 +168,8 @@ int windowBits;
/* extract wrap request from windowBits parameter */
if (windowBits < 0) {
+ if (windowBits < -15)
+ return Z_STREAM_ERROR;
wrap = 0;
windowBits = -windowBits;
}
@@ -764,8 +766,9 @@ int flush;
if (copy > have) copy = have;
if (copy) {
if (state->head != Z_NULL &&
- state->head->extra != Z_NULL) {
- len = state->head->extra_len - state->length;
+ state->head->extra != Z_NULL &&
+ (len = state->head->extra_len - state->length) <
+ state->head->extra_max) {
zmemcpy(state->head->extra + len, next,
len + copy > state->head->extra_max ?
state->head->extra_max - len : copy);
diff --git a/zlib/inftrees.c b/zlib/inftrees.c
index 09462a740b1..57d2793bec9 100644
--- a/zlib/inftrees.c
+++ b/zlib/inftrees.c
@@ -9,7 +9,7 @@
#define MAXBITS 15
const char inflate_copyright[] =
- " inflate 1.2.12 Copyright 1995-2022 Mark Adler ";
+ " inflate 1.2.13 Copyright 1995-2022 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -62,7 +62,7 @@ unsigned short FAR *work;
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
- 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 202};
+ 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 194, 65};
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
diff --git a/zlib/inftrees.h b/zlib/inftrees.h
index baa53a0b1a1..f53665311c1 100644
--- a/zlib/inftrees.h
+++ b/zlib/inftrees.h
@@ -38,7 +38,7 @@ typedef struct {
/* Maximum size of the dynamic table. The maximum number of code structures is
1444, which is the sum of 852 for literal/length codes and 592 for distance
codes. These values were found by exhaustive searches using the program
- examples/enough.c found in the zlib distribtution. The arguments to that
+ examples/enough.c found in the zlib distribution. The arguments to that
program are the number of symbols, the initial root table size, and the
maximum bit length of a code. "enough 286 9 15" for literal/length codes
returns returns 852, and "enough 30 6 15" for distance codes returns 592.
diff --git a/zlib/make_vms.com b/zlib/make_vms.com
index 65e9d0cbc8e..4dc8a891355 100644
--- a/zlib/make_vms.com
+++ b/zlib/make_vms.com
@@ -14,9 +14,9 @@ $! 0.02 20061008 Adapt to new Makefile.in
$! 0.03 20091224 Add support for large file check
$! 0.04 20100110 Add new gzclose, gzlib, gzread, gzwrite
$! 0.05 20100221 Exchange zlibdefs.h by zconf.h.in
-$! 0.06 20120111 Fix missing amiss_err, update zconf_h.in, fix new exmples
+$! 0.06 20120111 Fix missing amiss_err, update zconf_h.in, fix new examples
$! subdir path, update module search in makefile.in
-$! 0.07 20120115 Triggered by work done by Alexey Chupahin completly redesigned
+$! 0.07 20120115 Triggered by work done by Alexey Chupahin completely redesigned
$! shared image creation
$! 0.08 20120219 Make it work on VAX again, pre-load missing symbols to shared
$! image
diff --git a/zlib/qnx/package.qpg b/zlib/qnx/package.qpg
index badd1d5a0a7..ba2f1a2d6c3 100644
--- a/zlib/qnx/package.qpg
+++ b/zlib/qnx/package.qpg
@@ -25,10 +25,10 @@
<QPG:Files>
<QPG:Add file="../zconf.h" install="/opt/include/" user="root:sys" permission="644"/>
<QPG:Add file="../zlib.h" install="/opt/include/" user="root:sys" permission="644"/>
- <QPG:Add file="../libz.so.1.2.12" install="/opt/lib/" user="root:bin" permission="644"/>
- <QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.12"/>
- <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.12"/>
- <QPG:Add file="../libz.so.1.2.12" install="/opt/lib/" component="slib"/>
+ <QPG:Add file="../libz.so.1.2.13" install="/opt/lib/" user="root:bin" permission="644"/>
+ <QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.13"/>
+ <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.13"/>
+ <QPG:Add file="../libz.so.1.2.13" install="/opt/lib/" component="slib"/>
</QPG:Files>
<QPG:PackageFilter>
@@ -63,7 +63,7 @@
</QPM:ProductDescription>
<QPM:ReleaseDescription>
- <QPM:ReleaseVersion>1.2.12</QPM:ReleaseVersion>
+ <QPM:ReleaseVersion>1.2.13</QPM:ReleaseVersion>
<QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
<QPM:ReleaseStability>Stable</QPM:ReleaseStability>
<QPM:ReleaseNoteMinor></QPM:ReleaseNoteMinor>
diff --git a/zlib/treebuild.xml b/zlib/treebuild.xml
index 781b4c98cc2..0017a45d3c5 100644
--- a/zlib/treebuild.xml
+++ b/zlib/treebuild.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" ?>
-<package name="zlib" version="1.2.12">
- <library name="zlib" dlversion="1.2.12" dlname="z">
+<package name="zlib" version="1.2.13">
+ <library name="zlib" dlversion="1.2.13" dlname="z">
<property name="description"> zip compression library </property>
<property name="include-target-dir" value="$(@PACKAGE/install-includedir)" />
diff --git a/zlib/trees.c b/zlib/trees.c
index f73fd99c37b..5f305c47221 100644
--- a/zlib/trees.c
+++ b/zlib/trees.c
@@ -193,7 +193,7 @@ local void send_bits(s, value, length)
s->bits_sent += (ulg)length;
/* If not enough room in bi_buf, use (valid) bits from bi_buf and
- * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
+ * (16 - bi_valid) bits from value, leaving (width - (16 - bi_valid))
* unused bits in value.
*/
if (s->bi_valid > (int)Buf_size - length) {
@@ -256,7 +256,7 @@ local void tr_static_init()
length = 0;
for (code = 0; code < LENGTH_CODES-1; code++) {
base_length[code] = length;
- for (n = 0; n < (1<<extra_lbits[code]); n++) {
+ for (n = 0; n < (1 << extra_lbits[code]); n++) {
_length_code[length++] = (uch)code;
}
}
@@ -265,13 +265,13 @@ local void tr_static_init()
* in two different ways: code 284 + 5 bits or code 285, so we
* overwrite length_code[255] to use the best encoding:
*/
- _length_code[length-1] = (uch)code;
+ _length_code[length - 1] = (uch)code;
/* Initialize the mapping dist (0..32K) -> dist code (0..29) */
dist = 0;
for (code = 0 ; code < 16; code++) {
base_dist[code] = dist;
- for (n = 0; n < (1<<extra_dbits[code]); n++) {
+ for (n = 0; n < (1 << extra_dbits[code]); n++) {
_dist_code[dist++] = (uch)code;
}
}
@@ -279,11 +279,11 @@ local void tr_static_init()
dist >>= 7; /* from now on, all distances are divided by 128 */
for ( ; code < D_CODES; code++) {
base_dist[code] = dist << 7;
- for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
+ for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
_dist_code[256 + dist++] = (uch)code;
}
}
- Assert (dist == 256, "tr_static_init: 256+dist != 512");
+ Assert (dist == 256, "tr_static_init: 256 + dist != 512");
/* Construct the codes of the static literal tree */
for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
@@ -312,7 +312,7 @@ local void tr_static_init()
}
/* ===========================================================================
- * Genererate the file trees.h describing the static trees.
+ * Generate the file trees.h describing the static trees.
*/
#ifdef GEN_TREES_H
# ifndef ZLIB_DEBUG
@@ -321,7 +321,7 @@ local void tr_static_init()
# define SEPARATOR(i, last, width) \
((i) == (last)? "\n};\n\n" : \
- ((i) % (width) == (width)-1 ? ",\n" : ", "))
+ ((i) % (width) == (width) - 1 ? ",\n" : ", "))
void gen_trees_header()
{
@@ -458,7 +458,7 @@ local void pqdownheap(s, tree, k)
while (j <= s->heap_len) {
/* Set j to the smallest of the two sons: */
if (j < s->heap_len &&
- smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
+ smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
j++;
}
/* Exit if v is smaller than both sons */
@@ -507,7 +507,7 @@ local void gen_bitlen(s, desc)
*/
tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
- for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
+ for (h = s->heap_max + 1; h < HEAP_SIZE; h++) {
n = s->heap[h];
bits = tree[tree[n].Dad].Len + 1;
if (bits > max_length) bits = max_length, overflow++;
@@ -518,7 +518,7 @@ local void gen_bitlen(s, desc)
s->bl_count[bits]++;
xbits = 0;
- if (n >= base) xbits = extra[n-base];
+ if (n >= base) xbits = extra[n - base];
f = tree[n].Freq;
s->opt_len += (ulg)f * (unsigned)(bits + xbits);
if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits);
@@ -530,10 +530,10 @@ local void gen_bitlen(s, desc)
/* Find the first bit length which could increase: */
do {
- bits = max_length-1;
+ bits = max_length - 1;
while (s->bl_count[bits] == 0) bits--;
- s->bl_count[bits]--; /* move one leaf down the tree */
- s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
+ s->bl_count[bits]--; /* move one leaf down the tree */
+ s->bl_count[bits + 1] += 2; /* move one overflow item as its brother */
s->bl_count[max_length]--;
/* The brother of the overflow item also moves one step up,
* but this does not affect bl_count[max_length]
@@ -569,7 +569,7 @@ local void gen_bitlen(s, desc)
* OUT assertion: the field code is set for all tree elements of non
* zero code length.
*/
-local void gen_codes (tree, max_code, bl_count)
+local void gen_codes(tree, max_code, bl_count)
ct_data *tree; /* the tree to decorate */
int max_code; /* largest code with non zero frequency */
ushf *bl_count; /* number of codes at each bit length */
@@ -583,13 +583,13 @@ local void gen_codes (tree, max_code, bl_count)
* without bit reversal.
*/
for (bits = 1; bits <= MAX_BITS; bits++) {
- code = (code + bl_count[bits-1]) << 1;
+ code = (code + bl_count[bits - 1]) << 1;
next_code[bits] = (ush)code;
}
/* Check that the bit counts in bl_count are consistent. The last code
* must be all ones.
*/
- Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
+ Assert (code + bl_count[MAX_BITS] - 1 == (1 << MAX_BITS) - 1,
"inconsistent bit counts");
Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
@@ -600,7 +600,7 @@ local void gen_codes (tree, max_code, bl_count)
tree[n].Code = (ush)bi_reverse(next_code[len]++, len);
Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
- n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
+ n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len] - 1));
}
}
@@ -624,7 +624,7 @@ local void build_tree(s, desc)
int node; /* new node being created */
/* Construct the initial heap, with least frequent element in
- * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
+ * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n + 1].
* heap[0] is not used.
*/
s->heap_len = 0, s->heap_max = HEAP_SIZE;
@@ -652,7 +652,7 @@ local void build_tree(s, desc)
}
desc->max_code = max_code;
- /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
+ /* The elements heap[heap_len/2 + 1 .. heap_len] are leaves of the tree,
* establish sub-heaps of increasing lengths:
*/
for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
@@ -700,7 +700,7 @@ local void build_tree(s, desc)
* Scan a literal or distance tree to determine the frequencies of the codes
* in the bit length tree.
*/
-local void scan_tree (s, tree, max_code)
+local void scan_tree(s, tree, max_code)
deflate_state *s;
ct_data *tree; /* the tree to be scanned */
int max_code; /* and its largest code of non zero frequency */
@@ -714,10 +714,10 @@ local void scan_tree (s, tree, max_code)
int min_count = 4; /* min repeat count */
if (nextlen == 0) max_count = 138, min_count = 3;
- tree[max_code+1].Len = (ush)0xffff; /* guard */
+ tree[max_code + 1].Len = (ush)0xffff; /* guard */
for (n = 0; n <= max_code; n++) {
- curlen = nextlen; nextlen = tree[n+1].Len;
+ curlen = nextlen; nextlen = tree[n + 1].Len;
if (++count < max_count && curlen == nextlen) {
continue;
} else if (count < min_count) {
@@ -745,7 +745,7 @@ local void scan_tree (s, tree, max_code)
* Send a literal or distance tree in compressed form, using the codes in
* bl_tree.
*/
-local void send_tree (s, tree, max_code)
+local void send_tree(s, tree, max_code)
deflate_state *s;
ct_data *tree; /* the tree to be scanned */
int max_code; /* and its largest code of non zero frequency */
@@ -758,11 +758,11 @@ local void send_tree (s, tree, max_code)
int max_count = 7; /* max repeat count */
int min_count = 4; /* min repeat count */
- /* tree[max_code+1].Len = -1; */ /* guard already set */
+ /* tree[max_code + 1].Len = -1; */ /* guard already set */
if (nextlen == 0) max_count = 138, min_count = 3;
for (n = 0; n <= max_code; n++) {
- curlen = nextlen; nextlen = tree[n+1].Len;
+ curlen = nextlen; nextlen = tree[n + 1].Len;
if (++count < max_count && curlen == nextlen) {
continue;
} else if (count < min_count) {
@@ -773,13 +773,13 @@ local void send_tree (s, tree, max_code)
send_code(s, curlen, s->bl_tree); count--;
}
Assert(count >= 3 && count <= 6, " 3_6?");
- send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
+ send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
} else if (count <= 10) {
- send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
+ send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
} else {
- send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
+ send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
}
count = 0; prevlen = curlen;
if (nextlen == 0) {
@@ -807,8 +807,8 @@ local int build_bl_tree(s)
/* Build the bit length tree: */
build_tree(s, (tree_desc *)(&(s->bl_desc)));
- /* opt_len now includes the length of the tree representations, except
- * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
+ /* opt_len now includes the length of the tree representations, except the
+ * lengths of the bit lengths codes and the 5 + 5 + 4 bits for the counts.
*/
/* Determine the number of bit length codes to send. The pkzip format
@@ -819,7 +819,7 @@ local int build_bl_tree(s)
if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
}
/* Update opt_len to include the bit length tree and counts */
- s->opt_len += 3*((ulg)max_blindex+1) + 5+5+4;
+ s->opt_len += 3*((ulg)max_blindex + 1) + 5 + 5 + 4;
Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
s->opt_len, s->static_len));
@@ -841,19 +841,19 @@ local void send_all_trees(s, lcodes, dcodes, blcodes)
Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
"too many codes");
Tracev((stderr, "\nbl counts: "));
- send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
- send_bits(s, dcodes-1, 5);
- send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */
+ send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */
+ send_bits(s, dcodes - 1, 5);
+ send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */
for (rank = 0; rank < blcodes; rank++) {
Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
}
Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
- send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
+ send_tree(s, (ct_data *)s->dyn_ltree, lcodes - 1); /* literal tree */
Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
- send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
+ send_tree(s, (ct_data *)s->dyn_dtree, dcodes - 1); /* distance tree */
Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
}
@@ -866,7 +866,7 @@ void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
ulg stored_len; /* length of input block */
int last; /* one if this is the last block for a file */
{
- send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */
+ send_bits(s, (STORED_BLOCK<<1) + last, 3); /* send block type */
bi_windup(s); /* align on byte boundary */
put_short(s, (ush)stored_len);
put_short(s, (ush)~stored_len);
@@ -877,7 +877,7 @@ void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
s->compressed_len += (stored_len + 4) << 3;
s->bits_sent += 2*16;
- s->bits_sent += stored_len<<3;
+ s->bits_sent += stored_len << 3;
#endif
}
@@ -943,14 +943,17 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
max_blindex = build_bl_tree(s);
/* Determine the best encoding. Compute the block lengths in bytes. */
- opt_lenb = (s->opt_len+3+7)>>3;
- static_lenb = (s->static_len+3+7)>>3;
+ opt_lenb = (s->opt_len + 3 + 7) >> 3;
+ static_lenb = (s->static_len + 3 + 7) >> 3;
Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
s->sym_next / 3));
- if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
+#ifndef FORCE_STATIC
+ if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
+#endif
+ opt_lenb = static_lenb;
} else {
Assert(buf != (char*)0, "lost buf");
@@ -960,7 +963,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
#ifdef FORCE_STORED
if (buf != (char*)0) { /* force stored block */
#else
- if (stored_len+4 <= opt_lenb && buf != (char*)0) {
+ if (stored_len + 4 <= opt_lenb && buf != (char*)0) {
/* 4: two words for the lengths */
#endif
/* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
@@ -971,21 +974,17 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
*/
_tr_stored_block(s, buf, stored_len, last);
-#ifdef FORCE_STATIC
- } else if (static_lenb >= 0) { /* force static trees */
-#else
- } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
-#endif
- send_bits(s, (STATIC_TREES<<1)+last, 3);
+ } else if (static_lenb == opt_lenb) {
+ send_bits(s, (STATIC_TREES<<1) + last, 3);
compress_block(s, (const ct_data *)static_ltree,
(const ct_data *)static_dtree);
#ifdef ZLIB_DEBUG
s->compressed_len += 3 + s->static_len;
#endif
} else {
- send_bits(s, (DYN_TREES<<1)+last, 3);
- send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
- max_blindex+1);
+ send_bits(s, (DYN_TREES<<1) + last, 3);
+ send_all_trees(s, s->l_desc.max_code + 1, s->d_desc.max_code + 1,
+ max_blindex + 1);
compress_block(s, (const ct_data *)s->dyn_ltree,
(const ct_data *)s->dyn_dtree);
#ifdef ZLIB_DEBUG
@@ -1004,22 +1003,22 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
s->compressed_len += 7; /* align on byte boundary */
#endif
}
- Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
- s->compressed_len-7*last));
+ Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len >> 3,
+ s->compressed_len - 7*last));
}
/* ===========================================================================
* Save the match info and tally the frequency counts. Return true if
* the current block must be flushed.
*/
-int ZLIB_INTERNAL _tr_tally (s, dist, lc)
+int ZLIB_INTERNAL _tr_tally(s, dist, lc)
deflate_state *s;
unsigned dist; /* distance of matched string */
- unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
+ unsigned lc; /* match length - MIN_MATCH or unmatched char (dist==0) */
{
- s->sym_buf[s->sym_next++] = dist;
- s->sym_buf[s->sym_next++] = dist >> 8;
- s->sym_buf[s->sym_next++] = lc;
+ s->sym_buf[s->sym_next++] = (uch)dist;
+ s->sym_buf[s->sym_next++] = (uch)(dist >> 8);
+ s->sym_buf[s->sym_next++] = (uch)lc;
if (dist == 0) {
/* lc is the unmatched char */
s->dyn_ltree[lc].Freq++;
@@ -1031,7 +1030,7 @@ int ZLIB_INTERNAL _tr_tally (s, dist, lc)
(ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
(ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
- s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
+ s->dyn_ltree[_length_code[lc] + LITERALS + 1].Freq++;
s->dyn_dtree[d_code(dist)].Freq++;
}
return (s->sym_next == s->sym_end);
@@ -1061,7 +1060,7 @@ local void compress_block(s, ltree, dtree)
} else {
/* Here, lc is the match length - MIN_MATCH */
code = _length_code[lc];
- send_code(s, code+LITERALS+1, ltree); /* send the length code */
+ send_code(s, code + LITERALS + 1, ltree); /* send length code */
extra = extra_lbits[code];
if (extra != 0) {
lc -= base_length[code];
@@ -1177,6 +1176,6 @@ local void bi_windup(s)
s->bi_buf = 0;
s->bi_valid = 0;
#ifdef ZLIB_DEBUG
- s->bits_sent = (s->bits_sent+7) & ~7;
+ s->bits_sent = (s->bits_sent + 7) & ~7;
#endif
}
diff --git a/zlib/uncompr.c b/zlib/uncompr.c
index f03a1a865e3..f9532f46c1a 100644
--- a/zlib/uncompr.c
+++ b/zlib/uncompr.c
@@ -24,7 +24,7 @@
Z_DATA_ERROR if the input data was corrupted, including if the input data is
an incomplete zlib stream.
*/
-int ZEXPORT uncompress2 (dest, destLen, source, sourceLen)
+int ZEXPORT uncompress2(dest, destLen, source, sourceLen)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
@@ -83,7 +83,7 @@ int ZEXPORT uncompress2 (dest, destLen, source, sourceLen)
err;
}
-int ZEXPORT uncompress (dest, destLen, source, sourceLen)
+int ZEXPORT uncompress(dest, destLen, source, sourceLen)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
diff --git a/zlib/win32/README-WIN32.txt b/zlib/win32/README-WIN32.txt
index 536cfec6f67..050197d80f7 100644
--- a/zlib/win32/README-WIN32.txt
+++ b/zlib/win32/README-WIN32.txt
@@ -1,6 +1,6 @@
ZLIB DATA COMPRESSION LIBRARY
-zlib 1.2.12 is a general purpose data compression library. All the code is
+zlib 1.2.13 is a general purpose data compression library. All the code is
thread safe. The data format used by the zlib library is described by RFCs
(Request for Comments) 1950 to 1952 in the files
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
@@ -22,7 +22,7 @@ before asking for help.
Manifest:
-The package zlib-1.2.12-win32-x86.zip will contain the following files:
+The package zlib-1.2.13-win32-x86.zip will contain the following files:
README-WIN32.txt This document
ChangeLog Changes since previous zlib packages
diff --git a/zlib/win32/zlib1.rc b/zlib/win32/zlib1.rc
index 234e641c329..ceb4ee5c69e 100644
--- a/zlib/win32/zlib1.rc
+++ b/zlib/win32/zlib1.rc
@@ -26,7 +26,7 @@ BEGIN
VALUE "FileDescription", "zlib data compression library\0"
VALUE "FileVersion", ZLIB_VERSION "\0"
VALUE "InternalName", "zlib1.dll\0"
- VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
+ VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0"
VALUE "OriginalFilename", "zlib1.dll\0"
VALUE "ProductName", "zlib\0"
VALUE "ProductVersion", ZLIB_VERSION "\0"
diff --git a/zlib/zconf.h.cmakein b/zlib/zconf.h.cmakein
index a7f24cce60f..247ba2461dd 100644
--- a/zlib/zconf.h.cmakein
+++ b/zlib/zconf.h.cmakein
@@ -40,6 +40,9 @@
# define crc32 z_crc32
# define crc32_combine z_crc32_combine
# define crc32_combine64 z_crc32_combine64
+# define crc32_combine_gen z_crc32_combine_gen
+# define crc32_combine_gen64 z_crc32_combine_gen64
+# define crc32_combine_op z_crc32_combine_op
# define crc32_z z_crc32_z
# define deflate z_deflate
# define deflateBound z_deflateBound
@@ -351,6 +354,9 @@
# ifdef FAR
# undef FAR
# endif
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
# include <windows.h>
/* No need for _export, use ZLIB.DEF instead. */
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
@@ -469,11 +475,18 @@ typedef uLong FAR uLongf;
# undef _LARGEFILE64_SOURCE
#endif
-#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
-# define Z_HAVE_UNISTD_H
+#ifndef Z_HAVE_UNISTD_H
+# ifdef __WATCOMC__
+# define Z_HAVE_UNISTD_H
+# endif
+#endif
+#ifndef Z_HAVE_UNISTD_H
+# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
+# define Z_HAVE_UNISTD_H
+# endif
#endif
#ifndef Z_SOLO
-# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+# if defined(Z_HAVE_UNISTD_H)
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
# ifdef VMS
# include <unixio.h> /* for off_t */
diff --git a/zlib/zconf.h.in b/zlib/zconf.h.in
index 5e1d68a004e..bf977d3e70a 100644
--- a/zlib/zconf.h.in
+++ b/zlib/zconf.h.in
@@ -38,6 +38,9 @@
# define crc32 z_crc32
# define crc32_combine z_crc32_combine
# define crc32_combine64 z_crc32_combine64
+# define crc32_combine_gen z_crc32_combine_gen
+# define crc32_combine_gen64 z_crc32_combine_gen64
+# define crc32_combine_op z_crc32_combine_op
# define crc32_z z_crc32_z
# define deflate z_deflate
# define deflateBound z_deflateBound
@@ -349,6 +352,9 @@
# ifdef FAR
# undef FAR
# endif
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
# include <windows.h>
/* No need for _export, use ZLIB.DEF instead. */
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
@@ -467,11 +473,18 @@ typedef uLong FAR uLongf;
# undef _LARGEFILE64_SOURCE
#endif
-#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
-# define Z_HAVE_UNISTD_H
+#ifndef Z_HAVE_UNISTD_H
+# ifdef __WATCOMC__
+# define Z_HAVE_UNISTD_H
+# endif
+#endif
+#ifndef Z_HAVE_UNISTD_H
+# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
+# define Z_HAVE_UNISTD_H
+# endif
#endif
#ifndef Z_SOLO
-# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+# if defined(Z_HAVE_UNISTD_H)
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
# ifdef VMS
# include <unixio.h> /* for off_t */
diff --git a/zlib/zlib.3 b/zlib/zlib.3
index bcaebd9f02c..6f6e91404df 100644
--- a/zlib/zlib.3
+++ b/zlib/zlib.3
@@ -1,4 +1,4 @@
-.TH ZLIB 3 "27 Mar 2022"
+.TH ZLIB 3 "13 Oct 2022"
.SH NAME
zlib \- compression/decompression library
.SH SYNOPSIS
@@ -105,7 +105,7 @@ before asking for help.
Send questions and/or comments to zlib@gzip.org,
or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
.SH AUTHORS AND LICENSE
-Version 1.2.12
+Version 1.2.13
.LP
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
.LP
diff --git a/zlib/zlib.h b/zlib/zlib.h
index a55e85d89cb..429dfbb7659 100644
--- a/zlib/zlib.h
+++ b/zlib/zlib.h
@@ -1,5 +1,5 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.2.12, March 11th, 2022
+ version 1.2.13, October 13th, 2022
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
@@ -37,11 +37,11 @@
extern "C" {
#endif
-#define ZLIB_VERSION "1.2.12"
-#define ZLIB_VERNUM 0x12c0
+#define ZLIB_VERSION "1.2.13"
+#define ZLIB_VERNUM 0x12d0
#define ZLIB_VER_MAJOR 1
#define ZLIB_VER_MINOR 2
-#define ZLIB_VER_REVISION 12
+#define ZLIB_VER_REVISION 13
#define ZLIB_VER_SUBREVISION 0
/*
@@ -276,7 +276,7 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
== 0), or after each call of deflate(). If deflate returns Z_OK and with
zero avail_out, it must be called again after making room in the output
buffer because there might be more output pending. See deflatePending(),
- which can be used if desired to determine whether or not there is more ouput
+ which can be used if desired to determine whether or not there is more output
in that case.
Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
@@ -660,7 +660,7 @@ ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm,
to dictionary. dictionary must have enough space, where 32768 bytes is
always enough. If deflateGetDictionary() is called with dictionary equal to
Z_NULL, then only the dictionary length is returned, and nothing is copied.
- Similary, if dictLength is Z_NULL, then it is not set.
+ Similarly, if dictLength is Z_NULL, then it is not set.
deflateGetDictionary() may return a length less than the window size, even
when more than the window size in input has been provided. It may return up
@@ -915,7 +915,7 @@ ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,
to dictionary. dictionary must have enough space, where 32768 bytes is
always enough. If inflateGetDictionary() is called with dictionary equal to
Z_NULL, then only the dictionary length is returned, and nothing is copied.
- Similary, if dictLength is Z_NULL, then it is not set.
+ Similarly, if dictLength is Z_NULL, then it is not set.
inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
stream state is inconsistent.
@@ -1437,7 +1437,7 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
In the event that the end of file is reached and only a partial item is
available at the end, i.e. the remaining uncompressed data length is not a
- multiple of size, then the final partial item is nevetheless read into buf
+ multiple of size, then the final partial item is nevertheless read into buf
and the end-of-file flag is set. The length of the partial item read is not
provided, but could be inferred from the result of gztell(). This behavior
is the same as the behavior of fread() implementations in common libraries,
@@ -1913,7 +1913,7 @@ ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int));
-ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
+ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF((z_streamp));
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
#if defined(_WIN32) && !defined(Z_SOLO)
diff --git a/zlib/zlib2ansi b/zlib/zlib2ansi
index 15e3e165f37..23b2a1d5a3e 100755
--- a/zlib/zlib2ansi
+++ b/zlib/zlib2ansi
@@ -8,7 +8,7 @@
# TODO
#
-# Asumes no function pointer parameters. unless they are typedefed.
+# Assumes no function pointer parameters. unless they are typedefed.
# Assumes no literal strings that look like function definitions
# Assumes functions start at the beginning of a line
@@ -104,7 +104,7 @@ sub StripComments
no warnings;
- # Strip C & C++ coments
+ # Strip C & C++ comments
# From the perlfaq
$_[0] =~
diff --git a/zlib/zutil.c b/zlib/zutil.c
index dcab28a0d51..9543ae825e3 100644
--- a/zlib/zutil.c
+++ b/zlib/zutil.c
@@ -61,9 +61,11 @@ uLong ZEXPORT zlibCompileFlags()
#ifdef ZLIB_DEBUG
flags += 1 << 8;
#endif
+ /*
#if defined(ASMV) || defined(ASMINF)
flags += 1 << 9;
#endif
+ */
#ifdef ZLIB_WINAPI
flags += 1 << 10;
#endif
@@ -119,7 +121,7 @@ uLong ZEXPORT zlibCompileFlags()
# endif
int ZLIB_INTERNAL z_verbose = verbose;
-void ZLIB_INTERNAL z_error (m)
+void ZLIB_INTERNAL z_error(m)
char *m;
{
fprintf(stderr, "%s\n", m);
@@ -214,7 +216,7 @@ local ptr_table table[MAX_PTR];
* a protected system like OS/2. Use Microsoft C instead.
*/
-voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
+voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size)
{
voidpf buf;
ulg bsize = (ulg)items*size;
@@ -240,7 +242,7 @@ voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
return buf;
}
-void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
+void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
{
int n;
@@ -277,13 +279,13 @@ void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
# define _hfree hfree
#endif
-voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
+voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size)
{
(void)opaque;
return _halloc((long)items, size);
}
-void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
+void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
{
(void)opaque;
_hfree(ptr);
@@ -302,7 +304,7 @@ extern voidp calloc OF((uInt items, uInt size));
extern void free OF((voidpf ptr));
#endif
-voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
+voidpf ZLIB_INTERNAL zcalloc(opaque, items, size)
voidpf opaque;
unsigned items;
unsigned size;
@@ -312,7 +314,7 @@ voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
(voidpf)calloc(items, size);
}
-void ZLIB_INTERNAL zcfree (opaque, ptr)
+void ZLIB_INTERNAL zcfree(opaque, ptr)
voidpf opaque;
voidpf ptr;
{
diff --git a/zlib/zutil.h b/zlib/zutil.h
index d9a20ae1bf4..0bc7f4ecd1c 100644
--- a/zlib/zutil.h
+++ b/zlib/zutil.h
@@ -193,6 +193,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
(!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
#endif
/* common defaults */