summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore11
-rwxr-xr-xBUILD/SETUP.sh7
-rwxr-xr-xBUILD/compile-amd64-debug-max4
-rwxr-xr-xBUILD/compile-amd64-debug-max-no-ndb4
-rwxr-xr-xBUILD/compile-amd64-max2
-rwxr-xr-xBUILD/compile-darwin-mwcc6
-rwxr-xr-xBUILD/compile-pentium-debug6
-rwxr-xr-xBUILD/compile-pentium-debug-max4
-rwxr-xr-xBUILD/compile-pentium-debug-max-no-embedded4
-rwxr-xr-xBUILD/compile-pentium-debug-max-no-ndb4
-rwxr-xr-xBUILD/compile-pentium-debug-openssl2
-rwxr-xr-xBUILD/compile-pentium-debug-yassl2
-rwxr-xr-xBUILD/compile-pentium-icc-valgrind-max2
-rwxr-xr-xBUILD/compile-pentium-max2
-rwxr-xr-xBUILD/compile-pentium-mysqlfs-debug2
-rwxr-xr-xBUILD/compile-pentium-valgrind-max9
-rwxr-xr-xBUILD/compile-pentium64-debug2
-rwxr-xr-xBUILD/compile-pentium64-debug-max4
-rwxr-xr-xBUILD/compile-pentium64-valgrind-max9
-rwxr-xr-xBUILD/compile-ppc-debug2
-rwxr-xr-xBUILD/compile-ppc-debug-max4
-rwxr-xr-xBUILD/compile-ppc-debug-max-no-ndb4
-rwxr-xr-xBUILD/compile-ppc-max2
-rw-r--r--Docs/Makefile.am7
-rw-r--r--Docs/MySQLEULA.txt2
-rw-r--r--Makefile.am14
-rw-r--r--README2
-rw-r--r--VC++Files/libmysqld/libmysqld.vcproj1
-rw-r--r--VC++Files/mysqldemb/mysqldemb.vcproj1
-rw-r--r--VC++Files/mysys/mysys.vcproj1
-rw-r--r--VC++Files/sql/mysqld.vcproj7
-rw-r--r--VC++Files/storage/bdb/bdb.vcproj1
-rw-r--r--VC++Files/storage/innobase/innobase.vcproj2
-rw-r--r--client/Makefile.am1
-rw-r--r--client/mysql.cc11
-rw-r--r--client/mysqlslap.c11
-rw-r--r--client/mysqltest.c12
-rw-r--r--cmakelists.txt136
-rw-r--r--config/ac-macros/openssl.m46
-rw-r--r--config/ac-macros/yassl.m44
-rw-r--r--config/ac-macros/zlib.m49
-rw-r--r--configure.in30
-rw-r--r--dbug/Makefile.am2
-rw-r--r--extra/Makefile.am1
-rw-r--r--extra/comp_err.c3
-rw-r--r--extra/yassl/Makefile.am3
-rw-r--r--extra/yassl/taocrypt/Makefile.am2
-rw-r--r--include/my_dbug.h1
-rw-r--r--include/my_pthread.h7
-rw-r--r--include/mysql.h2
-rw-r--r--libmysql/Makefile.am4
-rw-r--r--libmysql/Makefile.shared5
-rw-r--r--libmysql/cmakelists.txt9
-rw-r--r--libmysql/mytest.c175
-rw-r--r--libmysql_r/Makefile.am2
-rw-r--r--libmysqld/Makefile.am7
-rw-r--r--libmysqld/cmakelists.txt86
-rw-r--r--libmysqld/examples/cmakelists.txt11
-rw-r--r--libmysqld/lib_sql.cc2
-rw-r--r--libmysqld/libmysqld.def1
-rw-r--r--mysql-test/Makefile.am8
-rw-r--r--mysql-test/extra/rpl_tests/rpl_partition.test262
-rw-r--r--mysql-test/lib/init_db.sql2
-rw-r--r--mysql-test/lib/mtr_stress.pl1
-rwxr-xr-xmysql-test/mysql-test-run.pl63
-rw-r--r--mysql-test/mysql-test-run.sh2
-rw-r--r--mysql-test/r/cast.result11
-rw-r--r--mysql-test/r/create.result2
-rw-r--r--mysql-test/r/csv.result93
-rw-r--r--mysql-test/r/ctype_latin1.result22
-rw-r--r--mysql-test/r/ctype_utf8.result46
-rw-r--r--mysql-test/r/events.result44
-rw-r--r--mysql-test/r/events_bugs.result74
-rw-r--r--mysql-test/r/func_gconcat.result15
-rw-r--r--mysql-test/r/group_min_max.result46
-rw-r--r--mysql-test/r/having.result2
-rw-r--r--mysql-test/r/information_schema.result48
-rw-r--r--mysql-test/r/join_nested.result58
-rw-r--r--mysql-test/r/join_outer.result19
-rw-r--r--mysql-test/r/lock_multi.result7
-rw-r--r--mysql-test/r/ndb_condition_pushdown.result20
-rw-r--r--mysql-test/r/ndb_insert.result44
-rw-r--r--mysql-test/r/ndb_partition_key.result18
-rw-r--r--mysql-test/r/ndb_read_multi_range.result104
-rw-r--r--mysql-test/r/ndb_replace.result12
-rw-r--r--mysql-test/r/partition.result123
-rw-r--r--mysql-test/r/partition_pruning.result52
-rw-r--r--mysql-test/r/ps.result46
-rw-r--r--mysql-test/r/rpl_ndb_insert_ignore.result8
-rw-r--r--mysql-test/r/rpl_ndb_sp007.result50
-rw-r--r--mysql-test/r/rpl_row_basic_8partition.result652
-rw-r--r--mysql-test/r/select.result19
-rw-r--r--mysql-test/r/sp-error.result12
-rw-r--r--mysql-test/r/sp-prelocking.result23
-rw-r--r--mysql-test/r/sp.result35
-rw-r--r--mysql-test/r/subselect.result2
-rw-r--r--mysql-test/r/system_mysql_db.result2
-rw-r--r--mysql-test/r/trigger-trans.result84
-rw-r--r--mysql-test/r/trigger.result55
-rw-r--r--mysql-test/r/varbinary.result2
-rw-r--r--mysql-test/r/view.result26
-rw-r--r--mysql-test/t/cast.test9
-rw-r--r--mysql-test/t/create.test6
-rw-r--r--mysql-test/t/csv.test93
-rw-r--r--mysql-test/t/ctype_latin1.test14
-rw-r--r--mysql-test/t/ctype_utf8.test34
-rw-r--r--mysql-test/t/disabled.def15
-rw-r--r--mysql-test/t/events.test33
-rw-r--r--mysql-test/t/events_bugs.test52
-rw-r--r--mysql-test/t/func_gconcat.test8
-rw-r--r--mysql-test/t/group_min_max.test46
-rw-r--r--mysql-test/t/information_schema.test3
-rw-r--r--mysql-test/t/join_nested.test52
-rw-r--r--mysql-test/t/join_outer.test20
-rw-r--r--mysql-test/t/lock_multi.test19
-rw-r--r--mysql-test/t/ndb_condition_pushdown.test14
-rw-r--r--mysql-test/t/ndb_insert.test31
-rw-r--r--mysql-test/t/ndb_partition_key.test25
-rw-r--r--mysql-test/t/ndb_read_multi_range.test38
-rw-r--r--mysql-test/t/ndb_replace.test11
-rw-r--r--mysql-test/t/partition.test107
-rw-r--r--mysql-test/t/partition_mgm_err2.test1
-rw-r--r--mysql-test/t/partition_pruning.test46
-rw-r--r--mysql-test/t/ps.test34
-rw-r--r--mysql-test/t/rpl_ndb_sp007.test9
-rw-r--r--mysql-test/t/rpl_row_basic_8partition.test204
-rw-r--r--mysql-test/t/select.test23
-rw-r--r--mysql-test/t/sp-error.test19
-rw-r--r--mysql-test/t/sp-prelocking.test34
-rw-r--r--mysql-test/t/sp.test36
-rw-r--r--mysql-test/t/trigger-trans.test52
-rw-r--r--mysql-test/t/trigger.test57
-rw-r--r--mysql-test/t/view.test35
-rw-r--r--mysql-test/valgrind.supp9
-rw-r--r--mysys/Makefile.am4
-rw-r--r--mysys/cmakelists.txt12
-rw-r--r--mysys/mf_keycache.c2
-rw-r--r--mysys/my_init.c6
-rwxr-xr-xnetware/BUILD/compile-netware-START2
-rw-r--r--netware/mysql_install_db.c2
-rw-r--r--regex/Makefile.am2
-rw-r--r--scripts/mysql_config.sh36
-rw-r--r--scripts/mysql_create_system_tables.sh2
-rw-r--r--scripts/mysql_fix_privilege_tables.sql1
-rw-r--r--scripts/mysql_install_db.sh3
-rw-r--r--server-tools/instance-manager/Makefile.am2
-rw-r--r--sql-common/client.c6
-rw-r--r--sql/Makefile.am3
-rw-r--r--sql/authors.h2
-rw-r--r--sql/cmakelists.txt148
-rw-r--r--sql/event.cc21
-rw-r--r--sql/field.cc24
-rw-r--r--sql/field.h15
-rw-r--r--sql/ha_archive.cc11
-rw-r--r--sql/ha_berkeley.cc3
-rw-r--r--sql/ha_blackhole.cc5
-rw-r--r--sql/ha_federated.cc3
-rw-r--r--sql/ha_heap.cc6
-rw-r--r--sql/ha_innodb.cc3
-rw-r--r--sql/ha_myisam.cc3
-rw-r--r--sql/ha_myisammrg.cc3
-rw-r--r--sql/ha_ndbcluster.cc242
-rw-r--r--sql/ha_ndbcluster.h11
-rw-r--r--sql/ha_ndbcluster_binlog.cc227
-rw-r--r--sql/ha_partition.cc19
-rw-r--r--sql/ha_partition.h3
-rw-r--r--sql/handler.cc32
-rw-r--r--sql/handler.h3
-rw-r--r--sql/item.cc51
-rw-r--r--sql/item.h2
-rw-r--r--sql/item_cmpfunc.cc48
-rw-r--r--sql/item_cmpfunc.h1
-rw-r--r--sql/item_func.cc7
-rw-r--r--sql/item_strfunc.cc2
-rw-r--r--sql/item_sum.cc7
-rw-r--r--sql/item_sum.h7
-rw-r--r--sql/item_timefunc.cc1
-rw-r--r--sql/item_xmlfunc.cc3
-rw-r--r--sql/key.cc1
-rw-r--r--sql/lock.cc2
-rw-r--r--sql/log.cc16
-rw-r--r--sql/log.h4
-rw-r--r--sql/log_event.cc32
-rw-r--r--sql/message.mc8
-rw-r--r--sql/mysql_priv.h3
-rw-r--r--sql/mysqld.cc5
-rw-r--r--sql/opt_range.cc32
-rw-r--r--sql/opt_sum.cc8
-rw-r--r--sql/parse_file.cc6
-rw-r--r--sql/parse_file.h3
-rw-r--r--sql/partition_info.cc361
-rw-r--r--sql/partition_info.h6
-rw-r--r--sql/password.c6
-rw-r--r--sql/set_var.cc2
-rw-r--r--sql/share/charsets/Index.xml5
-rw-r--r--sql/share/charsets/latin1.xml16
-rw-r--r--sql/slave.cc3
-rw-r--r--sql/sp.cc7
-rw-r--r--sql/sp_cache.cc1
-rw-r--r--sql/sp_head.cc9
-rw-r--r--sql/sql_acl.cc5
-rw-r--r--sql/sql_analyse.cc35
-rw-r--r--sql/sql_base.cc62
-rw-r--r--sql/sql_class.h6
-rw-r--r--sql/sql_delete.cc3
-rw-r--r--sql/sql_insert.cc54
-rw-r--r--sql/sql_load.cc5
-rw-r--r--sql/sql_parse.cc33
-rw-r--r--sql/sql_partition.cc468
-rw-r--r--sql/sql_partition.h2
-rw-r--r--sql/sql_plugin.cc3
-rw-r--r--sql/sql_prepare.cc12
-rw-r--r--sql/sql_select.cc100
-rw-r--r--sql/sql_show.cc16
-rw-r--r--sql/sql_table.cc92
-rw-r--r--sql/sql_trigger.cc72
-rw-r--r--sql/sql_update.cc5
-rw-r--r--sql/sql_view.cc1
-rw-r--r--sql/sql_yacc.yy3
-rw-r--r--sql/table.cc18
-rw-r--r--sql/tztime.cc7
-rw-r--r--sql/udf_example.cc2
-rw-r--r--storage/archive/Makefile.am1
-rw-r--r--storage/archive/cmakelists.txt6
-rw-r--r--storage/bdb/Makefile.in4
-rw-r--r--storage/bdb/cmakelists.txt73
-rw-r--r--storage/csv/cmakelists.txt5
-rw-r--r--storage/csv/ha_tina.cc390
-rw-r--r--storage/csv/ha_tina.h18
-rw-r--r--storage/example/Makefile.am7
-rw-r--r--storage/example/cmakelists.txt6
-rw-r--r--storage/example/ha_example.cc3
-rw-r--r--storage/heap/Makefile.am1
-rw-r--r--storage/innobase/Makefile.am3
-rw-r--r--storage/innobase/btr/btr0sea.c19
-rw-r--r--storage/innobase/include/univ.i2
-rw-r--r--storage/myisam/Makefile.am2
-rw-r--r--storage/myisam/mi_key.c2
-rw-r--r--storage/myisam/mi_keycache.c1
-rw-r--r--storage/myisam/mi_search.c11
-rw-r--r--storage/myisammrg/Makefile.am1
-rw-r--r--storage/ndb/include/kernel/signaldata/ArbitSignalData.hpp3
-rw-r--r--storage/ndb/include/kernel/signaldata/DictTabInfo.hpp5
-rw-r--r--storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp4
-rw-r--r--storage/ndb/include/kernel/signaldata/StartPerm.hpp6
-rw-r--r--storage/ndb/include/kernel/signaldata/SumaImpl.hpp2
-rw-r--r--storage/ndb/include/kernel/signaldata/TcContinueB.hpp3
-rw-r--r--storage/ndb/include/mgmapi/ndbd_exit_codes.h2
-rw-r--r--storage/ndb/include/ndbapi/NdbIndexOperation.hpp5
-rw-r--r--storage/ndb/include/ndbapi/NdbIndexStat.hpp1
-rw-r--r--storage/ndb/include/ndbapi/NdbOperation.hpp47
-rw-r--r--storage/ndb/include/ndbapi/NdbScanOperation.hpp3
-rw-r--r--storage/ndb/include/transporter/TransporterDefinitions.hpp1
-rw-r--r--storage/ndb/include/util/InputStream.hpp3
-rw-r--r--storage/ndb/include/util/OutputStream.hpp11
-rw-r--r--storage/ndb/include/util/SimpleProperties.hpp13
-rw-r--r--storage/ndb/include/util/SocketServer.hpp1
-rw-r--r--storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp6
-rw-r--r--storage/ndb/src/kernel/blocks/ERROR_codes.txt6
-rw-r--r--storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp17
-rw-r--r--storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp4
-rw-r--r--storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp244
-rw-r--r--storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp167
-rw-r--r--storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp27
-rw-r--r--storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp415
-rw-r--r--storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp101
-rw-r--r--storage/ndb/src/kernel/blocks/suma/Suma.cpp131
-rw-r--r--storage/ndb/src/kernel/error/ndbd_exit_codes.c3
-rw-r--r--storage/ndb/src/kernel/vm/DLFifoList.hpp15
-rw-r--r--storage/ndb/src/kernel/vm/DLList.hpp10
-rw-r--r--storage/ndb/src/kernel/vm/Pool.hpp19
-rw-r--r--storage/ndb/src/kernel/vm/SLList.hpp10
-rw-r--r--storage/ndb/src/kernel/vm/TransporterCallback.cpp4
-rw-r--r--storage/ndb/src/ndbapi/ClusterMgr.hpp2
-rw-r--r--storage/ndb/src/ndbapi/NdbBlob.cpp3
-rw-r--r--storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp1
-rw-r--r--storage/ndb/src/ndbapi/NdbIndexOperation.cpp8
-rw-r--r--storage/ndb/src/ndbapi/NdbOperation.cpp3
-rw-r--r--storage/ndb/src/ndbapi/NdbScanOperation.cpp8
-rw-r--r--storage/ndb/src/ndbapi/NdbTransaction.cpp8
-rw-r--r--storage/ndb/src/ndbapi/Ndbif.cpp12
-rw-r--r--storage/ndb/src/ndbapi/TransporterFacade.cpp13
-rw-r--r--storage/ndb/src/ndbapi/TransporterFacade.hpp1
-rw-r--r--storage/ndb/src/ndbapi/ndberror.c2
-rw-r--r--storage/ndb/test/include/NDBT_Tables.hpp2
-rw-r--r--storage/ndb/test/include/NdbRestarter.hpp1
-rw-r--r--storage/ndb/test/ndbapi/bank/Bank.cpp2
-rw-r--r--storage/ndb/test/ndbapi/bank/Bank.hpp8
-rw-r--r--storage/ndb/test/ndbapi/bank/BankLoad.cpp43
-rw-r--r--storage/ndb/test/ndbapi/bank/bankCreator.cpp6
-rw-r--r--storage/ndb/test/ndbapi/bank/testBank.cpp8
-rw-r--r--storage/ndb/test/ndbapi/testNodeRestart.cpp143
-rw-r--r--storage/ndb/test/ndbapi/testSRBank.cpp18
-rw-r--r--storage/ndb/test/ndbapi/testSystemRestart.cpp53
-rw-r--r--storage/ndb/test/ndbapi/testTimeout.cpp101
-rw-r--r--storage/ndb/test/ndbapi/test_event.cpp146
-rw-r--r--storage/ndb/test/run-test/ATRT_SETUP_README.txt292
-rw-r--r--storage/ndb/test/run-test/ATRT_USAGE_README.txt224
-rw-r--r--storage/ndb/test/run-test/Makefile.am11
-rw-r--r--storage/ndb/test/run-test/conf-daily-devel-ndbmaster.txt3
-rw-r--r--storage/ndb/test/run-test/conf-dl145a.txt (renamed from storage/ndb/test/run-test/conf-daily-basic-dl145a.txt)3
-rw-r--r--storage/ndb/test/run-test/conf-ndbmaster.txt (renamed from storage/ndb/test/run-test/conf-daily-basic-ndbmaster.txt)3
-rw-r--r--storage/ndb/test/run-test/conf-shark.txt (renamed from storage/ndb/test/run-test/conf-daily-basic-shark.txt)3
-rw-r--r--storage/ndb/test/run-test/daily-basic-tests.txt12
-rw-r--r--storage/ndb/test/run-test/daily-devel-tests.txt5
-rwxr-xr-xstorage/ndb/test/run-test/ndb-autotest.sh7
-rw-r--r--storage/ndb/test/src/NDBT_Tables.cpp3
-rw-r--r--storage/ndb/test/src/NdbBackup.cpp4
-rw-r--r--storage/ndb/test/src/NdbRestarter.cpp33
-rw-r--r--storage/ndb/test/src/NdbRestarts.cpp16
-rw-r--r--storage/ndb/tools/Makefile.am3
-rw-r--r--storage/ndb/tools/desc.cpp77
-rw-r--r--strings/Makefile.am2
-rw-r--r--strings/cmakelists.txt3
-rw-r--r--strings/conf_to_src.c9
-rw-r--r--strings/ctype-extra.c8729
-rw-r--r--support-files/mysql.spec.sh6
-rw-r--r--tests/Makefile.am3
-rw-r--r--vio/Makefile.am1
-rw-r--r--win/Makefile.am21
-rw-r--r--win/README35
-rw-r--r--win/config-handlerton.js171
-rw-r--r--win/config-version.js142
-rw-r--r--win/configure.js94
-rw-r--r--zlib/Makefile.am3
325 files changed, 16779 insertions, 2193 deletions
diff --git a/.bzrignore b/.bzrignore
index 82859703566..4b6b0411a47 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -683,18 +683,24 @@ mysql-test/r/*.out
mysql-test/r/*.reject
mysql-test/r/alter_table.err
mysql-test/r/archive.err
+mysql-test/r/backup.log
mysql-test/r/bdb-alter-table-1.err
mysql-test/r/bdb-alter-table-2.err
mysql-test/r/bdb-crash.err
mysql-test/r/bdb-deadlock.err
mysql-test/r/bdb.err
+mysql-test/r/bdb.log
mysql-test/r/bdb_cache.err
mysql-test/r/client_test.err
mysql-test/r/csv.err
mysql-test/r/ctype_ucs.err
mysql-test/r/derived.err
+mysql-test/r/events.log
+mysql-test/r/events_bugs.log
+mysql-test/r/events_logs_tests.log
mysql-test/r/exampledb.err
mysql-test/r/func_encrypt.err
+mysql-test/r/im_client_port.log
mysql-test/r/index_merge_load.result
mysql-test/r/isam.err
mysql-test/r/lowercase_table2.err
@@ -704,6 +710,7 @@ mysql-test/r/mysqlbinlog.err
mysql-test/r/mysqlbinlog2.err
mysql-test/r/mysqldump.err
mysql-test/r/mysqltest.err
+mysql-test/r/mysqltest.log
mysql-test/r/ndb_alter_table.err
mysql-test/r/ndb_autodiscover.err
mysql-test/r/ndb_autodiscover2.err
@@ -743,6 +750,9 @@ mysql-test/r/rpl000016.eval
mysql-test/r/rpl_log.eval
mysql-test/r/slave-running.eval
mysql-test/r/slave-stopped.eval
+mysql-test/r/symlink.log
+mysql-test/r/system_mysql_db.log
+mysql-test/r/udf.log
mysql-test/share/mysql
mysql-test/std_data/*.pem
mysql-test/t/index_merge.load
@@ -1748,3 +1758,4 @@ vio/viotest-sslconnect.cpp
vio/viotest.cpp
zlib/*.ds?
zlib/*.vcproj
+mysql-test/r/*.log
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index a6e18e26bfc..74f1ba089b9 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -53,14 +53,13 @@ SSL_LIBRARY=--with-yassl
# __attribute()__ doesn't work with gnu C++)
global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings"
-#debug_extra_warnings="-Wuninitialized"
c_warnings="$global_warnings -Wunused"
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
-base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-partition $SSL_LIBRARY"
-base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-partition $SSL_LIBRARY"
-max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-embedded-server --with-big-tables --with-partition $SSL_LIBRARY"
+base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-example-storage-engine --with-partition $SSL_LIBRARY"
+base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-example-storage-engine --with-partition $SSL_LIBRARY"
max_configs="$base_max_configs --with-embedded-server"
max_no_ndb_configs="$base_max_no_ndb_configs --with-embedded-server"
+valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max"
path=`dirname $0`
. "$path/check-cpu"
diff --git a/BUILD/compile-amd64-debug-max b/BUILD/compile-amd64-debug-max
index 530bdba009b..f08e068135a 100755
--- a/BUILD/compile-amd64-debug-max
+++ b/BUILD/compile-amd64-debug-max
@@ -1,9 +1,7 @@
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$amd64_cflags $debug_cflags $max_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_flags="$amd64_cflags $debug_cflags"
extra_configs="$amd64_configs $debug_configs $max_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-amd64-debug-max-no-ndb b/BUILD/compile-amd64-debug-max-no-ndb
index cf901a2d261..8babab44481 100755
--- a/BUILD/compile-amd64-debug-max-no-ndb
+++ b/BUILD/compile-amd64-debug-max-no-ndb
@@ -1,9 +1,7 @@
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$amd64_cflags $debug_cflags $max_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_flags="$amd64_cflags $debug_cflags"
extra_configs="$amd64_configs $debug_configs $max_no_ndb_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-amd64-max b/BUILD/compile-amd64-max
index 228448f6392..30db275c7ae 100755
--- a/BUILD/compile-amd64-max
+++ b/BUILD/compile-amd64-max
@@ -2,7 +2,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$amd64_cflags $fast_cflags $max_cflags -g"
+extra_flags="$amd64_cflags $fast_cflags -g"
extra_configs="$amd64_configs $max_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-darwin-mwcc b/BUILD/compile-darwin-mwcc
index 6fd0eab7e26..9ad8d5d40b5 100755
--- a/BUILD/compile-darwin-mwcc
+++ b/BUILD/compile-darwin-mwcc
@@ -31,14 +31,10 @@ else
;;
debug)
extra_flags="$ppc_cflags $debug_cflags"
- c_warnings="$c_warnings $debug_extra_warnings"
- cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$debug_configs"
;;
debug-max)
- extra_flags="$ppc_cflags $debug_cflags $max_cflags"
- c_warnings="$c_warnings $debug_extra_warnings"
- cxx_warnings="$cxx_warnings $debug_extra_warnings"
+ extra_flags="$ppc_cflags $debug_cflags"
extra_configs="$debug_configs $max_configs"
;;
*)
diff --git a/BUILD/compile-pentium-debug b/BUILD/compile-pentium-debug
index 7957caead29..db2bbea02f4 100755
--- a/BUILD/compile-pentium-debug
+++ b/BUILD/compile-pentium-debug
@@ -4,10 +4,6 @@ path=`dirname $0`
. "$path/SETUP.sh" $@ --with-debug=full
extra_flags="$pentium_cflags $debug_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
-extra_configs="$pentium_configs $debug_configs "
-
-extra_configs="$extra_configs"
+extra_configs="$pentium_configs $debug_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-debug-max b/BUILD/compile-pentium-debug-max
index 7a11ad24c44..cf7f00161fb 100755
--- a/BUILD/compile-pentium-debug-max
+++ b/BUILD/compile-pentium-debug-max
@@ -3,9 +3,7 @@
path=`dirname $0`
. "$path/SETUP.sh" $@ --with-debug=full
-extra_flags="$pentium_cflags $debug_cflags $max_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_flags="$pentium_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs $max_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-debug-max-no-embedded b/BUILD/compile-pentium-debug-max-no-embedded
index dfdf7d0a5e1..35cb61d2ac5 100755
--- a/BUILD/compile-pentium-debug-max-no-embedded
+++ b/BUILD/compile-pentium-debug-max-no-embedded
@@ -3,9 +3,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$pentium_cflags $debug_cflags $max_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_flags="$pentium_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs $base_max_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-debug-max-no-ndb b/BUILD/compile-pentium-debug-max-no-ndb
index 26ec7eacc9d..3a94e89439a 100755
--- a/BUILD/compile-pentium-debug-max-no-ndb
+++ b/BUILD/compile-pentium-debug-max-no-ndb
@@ -3,9 +3,7 @@
path=`dirname $0`
. "$path/SETUP.sh" $@ --with-debug=full
-extra_flags="$pentium_cflags $debug_cflags $max_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_flags="$pentium_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs $max_no_ndb_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-debug-openssl b/BUILD/compile-pentium-debug-openssl
index 68d99b6eda6..91c3b448c7e 100755
--- a/BUILD/compile-pentium-debug-openssl
+++ b/BUILD/compile-pentium-debug-openssl
@@ -4,8 +4,6 @@ path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
extra_configs="$extra_configs --with-debug=full --with-openssl"
diff --git a/BUILD/compile-pentium-debug-yassl b/BUILD/compile-pentium-debug-yassl
index 666e73d0267..84ca489903d 100755
--- a/BUILD/compile-pentium-debug-yassl
+++ b/BUILD/compile-pentium-debug-yassl
@@ -4,8 +4,6 @@ path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
extra_configs="$extra_configs --with-debug=full --with-yassl"
diff --git a/BUILD/compile-pentium-icc-valgrind-max b/BUILD/compile-pentium-icc-valgrind-max
index b765c777e2b..58acf892f5a 100755
--- a/BUILD/compile-pentium-icc-valgrind-max
+++ b/BUILD/compile-pentium-icc-valgrind-max
@@ -9,7 +9,7 @@ CC=icc
CXX=icpc
export CC CXX
-extra_flags="$pentium_cflags $debug_cflags $max_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max"
+extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
# Disable following warnings as these are generated by header files:
# 161 unrecognized pragma
diff --git a/BUILD/compile-pentium-max b/BUILD/compile-pentium-max
index 595581f604e..8272e3406d3 100755
--- a/BUILD/compile-pentium-max
+++ b/BUILD/compile-pentium-max
@@ -3,7 +3,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$pentium_cflags $fast_cflags $max_cflags -g"
+extra_flags="$pentium_cflags $fast_cflags -g"
extra_configs="$pentium_configs $max_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-mysqlfs-debug b/BUILD/compile-pentium-mysqlfs-debug
index 6643553d943..c871200604e 100755
--- a/BUILD/compile-pentium-mysqlfs-debug
+++ b/BUILD/compile-pentium-mysqlfs-debug
@@ -4,8 +4,6 @@ path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs $static_link"
extra_configs="$extra_configs --with-debug=full --with-mysqlfs --without-server --without-pstack"
diff --git a/BUILD/compile-pentium-valgrind-max b/BUILD/compile-pentium-valgrind-max
index f0dc92c2ffd..09cc162d2be 100755
--- a/BUILD/compile-pentium-valgrind-max
+++ b/BUILD/compile-pentium-valgrind-max
@@ -3,13 +3,8 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$pentium_cflags $debug_cflags $max_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
-extra_configs="$pentium_configs $debug_configs"
-
-# We want to test isam when building with valgrind
-extra_configs="$extra_configs $max_leave_isam_configs --with-isam"
+extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
+extra_configs="$pentium_configs $debug_configs $max_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium64-debug b/BUILD/compile-pentium64-debug
index 0299669f79a..761c590b680 100755
--- a/BUILD/compile-pentium64-debug
+++ b/BUILD/compile-pentium64-debug
@@ -4,8 +4,6 @@ path=`dirname $0`
. "$path/SETUP.sh" $@ --with-debug=full
extra_flags="$pentium64_cflags $debug_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs $static_link"
extra_configs="$extra_configs "
diff --git a/BUILD/compile-pentium64-debug-max b/BUILD/compile-pentium64-debug-max
index f0745c88c90..594fe2e3009 100755
--- a/BUILD/compile-pentium64-debug-max
+++ b/BUILD/compile-pentium64-debug-max
@@ -3,9 +3,7 @@
path=`dirname $0`
. "$path/SETUP.sh" $@ --with-debug=full
-extra_flags="$pentium64_cflags $debug_cflags $max_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_flags="$pentium64_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs $max_configs"
extra_configs="$extra_configs "
diff --git a/BUILD/compile-pentium64-valgrind-max b/BUILD/compile-pentium64-valgrind-max
index ef932920130..fa476cbb50a 100755
--- a/BUILD/compile-pentium64-valgrind-max
+++ b/BUILD/compile-pentium64-valgrind-max
@@ -3,13 +3,8 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$pentium64_cflags $debug_cflags $max_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
-extra_configs="$pentium_configs $debug_configs"
-
-# We want to test isam when building with valgrind
-extra_configs="$extra_configs $max_leave_isam_configs --with-isam"
+extra_flags="$pentium64_cflags $debug_cflags $valgrind_flags"
+extra_configs="$pentium_configs $debug_configs $max_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-ppc-debug b/BUILD/compile-ppc-debug
index 2be11eaaf22..99e9364a5e2 100755
--- a/BUILD/compile-ppc-debug
+++ b/BUILD/compile-ppc-debug
@@ -4,8 +4,6 @@ path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$ppc_cflags $debug_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$debug_configs "
extra_configs="$extra_configs"
diff --git a/BUILD/compile-ppc-debug-max b/BUILD/compile-ppc-debug-max
index 49d1442fd45..7c1a593869f 100755
--- a/BUILD/compile-ppc-debug-max
+++ b/BUILD/compile-ppc-debug-max
@@ -3,9 +3,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$ppc_cflags $debug_cflags $max_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_flags="$ppc_cflags $debug_cflags"
extra_configs="$debug_configs $max_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-ppc-debug-max-no-ndb b/BUILD/compile-ppc-debug-max-no-ndb
index a5b922a1ec9..7b39aa25dff 100755
--- a/BUILD/compile-ppc-debug-max-no-ndb
+++ b/BUILD/compile-ppc-debug-max-no-ndb
@@ -3,9 +3,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$ppc_cflags $debug_cflags $max_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_flags="$ppc_cflags $debug_cflags"
extra_configs="$debug_configs $max_no_ndb_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-ppc-max b/BUILD/compile-ppc-max
index 1d89be81c9c..c2eb95dffea 100755
--- a/BUILD/compile-ppc-max
+++ b/BUILD/compile-ppc-max
@@ -3,7 +3,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$ppc_cflags $fast_cflags $max_cflags -g"
+extra_flags="$ppc_cflags $fast_cflags -g"
extra_configs="$extra_configs $max_configs"
. "$path/FINISH.sh"
diff --git a/Docs/Makefile.am b/Docs/Makefile.am
index f512aa9e29e..b3588263415 100644
--- a/Docs/Makefile.am
+++ b/Docs/Makefile.am
@@ -62,5 +62,12 @@ INSTALL-BINARY: mysql.info $(GT)
../support-files/MacOSX/ReadMe.txt: mysql.info $(GT)
perl -w $(GT) mysql.info "mac-os-x-installation" "netware-installation" > $@
+# Include the Windows manual.chm in source .tar.gz only if available.
+# It is not in BitKeeper, but is downloaded from intranet by Bootstrap.
+dist-hook:
+ if [ -e $(srcdir)/manual.chm ] ; then \
+ cp $(srcdir)/manual.chm $(distdir); \
+ fi
+
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/Docs/MySQLEULA.txt b/Docs/MySQLEULA.txt
index 71e630ec81f..f50c50298b1 100644
--- a/Docs/MySQLEULA.txt
+++ b/Docs/MySQLEULA.txt
@@ -63,7 +63,7 @@ Licensee.
4. Price and payment.
No later than thirty (30) days after submission of the Order Form, Licensee
shall remit one non-refundable license fee per Licensed Copy as posted on
-http://order.mysql.com on the date Licensee submitted the Order Form (the
+http://shop.mysql.com on the date Licensee submitted the Order Form (the
"License Fee"). All payments shall be made in Euros or U.S. dollars. Licensee
shall be responsible for paying all local, state, federal and international
sales, value added, excise and other taxes and duties payable in connection
diff --git a/Makefile.am b/Makefile.am
index f2450dffb45..3f17cbe797d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,7 +20,7 @@ AUTOMAKE_OPTIONS = foreign
# These are built from source in the Docs directory
EXTRA_DIST = INSTALL-SOURCE INSTALL-WIN-SOURCE \
- README COPYING EXCEPTIONS-CLIENT
+ README COPYING EXCEPTIONS-CLIENT cmakelists.txt
SUBDIRS = . include @docs_dirs@ @zlib_dir@ @yassl_dir@ \
@readline_topdir@ sql-common \
@thread_dirs@ pstack \
@@ -29,7 +29,7 @@ SUBDIRS = . include @docs_dirs@ @zlib_dir@ @yassl_dir@ \
@mysql_se_plugins@ \
netware @libmysqld_dirs@ \
@bench_dirs@ support-files @tools_dirs@ \
- plugin
+ plugin win
DIST_SUBDIRS = . include @docs_dirs@ zlib \
@readline_topdir@ sql-common \
@@ -39,7 +39,7 @@ DIST_SUBDIRS = . include @docs_dirs@ zlib \
@man_dirs@ tests SSL\
BUILD netware os2 @libmysqld_dirs@\
@bench_dirs@ support-files server-tools tools \
- plugin
+ plugin win
# Run these targets before any others, also make part of clean target,
# to make sure we create new links after a clean.
@@ -95,8 +95,16 @@ bin-dist: all
$(top_builddir)/scripts/make_binary_distribution @MAKE_BINARY_DISTRIBUTION_OPTIONS@
# Remove BK's "SCCS" subdirectories from source distribution
+# Create initial database files for Windows installations.
dist-hook:
rm -rf `find $(distdir) -type d -name SCCS -print`
+ if echo "$(distdir)" | grep -q '^/' ; then \
+ scripts/mysql_install_db --no-defaults --windows \
+ --datadir="$(distdir)/win/data"; \
+ else \
+ scripts/mysql_install_db --no-defaults --windows \
+ --datadir="$$(pwd)/$(distdir)/win/data"; \
+ fi
tags:
support-files/build-tags
diff --git a/README b/README
index 88cdaaf67d4..d37b37cd918 100644
--- a/README
+++ b/README
@@ -8,7 +8,7 @@ License information can be found in these files:
For further information about MySQL or additional documentation, see:
- The latest information about MySQL: http://www.mysql.com
-- The current MySQL documentation: http:/dev.mysql.com/doc
+- The current MySQL documentation: http://dev.mysql.com/doc
Some manual sections of special interest:
diff --git a/VC++Files/libmysqld/libmysqld.vcproj b/VC++Files/libmysqld/libmysqld.vcproj
index 2ca2401826d..a8410ee958f 100644
--- a/VC++Files/libmysqld/libmysqld.vcproj
+++ b/VC++Files/libmysqld/libmysqld.vcproj
@@ -86,7 +86,6 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/D MYSQL_SERVER_SUFFIX=-pro"
Optimization="2"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
diff --git a/VC++Files/mysqldemb/mysqldemb.vcproj b/VC++Files/mysqldemb/mysqldemb.vcproj
index 657fbec2ccc..bf5fc557882 100644
--- a/VC++Files/mysqldemb/mysqldemb.vcproj
+++ b/VC++Files/mysqldemb/mysqldemb.vcproj
@@ -71,7 +71,6 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/D MYSQL_SERVER_SUFFIX=-pro"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../include,../regex,../libmysqld,../sql,../zlib"
diff --git a/VC++Files/mysys/mysys.vcproj b/VC++Files/mysys/mysys.vcproj
index 7e010cd3786..befb4ad58b0 100644
--- a/VC++Files/mysys/mysys.vcproj
+++ b/VC++Files/mysys/mysys.vcproj
@@ -67,7 +67,6 @@
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/D MYSQL_SERVER_SUFFIX=-max"
Optimization="2"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
diff --git a/VC++Files/sql/mysqld.vcproj b/VC++Files/sql/mysqld.vcproj
index ea617e4f413..641e1f8e8f4 100644
--- a/VC++Files/sql/mysqld.vcproj
+++ b/VC++Files/sql/mysqld.vcproj
@@ -20,7 +20,6 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/D MYSQL_SERVER_SUFFIX=-classic-nt"
Optimization="2"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
@@ -82,7 +81,6 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/D MYSQL_SERVER_SUFFIX=-max"
Optimization="2"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
@@ -143,7 +141,6 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/D MYSQL_SERVER_SUFFIX=-nt-max"
Optimization="2"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
@@ -207,7 +204,6 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/D MYSQL_SERVER_SUFFIX=-nt"
Optimization="2"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
@@ -271,7 +267,6 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/D MYSQL_SERVER_SUFFIX=-pro-nt"
Optimization="2"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
@@ -393,7 +388,6 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/D MYSQL_SERVER_SUFFIX=-pro"
Optimization="2"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
@@ -455,7 +449,6 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/D MYSQL_SERVER_SUFFIX=-classic"
Optimization="2"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
diff --git a/VC++Files/storage/bdb/bdb.vcproj b/VC++Files/storage/bdb/bdb.vcproj
index 692526d147c..6a94a44d8de 100644
--- a/VC++Files/storage/bdb/bdb.vcproj
+++ b/VC++Files/storage/bdb/bdb.vcproj
@@ -20,7 +20,6 @@
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/D MYSQL_SERVER_SUFFIX=-max"
Optimization="2"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
diff --git a/VC++Files/storage/innobase/innobase.vcproj b/VC++Files/storage/innobase/innobase.vcproj
index 1c4cb23a7a6..cd3c68997a1 100644
--- a/VC++Files/storage/innobase/innobase.vcproj
+++ b/VC++Files/storage/innobase/innobase.vcproj
@@ -21,7 +21,6 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/D MYSQL_SERVER_SUFFIX=-nt-max"
Optimization="2"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
@@ -176,7 +175,6 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/D MYSQL_SERVER_SUFFIX=-nt"
Optimization="2"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
diff --git a/client/Makefile.am b/client/Makefile.am
index af7c3d2a549..970ca744146 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -77,6 +77,7 @@ strings_src=decimal.c
# Fix for mit-threads
DEFS = -DUNDEF_THREADS_HACK
+EXTRA_DIST = get_password.c cmakelists.txt
link_sources:
for f in $(sql_src) ; do \
diff --git a/client/mysql.cc b/client/mysql.cc
index eb6970691bb..2001056dea1 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -653,7 +653,7 @@ static struct my_option my_long_options[] =
"Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"socket", 'S', "Socket file to use for connection.",
+ {"socket", 'S', "Socket file to use for connection. (This will override --port unless --protocol=TCP is specified.)",
(gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include "sslopt-longopts.h"
@@ -939,7 +939,14 @@ static int get_options(int argc, char **argv)
opt_reconnect= 0;
connect_flag= 0; /* Not in interactive mode */
}
-
+
+ if (opt_mysql_port && (!opt_protocol) && (!opt_mysql_unix_port))
+ {
+ /* Not checking return type since we are using a constant value */
+ /* straight from the initialization of sql_protocol_typelib. */
+ opt_protocol= find_type("TCP", &sql_protocol_typelib, 0);
+ }
+
if (strcmp(default_charset, charset_info->csname) &&
!(charset_info= get_charset_by_csname(default_charset,
MY_CS_PRIMARY, MYF(MY_WME))))
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index e1136bd3a69..904bf432071 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -266,6 +266,7 @@ int main(int argc, char **argv)
my_end(0);
exit(1);
}
+
/* globals? Yes, so we only have to run strlen once */
delimiter_length= strlen(delimiter);
@@ -455,9 +456,10 @@ static struct my_option my_long_options[] =
(gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
0},
{"preserve-schema", OPT_MYSQL_PRESERVE_SCHEMA,
- "Preserve the schema from the mysqlslap run.",
+ "Preserve the schema from the mysqlslap run, this happens unless \
+ --auto-generate-sql or --create are used.",
(gptr*) &opt_preserve, (gptr*) &opt_preserve, 0, GET_BOOL,
- NO_ARG, 0, 0, 0, 0, 0, 0},
+ NO_ARG, TRUE, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL,
"The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -750,6 +752,9 @@ get_options(int *argc,char ***argv)
if (!user)
user= (char *)"root";
+ if (create_string || auto_generate_sql )
+ opt_preserve= FALSE;
+
if (auto_generate_sql && (create_string || user_supplied_query))
{
fprintf(stderr,
@@ -1012,7 +1017,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
}
}
#endif
-#ifndef __WIN__
+#if !(defined(__WIN__) || defined(__NETWARE__))
#ifdef HAVE_LIBPTHREAD
else
#endif
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 888993e6054..50d814e3f9b 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -209,9 +209,9 @@ struct st_replace_regex
*/
char* buf;
char* even_buf;
- uint even_buf_len;
char* odd_buf;
- uint odd_buf_len;
+ int even_buf_len;
+ int odd_buf_len;
};
struct st_replace_regex *glob_replace_regex= 0;
@@ -1278,6 +1278,7 @@ int var_query_set(VAR* var, const char *query, const char** query_end)
MYSQL_RES *res;
MYSQL_ROW row;
MYSQL* mysql = &cur_con->mysql;
+ DBUG_ENTER("var_query_set");
LINT_INIT(res);
while (end > query && *end != '`')
@@ -1340,7 +1341,7 @@ int var_query_set(VAR* var, const char *query, const char** query_end)
eval_expr(var, "", 0);
mysql_free_result(res);
- return 0;
+ DBUG_RETURN(0);
}
void var_copy(VAR *dest, VAR *src)
@@ -1517,6 +1518,7 @@ void do_system(struct st_query *command)
}
command->last_argument= command->end;
+ dynstr_free(&ds_cmd);
DBUG_VOID_RETURN;
}
@@ -1557,7 +1559,7 @@ int do_echo(struct st_query *command)
dynstr_append_mem(ds, "\n", 1);
dynstr_free(&ds_echo);
command->last_argument= command->end;
- return 0;
+ return(0);
}
@@ -1660,7 +1662,7 @@ int do_save_master_pos()
if (have_ndbcluster)
{
- ulonglong epoch, tmp_epoch= 0;
+ ulonglong epoch=0, tmp_epoch= 0;
int count= 0;
do
diff --git a/cmakelists.txt b/cmakelists.txt
index ab5317ef171..70b017c757d 100644
--- a/cmakelists.txt
+++ b/cmakelists.txt
@@ -1,6 +1,74 @@
PROJECT(MySql)
-EXEC_PROGRAM(cscript.exe win ARGS config-version.js OUT_VARIABLE out)
+# This reads user configuration, generated by configure.js.
+INCLUDE(win/configure.data)
+
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
+ ${CMAKE_SOURCE_DIR}/include/mysql_version.h @ONLY)
+
+IF(WITH_ARCHIVE_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-D WITH_ARCHIVE_STORAGE_ENGINE)
+ SET (mysql_se_htons "${mysql_se_htons}, &archive_hton")
+ SET (mysql_se_decls "${mysql_se_decls}, archive_hton")
+ SET (mysql_se_ha_src ${mysql_se_ha_src} "../sql/ha_archive.cc")
+ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
+IF(WITH_BLACKHOLE_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-D WITH_BLACKHOLE_STORAGE_ENGINE)
+ SET (mysql_se_htons "${mysql_se_htons}, &blackhole_hton")
+ SET (mysql_se_decls "${mysql_se_decls}, blackhole_hton")
+ SET (mysql_se_ha_src ${mysql_se_ha_src} "../sql/ha_blackhole.cc")
+ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
+IF(WITH_EXAMPLE_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-D WITH_EXAMPLE_STORAGE_ENGINE)
+ SET (mysql_se_htons "${mysql_se_htons}, &example_hton")
+ SET (mysql_se_decls "${mysql_se_decls}, example_hton")
+ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
+IF(WITH_INNOBASE_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-D WITH_INNOBASE_STORAGE_ENGINE)
+ SET (mysql_se_htons "${mysql_se_htons}, &innobase_hton")
+ SET (mysql_se_decls "${mysql_se_decls}, innobase_hton")
+ SET (mysql_se_ha_src ${mysql_se_ha_src} "../sql/ha_innodb.cc")
+ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
+IF(WITH_PARTITION_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-D WITH_PARTITION_STORAGE_ENGINE)
+ SET (mysql_se_htons "${mysql_se_htons}, &partition_hton")
+ SET (mysql_se_decls "${mysql_se_decls}, partition_hton")
+ SET (mysql_se_ha_src ${mysql_se_ha_src} "../sql/ha_partition.cc")
+ENDIF(WITH_PARTITION_STORAGE_ENGINE)
+IF(WITH_FEDERATED_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-D WITH_FEDERATED_STORAGE_ENGINE)
+ SET (mysql_se_htons "${mysql_se_htons}, &federated_hton")
+ SET (mysql_se_decls "${mysql_se_decls}, federated_hton")
+ SET (mysql_se_ha_src ${mysql_se_ha_src} "../sql/ha_federated.cc")
+ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
+IF(WITH_BERKELEY_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-D WITH_BERKELEY_STORAGE_ENGINE)
+ SET (mysql_se_htons "${mysql_se_htons}, &berkeley_hton")
+ SET (mysql_se_decls "${mysql_se_decls}, berkeley_hton")
+ SET (mysql_se_ha_src ${mysql_se_ha_src} "../sql/ha_berkeley.cc")
+ENDIF(WITH_BERKELEY_STORAGE_ENGINE)
+
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/handlerton.cc.in
+ ${CMAKE_SOURCE_DIR}/sql/handlerton.cc @ONLY)
+
+SET(localstatedir "C:\\mysql\\data")
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-huge.cnf.sh
+ ${CMAKE_SOURCE_DIR}/support-files/my-huge.ini @ONLY)
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-innodb-heavy-4G.cnf.sh
+ ${CMAKE_SOURCE_DIR}/support-files/my-innodb-heavy-4G.ini @ONLY)
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-large.cnf.sh
+ ${CMAKE_SOURCE_DIR}/support-files/my-large.ini @ONLY)
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-medium.cnf.sh
+ ${CMAKE_SOURCE_DIR}/support-files/my-medium.ini @ONLY)
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-small.cnf.sh
+ ${CMAKE_SOURCE_DIR}/support-files/my-small.ini @ONLY)
+
+IF(__NT__)
+ ADD_DEFINITIONS(-D __NT__)
+ENDIF(__NT__)
+IF(CYBOZU)
+ ADD_DEFINITIONS(-D CYBOZU)
+ENDIF(CYBOZU)
# in some places we use DBUG_OFF
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D DBUG_OFF")
@@ -13,24 +81,62 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996")
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
+IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
+ CMAKE_GENERATOR MATCHES "Visual Studio 8")
# replace /MDd with /MTd
- STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT})
- STRING(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG_INIT ${CMAKE_C_FLAGS_DEBUG_INIT})
- STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
- STRING(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
- STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
- STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
+ STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG_INIT
+ ${CMAKE_CXX_FLAGS_DEBUG_INIT})
+ STRING(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG_INIT
+ ${CMAKE_C_FLAGS_DEBUG_INIT})
+ STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE
+ ${CMAKE_C_FLAGS_RELEASE})
+ STRING(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG
+ ${CMAKE_C_FLAGS_DEBUG})
+ STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE
+ ${CMAKE_CXX_FLAGS_RELEASE})
+ STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG
+ ${CMAKE_CXX_FLAGS_DEBUG})
# remove support for Exception handling
STRING(REPLACE "/GX" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
- STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_INIT ${CMAKE_CXX_FLAGS_INIT})
- STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT})
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
+ STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_INIT
+ ${CMAKE_CXX_FLAGS_INIT})
+ STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_DEBUG_INIT
+ ${CMAKE_CXX_FLAGS_DEBUG_INIT})
+ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
+ CMAKE_GENERATOR MATCHES "Visual Studio 8")
-ADD_DEFINITIONS("-D_WINDOWS -D__WIN__")
+ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D _CRT_SECURE_NO_DEPRECATE")
-SUBDIRS(vio dbug strings regex mysys extra/yassl extra/yassl/taocrypt extra
- zlib storage/innobase storage/heap storage/myisam storage/myisammrg
- client sql server-tools/instance-manager libmysql tests)
+ADD_SUBDIRECTORY(vio)
+ADD_SUBDIRECTORY(dbug)
+ADD_SUBDIRECTORY(strings)
+ADD_SUBDIRECTORY(regex)
+ADD_SUBDIRECTORY(mysys)
+ADD_SUBDIRECTORY(extra/yassl)
+ADD_SUBDIRECTORY(extra/yassl/taocrypt)
+ADD_SUBDIRECTORY(extra)
+ADD_SUBDIRECTORY(zlib)
+ADD_SUBDIRECTORY(storage/heap)
+ADD_SUBDIRECTORY(storage/myisam)
+ADD_SUBDIRECTORY(storage/myisammrg)
+ADD_SUBDIRECTORY(client)
+IF(WITH_ARCHIVE_STORAGE_ENGINE)
+ ADD_SUBDIRECTORY(storage/archive)
+ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
+IF(WITH_BERKELEY_STORAGE_ENGINE)
+ ADD_SUBDIRECTORY(storage/bdb)
+ENDIF(WITH_BERKELEY_STORAGE_ENGINE)
+IF(WITH_EXAMPLE_STORAGE_ENGINE)
+ ADD_SUBDIRECTORY(storage/example)
+ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
+IF(WITH_INNOBASE_STORAGE_ENGINE)
+ ADD_SUBDIRECTORY(storage/innobase)
+ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
+ADD_SUBDIRECTORY(sql)
+ADD_SUBDIRECTORY(server-tools/instance-manager)
+ADD_SUBDIRECTORY(libmysql)
+ADD_SUBDIRECTORY(tests)
+ADD_SUBDIRECTORY(libmysqld)
+ADD_SUBDIRECTORY(libmysqld/examples)
diff --git a/config/ac-macros/openssl.m4 b/config/ac-macros/openssl.m4
index aa46dd45360..1f9d53abe01 100644
--- a/config/ac-macros/openssl.m4
+++ b/config/ac-macros/openssl.m4
@@ -14,7 +14,8 @@ AC_DEFUN([MYSQL_FIND_OPENSSL], [
for d in /usr/ssl/lib /usr/local/ssl/lib /usr/lib/openssl \
/usr/lib /usr/lib64 /opt/ssl/lib /opt/openssl/lib \
/usr/freeware/lib32 /usr/local/lib/ ; do
- if test -f $d/libssl.a || test -f $d/libssl.so || test -f $d/libssl.dylib ; then
+ # Just to be safe, we test for ".so" anyway
+ if test -f $d/libssl.a || test -f $d/libssl.so || test -f $d/libssl$shrext_cmds ; then
OPENSSL_LIB=$d
fi
done
@@ -26,7 +27,8 @@ AC_DEFUN([MYSQL_FIND_OPENSSL], [
if test -f $incs/openssl/ssl.h ; then
OPENSSL_INCLUDE=-I$incs
fi
- if test -f $libs/libssl.a || test -f $libs/libssl.so || test -f $libs/libssl.dylib ; then
+ # Just to be safe, we test for ".so" anyway
+ if test -f $libs/libssl.a || test -f $libs/libssl.so || test -f $libs/libssl$shrext_cmds ; then
OPENSSL_LIB=$libs
fi
;;
diff --git a/config/ac-macros/yassl.m4 b/config/ac-macros/yassl.m4
index b4160ad2a99..c736f2f10f2 100644
--- a/config/ac-macros/yassl.m4
+++ b/config/ac-macros/yassl.m4
@@ -17,7 +17,6 @@ AC_DEFUN([MYSQL_CHECK_YASSL], [
yassl_dir="extra/yassl"
yassl_libs="-L\$(top_srcdir)/extra/yassl/src -lyassl -L\$(top_srcdir)/extra/yassl/taocrypt/src -ltaocrypt"
yassl_includes="-I\$(top_srcdir)/extra/yassl/include"
- yassl_libs_with_path="\$(top_srcdir)/extra/yassl/src/libyassl.la \$(top_srcdir)/extra/yassl/taocrypt/src/libtaocrypt.la"
AC_DEFINE([HAVE_OPENSSL], [1], [Defined by configure. Using yaSSL for OpenSSL emulation.])
AC_DEFINE([HAVE_YASSL], [1], [Defined by configure. Using yaSSL for OpenSSL emulation.])
# System specific checks
@@ -38,8 +37,7 @@ AC_DEFUN([MYSQL_CHECK_YASSL], [
AC_MSG_RESULT(no)
fi
AC_SUBST(yassl_libs)
- AC_SUBST(yassl_libs_with_path)
AC_SUBST(yassl_includes)
AC_SUBST(yassl_dir)
- AM_CONDITIONAL([HAVE_YASSL], [ test "with_yassl" = "yes" ])
+ AM_CONDITIONAL([HAVE_YASSL], [ test "$with_yassl" = "yes" ])
])
diff --git a/config/ac-macros/zlib.m4 b/config/ac-macros/zlib.m4
index ec55f19b98f..a8c54c845a1 100644
--- a/config/ac-macros/zlib.m4
+++ b/config/ac-macros/zlib.m4
@@ -13,9 +13,9 @@ mysql_cv_compress="yes"
dnl Auxiliary macro to check for zlib at given path
AC_DEFUN([MYSQL_CHECK_ZLIB_DIR], [
-save_INCLUDES="$INCLUDES"
+save_CPPFLAGS="$CPPFLAGS"
save_LIBS="$LIBS"
-INCLUDES="$INCLUDES $ZLIB_INCLUDES"
+CPPFLAGS="$ZLIB_INCLUDES $CPPFLAGS"
LIBS="$LIBS $ZLIB_LIBS"
AC_CACHE_VAL([mysql_cv_compress],
[AC_TRY_LINK([#include <zlib.h>],
@@ -24,7 +24,7 @@ AC_CACHE_VAL([mysql_cv_compress],
AC_MSG_RESULT([ok])],
[mysql_cv_compress="no"])
])
-INCLUDES="$save_INCLUDES"
+CPPFLAGS="$save_CPPFLAGS"
LIBS="$save_LIBS"
])
@@ -89,8 +89,9 @@ case $SYSTEM_TYPE in
fi
;;
*)
+ # Just to be safe, we test for ".so" anyway
if test \( -f "$mysql_zlib_dir/lib/libz.a" -o -f "$mysql_zlib_dir/lib/libz.so" -o \
- -f "$mysql_zlib_dir/lib/libz.sl" -o -f "$mysql_zlib_dir/lib/libz.dylib" \) \
+ -f "$mysql_zlib_dir/lib/libz$shrext_cmds" \) \
-a -f "$mysql_zlib_dir/include/zlib.h"; then
ZLIB_INCLUDES="-I$mysql_zlib_dir/include"
ZLIB_LIBS="-L$mysql_zlib_dir/lib -lz"
diff --git a/configure.in b/configure.in
index 34562ce7df1..0253a3a6771 100644
--- a/configure.in
+++ b/configure.in
@@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line!
# remember to also change ndb version below and update version.c in ndb
-AM_INIT_AUTOMAKE(mysql, 5.1.8-beta)
+AM_INIT_AUTOMAKE(mysql, 5.1.9-beta)
AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10
@@ -1608,18 +1608,20 @@ else
CXXFLAGS="$OPTIMIZE_CXXFLAGS -DDBUG_OFF $CXXFLAGS"
fi
-if test "$with_debug" = "no"
-then
- AC_ARG_WITH([fast-mutexes],
- AC_HELP_STRING([--with-fast-mutexes],
- [Compile with fast mutexes (default is disabled)]),
- [with_fast_mutexes=$withval], [with_fast_mutexes=no])
-fi
+AC_ARG_WITH([fast-mutexes],
+ AC_HELP_STRING([--with-fast-mutexes],
+ [Compile with fast mutexes (default is disabled)]),
+ [with_fast_mutexes=$withval], [with_fast_mutexes=no])
-if test "$with_fast_mutexes" = "yes"
+if test "$with_fast_mutexes" != "no"
then
- AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1],
- [Define to 1 if you want to use fast mutexes])
+ if test "$with_debug" != "no"
+ then
+ AC_MSG_WARN(['--with-fast-mutexes' ignored when '--with-debug' is given])
+ else
+ AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1],
+ [Define to 1 if you want to use fast mutexes])
+ fi
fi
# Force static compilation to avoid linking problems/get more speed
@@ -2463,7 +2465,8 @@ MYSQL_STORAGE_ENGINE(innobase,,innodb,,,,storage/innobase,ha_innodb.o,[ dnl
MYSQL_STORAGE_ENGINE(berkeley,,berkeley-db,,,,storage/bdb,,,[
MYSQL_SETUP_BERKELEY_DB
])
-MYSQL_STORAGE_ENGINE(example,,,,,no,storage/example,,,[
+MYSQL_STORAGE_ENGINE(example,,,,,,storage/example,no,
+ \$(top_builddir)/storage/example/libexample.a,[
AC_CONFIG_FILES(storage/example/Makefile)
])
MYSQL_STORAGE_ENGINE(archive,,,,,,storage/archive,,
@@ -2618,7 +2621,8 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
zlib/Makefile dnl
cmd-line-utils/readline/Makefile dnl
plugin/Makefile dnl
- plugin/fulltext/Makefile)
+ plugin/fulltext/Makefile dnl
+ win/Makefile)
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
AC_OUTPUT
diff --git a/dbug/Makefile.am b/dbug/Makefile.am
index 1046e770fa7..b0c8862bede 100644
--- a/dbug/Makefile.am
+++ b/dbug/Makefile.am
@@ -20,7 +20,7 @@ LDADD = libdbug.a ../mysys/libmysys.a ../strings/libmystrings.a
pkglib_LIBRARIES = libdbug.a
noinst_HEADERS = dbug_long.h
libdbug_a_SOURCES = dbug.c sanity.c
-EXTRA_DIST = example1.c example2.c example3.c \
+EXTRA_DIST = cmakelists.txt example1.c example2.c example3.c \
user.r monty.doc dbug_add_tags.pl \
my_main.c main.c factorial.c dbug_analyze.c
NROFF_INC = example1.r example2.r example3.r main.r \
diff --git a/extra/Makefile.am b/extra/Makefile.am
index 4fe1039d306..0aaa8c4d127 100644
--- a/extra/Makefile.am
+++ b/extra/Makefile.am
@@ -43,6 +43,7 @@ $(top_builddir)/include/sql_state.h: $(top_builddir)/include/mysqld_error.h
bin_PROGRAMS = replace comp_err perror resolveip my_print_defaults \
resolve_stack_dump mysql_waitpid innochecksum
noinst_PROGRAMS = charset2html
+EXTRA_DIST = cmakelists.txt
perror.o: perror.c
$(COMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
diff --git a/extra/comp_err.c b/extra/comp_err.c
index 2d685a04087..0a77cf6f66d 100644
--- a/extra/comp_err.c
+++ b/extra/comp_err.c
@@ -188,8 +188,9 @@ int main(int argc, char *argv[])
DBUG_RETURN(1);
}
clean_up(lang_head, error_head);
+ DBUG_LEAVE; /* Can't use dbug after my_end() */
my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
- DBUG_RETURN(0);
+ return 0;
}
}
diff --git a/extra/yassl/Makefile.am b/extra/yassl/Makefile.am
index 7ec49ec8c33..3ce5e2632cc 100644
--- a/extra/yassl/Makefile.am
+++ b/extra/yassl/Makefile.am
@@ -1,2 +1,3 @@
SUBDIRS = taocrypt src
-EXTRA_DIST = yassl.dsp yassl.dsw yassl.vcproj $(wildcard mySTL/*.hpp)
+EXTRA_DIST = yassl.dsp yassl.dsw yassl.vcproj $(wildcard mySTL/*.hpp) \
+ cmakelists.txt
diff --git a/extra/yassl/taocrypt/Makefile.am b/extra/yassl/taocrypt/Makefile.am
index c8413af3285..e882f7bafe6 100644
--- a/extra/yassl/taocrypt/Makefile.am
+++ b/extra/yassl/taocrypt/Makefile.am
@@ -1,2 +1,2 @@
SUBDIRS = src
-EXTRA_DIST = taocrypt.dsw taocrypt.dsp taocrypt.vcproj
+EXTRA_DIST = taocrypt.dsw taocrypt.dsp taocrypt.vcproj cmakelists.txt
diff --git a/include/my_dbug.h b/include/my_dbug.h
index db2139fa2e2..65bb7b55d0d 100644
--- a/include/my_dbug.h
+++ b/include/my_dbug.h
@@ -81,6 +81,7 @@ extern FILE *_db_fp_(void);
#else /* No debugger */
#define DBUG_ENTER(a1)
+#define DBUG_LEAVE
#define DBUG_RETURN(a1) do { return(a1); } while(0)
#define DBUG_VOID_RETURN do { return; } while(0)
#define DBUG_EXECUTE(keyword,a1) do { } while(0)
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 81100fe2b88..9146cab8589 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -116,6 +116,13 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
#define _REENTRANT 1
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
+/*
+ Windows has two ways to use thread local storage. The most efficient
+ is using __declspec(thread), but that does not work properly when
+ used in a .dll that is loaded at runtime, after program load. So for
+ libmysql.dll and libmysqld.dll we define USE_TLS in order to use the
+ TlsXxx() API instead, which works in all cases.
+*/
#ifdef USE_TLS /* For LIBMYSQL.DLL */
#undef SAFE_MUTEX /* This will cause conflicts */
#define pthread_key(T,V) DWORD V
diff --git a/include/mysql.h b/include/mysql.h
index 303cb2af4f5..925a4525378 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -287,8 +287,10 @@ typedef struct st_mysql
from mysql_stmt_close if close had to cancel result set of this object.
*/
my_bool *unbuffered_fetch_owner;
+#if defined(EMBEDDED_LIBRARY) || defined(EMBEDDED_LIBRARY_COMPATIBLE) || MYSQL_VERSION_ID >= 50100
/* needed for embedded server - no net buffer to store the 'info' */
char *info_buffer;
+#endif
} MYSQL;
typedef struct st_mysql_res {
diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am
index a3e16b521a9..9a6f418fa49 100644
--- a/libmysql/Makefile.am
+++ b/libmysql/Makefile.am
@@ -29,9 +29,9 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
include $(srcdir)/Makefile.shared
libmysqlclient_la_SOURCES = $(target_sources)
-libmysqlclient_la_LIBADD = $(target_libadd) $(yassl_libs_with_path)
+libmysqlclient_la_LIBADD = $(target_libadd) $(yassl_las)
libmysqlclient_la_LDFLAGS = $(target_ldflags)
-EXTRA_DIST = Makefile.shared libmysql.def
+EXTRA_DIST = Makefile.shared libmysql.def dll.c mytest.c cmakelists.txt
noinst_HEADERS = client_settings.h
# This is called from the toplevel makefile
diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared
index c4c9c0036e2..a641bdf2f10 100644
--- a/libmysql/Makefile.shared
+++ b/libmysql/Makefile.shared
@@ -87,6 +87,11 @@ DEFS = -DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \
-DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX \
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" $(target_defs)
+if HAVE_YASSL
+yassl_las = $(top_srcdir)/extra/yassl/src/libyassl.la \
+ $(top_srcdir)/extra/yassl/taocrypt/src/libtaocrypt.la
+endif
+
# The automatic dependencies miss this
#bmove_upp.lo: $(LTCHARSET_OBJS)
diff --git a/libmysql/cmakelists.txt b/libmysql/cmakelists.txt
index 006eac2fbb9..35795102082 100644
--- a/libmysql/cmakelists.txt
+++ b/libmysql/cmakelists.txt
@@ -1,5 +1,7 @@
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+# Need to set USE_TLS, since __declspec(thread) approach to thread local
+# storage does not work properly in DLLs.
+SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS")
+SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/zlib
@@ -48,6 +50,5 @@ ADD_LIBRARY(libmysql MODULE dll.c libmysql.def
ADD_DEPENDENCIES(libmysql dbug vio mysys strings GenError zlib yassl taocrypt)
TARGET_LINK_LIBRARIES(libmysql mysys strings wsock32)
-# ToDo: We should move the mytest.c program out in libmysql/
-ADD_EXECUTABLE(myTest ../VC++Files/libmysqltest/mytest.c)
+ADD_EXECUTABLE(myTest mytest.c)
TARGET_LINK_LIBRARIES(myTest libmysql)
diff --git a/libmysql/mytest.c b/libmysql/mytest.c
new file mode 100644
index 00000000000..a1dc13db39f
--- /dev/null
+++ b/libmysql/mytest.c
@@ -0,0 +1,175 @@
+/*C4*/
+/****************************************************************/
+/* Author: Jethro Wright, III TS : 3/ 4/1998 9:15 */
+/* Date: 02/18/1998 */
+/* mytest.c : do some testing of the libmySQL.DLL.... */
+/* */
+/* History: */
+/* 02/18/1998 jw3 also sprach zarathustra.... */
+/****************************************************************/
+
+
+#include <windows.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <mysql.h>
+
+#define DEFALT_SQL_STMT "SELECT * FROM db"
+#ifndef offsetof
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
+
+/********************************************************
+**
+** main :-
+**
+********************************************************/
+
+int
+main( int argc, char * argv[] )
+{
+
+ char szSQL[ 200 ], aszFlds[ 25 ][ 25 ], szDB[ 50 ] ;
+ const char *pszT;
+ int i, j, k, l, x ;
+ MYSQL * myData ;
+ MYSQL_RES * res ;
+ MYSQL_FIELD * fd ;
+ MYSQL_ROW row ;
+
+ //....just curious....
+ printf( "sizeof( MYSQL ) == %d\n", (int) sizeof( MYSQL ) ) ;
+ if ( argc == 2 )
+ {
+ strcpy( szDB, argv[ 1 ] ) ;
+ strcpy( szSQL, DEFALT_SQL_STMT ) ;
+ if (!strcmp(szDB,"--debug"))
+ {
+ strcpy( szDB, "mysql" ) ;
+ printf("Some mysql struct information (size and offset):\n");
+ printf("net:\t%3d %3d\n",(int) sizeof(myData->net),
+ (int) offsetof(MYSQL,net));
+ printf("host:\t%3d %3d\n",(int) sizeof(myData->host),
+ (int) offsetof(MYSQL,host));
+ printf("port:\t%3d %3d\n", (int) sizeof(myData->port),
+ (int) offsetof(MYSQL,port));
+ printf("protocol_version:\t%3d %3d\n",
+ (int) sizeof(myData->protocol_version),
+ (int) offsetof(MYSQL,protocol_version));
+ printf("thread_id:\t%3d %3d\n",(int) sizeof(myData->thread_id),
+ (int) offsetof(MYSQL,thread_id));
+ printf("affected_rows:\t%3d %3d\n",(int) sizeof(myData->affected_rows),
+ (int) offsetof(MYSQL,affected_rows));
+ printf("packet_length:\t%3d %3d\n",(int) sizeof(myData->packet_length),
+ (int) offsetof(MYSQL,packet_length));
+ printf("status:\t%3d %3d\n",(int) sizeof(myData->status),
+ (int) offsetof(MYSQL,status));
+ printf("fields:\t%3d %3d\n",(int) sizeof(myData->fields),
+ (int) offsetof(MYSQL,fields));
+ printf("field_alloc:\t%3d %3d\n",(int) sizeof(myData->field_alloc),
+ (int) offsetof(MYSQL,field_alloc));
+ printf("free_me:\t%3d %3d\n",(int) sizeof(myData->free_me),
+ (int) offsetof(MYSQL,free_me));
+ printf("options:\t%3d %3d\n",(int) sizeof(myData->options),
+ (int) offsetof(MYSQL,options));
+ puts("");
+ }
+ }
+ else if ( argc > 2 ) {
+ strcpy( szDB, argv[ 1 ] ) ;
+ strcpy( szSQL, argv[ 2 ] ) ;
+ }
+ else {
+ strcpy( szDB, "mysql" ) ;
+ strcpy( szSQL, DEFALT_SQL_STMT ) ;
+ }
+ //....
+
+ if ( (myData = mysql_init((MYSQL*) 0)) &&
+ mysql_real_connect( myData, NULL, NULL, NULL, NULL, MYSQL_PORT,
+ NULL, 0 ) )
+ {
+ myData->reconnect= 1;
+ if ( mysql_select_db( myData, szDB ) < 0 ) {
+ printf( "Can't select the %s database !\n", szDB ) ;
+ mysql_close( myData ) ;
+ return 2 ;
+ }
+ }
+ else {
+ printf( "Can't connect to the mysql server on port %d !\n",
+ MYSQL_PORT ) ;
+ mysql_close( myData ) ;
+ return 1 ;
+ }
+ //....
+ if ( ! mysql_query( myData, szSQL ) ) {
+ res = mysql_store_result( myData ) ;
+ i = (int) mysql_num_rows( res ) ; l = 1 ;
+ printf( "Query: %s\nNumber of records found: %ld\n", szSQL, i ) ;
+ //....we can get the field-specific characteristics here....
+ for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
+ strcpy( aszFlds[ x ], fd->name ) ;
+ //....
+ while ( row = mysql_fetch_row( res ) ) {
+ j = mysql_num_fields( res ) ;
+ printf( "Record #%ld:-\n", l++ ) ;
+ for ( k = 0 ; k < j ; k++ )
+ printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
+ (((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
+ puts( "==============================\n" ) ;
+ }
+ mysql_free_result( res ) ;
+ }
+ else printf( "Couldn't execute %s on the server !\n", szSQL ) ;
+ //....
+ puts( "==== Diagnostic info ====" ) ;
+ pszT = mysql_get_client_info() ;
+ printf( "Client info: %s\n", pszT ) ;
+ //....
+ pszT = mysql_get_host_info( myData ) ;
+ printf( "Host info: %s\n", pszT ) ;
+ //....
+ pszT = mysql_get_server_info( myData ) ;
+ printf( "Server info: %s\n", pszT ) ;
+ //....
+ res = mysql_list_processes( myData ) ; l = 1 ;
+ if (res)
+ {
+ for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
+ strcpy( aszFlds[ x ], fd->name ) ;
+ while ( row = mysql_fetch_row( res ) ) {
+ j = mysql_num_fields( res ) ;
+ printf( "Process #%ld:-\n", l++ ) ;
+ for ( k = 0 ; k < j ; k++ )
+ printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
+ (((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
+ puts( "==============================\n" ) ;
+ }
+ }
+ else
+ {
+ printf("Got error %s when retreiving processlist\n",mysql_error(myData));
+ }
+ //....
+ res = mysql_list_tables( myData, "%" ) ; l = 1 ;
+ for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
+ strcpy( aszFlds[ x ], fd->name ) ;
+ while ( row = mysql_fetch_row( res ) ) {
+ j = mysql_num_fields( res ) ;
+ printf( "Table #%ld:-\n", l++ ) ;
+ for ( k = 0 ; k < j ; k++ )
+ printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
+ (((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
+ puts( "==============================\n" ) ;
+ }
+ //....
+ pszT = mysql_stat( myData ) ;
+ puts( pszT ) ;
+ //....
+ mysql_close( myData ) ;
+ return 0 ;
+
+}
diff --git a/libmysql_r/Makefile.am b/libmysql_r/Makefile.am
index 11e65a28a19..d28f31b2258 100644
--- a/libmysql_r/Makefile.am
+++ b/libmysql_r/Makefile.am
@@ -32,7 +32,7 @@ include $(top_srcdir)/libmysql/Makefile.shared
libmysql_dir = $(top_srcdir)/libmysql
libmysqlclient_r_la_SOURCES = $(target_sources)
-libmysqlclient_r_la_LIBADD = $(target_libadd) $(yassl_libs_with_path)
+libmysqlclient_r_la_LIBADD = $(target_libadd) $(yassl_las)
libmysqlclient_r_la_LDFLAGS = $(target_ldflags)
# This is called from the toplevel makefile
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index be9947ca2dd..961eea21d2a 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -22,6 +22,7 @@ MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
MYSQLLIBdir= $(libdir)
+EXTRA_DIST = libmysqld.def
DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
-DDATADIR="\"$(MYSQLDATAdir)\"" \
@@ -93,8 +94,12 @@ INC_LIB= $(top_builddir)/regex/libregex.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/vio/libvio.a \
@mysql_se_libs@ \
- @yassl_libs_with_path@
+ $(yassl_las)
+if HAVE_YASSL
+yassl_las = $(top_srcdir)/extra/yassl/src/libyassl.la \
+ $(top_srcdir)/extra/yassl/taocrypt/src/libtaocrypt.la
+endif
# Storage engine specific compilation options
diff --git a/libmysqld/cmakelists.txt b/libmysqld/cmakelists.txt
new file mode 100644
index 00000000000..a11a0dffd33
--- /dev/null
+++ b/libmysqld/cmakelists.txt
@@ -0,0 +1,86 @@
+SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+
+# Need to set USE_TLS, since __declspec(thread) approach to thread local
+# storage does not work properly in DLLs.
+ADD_DEFINITIONS(-DUSE_TLS -DHAVE_ROW_BASED_REPLICATION -DMYSQL_SERVER
+ -DEMBEDDED_LIBRARY)
+
+# The old Windows build method used renamed (.cc -> .cpp) source files, fails
+# in #include in lib_sql.cc. So disable that using the USING_CMAKE define.
+ADD_DEFINITIONS(-DUSING_CMAKE)
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
+ ${CMAKE_SOURCE_DIR}/libmysqld
+ ${CMAKE_SOURCE_DIR}/libmysql
+ ${CMAKE_SOURCE_DIR}/sql
+ ${CMAKE_SOURCE_DIR}/regex
+ ${CMAKE_SOURCE_DIR}/extra/yassl/include
+ ${CMAKE_SOURCE_DIR}/storage/bdb/build_win32
+ ${CMAKE_SOURCE_DIR}/zlib
+)
+
+ADD_LIBRARY(mysqldemb emb_qcache.cc libmysqld.c lib_sql.cc
+ ../client/get_password.c ../libmysql/errmsg.c
+ ../libmysql/libmysql.c ../sql/password.c ../sql-common/client.c
+ ../sql-common/my_time.c ../sql-common/my_user.c
+ ../sql-common/pack.c ../sql/derror.cc ../sql/event_executor.cc
+ ../sql/event_timed.cc ../sql/event.cc ../sql/discover.cc
+ ../sql/field_conv.cc ../sql/field.cc ../sql/filesort.cc
+ ../sql/gstream.cc ../sql/ha_heap.cc ../sql/ha_myisam.cc
+ ../sql/ha_myisammrg.cc ${mysql_se_ha_src}
+ ../sql/handler.cc ../sql/handlerton-win.cc ../sql/hash_filo.cc
+ ../sql/hostname.cc ../sql/init.cc ../sql/item_buff.cc
+ ../sql/item_cmpfunc.cc ../sql/item.cc ../sql/item_create.cc
+ ../sql/item_func.cc ../sql/item_geofunc.cc ../sql/item_row.cc
+ ../sql/item_strfunc.cc ../sql/item_subselect.cc ../sql/item_sum.cc
+ ../sql/item_timefunc.cc ../sql/item_uniq.cc ../sql/item_xmlfunc.cc
+ ../sql/key.cc ../sql/lock.cc ../sql/log.cc ../sql/log_event.cc
+ ../sql/mf_iocache.cc ../sql/my_decimal.cc ../sql/net_serv.cc
+ ../sql/opt_range.cc ../sql/opt_sum.cc ../sql/parse_file.cc
+ ../sql/procedure.cc ../sql/protocol.cc ../sql/records.cc
+ ../sql/repl_failsafe.cc ../sql/rpl_filter.cc ../sql/set_var.cc
+ ../sql/spatial.cc ../sql/sp_cache.cc ../sql/sp.cc
+ ../sql/sp_head.cc ../sql/sp_pcontext.cc ../sql/sp_rcontext.cc
+ ../sql/sql_acl.cc ../sql/sql_analyse.cc ../sql/sql_base.cc
+ ../sql/sql_cache.cc ../sql/sql_class.cc ../sql/sql_crypt.cc
+ ../sql/sql_cursor.cc ../sql/sql_db.cc ../sql/sql_delete.cc
+ ../sql/sql_derived.cc ../sql/sql_do.cc ../sql/sql_error.cc
+ ../sql/sql_handler.cc ../sql/sql_help.cc ../sql/sql_insert.cc
+ ../sql/sql_lex.cc ../sql/sql_list.cc ../sql/sql_load.cc
+ ../sql/sql_manager.cc ../sql/sql_map.cc ../sql/sql_parse.cc
+ ../sql/sql_partition.cc ../sql/sql_plugin.cc ../sql/sql_prepare.cc
+ ../sql/sql_rename.cc ../sql/sql_repl.cc ../sql/sql_select.cc
+ ../sql/sql_show.cc ../sql/sql_state.c ../sql/sql_string.cc
+ ../sql/sql_tablespace.cc ../sql/sql_table.cc ../sql/sql_test.cc
+ ../sql/sql_trigger.cc ../sql/sql_udf.cc ../sql/sql_union.cc
+ ../sql/sql_update.cc ../sql/sql_view.cc ../sql/sql_yacc.cc
+ ../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc
+ ../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc
+ ../sql/partition_info.cc ../vio/vio.c
+ ../vio/viosocket.c ../vio/viossl.c ../vio/viosslfactories.c)
+
+# Seems we cannot make a library without at least one source file. So use a
+# dummy empty file
+FILE(WRITE cmake_dummy.c " ")
+
+ADD_LIBRARY(mysqlserver cmake_dummy.c)
+TARGET_LINK_LIBRARIES(mysqlserver wsock32)
+ADD_DEPENDENCIES(mysqlserver dbug mysys strings zlib mysqldemb regex myisam myisammrg
+ heap yassl taocrypt)
+IF(WITH_ARCHIVE_STORAGE_ENGINE)
+ ADD_DEPENDENCIES(mysqlserver archive)
+ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
+IF(WITH_EXAMPLE_STORAGE_ENGINE)
+ ADD_DEPENDENCIES(mysqlserver example)
+ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
+IF(WITH_INNOBASE_STORAGE_ENGINE)
+ ADD_DEPENDENCIES(mysqlserver innobase)
+ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
+IF(WITH_BERKELEY_STORAGE_ENGINE)
+ ADD_DEPENDENCIES(mysqlserver bdb)
+ENDIF(WITH_BERKELEY_STORAGE_ENGINE)
+
+ADD_LIBRARY(libmysqld MODULE cmake_dummy.c libmysqld.def)
+TARGET_LINK_LIBRARIES(libmysqld wsock32)
+ADD_DEPENDENCIES(libmysqld mysqlserver)
diff --git a/libmysqld/examples/cmakelists.txt b/libmysqld/examples/cmakelists.txt
new file mode 100644
index 00000000000..5c58264a7e7
--- /dev/null
+++ b/libmysqld/examples/cmakelists.txt
@@ -0,0 +1,11 @@
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
+ ${CMAKE_SOURCE_DIR}/libmysqld/include
+ ${CMAKE_SOURCE_DIR}/extra/yassl/include)
+
+# Currently does not work with DBUG, there are missing symbols reported.
+ADD_DEFINITIONS(-DDBUG_OFF)
+ADD_EXECUTABLE(test_libmysqld ../../client/completion_hash.cc
+ ../../client/mysql.cc ../../client/readline.cc
+ ../../client/sql_string.cc)
+TARGET_LINK_LIBRARIES(test_libmysqld yassl taocrypt zlib wsock32)
+ADD_DEPENDENCIES(test_libmysqld libmysqld)
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 6c520797d4f..70022d526a5 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -28,7 +28,7 @@ extern "C"
extern unsigned long max_allowed_packet, net_buffer_length;
}
-#if defined (__WIN__)
+#if defined(__WIN__) && !defined(USING_CMAKE)
#include "../sql/mysqld.cpp"
#else
#include "../sql/mysqld.cc"
diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def
index 93456901a7d..8b930c1ba1e 100644
--- a/libmysqld/libmysqld.def
+++ b/libmysqld/libmysqld.def
@@ -18,6 +18,7 @@ EXPORTS
list_delete
load_defaults
max_allowed_packet
+ my_cgets
my_end
my_getopt_print_errors
my_init
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index 9ae5622a164..067435f0189 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -22,12 +22,14 @@ DIST_SUBDIRS=ndb
benchdir_root= $(prefix)
testdir = $(benchdir_root)/mysql-test
-EXTRA_SCRIPTS = mysql-test-run.sh mysql-test-run.pl install_test_db.sh valgrind.supp
+EXTRA_SCRIPTS = mysql-test-run.sh install_test_db.sh valgrind.supp $(PRESCRIPTS)
EXTRA_DIST = $(EXTRA_SCRIPTS)
-test_SCRIPTS = mysql-test-run install_test_db
+GENSCRIPTS = mysql-test-run install_test_db
+PRESCRIPTS = mysql-test-run.pl
+test_SCRIPTS = $(GENSCRIPTS) $(PRESCRIPTS)
test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem \
std_data/server-cert.pem std_data/server-key.pem
-CLEANFILES = $(test_SCRIPTS) $(test_DATA)
+CLEANFILES = $(GENSCRIPTS) $(test_DATA)
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I..
EXTRA_PROGRAMS = mysql_test_run_new
diff --git a/mysql-test/extra/rpl_tests/rpl_partition.test b/mysql-test/extra/rpl_tests/rpl_partition.test
new file mode 100644
index 00000000000..8f2956bf1ef
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_partition.test
@@ -0,0 +1,262 @@
+############################################################
+# Author: MATZ #
+# Date: 2006-03-22 #
+# Purpose: See if replication of partition tables work #
+############################################################
+
+connection master;
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_query_log
+
+--echo --- Start test 2 partition RANGE testing --
+
+# Create table that is partitioned by range on year i.e. year(t) and
+# replicate basice operations such at insert, update delete between 2
+# different storage engines Alter table and ensure table is handled
+# Correctly on the slave
+# Note that the storage engine should not be explicit: the default
+# storage engine is used on master and slave.
+
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+ bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+ f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+ y YEAR, t DATE)
+ PARTITION BY RANGE (YEAR(t))
+ (PARTITION p0 VALUES LESS THAN (1901),
+ PARTITION p1 VALUES LESS THAN (1946),
+ PARTITION p2 VALUES LESS THAN (1966),
+ PARTITION p3 VALUES LESS THAN (1986),
+ PARTITION p4 VALUES LESS THAN (2005),
+ PARTITION p5 VALUES LESS THAN MAXVALUE);
+
+--echo --- On master ---
+SHOW CREATE TABLE t1;
+
+--echo --- On slave --
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 MODIFY vc TEXT;
+
+--echo --- On master ---
+SHOW CREATE TABLE t1;
+
+--echo --- On slave ---
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+--enable_query_log
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- End test 2 partition RANGE testing ---
+
+DROP TABLE IF EXISTS t1;
+
+########################################################
+
+--echo --- Start test 3 partition LIST testing ---
+--echo --- Do setup ---
+#################################################
+# Requirment: Create table that is partitioned #
+# by list on id i.e. (2,4). Pretend that we #
+# missed one and alter to add. Then replicate #
+# basice operations such at insert, update #
+# delete between 2 different storage engines #
+# Alter table and ensure table is handled #
+# Correctly on the slave #
+#################################################
+
+
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+ bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+ f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+ y YEAR, t DATE)
+ PARTITION BY LIST(id)
+ (PARTITION p0 VALUES IN (2, 4),
+ PARTITION p1 VALUES IN (42, 142));
+
+--echo --- Test 3 Alter to add partition ---
+
+ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412));
+
+--echo --- Show table on master ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Show table on slave ---
+
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- Check that simple Alter statements are replicated correctly ---
+
+ALTER TABLE t1 MODIFY vc TEXT;
+
+--echo --- Show the new improved table on the master ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Make sure that our tables on slave are still same engine ---
+--echo --- and that the alter statements replicated correctly ---
+
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- End test 3 partition LIST testing ---
+--echo --- Do Cleanup --
+
+DROP TABLE IF EXISTS t1;
+
+########################################################
+
+--echo --- Start test 4 partition HASH testing ---
+--echo --- Do setup ---
+#################################################
+# Requirment: Create table that is partitioned #
+# by hash on year i.e. YEAR(t). Then replicate #
+# basice operations such at insert, update #
+# delete between 2 different storage engines #
+# Alter table and ensure table is handled #
+# Correctly on the slave #
+#################################################
+
+
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+ bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+ f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+ y YEAR, t DATE)
+ PARTITION BY HASH( YEAR(t) )
+ PARTITIONS 4;
+
+--echo --- show that tables have been created correctly ---
+
+SHOW CREATE TABLE t1;
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- Check that simple Alter statements are replicated correctly ---
+
+ALTER TABLE t1 MODIFY vc TEXT;
+
+--echo --- Show the new improved table on the master ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Make sure that our tables on slave are still same engine ---
+--echo --- and that the alter statements replicated correctly ---
+
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- End test 4 partition HASH testing ---
+--echo --- Do Cleanup --
+
+DROP TABLE IF EXISTS t1;
+
+########################################################
+
+--echo --- Start test 5 partition by key testing ---
+--echo --- Create Table Section ---
+
+#################################################
+# Requirment: Create table that is partitioned #
+# by key on id with 4 parts. Then replicate #
+# basice operations such at insert, update #
+# delete between 2 different storage engines #
+# Alter table and ensure table is handled #
+# Correctly on the slave #
+#################################################
+
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+ bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+ f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+ y YEAR, t DATE,PRIMARY KEY(id))
+ PARTITION BY KEY()
+ PARTITIONS 4;
+
+--echo --- Show that tables on master are ndbcluster tables ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Show that tables on slave ---
+
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+
+--source include/rpl_multi_engine3.inc
+
+# Okay lets see how it holds up to table changes
+--echo --- Check that simple Alter statements are replicated correctly ---
+
+ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
+
+--echo --- Show the new improved table on the master ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Make sure that our tables on slave are still right type ---
+--echo --- and that the alter statements replicated correctly ---
+
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- Check that simple Alter statements are replicated correctly ---
+
+ALTER TABLE t1 MODIFY vc TEXT;
+
+--echo --- Show the new improved table on the master ---
+
+SHOW CREATE TABLE t1;
+
+--echo --- Make sure that our tables on slave are still same engine ---
+--echo --- and that the alter statements replicated correctly ---
+
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--echo --- Perform basic operation on master ---
+--echo --- and ensure replicated correctly ---
+
+--source include/rpl_multi_engine3.inc
+
+--echo --- End test 5 key partition testing ---
+--echo --- Do Cleanup ---
+
+DROP TABLE IF EXISTS t1;
+
+# End of 5.1 test case
diff --git a/mysql-test/lib/init_db.sql b/mysql-test/lib/init_db.sql
index 79a7c528370..a7079b0ac33 100644
--- a/mysql-test/lib/init_db.sql
+++ b/mysql-test/lib/init_db.sql
@@ -579,7 +579,7 @@ DROP PROCEDURE create_log_tables;
CREATE TABLE event (
db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
- name 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,
diff --git a/mysql-test/lib/mtr_stress.pl b/mysql-test/lib/mtr_stress.pl
index 77c3d8bb030..92bb220461b 100644
--- a/mysql-test/lib/mtr_stress.pl
+++ b/mysql-test/lib/mtr_stress.pl
@@ -21,7 +21,6 @@ sub run_stress_test ()
{
my $args;
- my $stress_basedir;
my $stress_suitedir;
mtr_report("Starting stress testing\n");
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 281c86cdb6e..c2e2ed8bf98 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -166,7 +166,6 @@ our $path_my_basedir;
our $opt_vardir; # A path but set directly on cmd line
our $opt_vardir_trace; # unix formatted opt_vardir for trace files
our $opt_tmpdir; # A path but set directly on cmd line
-our $opt_restart_cleanup; # Source a file with SQL drop statements
our $opt_usage;
our $opt_suite;
@@ -200,7 +199,6 @@ our $opt_big_test= 0; # Send --big-test to mysqltest
our @opt_extra_mysqld_opt;
-our $opt_comment;
our $opt_compress;
our $opt_ssl;
our $opt_skip_ssl;
@@ -549,6 +547,10 @@ sub command_line_setup () {
# 5.1 test run, even if different MTR_BUILD_THREAD is used. This means
# all port numbers might not be used in this version of the script.
#
+ # Also note the limiteation of ports we are allowed to hand out. This
+ # differs between operating systems and configuration, see
+ # http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html
+ # But a fairly safe range seems to be 5001 - 32767
if ( $ENV{'MTR_BUILD_THREAD'} )
{
# Up to two masters, up to three slaves
@@ -561,6 +563,13 @@ sub command_line_setup () {
$im_mysqld2_port= $opt_master_myport + 9;
}
+ if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
+ {
+ mtr_error("MTR_BUILD_THREAD number results in a port",
+ "outside 5001 - 32767",
+ "($opt_master_myport - $opt_master_myport + 10)");
+ }
+
# Read the command line
# Note: Keep list, and the order, in sync with usage at end of this file
@@ -590,16 +599,18 @@ sub command_line_setup () {
'with-ndbcluster-only' => \$opt_with_ndbcluster_only,
'ndb-extra-test' => \$opt_ndb_extra_test,
'do-test=s' => \$opt_do_test,
+ 'start-from=s' => \$opt_start_from,
'suite=s' => \$opt_suite,
'skip-rpl' => \$opt_skip_rpl,
'skip-im' => \$opt_skip_im,
'skip-test=s' => \$opt_skip_test,
+ 'big-test' => \$opt_big_test,
# Specify ports
'master_port=i' => \$opt_master_myport,
'slave_port=i' => \$opt_slave_myport,
- 'ndbcluster_port=i' => \$opt_ndbcluster_port,
- 'ndbcluster_port_slave=i' => \$opt_ndbcluster_port_slave,
+ 'ndbcluster-port=i' => \$opt_ndbcluster_port,
+ 'ndbcluster-port-slave=i' => \$opt_ndbcluster_port_slave,
'manager-port=i' => \$opt_manager_port, # Currently not used
'im-port=i' => \$im_port, # Instance Manager port.
'im-mysqld1-port=i' => \$im_mysqld1_port, # Port of mysqld, controlled by IM
@@ -609,13 +620,13 @@ sub command_line_setup () {
'record' => \$opt_record,
'check-testcases' => \$opt_check_testcases,
- # ???
+ # Extra options used when starting mysqld
'mysqld=s' => \@opt_extra_mysqld_opt,
# Run test on running server
'extern' => \$opt_extern,
- 'ndbconnectstring=s' => \$opt_ndbconnectstring,
- 'ndbconnectstring-slave=s' => \$opt_ndbconnectstring_slave,
+ 'ndb-connectstring=s' => \$opt_ndbconnectstring,
+ 'ndb-connectstring-slave=s' => \$opt_ndbconnectstring_slave,
# Debugging
'gdb' => \$opt_gdb,
@@ -656,7 +667,6 @@ sub command_line_setup () {
'vardir=s' => \$opt_vardir,
# Misc
- 'big-test' => \$opt_big_test,
'comment=s' => \$opt_comment,
'debug' => \$opt_debug,
'fast' => \$opt_fast,
@@ -665,13 +675,11 @@ sub command_line_setup () {
'netware' => \$opt_netware,
'old-master' => \$opt_old_master,
'reorder' => \$opt_reorder,
- 'restart-cleanup' => \$opt_restart_cleanup,
'script-debug' => \$opt_script_debug,
'sleep=i' => \$opt_sleep,
'socket=s' => \$opt_socket,
'start-dirty' => \$opt_start_dirty,
'start-and-exit' => \$opt_start_and_exit,
- 'start-from=s' => \$opt_start_from,
'timer' => \$opt_timer,
'unified-diff|udiff' => \$opt_udiff,
'user-test=s' => \$opt_user_test,
@@ -694,14 +702,6 @@ sub command_line_setup () {
print '#' x 78, "\n\n";
}
- if ( $opt_comment )
- {
- print "\n";
- print '#' x 78, "\n";
- print "# $opt_comment\n";
- print '#' x 78, "\n\n";
- }
-
foreach my $arg ( @ARGV )
{
if ( $arg =~ /^--skip-/ )
@@ -1068,6 +1068,8 @@ sub executable_setup () {
$exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest");
$exe_mysql_client_test=
mtr_exe_exists("$glob_basedir/tests/mysql_client_test",
+ "$glob_basedir/tests/release/mysql_client_test",
+ "$glob_basedir/tests/debug/mysql_client_test",
"$path_client_bindir/mysql_client_test",
"/usr/bin/false");
}
@@ -1079,7 +1081,8 @@ sub executable_setup () {
$exe_mysqladmin= mtr_exe_exists("$path_client_bindir/mysqladmin");
$exe_mysql= mtr_exe_exists("$path_client_bindir/mysql");
$exe_mysql_fix_system_tables=
- mtr_script_exists("$glob_basedir/scripts/mysql_fix_privilege_tables");
+ mtr_script_exists("$glob_basedir/scripts/mysql_fix_privilege_tables",
+ "/usr/bin/false");
$path_ndb_tools_dir= mtr_path_exists("$glob_basedir/storage/ndb/tools");
$exe_ndb_mgm= "$glob_basedir/storage/ndb/src/mgmclient/ndb_mgm";
}
@@ -1095,7 +1098,8 @@ sub executable_setup () {
$exe_mysql= mtr_exe_exists("$path_client_bindir/mysql");
$exe_mysql_fix_system_tables=
mtr_script_exists("$path_client_bindir/mysql_fix_privilege_tables",
- "$glob_basedir/scripts/mysql_fix_privilege_tables");
+ "$glob_basedir/scripts/mysql_fix_privilege_tables",
+ "/usr/bin/false");
$exe_my_print_defaults=
mtr_exe_exists("$path_client_bindir/my_print_defaults");
@@ -1131,6 +1135,8 @@ sub executable_setup () {
$exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest");
$exe_mysql_client_test=
mtr_exe_exists("$path_client_bindir/mysql_client_test",
+ "$glob_basedir/tests/release/mysql_client_test",
+ "$glob_basedir/tests/debug/mysql_client_test",
"/usr/bin/false"); # FIXME temporary
}
@@ -3263,12 +3269,6 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "--sleep=%d", $opt_sleep);
}
- if ( $opt_restart_cleanup and $glob_mysqld_restart )
- {
- mtr_add_arg($args, "--include=%s", "include/drop-on-restart.inc");
- $glob_mysqld_restart= 0;
- }
-
if ( $opt_debug )
{
mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace", $opt_vardir_trace);
@@ -3604,12 +3604,15 @@ Options to control what test suites or cases to run
skip-rpl Skip the replication test cases.
skip-im Don't start IM, and skip the IM test cases
skip-test=PREFIX Skip test cases which name are prefixed with PREFIX
+ big-test Pass "--big-test" to mysqltest which will set the environment
+ variable BIG_TEST, which can be checked from test cases.
Options that specify ports
master_port=PORT Specify the port number used by the first master
slave_port=PORT Specify the port number used by the first slave
- ndbcluster_port=PORT Specify the port number used by cluster
+ ndbcluster-port=PORT Specify the port number used by cluster
+ ndbcluster-port-slave=PORT Specify the port number used by slave cluster
Options for test case authoring
@@ -3665,16 +3668,14 @@ Misc options
help Get this help text
unified-diff | udiff When presenting differences, use unified diff
- testcase-timeout=MINUTES Max test case run time (default 5)
- suite-timeout=MINUTES Max test suite run time (default 120)
+ testcase-timeout=MINUTES Max test case run time (default $default_testcase_timeout)
+ suite-timeout=MINUTES Max test suite run time (default $default_suite_timeout)
Deprecated options
with-openssl Deprecated option for ssl
Options not yet described, or that I want to look into more
-
- big-test
debug
local
local-master
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index 41a9a206306..4485d8ca073 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -1088,7 +1088,7 @@ report_stats () {
found_error=0
# Find errors
- for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning"
+ for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning" "missing DBUG_RETURN"
do
if $GREP "$i" $MY_LOG_DIR/warnings.tmp >> $MY_LOG_DIR/warnings
then
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index 6d184da10e6..3478353b0ec 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -337,6 +337,17 @@ Warning 1105 Cast to signed converted positive out-of-range integer to it's nega
select cast(1.0e+300 as signed int);
cast(1.0e+300 as signed int)
9223372036854775807
+CREATE TABLE t1 (f1 double);
+INSERT INTO t1 SET f1 = -1.0e+30 ;
+INSERT INTO t1 SET f1 = +1.0e+30 ;
+SELECT f1 AS double_val, CAST(f1 AS SIGNED INT) AS cast_val FROM t1;
+double_val cast_val
+-1e+30 -9223372036854775808
+1e+30 9223372036854775807
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '-1e+30'
+Warning 1292 Truncated incorrect INTEGER value: '1e+30'
+DROP TABLE t1;
select cast('1.2' as decimal(3,2));
cast('1.2' as decimal(3,2))
1.20
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index edc0ec0d01e..d45960cf787 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -751,6 +751,8 @@ t2 CREATE TABLE `t2` (
`a2` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
+create table t1(a set("a,b","c,d") not null);
+ERROR 22007: Illegal set 'a,b' value found during parsing
create table t1 (i int) engine=myisam max_rows=100000000000;
show create table t1;
Table Create Table
diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result
index 9e63b82c29d..70eaac2eb4e 100644
--- a/mysql-test/r/csv.result
+++ b/mysql-test/r/csv.result
@@ -4993,6 +4993,99 @@ val
2
UNLOCK TABLES;
DROP TABLE test_concurrent_insert;
+CREATE TABLE test_repair_table ( val integer ) ENGINE = CSV;
+CHECK TABLE test_repair_table;
+Table Op Msg_type Msg_text
+test.test_repair_table check status OK
+REPAIR TABLE test_repair_table;
+Table Op Msg_type Msg_text
+test.test_repair_table repair status OK
+DROP TABLE test_repair_table;
+CREATE TABLE test_repair_table2 ( val integer ) ENGINE = CSV;
+SELECT * from test_repair_table2;
+val
+Warnings:
+Error 1194 Table 'test_repair_table2' is marked as crashed and should be repaired
+SELECT * from test_repair_table2;
+val
+test_repair_table2.CSM
+CHECK TABLE test_repair_table2;
+Table Op Msg_type Msg_text
+test.test_repair_table2 check status OK
+DROP TABLE test_repair_table2;
+CREATE TABLE test_repair_table3 ( val integer ) ENGINE = CSV;
+CHECK TABLE test_repair_table3;
+Table Op Msg_type Msg_text
+test.test_repair_table3 check error Corrupt
+REPAIR TABLE test_repair_table3;
+Table Op Msg_type Msg_text
+test.test_repair_table3 repair status OK
+SELECT * FROM test_repair_table3;
+val
+1
+4
+DROP TABLE test_repair_table3;
+CREATE TABLE test_repair_table4 (
+num int not null,
+magic_no int(4) unsigned zerofill DEFAULT '0000' NOT NULL,
+company_name char(30) DEFAULT '' NOT NULL,
+founded char(4) DEFAULT '' NOT NULL
+) ENGINE = CSV;
+SELECT * FROM test_repair_table4;
+num magic_no company_name founded
+Warnings:
+Error 1194 Table 'test_repair_table4' is marked as crashed and should be repaired
+SELECT * FROM test_repair_table4;
+num magic_no company_name founded
+CHECK TABLE test_repair_table4;
+Table Op Msg_type Msg_text
+test.test_repair_table4 check status OK
+INSERT INTO test_repair_table4 VALUES (2,101,'SAP','1972');
+INSERT INTO test_repair_table4 VALUES (1,101,'Microsoft','1978');
+INSERT INTO test_repair_table4 VALUES (2,101,'MySQL','1995');
+SELECT * FROM test_repair_table4;
+num magic_no company_name founded
+2 0101 SAP 1972
+1 0101 Microsoft 1978
+2 0101 MySQL 1995
+CHECK TABLE test_repair_table4;
+Table Op Msg_type Msg_text
+test.test_repair_table4 check status OK
+REPAIR TABLE test_repair_table4;
+Table Op Msg_type Msg_text
+test.test_repair_table4 repair status OK
+SELECT * FROM test_repair_table4;
+num magic_no company_name founded
+2 0101 SAP 1972
+1 0101 Microsoft 1978
+2 0101 MySQL 1995
+CHECK TABLE test_repair_table4;
+Table Op Msg_type Msg_text
+test.test_repair_table4 check status OK
+REPAIR TABLE test_repair_table4;
+Table Op Msg_type Msg_text
+test.test_repair_table4 repair status OK
+SELECT * FROM test_repair_table4;
+num magic_no company_name founded
+2 0101 SAP 1972
+1 0101 Microsoft 1978
+2 0101 MySQL 1995
+DROP TABLE test_repair_table4;
+CREATE TABLE test_repair_table5 (
+num int not null,
+magic_no int(4) unsigned zerofill DEFAULT '0000' NOT NULL,
+company_name char(30) DEFAULT '' NOT NULL,
+founded char(4) DEFAULT '' NOT NULL
+) ENGINE = CSV;
+CHECK TABLE test_repair_table5;
+Table Op Msg_type Msg_text
+test.test_repair_table5 check error Corrupt
+REPAIR TABLE test_repair_table5;
+Table Op Msg_type Msg_text
+test.test_repair_table5 repair status OK
+SELECT * FROM test_repair_table5;
+num magic_no company_name founded
+DROP TABLE test_repair_table5;
create table t1 (a int) engine=csv;
insert t1 values (1);
delete from t1;
diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result
index cf4bf6e2fdd..f8e07e1eb6f 100644
--- a/mysql-test/r/ctype_latin1.result
+++ b/mysql-test/r/ctype_latin1.result
@@ -369,3 +369,25 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
SELECT '„a' as str;
str
„a
+set @str= _latin1 'ABC €°§ß²³µ~ äöüÄÖÜ áéíóú ÀÈÌÒÙ @ abc';
+SELECT convert(@str collate latin1_bin using utf8);
+convert(@str collate latin1_bin using utf8)
+ABC €°§ß²³µ~ äöüÄÖÜ áéíóú ÀÈÌÒÙ @ abc
+SELECT convert(@str collate latin1_general_ci using utf8);
+convert(@str collate latin1_general_ci using utf8)
+ABC €°§ß²³µ~ äöüÄÖÜ áéíóú ÀÈÌÒÙ @ abc
+SELECT convert(@str collate latin1_german1_ci using utf8);
+convert(@str collate latin1_german1_ci using utf8)
+ABC €°§ß²³µ~ äöüÄÖÜ áéíóú ÀÈÌÒÙ @ abc
+SELECT convert(@str collate latin1_danish_ci using utf8);
+convert(@str collate latin1_danish_ci using utf8)
+ABC €°§ß²³µ~ äöüÄÖÜ áéíóú ÀÈÌÒÙ @ abc
+SELECT convert(@str collate latin1_spanish_ci using utf8);
+convert(@str collate latin1_spanish_ci using utf8)
+ABC €°§ß²³µ~ äöüÄÖÜ áéíóú ÀÈÌÒÙ @ abc
+SELECT convert(@str collate latin1_german2_ci using utf8);
+convert(@str collate latin1_german2_ci using utf8)
+ABC €°§ß²³µ~ äöüÄÖÜ áéíóú ÀÈÌÒÙ @ abc
+SELECT convert(@str collate latin1_swedish_ci using utf8);
+convert(@str collate latin1_swedish_ci using utf8)
+ABC €°§ß²³µ~ äöüÄÖÜ áéíóú ÀÈÌÒÙ @ abc
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index fe4dc9f1a66..44f6945238c 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -1066,6 +1066,52 @@ LENGTH(bug)
100
DROP TABLE t2;
DROP TABLE t1;
+SET NAMES utf8;
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1(a VARCHAR(255), KEY(a)) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
+INSERT INTO t1 VALUES('uu');
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+INSERT INTO t1 VALUES('uU');
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+INSERT INTO t1 VALUES('uu');
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+INSERT INTO t1 VALUES('uuABC');
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+INSERT INTO t1 VALUES('UuABC');
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+INSERT INTO t1 VALUES('uuABC');
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+alter table t1 add b int;
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',1);
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb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b',4);
+delete from t1 where b=3;
+INSERT INTO t1 VALUES('uUABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',3);
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa');
SELECT id FROM t1;
diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result
index 3da724448bf..06c846da781 100644
--- a/mysql-test/r/events.result
+++ b/mysql-test/r/events.result
@@ -237,7 +237,7 @@ SHOW CREATE TABLE mysql.event;
Table Create Table
event CREATE TABLE `event` (
`db` char(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
- `name` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
+ `name` char(64) NOT NULL DEFAULT '',
`body` longblob NOT NULL,
`definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`execute_at` datetime DEFAULT NULL,
@@ -260,10 +260,8 @@ ALTER TABLE mysql.event MODIFY db char(64) character set utf8 collate utf8_bin d
"This should work"
SHOW EVENTS;
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
-events_test intact_check root@localhost RECURRING NULL 10 HOUR # # ENABLED
+events_test intact_check root@localhost RECURRING NULL 10 HOUR # # ENABLED
ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default '';
-Warnings:
-Warning 1265 Data truncated for column 'db' at row 1
SELECT event_name FROM INFORMATION_SCHEMA.EVENTS;
ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error log.
ALTER TABLE mysql.event MODIFY db varchar(64) character set utf8 collate utf8_bin default '';
@@ -389,10 +387,9 @@ create event закачка on schedule every 10 hour do select get_lock("test_l
select definer, name, db from mysql.event;
definer name db
root@localhost закачка events_test
-"Should be only 1 process"
-show processlist;
-Id User Host db Command Time State Info
-# root localhost events_test Query # NULL show processlist
+"Should be 0 processes"
+select /*1*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
+user host db command state info
select release_lock("test_lock1");
release_lock("test_lock1")
1
@@ -409,12 +406,11 @@ get_lock("test_lock2", 20)
"Create an event which tries to acquire a mutex. The event locks on the mutex"
create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20);
"Let some time pass to the event starts"
-"Should have only 3 processes: the scheduler, our conn and the locked event"
-show processlist;
-Id User Host db Command Time State Info
-# root localhost events_test Query # NULL show processlist
-# event_scheduler localhost NULL Connect # Sleeping NULL
-# root localhost events_test Connect # User lock select get_lock("test_lock2", 20)
+"Should have only 2 processes: the scheduler and the locked event"
+select /*1*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
+user host db command state info
+event_scheduler localhost NULL Connect Sleeping NULL
+root localhost events_test Connect User lock select get_lock("test_lock2", 20)
"Release the mutex, the event worker should finish."
select release_lock("test_lock2");
release_lock("test_lock2")
@@ -425,23 +421,21 @@ select get_lock("test_lock2_1", 20);
get_lock("test_lock2_1", 20)
1
create event закачка21 on schedule every 10 hour do select get_lock("test_lock2_1", 20);
-"Should see 2 processes, one locked on get_lock("
+"Should see 1 process, locked on get_lock("
"Shutting down the scheduler, it should wait for the running event"
set global event_scheduler=0;
-"Should have only 3 processes: the scheduler, our conn and the locked event"
-show processlist;
-Id User Host db Command Time State Info
-# root localhost events_test Query # NULL show processlist
-# event_scheduler localhost NULL Connect # Sleeping NULL
-# root localhost events_test Connect # User lock select get_lock("test_lock2_1", 20)
+"Should have only 2 processes: the scheduler and the locked event"
+select /*4*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
+user host db command state info
+event_scheduler localhost NULL Connect Sleeping NULL
+root localhost events_test Connect User lock select get_lock("test_lock2_1", 20)
"Release the lock so the child process should finish. Hence the scheduler also"
select release_lock("test_lock2_1");
release_lock("test_lock2_1")
1
-"Should have only our process now:"
-show processlist;
-Id User Host db Command Time State Info
-# root localhost events_test Query # NULL show processlist
+"Should see 0 processes now:"
+select /*5*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
+user host db command state info
drop event закачка21;
create table t_16 (s1 int);
create trigger t_16_bi before insert on t_16 for each row create event e_16 on schedule every 1 second do set @a=5;
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index 53f7cdfd0ee..ef1ccfadecb 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -1,5 +1,20 @@
create database if not exists events_test;
use events_test;
+CREATE EVENT lower_case ON SCHEDULE EVERY 1 MINUTE DO SELECT 1;
+CREATE EVENT Lower_case ON SCHEDULE EVERY 2 MINUTE DO SELECT 2;
+ERROR HY000: Event 'Lower_case' already exists
+DROP EVENT Lower_case;
+SET NAMES cp1251;
+CREATE EVENT äîëåí_ðåãèñòúð_1251 ON SCHEDULE EVERY 1 YEAR DO SELECT 100;
+CREATE EVENT ÄîËåÍ_ðåãèñòúð_1251 ON SCHEDULE EVERY 2 YEAR DO SELECT 200;
+ERROR HY000: Event 'ДоЛеÐ_региÑтър_1251' already exists
+DROP EVENT ÄîËåÍ_ðåãèñòúð_1251;
+SET NAMES utf8;
+CREATE EVENT долен_региÑтър_утф8 ON SCHEDULE EVERY 3 YEAR DO SELECT 300;
+CREATE EVENT ДОЛЕÐ_региÑтър_утф8 ON SCHEDULE EVERY 4 YEAR DO SELECT 400;
+ERROR HY000: Event 'ДОЛЕÐ_региÑтър_утф8' already exists
+DROP EVENT ДОЛЕÐ_региÑтър_утф8;
+SET NAMES latin1;
set @a=3;
CREATE PROCEDURE p_16 () CREATE EVENT e_16 ON SCHEDULE EVERY @a SECOND DO SET @a=5;
call p_16();
@@ -35,11 +50,10 @@ select get_lock('test_bug16407', 60);
drop table "hashed_num";
end|
"Now if everything is fine the event has compiled and is locked
-show processlist;
-Id User Host db Command Time State Info
-# root localhost events_test Query # NULL show processlist
-# event_scheduler localhost NULL Connect # Sleeping NULL
-# root localhost events_test Connect # User lock select get_lock('test_bug16407', 60)
+select /*1*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
+user host db command state info
+event_scheduler localhost NULL Connect Sleeping NULL
+root localhost events_test Connect User lock select get_lock('test_bug16407', 60)
select release_lock('test_bug16407');
release_lock('test_bug16407')
1
@@ -60,7 +74,7 @@ create table events_smode_test(ev_name char(10), a date) engine=myisam;
"This should never insert something"
create event ee_16407_2 on schedule every 60 second do
begin
-select get_lock('ee_16407_2', 60);
+select get_lock('ee_16407_2', 60) /*ee_16407_2*/;
insert into events_test.events_smode_test values('ee_16407_2','1980-19-02');
end|
insert into events_smode_test values ('test','1980-19-02')|
@@ -68,7 +82,7 @@ ERROR 22007: Incorrect date value: '1980-19-02' for column 'a' at row 1
"This is ok"
create event ee_16407_3 on schedule every 60 second do
begin
-select get_lock('ee_16407_2', 60);
+select get_lock('ee_16407_2', 60) /*ee_16407_3*/;
insert into events_test.events_smode_test values ('ee_16407_3','1980-02-19');
insert into events_test.events_smode_test values ('ee_16407_3','1980-02-29');
end|
@@ -76,7 +90,7 @@ set sql_mode=""|
"This will insert rows but they will be truncated"
create event ee_16407_4 on schedule every 60 second do
begin
-select get_lock('ee_16407_2', 60);
+select get_lock('ee_16407_2', 60) /*ee_16407_4*/;
insert into events_test.events_smode_test values ('ee_16407_4','10-11-1956');
end|
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
@@ -89,20 +103,18 @@ select get_lock('ee_16407_2', 60);
get_lock('ee_16407_2', 60)
1
set global event_scheduler= 1;
-show processlist;
-Id User Host db Command Time State Info
-# root localhost events_test Query # NULL show processlist
-# event_scheduler localhost NULL Connect # Sleeping NULL
-# root localhost events_test Connect # User lock select get_lock('ee_16407_2', 60)
-# root localhost events_test Connect # User lock select get_lock('ee_16407_2', 60)
-# root localhost events_test Connect # User lock select get_lock('ee_16407_2', 60)
+select /*2*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
+user host db command state info
+event_scheduler localhost NULL Connect Sleeping NULL
+root localhost events_test Connect User lock select get_lock('ee_16407_2', 60) /*ee_16407_2*/
+root localhost events_test Connect User lock select get_lock('ee_16407_2', 60) /*ee_16407_3*/
+root localhost events_test Connect User lock select get_lock('ee_16407_2', 60) /*ee_16407_4*/
select release_lock('ee_16407_2');
release_lock('ee_16407_2')
1
-show processlist;
-Id User Host db Command Time State Info
-# root localhost events_test Query # NULL show processlist
-# event_scheduler localhost NULL Connect # Sleeping NULL
+select /*3*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
+user host db command state info
+event_scheduler localhost NULL Connect Sleeping NULL
set global event_scheduler= 0;
select * from events_smode_test order by ev_name, a;
ev_name a
@@ -125,12 +137,12 @@ create procedure ee_16407_5_pendant() begin insert into events_test.events_smode
create procedure ee_16407_6_pendant() begin insert into events_test.events_smode_test values('ee_16407_6','2004-02-29'); end|
create event ee_16407_5 on schedule every 60 second do
begin
-select get_lock('ee_16407_5', 60);
+select get_lock('ee_16407_5', 60) /*ee_16407_5*/;
call events_test.ee_16407_5_pendant();
end|
create event ee_16407_6 on schedule every 60 second do
begin
-select get_lock('ee_16407_5', 60);
+select get_lock('ee_16407_5', 60) /*ee_16407_6*/;
call events_test.ee_16407_6_pendant();
end|
set sql_mode='ansi';
@@ -138,19 +150,19 @@ select get_lock('ee_16407_5', 60);
get_lock('ee_16407_5', 60)
1
set global event_scheduler= 1;
-show processlist;
-Id User Host db Command Time State Info
-# root localhost events_test Query # NULL show processlist
-# event_scheduler localhost NULL Connect # Sleeping NULL
-# root localhost events_test Connect # User lock select get_lock('ee_16407_5', 60)
-# root localhost events_test Connect # User lock select get_lock('ee_16407_5', 60)
+"Should have 2 locked processes"
+select /*4*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
+user host db command state info
+event_scheduler localhost NULL Connect Sleeping NULL
+root localhost events_test Connect User lock select get_lock('ee_16407_5', 60) /*ee_16407_5*/
+root localhost events_test Connect User lock select get_lock('ee_16407_5', 60) /*ee_16407_6*/
select release_lock('ee_16407_5');
release_lock('ee_16407_5')
1
-show processlist;
-Id User Host db Command Time State Info
-# root localhost events_test Query # NULL show processlist
-# event_scheduler localhost NULL Connect # Sleeping NULL
+"Should have 0 processes locked"
+select /*5*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
+user host db command state info
+event_scheduler localhost NULL Connect Sleeping NULL
select * from events_smode_test order by ev_name, a;
ev_name a
ee_16407_6 2004-02-29
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 33ec9d0cfcf..b0a6d91ee40 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -596,6 +596,21 @@ GROUP_CONCAT(a ORDER BY a)
,x
,z
DROP TABLE t1;
+create table t1(f1 int);
+insert into t1 values(1),(2),(3);
+select f1, group_concat(f1+1) from t1 group by f1 with rollup;
+f1 group_concat(f1+1)
+1 2
+2 3
+3 4
+NULL 2,3,4
+select count(distinct (f1+1)) from t1 group by f1 with rollup;
+count(distinct (f1+1))
+1
+1
+1
+3
+drop table t1;
set names latin1;
create table t1 (a char, b char);
insert into t1 values ('a', 'a'), ('a', 'b'), ('b', 'a'), ('b', 'b');
diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result
index b1703c51f4e..6370f7699b3 100644
--- a/mysql-test/r/group_min_max.result
+++ b/mysql-test/r/group_min_max.result
@@ -1954,6 +1954,15 @@ id select_type table type possible_keys key key_len ref rows Extra
explain select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 163 NULL 128 Using where; Using index
+explain select distinct(a1) from t1 where ord(a2) = 98;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL idx_t1_1 163 NULL 128 Using where; Using index
+select distinct(a1) from t1 where ord(a2) = 98;
+a1
+a
+b
+c
+d
explain select a1 from t1 where a2 = 'b' group by a1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL idx_t1_1 130 NULL 5 Using where; Using index for group-by
@@ -2070,3 +2079,40 @@ SELECT a FROM t1 WHERE a LIKE 'B%' GROUP BY a;
a
BB
DROP TABLE t1;
+CREATE TABLE t1 (
+a int(11) NOT NULL DEFAULT '0',
+b varchar(16) COLLATE latin1_general_ci NOT NULL DEFAULT '',
+PRIMARY KEY (a,b)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+CREATE PROCEDURE a(x INT)
+BEGIN
+DECLARE rnd INT;
+DECLARE cnt INT;
+WHILE x > 0 DO
+SET rnd= x % 100;
+SET cnt = (SELECT COUNT(*) FROM t1 WHERE a = rnd);
+INSERT INTO t1(a,b) VALUES (rnd, CAST(cnt AS CHAR));
+SET x= x - 1;
+END WHILE;
+END|
+CALL a(1000);
+SELECT a FROM t1 WHERE a=0;
+a
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+SELECT DISTINCT a FROM t1 WHERE a=0;
+a
+0
+SELECT COUNT(DISTINCT a) FROM t1 WHERE a=0;
+COUNT(DISTINCT a)
+1
+DROP TABLE t1;
+DROP PROCEDURE a;
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result
index e54f6d7f2a4..225d5a475ff 100644
--- a/mysql-test/r/having.result
+++ b/mysql-test/r/having.result
@@ -12,7 +12,7 @@ explain extended select count(a) as b from t1 where a=0 having b >=0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
-Note 1003 select count(`test`.`t1`.`a`) AS `b` from `test`.`t1` where (`test`.`t1`.`a` = 0) having (count(`test`.`t1`.`a`) >= 0)
+Note 1003 select count(`test`.`t1`.`a`) AS `b` from `test`.`t1` where 0 having (count(`test`.`t1`.`a`) >= 0)
drop table t1;
CREATE TABLE t1 (
raw_id int(10) NOT NULL default '0',
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index e4a8226bb37..798efff3003 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -214,34 +214,34 @@ latin1 cp1252 West European latin1_swedish_ci 1
select * from information_schema.COLLATIONS
where COLLATION_NAME like 'latin1%';
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
-latin1_german1_ci latin1 5 0
-latin1_swedish_ci latin1 8 Yes Yes 1
-latin1_danish_ci latin1 15 0
-latin1_german2_ci latin1 31 Yes 2
-latin1_bin latin1 47 Yes 1
-latin1_general_ci latin1 48 0
-latin1_general_cs latin1 49 0
-latin1_spanish_ci latin1 94 0
+latin1_german1_ci latin1 5 # 1
+latin1_swedish_ci latin1 8 Yes # 1
+latin1_danish_ci latin1 15 # 1
+latin1_german2_ci latin1 31 # 2
+latin1_bin latin1 47 # 1
+latin1_general_ci latin1 48 # 1
+latin1_general_cs latin1 49 # 1
+latin1_spanish_ci latin1 94 # 1
SHOW COLLATION LIKE 'latin1%';
Collation Charset Id Default Compiled Sortlen
-latin1_german1_ci latin1 5 0
-latin1_swedish_ci latin1 8 Yes Yes 1
-latin1_danish_ci latin1 15 0
-latin1_german2_ci latin1 31 Yes 2
-latin1_bin latin1 47 Yes 1
-latin1_general_ci latin1 48 0
-latin1_general_cs latin1 49 0
-latin1_spanish_ci latin1 94 0
+latin1_german1_ci latin1 5 # 1
+latin1_swedish_ci latin1 8 Yes # 1
+latin1_danish_ci latin1 15 # 1
+latin1_german2_ci latin1 31 # 2
+latin1_bin latin1 47 # 1
+latin1_general_ci latin1 48 # 1
+latin1_general_cs latin1 49 # 1
+latin1_spanish_ci latin1 94 # 1
SHOW COLLATION WHERE collation like 'latin1%';
Collation Charset Id Default Compiled Sortlen
-latin1_german1_ci latin1 5 0
-latin1_swedish_ci latin1 8 Yes Yes 1
-latin1_danish_ci latin1 15 0
-latin1_german2_ci latin1 31 Yes 2
-latin1_bin latin1 47 Yes 1
-latin1_general_ci latin1 48 0
-latin1_general_cs latin1 49 0
-latin1_spanish_ci latin1 94 0
+latin1_german1_ci latin1 5 # 1
+latin1_swedish_ci latin1 8 Yes # 1
+latin1_danish_ci latin1 15 # 1
+latin1_german2_ci latin1 31 # 2
+latin1_bin latin1 47 # 1
+latin1_general_ci latin1 48 # 1
+latin1_general_cs latin1 49 # 1
+latin1_spanish_ci latin1 94 # 1
select * from information_schema.COLLATION_CHARACTER_SET_APPLICABILITY
where COLLATION_NAME like 'latin1%';
COLLATION_NAME CHARACTER_SET_NAME
diff --git a/mysql-test/r/join_nested.result b/mysql-test/r/join_nested.result
index dfcfa35d31d..0747418111b 100644
--- a/mysql-test/r/join_nested.result
+++ b/mysql-test/r/join_nested.result
@@ -1504,3 +1504,61 @@ id type cid id pid pid type
1 A NULL NULL NULL NULL NULL
DROP VIEW v1;
DROP TABLE t1,t2,t3;
+CREATE TABLE t1 (id1 int PRIMARY KEY, id2 int);
+CREATE TABLE t2 (id1 int PRIMARY KEY, id2 int);
+CREATE TABLE t3 (id1 int PRIMARY KEY, id2 int);
+CREATE TABLE t4 (id1 int PRIMARY KEY, id2 int);
+CREATE TABLE t5 (id1 int PRIMARY KEY, id2 int);
+SELECT t1.id1 AS id, t5.id1 AS ngroupbynsa
+FROM t1 INNER JOIN t2 ON t2.id2 = t1.id1
+LEFT OUTER JOIN
+(t3 INNER JOIN t4 ON t4.id1 = t3.id2 INNER JOIN t5 ON t4.id2 = t5.id1)
+ON t3.id2 IS NOT NULL
+WHERE t1.id1=2;
+id ngroupbynsa
+PREPARE stmt FROM
+"SELECT t1.id1 AS id, t5.id1 AS ngroupbynsa
+ FROM t1 INNER JOIN t2 ON t2.id2 = t1.id1
+ LEFT OUTER JOIN
+ (t3 INNER JOIN t4 ON t4.id1 = t3.id2 INNER JOIN t5 ON t4.id2 = t5.id1)
+ ON t3.id2 IS NOT NULL
+ WHERE t1.id1=2";
+EXECUTE stmt;
+id ngroupbynsa
+EXECUTE stmt;
+id ngroupbynsa
+EXECUTE stmt;
+id ngroupbynsa
+EXECUTE stmt;
+id ngroupbynsa
+INSERT INTO t1 VALUES (1,1), (2,1), (3,2);
+INSERT INTO t2 VALUES (2,1), (3,2), (4,3);
+INSERT INTO t3 VALUES (1,1), (3,2), (2,NULL);
+INSERT INTO t4 VALUES (1,1), (2,1), (3,3);
+INSERT INTO t5 VALUES (1,1), (2,2), (3,3), (4,3);
+EXECUTE stmt;
+id ngroupbynsa
+2 1
+2 1
+EXECUTE stmt;
+id ngroupbynsa
+2 1
+2 1
+EXECUTE stmt;
+id ngroupbynsa
+2 1
+2 1
+EXECUTE stmt;
+id ngroupbynsa
+2 1
+2 1
+SELECT t1.id1 AS id, t5.id1 AS ngroupbynsa
+FROM t1 INNER JOIN t2 ON t2.id2 = t1.id1
+LEFT OUTER JOIN
+(t3 INNER JOIN t4 ON t4.id1 = t3.id2 INNER JOIN t5 ON t4.id2 = t5.id1)
+ON t3.id2 IS NOT NULL
+WHERE t1.id1=2;
+id ngroupbynsa
+2 1
+2 1
+DROP TABLE t1,t2,t3,t4,t5;
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index 9d6c6140dd5..8a30f3c18ec 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -1135,3 +1135,22 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 4 Using where
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1
DROP TABLE t1,t2;
+CREATE TABLE t1 (id int(11) NOT NULL PRIMARY KEY, name varchar(20),
+INDEX (name)) ENGINE=InnoDB;
+CREATE TABLE t2 (id int(11) NOT NULL PRIMARY KEY, fkey int(11),
+FOREIGN KEY (fkey) REFERENCES t2(id)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,'A1'),(2,'A2'),(3,'B');
+INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3);
+EXPLAIN
+SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
+WHERE t1.name LIKE 'A%';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index PRIMARY,name name 23 NULL 3 Using where; Using index
+1 SIMPLE t2 ref fkey fkey 5 test.t1.id 1 Using where; Using index
+EXPLAIN
+SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
+WHERE t1.name LIKE 'A%' OR FALSE;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index PRIMARY,name name 23 NULL 3 Using where; Using index
+1 SIMPLE t2 ref fkey fkey 5 test.t1.id 1 Using where; Using index
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result
index 73e3a9d32e3..1ab51e9fad5 100644
--- a/mysql-test/r/lock_multi.result
+++ b/mysql-test/r/lock_multi.result
@@ -36,6 +36,13 @@ lock table t1 write, t2 write;
drop table t2;
ERROR 42S02: Table 'test.t2' doesn't exist
drop table t1;
+create table t1 (a int);
+create table t2 (a int);
+lock table t1 write, t2 write, t1 as t1_2 write, t2 as t2_2 write;
+ insert t1 select * from t2;
+drop table t2;
+ERROR 42S02: Table 'test.t2' doesn't exist
+drop table t1;
create table t1(a int);
lock tables t1 write;
show columns from t1;
diff --git a/mysql-test/r/ndb_condition_pushdown.result b/mysql-test/r/ndb_condition_pushdown.result
index bdeff437f6f..24fe30604ae 100644
--- a/mysql-test/r/ndb_condition_pushdown.result
+++ b/mysql-test/r/ndb_condition_pushdown.result
@@ -1,4 +1,4 @@
-DROP TABLE IF EXISTS t1,t2;
+DROP TABLE IF EXISTS t1,t2,t3,t4;
CREATE TABLE t1 (
auto int(5) unsigned NOT NULL auto_increment,
string char(10),
@@ -1766,5 +1766,21 @@ select * from t3 left join t4 on t4.attr2 = t3.attr2 where t4.attr1 > 1 and t4.a
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
1 SIMPLE t4 ALL NULL NULL NULL NULL 6 Using where
+create table t5 (a int primary key auto_increment, b tinytext not null)
+engine = ndb;
+insert into t5 (b) values ('jonas'), ('jensing'), ('johan');
+set engine_condition_pushdown = off;
+select * from t5 where b like '%jo%' order by a;
+a b
+1 jonas
+3 johan
+set engine_condition_pushdown = on;
+explain select * from t5 where b like '%jo%';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t5 ALL NULL NULL NULL NULL 3 Using where
+select * from t5 where b like '%jo%' order by a;
+a b
+1 jonas
+3 johan
set engine_condition_pushdown = @old_ecpd;
-DROP TABLE t1,t2,t3,t4;
+DROP TABLE t1,t2,t3,t4,t5;
diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/r/ndb_insert.result
index 11d322a06de..3f9a5d7c6c5 100644
--- a/mysql-test/r/ndb_insert.result
+++ b/mysql-test/r/ndb_insert.result
@@ -577,6 +577,25 @@ pk1 b c
2 2 17
4 4 3
6 6 3
+DELETE FROM t1;
+CREATE UNIQUE INDEX bi ON t1(b);
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
+INSERT INTO t1 VALUES(0,1,0),(21,21,21) ON DUPLICATE KEY UPDATE pk1=b+10,b=b+10;
+select * from t1 order by pk1;
+pk1 b c
+2 2 2
+3 3 3
+4 4 4
+5 5 5
+6 6 6
+7 7 7
+8 8 8
+9 9 9
+10 10 10
+11 11 1
+21 21 21
DROP TABLE t1;
CREATE TABLE t1(a INT) ENGINE=ndb;
INSERT IGNORE INTO t1 VALUES (1);
@@ -586,7 +605,7 @@ INSERT IGNORE INTO t1 SELECT a FROM t1;
INSERT IGNORE INTO t1 SELECT a FROM t1;
INSERT IGNORE INTO t1 VALUES (1);
INSERT IGNORE INTO t1 VALUES (1);
-SELECT * FROM t1;
+SELECT * FROM t1 ORDER BY a;
a
1
1
@@ -606,4 +625,27 @@ a
1
1
1
+DELETE FROM t1;
+CREATE UNIQUE INDEX ai ON t1(a);
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (NULL),(2);
+SELECT * FROM t1 ORDER BY a;
+a
+NULL
+1
+2
+DROP TABLE t1;
+CREATE TABLE t1(pk INT NOT NULL PRIMARY KEY, a INT, UNIQUE (a)) ENGINE=ndb;
+INSERT IGNORE INTO t1 VALUES (1,1),(2,2),(3,3);
+INSERT IGNORE INTO t1 VALUES (4,NULL),(5,NULL),(6,NULL),(7,4);
+SELECT * FROM t1 ORDER BY pk;
+pk a
+1 1
+2 2
+3 3
+4 NULL
+5 NULL
+6 NULL
+7 4
DROP TABLE t1;
diff --git a/mysql-test/r/ndb_partition_key.result b/mysql-test/r/ndb_partition_key.result
index 87b019c83e2..8225fca7a54 100644
--- a/mysql-test/r/ndb_partition_key.result
+++ b/mysql-test/r/ndb_partition_key.result
@@ -165,3 +165,21 @@ ENGINE=NDB
PARTITION BY KEY(c3) PARTITIONS 5;
ALTER TABLE t1 COALESCE PARTITION 4;
DROP TABLE t1;
+CREATE TABLE t1 (
+c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
+c2 TEXT NOT NULL,
+c3 INT NOT NULL,
+PRIMARY KEY(c1,c3))
+ENGINE=NDB
+PARTITION BY KEY(c3) PARTITIONS 5;
+ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
+DROP TABLE t1;
+CREATE TABLE t1 (
+c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
+c2 TEXT NOT NULL,
+c3 INT NOT NULL,
+PRIMARY KEY(c1,c3))
+ENGINE=NDB
+PARTITION BY KEY(c3);
+ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
+DROP TABLE t1;
diff --git a/mysql-test/r/ndb_read_multi_range.result b/mysql-test/r/ndb_read_multi_range.result
index bb9398054ff..9941d2b28a3 100644
--- a/mysql-test/r/ndb_read_multi_range.result
+++ b/mysql-test/r/ndb_read_multi_range.result
@@ -263,3 +263,107 @@ a b c d
10 10 10 10
drop table t2;
drop table t1;
+CREATE TABLE t1 (
+a int(11) NOT NULL,
+b int(11) NOT NULL,
+c datetime default NULL,
+PRIMARY KEY (a),
+KEY idx_bc (b,c)
+) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES
+(406989,67,'2006-02-23 17:08:46'), (150078,67,'2005-10-26 11:17:45'),
+(406993,67,'2006-02-27 11:20:57'), (245655,67,'2005-12-08 15:59:08'),
+(406994,67,'2006-02-27 11:26:46'), (256,67,NULL),
+(398341,67,'2006-02-20 04:48:44'), (254,67,NULL),(1120,67,NULL),
+(406988,67,'2006-02-23 17:07:22'), (255,67,NULL),
+(398340,67,'2006-02-20 04:38:53'),(406631,67,'2006-02-23 10:49:42'),
+(245653,67,'2005-12-08 15:59:07'),(406992,67,'2006-02-24 16:47:18'),
+(245654,67,'2005-12-08 15:59:08'),(406995,67,'2006-02-28 11:55:00'),
+(127261,67,'2005-10-13 12:17:58'),(406991,67,'2006-02-24 16:42:32'),
+(245652,67,'2005-12-08 15:58:27'),(398545,67,'2006-02-20 04:53:13'),
+(154504,67,'2005-10-28 11:53:01'),(9199,67,NULL),(1,67,'2006-02-23 15:01:35'),
+(223456,67,NULL),(4101,67,NULL),(1133,67,NULL),
+(406990,67,'2006-02-23 18:01:45'),(148815,67,'2005-10-25 15:34:17'),
+(148812,67,'2005-10-25 15:30:01'),(245651,67,'2005-12-08 15:58:27'),
+(154503,67,'2005-10-28 11:52:38');
+create table t11 select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 asc;
+create table t12 select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 desc;
+create table t21 select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 asc;
+create table t22 select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 desc;
+select * from t11 order by 1,2,3;
+a b c
+254 67 NULL
+255 67 NULL
+256 67 NULL
+1120 67 NULL
+1133 67 NULL
+4101 67 NULL
+9199 67 NULL
+223456 67 NULL
+select * from t12 order by 1,2,3;
+a b c
+254 67 NULL
+255 67 NULL
+256 67 NULL
+1120 67 NULL
+1133 67 NULL
+4101 67 NULL
+9199 67 NULL
+223456 67 NULL
+select * from t21 order by 1,2,3;
+a b c
+1 67 2006-02-23 15:01:35
+254 67 NULL
+255 67 NULL
+256 67 NULL
+1120 67 NULL
+1133 67 NULL
+4101 67 NULL
+9199 67 NULL
+223456 67 NULL
+245651 67 2005-12-08 15:58:27
+245652 67 2005-12-08 15:58:27
+245653 67 2005-12-08 15:59:07
+245654 67 2005-12-08 15:59:08
+245655 67 2005-12-08 15:59:08
+398340 67 2006-02-20 04:38:53
+398341 67 2006-02-20 04:48:44
+398545 67 2006-02-20 04:53:13
+406631 67 2006-02-23 10:49:42
+406988 67 2006-02-23 17:07:22
+406989 67 2006-02-23 17:08:46
+406990 67 2006-02-23 18:01:45
+406991 67 2006-02-24 16:42:32
+406992 67 2006-02-24 16:47:18
+406993 67 2006-02-27 11:20:57
+406994 67 2006-02-27 11:26:46
+406995 67 2006-02-28 11:55:00
+select * from t22 order by 1,2,3;
+a b c
+1 67 2006-02-23 15:01:35
+254 67 NULL
+255 67 NULL
+256 67 NULL
+1120 67 NULL
+1133 67 NULL
+4101 67 NULL
+9199 67 NULL
+223456 67 NULL
+245651 67 2005-12-08 15:58:27
+245652 67 2005-12-08 15:58:27
+245653 67 2005-12-08 15:59:07
+245654 67 2005-12-08 15:59:08
+245655 67 2005-12-08 15:59:08
+398340 67 2006-02-20 04:38:53
+398341 67 2006-02-20 04:48:44
+398545 67 2006-02-20 04:53:13
+406631 67 2006-02-23 10:49:42
+406988 67 2006-02-23 17:07:22
+406989 67 2006-02-23 17:08:46
+406990 67 2006-02-23 18:01:45
+406991 67 2006-02-24 16:42:32
+406992 67 2006-02-24 16:47:18
+406993 67 2006-02-27 11:20:57
+406994 67 2006-02-27 11:26:46
+406995 67 2006-02-28 11:55:00
+DROP TABLE t1, t11, t12, t21, t22;
diff --git a/mysql-test/r/ndb_replace.result b/mysql-test/r/ndb_replace.result
index 6aa1a387661..5e49968ca64 100644
--- a/mysql-test/r/ndb_replace.result
+++ b/mysql-test/r/ndb_replace.result
@@ -19,3 +19,15 @@ gesuchnr benutzer_id
2 1
3 2
drop table t1;
+CREATE TABLE t1(i INT PRIMARY KEY AUTO_INCREMENT,
+j INT,
+k INT,
+UNIQUE INDEX(j)
+) ENGINE = ndb;
+INSERT INTO t1 VALUES (1,1,23),(2,2,24);
+REPLACE INTO t1 (j,k) VALUES (1,42);
+REPLACE INTO t1 (i,j) VALUES (17,2);
+SELECT * from t1 ORDER BY i;
+i j k
+3 1 42
+17 2 24
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 7244dd6ccbf..2e293df50e2 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -642,7 +642,7 @@ drop table t1;
create table t1 (a int) engine=innodb partition by hash(a) ;
show table status like 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 PARTITION 10 Compact 2 8192 16384 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t1 InnoDB 10 Compact 2 8192 16384 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
drop table t1;
create table t2 (s1 int not null auto_increment, primary key (s1)) partition by list (s1) (partition p1 values in (1),partition p2 values in (2),partition p3 values in (3),partition p4 values in (4));
insert into t2 values (null),(null),(null);
@@ -718,4 +718,125 @@ CALL test.p1(13);
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
drop table t1;
+CREATE TABLE t1 (a int not null)
+partition by key(a)
+(partition p0 COMMENT='first partition');
+drop table t1;
+CREATE TABLE t1 (`a b` int not null)
+partition by key(`a b`);
+drop table t1;
+CREATE TABLE t1 (`a b` int not null)
+partition by hash(`a b`);
+drop table t1;
+create table t1 (f1 integer) partition by range(f1)
+(partition p1 values less than (0), partition p2 values less than (10));
+insert into t1 set f1 = null;
+select * from t1 where f1 is null;
+f1
+NULL
+explain partitions select * from t1 where f1 is null;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p1 system NULL NULL NULL NULL 1
+drop table t1;
+create table t1 (f1 integer) partition by list(f1)
+(partition p1 values in (1), partition p2 values in (null));
+insert into t1 set f1 = null;
+insert into t1 set f1 = 1;
+select * from t1 where f1 is null or f1 = 1;
+f1
+1
+NULL
+drop table t1;
+create table t1 (f1 smallint)
+partition by list (f1) (partition p0 values in (null));
+insert into t1 values (null);
+select * from t1 where f1 is null;
+f1
+NULL
+drop table t1;
+create table t1 (f1 smallint)
+partition by range (f1) (partition p0 values less than (0));
+insert into t1 values (null);
+select * from t1 where f1 is null;
+f1
+NULL
+drop table t1;
+create table t1 (f1 integer) partition by list(f1)
+(
+partition p1 values in (1),
+partition p2 values in (NULL),
+partition p3 values in (2),
+partition p4 values in (3),
+partition p5 values in (4)
+);
+insert into t1 values (1),(2),(3),(4),(null);
+select * from t1 where f1 < 3;
+f1
+1
+2
+explain partitions select * from t1 where f1 < 3;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p1,p3 ALL NULL NULL NULL NULL 2 Using where
+select * from t1 where f1 is null;
+f1
+NULL
+explain partitions select * from t1 where f1 is null;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2 system NULL NULL NULL NULL 1
+drop table t1;
+create table t1 (f1 int) partition by list(f1 div 2)
+(
+partition p1 values in (1),
+partition p2 values in (NULL),
+partition p3 values in (2),
+partition p4 values in (3),
+partition p5 values in (4)
+);
+insert into t1 values (2),(4),(6),(8),(null);
+select * from t1 where f1 < 3;
+f1
+2
+explain partitions select * from t1 where f1 < 3;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p1,p2,p3,p4,p5 ALL NULL NULL NULL NULL 5 Using where
+select * from t1 where f1 is null;
+f1
+NULL
+explain partitions select * from t1 where f1 is null;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2 system NULL NULL NULL NULL 1
+drop table t1;
+create table t1 (a int) partition by LIST(a) (
+partition pn values in (NULL),
+partition p0 values in (0),
+partition p1 values in (1),
+partition p2 values in (2)
+);
+insert into t1 values (NULL),(0),(1),(2);
+select * from t1 where a is null or a < 2;
+a
+NULL
+0
+1
+explain partitions select * from t1 where a is null or a < 2;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 pn,p0,p1 ALL NULL NULL NULL NULL 3 Using where
+select * from t1 where a is null or a < 0 or a > 1;
+a
+NULL
+2
+explain partitions select * from t1 where a is null or a < 0 or a > 1;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 pn,p2 ALL NULL NULL NULL NULL 2 Using where
+drop table t1;
+CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, name VARCHAR(20))
+ENGINE=MyISAM DEFAULT CHARSET=latin1
+PARTITION BY RANGE(id)
+(PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM,
+PARTITION p1 VALUES LESS THAN (20) ENGINE = MyISAM,
+PARTITION p2 VALUES LESS THAN (30) ENGINE = MyISAM);
+SHOW TABLE STATUS;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 MyISAM 10 Dynamic 0 0 0 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result
index cbad5d067b0..d520f7735ec 100644
--- a/mysql-test/r/partition_pruning.result
+++ b/mysql-test/r/partition_pruning.result
@@ -545,3 +545,55 @@ show status like 'Handler_read_next';
Variable_name Value
Handler_read_next 0
drop table t1, t2;
+create table t1 ( f_int1 mediumint, f_int2 integer)
+partition by list(mod(f_int1,4)) (
+partition p_3 values in (-3),
+partition p_2 values in (-2),
+partition p_1 values in (-1),
+partition p0 values in (0),
+partition p1 values in (1),
+partition p2 values in (2),
+partition p3 values in (3)
+);
+insert into t1 values (9, 9), (8, 8), (7, 7), (6, 6), (5, 5),
+(4, 4), (3, 3), (2, 2), (1, 1);
+select * from t1 where f_int1 between 5 and 15 order by f_int1;
+f_int1 f_int2
+5 5
+6 6
+7 7
+8 8
+9 9
+drop table t1;
+create table t1 (a char(10)) partition by list(length(a)) (
+partition p1 values in (1),
+partition p2 values in (2),
+partition p3 values in (3),
+partition p4 values in (4),
+partition p5 values in (5)
+);
+insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee');
+select * from t1 where a>='a' and a <= 'dddd';
+a
+a
+bb
+ccc
+dddd
+explain partitions select * from t1 where a>='a' and a <= 'dddd';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p1,p2,p3,p4,p5 ALL NULL NULL NULL NULL 5 Using where
+drop table t1;
+create table t1 (f_int1 integer) partition by list(abs(mod(f_int1,2)))
+subpartition by hash(f_int1) subpartitions 2
+(
+partition part1 values in (0),
+partition part2 values in (1),
+partition part4 values in (null)
+);
+insert into t1 set f_int1 = null;
+select * from t1 where f_int1 is null;
+f_int1
+NULL
+explain partitions select * from t1 where f_int1 is null;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 part4_p2sp0 system NULL NULL NULL NULL 1
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index e24cee9e875..6db5e8f8157 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -880,3 +880,49 @@ select row_count();
row_count()
1
drop table t1;
+create table t1 (a int, b int);
+insert into t1 (a,b) values (2,8),(1,9),(3,7);
+prepare stmt from "select * from t1 order by ?";
+execute stmt using @a;
+a b
+2 8
+1 9
+3 7
+set @a=1;
+execute stmt using @a;
+a b
+1 9
+2 8
+3 7
+set @a=2;
+execute stmt using @a;
+a b
+3 7
+2 8
+1 9
+deallocate prepare stmt;
+select * from t1 order by 1;
+a b
+1 9
+2 8
+3 7
+prepare stmt from "select * from t1 order by ?+1";
+set @a=0;
+execute stmt using @a;
+a b
+2 8
+1 9
+3 7
+set @a=1;
+execute stmt using @a;
+a b
+2 8
+1 9
+3 7
+deallocate prepare stmt;
+select * from t1 order by 1+1;
+a b
+2 8
+1 9
+3 7
+drop table t1;
diff --git a/mysql-test/r/rpl_ndb_insert_ignore.result b/mysql-test/r/rpl_ndb_insert_ignore.result
index 030845e89e2..4d55328a5d7 100644
--- a/mysql-test/r/rpl_ndb_insert_ignore.result
+++ b/mysql-test/r/rpl_ndb_insert_ignore.result
@@ -30,16 +30,16 @@ a b
2 2
3 3
4 4
-5 5
-6 6
+7 5
+10 6
SELECT * FROM t1 ORDER BY a;
a b
1 1
2 2
3 3
4 4
-5 5
-6 6
+7 5
+10 6
drop table t1;
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
diff --git a/mysql-test/r/rpl_ndb_sp007.result b/mysql-test/r/rpl_ndb_sp007.result
deleted file mode 100644
index 6e84f9940ef..00000000000
--- a/mysql-test/r/rpl_ndb_sp007.result
+++ /dev/null
@@ -1,50 +0,0 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-DROP PROCEDURE IF EXISTS test.p1;
-DROP TABLE IF EXISTS test.t1;
-CREATE PROCEDURE test.p1(IN i INT)
-BEGIN
-DECLARE CONTINUE HANDLER FOR sqlexception BEGIN END;
-DROP TABLE IF EXISTS test.t1;
-CREATE TABLE test.t1 (num INT,PRIMARY KEY(num))ENGINE=NDBCLUSTER;
-START TRANSACTION;
-INSERT INTO test.t1 VALUES(i);
-savepoint t1_save;
-INSERT INTO test.t1 VALUES (14);
-ROLLBACK to savepoint t1_save;
-COMMIT;
-END|
-
-< ---- Master selects-- >
--------------------------
-CALL test.p1(12);
-Warnings:
-Note 1051 Unknown table 't1'
-SELECT * FROM test.t1;
-num
-12
-
-< ---- Slave selects-- >
-------------------------
-SELECT * FROM test.t1;
-num
-12
-
-< ---- Master selects-- >
--------------------------
-CALL test.p1(13);
-SELECT * FROM test.t1;
-num
-13
-
-< ---- Slave selects-- >
-------------------------
-SELECT * FROM test.t1;
-num
-13
-DROP PROCEDURE IF EXISTS test.p1;
-DROP TABLE IF EXISTS test.t1;
diff --git a/mysql-test/r/rpl_row_basic_8partition.result b/mysql-test/r/rpl_row_basic_8partition.result
new file mode 100644
index 00000000000..3316e42b869
--- /dev/null
+++ b/mysql-test/r/rpl_row_basic_8partition.result
@@ -0,0 +1,652 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+DROP TABLE IF EXISTS t1;
+SET BINLOG_FORMAT=ROW;
+**** Partition RANGE testing ****
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE)
+PARTITION BY RANGE (YEAR(t))
+(PARTITION p0 VALUES LESS THAN (1901),
+PARTITION p1 VALUES LESS THAN (1946),
+PARTITION p2 VALUES LESS THAN (1966),
+PARTITION p3 VALUES LESS THAN (1986),
+PARTITION p4 VALUES LESS THAN (2005),
+PARTITION p5 VALUES LESS THAN MAXVALUE);
+--- On master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+--- On slave --
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+ALTER TABLE t1 MODIFY vc TEXT;
+--- On master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+--- On slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+DROP TABLE IF EXISTS t1;
+**** Partition LIST testing ****
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE)
+PARTITION BY LIST(id)
+(PARTITION p0 VALUES IN (2, 4),
+PARTITION p1 VALUES IN (42, 142),
+PARTITION p2 VALUES IN (412));
+--- On master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM)
+--- On slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM)
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+ALTER TABLE t1 MODIFY vc TEXT;
+--- On master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM)
+--- On slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM)
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+DROP TABLE IF EXISTS t1;
+**** Partition HASH testing ****
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE)
+PARTITION BY HASH( YEAR(t) )
+PARTITIONS 4;
+--- On master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4
+--- On slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+ALTER TABLE t1 MODIFY vc TEXT;
+--- On master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4
+--- On slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+DROP TABLE IF EXISTS t1;
+**** Partition by KEY ****
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+y YEAR, t DATE,PRIMARY KEY(id))
+PARTITION BY KEY()
+PARTITIONS 4;
+--- On master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4
+--- On slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned DEFAULT NULL,
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
+--- On master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4
+--- On slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` varchar(255) DEFAULT NULL,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+ALTER TABLE t1 MODIFY vc TEXT;
+--- On master ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4
+--- On slave ---
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) DEFAULT NULL,
+ `vc` text,
+ `bc` char(255) DEFAULT NULL,
+ `d` decimal(10,4) DEFAULT '0.0000',
+ `f` float DEFAULT '0',
+ `total` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `y` year(4) DEFAULT NULL,
+ `t` date DEFAULT NULL,
+ PRIMARY KEY (`id`,`total`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4
+"--- Insert into t1 --" as "";
+--- Select from t1 on master ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Select from t1 on slave ---
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14
+4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14
+142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
+412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+--- Update t1 on master --
+UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
+--- Check the update on master ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Check Update on slave ---
+SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
+id hex(b1) vc bc d f total y t
+412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+--- Remove a record from t1 on master ---
+DELETE FROM t1 WHERE id = 42;
+--- Show current count on master for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+--- Show current count on slave for t1 ---
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+DELETE FROM t1;
+DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index df68cdfff53..9b9f67efeb5 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -3371,3 +3371,22 @@ NULL a NULL
drop table t1,t2;
select * from (select * left join t on f1=f2) tt;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on f1=f2) tt' at line 1
+CREATE TABLE t1 (sku int PRIMARY KEY, pr int);
+CREATE TABLE t2 (sku int PRIMARY KEY, sppr int, name varchar(255));
+INSERT INTO t1 VALUES
+(10, 10), (20, 10), (30, 20), (40, 30), (50, 10), (60, 10);
+INSERT INTO t2 VALUES
+(10, 10, 'aaa'), (20, 10, 'bbb'), (30, 10, 'ccc'), (40, 20, 'ddd'),
+(50, 10, 'eee'), (60, 20, 'fff'), (70, 20, 'ggg'), (80, 30, 'hhh');
+SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr
+FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku);
+sku sppr name sku pr
+20 10 bbb 10 10
+20 10 bbb 20 10
+EXPLAIN
+SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr
+FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using where
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index 40fe0b09814..931fa2ee402 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -634,10 +634,18 @@ flush tables;
return 5;
end|
ERROR 0A000: FLUSH is not allowed in stored function or trigger
-create procedure bug9529_90123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123()
+create procedure bug9529_901234567890123456789012345678901234567890123456789012345()
begin
end|
-ERROR 42000: Identifier name 'bug9529_90123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890' is too long
+ERROR 42000: Identifier name 'bug9529_901234567890123456789012345678901234567890123456789012345' is too long
+drop procedure if exists bug17015_0123456789012345678901234567890123456789012345678901234|
+create procedure bug17015_0123456789012345678901234567890123456789012345678901234()
+begin
+end|
+show procedure status like 'bug17015%'|
+Db Name Type Definer Modified Created Security_type Comment
+test bug17015_0123456789012345678901234567890123456789012345678901234 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
+drop procedure bug17015_0123456789012345678901234567890123456789012345678901234|
drop procedure if exists bug10969|
create procedure bug10969()
begin
diff --git a/mysql-test/r/sp-prelocking.result b/mysql-test/r/sp-prelocking.result
index c2614892016..2335513b28a 100644
--- a/mysql-test/r/sp-prelocking.result
+++ b/mysql-test/r/sp-prelocking.result
@@ -214,3 +214,26 @@ drop function f1;
drop function f2;
drop function f3;
drop procedure sp1;
+drop table if exists t1;
+drop view if exists v1, v2, v3;
+drop function if exists bug15683;
+create table t1 (f1 bigint, f2 varchar(20), f3 bigint);
+insert into t1 set f1 = 1, f2 = 'schoenenbourg', f3 = 1;
+create view v1 as select 1 from t1 union all select 1;
+create view v2 as select 1 from v1;
+create view v3 as select 1 as f1 from v2;
+create function bug15683() returns bigint
+begin
+return (select count(*) from v3);
+end|
+prepare stmt from "select bug15683()";
+execute stmt;
+bug15683()
+2
+execute stmt;
+bug15683()
+2
+deallocate prepare stmt;
+drop table t1;
+drop view v1, v2, v3;
+drop function bug15683;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index f31facf6196..c75bce6580f 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -4812,4 +4812,39 @@ f1 bug13575(f1)
3 ccc
drop function bug13575;
drop table t3|
+drop procedure if exists bug16474_1|
+drop procedure if exists bug16474_2|
+delete from t1|
+insert into t1 values ('c', 2), ('b', 3), ('a', 1)|
+create procedure bug16474_1()
+begin
+declare x int;
+select id from t1 order by x;
+end|
+create procedure bug16474_2(x int)
+select id from t1 order by x|
+call bug16474_1()|
+id
+c
+b
+a
+call bug16474_2(1)|
+id
+c
+b
+a
+call bug16474_2(2)|
+id
+c
+b
+a
+drop procedure bug16474_1|
+drop procedure bug16474_2|
+set @x = 2|
+select * from t1 order by @x|
+id data
+c 2
+b 3
+a 1
+delete from t1|
drop table t1,t2;
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 5f7d58f959b..37823c66de9 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -547,7 +547,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 Using index
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
Warnings:
-Note 1003 select `test`.`t1`.`numreponse` AS `numreponse` from `test`.`t1` where ((`test`.`t1`.`numreponse` = (select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where (`test`.`t1`.`numeropost` = _latin1'1'))) and (`test`.`t1`.`numeropost` = _latin1'1'))
+Note 1003 select `test`.`t1`.`numreponse` AS `numreponse` from `test`.`t1` where ((`test`.`t1`.`numeropost` = _latin1'1'))
drop table t1;
CREATE TABLE t1 (a int(1));
INSERT INTO t1 VALUES (1);
diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result
index 21c698fc814..30cde39531d 100644
--- a/mysql-test/r/system_mysql_db.result
+++ b/mysql-test/r/system_mysql_db.result
@@ -193,7 +193,7 @@ show create table event;
Table Create Table
event CREATE TABLE `event` (
`db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
- `name` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
+ `name` char(64) NOT NULL DEFAULT '',
`body` longblob NOT NULL,
`definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`execute_at` datetime DEFAULT NULL,
diff --git a/mysql-test/r/trigger-trans.result b/mysql-test/r/trigger-trans.result
new file mode 100644
index 00000000000..b56abf1f59a
--- /dev/null
+++ b/mysql-test/r/trigger-trans.result
@@ -0,0 +1,84 @@
+drop table if exists t1;
+create table t1 (a varchar(16), b int) engine=innodb;
+create trigger t1_bi before insert on t1 for each row
+begin
+set new.a := upper(new.a);
+set new.b := new.b + 3;
+end|
+select trigger_schema, trigger_name, event_object_schema,
+event_object_table, action_statement from information_schema.triggers
+where event_object_schema = 'test' and event_object_table = 't1';
+trigger_schema trigger_name event_object_schema event_object_table action_statement
+test t1_bi test t1 begin
+set new.a := upper(new.a);
+set new.b := new.b + 3;
+end
+insert into t1 values ('The Lion', 10);
+select * from t1;
+a b
+THE LION 13
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+select trigger_schema, trigger_name, event_object_schema,
+event_object_table, action_statement from information_schema.triggers
+where event_object_schema = 'test' and event_object_table = 't1';
+trigger_schema trigger_name event_object_schema event_object_table action_statement
+test t1_bi test t1 begin
+set new.a := upper(new.a);
+set new.b := new.b + 3;
+end
+insert into t1 values ('The Unicorn', 20);
+select * from t1;
+a b
+THE LION 13
+THE UNICORN 23
+alter table t1 add column c int default 0;
+select trigger_schema, trigger_name, event_object_schema,
+event_object_table, action_statement from information_schema.triggers
+where event_object_schema = 'test' and event_object_table = 't1';
+trigger_schema trigger_name event_object_schema event_object_table action_statement
+test t1_bi test t1 begin
+set new.a := upper(new.a);
+set new.b := new.b + 3;
+end
+insert into t1 values ('Alice', 30, 1);
+select * from t1;
+a b c
+THE LION 13 0
+THE UNICORN 23 0
+ALICE 33 1
+alter table t1 rename to t1;
+select trigger_schema, trigger_name, event_object_schema,
+event_object_table, action_statement from information_schema.triggers
+where event_object_schema = 'test' and event_object_table = 't1';
+trigger_schema trigger_name event_object_schema event_object_table action_statement
+test t1_bi test t1 begin
+set new.a := upper(new.a);
+set new.b := new.b + 3;
+end
+insert into t1 values ('The Crown', 40, 1);
+select * from t1;
+a b c
+THE LION 13 0
+THE UNICORN 23 0
+ALICE 33 1
+THE CROWN 43 1
+alter table t1 rename to t1, add column d int default 0;
+select trigger_schema, trigger_name, event_object_schema,
+event_object_table, action_statement from information_schema.triggers
+where event_object_schema = 'test' and event_object_table = 't1';
+trigger_schema trigger_name event_object_schema event_object_table action_statement
+test t1_bi test t1 begin
+set new.a := upper(new.a);
+set new.b := new.b + 3;
+end
+insert into t1 values ('The Pie', 50, 1, 1);
+select * from t1;
+a b c d
+THE LION 13 0 0
+THE UNICORN 23 0 0
+ALICE 33 1 0
+THE CROWN 43 1 0
+THE PIE 53 1 1
+drop table t1;
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index 16d3246ed3e..ac451c5c34d 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -2,6 +2,7 @@ drop table if exists t1, t2, t3, t4;
drop view if exists v1;
drop database if exists mysqltest;
drop function if exists f1;
+drop function if exists f2;
drop procedure if exists p1;
create table t1 (i int);
create trigger trg before insert on t1 for each row set @a:=1;
@@ -860,6 +861,37 @@ trigger_schema trigger_name event_object_schema event_object_table action_statem
mysqltest t1_bi mysqltest t1 set @a:=new.id
drop trigger test.t1_bi;
ERROR HY000: Trigger does not exist
+alter table t1 rename to test.t1;
+ERROR HY000: Trigger in wrong schema
+insert into t1 values (103);
+select @a;
+@a
+103
+select trigger_schema, trigger_name, event_object_schema,
+event_object_table, action_statement from information_schema.triggers
+where event_object_schema = 'test' or event_object_schema = 'mysqltest';
+trigger_schema trigger_name event_object_schema event_object_table action_statement
+mysqltest t1_bi mysqltest t1 set @a:=new.id
+drop trigger test.t1_bi;
+ERROR HY000: Trigger does not exist
+alter table t1 rename to test.t1, add column val int default 0;
+ERROR HY000: Trigger in wrong schema
+insert into t1 values (104);
+select @a;
+@a
+104
+select trigger_schema, trigger_name, event_object_schema,
+event_object_table, action_statement from information_schema.triggers
+where event_object_schema = 'test' or event_object_schema = 'mysqltest';
+trigger_schema trigger_name event_object_schema event_object_table action_statement
+mysqltest t1_bi mysqltest t1 set @a:=new.id
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop trigger test.t1_bi;
+ERROR HY000: Trigger does not exist
drop trigger t1_bi;
drop table t1;
drop database mysqltest;
@@ -897,3 +929,26 @@ create trigger t1_bi before insert on t1 for each row return 0;
ERROR 42000: RETURN is only allowed in a FUNCTION
insert into t1 values (1);
drop table t1;
+create table t1 (a varchar(64), b int);
+create table t2 like t1;
+create trigger t1_ai after insert on t1 for each row
+set @a:= (select max(a) from t1);
+insert into t1 (a) values
+("Twas"),("brillig"),("and"),("the"),("slithy"),("toves"),
+("Did"),("gyre"),("and"),("gimble"),("in"),("the"),("wabe");
+create trigger t2_ai after insert on t2 for each row
+set @a:= (select max(a) from t2);
+insert into t2 select * from t1;
+load data infile '../std_data_ln/words.dat' into table t1 (a);
+drop trigger t1_ai;
+drop trigger t2_ai;
+create function f1() returns int return (select max(b) from t1);
+insert into t1 values
+("All",f1()),("mimsy",f1()),("were",f1()),("the",f1()),("borogoves",f1()),
+("And",f1()),("the",f1()),("mome", f1()),("raths",f1()),("outgrabe",f1());
+create function f2() returns int return (select max(b) from t2);
+insert into t2 select a, f2() from t1;
+load data infile '../std_data_ln/words.dat' into table t1 (a) set b:= f1();
+drop table t1;
+drop function f1;
+drop function f2;
diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result
index e55e6b35915..e62051df5cd 100644
--- a/mysql-test/r/varbinary.result
+++ b/mysql-test/r/varbinary.result
@@ -15,7 +15,7 @@ explain extended select * from t1 where UNIQ=0x38afba1d73e6a18a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const UNIQ UNIQ 8 const 1
Warnings:
-Note 1003 select `test`.`t1`.`ID` AS `ID`,`test`.`t1`.`UNIQ` AS `UNIQ` from `test`.`t1` where (`test`.`t1`.`UNIQ` = 4084688022709641610)
+Note 1003 select `test`.`t1`.`ID` AS `ID`,`test`.`t1`.`UNIQ` AS `UNIQ` from `test`.`t1` where 1
drop table t1;
select x'hello';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'x'hello'' at line 1
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index c02e4e1f7c8..fc3e5475ae7 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -2553,3 +2553,29 @@ a b
3 3
drop view v2, v1;
drop table t1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (1), (2);
+CREATE VIEW v1 AS SELECT SQRT(a) my_sqrt FROM t1;
+SELECT my_sqrt FROM v1 ORDER BY my_sqrt;
+my_sqrt
+1
+1.4142135623731
+DROP VIEW v1;
+DROP TABLE t1;
+CREATE TABLE t1 (id int PRIMARY KEY);
+CREATE TABLE t2 (id int PRIMARY KEY);
+INSERT INTO t1 VALUES (1), (3);
+INSERT INTO t2 VALUES (1), (2), (3);
+CREATE VIEW v2 AS SELECT * FROM t2;
+SELECT COUNT(*) FROM t1 LEFT JOIN t2 ON t1.id=t2.id;
+COUNT(*)
+2
+SELECT * FROM t1 LEFT JOIN t2 ON t1.id=t2.id;
+id id
+1 1
+3 3
+SELECT COUNT(*) FROM t1 LEFT JOIN v2 ON t1.id=v2.id;
+COUNT(*)
+2
+DROP VIEW v2;
+DROP TABLE t1, t2;
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index dc7f695e38e..7e09f44397c 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -165,6 +165,15 @@ select cast(repeat('1',20) as signed);
#
select cast(1.0e+300 as signed int);
+#
+# Bugs: #15098: CAST(column double TO signed int), wrong result
+#
+CREATE TABLE t1 (f1 double);
+INSERT INTO t1 SET f1 = -1.0e+30 ;
+INSERT INTO t1 SET f1 = +1.0e+30 ;
+SELECT f1 AS double_val, CAST(f1 AS SIGNED INT) AS cast_val FROM t1;
+DROP TABLE t1;
+
# End of 4.1 tests
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index c5d1b881896..fe8cfe70c4e 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -647,6 +647,12 @@ show create table t2;
drop table t1, t2;
+#
+# Bug #15316 SET value having comma not correctly handled
+#
+--error 1367
+create table t1(a set("a,b","c,d") not null);
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index 916a2132deb..63c76e79fc7 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1388,6 +1388,99 @@ UNLOCK TABLES;
DROP TABLE test_concurrent_insert;
#
+# Test REPAIR/CHECK TABLE (5.1)
+#
+
+# Check that repair on the newly created table works fine
+
+CREATE TABLE test_repair_table ( val integer ) ENGINE = CSV;
+
+CHECK TABLE test_repair_table;
+REPAIR TABLE test_repair_table;
+
+DROP TABLE test_repair_table;
+
+#
+# Check autorepair. Here we also check that we can work w/o metafile
+# restore the meta-file
+#
+
+CREATE TABLE test_repair_table2 ( val integer ) ENGINE = CSV;
+--exec rm $MYSQLTEST_VARDIR/master-data/test/test_repair_table2.CSM
+
+# Should give a warning and perform autorepair. We also disable ps-protocol
+# here, as mysql-test eats up warnings in ps-protocol mode
+
+--disable_ps_protocol
+SELECT * from test_repair_table2;
+--enable_ps_protocol
+# this should work ok, as the table is already repaired
+SELECT * from test_repair_table2;
+# check that the metafile appeared again. chop the path to it
+--exec ls $MYSQLTEST_VARDIR/master-data/test/test_repair_table2.CSM | perl -pi -e "s/.*\///"
+CHECK TABLE test_repair_table2;
+DROP TABLE test_repair_table2;
+
+
+# Corrupt csv file and see if we can repair it
+CREATE TABLE test_repair_table3 ( val integer ) ENGINE = CSV;
+--exec perl -e 'print "\"1\"\n\"4\"\n\"3";' > $MYSQLTEST_VARDIR/master-data/test/test_repair_table3.CSV
+CHECK TABLE test_repair_table3;
+REPAIR TABLE test_repair_table3;
+SELECT * FROM test_repair_table3;
+DROP TABLE test_repair_table3;
+
+# Test with more sophisticated table
+
+CREATE TABLE test_repair_table4 (
+ num int not null,
+ magic_no int(4) unsigned zerofill DEFAULT '0000' NOT NULL,
+ company_name char(30) DEFAULT '' NOT NULL,
+ founded char(4) DEFAULT '' NOT NULL
+) ENGINE = CSV;
+
+--exec rm $MYSQLTEST_VARDIR/master-data/test/test_repair_table4.CSM
+--disable_ps_protocol
+SELECT * FROM test_repair_table4;
+--enable_ps_protocol
+SELECT * FROM test_repair_table4;
+CHECK TABLE test_repair_table4;
+
+INSERT INTO test_repair_table4 VALUES (2,101,'SAP','1972');
+INSERT INTO test_repair_table4 VALUES (1,101,'Microsoft','1978');
+INSERT INTO test_repair_table4 VALUES (2,101,'MySQL','1995');
+
+# list table content
+SELECT * FROM test_repair_table4;
+CHECK TABLE test_repair_table4;
+REPAIR TABLE test_repair_table4;
+# check that nothing changed
+SELECT * FROM test_repair_table4;
+# verify that check/repair did non corrupt the table itself
+CHECK TABLE test_repair_table4;
+REPAIR TABLE test_repair_table4;
+SELECT * FROM test_repair_table4;
+DROP TABLE test_repair_table4;
+
+# Run CHECK/REPAIR on the CSV file with a single row, which misses a column.
+
+CREATE TABLE test_repair_table5 (
+ num int not null,
+ magic_no int(4) unsigned zerofill DEFAULT '0000' NOT NULL,
+ company_name char(30) DEFAULT '' NOT NULL,
+ founded char(4) DEFAULT '' NOT NULL
+) ENGINE = CSV;
+
+# Corrupt a table -- put a file with wrong # of columns
+--exec perl -e 'print "\"1\",\"101\",\"IBM\"\n";' > $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV
+
+CHECK TABLE test_repair_table5;
+REPAIR TABLE test_repair_table5;
+SELECT * FROM test_repair_table5;
+DROP TABLE test_repair_table5;
+
+
+#
# BUG#13406 - incorrect amount of "records deleted"
#
diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test
index a005b4769c4..dead9a7a0bc 100644
--- a/mysql-test/t/ctype_latin1.test
+++ b/mysql-test/t/ctype_latin1.test
@@ -95,4 +95,18 @@ SET collation_connection='latin1_bin';
CREATE TABLE „a (a int);
SELECT '„a' as str;
+
+#
+# Bug#18321: Can't store EuroSign with latin1_german1_ci and latin1_general_ci
+# The problem was in latin1->utf8->latin1 round trip.
+#
+set @str= _latin1 'ABC €°§ß²³µ~ äöüÄÖÜ áéíóú ÀÈÌÒÙ @ abc';
+SELECT convert(@str collate latin1_bin using utf8);
+SELECT convert(@str collate latin1_general_ci using utf8);
+SELECT convert(@str collate latin1_german1_ci using utf8);
+SELECT convert(@str collate latin1_danish_ci using utf8);
+SELECT convert(@str collate latin1_spanish_ci using utf8);
+SELECT convert(@str collate latin1_german2_ci using utf8);
+SELECT convert(@str collate latin1_swedish_ci using utf8);
+
# End of 4.1 tests
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index c9b2b9fc18f..5ca1f58d233 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -878,6 +878,40 @@ SELECT LENGTH(bug) FROM t2;
DROP TABLE t2;
DROP TABLE t1;
+#
+# Bug#17705: Corruption of compressed index when index length changes between
+# 254 and 256
+#
+
+SET NAMES utf8;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a VARCHAR(255), KEY(a)) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
+INSERT INTO t1 VALUES('uu');
+check table t1;
+INSERT INTO t1 VALUES('uU');
+check table t1;
+INSERT INTO t1 VALUES('uu');
+check table t1;
+INSERT INTO t1 VALUES('uuABC');
+check table t1;
+INSERT INTO t1 VALUES('UuABC');
+check table t1;
+INSERT INTO t1 VALUES('uuABC');
+check table t1;
+alter table t1 add b int;
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',1);
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',2);
+delete from t1 where b=1;
+INSERT INTO t1 VALUES('UUABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',1);
+check table t1;
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',3);
+INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',4);
+delete from t1 where b=3;
+INSERT INTO t1 VALUES('uUABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',3);
+check table t1;
+drop table t1;
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 3777f425774..8827eab6bb5 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -16,31 +16,34 @@ events : test case unstable. andrey will fix
ndb_autodiscover : Needs to be fixed w.r.t binlog
ndb_autodiscover2 : Needs to be fixed w.r.t binlog
#ndb_binlog_basic : Results are not deterministic, Tomas will fix
-#ndb_binlog_ddl_multi : Bug#17038 [PATCH PENDING]
#ndb_binlog_multi : Results are not deterministic, Tomas will fix
+ndb_cache2 : Bug #18597
+ndb_gis : Bug #18600
ndb_load : Bug#17233
partition_03ndb : Bug#16385
ps_7ndb : dbug assert in RBR mode when executing test suite
#rpl_bit_npk : Bug#13418
-rpl_ddl : Bug#15963 SBR does not show "Definer" correctly
+#rpl_ddl : Bug#15963 SBR does not show "Definer" correctly
+rpl_ndb_dd_basic : Bug #18569
rpl_ndb_2innodb : assertion in get_parts_for_update()
rpl_ndb_2myisam : assertion in get_parts_for_update()
rpl_ndb_auto_inc : Bug#17086
-#rpl_ndb_basic : Bug#16228 [IN REVIEW]
+rpl_ndb_basic : Bug #18592
#rpl_ndb_blob : interferes with following tests, causing hang
#rpl_ndb_blob2 : interferes with following tests, causing hang
rpl_ndb_ddl : master hangs
#rpl_ndb_delete_nowhere : Bug#17400: delete & update of rows in table without pk fails
+rpl_ndb_insert_ignore : Bug #18567
rpl_ndb_innodb2ndb : Bug#18261: Cluster Replication: tests rpl_ndb_xxx2ndb fails
-rpl_ndb_insert_ignore : Bugs: #17431: INSERT IGNORE INTO returns failed: 1296
rpl_ndb_myisam2ndb : Bug#18261: Cluster Replication: tests rpl_ndb_xxx2ndb fails
+rpl_ndb_multi_update3 : Bug#18627: Cluster Replication: rpl_ndb_multi_update3 fails on Intel 64 bit
rpl_ndb_log : result not deterministic, TBD if should remove
rpl_ndb_relay_space : Bug#16993
#rpl_ndb_multi_update3 : Bug#17400: delete & update of rows in table without pk fails
-rpl_ndb_sp007 : Bug #17290
+rpl_switch_stm_row_mixed : Bug #18590
rpl_row_inexist_tbl : Disabled since patch makes this test wait forever
rpl_sp : Bug#16456
rpl_until : Unstable test case, bug#15886
sp-goto : GOTO is currently is disabled - will be fixed in the future
mysqldump : BUG#18078
-udf : Need to check if udf_example.so has been built
+udf : Bug#18564 (Permission by Brian)
diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test
index 6036dcb3000..755d4e7775b 100644
--- a/mysql-test/t/events.test
+++ b/mysql-test/t/events.test
@@ -341,9 +341,8 @@ create event закачка on schedule every 10 hour do select get_lock("test_l
--echo "Should return 1 row"
select definer, name, db from mysql.event;
---echo "Should be only 1 process"
---replace_column 1 # 6 #
-show processlist;
+--echo "Should be 0 processes"
+select /*1*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select release_lock("test_lock1");
drop event закачка;
--echo "Should have 0 events"
@@ -359,9 +358,8 @@ select get_lock("test_lock2", 20);
create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20);
--echo "Let some time pass to the event starts"
--sleep 2
---echo "Should have only 3 processes: the scheduler, our conn and the locked event"
---replace_column 1 # 6 #
-show processlist;
+--echo "Should have only 2 processes: the scheduler and the locked event"
+select /*1*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
--echo "Release the mutex, the event worker should finish."
select release_lock("test_lock2");
drop event закачка;
@@ -378,21 +376,18 @@ set global event_scheduler=1;
select get_lock("test_lock2_1", 20);
create event закачка21 on schedule every 10 hour do select get_lock("test_lock2_1", 20);
--sleep 1
---echo "Should see 2 processes, one locked on get_lock("
-#--replace_column 1 # 6 #
-#show processlist;
+--echo "Should see 1 process, locked on get_lock("
+#select /*3*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
--echo "Shutting down the scheduler, it should wait for the running event"
set global event_scheduler=0;
--sleep 1
---echo "Should have only 3 processes: the scheduler, our conn and the locked event"
---replace_column 1 # 6 #
-show processlist;
+--echo "Should have only 2 processes: the scheduler and the locked event"
+select /*4*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
--echo "Release the lock so the child process should finish. Hence the scheduler also"
select release_lock("test_lock2_1");
--sleep 1
---echo "Should have only our process now:"
---replace_column 1 # 6 #
-show processlist;
+--echo "Should see 0 processes now:"
+select /*5*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
drop event закачка21;
####
@@ -441,7 +436,7 @@ drop event e1;
##select get_lock("test_lock3", 20);
##create event закачка on schedule every 10 hour do select get_lock("test_lock3", 20);
##select sleep(2);
-##show processlist;
+##select /*7*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
##drop event закачка;
##select release_lock("test_lock3");
@@ -451,15 +446,13 @@ drop event e1;
##select get_lock("test_lock4", 20);
##create event закачка4 on schedule every 1 second do select get_lock("test_lock4", 20);
##select sleep(3);
-##--replace_column 1 # 6 #
-##show processlist;
+##select /*8*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
##drop event закачка4;
##select release_lock("test_lock4");
##set global event_scheduler=0;
##select sleep(2);
-##--replace_column 1 # 6 #
-##show processlist;
+##select /*9*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
##select count(*) from mysql.event;
drop database events_test;
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index 384b648761a..3f339ff0398 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -1,5 +1,28 @@
create database if not exists events_test;
use events_test;
+
+#
+# START - 16415: Events: event names are case sensitive
+#
+CREATE EVENT lower_case ON SCHEDULE EVERY 1 MINUTE DO SELECT 1;
+--error ER_EVENT_ALREADY_EXISTS
+CREATE EVENT Lower_case ON SCHEDULE EVERY 2 MINUTE DO SELECT 2;
+DROP EVENT Lower_case;
+SET NAMES cp1251;
+CREATE EVENT äîëåí_ðåãèñòúð_1251 ON SCHEDULE EVERY 1 YEAR DO SELECT 100;
+--error ER_EVENT_ALREADY_EXISTS
+CREATE EVENT ÄîËåÍ_ðåãèñòúð_1251 ON SCHEDULE EVERY 2 YEAR DO SELECT 200;
+DROP EVENT ÄîËåÍ_ðåãèñòúð_1251;
+SET NAMES utf8;
+CREATE EVENT долен_региÑтър_утф8 ON SCHEDULE EVERY 3 YEAR DO SELECT 300;
+--error ER_EVENT_ALREADY_EXISTS
+CREATE EVENT ДОЛЕÐ_региÑтър_утф8 ON SCHEDULE EVERY 4 YEAR DO SELECT 400;
+DROP EVENT ДОЛЕÐ_региÑтър_утф8;
+SET NAMES latin1;
+#
+# END - 16415: Events: event names are case sensitive
+#
+
#
# START - BUG#16408: Events: crash for an event in a procedure
#
@@ -54,8 +77,7 @@ end|
delimiter ;|
--sleep 1
--echo "Now if everything is fine the event has compiled and is locked
---replace_column 1 # 6 #
-show processlist;
+select /*1*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select release_lock('test_bug16407');
set global event_scheduler= 0;
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
@@ -72,15 +94,15 @@ create table events_smode_test(ev_name char(10), a date) engine=myisam;
delimiter |;
create event ee_16407_2 on schedule every 60 second do
begin
- select get_lock('ee_16407_2', 60);
+ select get_lock('ee_16407_2', 60) /*ee_16407_2*/;
insert into events_test.events_smode_test values('ee_16407_2','1980-19-02');
end|
---error 1292
+--error ER_TRUNCATED_WRONG_VALUE
insert into events_smode_test values ('test','1980-19-02')|
--echo "This is ok"
create event ee_16407_3 on schedule every 60 second do
begin
- select get_lock('ee_16407_2', 60);
+ select get_lock('ee_16407_2', 60) /*ee_16407_3*/;
insert into events_test.events_smode_test values ('ee_16407_3','1980-02-19');
insert into events_test.events_smode_test values ('ee_16407_3','1980-02-29');
end|
@@ -88,7 +110,7 @@ set sql_mode=""|
--echo "This will insert rows but they will be truncated"
create event ee_16407_4 on schedule every 60 second do
begin
- select get_lock('ee_16407_2', 60);
+ select get_lock('ee_16407_2', 60) /*ee_16407_4*/;
insert into events_test.events_smode_test values ('ee_16407_4','10-11-1956');
end|
delimiter ;|
@@ -97,12 +119,10 @@ set sql_mode="ansi";
select get_lock('ee_16407_2', 60);
set global event_scheduler= 1;
--sleep 1
---replace_column 1 # 6 #
-show processlist;
+select /*2*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select release_lock('ee_16407_2');
--sleep 3
---replace_column 1 # 6 #
-show processlist;
+select /*3*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
set global event_scheduler= 0;
select * from events_smode_test order by ev_name, a;
--echo "OK, last check before we drop them"
@@ -120,12 +140,12 @@ create procedure ee_16407_5_pendant() begin insert into events_test.events_smode
create procedure ee_16407_6_pendant() begin insert into events_test.events_smode_test values('ee_16407_6','2004-02-29'); end|
create event ee_16407_5 on schedule every 60 second do
begin
- select get_lock('ee_16407_5', 60);
+ select get_lock('ee_16407_5', 60) /*ee_16407_5*/;
call events_test.ee_16407_5_pendant();
end|
create event ee_16407_6 on schedule every 60 second do
begin
- select get_lock('ee_16407_5', 60);
+ select get_lock('ee_16407_5', 60) /*ee_16407_6*/;
call events_test.ee_16407_6_pendant();
end|
delimiter ;|
@@ -133,12 +153,12 @@ set sql_mode='ansi';
select get_lock('ee_16407_5', 60);
set global event_scheduler= 1;
--sleep 1
---replace_column 1 # 6 #
-show processlist;
+--echo "Should have 2 locked processes"
+select /*4*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select release_lock('ee_16407_5');
--sleep 3
---replace_column 1 # 6 #
-show processlist;
+--echo "Should have 0 processes locked"
+select /*5*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select * from events_smode_test order by ev_name, a;
--echo "And here we check one more time before we drop the events"
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index 058df9af56b..1b88ed90fa3 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -389,6 +389,14 @@ SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY id;
DROP TABLE t1;
+#
+# Bug #15560: GROUP_CONCAT wasn't ready for WITH ROLLUP queries
+#
+create table t1(f1 int);
+insert into t1 values(1),(2),(3);
+select f1, group_concat(f1+1) from t1 group by f1 with rollup;
+select count(distinct (f1+1)) from t1 group by f1 with rollup;
+drop table t1;
# End of 4.1 tests
#
diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test
index 8dc55532bbf..bff07366ec2 100644
--- a/mysql-test/t/group_min_max.test
+++ b/mysql-test/t/group_min_max.test
@@ -641,6 +641,14 @@ explain select a1,a2,count(a2) from t1 group by a1,a2,b;
explain select a1,a2,count(a2) from t1 where (a1 > 'a') group by a1,a2,b;
explain select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b;
+
+#
+# Bug #16710: select distinct doesn't return all it should
+#
+
+explain select distinct(a1) from t1 where ord(a2) = 98;
+select distinct(a1) from t1 where ord(a2) = 98;
+
#
# BUG#11044: DISTINCT or GROUP BY queries with equality predicates instead of MIN/MAX.
#
@@ -736,3 +744,41 @@ SELECT DISTINCT a FROM t1 WHERE a LIKE 'B%';
SELECT a FROM t1 WHERE a LIKE 'B%' GROUP BY a;
DROP TABLE t1;
+
+
+#
+# Bug #15102: select distinct returns empty result, select count
+# distinct > 0 (correct)
+#
+
+CREATE TABLE t1 (
+ a int(11) NOT NULL DEFAULT '0',
+ b varchar(16) COLLATE latin1_general_ci NOT NULL DEFAULT '',
+ PRIMARY KEY (a,b)
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+delimiter |;
+
+CREATE PROCEDURE a(x INT)
+BEGIN
+ DECLARE rnd INT;
+ DECLARE cnt INT;
+
+ WHILE x > 0 DO
+ SET rnd= x % 100;
+ SET cnt = (SELECT COUNT(*) FROM t1 WHERE a = rnd);
+ INSERT INTO t1(a,b) VALUES (rnd, CAST(cnt AS CHAR));
+ SET x= x - 1;
+ END WHILE;
+END|
+
+DELIMITER ;|
+
+CALL a(1000);
+
+SELECT a FROM t1 WHERE a=0;
+SELECT DISTINCT a FROM t1 WHERE a=0;
+SELECT COUNT(DISTINCT a) FROM t1 WHERE a=0;
+
+DROP TABLE t1;
+DROP PROCEDURE a;
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index f9bd4bddff9..e06d316f084 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -97,9 +97,12 @@ SHOW CHARACTER SET WHERE charset like 'latin1%';
# Test for information_schema.COLLATIONS &
# SHOW COLLATION
+--replace_column 5 #
select * from information_schema.COLLATIONS
where COLLATION_NAME like 'latin1%';
+--replace_column 5 #
SHOW COLLATION LIKE 'latin1%';
+--replace_column 5 #
SHOW COLLATION WHERE collation like 'latin1%';
select * from information_schema.COLLATION_CHARACTER_SET_APPLICABILITY
diff --git a/mysql-test/t/join_nested.test b/mysql-test/t/join_nested.test
index 8adcf05be93..69886d035bf 100644
--- a/mysql-test/t/join_nested.test
+++ b/mysql-test/t/join_nested.test
@@ -942,3 +942,55 @@ SELECT * FROM t1 p LEFT JOIN v1 ON p.id=v1.id
DROP VIEW v1;
DROP TABLE t1,t2,t3;
+
+
+#
+# Test for bug #18279: crash when on conditions are moved out of a nested join
+# to the on conditions for the nest
+
+CREATE TABLE t1 (id1 int PRIMARY KEY, id2 int);
+CREATE TABLE t2 (id1 int PRIMARY KEY, id2 int);
+CREATE TABLE t3 (id1 int PRIMARY KEY, id2 int);
+CREATE TABLE t4 (id1 int PRIMARY KEY, id2 int);
+CREATE TABLE t5 (id1 int PRIMARY KEY, id2 int);
+
+SELECT t1.id1 AS id, t5.id1 AS ngroupbynsa
+ FROM t1 INNER JOIN t2 ON t2.id2 = t1.id1
+ LEFT OUTER JOIN
+ (t3 INNER JOIN t4 ON t4.id1 = t3.id2 INNER JOIN t5 ON t4.id2 = t5.id1)
+ ON t3.id2 IS NOT NULL
+ WHERE t1.id1=2;
+
+PREPARE stmt FROM
+"SELECT t1.id1 AS id, t5.id1 AS ngroupbynsa
+ FROM t1 INNER JOIN t2 ON t2.id2 = t1.id1
+ LEFT OUTER JOIN
+ (t3 INNER JOIN t4 ON t4.id1 = t3.id2 INNER JOIN t5 ON t4.id2 = t5.id1)
+ ON t3.id2 IS NOT NULL
+ WHERE t1.id1=2";
+
+EXECUTE stmt;
+EXECUTE stmt;
+EXECUTE stmt;
+EXECUTE stmt;
+
+INSERT INTO t1 VALUES (1,1), (2,1), (3,2);
+INSERT INTO t2 VALUES (2,1), (3,2), (4,3);
+INSERT INTO t3 VALUES (1,1), (3,2), (2,NULL);
+INSERT INTO t4 VALUES (1,1), (2,1), (3,3);
+INSERT INTO t5 VALUES (1,1), (2,2), (3,3), (4,3);
+
+EXECUTE stmt;
+EXECUTE stmt;
+EXECUTE stmt;
+EXECUTE stmt;
+
+SELECT t1.id1 AS id, t5.id1 AS ngroupbynsa
+ FROM t1 INNER JOIN t2 ON t2.id2 = t1.id1
+ LEFT OUTER JOIN
+ (t3 INNER JOIN t4 ON t4.id1 = t3.id2 INNER JOIN t5 ON t4.id2 = t5.id1)
+ ON t3.id2 IS NOT NULL
+ WHERE t1.id1=2;
+
+DROP TABLE t1,t2,t3,t4,t5;
+
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 03ad56ed2b6..c194213e0c9 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -759,3 +759,23 @@ EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a > IF(t1.a = t2.b
DROP TABLE t1,t2;
+#
+# Test for bug #17164: ORed FALSE blocked conversion of outer join into join
+#
+
+CREATE TABLE t1 (id int(11) NOT NULL PRIMARY KEY, name varchar(20),
+ INDEX (name)) ENGINE=InnoDB;
+CREATE TABLE t2 (id int(11) NOT NULL PRIMARY KEY, fkey int(11),
+ FOREIGN KEY (fkey) REFERENCES t2(id)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,'A1'),(2,'A2'),(3,'B');
+INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3);
+
+EXPLAIN
+SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
+ WHERE t1.name LIKE 'A%';
+
+EXPLAIN
+SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
+ WHERE t1.name LIKE 'A%' OR FALSE;
+
+DROP TABLE t1,t2;
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index 0d2266fc2ae..3d07ec98d69 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -95,6 +95,25 @@ reap;
connection locker;
drop table t1;
+#
+# Same test as above, but with the dropped table locked twice
+#
+
+connection locker;
+create table t1 (a int);
+create table t2 (a int);
+lock table t1 write, t2 write, t1 as t1_2 write, t2 as t2_2 write;
+connection reader;
+send insert t1 select * from t2;
+connection locker;
+drop table t2;
+connection reader;
+--error 1146
+reap;
+connection locker;
+drop table t1;
+
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/ndb_condition_pushdown.test b/mysql-test/t/ndb_condition_pushdown.test
index 9f512430085..44740c1a486 100644
--- a/mysql-test/t/ndb_condition_pushdown.test
+++ b/mysql-test/t/ndb_condition_pushdown.test
@@ -2,7 +2,7 @@
-- source include/not_embedded.inc
--disable_warnings
-DROP TABLE IF EXISTS t1,t2;
+DROP TABLE IF EXISTS t1,t2,t3,t4;
--enable_warnings
#
@@ -1639,5 +1639,15 @@ select * from t2 where (attr1 < 2) = (attr2 < 2) order by pk1;
explain
select * from t3 left join t4 on t4.attr2 = t3.attr2 where t4.attr1 > 1 and t4.attr3 < 5 or t4.attr1 is null order by t4.pk1;
+# bug#15722
+create table t5 (a int primary key auto_increment, b tinytext not null)
+engine = ndb;
+insert into t5 (b) values ('jonas'), ('jensing'), ('johan');
+set engine_condition_pushdown = off;
+select * from t5 where b like '%jo%' order by a;
+set engine_condition_pushdown = on;
+explain select * from t5 where b like '%jo%';
+select * from t5 where b like '%jo%' order by a;
+
set engine_condition_pushdown = @old_ecpd;
-DROP TABLE t1,t2,t3,t4;
+DROP TABLE t1,t2,t3,t4,t5;
diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test
index 92bc51bcf4f..bf25ca9a133 100644
--- a/mysql-test/t/ndb_insert.test
+++ b/mysql-test/t/ndb_insert.test
@@ -591,14 +591,14 @@ DELETE FROM t1 WHERE pk1 = 2 OR pk1 = 4 OR pk1 = 6;
INSERT INTO t1 VALUES(1,1,1),(2,2,17),(3,4,5) ON DUPLICATE KEY UPDATE pk1=b;
select * from t1 where pk1 = b and b != c order by pk1;
-# The following test case currently does not work
-#DELETE FROM t1;
-#CREATE UNIQUE INDEX bi ON t1(b);
-#INSERT INTO t1 VALUES
-#(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
-#(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
-#INSERT INTO t1 VALUES(0,1,0),(21,21,21) ON DUPLICATE KEY UPDATE pk1=b+10,c=b+10;
-#select * from t1 order by pk1;
+# Test handling of duplicate unique
+DELETE FROM t1;
+CREATE UNIQUE INDEX bi ON t1(b);
+INSERT INTO t1 VALUES
+(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),
+(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10);
+INSERT INTO t1 VALUES(0,1,0),(21,21,21) ON DUPLICATE KEY UPDATE pk1=b+10,b=b+10;
+select * from t1 order by pk1;
DROP TABLE t1;
@@ -614,7 +614,20 @@ INSERT IGNORE INTO t1 SELECT a FROM t1;
INSERT IGNORE INTO t1 SELECT a FROM t1;
INSERT IGNORE INTO t1 VALUES (1);
INSERT IGNORE INTO t1 VALUES (1);
-SELECT * FROM t1;
+SELECT * FROM t1 ORDER BY a;
+DELETE FROM t1;
+CREATE UNIQUE INDEX ai ON t1(a);
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (NULL),(2);
+SELECT * FROM t1 ORDER BY a;
+DROP TABLE t1;
+
+# Ignore and NULL values
+CREATE TABLE t1(pk INT NOT NULL PRIMARY KEY, a INT, UNIQUE (a)) ENGINE=ndb;
+INSERT IGNORE INTO t1 VALUES (1,1),(2,2),(3,3);
+INSERT IGNORE INTO t1 VALUES (4,NULL),(5,NULL),(6,NULL),(7,4);
+SELECT * FROM t1 ORDER BY pk;
DROP TABLE t1;
# End of 4.1 tests
diff --git a/mysql-test/t/ndb_partition_key.test b/mysql-test/t/ndb_partition_key.test
index d43dc7e49e4..87933671529 100644
--- a/mysql-test/t/ndb_partition_key.test
+++ b/mysql-test/t/ndb_partition_key.test
@@ -153,3 +153,28 @@ b'0',
ALTER TABLE t1 COALESCE PARTITION 4;
DROP TABLE t1;
+
+#
+# BUG 16806: ALTER TABLE fails
+#
+CREATE TABLE t1 (
+ c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
+ c2 TEXT NOT NULL,
+ c3 INT NOT NULL,
+ PRIMARY KEY(c1,c3))
+ ENGINE=NDB
+ PARTITION BY KEY(c3) PARTITIONS 5;
+
+ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
+ c2 TEXT NOT NULL,
+ c3 INT NOT NULL,
+ PRIMARY KEY(c1,c3))
+ ENGINE=NDB
+ PARTITION BY KEY(c3);
+
+ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
+DROP TABLE t1;
diff --git a/mysql-test/t/ndb_read_multi_range.test b/mysql-test/t/ndb_read_multi_range.test
index b1bf7fe4258..855f7789032 100644
--- a/mysql-test/t/ndb_read_multi_range.test
+++ b/mysql-test/t/ndb_read_multi_range.test
@@ -200,3 +200,41 @@ select * from t2 order by a;
drop table t2;
drop table t1;
+
+# bug17729
+
+CREATE TABLE t1 (
+ a int(11) NOT NULL,
+ b int(11) NOT NULL,
+ c datetime default NULL,
+ PRIMARY KEY (a),
+ KEY idx_bc (b,c)
+) ENGINE=ndbcluster;
+
+INSERT INTO t1 VALUES
+(406989,67,'2006-02-23 17:08:46'), (150078,67,'2005-10-26 11:17:45'),
+(406993,67,'2006-02-27 11:20:57'), (245655,67,'2005-12-08 15:59:08'),
+(406994,67,'2006-02-27 11:26:46'), (256,67,NULL),
+(398341,67,'2006-02-20 04:48:44'), (254,67,NULL),(1120,67,NULL),
+(406988,67,'2006-02-23 17:07:22'), (255,67,NULL),
+(398340,67,'2006-02-20 04:38:53'),(406631,67,'2006-02-23 10:49:42'),
+(245653,67,'2005-12-08 15:59:07'),(406992,67,'2006-02-24 16:47:18'),
+(245654,67,'2005-12-08 15:59:08'),(406995,67,'2006-02-28 11:55:00'),
+(127261,67,'2005-10-13 12:17:58'),(406991,67,'2006-02-24 16:42:32'),
+(245652,67,'2005-12-08 15:58:27'),(398545,67,'2006-02-20 04:53:13'),
+(154504,67,'2005-10-28 11:53:01'),(9199,67,NULL),(1,67,'2006-02-23 15:01:35'),
+(223456,67,NULL),(4101,67,NULL),(1133,67,NULL),
+(406990,67,'2006-02-23 18:01:45'),(148815,67,'2005-10-25 15:34:17'),
+(148812,67,'2005-10-25 15:30:01'),(245651,67,'2005-12-08 15:58:27'),
+(154503,67,'2005-10-28 11:52:38');
+
+create table t11 select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 asc;
+create table t12 select * from t1 where b = 67 AND (c IS NULL OR c > NOW()) order by 3 desc;
+create table t21 select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 asc;
+create table t22 select * from t1 where b = 67 AND (c IS NULL OR c > '2005-12-08') order by 3 desc;
+
+select * from t11 order by 1,2,3;
+select * from t12 order by 1,2,3;
+select * from t21 order by 1,2,3;
+select * from t22 order by 1,2,3;
+DROP TABLE t1, t11, t12, t21, t22;
diff --git a/mysql-test/t/ndb_replace.test b/mysql-test/t/ndb_replace.test
index b97a0322a6a..6cad80ef8ea 100644
--- a/mysql-test/t/ndb_replace.test
+++ b/mysql-test/t/ndb_replace.test
@@ -27,4 +27,15 @@ replace into t1 (gesuchnr,benutzer_id) values (1,1);
select * from t1 order by gesuchnr;
drop table t1;
+# bug#17431
+CREATE TABLE t1(i INT PRIMARY KEY AUTO_INCREMENT,
+ j INT,
+ k INT,
+ UNIQUE INDEX(j)
+ ) ENGINE = ndb;
+INSERT INTO t1 VALUES (1,1,23),(2,2,24);
+REPLACE INTO t1 (j,k) VALUES (1,42);
+REPLACE INTO t1 (i,j) VALUES (17,2);
+SELECT * from t1 ORDER BY i;
+
# End of 4.1 tests
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index ad01977a458..a3aa3f6f025 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -849,4 +849,111 @@ CALL test.p1(12);
CALL test.p1(13);
drop table t1;
+#
+# Bug 13520: Problem with delimiters in COMMENT DATA DIRECTORY ..
+#
+CREATE TABLE t1 (a int not null)
+partition by key(a)
+(partition p0 COMMENT='first partition');
+drop table t1;
+
+#
+# Bug 13433: Problem with delimited identifiers
+#
+CREATE TABLE t1 (`a b` int not null)
+partition by key(`a b`);
+drop table t1;
+
+CREATE TABLE t1 (`a b` int not null)
+partition by hash(`a b`);
+drop table t1;
+
+#
+# Bug#18053 Partitions: crash if null
+# Bug#18070 Partitions: wrong result on WHERE ... IS NULL
+#
+create table t1 (f1 integer) partition by range(f1)
+(partition p1 values less than (0), partition p2 values less than (10));
+insert into t1 set f1 = null;
+select * from t1 where f1 is null;
+explain partitions select * from t1 where f1 is null;
+drop table t1;
+
+create table t1 (f1 integer) partition by list(f1)
+(partition p1 values in (1), partition p2 values in (null));
+insert into t1 set f1 = null;
+insert into t1 set f1 = 1;
+select * from t1 where f1 is null or f1 = 1;
+drop table t1;
+
+create table t1 (f1 smallint)
+partition by list (f1) (partition p0 values in (null));
+insert into t1 values (null);
+select * from t1 where f1 is null;
+drop table t1;
+
+create table t1 (f1 smallint)
+partition by range (f1) (partition p0 values less than (0));
+insert into t1 values (null);
+select * from t1 where f1 is null;
+drop table t1;
+
+create table t1 (f1 integer) partition by list(f1)
+(
+ partition p1 values in (1),
+ partition p2 values in (NULL),
+ partition p3 values in (2),
+ partition p4 values in (3),
+ partition p5 values in (4)
+);
+
+insert into t1 values (1),(2),(3),(4),(null);
+select * from t1 where f1 < 3;
+explain partitions select * from t1 where f1 < 3;
+select * from t1 where f1 is null;
+explain partitions select * from t1 where f1 is null;
+drop table t1;
+
+create table t1 (f1 int) partition by list(f1 div 2)
+(
+ partition p1 values in (1),
+ partition p2 values in (NULL),
+ partition p3 values in (2),
+ partition p4 values in (3),
+ partition p5 values in (4)
+);
+
+insert into t1 values (2),(4),(6),(8),(null);
+select * from t1 where f1 < 3;
+explain partitions select * from t1 where f1 < 3;
+select * from t1 where f1 is null;
+explain partitions select * from t1 where f1 is null;
+drop table t1;
+
+create table t1 (a int) partition by LIST(a) (
+ partition pn values in (NULL),
+ partition p0 values in (0),
+ partition p1 values in (1),
+ partition p2 values in (2)
+);
+insert into t1 values (NULL),(0),(1),(2);
+select * from t1 where a is null or a < 2;
+explain partitions select * from t1 where a is null or a < 2;
+select * from t1 where a is null or a < 0 or a > 1;
+explain partitions select * from t1 where a is null or a < 0 or a > 1;
+drop table t1;
+
+#
+#Bug# 17631 SHOW TABLE STATUS reports wrong engine
+#
+CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, name VARCHAR(20))
+ENGINE=MyISAM DEFAULT CHARSET=latin1
+PARTITION BY RANGE(id)
+(PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM,
+PARTITION p1 VALUES LESS THAN (20) ENGINE = MyISAM,
+PARTITION p2 VALUES LESS THAN (30) ENGINE = MyISAM);
+--replace_column 6 0 7 0 8 0 9 0 12 NULL 13 NULL 14 NULL
+SHOW TABLE STATUS;
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/partition_mgm_err2.test b/mysql-test/t/partition_mgm_err2.test
index 157ba4d70d2..dd96731ccdd 100644
--- a/mysql-test/t/partition_mgm_err2.test
+++ b/mysql-test/t/partition_mgm_err2.test
@@ -1,6 +1,7 @@
#
# Test of partitions that require symlinks
#
+-- source include/have_partition.inc
-- require r/have_symlink.require
disable_query_log;
diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test
index 30f4f37ee04..63d389f2c06 100644
--- a/mysql-test/t/partition_pruning.test
+++ b/mysql-test/t/partition_pruning.test
@@ -447,5 +447,51 @@ show status like 'Handler_read_next';
drop table t1, t2;
+# BUG#18025
+# part1: mediumint columns
+create table t1 ( f_int1 mediumint, f_int2 integer)
+partition by list(mod(f_int1,4)) (
+ partition p_3 values in (-3),
+ partition p_2 values in (-2),
+ partition p_1 values in (-1),
+ partition p0 values in (0),
+ partition p1 values in (1),
+ partition p2 values in (2),
+ partition p3 values in (3)
+);
+
+insert into t1 values (9, 9), (8, 8), (7, 7), (6, 6), (5, 5),
+ (4, 4), (3, 3), (2, 2), (1, 1);
+select * from t1 where f_int1 between 5 and 15 order by f_int1;
+
+drop table t1;
+
+# part2: bug in pruning code
+create table t1 (a char(10)) partition by list(length(a)) (
+ partition p1 values in (1),
+ partition p2 values in (2),
+ partition p3 values in (3),
+ partition p4 values in (4),
+ partition p5 values in (5)
+);
+insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee');
+select * from t1 where a>='a' and a <= 'dddd';
+explain partitions select * from t1 where a>='a' and a <= 'dddd';
+drop table t1;
+
+# BUG#18659: Assertion failure when subpartitioning is used and partition is
+# "IS NULL"
+create table t1 (f_int1 integer) partition by list(abs(mod(f_int1,2)))
+ subpartition by hash(f_int1) subpartitions 2
+(
+ partition part1 values in (0),
+ partition part2 values in (1),
+ partition part4 values in (null)
+);
+insert into t1 set f_int1 = null;
+
+select * from t1 where f_int1 is null;
+explain partitions select * from t1 where f_int1 is null;
+
# No tests for NULLs in RANGE(monotonic_expr()) - they depend on BUG#15447
# being fixed.
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index ffbba991fb6..b54efcad3a3 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -933,4 +933,38 @@ execute ins_call;
select row_count();
drop table t1;
+#
+# BUG#16474: SP crashed MySQL
+# (when using "order by localvar", where 'localvar' is just that.
+# The actual bug test is in sp.test, this is just testing that we get the
+# expected result for prepared statements too, i.e. place holders work as
+# textual substitution. If it's a single integer, it works as the (deprecated)
+# "order by column#", otherwise it's an expression.
+#
+create table t1 (a int, b int);
+insert into t1 (a,b) values (2,8),(1,9),(3,7);
+
+# Will order by index
+prepare stmt from "select * from t1 order by ?";
+execute stmt using @a;
+set @a=1;
+execute stmt using @a;
+set @a=2;
+execute stmt using @a;
+deallocate prepare stmt;
+# For reference:
+select * from t1 order by 1;
+
+# Will not order by index.
+prepare stmt from "select * from t1 order by ?+1";
+set @a=0;
+execute stmt using @a;
+set @a=1;
+execute stmt using @a;
+deallocate prepare stmt;
+# For reference:
+select * from t1 order by 1+1;
+
+drop table t1;
+
# End of 5.0 tests
diff --git a/mysql-test/t/rpl_ndb_sp007.test b/mysql-test/t/rpl_ndb_sp007.test
deleted file mode 100644
index 767fd105518..00000000000
--- a/mysql-test/t/rpl_ndb_sp007.test
+++ /dev/null
@@ -1,9 +0,0 @@
-#################################
-# Wrapper for rpl_row_sp007.test#
-# These tests have been wrapped #
-# so the same code can be used #
-# For different engines #
-#################################
--- source include/have_ndb.inc
-let $engine_type=NDBCLUSTER;
--- source extra/rpl_tests/rpl_row_sp007.test
diff --git a/mysql-test/t/rpl_row_basic_8partition.test b/mysql-test/t/rpl_row_basic_8partition.test
new file mode 100644
index 00000000000..0e2518817fa
--- /dev/null
+++ b/mysql-test/t/rpl_row_basic_8partition.test
@@ -0,0 +1,204 @@
+############################################################
+# Author: MATZ #
+# Date: 2006-03-22 #
+# Purpose: See if replication of partition tables work #
+# Most of this test is copied from the rpl_xxx2yyy tests, #
+# but here we just test some simple basic replication of #
+# partition tables with same engine (MyISAM) in both ends. #
+############################################################
+
+--source include/master-slave.inc
+connection master;
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+SET BINLOG_FORMAT=ROW;
+
+--echo **** Partition RANGE testing ****
+
+# Create table that is partitioned by range on year i.e. year(t) and
+# replicate basice operations such at insert, update delete between 2
+# different storage engines Alter table and ensure table is handled
+# Correctly on the slave
+# Note that the storage engine should not be explicit: the default
+# storage engine is used on master and slave.
+
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+ bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+ f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+ y YEAR, t DATE)
+ PARTITION BY RANGE (YEAR(t))
+ (PARTITION p0 VALUES LESS THAN (1901),
+ PARTITION p1 VALUES LESS THAN (1946),
+ PARTITION p2 VALUES LESS THAN (1966),
+ PARTITION p3 VALUES LESS THAN (1986),
+ PARTITION p4 VALUES LESS THAN (2005),
+ PARTITION p5 VALUES LESS THAN MAXVALUE);
+
+--echo --- On master ---
+SHOW CREATE TABLE t1;
+
+--echo --- On slave --
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--source include/rpl_multi_engine3.inc
+
+connection master;
+# Check that simple Alter statements are replicated correctly
+ALTER TABLE t1 MODIFY vc TEXT;
+
+--echo --- On master ---
+SHOW CREATE TABLE t1;
+
+--echo --- On slave ---
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+# Perform basic operation on master and ensure replicated correctly
+--source include/rpl_multi_engine3.inc
+
+connection master;
+DROP TABLE IF EXISTS t1;
+
+########################################################
+
+--echo **** Partition LIST testing ****
+
+# Create table that is partitioned by list on id i.e. (2,4). Pretend
+# that we missed one and alter to add. Then replicate basice
+# operations such at insert, update delete between 2 different storage
+# engines Alter table and ensure table is handled Correctly on the
+# slave.
+
+
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+ bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+ f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+ y YEAR, t DATE)
+ PARTITION BY LIST(id)
+ (PARTITION p0 VALUES IN (2, 4),
+ PARTITION p1 VALUES IN (42, 142),
+ PARTITION p2 VALUES IN (412));
+
+--echo --- On master ---
+SHOW CREATE TABLE t1;
+
+--echo --- On slave ---
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+# Perform basic operation on master and ensure replicated correctly
+--source include/rpl_multi_engine3.inc
+
+connection master;
+# Check that simple Alter statements are replicated correctly ---
+ALTER TABLE t1 MODIFY vc TEXT;
+
+--echo --- On master ---
+SHOW CREATE TABLE t1;
+
+--echo --- On slave ---
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+# Perform basic operation on master and ensure replicated correctly
+--source include/rpl_multi_engine3.inc
+
+connection master;
+DROP TABLE IF EXISTS t1;
+
+########################################################
+
+--echo **** Partition HASH testing ****
+
+# Create table that is partitioned by hash on year i.e. YEAR(t). Then
+# replicate basice operations such at insert, update delete between 2
+# different storage engines Alter table and ensure table is handled
+# Correctly on the slave
+
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+ bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+ f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+ y YEAR, t DATE)
+ PARTITION BY HASH( YEAR(t) )
+ PARTITIONS 4;
+
+--echo --- On master ---
+SHOW CREATE TABLE t1;
+
+--echo --- On slave ---
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--source include/rpl_multi_engine3.inc
+
+# Check that simple Alter statements are replicated correctly
+ALTER TABLE t1 MODIFY vc TEXT;
+
+--echo --- On master ---
+SHOW CREATE TABLE t1;
+
+--echo --- On slave ---
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--source include/rpl_multi_engine3.inc
+
+connection master;
+DROP TABLE IF EXISTS t1;
+
+########################################################
+
+# This part does not work
+--echo **** Partition by KEY ****
+
+# Create table that is partitioned by key on id with 4 parts. Then
+# replicate basice operations such at insert, update delete between 2
+# different storage engines Alter table and ensure table is handled
+# Correctly on the slave
+
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
+ bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
+ f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
+ y YEAR, t DATE,PRIMARY KEY(id))
+ PARTITION BY KEY()
+ PARTITIONS 4;
+
+--echo --- On master ---
+SHOW CREATE TABLE t1;
+
+--echo --- On slave ---
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--source include/rpl_multi_engine3.inc
+
+connection master;
+# Check that simple Alter statements are replicated correctly
+ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
+
+--echo --- On master ---
+SHOW CREATE TABLE t1;
+
+--echo --- On slave ---
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--source include/rpl_multi_engine3.inc
+
+connection master;
+# Check that simple Alter statements are replicated correctly
+ALTER TABLE t1 MODIFY vc TEXT;
+
+--echo --- On master ---
+SHOW CREATE TABLE t1;
+
+--echo --- On slave ---
+sync_slave_with_master;
+SHOW CREATE TABLE t1;
+
+--source include/rpl_multi_engine3.inc
+
+DROP TABLE IF EXISTS t1;
+
+# End of 5.1 test case
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 01d5f2eb4d1..c4fe1906cbc 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -2848,3 +2848,26 @@ drop table t1,t2;
#
--error 1064
select * from (select * left join t on f1=f2) tt;
+
+#
+# Bug #16504: re-evaluation of Item_equal object after reading const table
+#
+
+CREATE TABLE t1 (sku int PRIMARY KEY, pr int);
+CREATE TABLE t2 (sku int PRIMARY KEY, sppr int, name varchar(255));
+
+INSERT INTO t1 VALUES
+ (10, 10), (20, 10), (30, 20), (40, 30), (50, 10), (60, 10);
+
+INSERT INTO t2 VALUES
+ (10, 10, 'aaa'), (20, 10, 'bbb'), (30, 10, 'ccc'), (40, 20, 'ddd'),
+ (50, 10, 'eee'), (60, 20, 'fff'), (70, 20, 'ggg'), (80, 30, 'hhh');
+
+SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr
+ FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku);
+EXPLAIN
+SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr
+ FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku);
+
+
+DROP TABLE t1,t2;
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index da40cdf643a..c9ce26b6dda 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -904,12 +904,26 @@ end|
#
# BUG#9529: Stored Procedures: No Warning on truncation of procedure name
# during creation.
-# Note: When using utf8 for mysql.proc, this limit is much higher than before
+# BUG#17015: Routine name truncation not an error
+# When we started using utf8 for mysql.proc, this limit appeared
+# to be higher, but in reality the names were truncated.
--error ER_TOO_LONG_IDENT
-create procedure bug9529_90123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123()
+create procedure bug9529_901234567890123456789012345678901234567890123456789012345()
begin
end|
+--disable_warnings
+drop procedure if exists bug17015_0123456789012345678901234567890123456789012345678901234|
+--enable_warnings
+# Check the upper limit, just to make sure.
+create procedure bug17015_0123456789012345678901234567890123456789012345678901234()
+begin
+end|
+
+--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+show procedure status like 'bug17015%'|
+drop procedure bug17015_0123456789012345678901234567890123456789012345678901234|
+
#
# BUG#10969: Stored procedures: crash if default() function
@@ -1717,4 +1731,3 @@ end|
#drop procedure if exists bugNNNN|
#--enable_warnings
#create procedure bugNNNN...
-
diff --git a/mysql-test/t/sp-prelocking.test b/mysql-test/t/sp-prelocking.test
index edb8ae5b92d..6287950d216 100644
--- a/mysql-test/t/sp-prelocking.test
+++ b/mysql-test/t/sp-prelocking.test
@@ -240,3 +240,37 @@ drop function f1;
drop function f2;
drop function f3;
drop procedure sp1;
+
+#
+# Bug#15683 "crash, Function on nested VIEWs, Prepared statement"
+# Check that when creating the prelocking list a nested view
+# is not merged until it's used.
+#
+--disable_warnings
+drop table if exists t1;
+drop view if exists v1, v2, v3;
+drop function if exists bug15683;
+--enable_warnings
+create table t1 (f1 bigint, f2 varchar(20), f3 bigint);
+insert into t1 set f1 = 1, f2 = 'schoenenbourg', f3 = 1;
+create view v1 as select 1 from t1 union all select 1;
+create view v2 as select 1 from v1;
+create view v3 as select 1 as f1 from v2;
+
+delimiter |;
+create function bug15683() returns bigint
+begin
+return (select count(*) from v3);
+end|
+delimiter ;|
+
+prepare stmt from "select bug15683()";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+drop table t1;
+drop view v1, v2, v3;
+drop function bug15683;
+#
+# End of 5.0 tests
+#
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 3b1ee7f5076..fe306126e45 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -5654,6 +5654,42 @@ drop function bug13575;
drop table t3|
#
+# BUG#16474: SP crashed MySQL
+# (when using "order by localvar", where 'localvar' is just that.
+#
+--disable_warnings
+drop procedure if exists bug16474_1|
+drop procedure if exists bug16474_2|
+--enable_warnings
+
+delete from t1|
+insert into t1 values ('c', 2), ('b', 3), ('a', 1)|
+
+create procedure bug16474_1()
+begin
+ declare x int;
+
+ select id from t1 order by x;
+end|
+
+# This does NOT order by column index; variable is an expression.
+create procedure bug16474_2(x int)
+ select id from t1 order by x|
+
+call bug16474_1()|
+call bug16474_2(1)|
+call bug16474_2(2)|
+drop procedure bug16474_1|
+drop procedure bug16474_2|
+
+# For reference: user variables are expressions too and do not affect ordering.
+set @x = 2|
+select * from t1 order by @x|
+
+delete from t1|
+
+
+#
# BUG#NNNN: New bug synopsis
#
#--disable_warnings
diff --git a/mysql-test/t/trigger-trans.test b/mysql-test/t/trigger-trans.test
new file mode 100644
index 00000000000..5c135d98878
--- /dev/null
+++ b/mysql-test/t/trigger-trans.test
@@ -0,0 +1,52 @@
+# Tests which involve triggers and transactions
+# (or just InnoDB storage engine)
+--source include/have_innodb.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+# Test for bug #18153 "OPTIMIZE/ALTER on transactional tables corrupt
+# triggers/triggers are lost".
+
+create table t1 (a varchar(16), b int) engine=innodb;
+delimiter |;
+create trigger t1_bi before insert on t1 for each row
+begin
+ set new.a := upper(new.a);
+ set new.b := new.b + 3;
+end|
+delimiter ;|
+select trigger_schema, trigger_name, event_object_schema,
+ event_object_table, action_statement from information_schema.triggers
+ where event_object_schema = 'test' and event_object_table = 't1';
+insert into t1 values ('The Lion', 10);
+select * from t1;
+optimize table t1;
+select trigger_schema, trigger_name, event_object_schema,
+ event_object_table, action_statement from information_schema.triggers
+ where event_object_schema = 'test' and event_object_table = 't1';
+insert into t1 values ('The Unicorn', 20);
+select * from t1;
+alter table t1 add column c int default 0;
+select trigger_schema, trigger_name, event_object_schema,
+ event_object_table, action_statement from information_schema.triggers
+ where event_object_schema = 'test' and event_object_table = 't1';
+insert into t1 values ('Alice', 30, 1);
+select * from t1;
+# Special tricky cases allowed by ALTER TABLE ... RENAME
+alter table t1 rename to t1;
+select trigger_schema, trigger_name, event_object_schema,
+ event_object_table, action_statement from information_schema.triggers
+ where event_object_schema = 'test' and event_object_table = 't1';
+insert into t1 values ('The Crown', 40, 1);
+select * from t1;
+alter table t1 rename to t1, add column d int default 0;
+select trigger_schema, trigger_name, event_object_schema,
+ event_object_table, action_statement from information_schema.triggers
+ where event_object_schema = 'test' and event_object_table = 't1';
+insert into t1 values ('The Pie', 50, 1, 1);
+select * from t1;
+drop table t1;
+
+# End of 5.0 tests
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test
index 1d68b519f1d..c5925bbd9d5 100644
--- a/mysql-test/t/trigger.test
+++ b/mysql-test/t/trigger.test
@@ -7,6 +7,7 @@ drop table if exists t1, t2, t3, t4;
drop view if exists v1;
drop database if exists mysqltest;
drop function if exists f1;
+drop function if exists f2;
drop procedure if exists p1;
--enable_warnings
@@ -1017,6 +1018,29 @@ select trigger_schema, trigger_name, event_object_schema,
# There should be no fantom .TRN files
--error ER_TRG_DOES_NOT_EXIST
drop trigger test.t1_bi;
+# Let us also check handling of this restriction in ALTER TABLE ... RENAME
+--error ER_TRG_IN_WRONG_SCHEMA
+alter table t1 rename to test.t1;
+insert into t1 values (103);
+select @a;
+select trigger_schema, trigger_name, event_object_schema,
+ event_object_table, action_statement from information_schema.triggers
+ where event_object_schema = 'test' or event_object_schema = 'mysqltest';
+# Again there should be no fantom .TRN files
+--error ER_TRG_DOES_NOT_EXIST
+drop trigger test.t1_bi;
+--error ER_TRG_IN_WRONG_SCHEMA
+alter table t1 rename to test.t1, add column val int default 0;
+insert into t1 values (104);
+select @a;
+select trigger_schema, trigger_name, event_object_schema,
+ event_object_table, action_statement from information_schema.triggers
+ where event_object_schema = 'test' or event_object_schema = 'mysqltest';
+# Table definition should not change
+show create table t1;
+# And once again check for fantom .TRN files
+--error ER_TRG_DOES_NOT_EXIST
+drop trigger test.t1_bi;
drop trigger t1_bi;
drop table t1;
drop database mysqltest;
@@ -1057,3 +1081,36 @@ create table t1 (i int);
create trigger t1_bi before insert on t1 for each row return 0;
insert into t1 values (1);
drop table t1;
+
+# Test for bug #17764 "Trigger crashes MyISAM table"
+#
+# Table was reported as crashed when it was subject table of trigger invoked
+# by insert statement which was executed with enabled bulk insert mode (which
+# is actually set of optimizations enabled by handler::start_bulk_insert())
+# and this trigger also explicitly referenced it.
+# The same problem arose when table to which bulk insert was done was also
+# referenced in function called by insert statement.
+create table t1 (a varchar(64), b int);
+create table t2 like t1;
+create trigger t1_ai after insert on t1 for each row
+ set @a:= (select max(a) from t1);
+insert into t1 (a) values
+ ("Twas"),("brillig"),("and"),("the"),("slithy"),("toves"),
+ ("Did"),("gyre"),("and"),("gimble"),("in"),("the"),("wabe");
+create trigger t2_ai after insert on t2 for each row
+ set @a:= (select max(a) from t2);
+insert into t2 select * from t1;
+load data infile '../std_data_ln/words.dat' into table t1 (a);
+drop trigger t1_ai;
+drop trigger t2_ai;
+# Test that the problem for functions is fixed as well
+create function f1() returns int return (select max(b) from t1);
+insert into t1 values
+ ("All",f1()),("mimsy",f1()),("were",f1()),("the",f1()),("borogoves",f1()),
+ ("And",f1()),("the",f1()),("mome", f1()),("raths",f1()),("outgrabe",f1());
+create function f2() returns int return (select max(b) from t2);
+insert into t2 select a, f2() from t1;
+load data infile '../std_data_ln/words.dat' into table t1 (a) set b:= f1();
+drop table t1;
+drop function f1;
+drop function f2;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index eb7940158ff..fd9589a6f59 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -2404,3 +2404,38 @@ update v2 set b=3 where a=2;
select * from v2;
drop view v2, v1;
drop table t1;
+
+#
+# Bug #18386: select from view over a table with ORDER BY view_col clause
+# given view_col is not an image of any column from the base table
+
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (1), (2);
+
+CREATE VIEW v1 AS SELECT SQRT(a) my_sqrt FROM t1;
+
+SELECT my_sqrt FROM v1 ORDER BY my_sqrt;
+
+DROP VIEW v1;
+DROP TABLE t1;
+
+#
+# Bug #18237: invalid count optimization applied to an outer join with a view
+#
+
+CREATE TABLE t1 (id int PRIMARY KEY);
+CREATE TABLE t2 (id int PRIMARY KEY);
+
+INSERT INTO t1 VALUES (1), (3);
+INSERT INTO t2 VALUES (1), (2), (3);
+
+CREATE VIEW v2 AS SELECT * FROM t2;
+
+SELECT COUNT(*) FROM t1 LEFT JOIN t2 ON t1.id=t2.id;
+SELECT * FROM t1 LEFT JOIN t2 ON t1.id=t2.id;
+
+SELECT COUNT(*) FROM t1 LEFT JOIN v2 ON t1.id=v2.id;
+
+DROP VIEW v2;
+
+DROP TABLE t1, t2;
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index bcca7c252ab..69e4ee933b8 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -153,6 +153,15 @@
fun:gzflush
}
+{
+ libz deflate3
+ Memcheck:Cond
+ obj:*/libz.so.*
+ obj:*/libz.so.*
+ fun:deflate
+ fun:do_flush
+}
+
#
# Warning from my_thread_init becasue mysqld dies before kill thread exists
#
diff --git a/mysys/Makefile.am b/mysys/Makefile.am
index 121342bec87..51ea249bbf6 100644
--- a/mysys/Makefile.am
+++ b/mysys/Makefile.am
@@ -58,7 +58,9 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \
my_handler.c my_netware.c my_largepage.c \
my_windac.c my_access.c base64.c
EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
- thr_mutex.c thr_rwlock.c
+ thr_mutex.c thr_rwlock.c \
+ cmakelists.txt mf_soundex.c \
+ my_conio.c my_wincond.c my_winsem.c my_winthread.c
libmysys_a_LIBADD = @THREAD_LOBJECTS@
# test_dir_DEPENDENCIES= $(LIBRARIES)
# testhash_DEPENDENCIES= $(LIBRARIES)
diff --git a/mysys/cmakelists.txt b/mysys/cmakelists.txt
index ceecc1368ec..5a3b8f1657e 100644
--- a/mysys/cmakelists.txt
+++ b/mysys/cmakelists.txt
@@ -1,5 +1,13 @@
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
+SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+
+# Need to set USE_TLS, since mysys is linked into libmysql.dll and
+# libmysqld.dll, and __declspec(thread) approach to thread local storage does
+# not work properly in DLLs.
+# Currently, USE_TLS crashes in Debug builds, so until that is fixed Debug
+# .dlls cannot be loaded at runtime.
+SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DUSE_TLS")
+SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DUSE_TLS")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/include)
ADD_LIBRARY(mysys array.c charset-def.c charset.c checksum.c default.c default_modify.c
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 3b5e277b56d..b8c74ddb86b 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -550,7 +550,7 @@ finish:
}
#endif
keycache_pthread_mutex_unlock(&keycache->cache_lock);
- return blocks;
+ DBUG_RETURN(blocks);
}
diff --git a/mysys/my_init.c b/mysys/my_init.c
index efeee0fbc76..31757cd5df0 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -134,7 +134,10 @@ void my_end(int infoflag)
*/
FILE *info_file= DBUG_FILE;
my_bool print_info= (info_file != stderr);
- DBUG_ENTER("my_end");
+ /* We do not use DBUG_ENTER here, as after cleanup DBUG is no longer
+ operational, so we cannot use DBUG_RETURN.
+ */
+ DBUG_PRINT("info",("Shutting down"));
if (!info_file)
{
info_file= stderr;
@@ -214,7 +217,6 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
WSACleanup();
#endif /* __WIN__ */
my_init_done=0;
- DBUG_VOID_RETURN;
} /* my_end */
diff --git a/netware/BUILD/compile-netware-START b/netware/BUILD/compile-netware-START
index 9918ead87c5..95b222994d3 100755
--- a/netware/BUILD/compile-netware-START
+++ b/netware/BUILD/compile-netware-START
@@ -24,5 +24,5 @@ base_configs=" \
--prefix=N:/mysql \
--without-mysqlmanager \
--without-man \
+ --without-csv-storage-engine \
"
-
diff --git a/netware/mysql_install_db.c b/netware/mysql_install_db.c
index 355e18b819a..65ee7873e5c 100644
--- a/netware/mysql_install_db.c
+++ b/netware/mysql_install_db.c
@@ -423,7 +423,7 @@ int main(int argc, char **argv)
printf("\nThe latest information about MySQL is available on the web at\n");
printf("\thttp://www.mysql.com\n");
- printf("\nSupport MySQL by buying support at https://order.mysql.com\n\n");
+ printf("\nSupport MySQL by buying support at http://shop.mysql.com\n\n");
return 0;
}
diff --git a/regex/Makefile.am b/regex/Makefile.am
index 7e8478e8123..6fd5b1b57a2 100644
--- a/regex/Makefile.am
+++ b/regex/Makefile.am
@@ -25,7 +25,7 @@ re_SOURCES = split.c debug.c main.c
re_LDFLAGS= @NOINST_LDFLAGS@
EXTRA_DIST = tests CHANGES COPYRIGHT WHATSNEW regexp.c \
debug.ih engine.ih main.ih regcomp.ih regerror.ih \
- regex.3 regex.7
+ regex.3 regex.7 cmakelists.txt
test: re tests
./re < tests
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh
index 5b35c0190a5..84ff518c381 100644
--- a/scripts/mysql_config.sh
+++ b/scripts/mysql_config.sh
@@ -82,27 +82,29 @@ basedir=`echo $me | sed -e 's;/bin/mysql_config;;'`
ldata='@localstatedir@'
execdir='@libexecdir@'
bindir='@bindir@'
+
+# If installed, search for the compiled in directory first (might be "lib64")
pkglibdir='@pkglibdir@'
-fix_path pkglibdir lib/mysql lib
+pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"`
+fix_path pkglibdir $pkglibdir_rel lib/mysql lib
+
pkgincludedir='@pkgincludedir@'
fix_path pkgincludedir include/mysql include
+
version='@VERSION@'
socket='@MYSQL_UNIX_ADDR@'
port='@MYSQL_TCP_PORT@'
ldflags='@LDFLAGS@'
-# Create options
-
-libs="$ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
+# Create options
+# We intentionally add a space to the beginning of lib strings, simplifies replace later
+libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@"
-libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
+libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@"
+embedded_libs=" $ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@"
-libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@"
-libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
cflags="-I$pkgincludedir @CFLAGS@ " #note: end space!
include="-I$pkgincludedir"
-embedded_libs="$ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@"
-embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
# Remove some options that a client doesn't have to care about
# FIXME until we have a --cxxflags, we need to remove -Xa
@@ -110,7 +112,7 @@ embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' |
for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \
DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \
DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*' \
- Xa xstrconst
+ Xa xstrconst "xc99=none"
do
# The first option we might strip will always have a space before it because
# we set -I$pkgincludedir as the first option
@@ -118,6 +120,20 @@ do
done
cflags=`echo "$cflags"|sed -e 's/ *\$//'`
+# Same for --libs(_r)
+for remove in lmtmalloc
+do
+ # We know the strings starts with a space
+ libs=`echo "$libs"|sed -e "s/ -$remove */ /g"`
+ libs_r=`echo "$libs_r"|sed -e "s/ -$remove */ /g"`
+ embedded_libs=`echo "$embedded_libs"|sed -e "s/ -$remove */ /g"`
+done
+
+# Strip trailing and ending space if any, and '+' (FIXME why?)
+libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
+libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
+embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
+
usage () {
cat <<EOF
Usage: $0 [OPTIONS]
diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh
index 287a83fbc99..a401e1d0159 100644
--- a/scripts/mysql_create_system_tables.sh
+++ b/scripts/mysql_create_system_tables.sh
@@ -775,7 +775,7 @@ if test ! -f $mdata/event.frm
then
c_ev="$c_ev CREATE TABLE event ("
c_ev="$c_ev db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',"
- c_ev="$c_ev name char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',"
+ c_ev="$c_ev name char(64) CHARACTER SET utf8 NOT NULL default '',"
c_ev="$c_ev body longblob NOT NULL,"
c_ev="$c_ev definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',"
c_ev="$c_ev execute_at DATETIME default NULL,"
diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql
index 478d6b48c73..5b3cab16db2 100644
--- a/scripts/mysql_fix_privilege_tables.sql
+++ b/scripts/mysql_fix_privilege_tables.sql
@@ -671,6 +671,7 @@ ALTER TABLE event ADD sql_mode
) DEFAULT '' NOT NULL AFTER on_completion;
UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0;
+ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default '';
--
-- TRIGGER privilege
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 33db1eae82a..c05fda745b0 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -1,3 +1,4 @@
+
#!/bin/sh
# Copyright (C) 2002-2003 MySQL AB
# For a more info consult the file COPYRIGHT distributed with this file.
@@ -269,7 +270,7 @@ then
echo
echo "The latest information about MySQL is available on the web at"
echo "http://www.mysql.com"
- echo "Support MySQL by buying support/licenses at https://order.mysql.com"
+ echo "Support MySQL by buying support/licenses at http://shop.mysql.com"
fi
exit 0
else
diff --git a/server-tools/instance-manager/Makefile.am b/server-tools/instance-manager/Makefile.am
index ab08df99fd9..462d7984aa4 100644
--- a/server-tools/instance-manager/Makefile.am
+++ b/server-tools/instance-manager/Makefile.am
@@ -87,6 +87,8 @@ mysqlmanager_LDADD= @CLIENT_EXTRA_LDFLAGS@ \
$(top_builddir)/dbug/libdbug.a \
@openssl_libs@ @yassl_libs@ @ZLIB_LIBS@
+EXTRA_DIST = WindowsService.cpp WindowsService.h IMService.cpp \
+ IMService.h cmakelists.txt
tags:
ctags -R *.h *.cc
diff --git a/sql-common/client.c b/sql-common/client.c
index 4c7ef3fcd03..cd50960164b 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1428,13 +1428,7 @@ mysql_init(MYSQL *mysql)
mysql->free_me=1;
}
else
- {
-#if defined(EMBEDDED_LIBRARY) || MYSQL_VERSION_ID >= 50100
bzero((char*) (mysql), sizeof(*(mysql)));
-#else
- bzero((char*) (mysql), offsetof(MYSQL, info_buffer));
-#endif
- }
mysql->options.connect_timeout= CONNECT_TIMEOUT;
mysql->last_used_con= mysql->next_slave= mysql->master = mysql;
mysql->charset=default_charset_info;
diff --git a/sql/Makefile.am b/sql/Makefile.am
index 8545cd7d75a..60e7891931f 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -124,7 +124,8 @@ DEFS = -DMYSQL_SERVER \
@DEFS@
BUILT_SOURCES = sql_yacc.cc sql_yacc.h lex_hash.h
-EXTRA_DIST = udf_example.cc handlerton-win.cc $(BUILT_SOURCES)
+EXTRA_DIST = udf_example.cc $(BUILT_SOURCES) \
+ nt_servc.cc nt_servc.h message.mc cmakelists.txt
CLEANFILES = lex_hash.h sql_yacc.cc sql_yacc.h
AM_YFLAGS = -d
diff --git a/sql/authors.h b/sql/authors.h
index fde1806f4be..595d14c6e0b 100644
--- a/sql/authors.h
+++ b/sql/authors.h
@@ -65,6 +65,7 @@ struct show_table_authors_st show_table_authors[]= {
{ "Antony T. Curtis", "Norwalk, CA, USA",
"Parser, port to OS/2, storage engines and some random stuff" },
{ "Yuri Dario", "", "OS/2 port" },
+ { "Andrei Elkin", "Espoo, Finland", "Replication" },
{ "Sergei Golubchik", "Kerpen, Germany",
"Full-text search, precision math" },
{ "Lenz Grimmer", "Hamburg, Germany",
@@ -77,6 +78,7 @@ struct show_table_authors_st show_table_authors[]= {
"Bug fixing" },
{ "Mats Kindahl", "Storvreta, Sweden", "Replication" },
{ "Serge Kozlov", "Velikie Luki, Russia", "Testing - Cluster" },
+ { "Hakan Küçükyılmaz", "Walldorf, Germany", "Testing - Server" },
{ "Greg (Groggy) Lehey", "Uchunga, SA, Australia", "Backup" },
{ "Matthias Leich", "Berlin, Germany", "Testing - Server" },
{ "Dmitri Lenev", "Moscow, Russia",
diff --git a/sql/cmakelists.txt b/sql/cmakelists.txt
index 2099ef94996..381d22c605c 100644
--- a/sql/cmakelists.txt
+++ b/sql/cmakelists.txt
@@ -1,11 +1,15 @@
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
+SET(CMAKE_CXX_FLAGS_DEBUG
+ "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
+SET(CMAKE_C_FLAGS_DEBUG
+ "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/extra/yassl/include
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
- ${CMAKE_SOURCE_DIR}/zlib)
+ ${CMAKE_SOURCE_DIR}/zlib
+ ${CMAKE_SOURCE_DIR}/storage/bdb/build_win32
+ ${CMAKE_SOURCE_DIR}/storage/bdb/dbinc)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc
${CMAKE_SOURCE_DIR}/sql/message.h
@@ -16,47 +20,70 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc
${CMAKE_SOURCE_DIR}/sql/lex_hash.h
${PROJECT_SOURCE_DIR}/include/mysqld_error.h
${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
- ${PROJECT_SOURCE_DIR}/include/sql_state.h PROPERTIES GENERATED 1)
-
-ADD_DEFINITIONS(-DWITH_INNOBASE_STORAGE_ENGINE -DHAVE_ARCHIVE_DB -DHAVE_BLACKHOLE_DB -DHAVE_EXAMPLE_DB)
-ADD_DEFINITIONS(-DHAVE_ROW_BASED_REPLICATION -DHAVE_FEDERATED_DB -DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN -DWITH_PARTITION_STORAGE_ENGINE -D_CRT_SECURE_NO_DEPRECATE)
+ ${PROJECT_SOURCE_DIR}/include/sql_state.h
+ PROPERTIES GENERATED 1)
+
+ADD_DEFINITIONS(-DHAVE_ROW_BASED_REPLICATION -DMYSQL_SERVER
+ -D_CONSOLE -DHAVE_DLOPEN)
+
+ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc
+ discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
+ filesort.cc gstream.cc ha_heap.cc ha_myisam.cc ha_myisammrg.cc
+ ${mysql_se_ha_src} handler.cc hash_filo.cc hash_filo.h
+ hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc
+ item_create.cc item_func.cc item_geofunc.cc item_row.cc
+ item_strfunc.cc item_subselect.cc item_sum.cc item_timefunc.cc
+ item_uniq.cc key.cc log.cc lock.cc log_event.cc message.rc
+ message.h mf_iocache.cc my_decimal.cc ../sql-common/my_time.c
+ ../storage/myisammrg/myrg_rnext_same.c mysqld.cc net_serv.cc
+ nt_servc.cc nt_servc.h opt_range.cc opt_range.h opt_sum.cc
+ ../sql-common/pack.c parse_file.cc password.c procedure.cc
+ protocol.cc records.cc repl_failsafe.cc rpl_filter.cc set_var.cc
+ slave.cc sp.cc sp_cache.cc sp_head.cc sp_pcontext.cc
+ sp_rcontext.cc spatial.cc sql_acl.cc sql_analyse.cc sql_base.cc
+ sql_cache.cc sql_class.cc sql_client.cc sql_crypt.cc sql_crypt.h
+ sql_cursor.cc sql_db.cc sql_delete.cc sql_derived.cc sql_do.cc
+ sql_error.cc sql_handler.cc sql_help.cc sql_insert.cc sql_lex.cc
+ sql_list.cc sql_load.cc sql_manager.cc sql_map.cc sql_parse.cc
+ sql_partition.cc sql_plugin.cc sql_prepare.cc sql_rename.cc
+ sql_repl.cc sql_select.cc sql_show.cc sql_state.c sql_string.cc
+ sql_table.cc sql_test.cc sql_trigger.cc sql_udf.cc sql_union.cc
+ sql_update.cc sql_view.cc strfunc.cc table.cc thr_malloc.cc
+ time.cc tztime.cc uniques.cc unireg.cc item_xmlfunc.cc
+ rpl_tblmap.cc sql_binlog.cc event_executor.cc event_timed.cc
+ sql_tablespace.cc event.cc ../sql-common/my_user.c
+ partition_info.cc
+ ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
+ ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
+ ${PROJECT_SOURCE_DIR}/include/mysqld_error.h
+ ${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
+ ${PROJECT_SOURCE_DIR}/include/sql_state.h
+ ${PROJECT_SOURCE_DIR}/include/mysql_version.h
+ ${PROJECT_SOURCE_DIR}/sql/handlerton.cc
+ ${PROJECT_SOURCE_DIR}/sql/lex_hash.h)
+TARGET_LINK_LIBRARIES(mysqld heap myisam myisammrg mysys yassl zlib dbug yassl
+ taocrypt strings vio regex wsock32)
+IF(WITH_ARCHIVE_STORAGE_ENGINE)
+ TARGET_LINK_LIBRARIES(mysqld archive)
+ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
+IF(WITH_EXAMPLE_STORAGE_ENGINE)
+ TARGET_LINK_LIBRARIES(mysqld example)
+ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
+IF(WITH_INNOBASE_STORAGE_ENGINE)
+ TARGET_LINK_LIBRARIES(mysqld innobase)
+ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
+IF(WITH_BERKELEY_STORAGE_ENGINE)
+ TARGET_LINK_LIBRARIES(mysqld bdb)
+ENDIF(WITH_BERKELEY_STORAGE_ENGINE)
-ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc discover.cc ../libmysql/errmsg.c field.cc
- field_conv.cc filesort.cc gstream.cc ha_blackhole.cc
- ha_federated.cc ha_heap.cc ha_innodb.cc ha_myisam.cc ha_myisammrg.cc
- ha_partition.cc handler.cc hash_filo.cc hash_filo.h hostname.cc
- init.cc item.cc item_buff.cc item_cmpfunc.cc item_create.cc item_func.cc item_geofunc.cc
- item_row.cc item_strfunc.cc item_subselect.cc item_sum.cc item_timefunc.cc item_uniq.cc
- key.cc log.cc lock.cc log_event.cc message.rc message.h mf_iocache.cc
- my_decimal.cc ../sql-common/my_time.c
- ../storage/myisammrg/myrg_rnext_same.c mysqld.cc net_serv.cc nt_servc.cc nt_servc.h opt_range.cc opt_range.h
- opt_sum.cc ../sql-common/pack.c parse_file.cc password.c procedure.cc protocol.cc records.cc
- repl_failsafe.cc rpl_filter.cc set_var.cc slave.cc sp.cc sp_cache.cc sp_head.cc
- sp_pcontext.cc sp_rcontext.cc spatial.cc sql_acl.cc sql_analyse.cc sql_base.cc sql_cache.cc
- sql_class.cc sql_client.cc sql_crypt.cc sql_crypt.h sql_cursor.cc sql_db.cc sql_delete.cc
- sql_derived.cc sql_do.cc sql_error.cc sql_handler.cc sql_help.cc sql_insert.cc
- sql_lex.cc sql_list.cc sql_load.cc sql_manager.cc sql_map.cc sql_parse.cc sql_partition.cc
- sql_plugin.cc sql_prepare.cc sql_rename.cc sql_repl.cc sql_select.cc sql_show.cc
- sql_state.c sql_string.cc sql_table.cc sql_test.cc sql_trigger.cc sql_udf.cc sql_union.cc
- sql_update.cc sql_view.cc strfunc.cc table.cc thr_malloc.cc time.cc tztime.cc
- uniques.cc unireg.cc item_xmlfunc.cc rpl_tblmap.cc sql_binlog.cc event_executor.cc
- event_timed.cc sql_tablespace.cc event.cc ../sql-common/my_user.c partition_info.cc
- ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
- ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
- ${PROJECT_SOURCE_DIR}/include/mysqld_error.h
- ${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
- ${PROJECT_SOURCE_DIR}/include/sql_state.h
- ${PROJECT_SOURCE_DIR}/include/mysql_version.h
- ${PROJECT_SOURCE_DIR}/sql/handlerton.cc
- ${PROJECT_SOURCE_DIR}/sql/lex_hash.h)
-TARGET_LINK_LIBRARIES(mysqld heap myisam myisammrg innobase mysys yassl zlib dbug yassl taocrypt strings vio regex wsock32)
ADD_DEPENDENCIES(mysqld GenError)
# Sql Parser custom command
ADD_CUSTOM_COMMAND(
SOURCE ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy
OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
- COMMAND bison.exe ARGS -y -p MYSQL --defines=sql_yacc.h --output=sql_yacc.cc sql_yacc.yy
+ COMMAND bison.exe ARGS -y -p MYSQL --defines=sql_yacc.h
+ --output=sql_yacc.cc sql_yacc.yy
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy)
ADD_CUSTOM_COMMAND(
@@ -67,51 +94,10 @@ ADD_CUSTOM_COMMAND(
# Windows message file
ADD_CUSTOM_COMMAND(
- SOURCE ../VC++Files/sql/message.mc
+ SOURCE message.mc
OUTPUT message.rc message.h
- COMMAND mc ARGS ../VC++Files/sql/message.mc
- DEPENDS ../VC++Files/sql/message.mc)
-
-# MySql_version.h.
-#ADD_CUSTOM_COMMAND(
-# SOURCE ${PROJECT_SOURCE_DIR}/include/mysql_version.h.in
-# OUTPUT ${PROJECT_SOURCE_DIR}/include/mysql_version.h
-# COMMAND cscript.exe ${PROJECT_SOURCE_DIR}/win/config-version.js
-# DEPENDS ${PROJECT_SOURCE_DIR}/include/mysql_version.h.in)
-
-# Handlerton file
-ADD_CUSTOM_COMMAND(
- SOURCE ${PROJECT_SOURCE_DIR}/sql/handlerton.cc.in
- OUTPUT ${PROJECT_SOURCE_DIR}/sql/handlerton.cc
- COMMAND cscript.exe ${PROJECT_SOURCE_DIR}/win/config-handlerton.js ARGS ${PROJECT_SOURCE_DIR}/win/configure.data
- DEPENDS ${PROJECT_SOURCE_DIR}/sql/handlerton.cc.in)
-
-# Error file
-#GET_TARGET_PROPERTY(COMP_ERR_EXE comp_err LOCATION)
-#ADD_CUSTOM_COMMAND(
- #SOURCE ${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt
- #OUTPUT ${PROJECT_SOURCE_DIR}/include/mysqld_error.h
- #COMMAND ${COMP_ERR_EXE}
- #ARGS --charset=${PROJECT_SOURCE_DIR}/sql/share/charsets
- # --out-dir=${PROJECT_SOURCE_DIR}/sql/share/
-## --header_file=${PROJECT_SOURCE_DIR}/include/mysqld_error.h
-# --name_file=${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
-# --state_file=${PROJECT_SOURCE_DIR}/include/sql_state.h
- # --in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt
- # DEPENDS ${COMP_ERR_EXE} share/errmsg.txt)
-
-#ADD_CUSTOM_COMMAND(
-# OUTPUT ${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
-# COMMAND echo
-# DEPENDS ${PROJECT_SOURCE_DIR}/include/mysqld_error.h
-#)
-
-#ADD_CUSTOM_COMMAND(
-# OUTPUT ${PROJECT_SOURCE_DIR}/include/sql_state.h
-# COMMAND echo
-# DEPENDS ${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
-#)
-
+ COMMAND mc ARGS message.mc
+ DEPENDS message.mc)
# Gen_lex_hash
ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc)
diff --git a/sql/event.cc b/sql/event.cc
index 8eca4b1dcd3..3bfbfbec483 100644
--- a/sql/event.cc
+++ b/sql/event.cc
@@ -952,6 +952,10 @@ err:
NOTES
1) Use sp_name for look up, return in **ett if found
2) tbl is not closed at exit
+
+ RETURN
+ 0 ok In this case *ett is set to the event
+ # error *ett == 0
*/
static int
@@ -960,7 +964,7 @@ db_find_event(THD *thd, sp_name *name, LEX_STRING *definer, Event_timed **ett,
{
TABLE *table;
int ret;
- Event_timed *et=NULL;
+ Event_timed *et= 0;
DBUG_ENTER("db_find_event");
DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
@@ -997,7 +1001,7 @@ db_find_event(THD *thd, sp_name *name, LEX_STRING *definer, Event_timed **ett,
}
done:
- if (ret && et)
+ if (ret)
{
delete et;
et= 0;
@@ -1382,7 +1386,7 @@ evex_show_create_event(THD *thd, sp_name *spn, LEX_STRING definer)
ret= db_find_event(thd, spn, &definer, &et, NULL, thd->mem_root);
thd->restore_backup_open_tables_state(&backup);
- if (!ret && et)
+ if (et)
{
Protocol *protocol= thd->protocol;
char show_str_buf[768];
@@ -1392,10 +1396,12 @@ evex_show_create_event(THD *thd, sp_name *spn, LEX_STRING definer)
ulong sql_mode_len=0;
show_str.length(0);
- show_str.set_charset(system_charset_info);
if (et->get_create_event(thd, &show_str))
+ {
+ delete et;
DBUG_RETURN(1);
+ }
field_list.push_back(new Item_empty_string("Event", NAME_LEN));
@@ -1409,16 +1415,19 @@ evex_show_create_event(THD *thd, sp_name *spn, LEX_STRING definer)
show_str.length()));
if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS |
Protocol::SEND_EOF))
+ {
+ delete et;
DBUG_RETURN(1);
-
+ }
protocol->prepare_for_resend();
protocol->store(et->name.str, et->name.length, system_charset_info);
protocol->store((char*) sql_mode_str, sql_mode_len, system_charset_info);
- protocol->store(show_str.c_ptr(), show_str.length(), system_charset_info);
+ protocol->store(show_str.ptr(), show_str.length(), system_charset_info);
ret= protocol->write();
send_eof(thd);
+ delete et;
}
DBUG_RETURN(ret);
diff --git a/sql/field.cc b/sql/field.cc
index 65c0d1b9397..1f67f83aabd 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -4237,6 +4237,7 @@ double Field_double::val_real(void)
longlong Field_double::val_int(void)
{
double j;
+ longlong res;
#ifdef WORDS_BIGENDIAN
if (table->s->db_low_byte_first)
{
@@ -4245,7 +4246,30 @@ longlong Field_double::val_int(void)
else
#endif
doubleget(j,ptr);
+ /* Check whether we fit into longlong range */
+ if (j <= (double) LONGLONG_MIN)
+ {
+ res= (longlong) LONGLONG_MIN;
+ goto warn;
+ }
+ if (j >= (double) (ulonglong) LONGLONG_MAX)
+ {
+ res= (longlong) LONGLONG_MAX;
+ goto warn;
+ }
return (longlong) rint(j);
+
+warn:
+ {
+ char buf[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];
+ String tmp(buf, sizeof(buf), &my_charset_latin1), *str;
+ str= val_str(&tmp, 0);
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TRUNCATED_WRONG_VALUE,
+ ER(ER_TRUNCATED_WRONG_VALUE), "INTEGER",
+ str->c_ptr());
+ }
+ return res;
}
diff --git a/sql/field.h b/sql/field.h
index 3fbdc0d0aa9..936babdd26a 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -350,6 +350,12 @@ public:
/* convert decimal to longlong with overflow check */
longlong convert_decimal2longlong(const my_decimal *val, bool unsigned_flag,
int *err);
+ /* The max. number of characters */
+ inline uint32 char_length() const
+ {
+ return field_length / charset()->mbmaxlen;
+ }
+
friend bool reopen_table(THD *,struct st_table *,bool);
friend int cre_myisam(my_string name, register TABLE *form, uint options,
ulonglong auto_increment_value);
@@ -994,20 +1000,23 @@ public:
class Field_string :public Field_longstr {
public:
+ bool can_alter_field_type;
Field_string(char *ptr_arg, uint32 len_arg,uchar *null_ptr_arg,
uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
CHARSET_INFO *cs)
:Field_longstr(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
- unireg_check_arg, field_name_arg, cs) {};
+ unireg_check_arg, field_name_arg, cs),
+ can_alter_field_type(1) {};
Field_string(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
CHARSET_INFO *cs)
:Field_longstr((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
- NONE, field_name_arg, cs) {};
+ NONE, field_name_arg, cs),
+ can_alter_field_type(1) {};
enum_field_types type() const
{
- return ((orig_table &&
+ return ((can_alter_field_type && orig_table &&
orig_table->s->db_create_options & HA_OPTION_PACK_RECORD &&
field_length >= 4) &&
orig_table->s->frm_version < FRM_VER_TRUE_VARCHAR ?
diff --git a/sql/ha_archive.cc b/sql/ha_archive.cc
index a8bc0822a85..403855b6a01 100644
--- a/sql/ha_archive.cc
+++ b/sql/ha_archive.cc
@@ -180,7 +180,9 @@ handlerton archive_hton = {
NULL, /* fill_files_table */
HTON_NO_FLAGS,
NULL, /* binlog_func */
- NULL /* binlog_log_query */
+ NULL, /* binlog_log_query */
+ NULL /* release_temporary_latches */
+
};
static handler *archive_create_handler(TABLE_SHARE *table)
@@ -1228,10 +1230,11 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt)
if (table->found_next_number_field)
{
Field *field= table->found_next_number_field;
- if (share->auto_increment_value <
- field->val_int((char*)(buf + field->offset())))
+ ulonglong auto_value=
+ (ulonglong) field->val_int((char*)(buf + field->offset()));
+ if (share->auto_increment_value < auto_value)
auto_increment_value= share->auto_increment_value=
- field->val_int((char*)(buf + field->offset()));
+ auto_value;
}
share->rows_recorded++;
}
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index 910a703fdeb..6ea4cc9aeb5 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -155,7 +155,8 @@ handlerton berkeley_hton = {
NULL, /* Fill Files Table */
HTON_CLOSE_CURSORS_AT_COMMIT | HTON_FLUSH_AFTER_RENAME,
NULL, /* binlog_func */
- NULL /* binlog_log_query */
+ NULL, /* binlog_log_query */
+ NULL /* release_temporary_latches */
};
handler *berkeley_create_handler(TABLE_SHARE *table)
diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc
index 7d28344a0a4..2f5e8ee0abc 100644
--- a/sql/ha_blackhole.cc
+++ b/sql/ha_blackhole.cc
@@ -62,8 +62,9 @@ handlerton blackhole_hton= {
NULL, /* Alter Tablespace */
NULL, /* Fill FILES table */
HTON_CAN_RECREATE,
- NULL, /* binlog_func */
- NULL /* binlog_log_query */
+ NULL, /* binlog_func */
+ NULL, /* binlog_log_query */
+ NULL /* release_temporary_latches */
};
diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc
index 947c936c2e9..129a44b5721 100644
--- a/sql/ha_federated.cc
+++ b/sql/ha_federated.cc
@@ -400,7 +400,8 @@ handlerton federated_hton= {
NULL, /* Fill FILES table */
HTON_ALTER_NOT_SUPPORTED,
NULL, /* binlog_func */
- NULL /* binlog_log_query */
+ NULL, /* binlog_log_query */
+ NULL /* release_temporary_latches */
};
diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc
index 96f760a7a44..f20dfe259fb 100644
--- a/sql/ha_heap.cc
+++ b/sql/ha_heap.cc
@@ -60,7 +60,8 @@ handlerton heap_hton= {
NULL, /* Fill Files Table */
HTON_CAN_RECREATE,
NULL, /* binlog_func */
- NULL /* binlog_log_query */
+ NULL, /* binlog_log_query */
+ NULL /* release_temporary_latches */
};
static handler *heap_create_handler(TABLE_SHARE *table)
@@ -524,7 +525,6 @@ THR_LOCK_DATA **ha_heap::store_lock(THD *thd,
int ha_heap::delete_table(const char *name)
{
- char buff[FN_REFLEN];
int error= heap_delete_table(name);
return error == ENOENT ? 0 : error;
}
@@ -561,7 +561,7 @@ ha_rows ha_heap::records_in_range(uint inx, key_range *min_key,
return records;
/* Assert that info() did run. We need current statistics here. */
- DBUG_ASSERT(key_stat_version);
+ DBUG_ASSERT(key_stat_version == file->s->key_stat_version);
return key->rec_per_key[key->key_parts-1];
}
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index bf07d56565a..1b0f4c34acc 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -237,7 +237,8 @@ handlerton innobase_hton = {
NULL, /* Fill FILES table */
HTON_NO_FLAGS,
NULL, /* binlog_func */
- NULL /* binlog_log_query */
+ NULL, /* binlog_log_query */
+ innobase_release_temporary_latches
};
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index fba36450d81..ec39ee00efc 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -92,7 +92,8 @@ handlerton myisam_hton= {
NULL, /* Fill Files Table */
HTON_CAN_RECREATE,
NULL, /* binlog_func */
- NULL /* binlog_log_query */
+ NULL, /* binlog_log_query */
+ NULL /* release_temporary_latches */
};
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc
index ec015c5e320..0ce4e1d8bcb 100644
--- a/sql/ha_myisammrg.cc
+++ b/sql/ha_myisammrg.cc
@@ -70,7 +70,8 @@ handlerton myisammrg_hton= {
NULL, /* Fill Files Table */
HTON_CAN_RECREATE,
NULL, /* binlog_func */
- NULL /* binlog_log_query */
+ NULL, /* binlog_log_query */
+ NULL /* release_temporary_latches */
};
static handler *myisammrg_create_handler(TABLE_SHARE *table)
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index edba5be87ef..a4193e4eb33 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -74,6 +74,8 @@ handlerton ndbcluster_hton = {
DB_TYPE_NDBCLUSTER,
ndbcluster_init,
~(uint)0, /* slot */
+ /* below are initialized by name in ndbcluster_init() */
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
static handler *ndbcluster_create_handler(TABLE_SHARE *table)
@@ -1240,6 +1242,7 @@ int ha_ndbcluster::add_index_handle(THD *thd, NDBDICT *dict, KEY *key_info,
{
char unique_index_name[FN_LEN];
static const char* unique_suffix= "$unique";
+ m_has_unique_index= TRUE;
strxnmov(unique_index_name, FN_LEN, index_name, unique_suffix, NullS);
DBUG_PRINT("info", ("Get handle to unique_index %s", unique_index_name));
const NDBINDEX *index= dict->getIndex(unique_index_name, m_tabname);
@@ -1266,7 +1269,7 @@ int ha_ndbcluster::open_indexes(Ndb *ndb, TABLE *tab, bool ignore_error)
KEY* key_info= tab->key_info;
const char **key_name= tab->s->keynames.type_names;
DBUG_ENTER("ha_ndbcluster::open_indexes");
-
+ m_has_unique_index= FALSE;
for (i= 0; i < tab->s->keys; i++, key_info++, key_name++)
{
if ((error= add_index_handle(thd, dict, key_info, *key_name, i)))
@@ -1568,6 +1571,25 @@ int ha_ndbcluster::set_primary_key_from_record(NdbOperation *op, const byte *rec
DBUG_RETURN(0);
}
+int ha_ndbcluster::set_index_key_from_record(NdbOperation *op,
+ const byte *record, uint keyno)
+{
+ KEY* key_info= table->key_info + keyno;
+ KEY_PART_INFO* key_part= key_info->key_part;
+ KEY_PART_INFO* end= key_part+key_info->key_parts;
+ uint i;
+ DBUG_ENTER("set_index_key_from_record");
+
+ for (i= 0; key_part != end; key_part++, i++)
+ {
+ Field* field= key_part->field;
+ if (set_ndb_key(op, field, m_index[keyno].unique_index_attrid_map[i],
+ record+key_part->offset))
+ ERR_RETURN(m_active_trans->getNdbError());
+ }
+ DBUG_RETURN(0);
+}
+
int
ha_ndbcluster::set_index_key(NdbOperation *op,
const KEY *key_info,
@@ -1776,46 +1798,154 @@ int ha_ndbcluster::complemented_read(const byte *old_data, byte *new_data,
}
/*
- Peek to check if a particular row already exists
+ * Check that all operations between first and last all
+ * have gotten the errcode
+ * If checking for HA_ERR_KEY_NOT_FOUND then update m_dupkey
+ * for all succeeding operations
+ */
+bool ha_ndbcluster::check_all_operations_for_error(NdbTransaction *trans,
+ const NdbOperation *first,
+ const NdbOperation *last,
+ uint errcode)
+{
+ const NdbOperation *op= first;
+ DBUG_ENTER("ha_ndbcluster::check_all_operations_for_error");
+
+ while(op)
+ {
+ NdbError err= op->getNdbError();
+ if (err.status != NdbError::Success)
+ {
+ if (ndb_to_mysql_error(&err) != (int) errcode)
+ DBUG_RETURN(false);
+ if (op == last) break;
+ op= trans->getNextCompletedOperation(op);
+ }
+ else
+ {
+ // We found a duplicate
+ if (op->getType() == NdbOperation::UniqueIndexAccess)
+ {
+ if (errcode == HA_ERR_KEY_NOT_FOUND)
+ {
+ NdbIndexOperation *iop= (NdbIndexOperation *) op;
+ const NDBINDEX *index= iop->getIndex();
+ // Find the key_no of the index
+ for(uint i= 0; i<table->s->keys; i++)
+ {
+ if (m_index[i].unique_index == index)
+ {
+ m_dupkey= i;
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ // Must have been primary key access
+ DBUG_ASSERT(op->getType() == NdbOperation::PrimaryKeyAccess);
+ if (errcode == HA_ERR_KEY_NOT_FOUND)
+ m_dupkey= table->s->primary_key;
+ }
+ DBUG_RETURN(false);
+ }
+ }
+ DBUG_RETURN(true);
+}
+
+
+/*
+ * Peek to check if any rows already exist with conflicting
+ * primary key or unique index values
*/
-int ha_ndbcluster::peek_row(const byte *record)
+int ha_ndbcluster::peek_indexed_rows(const byte *record)
{
NdbTransaction *trans= m_active_trans;
NdbOperation *op;
- DBUG_ENTER("peek_row");
-
- NdbOperation::LockMode lm=
- (NdbOperation::LockMode)get_ndb_lock_type(m_lock.type);
- if (!(op= trans->getNdbOperation((const NDBTAB *) m_table)) ||
- op->readTuple(lm) != 0)
- ERR_RETURN(trans->getNdbError());
-
+ const NdbOperation *first, *last;
+ uint i;
int res;
- if ((res= set_primary_key_from_record(op, record)))
- ERR_RETURN(trans->getNdbError());
+ DBUG_ENTER("peek_indexed_rows");
- if (m_use_partition_function)
+ NdbOperation::LockMode lm= NdbOperation::LM_Read;
+ first= NULL;
+ if (table->s->primary_key != MAX_KEY)
{
- uint32 part_id;
- int error;
- longlong func_value;
- if ((error= m_part_info->get_partition_id(m_part_info, &part_id,
- &func_value)))
+ /*
+ * Fetch any row with colliding primary key
+ */
+ if (!(op= trans->getNdbOperation((const NDBTAB *) m_table)) ||
+ op->readTuple(lm) != 0)
+ ERR_RETURN(trans->getNdbError());
+
+ first= op;
+ if ((res= set_primary_key_from_record(op, record)))
+ ERR_RETURN(trans->getNdbError());
+
+ if (m_use_partition_function)
{
- DBUG_RETURN(error);
+ uint32 part_id;
+ int error;
+ longlong func_value;
+ if ((error= m_part_info->get_partition_id(m_part_info, &part_id,
+ &func_value)))
+ {
+ DBUG_RETURN(error);
+ }
+ op->setPartitionId(part_id);
}
- op->setPartitionId(part_id);
}
+ /*
+ * Fetch any rows with colliding unique indexes
+ */
+ KEY* key_info;
+ KEY_PART_INFO *key_part, *end;
+ for (i= 0, key_info= table->key_info; i < table->s->keys; i++, key_info++)
+ {
+ if (i != table->s->primary_key &&
+ key_info->flags & HA_NOSAME)
+ {
+ // A unique index is defined on table
+ NdbIndexOperation *iop;
+ NDBINDEX *unique_index = (NDBINDEX *) m_index[i].unique_index;
+ key_part= key_info->key_part;
+ end= key_part + key_info->key_parts;
+ if (!(iop= trans->getNdbIndexOperation(unique_index,
+ (const NDBTAB *) m_table)) ||
+ iop->readTuple(lm) != 0)
+ ERR_RETURN(trans->getNdbError());
- if (execute_no_commit_ie(this,trans) != 0)
+ if (!first)
+ first= iop;
+ if ((res= set_index_key_from_record(iop, record, i)))
+ ERR_RETURN(trans->getNdbError());
+ }
+ }
+ last= trans->getLastDefinedOperation();
+ if (first)
+ res= execute_no_commit_ie(this,trans);
+ else
+ {
+ // Table has no keys
+ table->status= STATUS_NOT_FOUND;
+ DBUG_RETURN(HA_ERR_KEY_NOT_FOUND);
+ }
+ if (check_all_operations_for_error(trans, first, last,
+ HA_ERR_KEY_NOT_FOUND))
{
table->status= STATUS_NOT_FOUND;
DBUG_RETURN(ndb_err(trans));
}
+ else
+ {
+ DBUG_PRINT("info", ("m_dupkey %d", m_dupkey));
+ }
DBUG_RETURN(0);
}
+
/*
Read one record from NDB using unique secondary index
*/
@@ -2208,7 +2338,7 @@ int ha_ndbcluster::ordered_index_scan(const key_range *start_key,
if (generate_scan_filter(m_cond_stack, op))
DBUG_RETURN(ndb_err(trans));
- if (res= define_read_attrs(buf, op))
+ if ((res= define_read_attrs(buf, op)))
{
DBUG_RETURN(res);
}
@@ -2310,13 +2440,33 @@ int ha_ndbcluster::write_row(byte *record)
DBUG_ENTER("ha_ndbcluster::write_row");
m_write_op= TRUE;
- if (!m_use_write && m_ignore_dup_key && table_share->primary_key != MAX_KEY)
+ has_auto_increment= (table->next_number_field && record == table->record[0]);
+ if (table_share->primary_key != MAX_KEY)
+ {
+ /*
+ * Increase any auto_incremented primary key
+ */
+ if (has_auto_increment)
+ {
+ THD *thd= table->in_use;
+
+ m_skip_auto_increment= FALSE;
+ update_auto_increment();
+ /* Ensure that handler is always called for auto_increment values */
+ thd->next_insert_id= 0;
+ m_skip_auto_increment= !auto_increment_column_changed;
+ }
+ }
+
+ /*
+ * If IGNORE the ignore constraint violations on primary and unique keys
+ */
+ if (!m_use_write && m_ignore_dup_key)
{
- int peek_res= peek_row(record);
+ int peek_res= peek_indexed_rows(record);
if (!peek_res)
{
- m_dupkey= table_share->primary_key;
DBUG_RETURN(HA_ERR_FOUND_DUPP_KEY);
}
if (peek_res != HA_ERR_KEY_NOT_FOUND)
@@ -2326,7 +2476,6 @@ int ha_ndbcluster::write_row(byte *record)
statistic_increment(thd->status_var.ha_write_count, &LOCK_status);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
table->timestamp_field->set_time();
- has_auto_increment= (table->next_number_field && record == table->record[0]);
if (!(op= trans->getNdbOperation((const NDBTAB *) m_table)))
ERR_RETURN(trans->getNdbError());
@@ -2367,17 +2516,6 @@ int ha_ndbcluster::write_row(byte *record)
{
int res;
- if (has_auto_increment)
- {
- THD *thd= table->in_use;
-
- m_skip_auto_increment= FALSE;
- update_auto_increment();
- /* Ensure that handler is always called for auto_increment values */
- thd->next_insert_id= 0;
- m_skip_auto_increment= !auto_increment_column_changed;
- }
-
if ((res= set_primary_key_from_record(op, record)))
return res;
}
@@ -3259,8 +3397,9 @@ int ha_ndbcluster::rnd_pos(byte *buf, byte *pos)
The partition id has been fetched from ndb
and has been stored directly after the hidden key
*/
+ DBUG_DUMP("key+part", (char *)pos, key_length);
key_length= ref_length - sizeof(m_part_id);
- part_spec.start_part= part_spec.end_part= *(pos + key_length);
+ part_spec.start_part= part_spec.end_part= *(uint32 *)(pos + key_length);
}
else
{
@@ -3275,6 +3414,7 @@ int ha_ndbcluster::rnd_pos(byte *buf, byte *pos)
}
DBUG_PRINT("info", ("partition id %u", part_spec.start_part));
}
+ DBUG_DUMP("key", (char *)pos, key_length);
DBUG_RETURN(pk_read(pos, key_length, buf, part_spec.start_part));
}
}
@@ -3360,7 +3500,10 @@ void ha_ndbcluster::position(const byte *record)
#endif
memcpy(ref, m_ref, key_length);
}
-
+#ifndef DBUG_OFF
+ if (table_share->primary_key == MAX_KEY && m_use_partition_function)
+ DBUG_DUMP("key+part", (char*)ref, key_length+sizeof(m_part_id));
+#endif
DBUG_DUMP("ref", (char*)ref, key_length);
DBUG_VOID_RETURN;
}
@@ -3463,7 +3606,7 @@ int ha_ndbcluster::extra(enum ha_extra_function operation)
break;
case HA_EXTRA_IGNORE_DUP_KEY: /* Dup keys don't rollback everything*/
DBUG_PRINT("info", ("HA_EXTRA_IGNORE_DUP_KEY"));
- if (current_thd->lex->sql_command == SQLCOM_REPLACE)
+ if (current_thd->lex->sql_command == SQLCOM_REPLACE && !m_has_unique_index)
{
DBUG_PRINT("info", ("Turning ON use of write instead of insert"));
m_use_write= TRUE;
@@ -5137,6 +5280,7 @@ ha_ndbcluster::ha_ndbcluster(TABLE_SHARE *table_arg):
m_sorted(FALSE),
m_use_write(FALSE),
m_ignore_dup_key(FALSE),
+ m_has_unique_index(FALSE),
m_primary_key_update(FALSE),
m_ignore_no_key(FALSE),
m_rows_to_insert((ha_rows) 1),
@@ -6923,7 +7067,6 @@ void ndbcluster_real_free_share(NDB_SHARE **share)
hash_delete(&ndbcluster_open_tables, (byte*) *share);
thr_lock_delete(&(*share)->lock);
pthread_mutex_destroy(&(*share)->mutex);
- free_root(&(*share)->mem_root, MYF(0));
#ifdef HAVE_NDB_BINLOG
if ((*share)->table)
@@ -6944,6 +7087,7 @@ void ndbcluster_real_free_share(NDB_SHARE **share)
#endif
}
#endif
+ free_root(&(*share)->mem_root, MYF(0));
my_free((gptr) *share, MYF(0));
*share= 0;
@@ -7468,7 +7612,9 @@ ha_ndbcluster::setup_recattr(const NdbRecAttr* curr)
if ((* value).ptr)
{
DBUG_ASSERT(curr != 0);
- (* value).rec= curr;
+ NdbValue* val= m_value + curr->getColumn()->getColumnNo();
+ DBUG_ASSERT(val->ptr);
+ val->rec= curr;
curr= curr->next();
}
}
@@ -8057,7 +8203,12 @@ void ndb_serialize_cond(const Item *item, void *arg)
context->expecting_field_result(INT_RESULT))
: true)) &&
// Bit fields no yet supported in scan filter
- type != MYSQL_TYPE_BIT)
+ type != MYSQL_TYPE_BIT &&
+ // No BLOB support in scan filter
+ type != MYSQL_TYPE_TINY_BLOB &&
+ type != MYSQL_TYPE_MEDIUM_BLOB &&
+ type != MYSQL_TYPE_LONG_BLOB &&
+ type != MYSQL_TYPE_BLOB)
{
const NDBCOL *col= tab->getColumn(field->field_name);
DBUG_ASSERT(col);
@@ -9098,7 +9249,7 @@ char* ha_ndbcluster::get_tablespace_name(THD *thd)
{
NdbDictionary::Tablespace ts= ndbdict->getTablespace(id);
ndberr= ndbdict->getNdbError();
- if(ndberr.classification != ndberror_cl_none)
+ if(ndberr.classification != NdbError::NoError)
goto err;
return (my_strdup(ts.getName(), MYF(0)));
}
@@ -9544,6 +9695,7 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
NDBDICT *dict = ndb->getDictionary();
int error;
const char * errmsg;
+ LINT_INIT(errmsg);
switch (info->ts_cmd_type){
case (CREATE_TABLESPACE):
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
index fa867ea5774..7dfec18fcb6 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -115,8 +115,6 @@ typedef struct st_ndbcluster_share {
TABLE *table;
NdbValue *ndb_value[2];
MY_BITMAP *subscriber_bitmap;
- MY_BITMAP slock_bitmap;
- uint32 slock[256/32]; // 256 bits for lock status of table
#endif
} NDB_SHARE;
@@ -738,7 +736,11 @@ private:
part_id_range *part_spec);
int full_table_scan(byte * buf);
- int peek_row(const byte *record);
+ bool check_all_operations_for_error(NdbTransaction *trans,
+ const NdbOperation *first,
+ const NdbOperation *last,
+ uint errcode);
+ int peek_indexed_rows(const byte *record);
int unique_index_read(const byte *key, uint key_len,
byte *buf);
int fetch_next(NdbScanOperation* op);
@@ -766,6 +768,8 @@ private:
int get_ndb_blobs_value(NdbBlob *last_ndb_blob);
int set_primary_key(NdbOperation *op, const byte *key);
int set_primary_key_from_record(NdbOperation *op, const byte *record);
+ int set_index_key_from_record(NdbOperation *op, const byte *record,
+ uint keyno);
int set_bounds(NdbIndexScanOperation*, uint inx, bool rir,
const key_range *keys[2], uint= 0);
int key_cmp(uint keynr, const byte * old_row, const byte * new_row);
@@ -832,6 +836,7 @@ private:
bool m_sorted;
bool m_use_write;
bool m_ignore_dup_key;
+ bool m_has_unique_index;
bool m_primary_key_update;
bool m_write_op;
bool m_ignore_no_key;
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index ca3dcf605b0..60ccb661703 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -86,6 +86,22 @@ static ulonglong ndb_latest_received_binlog_epoch= 0;
NDB_SHARE *apply_status_share= 0;
NDB_SHARE *schema_share= 0;
+/* Schema object distribution handling */
+HASH ndb_schema_objects;
+typedef struct st_ndb_schema_object {
+ pthread_mutex_t mutex;
+ char *key;
+ uint key_length;
+ uint use_count;
+ MY_BITMAP slock_bitmap;
+ uint32 slock[256/32]; // 256 bits for lock status of table
+} NDB_SCHEMA_OBJECT;
+static NDB_SCHEMA_OBJECT *ndb_get_schema_object(const char *key,
+ my_bool create_if_not_exists,
+ my_bool have_lock);
+static void ndb_free_schema_object(NDB_SCHEMA_OBJECT **ndb_schema_object,
+ bool have_lock);
+
/* instantiated in storage/ndb/src/ndbapi/Ndbif.cpp */
extern Uint64 g_latest_trans_gci;
@@ -328,9 +344,6 @@ void ndbcluster_binlog_init_share(NDB_SHARE *share, TABLE *_table)
max_ndb_nodes, false);
bitmap_clear_all(&share->subscriber_bitmap[i]);
}
- bitmap_init(&share->slock_bitmap, share->slock,
- sizeof(share->slock)*8, false);
- bitmap_clear_all(&share->slock_bitmap);
}
if (!do_event_op)
@@ -952,7 +965,6 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
}
char tmp_buf2[FN_REFLEN];
- int get_a_share= 0;
switch (type)
{
case SOT_DROP_TABLE:
@@ -963,8 +975,6 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
query= tmp_buf2;
query_length= (uint) (strxmov(tmp_buf2, "drop table `",
table_name, "`", NullS) - tmp_buf2);
- if (!share)
- get_a_share= 1;
break;
case SOT_RENAME_TABLE:
/* redo the rename table query as is may contain several tables */
@@ -972,14 +982,10 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
query_length= (uint) (strxmov(tmp_buf2, "rename table `",
old_db, ".", old_table_name, "` to `",
db, ".", table_name, "`", NullS) - tmp_buf2);
- if (!share)
- get_a_share= 1;
break;
case SOT_CREATE_TABLE:
// fall through
case SOT_ALTER_TABLE:
- if (!share)
- get_a_share= 1;
break;
case SOT_DROP_DB:
break;
@@ -995,18 +1001,18 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
abort(); /* should not happen, programming error */
}
- if (get_a_share)
+ NDB_SCHEMA_OBJECT *ndb_schema_object;
{
char key[FN_REFLEN];
build_table_filename(key, sizeof(key), db, table_name, "");
- share= get_share(key, 0, false, false);
+ ndb_schema_object= ndb_get_schema_object(key, TRUE, FALSE);
}
const NdbError *ndb_error= 0;
uint32 node_id= g_ndb_cluster_connection->node_id();
Uint64 epoch= 0;
MY_BITMAP schema_subscribers;
- uint32 bitbuf[sizeof(schema_share->slock)/4];
+ uint32 bitbuf[sizeof(ndb_schema_object->slock)/4];
{
int i;
bitmap_init(&schema_subscribers, bitbuf, sizeof(bitbuf)*8, false);
@@ -1022,11 +1028,12 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share,
(void) pthread_mutex_unlock(&schema_share->mutex);
bitmap_clear_bit(&schema_subscribers, node_id);
- if (share)
+ if (ndb_schema_object)
{
- (void) pthread_mutex_lock(&share->mutex);
- memcpy(share->slock, schema_subscribers.bitmap, sizeof(share->slock));
- (void) pthread_mutex_unlock(&share->mutex);
+ (void) pthread_mutex_lock(&ndb_schema_object->mutex);
+ memcpy(ndb_schema_object->slock, schema_subscribers.bitmap,
+ sizeof(ndb_schema_object->slock));
+ (void) pthread_mutex_unlock(&ndb_schema_object->mutex);
}
DBUG_DUMP("schema_subscribers", (char*)schema_subscribers.bitmap,
@@ -1158,20 +1165,17 @@ end:
Wait for other mysqld's to acknowledge the table operation
*/
if (ndb_error == 0 &&
- (type == SOT_CREATE_TABLE ||
- type == SOT_RENAME_TABLE ||
- type == SOT_ALTER_TABLE) &&
!bitmap_is_clear_all(&schema_subscribers))
{
int max_timeout= 10;
- (void) pthread_mutex_lock(&share->mutex);
+ (void) pthread_mutex_lock(&ndb_schema_object->mutex);
while (1)
{
struct timespec abstime;
int i;
set_timespec(abstime, 1);
(void) pthread_cond_timedwait(&injector_cond,
- &share->mutex,
+ &ndb_schema_object->mutex,
&abstime);
(void) pthread_mutex_lock(&schema_share->mutex);
@@ -1184,14 +1188,14 @@ end:
}
(void) pthread_mutex_unlock(&schema_share->mutex);
- /* remove any unsubscribed from share->slock */
- bitmap_intersect(&share->slock_bitmap, &schema_subscribers);
+ /* remove any unsubscribed from ndb_schema_object->slock */
+ bitmap_intersect(&ndb_schema_object->slock_bitmap, &schema_subscribers);
- DBUG_DUMP("share->slock_bitmap.bitmap",
- (char*)share->slock_bitmap.bitmap,
- no_bytes_in_map(&share->slock_bitmap));
+ DBUG_DUMP("ndb_schema_object->slock_bitmap.bitmap",
+ (char*)ndb_schema_object->slock_bitmap.bitmap,
+ no_bytes_in_map(&ndb_schema_object->slock_bitmap));
- if (bitmap_is_clear_all(&share->slock_bitmap))
+ if (bitmap_is_clear_all(&ndb_schema_object->slock_bitmap))
break;
max_timeout--;
@@ -1203,16 +1207,13 @@ end:
if (ndb_extra_logging)
sql_print_information("NDB create table: "
"waiting max %u sec for create table %s.",
- max_timeout, share->key);
+ max_timeout, ndb_schema_object->key);
}
- (void) pthread_mutex_unlock(&share->mutex);
+ (void) pthread_mutex_unlock(&ndb_schema_object->mutex);
}
- if (get_a_share && share)
- {
- free_share(&share);
- share= 0;
- }
+ if (ndb_schema_object)
+ ndb_free_schema_object(&ndb_schema_object, FALSE);
DBUG_RETURN(0);
}
@@ -1529,12 +1530,12 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
MEM_ROOT *mem_root)
{
DBUG_ENTER("ndb_binlog_thread_handle_schema_event");
- NDB_SHARE *share= (NDB_SHARE *)pOp->getCustomData();
- if (share && schema_share == share)
+ NDB_SHARE *tmp_share= (NDB_SHARE *)pOp->getCustomData();
+ if (tmp_share && schema_share == tmp_share)
{
NDBEVENT::TableEvent ev_type= pOp->getEventType();
DBUG_PRINT("enter", ("%s.%s ev_type: %d",
- share->db, share->table_name, ev_type));
+ tmp_share->db, tmp_share->table_name, ev_type));
if (ev_type == NDBEVENT::TE_UPDATE ||
ev_type == NDBEVENT::TE_INSERT)
{
@@ -1543,7 +1544,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
MY_BITMAP slock;
bitmap_init(&slock, schema->slock, 8*SCHEMA_SLOCK_SIZE, false);
uint node_id= g_ndb_cluster_connection->node_id();
- ndbcluster_get_schema(share, schema);
+ ndbcluster_get_schema(tmp_share, schema);
if (schema->node_id != node_id)
{
int log_query= 0, post_epoch_unlock= 0;
@@ -1628,18 +1629,24 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
break;
case SOT_CLEAR_SLOCK:
{
- if (share)
+ pthread_mutex_lock(&ndbcluster_mutex);
+ NDB_SCHEMA_OBJECT *ndb_schema_object=
+ (NDB_SCHEMA_OBJECT*) hash_search(&ndb_schema_objects,
+ (byte*) key, strlen(key));
+ if (ndb_schema_object)
{
- pthread_mutex_lock(&share->mutex);
- memcpy(share->slock, schema->slock, sizeof(share->slock));
- DBUG_DUMP("share->slock_bitmap.bitmap",
- (char*)share->slock_bitmap.bitmap,
- no_bytes_in_map(&share->slock_bitmap));
- pthread_mutex_unlock(&share->mutex);
+ pthread_mutex_lock(&ndb_schema_object->mutex);
+ memcpy(ndb_schema_object->slock, schema->slock,
+ sizeof(ndb_schema_object->slock));
+ DBUG_DUMP("ndb_schema_object->slock_bitmap.bitmap",
+ (char*)ndb_schema_object->slock_bitmap.bitmap,
+ no_bytes_in_map(&ndb_schema_object->slock_bitmap));
+ pthread_mutex_unlock(&ndb_schema_object->mutex);
pthread_cond_signal(&injector_cond);
- free_share(&share);
- share= 0;
}
+ if (share)
+ free_share(&share, TRUE);
+ pthread_mutex_unlock(&ndbcluster_mutex);
DBUG_RETURN(0);
}
case SOT_TABLESPACE:
@@ -1687,24 +1694,24 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
schema_share= 0;
// fall through
case NDBEVENT::TE_ALTER:
- ndb_handle_schema_change(thd, ndb, pOp, share);
+ ndb_handle_schema_change(thd, ndb, pOp, tmp_share);
break;
case NDBEVENT::TE_NODE_FAILURE:
{
uint8 node_id= g_node_id_map[pOp->getNdbdNodeId()];
DBUG_ASSERT(node_id != 0xFF);
- (void) pthread_mutex_lock(&share->mutex);
- bitmap_clear_all(&share->subscriber_bitmap[node_id]);
+ (void) pthread_mutex_lock(&tmp_share->mutex);
+ bitmap_clear_all(&tmp_share->subscriber_bitmap[node_id]);
DBUG_PRINT("info",("NODE_FAILURE UNSUBSCRIBE[%d]", node_id));
if (ndb_extra_logging)
{
sql_print_information("NDB Binlog: Node: %d, down,"
" Subscriber bitmask %x%x",
pOp->getNdbdNodeId(),
- share->subscriber_bitmap[node_id].bitmap[1],
- share->subscriber_bitmap[node_id].bitmap[0]);
+ tmp_share->subscriber_bitmap[node_id].bitmap[1],
+ tmp_share->subscriber_bitmap[node_id].bitmap[0]);
}
- (void) pthread_mutex_unlock(&share->mutex);
+ (void) pthread_mutex_unlock(&tmp_share->mutex);
(void) pthread_cond_signal(&injector_cond);
break;
}
@@ -1713,8 +1720,8 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
uint8 node_id= g_node_id_map[pOp->getNdbdNodeId()];
uint8 req_id= pOp->getReqNodeId();
DBUG_ASSERT(req_id != 0 && node_id != 0xFF);
- (void) pthread_mutex_lock(&share->mutex);
- bitmap_set_bit(&share->subscriber_bitmap[node_id], req_id);
+ (void) pthread_mutex_lock(&tmp_share->mutex);
+ bitmap_set_bit(&tmp_share->subscriber_bitmap[node_id], req_id);
DBUG_PRINT("info",("SUBSCRIBE[%d] %d", node_id, req_id));
if (ndb_extra_logging)
{
@@ -1722,10 +1729,10 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
" Subscriber bitmask %x%x",
pOp->getNdbdNodeId(),
req_id,
- share->subscriber_bitmap[node_id].bitmap[1],
- share->subscriber_bitmap[node_id].bitmap[0]);
+ tmp_share->subscriber_bitmap[node_id].bitmap[1],
+ tmp_share->subscriber_bitmap[node_id].bitmap[0]);
}
- (void) pthread_mutex_unlock(&share->mutex);
+ (void) pthread_mutex_unlock(&tmp_share->mutex);
(void) pthread_cond_signal(&injector_cond);
break;
}
@@ -1734,8 +1741,8 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
uint8 node_id= g_node_id_map[pOp->getNdbdNodeId()];
uint8 req_id= pOp->getReqNodeId();
DBUG_ASSERT(req_id != 0 && node_id != 0xFF);
- (void) pthread_mutex_lock(&share->mutex);
- bitmap_clear_bit(&share->subscriber_bitmap[node_id], req_id);
+ (void) pthread_mutex_lock(&tmp_share->mutex);
+ bitmap_clear_bit(&tmp_share->subscriber_bitmap[node_id], req_id);
DBUG_PRINT("info",("UNSUBSCRIBE[%d] %d", node_id, req_id));
if (ndb_extra_logging)
{
@@ -1743,16 +1750,16 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
" Subscriber bitmask %x%x",
pOp->getNdbdNodeId(),
req_id,
- share->subscriber_bitmap[node_id].bitmap[1],
- share->subscriber_bitmap[node_id].bitmap[0]);
+ tmp_share->subscriber_bitmap[node_id].bitmap[1],
+ tmp_share->subscriber_bitmap[node_id].bitmap[0]);
}
- (void) pthread_mutex_unlock(&share->mutex);
+ (void) pthread_mutex_unlock(&tmp_share->mutex);
(void) pthread_cond_signal(&injector_cond);
break;
}
default:
sql_print_error("NDB Binlog: unknown non data event %d for %s. "
- "Ignoring...", (unsigned) ev_type, share->key);
+ "Ignoring...", (unsigned) ev_type, tmp_share->key);
}
}
DBUG_RETURN(0);
@@ -2888,6 +2895,90 @@ private:
Injector thread main loop
****************************************************************/
+static byte *ndb_schema_objects_get_key(NDB_SCHEMA_OBJECT *schema_object, uint *length,
+ my_bool not_used __attribute__((unused)))
+{
+ *length= schema_object->key_length;
+ return (byte*) schema_object->key;
+}
+
+static NDB_SCHEMA_OBJECT *ndb_get_schema_object(const char *key,
+ my_bool create_if_not_exists,
+ my_bool have_lock)
+{
+ NDB_SCHEMA_OBJECT *ndb_schema_object;
+ uint length= (uint) strlen(key);
+ DBUG_ENTER("ndb_get_schema_object");
+ DBUG_PRINT("enter", ("key: '%s'", key));
+
+ if (!have_lock)
+ pthread_mutex_lock(&ndbcluster_mutex);
+ while (!(ndb_schema_object=
+ (NDB_SCHEMA_OBJECT*) hash_search(&ndb_schema_objects,
+ (byte*) key,
+ length)))
+ {
+ if (!create_if_not_exists)
+ {
+ DBUG_PRINT("info", ("does not exist"));
+ break;
+ }
+ if (!(ndb_schema_object=
+ (NDB_SCHEMA_OBJECT*) my_malloc(sizeof(*ndb_schema_object) + length + 1,
+ MYF(MY_WME | MY_ZEROFILL))))
+ {
+ DBUG_PRINT("info", ("malloc error"));
+ break;
+ }
+ ndb_schema_object->key= (char *)(ndb_schema_object+1);
+ memcpy(ndb_schema_object->key, key, length + 1);
+ ndb_schema_object->key_length= length;
+ if (my_hash_insert(&ndb_schema_objects, (byte*) ndb_schema_object))
+ {
+ my_free((gptr) ndb_schema_object, 0);
+ break;
+ }
+ pthread_mutex_init(&ndb_schema_object->mutex, MY_MUTEX_INIT_FAST);
+ bitmap_init(&ndb_schema_object->slock_bitmap, ndb_schema_object->slock,
+ sizeof(ndb_schema_object->slock)*8, false);
+ bitmap_clear_all(&ndb_schema_object->slock_bitmap);
+ break;
+ }
+ if (ndb_schema_object)
+ {
+ ndb_schema_object->use_count++;
+ DBUG_PRINT("info", ("use_count: %d", ndb_schema_object->use_count));
+ }
+ if (!have_lock)
+ pthread_mutex_unlock(&ndbcluster_mutex);
+ DBUG_RETURN(ndb_schema_object);
+}
+
+
+static void ndb_free_schema_object(NDB_SCHEMA_OBJECT **ndb_schema_object,
+ bool have_lock)
+{
+ DBUG_ENTER("ndb_free_schema_object");
+ DBUG_PRINT("enter", ("key: '%s'", (*ndb_schema_object)->key));
+ if (!have_lock)
+ pthread_mutex_lock(&ndbcluster_mutex);
+ if (!--(*ndb_schema_object)->use_count)
+ {
+ DBUG_PRINT("info", ("use_count: %d", (*ndb_schema_object)->use_count));
+ hash_delete(&ndb_schema_objects, (byte*) *ndb_schema_object);
+ pthread_mutex_destroy(&(*ndb_schema_object)->mutex);
+ my_free((gptr) *ndb_schema_object, MYF(0));
+ *ndb_schema_object= 0;
+ }
+ else
+ {
+ DBUG_PRINT("info", ("use_count: %d", (*ndb_schema_object)->use_count));
+ }
+ if (!have_lock)
+ pthread_mutex_unlock(&ndbcluster_mutex);
+ DBUG_VOID_RETURN;
+}
+
pthread_handler_t ndb_binlog_thread_func(void *arg)
{
THD *thd; /* needs to be first for thread_stack */
@@ -2961,6 +3052,10 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
goto err;
}
+ /* init hash for schema object distribution */
+ (void) hash_init(&ndb_schema_objects, system_charset_info, 32, 0, 0,
+ (hash_get_key)ndb_schema_objects_get_key, 0, 0);
+
/*
Expose global reference to our ndb object.
@@ -3360,6 +3455,8 @@ err:
ndb= 0;
}
+ hash_free(&ndb_schema_objects);
+
// Placed here to avoid a memory leak; TODO: check if needed
net_end(&thd->net);
delete thd;
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 0a8f92d6813..7cf841a5d71 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -103,8 +103,9 @@ handlerton partition_hton = {
NULL, /* Alter Tablespace */
NULL, /* Fill FILES table */
HTON_NOT_USER_SELECTABLE | HTON_HIDDEN,
- NULL, /* binlog_func */
- NULL /* binlog_log_query */
+ NULL, /* binlog_func */
+ NULL, /* binlog_log_query */
+ NULL /* release_temporary_latches */
};
/*
@@ -257,6 +258,13 @@ void ha_partition::init_handler_variables()
}
+const char *ha_partition::table_type() const
+{
+ // we can do this since we only support a single engine type
+ return m_file[0]->table_type();
+}
+
+
/*
Destructor method
@@ -2914,12 +2922,15 @@ int ha_partition::rnd_init(bool scan)
/* Now we see what the index of our first important partition is */
DBUG_PRINT("info", ("m_part_info->used_partitions 0x%x",
- m_part_info->used_partitions.bitmap));
+ m_part_info->used_partitions.bitmap));
part_id= bitmap_get_first_set(&(m_part_info->used_partitions));
DBUG_PRINT("info", ("m_part_spec.start_part %d", part_id));
if (MY_BIT_NONE == part_id)
+ {
+ error= 0;
goto err1;
+ }
/*
We have a partition and we are scanning with rnd_next
@@ -2958,7 +2969,7 @@ err:
while ((int)--i >= (int)part_id)
{
if (bitmap_is_set(&(m_part_info->used_partitions), i))
- m_file[i]->ha_rnd_end();
+ m_file[i]->ha_rnd_end();
}
err1:
m_scan_value= 2;
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index 32ea75fabf0..96b615df71a 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -524,8 +524,7 @@ public:
virtual const char *index_type(uint inx);
/* The name of the table type that will be used for display purposes */
- virtual const char *table_type() const
- { return "PARTITION"; }
+ virtual const char *table_type() const;
/* The name of the row type used for the underlying tables. */
virtual enum row_type get_row_type() const;
diff --git a/sql/handler.cc b/sql/handler.cc
index c53ee4153f9..808dd0841c5 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -68,7 +68,8 @@ const handlerton default_hton =
NULL, /* fill_files_table */
HTON_NO_FLAGS, /* flags */
NULL, /* binlog_func */
- NULL /* binlog_log_query */
+ NULL, /* binlog_log_query */
+ NULL /* release_temporary_latches */
};
static SHOW_COMP_OPTION have_yes= SHOW_OPTION_YES;
@@ -445,8 +446,6 @@ static my_bool init_handlerton(THD *unused1, st_plugin_int *plugin,
int ha_init()
{
int error= 0;
- handlerton **types;
- show_table_alias_st *table_alias;
total_ha= savepoint_alloc_size= 0;
if (ha_init_errors())
@@ -1179,11 +1178,23 @@ bool mysql_xa_recover(THD *thd)
return value: always 0
*/
+static my_bool release_temporary_latches(THD *thd, st_plugin_int *plugin,
+ void *unused)
+{
+ handlerton *hton= (handlerton *) plugin->plugin->info;
+
+ if (hton->state == SHOW_OPTION_YES && hton->release_temporary_latches)
+ hton->release_temporary_latches(thd);
+
+ return FALSE;
+}
+
+
int ha_release_temporary_latches(THD *thd)
{
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
- innobase_release_temporary_latches(thd);
-#endif
+ plugin_foreach(thd, release_temporary_latches, MYSQL_STORAGE_ENGINE_PLUGIN,
+ NULL);
+
return 0;
}
@@ -3264,6 +3275,8 @@ int handler::ha_external_lock(THD *thd, int lock_type)
case SQLCOM_TRUNCATE:
case SQLCOM_ALTER_TABLE:
DBUG_RETURN(0);
+ default:
+ break;
}
/*
@@ -3296,6 +3309,13 @@ int handler::ha_write_row(byte *buf)
int handler::ha_update_row(const byte *old_data, byte *new_data)
{
int error;
+
+ /*
+ Some storage engines require that the new record is in record[0]
+ (and the old record is in record[1]).
+ */
+ DBUG_ASSERT(new_data == table->record[0]);
+
if (unlikely(error= update_row(old_data, new_data)))
return error;
#ifdef HAVE_ROW_BASED_REPLICATION
diff --git a/sql/handler.h b/sql/handler.h
index ef7c206486a..261a813bbfa 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -580,6 +580,7 @@ typedef struct
void (*binlog_log_query)(THD *thd, enum_binlog_command binlog_command,
const char *query, uint query_length,
const char *db, const char *table_name);
+ int (*release_temporary_latches)(THD *thd);
} handlerton;
extern const handlerton default_hton;
@@ -685,6 +686,8 @@ public:
{
do_prelock(tables, count);
}
+ virtual ~TABLEOP_HOOKS() {}
+ TABLEOP_HOOKS() {}
private:
/* Function primitive that is called prior to locking tables */
diff --git a/sql/item.cc b/sql/item.cc
index 567957db583..00005694964 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -496,7 +496,7 @@ bool Item_ident::remove_dependence_processor(byte * arg)
arguments in a condition the method must return false.
RETURN
- false to force the evaluation of collect_item_field_processor
+ FALSE to force the evaluation of collect_item_field_processor
for the subsequent items.
*/
@@ -517,6 +517,39 @@ bool Item_field::collect_item_field_processor(byte *arg)
}
+/*
+ Check if an Item_field references some field from a list of fields.
+
+ SYNOPSIS
+ Item_field::find_item_in_field_list_processor
+ arg Field being compared, arg must be of type Field
+
+ DESCRIPTION
+ Check whether the Item_field represented by 'this' references any
+ of the fields in the keyparts passed via 'arg'. Used with the
+ method Item::walk() to test whether any keypart in a sequence of
+ keyparts is referenced in an expression.
+
+ RETURN
+ TRUE if 'this' references the field 'arg'
+ FALSE otherwise
+*/
+
+bool Item_field::find_item_in_field_list_processor(byte *arg)
+{
+ KEY_PART_INFO *first_non_group_part= *((KEY_PART_INFO **) arg);
+ KEY_PART_INFO *last_part= *(((KEY_PART_INFO **) arg) + 1);
+ KEY_PART_INFO *cur_part;
+
+ for (cur_part= first_non_group_part; cur_part != last_part; cur_part++)
+ {
+ if (field->eq(cur_part->field))
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
bool Item::check_cols(uint c)
{
if (c != 1)
@@ -1362,6 +1395,9 @@ bool agg_item_charsets(DTCollation &coll, const char *fname,
Item **args, uint nargs, uint flags)
{
Item **arg, **last, *safe_args[2];
+
+ LINT_INIT(safe_args[0]);
+ LINT_INIT(safe_args[1]);
if (agg_item_collations(coll, fname, args, nargs, flags))
return TRUE;
@@ -3753,7 +3789,7 @@ Item *Item_field::replace_equal_field(byte *arg)
if (item_equal)
{
Item_field *subst= item_equal->get_first();
- if (!field->eq(subst->field))
+ if (subst && !field->eq(subst->field))
return subst;
}
return this;
@@ -5114,11 +5150,8 @@ bool Item_direct_view_ref::fix_fields(THD *thd, Item **reference)
DESCRIPTION
A view column reference is considered equal to another column
reference if the second one is a view column and if both column
- references point to the same field. For views 'same field' means
- the same Item_field object in the view translation table, where
- the view translation table contains all result columns of the
- view. This definition ensures that view columns are resolved
- in the same manner as table columns.
+ references resolve to the same item. It is assumed that both
+ items are of the same type.
RETURN
TRUE Referenced item is equal to given item
@@ -5134,8 +5167,8 @@ bool Item_direct_view_ref::eq(const Item *item, bool binary_cmp) const
if (item_ref->ref_type() == VIEW_REF)
{
Item *item_ref_ref= *(item_ref->ref);
- DBUG_ASSERT((*ref)->real_item()->type() == FIELD_ITEM &&
- (item_ref_ref->real_item()->type() == FIELD_ITEM));
+ DBUG_ASSERT((*ref)->real_item()->type() ==
+ item_ref_ref->real_item()->type());
return ((*ref)->real_item() == item_ref_ref->real_item());
}
}
diff --git a/sql/item.h b/sql/item.h
index b9ce418858c..6c7a0976df1 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -741,6 +741,7 @@ public:
virtual bool remove_fixed(byte * arg) { fixed= 0; return 0; }
virtual bool cleanup_processor(byte *arg);
virtual bool collect_item_field_processor(byte * arg) { return 0; }
+ virtual bool find_item_in_field_list_processor(byte *arg) { return 0; }
virtual bool change_context_processor(byte *context) { return 0; }
virtual bool reset_query_id_processor(byte *query_id) { return 0; }
@@ -1193,6 +1194,7 @@ public:
bool is_null() { return field->is_null(); }
Item *get_tmp_table_item(THD *thd);
bool collect_item_field_processor(byte * arg);
+ bool find_item_in_field_list_processor(byte *arg);
bool reset_query_id_processor(byte *arg)
{
field->query_id= *((query_id_t *) arg);
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 6c19c96f77c..65654b150e1 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -2563,10 +2563,13 @@ Item_cond::fix_fields(THD *thd, Item **ref)
(item= *li.ref())->check_cols(1))
return TRUE; /* purecov: inspected */
used_tables_cache|= item->used_tables();
- tmp_table_map= item->not_null_tables();
- not_null_tables_cache|= tmp_table_map;
- and_tables_cache&= tmp_table_map;
- const_item_cache&= item->const_item();
+ if (!item->const_item())
+ {
+ tmp_table_map= item->not_null_tables();
+ not_null_tables_cache|= tmp_table_map;
+ and_tables_cache&= tmp_table_map;
+ const_item_cache= FALSE;
+ }
with_sum_func= with_sum_func || item->with_sum_func;
if (item->maybe_null)
maybe_null=1;
@@ -3599,7 +3602,8 @@ void Item_equal::add(Item *c)
Item_func_eq *func= new Item_func_eq(c, const_item);
func->set_cmp_func();
func->quick_fix_field();
- cond_false = !(func->val_int());
+ if ((cond_false= !func->val_int()))
+ const_item_cache= 1;
}
void Item_equal::add(Item_field *f)
@@ -3731,13 +3735,45 @@ void Item_equal::sort(Item_field_cmpfunc cmp, void *arg)
} while (swap);
}
+
+/*
+ Check appearance of new constant items in the multiple equality object
+
+ SYNOPSIS
+ update_const()
+
+ DESCRIPTION
+ The function checks appearance of new constant items among
+ the members of multiple equalities. Each new constant item is
+ compared with the designated constant item if there is any in the
+ multiple equality. If there is none the first new constant item
+ becomes designated.
+
+ RETURN VALUES
+ none
+*/
+
+void Item_equal::update_const()
+{
+ List_iterator<Item_field> it(fields);
+ Item *item;
+ while ((item= it++))
+ {
+ if (item->const_item())
+ {
+ it.remove();
+ add(item);
+ }
+ }
+}
+
bool Item_equal::fix_fields(THD *thd, Item **ref)
{
List_iterator_fast<Item_field> li(fields);
Item *item;
not_null_tables_cache= used_tables_cache= 0;
const_item_cache= 0;
- while ((item=li++))
+ while ((item= li++))
{
table_map tmp_table_map;
used_tables_cache|= item->used_tables();
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 89aafa5721e..67f0a5f5e2e 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -1196,6 +1196,7 @@ public:
bool contains(Field *field);
Item_field* get_first() { return fields.head(); }
void merge(Item_equal *item);
+ void update_const();
enum Functype functype() const { return MULT_EQUAL_FUNC; }
longlong val_int();
const char *func_name() const { return "multiple equal"; }
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 30b2c44c453..99b49d5686e 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -4463,7 +4463,7 @@ double Item_func_match::val_real()
DBUG_RETURN(-1.0);
if (table->null_row) /* NULL row from an outer join */
- return 0.0;
+ DBUG_RETURN(0.0);
if (join_key)
{
@@ -4480,9 +4480,8 @@ double Item_func_match::val_real()
DBUG_RETURN(ft_handler->please->find_relevance(ft_handler,
(byte *)a->ptr(), a->length()));
}
- else
- DBUG_RETURN(ft_handler->please->find_relevance(ft_handler,
- table->record[0], 0));
+ DBUG_RETURN(ft_handler->please->find_relevance(ft_handler,
+ table->record[0], 0));
}
void Item_func_match::print(String *str)
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index a3e47154bc3..dc14bd93136 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2593,7 +2593,7 @@ String *Item_load_file::val_str(String *str)
tmp_value.length(stat_info.st_size);
my_close(file, MYF(0));
null_value = 0;
- return &tmp_value;
+ DBUG_RETURN(&tmp_value);
err:
null_value = 1;
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 1ff82af1e2d..f28f8b668e2 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -2495,6 +2495,7 @@ void Item_sum_count_distinct::make_unique()
{
table=0;
original= 0;
+ force_copy_fields= 1;
tree= 0;
tmp_table_param= 0;
always_null= FALSE;
@@ -2538,6 +2539,7 @@ bool Item_sum_count_distinct::setup(THD *thd)
if (always_null)
return FALSE;
count_field_types(tmp_table_param,list,0);
+ tmp_table_param->force_copy_fields= force_copy_fields;
DBUG_ASSERT(table == 0);
if (!(table= create_tmp_table(thd, tmp_table_param, list, (ORDER*) 0, 1,
0,
@@ -3052,7 +3054,7 @@ Item_func_group_concat(Name_resolution_context *context_arg,
count_cut_values(0),
distinct(distinct_arg),
warning_for_row(FALSE),
- original(0)
+ force_copy_fields(0), original(0)
{
Item *item_select;
Item **arg_ptr;
@@ -3109,6 +3111,7 @@ Item_func_group_concat::Item_func_group_concat(THD *thd,
distinct(item->distinct),
warning_for_row(item->warning_for_row),
always_null(item->always_null),
+ force_copy_fields(item->force_copy_fields),
original(item)
{
quick_group= item->quick_group;
@@ -3310,6 +3313,7 @@ bool Item_func_group_concat::setup(THD *thd)
DBUG_RETURN(TRUE);
count_field_types(tmp_table_param,all_fields,0);
+ tmp_table_param->force_copy_fields= force_copy_fields;
DBUG_ASSERT(table == 0);
/*
We have to create a temporary table to get descriptions of fields
@@ -3372,6 +3376,7 @@ void Item_func_group_concat::make_unique()
tmp_table_param= 0;
table=0;
original= 0;
+ force_copy_fields= 1;
tree= 0;
}
diff --git a/sql/item_sum.h b/sql/item_sum.h
index a38530a502c..328f8dd8400 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -501,6 +501,7 @@ class Item_sum_count_distinct :public Item_sum_int
TABLE *table;
uint32 *field_lengths;
TMP_TABLE_PARAM *tmp_table_param;
+ bool force_copy_fields;
/*
If there are no blobs, we can use a tree, which
is faster than heap table. In that case, we still use the table
@@ -524,13 +525,14 @@ class Item_sum_count_distinct :public Item_sum_int
public:
Item_sum_count_distinct(List<Item> &list)
:Item_sum_int(list), table(0), field_lengths(0), tmp_table_param(0),
- tree(0), original(0), always_null(FALSE)
+ force_copy_fields(0), tree(0), original(0), always_null(FALSE)
{ quick_group= 0; }
Item_sum_count_distinct(THD *thd, Item_sum_count_distinct *item)
:Item_sum_int(thd, item), table(item->table),
field_lengths(item->field_lengths),
tmp_table_param(item->tmp_table_param),
- tree(item->tree), original(item), tree_key_length(item->tree_key_length),
+ force_copy_fields(0), tree(item->tree), original(item),
+ tree_key_length(item->tree_key_length),
always_null(item->always_null)
{}
~Item_sum_count_distinct();
@@ -1086,6 +1088,7 @@ class Item_func_group_concat : public Item_sum
bool distinct;
bool warning_for_row;
bool always_null;
+ bool force_copy_fields;
bool no_appended;
/*
Following is 0 normal object and pointer to original one for copy
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index c4f7dec70d0..7ee206a4195 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2028,7 +2028,6 @@ void Item_date_add_interval::fix_length_and_dec()
bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date)
{
- long period,sign;
INTERVAL interval;
if (args[0]->get_date(ltime, TIME_NO_ZERO_DATE) ||
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index ae626b7c368..91f958d5b70 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -2403,8 +2403,7 @@ void Item_xml_str_func::fix_length_and_dec()
char context[32];
uint clen= xpath.query.end - xpath.lasttok.beg;
set_if_bigger(clen, sizeof(context) - 1);
- memcpy(context, xpath.lasttok.beg, clen);
- context[clen]= '\0';
+ strmake(context, xpath.lasttok.beg, clen);
my_printf_error(ER_UNKNOWN_ERROR, "XPATH syntax error: '%s'",
MYF(0), context);
return;
diff --git a/sql/key.cc b/sql/key.cc
index 4001c6177a1..fd9e8a89b17 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -468,7 +468,6 @@ int key_rec_cmp(void *key, byte *first_rec, byte *second_rec)
do
{
Field *field= key_part->field;
- uint length;
if (key_part->null_bit)
{
diff --git a/sql/lock.cc b/sql/lock.cc
index 40a7a29942b..d552534b1c6 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -911,11 +911,13 @@ end:
void unlock_table_names(THD *thd, TABLE_LIST *table_list,
TABLE_LIST *last_table)
{
+ DBUG_ENTER("unlock_table_names");
for (TABLE_LIST *table= table_list;
table != last_table;
table= table->next_local)
unlock_table_name(thd,table);
pthread_cond_broadcast(&COND_refresh);
+ DBUG_VOID_RETURN;
}
diff --git a/sql/log.cc b/sql/log.cc
index 02bf5ec3015..b93b5319ffb 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -63,9 +63,11 @@ static int binlog_prepare(THD *thd, bool all);
Don't add constructors, destructors, or virtual functions.
*/
struct binlog_trx_data {
- bool empty() const {
+ bool empty() const
+ {
return pending == NULL && my_b_tell(&trans_log) == 0;
}
+ binlog_trx_data() {}
IO_CACHE trans_log; // The transaction cache
Rows_log_event *pending; // The pending binrows event
};
@@ -104,7 +106,8 @@ handlerton binlog_hton = {
NULL, /* Fill FILES table */
HTON_NOT_USER_SELECTABLE | HTON_HIDDEN,
NULL, /* binlog_func */
- NULL /* binlog_log_query */
+ NULL, /* binlog_log_query */
+ NULL /* release_temporary_latches */
};
@@ -717,8 +720,6 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length,
bool error= FALSE;
Log_event_handler **current_handler= slow_log_handler_list;
bool is_command= FALSE;
-
- char message_buff[MAX_LOG_BUFFER_SIZE];
char user_host_buff[MAX_USER_HOST_SIZE];
my_time_t current_time;
@@ -2637,8 +2638,9 @@ int THD::binlog_setup_trx_data()
int THD::binlog_write_table_map(TABLE *table, bool is_trans)
{
+ int error;
DBUG_ENTER("THD::binlog_write_table_map");
- DBUG_PRINT("enter", ("table=%p (%s: #%u)",
+ DBUG_PRINT("enter", ("table: %p (%s: #%u)",
table, table->s->table_name, table->s->table_map_id));
/* Pre-conditions */
@@ -2655,10 +2657,10 @@ int THD::binlog_write_table_map(TABLE *table, bool is_trans)
trans_register_ha(this, options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN),
&binlog_hton);
- if (int error= mysql_bin_log.write(&the_event))
+ if ((error= mysql_bin_log.write(&the_event)))
DBUG_RETURN(error);
- ++binlog_table_maps;
+ binlog_table_maps++;
table->s->table_map_version= mysql_bin_log.table_map_version();
DBUG_RETURN(0);
}
diff --git a/sql/log.h b/sql/log.h
index 391ef54dff7..03d5466e549 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -40,7 +40,8 @@ class TC_LOG
class TC_LOG_DUMMY: public TC_LOG // use it to disable the logging
{
- public:
+public:
+ TC_LOG_DUMMY() {}
int open(const char *opt_name) { return 0; }
void close() { }
int log(THD *thd, my_xid xid) { return 1; }
@@ -354,6 +355,7 @@ public:
class Log_event_handler
{
public:
+ Log_event_handler() {}
virtual bool init()= 0;
virtual void cleanup()= 0;
diff --git a/sql/log_event.cc b/sql/log_event.cc
index d7ad9501ffd..8a39b1fc4eb 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -6402,7 +6402,7 @@ static int find_and_fetch_row(TABLE *table, byte *key)
table->record[0] if the engine allows it. We first compute a
row reference using the position() member function (it will be
stored in table->file->ref) and the use rnd_pos() to position
- the "cursor" at the correct row.
+ the "cursor" (i.e., record[0] in this case) at the correct row.
*/
table->file->position(table->record[0]);
DBUG_RETURN(table->file->rnd_pos(table->record[0], table->file->ref));
@@ -6425,9 +6425,9 @@ static int find_and_fetch_row(TABLE *table, byte *key)
my_ptrdiff_t const pos=
table->s->null_bytes > 0 ? table->s->null_bytes - 1 : 0;
table->record[1][pos]= 0xFF;
- if ((error= table->file->index_read_idx(table->record[1], 0, key,
- table->key_info->key_length,
- HA_READ_KEY_EXACT)))
+ if ((error= table->file->index_read(table->record[1], key,
+ table->key_info->key_length,
+ HA_READ_KEY_EXACT)))
{
table->file->print_error(error, MYF(0));
DBUG_RETURN(error);
@@ -6797,19 +6797,25 @@ int Update_rows_log_event::do_exec_row(TABLE *table)
return error;
/*
- This is only a precaution to make sure that the call to
- ha_update_row is using record[1].
-
- If this is not needed/required, then we could use m_after_image in
- that call instead.
+ We have to ensure that the new record (i.e., the after image) is
+ in record[0] and the old record (i.e., the before image) is in
+ record[1]. This since some storage engines require this (for
+ example, the partition engine).
+
+ Since find_and_fetch_row() puts the fetched record (i.e., the old
+ record) in record[0], we have to move it out of the way and into
+ record[1]. After that, we can put the new record (i.e., the after
+ image) into record[0].
*/
- bmove_align(table->record[1], m_after_image,(size_t) table->s->reclength);
+ bmove_align(table->record[1], table->record[0], table->s->reclength);
+ bmove_align(table->record[0], m_after_image, table->s->reclength);
/*
- Now we should have the right row to update. The record that has
- been fetched is guaranteed to be in record[0], so we use that.
+ Now we should have the right row to update. The old row (the one
+ we're looking for) has to be in record[1] and the new row has to
+ be in record[0] for all storage engines to work correctly.
*/
- error= table->file->ha_update_row(table->record[0], table->record[1]);
+ error= table->file->ha_update_row(table->record[1], table->record[0]);
return error;
}
diff --git a/sql/message.mc b/sql/message.mc
new file mode 100644
index 00000000000..a1a7c8cff7e
--- /dev/null
+++ b/sql/message.mc
@@ -0,0 +1,8 @@
+MessageId = 100
+Severity = Error
+Facility = Application
+SymbolicName = MSG_DEFAULT
+Language = English
+%1For more information, see Help and Support Center at http://www.mysql.com.
+
+
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index a9d6f16fef3..85b96d7e690 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -756,6 +756,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
Item ***copy_func, Field **from_field,
bool group, bool modify_item,
bool table_cant_handle_bit_fields,
+ bool make_copy_field,
uint convert_blob_length);
void sp_prepare_create_field(THD *thd, create_field *sql_field);
int prepare_create_field(create_field *sql_field,
@@ -838,7 +839,7 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh);
bool close_data_tables(THD *thd,const char *db, const char *table_name);
bool wait_for_tables(THD *thd);
bool table_is_used(TABLE *table, bool wait_for_name_lock);
-bool drop_locked_tables(THD *thd,const char *db, const char *table_name);
+TABLE *drop_locked_tables(THD *thd,const char *db, const char *table_name);
void abort_locked_tables(THD *thd,const char *db, const char *table_name);
void execute_init_command(THD *thd, sys_var_str *init_command_var,
rw_lock_t *var_mutex);
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index ccb74730bc3..71067630535 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -3370,7 +3370,7 @@ static void create_shutdown_thread()
}
-#if defined(__NT__) || defined(HAVE_SMEM)
+#if (defined(__NT__) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY)
static void handle_connections_methods()
{
pthread_t hThread;
@@ -8173,6 +8173,7 @@ my_bool innobase_log_archive,
innobase_file_per_table,
innobase_locks_unsafe_for_binlog;
+extern "C" {
ulong srv_max_buf_pool_modified_pct;
ulong srv_max_purge_lag;
ulong srv_auto_extend_increment;
@@ -8181,6 +8182,8 @@ ulong srv_n_free_tickets_to_enter;
ulong srv_thread_sleep_delay;
ulong srv_thread_concurrency;
ulong srv_commit_concurrency;
+}
+
#endif
#ifndef WITH_NDBCLUSTER_STORAGE_ENGINE
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index e9ebd9cbccb..7f93327f68a 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -339,7 +339,7 @@ public:
if (min_flag || max_flag)
return FALSE;
byte *min_val= (byte *)min_value;
- byte *max_val= (byte *)min_value;
+ byte *max_val= (byte *)max_value;
if (maybe_null)
{
@@ -2296,6 +2296,7 @@ bool prune_partitions(THD *thd, TABLE *table, Item *pprune_cond)
RANGE_OPT_PARAM *range_par= &prune_param.range_param;
prune_param.part_info= part_info;
+ prune_param.part_iter.has_null_value= FALSE;
init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0);
range_par->mem_root= &alloc;
@@ -6039,7 +6040,8 @@ SEL_ARG *
SEL_ARG::insert(SEL_ARG *key)
{
SEL_ARG *element,**par,*last_element;
- LINT_INIT(par); LINT_INIT(last_element);
+ LINT_INIT(par);
+ LINT_INIT(last_element);
for (element= this; element != &null_element ; )
{
@@ -8187,6 +8189,7 @@ cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
bool have_min, bool have_max,
double *read_cost, ha_rows *records);
+
/*
Test if this access method is applicable to a GROUP query with MIN/MAX
functions, and if so, construct a new TRP object.
@@ -8593,11 +8596,36 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
}
else if (min_max_arg_part &&
(min_max_arg_part - first_non_group_part > 0))
+ {
/*
There is a gap but no range tree, thus no predicates at all for the
non-group keyparts.
*/
goto next_index;
+ }
+ else if (first_non_group_part && join->conds)
+ {
+ /*
+ If there is no MIN/MAX function in the query, but some index
+ key part is referenced in the WHERE clause, then this index
+ cannot be used because the WHERE condition over the keypart's
+ field cannot be 'pushed' to the index (because there is no
+ range 'tree'), and the WHERE clause must be evaluated before
+ GROUP BY/DISTINCT.
+ */
+ /*
+ Store the first and last keyparts that need to be analyzed
+ into one array that can be passed as parameter.
+ */
+ KEY_PART_INFO *key_part_range[2];
+ key_part_range[0]= first_non_group_part;
+ key_part_range[1]= last_part;
+
+ /* Check if cur_part is referenced in the WHERE clause. */
+ if (join->conds->walk(&Item::find_item_in_field_list_processor,
+ (byte*) key_part_range))
+ goto next_index;
+ }
}
/*
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 4158031b9a9..aac47707d1b 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -96,8 +96,14 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
*/
for (TABLE_LIST *tl= tables; tl; tl= tl->next_leaf)
{
+ TABLE_LIST *embedded;
+ for (embedded= tl ; embedded; embedded= embedded->embedding)
+ {
+ if (embedded->on_expr)
+ break;
+ }
+ if (embedded)
/* Don't replace expression on a table that is part of an outer join */
- if (tl->on_expr)
{
outer_tables|= tl->table->map;
diff --git a/sql/parse_file.cc b/sql/parse_file.cc
index 7faa4081d7d..0071d59242e 100644
--- a/sql/parse_file.cc
+++ b/sql/parse_file.cc
@@ -546,7 +546,7 @@ parse_string(char *ptr, char *end, MEM_ROOT *mem_root, LEX_STRING *str)
read escaped string from ptr to eol in already allocated str
SYNOPSIS
- parse_escaped_string()
+ read_escaped_string()
ptr - pointer on string beginning
eol - pointer on character after end of string
str - target string
@@ -617,7 +617,7 @@ read_escaped_string(char *ptr, char *eol, LEX_STRING *str)
# - pointer on symbol after string
*/
-static char *
+char *
parse_escaped_string(char *ptr, char *end, MEM_ROOT *mem_root, LEX_STRING *str)
{
char *eol= strchr(ptr, '\n');
@@ -635,7 +635,7 @@ parse_escaped_string(char *ptr, char *end, MEM_ROOT *mem_root, LEX_STRING *str)
parse '' delimited escaped string
SYNOPSIS
- parse_escaped_string()
+ parse_quoted_escaped_string()
ptr - pointer on string beginning
end - pointer on symbol after parsed string end (still owned
by buffer and can be accessed
diff --git a/sql/parse_file.h b/sql/parse_file.h
index 0d5a215fe1a..33871588e11 100644
--- a/sql/parse_file.h
+++ b/sql/parse_file.h
@@ -72,6 +72,9 @@ bool get_file_options_ulllist(char *&ptr, char *end, char *line,
gptr base, File_option *parameter,
MEM_ROOT *mem_root);
+char *
+parse_escaped_string(char *ptr, char *end, MEM_ROOT *mem_root, LEX_STRING *str);
+
class File_parser;
File_parser *sql_parse_prepare(const LEX_STRING *file_name,
MEM_ROOT *mem_root, bool bad_format_errors);
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 10725878d51..ad0aa053ae2 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -124,7 +124,6 @@ char *partition_info::create_default_partition_names(uint part_no, uint no_parts
SYNOPSIS
set_up_default_partitions()
- part_info The reference to all partition information
file A reference to a handler of the table
max_rows Maximum number of rows stored in the table
start_no Starting partition number
@@ -201,7 +200,6 @@ end:
SYNOPSIS
set_up_default_subpartitions()
- part_info The reference to all partition information
file A reference to a handler of the table
max_rows Maximum number of rows stored in the table
@@ -271,7 +269,6 @@ end:
SYNOPSIS
set_up_defaults_for_partitioning()
- part_info The reference to all partition information
file A reference to a handler of the table
max_rows Maximum number of rows stored in the table
start_no Starting partition number
@@ -388,4 +385,362 @@ char *partition_info::has_unique_names()
DBUG_RETURN(NULL);
}
+
+/*
+ Check that all partitions use the same storage engine.
+ This is currently a limitation in this version.
+
+ SYNOPSIS
+ check_engine_mix()
+ engine_array An array of engine identifiers
+ no_parts Total number of partitions
+
+ RETURN VALUE
+ TRUE Error, mixed engines
+ FALSE Ok, no mixed engines
+ DESCRIPTION
+ Current check verifies only that all handlers are the same.
+ Later this check will be more sophisticated.
+*/
+
+bool partition_info::check_engine_mix(handlerton **engine_array, uint no_parts)
+{
+ uint i= 0;
+ bool result= FALSE;
+ DBUG_ENTER("partition_info::check_engine_mix");
+
+ do
+ {
+ if (engine_array[i] != engine_array[0])
+ {
+ result= TRUE;
+ break;
+ }
+ } while (++i < no_parts);
+ DBUG_RETURN(result);
+}
+
+
+/*
+ This routine allocates an array for all range constants to achieve a fast
+ check what partition a certain value belongs to. At the same time it does
+ also check that the range constants are defined in increasing order and
+ that the expressions are constant integer expressions.
+
+ SYNOPSIS
+ check_range_constants()
+
+ RETURN VALUE
+ TRUE An error occurred during creation of range constants
+ FALSE Successful creation of range constant mapping
+
+ DESCRIPTION
+ This routine is called from check_partition_info to get a quick error
+ before we came too far into the CREATE TABLE process. It is also called
+ from fix_partition_func every time we open the .frm file. It is only
+ called for RANGE PARTITIONed tables.
+*/
+
+bool partition_info::check_range_constants()
+{
+ partition_element* part_def;
+ longlong current_largest_int= LONGLONG_MIN;
+ longlong part_range_value_int;
+ uint i;
+ List_iterator<partition_element> it(partitions);
+ bool result= TRUE;
+ DBUG_ENTER("partition_info::check_range_constants");
+ DBUG_PRINT("enter", ("INT_RESULT with %d parts", no_parts));
+
+ part_result_type= INT_RESULT;
+ range_int_array= (longlong*)sql_alloc(no_parts * sizeof(longlong));
+ if (unlikely(range_int_array == NULL))
+ {
+ mem_alloc_error(no_parts * sizeof(longlong));
+ goto end;
+ }
+ i= 0;
+ do
+ {
+ part_def= it++;
+ if ((i != (no_parts - 1)) || !defined_max_value)
+ part_range_value_int= part_def->range_value;
+ else
+ part_range_value_int= LONGLONG_MAX;
+ if (likely(current_largest_int < part_range_value_int))
+ {
+ current_largest_int= part_range_value_int;
+ range_int_array[i]= part_range_value_int;
+ }
+ else
+ {
+ my_error(ER_RANGE_NOT_INCREASING_ERROR, MYF(0));
+ goto end;
+ }
+ } while (++i < no_parts);
+ result= FALSE;
+end:
+ DBUG_RETURN(result);
+}
+
+
+/*
+ A support routine for check_list_constants used by qsort to sort the
+ constant list expressions.
+
+ SYNOPSIS
+ list_part_cmp()
+ a First list constant to compare with
+ b Second list constant to compare with
+
+ RETURN VALUE
+ +1 a > b
+ 0 a == b
+ -1 a < b
+*/
+
+int partition_info::list_part_cmp(const void* a, const void* b)
+{
+ longlong a1= ((LIST_PART_ENTRY*)a)->list_value;
+ longlong b1= ((LIST_PART_ENTRY*)b)->list_value;
+ if (a1 < b1)
+ return -1;
+ else if (a1 > b1)
+ return +1;
+ else
+ return 0;
+}
+
+
+/*
+ This routine allocates an array for all list constants to achieve a fast
+ check what partition a certain value belongs to. At the same time it does
+ also check that there are no duplicates among the list constants and that
+ that the list expressions are constant integer expressions.
+
+ SYNOPSIS
+ check_list_constants()
+
+ RETURN VALUE
+ TRUE An error occurred during creation of list constants
+ FALSE Successful creation of list constant mapping
+
+ DESCRIPTION
+ This routine is called from check_partition_info to get a quick error
+ before we came too far into the CREATE TABLE process. It is also called
+ from fix_partition_func every time we open the .frm file. It is only
+ called for LIST PARTITIONed tables.
+*/
+
+bool partition_info::check_list_constants()
+{
+ uint i;
+ uint list_index= 0;
+ longlong *list_value;
+ bool not_first;
+ bool result= TRUE;
+ longlong curr_value, prev_value;
+ partition_element* part_def;
+ bool found_null= FALSE;
+ List_iterator<partition_element> list_func_it(partitions);
+ DBUG_ENTER("partition_info::check_list_constants");
+
+ part_result_type= INT_RESULT;
+ no_list_values= 0;
+ /*
+ We begin by calculating the number of list values that have been
+ defined in the first step.
+
+ We use this number to allocate a properly sized array of structs
+ to keep the partition id and the value to use in that partition.
+ In the second traversal we assign them values in the struct array.
+
+ Finally we sort the array of structs in order of values to enable
+ a quick binary search for the proper value to discover the
+ partition id.
+ After sorting the array we check that there are no duplicates in the
+ list.
+ */
+
+ i= 0;
+ do
+ {
+ part_def= list_func_it++;
+ if (part_def->has_null_value)
+ {
+ if (found_null)
+ {
+ my_error(ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR, MYF(0));
+ goto end;
+ }
+ has_null_value= TRUE;
+ has_null_part_id= i;
+ found_null= TRUE;
+ }
+ List_iterator<longlong> list_val_it1(part_def->list_val_list);
+ while (list_val_it1++)
+ no_list_values++;
+ } while (++i < no_parts);
+ list_func_it.rewind();
+ list_array= (LIST_PART_ENTRY*)sql_alloc(no_list_values*sizeof(LIST_PART_ENTRY));
+ if (unlikely(list_array == NULL))
+ {
+ mem_alloc_error(no_list_values * sizeof(LIST_PART_ENTRY));
+ goto end;
+ }
+
+ i= 0;
+ do
+ {
+ part_def= list_func_it++;
+ List_iterator<longlong> list_val_it2(part_def->list_val_list);
+ while ((list_value= list_val_it2++))
+ {
+ list_array[list_index].list_value= *list_value;
+ list_array[list_index++].partition_id= i;
+ }
+ } while (++i < no_parts);
+
+ qsort((void*)list_array, no_list_values, sizeof(LIST_PART_ENTRY),
+ &list_part_cmp);
+
+ not_first= FALSE;
+ i= prev_value= 0; //prev_value initialised to quiet compiler
+ do
+ {
+ curr_value= list_array[i].list_value;
+ if (likely(!not_first || prev_value != curr_value))
+ {
+ prev_value= curr_value;
+ not_first= TRUE;
+ }
+ else
+ {
+ my_error(ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR, MYF(0));
+ goto end;
+ }
+ } while (++i < no_list_values);
+ result= FALSE;
+end:
+ DBUG_RETURN(result);
+}
+
+
+/*
+ This code is used early in the CREATE TABLE and ALTER TABLE process.
+
+ SYNOPSIS
+ check_partition_info()
+ file A reference to a handler of the table
+ max_rows Maximum number of rows stored in the table
+ engine_type Return value for used engine in partitions
+
+ RETURN VALUE
+ TRUE Error, something went wrong
+ FALSE Ok, full partition data structures are now generated
+
+ DESCRIPTION
+ We will check that the partition info requested is possible to set-up in
+ this version. This routine is an extension of the parser one could say.
+ If defaults were used we will generate default data structures for all
+ partitions.
+
+*/
+
+bool partition_info::check_partition_info(handlerton **eng_type,
+ handler *file, ulonglong max_rows)
+{
+ handlerton **engine_array= NULL;
+ uint part_count= 0;
+ uint i, tot_partitions;
+ bool result= TRUE;
+ char *same_name;
+ DBUG_ENTER("partition_info::check_partition_info");
+
+ if (unlikely(!is_sub_partitioned() &&
+ !(use_default_subpartitions && use_default_no_subpartitions)))
+ {
+ my_error(ER_SUBPARTITION_ERROR, MYF(0));
+ goto end;
+ }
+ if (unlikely(is_sub_partitioned() &&
+ (!(part_type == RANGE_PARTITION ||
+ part_type == LIST_PARTITION))))
+ {
+ /* Only RANGE and LIST partitioning can be subpartitioned */
+ my_error(ER_SUBPARTITION_ERROR, MYF(0));
+ goto end;
+ }
+ if (unlikely(set_up_defaults_for_partitioning(file, max_rows, (uint)0)))
+ goto end;
+ tot_partitions= get_tot_partitions();
+ if (unlikely(tot_partitions > MAX_PARTITIONS))
+ {
+ my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0));
+ goto end;
+ }
+ if ((same_name= has_unique_names()))
+ {
+ my_error(ER_SAME_NAME_PARTITION, MYF(0), same_name);
+ goto end;
+ }
+ engine_array= (handlerton**)my_malloc(tot_partitions * sizeof(handlerton *),
+ MYF(MY_WME));
+ if (unlikely(!engine_array))
+ goto end;
+ i= 0;
+ {
+ List_iterator<partition_element> part_it(partitions);
+ do
+ {
+ partition_element *part_elem= part_it++;
+ if (!is_sub_partitioned())
+ {
+ if (part_elem->engine_type == NULL)
+ part_elem->engine_type= default_engine_type;
+ DBUG_PRINT("info", ("engine = %d",
+ ha_legacy_type(part_elem->engine_type)));
+ engine_array[part_count++]= part_elem->engine_type;
+ }
+ else
+ {
+ uint j= 0;
+ List_iterator<partition_element> sub_it(part_elem->subpartitions);
+ do
+ {
+ part_elem= sub_it++;
+ if (part_elem->engine_type == NULL)
+ part_elem->engine_type= default_engine_type;
+ DBUG_PRINT("info", ("engine = %u",
+ ha_legacy_type(part_elem->engine_type)));
+ engine_array[part_count++]= part_elem->engine_type;
+ } while (++j < no_subparts);
+ }
+ } while (++i < no_parts);
+ }
+ if (unlikely(partition_info::check_engine_mix(engine_array, part_count)))
+ {
+ my_error(ER_MIX_HANDLER_ERROR, MYF(0));
+ goto end;
+ }
+
+ if (eng_type)
+ *eng_type= (handlerton*)engine_array[0];
+
+ /*
+ We need to check all constant expressions that they are of the correct
+ type and that they are increasing for ranges and not overlapping for
+ list constants.
+ */
+
+ if (unlikely((part_type == RANGE_PARTITION && check_range_constants()) ||
+ (part_type == LIST_PARTITION && check_list_constants())))
+ goto end;
+ result= FALSE;
+end:
+ my_free((char*)engine_array,MYF(MY_ALLOW_ZERO_PTR));
+ DBUG_RETURN(result);
+}
+
+
#endif /* WITH_PARTITION_STORAGE_ENGINE */
diff --git a/sql/partition_info.h b/sql/partition_info.h
index 69aef512a67..08669f8001e 100644
--- a/sql/partition_info.h
+++ b/sql/partition_info.h
@@ -245,7 +245,13 @@ public:
bool set_up_defaults_for_partitioning(handler *file, ulonglong max_rows,
uint start_no);
char *has_unique_names();
+ static bool check_engine_mix(handlerton **engine_array, uint no_parts);
+ bool check_range_constants();
+ bool check_list_constants();
+ bool check_partition_info(handlerton **eng_type,
+ handler *file, ulonglong max_rows);
private:
+ static int list_part_cmp(const void* a, const void* b);
bool set_up_default_partitions(handler *file, ulonglong max_rows,
uint start_no);
bool set_up_default_subpartitions(handler *file, ulonglong max_rows);
diff --git a/sql/password.c b/sql/password.c
index 506e1aa36a2..c6d904bc45b 100644
--- a/sql/password.c
+++ b/sql/password.c
@@ -323,7 +323,7 @@ void create_random_string(char *to, uint length, struct rand_struct *rand_st)
char *octet2hex(char *to, const char *str, uint len)
{
- const byte *str_end= str + len;
+ const char *str_end= str + len;
for (; str != str_end; ++str)
{
*to++= _dig_vec_upper[((uchar) *str) >> 4];
@@ -406,7 +406,7 @@ make_scrambled_password(char *to, const char *password)
mysql_sha1_result(&sha1_context, hash_stage2);
/* convert hash_stage2 to hex string */
*to++= PVERSION41_CHAR;
- octet2hex(to, hash_stage2, SHA1_HASH_SIZE);
+ octet2hex(to, (const char*) hash_stage2, SHA1_HASH_SIZE);
}
@@ -520,5 +520,5 @@ void get_salt_from_password(uint8 *hash_stage2, const char *password)
void make_password_from_salt(char *to, const uint8 *hash_stage2)
{
*to++= PVERSION41_CHAR;
- octet2hex(to, hash_stage2, SHA1_HASH_SIZE);
+ octet2hex(to, (const char*) hash_stage2, SHA1_HASH_SIZE);
}
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 213b52cc20c..f2694f651f4 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1965,6 +1965,7 @@ CHARSET_INFO *get_old_charset_by_name(const char *name)
bool sys_var_collation::check(THD *thd, set_var *var)
{
CHARSET_INFO *tmp;
+ LINT_INIT(tmp);
if (var->value->result_type() == STRING_RESULT)
{
@@ -1999,6 +2000,7 @@ bool sys_var_collation::check(THD *thd, set_var *var)
bool sys_var_character_set::check(THD *thd, set_var *var)
{
CHARSET_INFO *tmp;
+ LINT_INIT(tmp);
if (var->value->result_type() == STRING_RESULT)
{
diff --git a/sql/share/charsets/Index.xml b/sql/share/charsets/Index.xml
index 6db14f22264..3f1a25072b7 100644
--- a/sql/share/charsets/Index.xml
+++ b/sql/share/charsets/Index.xml
@@ -115,7 +115,10 @@ To make maintaining easier please:
<alias>l1</alias>
<alias>latin1</alias>
<collation name="latin1_german1_ci" id="5" order="German Duden"/>
- <collation name="latin1_swedish_ci" id="8" order="Finnish, Swedish" flag="primary"/>
+ <collation name="latin1_swedish_ci" id="8" order="Finnish, Swedish">
+ <flag>primary</flag>
+ <flag>compiled</flag>
+ </collation>
<collation name="latin1_danish_ci" id="15" order="Danish"/>
<collation name="latin1_german2_ci" id="31" order="German Phonebook" flag="compiled"/>
<collation name="latin1_spanish_ci" id="94" order="Spanish"/>
diff --git a/sql/share/charsets/latin1.xml b/sql/share/charsets/latin1.xml
index 0b6f54dc800..5814a17b0e1 100644
--- a/sql/share/charsets/latin1.xml
+++ b/sql/share/charsets/latin1.xml
@@ -33,14 +33,14 @@
01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 10 00 10 02 10 10 10 10 10 10 01 10 01 00 01 00
+ 00 10 10 10 10 10 10 10 10 10 02 10 02 00 02 01
+ 48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
+ 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
- 01 01 01 01 01 01 01 00 01 01 01 01 01 01 01 02
+ 01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
- 02 02 02 02 02 02 02 00 02 02 02 02 02 02 02 02
+ 02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 02
</map>
</ctype>
@@ -99,8 +99,8 @@
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
- 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 008A 008B 008C 008D 008E 008F
- 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 009F
+ 20AC 0081 201A 0192 201E 2026 2020 2021 02C6 2030 0160 2039 0152 008D 017D 008F
+ 0090 2018 2019 201C 201D 2022 2013 2014 02DC 2122 0161 203A 0153 009D 017E 0178
00A0 00A1 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00AA 00AB 00AC 00AD 00AE 00AF
00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00BA 00BB 00BC 00BD 00BE 00BF
00C0 00C1 00C2 00C3 00C4 00C5 00C6 00C7 00C8 00C9 00CA 00CB 00CC 00CD 00CE 00CF
diff --git a/sql/slave.cc b/sql/slave.cc
index 484d669de62..04ecc04ab17 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3613,7 +3613,7 @@ Slave SQL thread aborted. Can't execute init_slave query");
thd->net.last_error ?
thd->net.last_error : "<no message>");
}
- else if (rli->last_slave_errno != thd->net.last_errno)
+ else if (rli->last_slave_errno != (int) thd->net.last_errno)
{
sql_print_error("Slave (additional info): %s Error_code: %d",
thd->net.last_error ?
@@ -4095,6 +4095,7 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT /* a way to escape */)
DBUG_RETURN(queue_old_event(mi,buf,event_len));
+ LINT_INIT(inc_pos);
pthread_mutex_lock(&mi->data_lock);
switch (buf[EVENT_TYPE_OFFSET]) {
diff --git a/sql/sp.cc b/sql/sp.cc
index 022417d15d1..7fc388860d1 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -535,7 +535,11 @@ db_create_routine(THD *thd, int type, sp_head *sp)
ret= SP_GET_FIELD_FAILED;
goto done;
}
- if (sp->m_name.length > table->field[MYSQL_PROC_FIELD_NAME]->field_length)
+
+ if (system_charset_info->cset->numchars(system_charset_info,
+ sp->m_name.str,
+ sp->m_name.str+sp->m_name.length) >
+ table->field[MYSQL_PROC_FIELD_NAME]->char_length())
{
ret= SP_BAD_IDENTIFIER;
goto done;
@@ -668,7 +672,6 @@ db_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics)
{
TABLE *table;
int ret;
- bool opened;
DBUG_ENTER("db_update_routine");
DBUG_PRINT("enter", ("type: %d name: %.*s",
type, name->m_name.length, name->m_name.str));
diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc
index fea6a67f32c..f5912caddaf 100644
--- a/sql/sp_cache.cc
+++ b/sql/sp_cache.cc
@@ -124,7 +124,6 @@ void sp_cache_clear(sp_cache **cp)
void sp_cache_insert(sp_cache **cp, sp_head *sp)
{
sp_cache *c;
- ulong v;
if (!(c= *cp))
{
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index cec3a19a542..47d4326d780 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -563,6 +563,7 @@ create_typelib(MEM_ROOT *mem_root, create_field *field_def, List<String> *src)
TYPELIB *result= NULL;
CHARSET_INFO *cs= field_def->charset;
DBUG_ENTER("create_typelib");
+
if (src->elements)
{
result= (TYPELIB*) alloc_root(mem_root, sizeof(TYPELIB));
@@ -570,8 +571,8 @@ create_typelib(MEM_ROOT *mem_root, create_field *field_def, List<String> *src)
result->name= "";
if (!(result->type_names=(const char **)
alloc_root(mem_root,(sizeof(char *)+sizeof(int))*(result->count+1))))
- return 0;
- result->type_lengths= (unsigned int *)(result->type_names + result->count+1);
+ DBUG_RETURN(0);
+ result->type_lengths= (uint*)(result->type_names + result->count+1);
List_iterator<String> it(*src);
String conv;
for (uint i=0; i < result->count; i++)
@@ -604,7 +605,7 @@ create_typelib(MEM_ROOT *mem_root, create_field *field_def, List<String> *src)
result->type_names[result->count]= 0;
result->type_lengths[result->count]= 0;
}
- return result;
+ DBUG_RETURN(result);
}
@@ -1224,10 +1225,10 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
sp_rcontext *octx = thd->spcont;
sp_rcontext *nctx = NULL;
bool err_status= FALSE;
-
DBUG_ENTER("sp_head::execute_function");
DBUG_PRINT("info", ("function %s", m_name.str));
+ LINT_INIT(binlog_save_options);
params = m_pcont->context_pvars();
/*
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index aa426cb33f9..09b684c8706 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -5037,6 +5037,8 @@ static int handle_grant_struct(uint struct_no, bool drop,
LINT_INIT(acl_user);
LINT_INIT(acl_db);
LINT_INIT(grant_name);
+ LINT_INIT(user);
+ LINT_INIT(host);
/* Get the number of elements in the in-memory structure. */
switch (struct_no) {
@@ -5109,8 +5111,7 @@ static int handle_grant_struct(uint struct_no, bool drop,
result= 1; /* At least one element found. */
if ( drop )
{
- switch ( struct_no )
- {
+ switch ( struct_no ) {
case 0:
delete_dynamic_element(&acl_users, idx);
break;
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index af9246c673a..f372c55c13e 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -176,8 +176,7 @@ err:
bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
{
- const char *begin, *end = str + str_len;
-
+ const char *begin, *end= str + str_len;
DBUG_ENTER("test_if_number");
/*
@@ -186,13 +185,13 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
*/
for (; str != end && my_isspace(system_charset_info, *str); str++) ;
if (str == end)
- return 0;
+ DBUG_RETURN(0);
if (*str == '-')
{
info->negative = 1;
- if (++str == end || *str == '0') // converting -0 to a number
- return 0; // might lose information
+ if (++str == end || *str == '0') // converting -0 to a number
+ DBUG_RETURN(0); // might lose information
}
else
info->negative = 0;
@@ -210,33 +209,33 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
int error;
info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error);
if (info->integers == 1)
- return 0; // a single number can't be zerofill
+ DBUG_RETURN(0); // single number can't be zerofill
info->maybe_zerofill = 1;
- return 1; // a zerofill number, or an integer
+ DBUG_RETURN(1); // a zerofill number, or an integer
}
if (*str == '.' || *str == 'e' || *str == 'E')
{
- if (info->zerofill) // can't be zerofill anymore
- return 0;
- if ((str + 1) == end) // number was something like '123[.eE]'
+ if (info->zerofill) // can't be zerofill anymore
+ DBUG_RETURN(0);
+ if ((str + 1) == end) // number was something like '123[.eE]'
{
char *endpos= (char*) str;
int error;
info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error);
- return 1;
+ DBUG_RETURN(1);
}
- if (*str == 'e' || *str == 'E') // number may be something like '1e+50'
+ if (*str == 'e' || *str == 'E') // number may be something like '1e+50'
{
str++;
if (*str != '-' && *str != '+')
- return 0;
+ DBUG_RETURN(0);
for (str++; str != end && my_isdigit(system_charset_info,*str); str++) ;
if (str == end)
{
- info->is_float = 1; // we can't use variable decimals here
+ info->is_float = 1; // we can't use variable decimals here
return 1;
}
- return 0;
+ DBUG_RETURN(0);
}
for (str++; *(end - 1) == '0'; end--); // jump over zeros at the end
if (str == end) // number was something like '123.000'
@@ -244,17 +243,17 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
char *endpos= (char*) str;
int error;
info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error);
- return 1;
+ DBUG_RETURN(1);
}
for (; str != end && my_isdigit(system_charset_info,*str); str++)
info->decimals++;
if (str == end)
{
info->dval = my_atof(begin);
- return 1;
+ DBUG_RETURN(1);
}
}
- return 0;
+ DBUG_RETURN(0);
}
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 6c2ca06164f..7499cec6147 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1408,10 +1408,7 @@ void update_non_unique_table_error(TABLE_LIST *update,
TABLE *find_temporary_table(THD *thd, const char *db, const char *table_name)
{
- char key[MAX_DBKEY_LENGTH];
- uint key_length;
TABLE_LIST table_list;
- TABLE *table;
table_list.db= (char*) db;
table_list.table_name= (char*) table_name;
@@ -1738,7 +1735,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
/* an open table operation needs a lot of the stack space */
if (check_stack_overrun(thd, STACK_MIN_SIZE_FOR_OPEN, (char *)&alias))
- return 0;
+ DBUG_RETURN(0);
if (thd->killed)
DBUG_RETURN(0);
@@ -1877,7 +1874,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
if (!thd->open_tables)
thd->version=refresh_version;
else if ((thd->version != refresh_version) &&
- ! (flags & MYSQL_LOCK_IGNORE_FLUSH) && !table->s->log_table)
+ ! (flags & MYSQL_LOCK_IGNORE_FLUSH))
{
/* Someone did a refresh while thread was opening tables */
if (refresh)
@@ -1939,7 +1936,6 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
}
else
{
- TABLE_SHARE *share;
/* Free cache if too big */
while (open_cache.records > table_cache_size && unused_tables)
VOID(hash_delete(&open_cache,(byte*) unused_tables)); /* purecov: tested */
@@ -2349,13 +2345,36 @@ bool wait_for_tables(THD *thd)
}
-/* drop tables from locked list */
+/*
+ drop tables from locked list
+
+ SYNOPSIS
+ drop_locked_tables()
+ thd Thread thandler
+ db Database
+ table_name Table name
-bool drop_locked_tables(THD *thd,const char *db, const char *table_name)
+ INFORMATION
+ This is only called on drop tables
+
+ The TABLE object for the dropped table is unlocked but still kept around
+ as a name lock, which means that the table will be available for other
+ thread as soon as we call unlock_table_names().
+ If there is multiple copies of the table locked, all copies except
+ the first, which acts as a name lock, is removed.
+
+ RETURN
+ # If table existed, return table
+ 0 Table was not locked
+*/
+
+
+TABLE *drop_locked_tables(THD *thd,const char *db, const char *table_name)
{
- TABLE *table,*next,**prev;
- bool found=0;
+ TABLE *table,*next,**prev, *found= 0;
prev= &thd->open_tables;
+ DBUG_ENTER("drop_locked_tables");
+
for (table= thd->open_tables; table ; table=next)
{
next=table->next;
@@ -2363,8 +2382,21 @@ bool drop_locked_tables(THD *thd,const char *db, const char *table_name)
!strcmp(table->s->db.str, db))
{
mysql_lock_remove(thd, thd->locked_tables,table);
- VOID(hash_delete(&open_cache,(byte*) table));
- found=1;
+ if (!found)
+ {
+ found= table;
+ /* Close engine table, but keep object around as a name lock */
+ if (table->db_stat)
+ {
+ table->db_stat= 0;
+ table->file->close();
+ }
+ }
+ else
+ {
+ /* We already have a name lock, remove copy */
+ VOID(hash_delete(&open_cache,(byte*) table));
+ }
}
else
{
@@ -2373,14 +2405,12 @@ bool drop_locked_tables(THD *thd,const char *db, const char *table_name)
}
}
*prev=0;
- if (found)
- VOID(pthread_cond_broadcast(&COND_refresh)); // Signal to refresh
if (thd->locked_tables && thd->locked_tables->table_count == 0)
{
my_free((gptr) thd->locked_tables,MYF(0));
thd->locked_tables=0;
}
- return found;
+ DBUG_RETURN(found);
}
@@ -3489,6 +3519,7 @@ find_field_in_view(THD *thd, TABLE_LIST *table_list,
Field_iterator_view field_it;
field_it.set(table_list);
Query_arena *arena, backup;
+ LINT_INIT(arena);
DBUG_ASSERT(table_list->schema_table_reformed ||
(ref != 0 && table_list->view != 0));
@@ -3578,6 +3609,7 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name,
DBUG_ASSERT(table_ref->is_natural_join && table_ref->join_columns);
DBUG_ASSERT(*actual_table == NULL);
+ LINT_INIT(arena);
LINT_INIT(found_field);
for (;;)
diff --git a/sql/sql_class.h b/sql/sql_class.h
index bcc00c19eb0..60ff558ac48 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1605,13 +1605,14 @@ public:
lock(0)
{}
int prepare(List<Item> &list, SELECT_LEX_UNIT *u);
- friend class select_create_prepare_hooks;
void binlog_show_create_table(TABLE **tables, uint count);
void store_values(List<Item> &values);
void send_error(uint errcode,const char *err);
bool send_eof();
void abort();
+ // Needed for access from local class MY_HOOKS in prepare(), since thd is proteted.
+ THD *get_thd(void) { return thd; }
};
#include <myisam.h>
@@ -1655,11 +1656,12 @@ public:
aggregate functions as normal functions.
*/
bool precomputed_group_by;
+ bool force_copy_fields;
TMP_TABLE_PARAM()
:copy_field(0), group_parts(0),
group_length(0), group_null_parts(0), convert_blob_length(0),
- schema_table(0), precomputed_group_by(0)
+ schema_table(0), precomputed_group_by(0), force_copy_fields(0)
{}
~TMP_TABLE_PARAM()
{
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index f4186120766..181b91781d7 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -37,7 +37,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
READ_RECORD info;
bool using_limit=limit != HA_POS_ERROR;
bool transactional_table, safe_update, const_cond;
- ha_rows deleted;
+ ha_rows deleted= 0;
uint usable_index= MAX_KEY;
SELECT_LEX *select_lex= &thd->lex->select_lex;
bool ha_delete_all_rows= 0;
@@ -212,7 +212,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
else
init_read_record_idx(&info, thd, table, 1, usable_index);
- deleted=0L;
init_ftfuncs(thd, select_lex, 1);
thd->proc_info="updating";
will_batch= !table->file->start_bulk_delete();
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 13e1f80f512..5cb74fd32ee 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -419,11 +419,15 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
let's *try* to start bulk inserts. It won't necessary
start them as values_list.elements should be greater than
some - handler dependent - threshold.
+ We should not start bulk inserts if this statement uses
+ functions or invokes triggers since they may access
+ to the same table and therefore should not see its
+ inconsistent state created by this optimization.
So we call start_bulk_insert to perform nesessary checks on
values_list.elements, and - if nothing else - to initialize
the code to make the call of end_bulk_insert() below safe.
*/
- if (lock_type != TL_WRITE_DELAYED)
+ if (lock_type != TL_WRITE_DELAYED && !thd->prelocked_mode)
table->file->start_bulk_insert(values_list.elements);
thd->no_trans_update= 0;
@@ -549,7 +553,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
else
#endif
{
- if (table->file->end_bulk_insert() && !error)
+ if (!thd->prelocked_mode && table->file->end_bulk_insert() && !error)
{
table->file->print_error(my_errno,MYF(0));
error=1;
@@ -2230,7 +2234,7 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
lex->current_select->options|= OPTION_BUFFER_RESULT;
lex->current_select->join->select_options|= OPTION_BUFFER_RESULT;
}
- else
+ else if (!thd->prelocked_mode)
{
/*
We must not yet prepare the result table if it is the same as one of the
@@ -2238,6 +2242,8 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
indexes on the result table, which may be used during the select, if it
is the same table (Bug #6034). Do the preparation after the select phase
in select_insert::prepare2().
+ We won't start bulk inserts at all if this statement uses functions or
+ should invoke triggers since they may access to the same table too.
*/
table->file->start_bulk_insert((ha_rows) 0);
}
@@ -2288,7 +2294,8 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
int select_insert::prepare2(void)
{
DBUG_ENTER("select_insert::prepare2");
- if (thd->lex->current_select->options & OPTION_BUFFER_RESULT)
+ if (thd->lex->current_select->options & OPTION_BUFFER_RESULT &&
+ !thd->prelocked_mode)
table->file->start_bulk_insert((ha_rows) 0);
DBUG_RETURN(0);
}
@@ -2391,7 +2398,8 @@ void select_insert::send_error(uint errcode,const char *err)
*/
DBUG_VOID_RETURN;
}
- table->file->end_bulk_insert();
+ if (!thd->prelocked_mode)
+ table->file->end_bulk_insert();
/*
If at least one row has been inserted/modified and will stay in the table
(the table doesn't have transactions) we must write to the binlog (and
@@ -2447,7 +2455,7 @@ bool select_insert::send_eof()
int error,error2;
DBUG_ENTER("select_insert::send_eof");
- error=table->file->end_bulk_insert();
+ error= (!thd->prelocked_mode) ? table->file->end_bulk_insert():0;
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
/*
@@ -2507,28 +2515,25 @@ bool select_insert::send_eof()
CREATE TABLE (SELECT) ...
***************************************************************************/
-/* HPUX compiler bug prevents this from being a local class, since then it
- does not have access to protected member select_create::thd.
-*/
-class select_create_prepare_hooks : public TABLEOP_HOOKS {
-public:
- select_create_prepare_hooks(select_create *x) : ptr(x) { }
- virtual void do_prelock(TABLE **tables, uint count)
- {
- if (ptr->thd->current_stmt_binlog_row_based)
- ptr->binlog_show_create_table(tables, count);
- }
-
-private:
- select_create *ptr;
-};
-
int
select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
{
DBUG_ENTER("select_create::prepare");
- select_create_prepare_hooks hooks(this);
+ class MY_HOOKS : public TABLEOP_HOOKS {
+ public:
+ MY_HOOKS(select_create *x) : ptr(x) { }
+ virtual void do_prelock(TABLE **tables, uint count)
+ {
+ if (ptr->get_thd()->current_stmt_binlog_row_based)
+ ptr->binlog_show_create_table(tables, count);
+ }
+
+ private:
+ select_create *ptr;
+ };
+
+ MY_HOOKS hooks(this);
unit= u;
table= create_table_from_items(thd, create_info, create_table,
@@ -2559,7 +2564,8 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
thd->cuted_fields=0;
if (info.ignore || info.handle_duplicates != DUP_ERROR)
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
- table->file->start_bulk_insert((ha_rows) 0);
+ if (!thd->prelocked_mode)
+ table->file->start_bulk_insert((ha_rows) 0);
thd->no_trans_update= 0;
thd->abort_on_warning= (!info.ignore &&
(thd->variables.sql_mode &
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 9fcdc969597..599480e616c 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -367,7 +367,8 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
if (ignore ||
handle_duplicates == DUP_REPLACE)
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
- table->file->start_bulk_insert((ha_rows) 0);
+ if (!thd->prelocked_mode)
+ table->file->start_bulk_insert((ha_rows) 0);
table->copy_blobs=1;
thd->no_trans_update= 0;
@@ -384,7 +385,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
error= read_sep_field(thd, info, table_list, fields_vars,
set_fields, set_values, read_info,
*enclosed, skip_lines, ignore);
- if (table->file->end_bulk_insert() && !error)
+ if (!thd->prelocked_mode && table->file->end_bulk_insert() && !error)
{
table->file->print_error(my_errno, MYF(0));
error= 1;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index eea2ae57e75..c33257ff602 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2112,8 +2112,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
void log_slow_statement(THD *thd)
{
- DBUG_ENTER("log_slow_statement");
time_t start_of_query;
+ DBUG_ENTER("log_slow_statement");
/*
The following should never be true with our current code base,
@@ -2121,7 +2121,7 @@ void log_slow_statement(THD *thd)
statement in a trigger or stored function
*/
if (unlikely(thd->in_sub_stmt))
- return; // Don't set time for sub stmt
+ DBUG_VOID_RETURN; // Don't set time for sub stmt
start_of_query= thd->start_time;
thd->end_time(); // Set start time
@@ -5864,18 +5864,15 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
{
if (thd->net.report_error)
{
- if (thd->lex->sphead)
- {
- delete thd->lex->sphead;
- thd->lex->sphead= NULL;
- }
- if (thd->lex->et)
+ delete lex->sphead;
+ lex->sphead= NULL;
+ if (lex->et)
{
- thd->lex->et->free_sphead_on_delete= true;
+ lex->et->free_sphead_on_delete= true;
/* alloced on thd->mem_root so no real memory free but dtor call */
- thd->lex->et->free_sp();
- thd->lex->et->deinit_mutexes();
- thd->lex->et= NULL;
+ lex->et->free_sp();
+ lex->et->deinit_mutexes();
+ lex->et= NULL;
}
}
else
@@ -5906,18 +5903,18 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
thd->is_fatal_error));
query_cache_abort(&thd->net);
lex->unit.cleanup();
- if (thd->lex->sphead)
+ if (lex->sphead)
{
/* Clean up after failed stored procedure/function */
- delete thd->lex->sphead;
- thd->lex->sphead= NULL;
+ delete lex->sphead;
+ lex->sphead= NULL;
}
- if (thd->lex->et)
+ if (lex->et)
{
- thd->lex->et->free_sphead_on_delete= true;
+ lex->et->free_sphead_on_delete= true;
lex->et->free_sp();
lex->et->deinit_mutexes();
- thd->lex->et= NULL;
+ lex->et= NULL;
}
}
thd->proc_info="freeing items";
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 62c48ba37dc..981b22e0caf 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -199,13 +199,15 @@ bool is_name_in_list(char *name,
*/
bool partition_default_handling(TABLE *table, partition_info *part_info,
+ bool is_create_table_ind,
const char *normalized_path)
{
DBUG_ENTER("partition_default_handling");
if (part_info->use_default_no_partitions)
{
- if (table->file->get_no_parts(normalized_path, &part_info->no_parts))
+ if (!is_create_table_ind &&
+ table->file->get_no_parts(normalized_path, &part_info->no_parts))
{
DBUG_RETURN(TRUE);
}
@@ -214,7 +216,8 @@ bool partition_default_handling(TABLE *table, partition_info *part_info,
part_info->use_default_no_subpartitions)
{
uint no_parts;
- if (table->file->get_no_parts(normalized_path, &no_parts))
+ if (!is_create_table_ind &&
+ (table->file->get_no_parts(normalized_path, &no_parts)))
{
DBUG_RETURN(TRUE);
}
@@ -408,383 +411,6 @@ int get_part_for_delete(const byte *buf, const byte *rec0,
/*
- This routine allocates an array for all range constants to achieve a fast
- check what partition a certain value belongs to. At the same time it does
- also check that the range constants are defined in increasing order and
- that the expressions are constant integer expressions.
-
- SYNOPSIS
- check_range_constants()
- part_info Partition info
-
- RETURN VALUE
- TRUE An error occurred during creation of range constants
- FALSE Successful creation of range constant mapping
-
- DESCRIPTION
- This routine is called from check_partition_info to get a quick error
- before we came too far into the CREATE TABLE process. It is also called
- from fix_partition_func every time we open the .frm file. It is only
- called for RANGE PARTITIONed tables.
-*/
-
-static bool check_range_constants(partition_info *part_info)
-{
- partition_element* part_def;
- longlong current_largest_int= LONGLONG_MIN;
- longlong part_range_value_int;
- uint no_parts= part_info->no_parts;
- uint i;
- List_iterator<partition_element> it(part_info->partitions);
- bool result= TRUE;
- DBUG_ENTER("check_range_constants");
- DBUG_PRINT("enter", ("INT_RESULT with %d parts", no_parts));
-
- part_info->part_result_type= INT_RESULT;
- part_info->range_int_array=
- (longlong*)sql_alloc(no_parts * sizeof(longlong));
- if (unlikely(part_info->range_int_array == NULL))
- {
- mem_alloc_error(no_parts * sizeof(longlong));
- goto end;
- }
- i= 0;
- do
- {
- part_def= it++;
- if ((i != (no_parts - 1)) || !part_info->defined_max_value)
- part_range_value_int= part_def->range_value;
- else
- part_range_value_int= LONGLONG_MAX;
- if (likely(current_largest_int < part_range_value_int))
- {
- current_largest_int= part_range_value_int;
- part_info->range_int_array[i]= part_range_value_int;
- }
- else
- {
- my_error(ER_RANGE_NOT_INCREASING_ERROR, MYF(0));
- goto end;
- }
- } while (++i < no_parts);
- result= FALSE;
-end:
- DBUG_RETURN(result);
-}
-
-
-/*
- A support routine for check_list_constants used by qsort to sort the
- constant list expressions.
-
- SYNOPSIS
- list_part_cmp()
- a First list constant to compare with
- b Second list constant to compare with
-
- RETURN VALUE
- +1 a > b
- 0 a == b
- -1 a < b
-*/
-
-static int list_part_cmp(const void* a, const void* b)
-{
- longlong a1= ((LIST_PART_ENTRY*)a)->list_value;
- longlong b1= ((LIST_PART_ENTRY*)b)->list_value;
- if (a1 < b1)
- return -1;
- else if (a1 > b1)
- return +1;
- else
- return 0;
-}
-
-
-/*
- This routine allocates an array for all list constants to achieve a fast
- check what partition a certain value belongs to. At the same time it does
- also check that there are no duplicates among the list constants and that
- that the list expressions are constant integer expressions.
-
- SYNOPSIS
- check_list_constants()
- part_info Partition info
-
- RETURN VALUE
- TRUE An error occurred during creation of list constants
- FALSE Successful creation of list constant mapping
-
- DESCRIPTION
- This routine is called from check_partition_info to get a quick error
- before we came too far into the CREATE TABLE process. It is also called
- from fix_partition_func every time we open the .frm file. It is only
- called for LIST PARTITIONed tables.
-*/
-
-static bool check_list_constants(partition_info *part_info)
-{
- uint i, no_parts;
- uint no_list_values= 0;
- uint list_index= 0;
- longlong *list_value;
- bool not_first;
- bool result= TRUE;
- longlong curr_value, prev_value;
- partition_element* part_def;
- bool found_null= FALSE;
- List_iterator<partition_element> list_func_it(part_info->partitions);
- DBUG_ENTER("check_list_constants");
-
- part_info->part_result_type= INT_RESULT;
-
- /*
- We begin by calculating the number of list values that have been
- defined in the first step.
-
- We use this number to allocate a properly sized array of structs
- to keep the partition id and the value to use in that partition.
- In the second traversal we assign them values in the struct array.
-
- Finally we sort the array of structs in order of values to enable
- a quick binary search for the proper value to discover the
- partition id.
- After sorting the array we check that there are no duplicates in the
- list.
- */
-
- no_parts= part_info->no_parts;
- i= 0;
- do
- {
- part_def= list_func_it++;
- if (part_def->has_null_value)
- {
- if (found_null)
- {
- my_error(ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR, MYF(0));
- goto end;
- }
- part_info->has_null_value= TRUE;
- part_info->has_null_part_id= i;
- found_null= TRUE;
- }
- List_iterator<longlong> list_val_it1(part_def->list_val_list);
- while (list_val_it1++)
- no_list_values++;
- } while (++i < no_parts);
- list_func_it.rewind();
- part_info->no_list_values= no_list_values;
- part_info->list_array=
- (LIST_PART_ENTRY*)sql_alloc(no_list_values*sizeof(LIST_PART_ENTRY));
- if (unlikely(part_info->list_array == NULL))
- {
- mem_alloc_error(no_list_values * sizeof(LIST_PART_ENTRY));
- goto end;
- }
-
- i= 0;
- do
- {
- part_def= list_func_it++;
- List_iterator<longlong> list_val_it2(part_def->list_val_list);
- while ((list_value= list_val_it2++))
- {
- part_info->list_array[list_index].list_value= *list_value;
- part_info->list_array[list_index++].partition_id= i;
- }
- } while (++i < no_parts);
-
- qsort((void*)part_info->list_array, no_list_values,
- sizeof(LIST_PART_ENTRY), &list_part_cmp);
-
- not_first= FALSE;
- i= prev_value= 0; //prev_value initialised to quiet compiler
- do
- {
- curr_value= part_info->list_array[i].list_value;
- if (likely(!not_first || prev_value != curr_value))
- {
- prev_value= curr_value;
- not_first= TRUE;
- }
- else
- {
- my_error(ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR, MYF(0));
- goto end;
- }
- } while (++i < no_list_values);
- result= FALSE;
-end:
- DBUG_RETURN(result);
-}
-
-
-
-
-
-
-
-/*
- Check that all partitions use the same storage engine.
- This is currently a limitation in this version.
-
- SYNOPSIS
- check_engine_mix()
- engine_array An array of engine identifiers
- no_parts Total number of partitions
-
- RETURN VALUE
- TRUE Error, mixed engines
- FALSE Ok, no mixed engines
- DESCRIPTION
- Current check verifies only that all handlers are the same.
- Later this check will be more sophisticated.
-*/
-
-static bool check_engine_mix(handlerton **engine_array, uint no_parts)
-{
- uint i= 0;
- bool result= FALSE;
- DBUG_ENTER("check_engine_mix");
-
- do
- {
- if (engine_array[i] != engine_array[0])
- {
- result= TRUE;
- break;
- }
- } while (++i < no_parts);
- DBUG_RETURN(result);
-}
-
-
-/*
- This code is used early in the CREATE TABLE and ALTER TABLE process.
-
- SYNOPSIS
- check_partition_info()
- part_info The reference to all partition information
- file A reference to a handler of the table
- max_rows Maximum number of rows stored in the table
- engine_type Return value for used engine in partitions
-
- RETURN VALUE
- TRUE Error, something went wrong
- FALSE Ok, full partition data structures are now generated
-
- DESCRIPTION
- We will check that the partition info requested is possible to set-up in
- this version. This routine is an extension of the parser one could say.
- If defaults were used we will generate default data structures for all
- partitions.
-
-*/
-
-bool check_partition_info(partition_info *part_info,handlerton **eng_type,
- handler *file, ulonglong max_rows)
-{
- handlerton **engine_array= NULL;
- uint part_count= 0;
- uint i, no_parts, tot_partitions;
- bool result= TRUE;
- char *same_name;
- DBUG_ENTER("check_partition_info");
-
- if (unlikely(!part_info->is_sub_partitioned() &&
- !(part_info->use_default_subpartitions &&
- part_info->use_default_no_subpartitions)))
- {
- my_error(ER_SUBPARTITION_ERROR, MYF(0));
- goto end;
- }
- if (unlikely(part_info->is_sub_partitioned() &&
- (!(part_info->part_type == RANGE_PARTITION ||
- part_info->part_type == LIST_PARTITION))))
- {
- /* Only RANGE and LIST partitioning can be subpartitioned */
- my_error(ER_SUBPARTITION_ERROR, MYF(0));
- goto end;
- }
- if (unlikely(part_info->set_up_defaults_for_partitioning(file,
- max_rows,
- (uint)0)))
- goto end;
- tot_partitions= part_info->get_tot_partitions();
- if (unlikely(tot_partitions > MAX_PARTITIONS))
- {
- my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0));
- goto end;
- }
- if ((same_name= part_info->has_unique_names()))
- {
- my_error(ER_SAME_NAME_PARTITION, MYF(0), same_name);
- goto end;
- }
- engine_array= (handlerton**)my_malloc(tot_partitions * sizeof(handlerton *),
- MYF(MY_WME));
- if (unlikely(!engine_array))
- goto end;
- i= 0;
- no_parts= part_info->no_parts;
- {
- List_iterator<partition_element> part_it(part_info->partitions);
- do
- {
- partition_element *part_elem= part_it++;
- if (!part_info->is_sub_partitioned())
- {
- if (part_elem->engine_type == NULL)
- part_elem->engine_type= part_info->default_engine_type;
- DBUG_PRINT("info", ("engine = %d",
- ha_legacy_type(part_elem->engine_type)));
- engine_array[part_count++]= part_elem->engine_type;
- }
- else
- {
- uint j= 0, no_subparts= part_info->no_subparts;;
- List_iterator<partition_element> sub_it(part_elem->subpartitions);
- do
- {
- part_elem= sub_it++;
- if (part_elem->engine_type == NULL)
- part_elem->engine_type= part_info->default_engine_type;
- DBUG_PRINT("info", ("engine = %u",
- ha_legacy_type(part_elem->engine_type)));
- engine_array[part_count++]= part_elem->engine_type;
- } while (++j < no_subparts);
- }
- } while (++i < part_info->no_parts);
- }
- if (unlikely(check_engine_mix(engine_array, part_count)))
- {
- my_error(ER_MIX_HANDLER_ERROR, MYF(0));
- goto end;
- }
-
- if (eng_type)
- *eng_type= (handlerton*)engine_array[0];
-
- /*
- We need to check all constant expressions that they are of the correct
- type and that they are increasing for ranges and not overlapping for
- list constants.
- */
-
- if (unlikely((part_info->part_type == RANGE_PARTITION &&
- check_range_constants(part_info)) ||
- (part_info->part_type == LIST_PARTITION &&
- check_list_constants(part_info))))
- goto end;
- result= FALSE;
-end:
- my_free((char*)engine_array,MYF(MY_ALLOW_ZERO_PTR));
- DBUG_RETURN(result);
-}
-
-
-/*
This method is used to set-up both partition and subpartitioning
field array and used for all types of partitioning.
It is part of the logic around fix_partition_func.
@@ -1737,9 +1363,11 @@ bool fix_partition_func(THD *thd, const char* name, TABLE *table,
db_name= &db_name_string[home_dir_length];
tables.db= db_name;
- if (!is_create_table_ind)
+ if (!is_create_table_ind ||
+ thd->lex->sql_command != SQLCOM_CREATE_TABLE)
{
if (partition_default_handling(table, part_info,
+ is_create_table_ind,
table->s->normalized_path.str))
{
DBUG_RETURN(TRUE);
@@ -1809,13 +1437,13 @@ bool fix_partition_func(THD *thd, const char* name, TABLE *table,
if (part_info->part_type == RANGE_PARTITION)
{
error_str= partition_keywords[PKW_RANGE].str;
- if (unlikely(check_range_constants(part_info)))
+ if (unlikely(part_info->check_range_constants()))
goto end;
}
else if (part_info->part_type == LIST_PARTITION)
{
error_str= partition_keywords[PKW_LIST].str;
- if (unlikely(check_list_constants(part_info)))
+ if (unlikely(part_info->check_list_constants()))
goto end;
}
else
@@ -1880,6 +1508,11 @@ static int add_write(File fptr, const char *buf, uint len)
return 1;
}
+static int add_string_object(File fptr, String *string)
+{
+ return add_write(fptr, string->ptr(), string->length());
+}
+
static int add_string(File fptr, const char *string)
{
return add_write(fptr, string, strlen(string));
@@ -1966,7 +1599,14 @@ static int add_key_partition(File fptr, List<char> field_list)
while (i < no_fields)
{
const char *field_str= part_it++;
- err+= add_string(fptr, field_str);
+ String field_string("", 0, system_charset_info);
+ THD *thd= current_thd;
+ ulonglong save_options= thd->options;
+ thd->options= 0;
+ append_identifier(thd, &field_string, field_str,
+ strlen(field_str));
+ thd->options= save_options;
+ err+= add_string_object(fptr, &field_string);
if (i != (no_fields-1))
err+= add_comma(fptr);
i++;
@@ -2036,7 +1676,7 @@ static int add_partition_options(File fptr, partition_element *p_elem)
err+= add_keyword_string(fptr, "INDEX DIRECTORY", TRUE,
p_elem->index_file_name);
if (p_elem->part_comment)
- err+= add_keyword_string(fptr, "COMMENT", FALSE, p_elem->part_comment);
+ err+= add_keyword_string(fptr, "COMMENT", TRUE, p_elem->part_comment);
return err + add_engine(fptr,p_elem->engine_type);
}
@@ -2863,9 +2503,6 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
/* Get the partitioning function value for the endpoint */
longlong part_func_value= part_val_int(part_info->part_expr);
- if (part_info->part_expr->null_value)
- DBUG_RETURN(0);
-
while (max_part_id > min_part_id)
{
loc_part_id= (max_part_id + min_part_id + 1) >> 1;
@@ -3636,10 +3273,10 @@ void get_partition_set(const TABLE *table, byte *buf, const uint index,
| Forminfo 288 bytes |
-------------------------------
| Screen buffer, to make |
- | field names readable |
+ |field names readable |
-------------------------------
| Packed field info |
- | 17 + 1 + strlen(field_name) |
+ |17 + 1 + strlen(field_name) |
| + 1 end of file character |
-------------------------------
| Partition info |
@@ -3742,7 +3379,7 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
DBUG_PRINT("info", ("default engine = %d, default_db_type = %d",
ha_legacy_type(part_info->default_engine_type),
ha_legacy_type(default_db_type)));
- if (is_create_table_ind)
+ if (is_create_table_ind && old_lex->sql_command == SQLCOM_CREATE_TABLE)
{
if (old_lex->like_name)
{
@@ -3756,14 +3393,32 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
char *src_table= table_ident->table.str;
char buf[FN_REFLEN];
build_table_filename(buf, sizeof(buf), src_db, src_table, "");
- if (partition_default_handling(table, part_info, buf))
+ if (partition_default_handling(table, part_info,
+ FALSE, buf))
{
result= TRUE;
goto end;
}
}
else
+ {
+ /*
+ When we come here we are doing a create table. In this case we
+ have already done some preparatory work on the old part_info
+ object. We don't really need this new partition_info object.
+ Thus we go back to the old partition info object.
+ We need to free any memory objects allocated on item_free_list
+ by the parser since we are keeping the old info from the first
+ parser call in CREATE TABLE.
+ We'll ensure that this object isn't put into table cache also
+ just to ensure we don't get into strange situations with the
+ item objects.
+ */
+ free_items(thd->free_list);
part_info= thd->work_part_info;
+ thd->free_list= NULL;
+ table->s->version= 0UL;
+ }
}
table->part_info= part_info;
table->file->set_part_info(part_info);
@@ -4842,7 +4497,7 @@ the generated partition syntax in a correct manner.
tab_part_info->use_default_subpartitions= FALSE;
tab_part_info->use_default_no_subpartitions= FALSE;
}
- if (check_partition_info(tab_part_info, (handlerton**)NULL,
+ if (tab_part_info->check_partition_info((handlerton**)NULL,
table->file, ULL(0)))
{
DBUG_RETURN(TRUE);
@@ -4901,7 +4556,7 @@ the generated partition syntax in a correct manner.
*/
if (table->part_info)
{
- if (thd->lex->alter_info.flags & ALTER_REMOVE_PARTITIONING)
+ if (alter_info->flags & ALTER_REMOVE_PARTITIONING)
{
DBUG_PRINT("info", ("Remove partitioning"));
if (!(thd->lex->create_info.used_fields & HA_CREATE_USED_ENGINE))
@@ -5623,6 +5278,7 @@ static void set_up_range_analysis_info(partition_info *part_info)
switch (field->type()) {
case MYSQL_TYPE_TINY:
case MYSQL_TYPE_SHORT:
+ case MYSQL_TYPE_INT24:
case MYSQL_TYPE_LONG:
case MYSQL_TYPE_LONGLONG:
part_info->get_part_iter_for_interval=
@@ -5722,6 +5378,19 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
else
DBUG_ASSERT(0);
+ if (field->real_maybe_null() && part_info->has_null_value)
+ {
+ if (*min_value)
+ {
+ if (*max_value && !(flags & (NO_MIN_RANGE | NO_MAX_RANGE)))
+ {
+ init_single_partition_iterator(part_info->has_null_part_id, part_iter);
+ return 1;
+ }
+ if (!(flags & NEAR_MIN))
+ part_iter->has_null_value= TRUE;
+ }
+ }
/* Find minimum */
if (flags & NO_MIN_RANGE)
part_iter->part_nums.start= 0;
@@ -5852,7 +5521,11 @@ int get_part_iter_for_interval_via_walking(partition_info *part_info,
else
{
longlong dummy;
- if (!part_info->get_partition_id(part_info, &part_id, &dummy))
+ int res= part_info->is_sub_partitioned() ?
+ part_info->get_part_partition_id(part_info, &part_id,
+ &dummy):
+ part_info->get_partition_id(part_info, &part_id, &dummy);
+ if (!res)
{
init_single_partition_iterator(part_id, part_iter);
return 1; /* Ok, iterator initialized */
@@ -5933,7 +5606,14 @@ uint32 get_next_partition_id_range(PARTITION_ITERATOR* part_iter)
uint32 get_next_partition_id_list(PARTITION_ITERATOR *part_iter)
{
if (part_iter->part_nums.start == part_iter->part_nums.end)
+ {
+ if (part_iter->has_null_value)
+ {
+ part_iter->has_null_value= FALSE;
+ return part_iter->part_info->has_null_part_id;
+ }
return NOT_A_PARTITION_ID;
+ }
else
return part_iter->part_info->list_array[part_iter->
part_nums.start++].partition_id;
diff --git a/sql/sql_partition.h b/sql/sql_partition.h
index 4982b1fcf1f..c214be81ae4 100644
--- a/sql/sql_partition.h
+++ b/sql/sql_partition.h
@@ -124,7 +124,7 @@ typedef uint32 (*partition_iter_func)(st_partition_iter* part_iter);
typedef struct st_partition_iter
{
partition_iter_func get_next;
-
+ bool has_null_value;
struct st_part_num_range
{
uint32 start;
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 74852716f74..3d42bfea104 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -192,7 +192,8 @@ static st_plugin_dl *plugin_dl_add(LEX_STRING *dl, int report)
if (plugin_dl.version != MYSQL_PLUGIN_INTERFACE_VERSION)
{
- int i, sizeof_st_plugin;
+ int i;
+ uint sizeof_st_plugin;
struct st_mysql_plugin *old, *cur;
char *ptr= (char *)sym;
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index a0cfc5a7a9e..ced15b3f728 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -2128,11 +2128,17 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
/* Reset is_schema_table_processed value(needed for I_S tables */
tables->is_schema_table_processed= FALSE;
- if (tables->prep_on_expr)
+ TABLE_LIST *embedded; /* The table at the current level of nesting. */
+ TABLE_LIST *embedding= tables; /* The parent nested table reference. */
+ do
{
- tables->on_expr= tables->prep_on_expr->copy_andor_structure(thd);
- tables->on_expr->cleanup();
+ embedded= embedding;
+ if (embedded->prep_on_expr)
+ embedded->on_expr= embedded->prep_on_expr->copy_andor_structure(thd);
+ embedding= embedded->embedding;
}
+ while (embedding &&
+ embedding->nested_join->join_list.head() == embedded);
}
lex->current_select= &lex->select_lex;
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 59c7436d85c..4e67ce0d67f 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -2190,7 +2190,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
s->type=JT_SYSTEM;
join->const_table_map|=table->map;
set_position(join,const_count++,s,(KEYUSE*) 0);
- if ((tmp= join_read_const_table(s,join->positions+const_count-1)))
+ if ((tmp= join_read_const_table(s, join->positions+const_count-1)))
{
if (tmp > 0)
DBUG_RETURN(1); // Fatal error
@@ -2243,7 +2243,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
found_const_table_map))
DBUG_RETURN(1);
if ((tmp=join_read_const_table(s,
- join->positions+const_count-1)))
+ join->positions+const_count-1)))
{
if (tmp > 0)
DBUG_RETURN(1); // Fatal error
@@ -6844,8 +6844,8 @@ static COND *build_equal_items_for_cond(COND *cond,
return item_equal;
}
/*
- For each field reference in cond, not from equalitym predicates,
- set a pointer to the multiple equality if belongs to (if there is any)
+ For each field reference in cond, not from equal item predicates,
+ set a pointer to the multiple equality it belongs to (if there is any)
*/
cond= cond->transform(&Item::equal_fields_propagator,
(byte *) inherited);
@@ -7030,7 +7030,7 @@ static int compare_fields_by_table_order(Item_field *field1,
NOTES
Before generating an equality function checks that it has not
- been generated for multiple equalies of the upper levels.
+ been generated for multiple equalities of the upper levels.
E.g. for the following where condition
WHERE a=5 AND ((a=b AND b=c) OR c>4)
the upper level AND condition will contain =(5,a),
@@ -7203,7 +7203,7 @@ static COND* substitute_for_best_equal_field(COND *cond,
{
cond= eliminate_item_equal(cond, cond_equal->upper_levels, item_equal);
// This occurs when eliminate_item_equal() founds that cond is
- // always false and substitues it with Item_int 0.
+ // always false and substitutes it with Item_int 0.
// Due to this, value of item_equal will be 0, so just return it.
if (cond->type() != Item::COND_ITEM)
break;
@@ -7225,6 +7225,44 @@ static COND* substitute_for_best_equal_field(COND *cond,
}
+/*
+ Check appearance of new constant items in multiple equalities
+ of a condition after reading a constant table
+
+ SYNOPSIS
+ update_const_equal_items()
+ cond condition whose multiple equalities are to be checked
+ table constant table that has been read
+
+ DESCRIPTION
+ The function retrieves the cond condition and for each encountered
+ multiple equality checks whether new constants have appeared after
+ reading the constant (single row) table tab. If so it adjusts
+ the multiple equality appropriately.
+*/
+
+static void update_const_equal_items(COND *cond, JOIN_TAB *tab)
+{
+ if (!(cond->used_tables() & tab->table->map))
+ return;
+
+ if (cond->type() == Item::COND_ITEM)
+ {
+ List<Item> *cond_list= ((Item_cond*) cond)->argument_list();
+ List_iterator_fast<Item> li(*cond_list);
+ Item *item;
+ while ((item= li++))
+ update_const_equal_items(item, tab);
+ }
+ else if (cond->type() == Item::FUNC_ITEM &&
+ ((Item_cond*) cond)->functype() == Item_func::MULT_EQUAL_FUNC)
+ {
+ Item_equal *item_equal= (Item_equal *) cond;
+ item_equal->update_const();
+ }
+}
+
+
/*
change field = field to field = const for each found field = const in the
and_level
@@ -7517,7 +7555,7 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top)
*/
if (table->on_expr)
{
- Item *expr= table->prep_on_expr ? table->prep_on_expr : table->on_expr;
+ Item *expr= table->on_expr;
/*
If an on expression E is attached to the table,
check all null rejected predicates in this expression.
@@ -7528,7 +7566,9 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top)
*/
expr= simplify_joins(join, &nested_join->join_list,
expr, FALSE);
- table->prep_on_expr= table->on_expr= expr;
+ table->on_expr= expr;
+ if (!table->prep_on_expr)
+ table->prep_on_expr= expr->copy_andor_structure(join->thd);
}
nested_join->used_tables= (table_map) 0;
nested_join->not_null_tables=(table_map) 0;
@@ -8353,6 +8393,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
Item ***copy_func, Field **from_field,
bool group, bool modify_item,
bool table_cant_handle_bit_fields,
+ bool make_copy_field,
uint convert_blob_length)
{
Item::Type orig_type= type;
@@ -8434,7 +8475,13 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
case Item::REF_ITEM:
case Item::NULL_ITEM:
case Item::VARBIN_ITEM:
- return create_tmp_field_from_item(thd, item, table, copy_func, modify_item,
+ if (make_copy_field)
+ {
+ DBUG_ASSERT(((Item_result_field*)item)->result_field);
+ *from_field= ((Item_result_field*)item)->result_field;
+ }
+ return create_tmp_field_from_item(thd, item, table, (make_copy_field ? 0 :
+ copy_func), modify_item,
convert_blob_length);
case Item::TYPE_HOLDER:
return ((Item_type_holder *)item)->make_field_by_type(table);
@@ -8507,6 +8554,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
Item **copy_func;
MI_COLUMNDEF *recinfo;
uint total_uneven_bit_length= 0;
+ bool force_copy_fields= param->force_copy_fields;
DBUG_ENTER("create_tmp_table");
DBUG_PRINT("enter",("distinct: %d save_sum_fields: %d rows_limit: %lu group: %d",
(int) distinct, (int) save_sum_fields,
@@ -8666,7 +8714,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
Field *new_field=
create_tmp_field(thd, table, arg, arg->type(), &copy_func,
tmp_from_field, group != 0,not_all_columns,
- distinct,
+ distinct, 0,
param->convert_blob_length);
if (!new_field)
goto err; // Should be OOM
@@ -8723,8 +8771,9 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
create_tmp_field_for_schema(thd, item, table) :
create_tmp_field(thd, table, item, type, &copy_func,
tmp_from_field, group != 0,
- not_all_columns || group != 0,
- item->marker == 4,
+ !force_copy_fields &&
+ (not_all_columns || group !=0),
+ item->marker == 4, force_copy_fields,
param->convert_blob_length);
if (!new_field)
@@ -10213,6 +10262,27 @@ join_read_const_table(JOIN_TAB *tab, POSITION *pos)
}
if (!table->null_row)
table->maybe_null=0;
+
+ /* Check appearance of new constant items in Item_equal objects */
+ JOIN *join= tab->join;
+ if (join->conds)
+ update_const_equal_items(join->conds, tab);
+ TABLE_LIST *tbl;
+ for (tbl= join->select_lex->leaf_tables; tbl; tbl= tbl->next_leaf)
+ {
+ TABLE_LIST *embedded;
+ TABLE_LIST *embedding= tbl;
+ do
+ {
+ embedded= embedding;
+ if (embedded->on_expr)
+ update_const_equal_items(embedded->on_expr, tab);
+ embedding= embedded->embedding;
+ }
+ while (embedding &&
+ embedding->nested_join->join_list.head() == embedded);
+ }
+
DBUG_RETURN(0);
}
@@ -12410,7 +12480,11 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
Item **select_item; /* The corresponding item from the SELECT clause. */
Field *from_field; /* The corresponding field from the FROM clause. */
- if (order_item->type() == Item::INT_ITEM)
+ /*
+ Local SP variables may be int but are expressions, not positions.
+ (And they can't be used before fix_fields is called for them).
+ */
+ if (order_item->type() == Item::INT_ITEM && order_item->basic_const_item())
{ /* Order by position */
uint count= (uint) order_item->val_int();
if (!count || count > fields.elements)
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index da372d9063d..c8f4d399037 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1770,18 +1770,19 @@ void free_status_vars()
there's lots of room for optimizing this, especially in non-sorted mode,
but nobody cares - it may be called only in case of failed plugin
initialization in the mysqld startup.
-
*/
+
void remove_status_vars(SHOW_VAR *list)
{
if (status_vars_inited)
{
pthread_mutex_lock(&LOCK_status);
SHOW_VAR *all= dynamic_element(&all_status_vars, 0, SHOW_VAR *);
- int a= 0, b= all_status_vars.elements, c= (a+b)/2, res;
+ int a= 0, b= all_status_vars.elements, c= (a+b)/2;
for (; list->name; list++)
{
+ int res= 0;
for (a= 0, b= all_status_vars.elements; b-a > 1; c= (a+b)/2)
{
res= show_var_cmp(list, all+c);
@@ -1789,7 +1790,8 @@ void remove_status_vars(SHOW_VAR *list)
b= c;
else if (res > 0)
a= c;
- else break;
+ else
+ break;
}
if (res == 0)
all[c].type= SHOW_UNDEF;
@@ -1800,7 +1802,7 @@ void remove_status_vars(SHOW_VAR *list)
else
{
SHOW_VAR *all= dynamic_element(&all_status_vars, 0, SHOW_VAR *);
- int i;
+ uint i;
for (; list->name; list++)
{
for (i= 0; i < all_status_vars.elements; i++)
@@ -2719,6 +2721,12 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
ptr=strxmov(ptr, " row_format=",
ha_row_type[(uint) share->row_type],
NullS);
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+ if (show_table->s->db_type == &partition_hton &&
+ show_table->part_info != NULL &&
+ show_table->part_info->no_parts > 0)
+ ptr= strmov(ptr, " partitioned");
+#endif
table->field[19]->store(option_buff+1,
(ptr == option_buff ? 0 :
(uint) (ptr-option_buff)-1), cs);
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index de7b273d57e..ed875d321bc 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -565,6 +565,10 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
String built_query;
DBUG_ENTER("mysql_rm_table_part2");
+ LINT_INIT(alias);
+ LINT_INIT(path_length);
+ safe_mutex_assert_owner(&LOCK_open);
+
if (thd->current_stmt_binlog_row_based && !dont_log_query)
{
built_query.set_charset(system_charset_info);
@@ -614,7 +618,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
*/
if (thd->current_stmt_binlog_row_based && !dont_log_query)
{
- ++non_temp_tables_count;
+ non_temp_tables_count++;
/*
Don't write the database name if it is the current one (or if
thd->db is NULL).
@@ -634,11 +638,18 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
table_type= table->db_type;
if (!drop_temporary)
{
+ TABLE *locked_table;
abort_locked_tables(thd, db, table->table_name);
remove_table_from_cache(thd, db, table->table_name,
RTFC_WAIT_OTHER_THREAD_FLAG |
RTFC_CHECK_KILLED_FLAG);
- drop_locked_tables(thd, db, table->table_name);
+ /*
+ If the table was used in lock tables, remember it so that
+ unlock_table_names can free it
+ */
+ if ((locked_table= drop_locked_tables(thd, db, table->table_name)))
+ table->table= locked_table;
+
if (thd->killed)
{
thd->no_warnings_for_error= 0;
@@ -649,8 +660,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
path_length= build_table_filename(path, sizeof(path),
db, alias, reg_ext);
}
- if (table_type == NULL &&
- (drop_temporary ||
+ if (drop_temporary ||
+ (table_type == NULL &&
(access(path, F_OK) &&
ha_create_table_from_engine(thd, db, alias)) ||
(!drop_view &&
@@ -1180,6 +1191,11 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
sql_field->interval_list);
List_iterator<String> it(sql_field->interval_list);
String conv, *tmp;
+ char comma_buf[2];
+ int comma_length= cs->cset->wc_mb(cs, ',', (uchar*) comma_buf,
+ (uchar*) comma_buf +
+ sizeof(comma_buf));
+ DBUG_ASSERT(comma_length > 0);
for (uint i= 0; (tmp= it++); i++)
{
uint lengthsp;
@@ -1198,6 +1214,16 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
interval->type_lengths[i]);
interval->type_lengths[i]= lengthsp;
((uchar *)interval->type_names[i])[lengthsp]= '\0';
+ if (sql_field->sql_type == FIELD_TYPE_SET)
+ {
+ if (cs->coll->instr(cs, interval->type_names[i],
+ interval->type_lengths[i],
+ comma_buf, comma_length, NULL, 0))
+ {
+ my_error(ER_ILLEGAL_VALUE_FOR_TYPE, MYF(0), "set", tmp->ptr());
+ DBUG_RETURN(-1);
+ }
+ }
}
sql_field->interval_list.empty(); // Don't need interval_list anymore
}
@@ -2115,7 +2141,7 @@ bool mysql_create_table_internal(THD *thd,
}
DBUG_PRINT("info", ("db_type = %d",
ha_legacy_type(part_info->default_engine_type)));
- if (check_partition_info(part_info, &engine_type, file,
+ if (part_info->check_partition_info( &engine_type, file,
create_info->max_rows))
goto err;
part_info->default_engine_type= engine_type;
@@ -2130,15 +2156,6 @@ bool mysql_create_table_internal(THD *thd,
goto err;
part_info->part_info_string= part_syntax_buf;
part_info->part_info_len= syntax_len;
- if (create_info->db_type != engine_type)
- {
- delete file;
- if (!(file= get_new_handler((TABLE_SHARE*) 0, thd->mem_root, engine_type)))
- {
- mem_alloc_error(sizeof(handler));
- DBUG_RETURN(TRUE);
- }
- }
if ((!(engine_type->partition_flags &&
engine_type->partition_flags() & HA_CAN_PARTITION)) ||
create_info->db_type == &partition_hton)
@@ -2155,6 +2172,41 @@ bool mysql_create_table_internal(THD *thd,
{
DBUG_RETURN(TRUE);
}
+ /*
+ If we have default number of partitions or subpartitions we
+ might require to set-up the part_info object such that it
+ creates a proper .par file. The current part_info object is
+ only used to create the frm-file and .par-file.
+ */
+ if (part_info->use_default_no_partitions &&
+ part_info->no_parts &&
+ (int)part_info->no_parts != file->get_default_no_partitions(0ULL))
+ {
+ uint i;
+ List_iterator<partition_element> part_it(part_info->partitions);
+ part_it++;
+ DBUG_ASSERT(thd->lex->sql_command != SQLCOM_CREATE_TABLE);
+ for (i= 1; i < part_info->partitions.elements; i++)
+ (part_it++)->part_state= PART_TO_BE_DROPPED;
+ }
+ else if (part_info->is_sub_partitioned() &&
+ part_info->use_default_no_subpartitions &&
+ part_info->no_subparts &&
+ (int)part_info->no_subparts !=
+ file->get_default_no_partitions(0ULL))
+ {
+ DBUG_ASSERT(thd->lex->sql_command != SQLCOM_CREATE_TABLE);
+ part_info->no_subparts= file->get_default_no_partitions(0ULL);
+ }
+ }
+ else if (create_info->db_type != engine_type)
+ {
+ delete file;
+ if (!(file= get_new_handler((TABLE_SHARE*) 0, thd->mem_root, engine_type)))
+ {
+ mem_alloc_error(sizeof(handler));
+ DBUG_RETURN(TRUE);
+ }
}
}
#endif
@@ -2412,7 +2464,7 @@ TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
field=item->tmp_table_field(&tmp_table);
else
field=create_tmp_field(thd, &tmp_table, item, item->type(),
- (Item ***) 0, &tmp_field, 0, 0, 0, 0);
+ (Item ***) 0, &tmp_field, 0, 0, 0, 0, 0);
if (!field ||
!(cr_field=new create_field(field,(item->type() == Item::FIELD_ITEM ?
((Item_field *)item)->field :
@@ -3918,6 +3970,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
uint db_create_options, used_fields;
handlerton *old_db_type, *new_db_type;
uint need_copy_table= 0;
+ bool no_table_reopen= FALSE;
#ifdef WITH_PARTITION_STORAGE_ENGINE
uint fast_alter_partition= 0;
bool partition_changed= FALSE;
@@ -3935,6 +3988,11 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
bool committed= 0;
DBUG_ENTER("mysql_alter_table");
+ LINT_INIT(index_add_count);
+ LINT_INIT(index_drop_count);
+ LINT_INIT(index_add_buffer);
+ LINT_INIT(index_drop_buffer);
+
thd->proc_info="init";
table_name=table_list->table_name;
alias= (lower_case_table_names == 2) ? table_list->alias : table_name;
@@ -4948,10 +5006,10 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
Win32 and InnoDB can't drop a table that is in use, so we must
close the original table at before doing the rename
*/
- table_name=thd->strdup(table_name); // must be saved
table->s->version= 0; // Force removal of table def
close_cached_table(thd, table);
table=0; // Marker that table is closed
+ no_table_reopen= TRUE;
}
#if (!defined( __WIN__) && !defined( __EMX__) && !defined( OS2))
else
@@ -5009,7 +5067,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
goto err;
}
}
- if (thd->lock || new_name != table_name) // True if WIN32
+ if (thd->lock || new_name != table_name || no_table_reopen) // True if WIN32
{
/*
Not table locking or alter table with rename.
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index f1ecae884d5..b2b6b115f7d 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -87,7 +87,7 @@ static File_option trigname_file_parameters[]=
{
{(char *) STRING_WITH_LEN("trigger_table")},
offsetof(struct st_trigname, trigger_table),
- FILE_OPTIONS_ESTRING
+ FILE_OPTIONS_ESTRING
},
{ { 0, 0 }, 0, FILE_OPTIONS_STRING }
};
@@ -109,10 +109,6 @@ const LEX_STRING trg_event_type_names[]=
static TABLE_LIST *add_table_for_trigger(THD *thd, sp_name *trig);
-bool handle_old_incorrect_sql_modes(char *&unknown_key, gptr base,
- MEM_ROOT *mem_root,
- char *end, gptr hook_data);
-
class Handle_old_incorrect_sql_modes_hook: public Unknown_key_hook
{
private:
@@ -125,6 +121,20 @@ public:
MEM_ROOT *mem_root, char *end);
};
+class Handle_old_incorrect_trigger_table_hook: public Unknown_key_hook
+{
+public:
+ Handle_old_incorrect_trigger_table_hook(char *file_path,
+ LEX_STRING *trigger_table_arg)
+ :path(file_path), trigger_table_value(trigger_table_arg)
+ {};
+ virtual bool process_unknown_string(char *&unknown_key, gptr base,
+ MEM_ROOT *mem_root, char *end);
+private:
+ char *path;
+ LEX_STRING *trigger_table_value;
+};
+
/*
Create or drop trigger for table.
@@ -1126,6 +1136,9 @@ static TABLE_LIST *add_table_for_trigger(THD *thd, sp_name *trig)
LEX_STRING path;
File_parser *parser;
struct st_trigname trigname;
+ Handle_old_incorrect_trigger_table_hook trigger_table_hook(
+ path_buff, &trigname.trigger_table);
+
DBUG_ENTER("add_table_for_trigger");
path.length= build_table_filename(path_buff, FN_REFLEN-1,
@@ -1151,7 +1164,7 @@ static TABLE_LIST *add_table_for_trigger(THD *thd, sp_name *trig)
if (parser->parse((gptr)&trigname, thd->mem_root,
trigname_file_parameters, 1,
- &file_parser_dummy_hook))
+ &trigger_table_hook))
DBUG_RETURN(0);
/* We need to reset statement table list to be PS/SP friendly. */
@@ -1367,6 +1380,7 @@ Table_triggers_list::change_table_name_in_trignames(const char *db_name,
This method tries to leave trigger related files in consistent state,
i.e. it either will complete successfully, or will fail leaving files
in their initial state.
+ Also this method assumes that subject table is not renamed to itself.
RETURN VALUE
FALSE Success
@@ -1388,6 +1402,9 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db,
safe_mutex_assert_owner(&LOCK_open);
+ DBUG_ASSERT(my_strcasecmp(table_alias_charset, db, new_db) ||
+ my_strcasecmp(table_alias_charset, old_table, new_table));
+
if (Table_triggers_list::check_n_load(thd, db, old_table, &table, TRUE))
{
result= 1;
@@ -1537,7 +1554,7 @@ Handle_old_incorrect_sql_modes_hook::process_unknown_string(char *&unknown_key,
MEM_ROOT *mem_root,
char *end)
{
- DBUG_ENTER("handle_old_incorrect_sql_modes");
+ DBUG_ENTER("Handle_old_incorrect_sql_modes_hook::process_unknown_string");
DBUG_PRINT("info", ("unknown key:%60s", unknown_key));
if (unknown_key + INVALID_SQL_MODES_LENGTH + 1 < end &&
@@ -1566,3 +1583,44 @@ Handle_old_incorrect_sql_modes_hook::process_unknown_string(char *&unknown_key,
}
DBUG_RETURN(FALSE);
}
+
+/*
+ Trigger BUG#15921 compatibility hook. For details see
+ Handle_old_incorrect_sql_modes_hook::process_unknown_string().
+*/
+
+#define INVALID_TRIGGER_TABLE_LENGTH 15
+
+bool
+Handle_old_incorrect_trigger_table_hook::
+process_unknown_string(char *&unknown_key, gptr base, MEM_ROOT *mem_root,
+ char *end)
+{
+ DBUG_ENTER("Handle_old_incorrect_trigger_table_hook::process_unknown_string");
+ DBUG_PRINT("info", ("unknown key:%60s", unknown_key));
+
+ if (unknown_key + INVALID_TRIGGER_TABLE_LENGTH + 1 < end &&
+ unknown_key[INVALID_TRIGGER_TABLE_LENGTH] == '=' &&
+ !memcmp(unknown_key, STRING_WITH_LEN("trigger_table")))
+ {
+ char *ptr= unknown_key + INVALID_TRIGGER_TABLE_LENGTH + 1;
+
+ DBUG_PRINT("info", ("trigger_table affected by BUG#15921 detected"));
+ push_warning_printf(current_thd,
+ MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_OLD_FILE_FORMAT,
+ ER(ER_OLD_FILE_FORMAT),
+ (char *)path, "TRIGGER");
+
+ if (!(ptr= parse_escaped_string(ptr, end, mem_root, trigger_table_value)))
+ {
+ my_error(ER_FPARSER_ERROR_IN_PARAMETER, MYF(0), "trigger_table",
+ unknown_key);
+ DBUG_RETURN(TRUE);
+ }
+
+ /* Set parsing pointer to the last symbol of string (\n). */
+ unknown_key= ptr-1;
+ }
+ DBUG_RETURN(FALSE);
+}
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index b19d6504b2e..75e8db6621f 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1229,6 +1229,11 @@ multi_update::initialize_tables(JOIN *join)
Field_string offset(table->file->ref_length, 0, "offset",
&my_charset_bin);
offset.init(table);
+ /*
+ The field will be converted to varstring when creating tmp table if
+ table to be updated was created by mysql 4.1. Deny this.
+ */
+ offset.can_alter_field_type= 0;
if (!(ifield= new Item_field(((Field *) &offset))))
DBUG_RETURN(1);
ifield->maybe_null= 0;
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 1b5e91daf3e..18217094ff7 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -940,6 +940,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table)
tbl->skip_temporary= 1;
tbl->belong_to_view= top_view;
tbl->referencing_view= table;
+ tbl->prelocking_placeholder= table->prelocking_placeholder;
/*
First we fill want_privilege with SELECT_ACL (this is needed for the
tables which belongs to view subqueries and temporary table views,
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 9304bc3f27c..e9379ab2f18 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -4726,13 +4726,14 @@ alter:
lex->col_list.empty();
lex->select_lex.init_order();
lex->select_lex.db=lex->name= 0;
- lex->like_name= 0;
+ lex->like_name= 0;
bzero((char*) &lex->create_info,sizeof(lex->create_info));
lex->create_info.db_type= (handlerton*) &default_hton;
lex->create_info.default_table_charset= NULL;
lex->create_info.row_type= ROW_TYPE_NOT_USED;
lex->alter_info.reset();
lex->alter_info.flags= 0;
+ lex->no_write_to_binlog= 0;
}
alter_commands
{}
diff --git a/sql/table.cc b/sql/table.cc
index 90d8569425a..4807d9d0cf0 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1556,7 +1556,15 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
DBUG_RETURN (error);
}
- /* close a .frm file and it's tables */
+
+/*
+ Free information allocated by openfrm
+
+ SYNOPSIS
+ closefrm()
+ table TABLE object to free
+ free_share Is 1 if we also want to free table_share
+*/
int closefrm(register TABLE *table, bool free_share)
{
@@ -1564,6 +1572,7 @@ int closefrm(register TABLE *table, bool free_share)
uint idx;
KEY *key_info;
DBUG_ENTER("closefrm");
+
if (table->db_stat)
error=table->file->close();
key_info= table->key_info;
@@ -2395,12 +2404,14 @@ table_check_intact(TABLE *table, uint table_f_count,
table running on a old server will be valid.
*/
field->sql_type(sql_type);
- if (strncmp(sql_type.c_ptr(), table_def->type.str,
+ if (sql_type.length() < table_def->type.length - 1 ||
+ strncmp(sql_type.ptr(),
+ table_def->type.str,
table_def->type.length - 1))
{
sql_print_error("(%s) Expected field %s at position %d to have type "
"%s, found %s", table->alias, table_def->name.str,
- i, table_def->type.str, sql_type.c_ptr());
+ i, table_def->type.str, sql_type.c_ptr_safe());
error= TRUE;
}
else if (table_def->cset.str && !field->has_charset())
@@ -3621,6 +3632,7 @@ Field_iterator_table_ref::get_or_create_column_ref(TABLE_LIST *parent_table_ref)
TABLE_LIST *add_table_ref= parent_table_ref ?
parent_table_ref : table_ref;
+ LINT_INIT(field_count);
if (field_it == &table_field_it)
{
/* The field belongs to a stored table. */
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 94c1eb8ac63..1be2321200b 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -2189,12 +2189,11 @@ my_tz_find(const String * name, TABLE_LIST *tz_tables)
TZ_NAMES_ENTRY *tmp_tzname;
Time_zone *result_tz= 0;
long offset;
-
DBUG_ENTER("my_tz_find");
DBUG_PRINT("enter", ("time zone name='%s'",
- name ? ((String *)name)->c_ptr() : "NULL"));
-
- DBUG_ASSERT(!time_zone_tables_exist || tz_tables || current_thd->slave_thread);
+ name ? ((String *)name)->c_ptr_safe() : "NULL"));
+ DBUG_ASSERT(!time_zone_tables_exist || tz_tables ||
+ current_thd->slave_thread);
if (!name)
DBUG_RETURN(0);
diff --git a/sql/udf_example.cc b/sql/udf_example.cc
index e6d272d9085..73e49aef178 100644
--- a/sql/udf_example.cc
+++ b/sql/udf_example.cc
@@ -497,7 +497,7 @@ char *metaphon(UDF_INIT *initid, UDF_ARGS *args, char *result,
}
}
}
- *length= (ulong) (result - org_result);
+ *length= (ulong) (max(0, result - org_result - 1));
return org_result;
}
diff --git a/storage/archive/Makefile.am b/storage/archive/Makefile.am
index c2ae9d6b728..415e0dc8f8f 100644
--- a/storage/archive/Makefile.am
+++ b/storage/archive/Makefile.am
@@ -27,6 +27,7 @@ noinst_PROGRAMS = archive_test
archive_test_LDFLAGS = @NOINST_LDFLAGS@
noinst_HEADERS = azlib.h
libarchive_a_SOURCES = azio.c
+EXTRA_DIST = cmakelists.txt
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/storage/archive/cmakelists.txt b/storage/archive/cmakelists.txt
new file mode 100644
index 00000000000..4189781e73a
--- /dev/null
+++ b/storage/archive/cmakelists.txt
@@ -0,0 +1,6 @@
+SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib)
+ADD_LIBRARY(archive azio.c)
+TARGET_LINK_LIBRARIES(archive zlib mysys dbug strings)
diff --git a/storage/bdb/Makefile.in b/storage/bdb/Makefile.in
index c6d445f2ed5..4e2439025f3 100644
--- a/storage/bdb/Makefile.in
+++ b/storage/bdb/Makefile.in
@@ -23,13 +23,13 @@ top_srcdir = @top_srcdir@
# distdir and top_distdir are set by the calling Makefile
bdb_build = build_unix
-files = LICENSE Makefile Makefile.in README
+files = LICENSE Makefile Makefile.in README cmakelists.txt
subdirs = btree build_win32 clib common cxx db dbinc \
dbinc_auto db185 db_archive db_checkpoint db_deadlock db_dump \
db_dump185 db_hotbackup db_load db_printlog db_recover db_stat db_upgrade \
db_verify dbm dbreg dist env fileops hash \
hsearch hmac include lock log mp mutex os \
- os_win32 qam rep txn xa sequence
+ os_win32 qam rep txn xa sequence crypto
@SET_MAKE@
diff --git a/storage/bdb/cmakelists.txt b/storage/bdb/cmakelists.txt
index 8651930657f..c27665d902c 100644
--- a/storage/bdb/cmakelists.txt
+++ b/storage/bdb/cmakelists.txt
@@ -1,8 +1,67 @@
-SET(CMAKE_CXX_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
+SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-#INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/extra/yassl/include)
-ADD_LIBRARY(bdb _check.c _rectest.c hp_block.c hp_clear.c hp_close.c hp_create.c
- hp_delete.c hp_extra.c hp_hash.c hp_info.c hp_open.c hp_panic.c
- hp_rename.c hp_rfirst.c hp_rkey.c hp_rlast.c hp_rnext.c hp_rprev.c
- hp_rrnd.c hp_rsame.c hp_scan.c hp_static.c hp_update.c hp_write.c)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/bdb/build_win32
+ ${CMAKE_SOURCE_DIR}/storage/bdb/dbinc
+ ${CMAKE_SOURCE_DIR}/storage/bdb)
+
+# BDB needs a number of source files that are auto-generated by the unix
+# configure. So to build BDB, it is necessary to copy these over to the Windows
+# bitkeeper tree, or to use a source .tar.gz package which already has these
+# files.
+ADD_LIBRARY(bdb crypto/aes_method.c btree/bt_compact.c btree/bt_compare.c
+ btree/bt_conv.c btree/bt_curadj.c btree/bt_cursor.c
+ btree/bt_delete.c btree/bt_method.c btree/bt_open.c btree/bt_put.c
+ btree/bt_rec.c btree/bt_reclaim.c btree/bt_recno.c
+ btree/bt_rsearch.c btree/bt_search.c btree/bt_split.c
+ btree/bt_stat.c btree/bt_upgrade.c btree/bt_verify.c
+ btree/btree_auto.c db/crdel_auto.c db/crdel_rec.c crypto/crypto.c
+ db/db.c db/db_am.c db/db_auto.c common/db_byteorder.c db/db_cam.c
+ common/db_clock.c db/db_conv.c db/db_dispatch.c db/db_dup.c
+ common/db_err.c common/db_getlong.c common/db_idspace.c
+ db/db_iface.c db/db_join.c common/db_log2.c db/db_meta.c
+ db/db_method.c db/db_open.c db/db_overflow.c db/db_ovfl_vrfy.c
+ db/db_pr.c db/db_rec.c db/db_reclaim.c db/db_remove.c
+ db/db_rename.c db/db_ret.c env/db_salloc.c db/db_setid.c
+ db/db_setlsn.c env/db_shash.c db/db_stati.c db/db_truncate.c
+ db/db_upg.c db/db_upg_opd.c db/db_vrfy.c db/db_vrfyutil.c
+ dbm/dbm.c dbreg/dbreg.c dbreg/dbreg_auto.c dbreg/dbreg_rec.c
+ dbreg/dbreg_stat.c dbreg/dbreg_util.c env/env_failchk.c
+ env/env_file.c env/env_method.c env/env_open.c env/env_recover.c
+ env/env_region.c env/env_register.c env/env_stat.c
+ fileops/fileops_auto.c fileops/fop_basic.c fileops/fop_rec.c
+ fileops/fop_util.c hash/hash.c hash/hash_auto.c hash/hash_conv.c
+ hash/hash_dup.c hash/hash_func.c hash/hash_meta.c
+ hash/hash_method.c hash/hash_open.c hash/hash_page.c
+ hash/hash_rec.c hash/hash_reclaim.c hash/hash_stat.c
+ hash/hash_upgrade.c hash/hash_verify.c hmac/hmac.c
+ hsearch/hsearch.c lock/lock.c lock/lock_deadlock.c
+ lock/lock_failchk.c lock/lock_id.c lock/lock_list.c
+ lock/lock_method.c lock/lock_region.c lock/lock_stat.c
+ lock/lock_timer.c lock/lock_util.c log/log.c log/log_archive.c
+ log/log_compare.c log/log_debug.c log/log_get.c log/log_method.c
+ log/log_put.c log/log_stat.c mp/mp_alloc.c mp/mp_bh.c mp/mp_fget.c
+ mp/mp_fmethod.c mp/mp_fopen.c mp/mp_fput.c mp/mp_fset.c
+ mp/mp_method.c mp/mp_region.c mp/mp_register.c mp/mp_stat.c
+ mp/mp_sync.c mp/mp_trickle.c crypto/mersenne/mt19937db.c
+ mutex/mut_alloc.c mutex/mut_method.c mutex/mut_region.c
+ mutex/mut_stat.c mutex/mut_tas.c mutex/mut_win32.c
+ os_win32/os_abs.c os/os_alloc.c os_win32/os_clock.c
+ os_win32/os_config.c os_win32/os_dir.c os_win32/os_errno.c
+ os_win32/os_fid.c os_win32/os_flock.c os_win32/os_fsync.c
+ os_win32/os_handle.c os/os_id.c os_win32/os_map.c os/os_method.c
+ os/os_oflags.c os_win32/os_open.c os/os_region.c
+ os_win32/os_rename.c os/os_root.c os/os_rpath.c os_win32/os_rw.c
+ os_win32/os_seek.c os_win32/os_sleep.c os_win32/os_spin.c
+ os_win32/os_stat.c os/os_tmpdir.c os_win32/os_truncate.c
+ os/os_unlink.c qam/qam.c qam/qam_auto.c qam/qam_conv.c
+ qam/qam_files.c qam/qam_method.c qam/qam_open.c qam/qam_rec.c
+ qam/qam_stat.c qam/qam_upgrade.c qam/qam_verify.c rep/rep_auto.c
+ rep/rep_backup.c rep/rep_elect.c rep/rep_log.c rep/rep_method.c
+ rep/rep_record.c rep/rep_region.c rep/rep_stat.c rep/rep_stub.c
+ rep/rep_util.c rep/rep_verify.c crypto/rijndael/rijndael-alg-fst.c
+ crypto/rijndael/rijndael-api-fst.c hmac/sha1.c clib/strcasecmp.c
+ txn/txn.c txn/txn_auto.c txn/txn_chkpt.c txn/txn_failchk.c
+ txn/txn_method.c txn/txn_rec.c txn/txn_recover.c txn/txn_region.c
+ txn/txn_stat.c txn/txn_util.c common/util_log.c common/util_sig.c
+ xa/xa.c xa/xa_db.c xa/xa_map.c)
diff --git a/storage/csv/cmakelists.txt b/storage/csv/cmakelists.txt
new file mode 100644
index 00000000000..4e142646b2d
--- /dev/null
+++ b/storage/csv/cmakelists.txt
@@ -0,0 +1,5 @@
+SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+ADD_LIBRARY(csv ha_tina.cc ha_tina.h)
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index fed9394e91e..537e5b1bcc4 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -52,6 +52,24 @@ TODO:
#include <mysql/plugin.h>
+/*
+ uchar + uchar + ulonglong + ulonglong + ulonglong + ulonglong + uchar
+*/
+#define META_BUFFER_SIZE sizeof(uchar) + sizeof(uchar) + sizeof(ulonglong) \
+ + sizeof(ulonglong) + sizeof(ulonglong) + sizeof(ulonglong) + sizeof(uchar)
+#define TINA_CHECK_HEADER 254 // The number we use to determine corruption
+
+/* The file extension */
+#define CSV_EXT ".CSV" // The data file
+#define CSN_EXT ".CSN" // Files used during repair
+#define CSM_EXT ".CSM" // Meta file
+
+
+static TINA_SHARE *get_share(const char *table_name, TABLE *table);
+static int free_share(TINA_SHARE *share);
+static int read_meta_file(File meta_file, ha_rows *rows);
+static int write_meta_file(File meta_file, ha_rows rows, bool dirty);
+
/* Stuff for shares */
pthread_mutex_t tina_mutex;
static HASH tina_open_tables;
@@ -196,6 +214,7 @@ static int tina_done_func()
static TINA_SHARE *get_share(const char *table_name, TABLE *table)
{
TINA_SHARE *share;
+ char meta_file_name[FN_REFLEN];
char *tmp_name;
uint length;
@@ -211,9 +230,8 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table)
*/
if (!(share=(TINA_SHARE*) hash_search(&tina_open_tables,
(byte*) table_name,
- length)))
+ length)))
{
- char data_file_name[FN_REFLEN];
if (!my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
&share, sizeof(*share),
&tmp_name, length+1,
@@ -227,15 +245,39 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table)
share->is_log_table= FALSE;
share->table_name_length= length;
share->table_name= tmp_name;
+ share->crashed= FALSE;
+ share->rows_recorded= 0;
strmov(share->table_name, table_name);
- fn_format(data_file_name, table_name, "", ".CSV",
+ fn_format(share->data_file_name, table_name, "", CSV_EXT,
+ MY_REPLACE_EXT|MY_UNPACK_FILENAME);
+ fn_format(meta_file_name, table_name, "", CSM_EXT,
MY_REPLACE_EXT|MY_UNPACK_FILENAME);
if (my_hash_insert(&tina_open_tables, (byte*) share))
goto error;
thr_lock_init(&share->lock);
pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST);
- if ((share->data_file= my_open(data_file_name, O_RDWR|O_APPEND,
+ /*
+ Open or create the meta file. In the latter case, we'll get
+ an error during read_meta_file and mark the table as crashed.
+ Usually this will result in auto-repair, and we will get a good
+ meta-file in the end.
+ */
+ if ((share->meta_file= my_open(meta_file_name,
+ O_RDWR|O_CREAT, MYF(0))) == -1)
+ share->crashed= TRUE;
+
+ /*
+ After we read, we set the file to dirty. When we close, we will do the
+ opposite. If the meta file will not open we assume it is crashed and
+ mark it as such.
+ */
+ if (read_meta_file(share->meta_file, &share->rows_recorded))
+ share->crashed= TRUE;
+ else
+ (void)write_meta_file(share->meta_file, share->rows_recorded, TRUE);
+
+ if ((share->data_file= my_open(share->data_file_name, O_RDWR|O_APPEND,
MYF(0))) == -1)
goto error2;
@@ -272,6 +314,128 @@ error:
/*
+ Read CSV meta-file
+
+ SYNOPSIS
+ read_meta_file()
+ meta_file The meta-file filedes
+ ha_rows Pointer to the var we use to store rows count.
+ These are read from the meta-file.
+
+ DESCRIPTION
+
+ Read the meta-file info. For now we are only interested in
+ rows counf, crashed bit and magic number.
+
+ RETURN
+ 0 - OK
+ non-zero - error occurred
+*/
+
+static int read_meta_file(File meta_file, ha_rows *rows)
+{
+ uchar meta_buffer[META_BUFFER_SIZE];
+ uchar *ptr= meta_buffer;
+
+ DBUG_ENTER("ha_tina::read_meta_file");
+
+ VOID(my_seek(meta_file, 0, MY_SEEK_SET, MYF(0)));
+ if (my_read(meta_file, (byte*)meta_buffer, META_BUFFER_SIZE, 0)
+ != META_BUFFER_SIZE)
+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
+
+ /*
+ Parse out the meta data, we ignore version at the moment
+ */
+
+ ptr+= sizeof(uchar)*2; // Move past header
+ *rows= (ha_rows)uint8korr(ptr);
+ ptr+= sizeof(ulonglong); // Move past rows
+ /*
+ Move past check_point, auto_increment and forced_flushes fields.
+ They are present in the format, but we do not use them yet.
+ */
+ ptr+= 3*sizeof(ulonglong);
+
+ /* check crashed bit and magic number */
+ if ((meta_buffer[0] != (uchar)TINA_CHECK_HEADER) ||
+ ((bool)(*ptr)== TRUE))
+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
+
+ my_sync(meta_file, MYF(MY_WME));
+
+ DBUG_RETURN(0);
+}
+
+
+/*
+ Write CSV meta-file
+
+ SYNOPSIS
+ write_meta_file()
+ meta_file The meta-file filedes
+ ha_rows The number of rows we have in the datafile.
+ dirty A flag, which marks whether we have a corrupt table
+
+ DESCRIPTION
+
+ Write meta-info the the file. Only rows count, crashed bit and
+ magic number matter now.
+
+ RETURN
+ 0 - OK
+ non-zero - error occurred
+*/
+
+static int write_meta_file(File meta_file, ha_rows rows, bool dirty)
+{
+ uchar meta_buffer[META_BUFFER_SIZE];
+ uchar *ptr= meta_buffer;
+
+ DBUG_ENTER("ha_tina::write_meta_file");
+
+ *ptr= (uchar)TINA_CHECK_HEADER;
+ ptr+= sizeof(uchar);
+ *ptr= (uchar)TINA_VERSION;
+ ptr+= sizeof(uchar);
+ int8store(ptr, (ulonglong)rows);
+ ptr+= sizeof(ulonglong);
+ memset(ptr, 0, 3*sizeof(ulonglong));
+ /*
+ Skip over checkpoint, autoincrement and forced_flushes fields.
+ We'll need them later.
+ */
+ ptr+= 3*sizeof(ulonglong);
+ *ptr= (uchar)dirty;
+
+ VOID(my_seek(meta_file, 0, MY_SEEK_SET, MYF(0)));
+ if (my_write(meta_file, (byte *)meta_buffer, META_BUFFER_SIZE, 0)
+ != META_BUFFER_SIZE)
+ DBUG_RETURN(-1);
+
+ my_sync(meta_file, MYF(MY_WME));
+
+ DBUG_RETURN(0);
+}
+
+bool ha_tina::check_and_repair(THD *thd)
+{
+ HA_CHECK_OPT check_opt;
+ DBUG_ENTER("ha_tina::check_and_repair");
+
+ check_opt.init();
+
+ DBUG_RETURN(repair(thd, &check_opt));
+}
+
+
+bool ha_tina::is_crashed() const
+{
+ DBUG_ENTER("ha_tina::is_crashed");
+ DBUG_RETURN(share->crashed);
+}
+
+/*
Free lock controls.
*/
static int free_share(TINA_SHARE *share)
@@ -280,7 +444,11 @@ static int free_share(TINA_SHARE *share)
pthread_mutex_lock(&tina_mutex);
int result_code= 0;
if (!--share->use_count){
- /* Drop the mapped file */
+ /* Write the meta file. Mark it as crashed if needed. */
+ (void)write_meta_file(share->meta_file, share->rows_recorded,
+ share->crashed ? TRUE :FALSE);
+ if (my_close(share->meta_file, MYF(0)))
+ result_code= 1;
if (share->mapped_file)
my_munmap(share->mapped_file, share->file_stat.st_size);
result_code= my_close(share->data_file,MYF(0));
@@ -409,7 +577,7 @@ int ha_tina::encode_quote(byte *buf)
/*
chain_append() adds delete positions to the chain that we use to keep
- track of space. Then the chain will be used to cleanup "holes", occured
+ track of space. Then the chain will be used to cleanup "holes", occurred
due to deletes and updates.
*/
int ha_tina::chain_append()
@@ -471,7 +639,10 @@ int ha_tina::find_current_row(byte *buf)
for (Field **field=table->field ; *field ; field++)
{
buffer.length(0);
- mapped_ptr++; // Increment past the first quote
+ if (*mapped_ptr == '"')
+ mapped_ptr++; // Increment past the first quote
+ else
+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
for(;mapped_ptr != end_ptr; mapped_ptr++)
{
// Need to convert line feeds!
@@ -497,8 +668,16 @@ int ha_tina::find_current_row(byte *buf)
buffer.append(*mapped_ptr);
}
}
- else
+ else // ordinary symbol
+ {
+ /*
+ We are at final symbol and no last quote was found =>
+ we are working with a damaged file.
+ */
+ if (mapped_ptr == end_ptr -1)
+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
buffer.append(*mapped_ptr);
+ }
}
(*field)->store(buffer.ptr(), buffer.length(), system_charset_info);
}
@@ -514,7 +693,8 @@ int ha_tina::find_current_row(byte *buf)
extensions exist for this handler.
*/
static const char *ha_tina_exts[] = {
- ".CSV",
+ CSV_EXT,
+ CSM_EXT,
NullS
};
@@ -637,12 +817,18 @@ bool ha_tina::check_if_locking_is_allowed(uint sql_command,
this will not be called for every request. Any sort of positions
that need to be reset should be kept in the ::extra() call.
*/
-int ha_tina::open(const char *name, int mode, uint test_if_locked)
+int ha_tina::open(const char *name, int mode, uint open_options)
{
DBUG_ENTER("ha_tina::open");
if (!(share= get_share(name, table)))
- DBUG_RETURN(1);
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
+
+ if (share->crashed && !(open_options & HA_OPEN_FOR_REPAIR))
+ {
+ free_share(share);
+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
+ }
/*
Init locking. Pass handler object to the locking routines,
@@ -680,6 +866,9 @@ int ha_tina::write_row(byte * buf)
int size;
DBUG_ENTER("ha_tina::write_row");
+ if (share->crashed)
+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
+
ha_statistic_increment(&SSV::ha_write_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
@@ -704,13 +893,13 @@ int ha_tina::write_row(byte * buf)
/* update local copy of the max position to see our own changes */
local_saved_data_file_length= share->file_stat.st_size;
+ /* update shared info */
+ pthread_mutex_lock(&share->mutex);
+ share->rows_recorded++;
/* update status for the log tables */
if (share->is_log_table)
- {
- pthread_mutex_lock(&share->mutex);
update_status();
- pthread_mutex_unlock(&share->mutex);
- }
+ pthread_mutex_unlock(&share->mutex);
records++;
DBUG_RETURN(0);
@@ -815,6 +1004,9 @@ int ha_tina::rnd_init(bool scan)
{
DBUG_ENTER("ha_tina::rnd_init");
+ if (share->crashed)
+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
+
current_position= next_position= 0;
records= 0;
records_is_known= 0;
@@ -844,15 +1036,19 @@ int ha_tina::rnd_init(bool scan)
*/
int ha_tina::rnd_next(byte *buf)
{
+ int rc;
DBUG_ENTER("ha_tina::rnd_next");
+ if (share->crashed)
+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
+
ha_statistic_increment(&SSV::ha_read_rnd_next_count);
current_position= next_position;
if (!share->mapped_file)
DBUG_RETURN(HA_ERR_END_OF_FILE);
- if (HA_ERR_END_OF_FILE == find_current_row(buf) )
- DBUG_RETURN(HA_ERR_END_OF_FILE);
+ if ((rc= find_current_row(buf)))
+ DBUG_RETURN(rc);
records++;
DBUG_RETURN(0);
@@ -977,16 +1173,115 @@ int ha_tina::rnd_end()
}
-/*
+/*
+ Repair CSV table in the case, it is crashed.
+
+ SYNOPSIS
+ repair()
+ thd The thread, performing repair
+ check_opt The options for repair. We do not use it currently.
+
+ DESCRIPTION
+ If the file is empty, change # of rows in the file and complete recovery.
+ Otherwise, scan the table looking for bad rows. If none were found,
+ we mark file as a good one and return. If a bad row was encountered,
+ we truncate the datafile up to the last good row.
+
+ TODO: Make repair more clever - it should try to recover subsequent
+ rows (after the first bad one) as well.
+*/
+
+int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
+{
+ char repaired_fname[FN_REFLEN];
+ byte *buf;
+ File repair_file;
+ int rc;
+ ha_rows rows_repaired= 0;
+ DBUG_ENTER("ha_tina::repair");
+
+ /* empty file */
+ if (!share->mapped_file)
+ {
+ share->rows_recorded= 0;
+ goto end;
+ }
+
+ if (!(buf= (byte*) my_malloc(table->s->reclength, MYF(MY_WME))))
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
+
+ /*
+ Local_saved_data_file_length is initialized during the lock phase.
+ Sometimes this is not getting executed before ::repair (e.g. for
+ the log tables). We set it manually here.
+ */
+ local_saved_data_file_length= share->file_stat.st_size;
+ /* set current position to the beginning of the file */
+ current_position= next_position= 0;
+
+ /* Read the file row-by-row. If everything is ok, repair is not needed. */
+ while (!(rc= find_current_row(buf)))
+ {
+ rows_repaired++;
+ current_position= next_position;
+ }
+
+ my_free((char*)buf, MYF(0));
+
+ /* The file is ok */
+ if (rc == HA_ERR_END_OF_FILE)
+ {
+ /*
+ If rows_recorded != rows_repaired, we should update
+ rows_recorded value to the current amount of rows.
+ */
+ share->rows_recorded= rows_repaired;
+ goto end;
+ }
+
+ /*
+ Otherwise we've encountered a bad row => repair is needed.
+ Let us create a temporary file.
+ */
+ if ((repair_file= my_create(fn_format(repaired_fname, share->table_name,
+ "", CSN_EXT,
+ MY_REPLACE_EXT|MY_UNPACK_FILENAME),
+ 0, O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
+ DBUG_RETURN(HA_ERR_CRASHED_ON_REPAIR);
+
+ if (my_write(repair_file, (byte*)share->mapped_file, current_position,
+ MYF(MY_NABP)))
+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
+ my_close(repair_file, MYF(0));
+ /* we just truncated the file up to the first bad row. update rows count. */
+ share->rows_recorded= rows_repaired;
+
+ if (my_munmap(share->mapped_file, share->file_stat.st_size))
+ DBUG_RETURN(-1);
+
+ my_rename(repaired_fname, share->data_file_name, MYF(0));
+
+ /* We set it to null so that get_mmap() won't try to unmap it */
+ share->mapped_file= NULL;
+ if (get_mmap(share, 0) > 0)
+ DBUG_RETURN(-1);
+
+end:
+ share->crashed= FALSE;
+ DBUG_RETURN(HA_ADMIN_OK);
+}
+
+/*
DELETE without WHERE calls this
*/
int ha_tina::delete_all_rows()
{
+ int rc;
DBUG_ENTER("ha_tina::delete_all_rows");
if (!records_is_known)
- return (my_errno=HA_ERR_WRONG_COMMAND);
+ DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND);
/* Unmap the file before the new size is set */
if (share->mapped_file && my_munmap(share->mapped_file,
@@ -995,7 +1290,7 @@ int ha_tina::delete_all_rows()
share->mapped_file= NULL;
/* Truncate the file to zero size */
- int rc= my_chsize(share->data_file, 0, 0, MYF(MY_WME));
+ rc= my_chsize(share->data_file, 0, 0, MYF(MY_WME));
if (get_mmap(share, 0) > 0)
DBUG_RETURN(-1);
@@ -1030,22 +1325,71 @@ int ha_tina::create(const char *name, TABLE *table_arg,
File create_file;
DBUG_ENTER("ha_tina::create");
- if ((create_file= my_create(fn_format(name_buff, name, "", ".CSV",
+ if ((create_file= my_create(fn_format(name_buff, name, "", CSM_EXT,
+ MY_REPLACE_EXT|MY_UNPACK_FILENAME), 0,
+ O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
+ DBUG_RETURN(-1);
+
+ write_meta_file(create_file, 0, FALSE);
+ my_close(create_file, MYF(0));
+
+ if ((create_file= my_create(fn_format(name_buff, name, "", CSV_EXT,
MY_REPLACE_EXT|MY_UNPACK_FILENAME),0,
O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
DBUG_RETURN(-1);
- my_close(create_file,MYF(0));
+ my_close(create_file, MYF(0));
DBUG_RETURN(0);
}
+int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt)
+{
+ int rc= 0;
+ byte *buf;
+ const char *old_proc_info;
+ ha_rows count= share->rows_recorded;
+ DBUG_ENTER("ha_tina::check");
+
+ old_proc_info= thd_proc_info(thd, "Checking table");
+ if (!(buf= (byte*) my_malloc(table->s->reclength, MYF(MY_WME))))
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
+
+ /*
+ Local_saved_data_file_length is initialized during the lock phase.
+ Check does not use store_lock in certain cases. So, we set it
+ manually here.
+ */
+ local_saved_data_file_length= share->file_stat.st_size;
+ /* set current position to the beginning of the file */
+ current_position= next_position= 0;
+ /* Read the file row-by-row. If everything is ok, repair is not needed. */
+ while (!(rc= find_current_row(buf)))
+ {
+ count--;
+ current_position= next_position;
+ }
+
+ my_free((char*)buf, MYF(0));
+ thd_proc_info(thd, old_proc_info);
+
+ if ((rc != HA_ERR_END_OF_FILE) || count)
+ {
+ share->crashed= TRUE;
+ DBUG_RETURN(HA_ADMIN_CORRUPT);
+ }
+ else
+ DBUG_RETURN(HA_ADMIN_OK);
+}
+
+
bool ha_tina::check_if_incompatible_data(HA_CREATE_INFO *info,
uint table_changes)
{
return COMPATIBLE_DATA_YES;
}
+#ifdef MYSQL_PLUGIN
mysql_declare_plugin
{
MYSQL_STORAGE_ENGINE_PLUGIN,
@@ -1058,4 +1402,4 @@ mysql_declare_plugin
0x0100 /* 1.0 */,
}
mysql_declare_plugin_end;
-
+#endif
diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h
index dc743cf6514..d155a614780 100644
--- a/storage/csv/ha_tina.h
+++ b/storage/csv/ha_tina.h
@@ -19,9 +19,16 @@
#include <my_dir.h>
#define DEFAULT_CHAIN_LENGTH 512
+/*
+ Version for file format.
+ 1 - Initial Version. That is, the version when the metafile was introduced.
+*/
+
+#define TINA_VERSION 1
typedef struct st_tina_share {
char *table_name;
+ char data_file_name[FN_REFLEN];
byte *mapped_file; /* mapped region of file */
uint table_name_length, use_count;
/*
@@ -39,6 +46,9 @@ typedef struct st_tina_share {
off_t saved_data_file_length;
pthread_mutex_t mutex;
THR_LOCK lock;
+ File meta_file; /* Meta file we use */
+ bool crashed; /* Meta file is crashed */
+ ha_rows rows_recorded; /* Number of rows in tables */
} TINA_SHARE;
struct tina_set {
@@ -108,7 +118,7 @@ public:
ulong type, TABLE *table,
uint count,
bool called_by_logger_thread);
- int open(const char *name, int mode, uint test_if_locked);
+ int open(const char *name, int mode, uint open_options);
int close(void);
int write_row(byte * buf);
int update_row(const byte * old_data, byte * new_data);
@@ -116,7 +126,13 @@ public:
int rnd_init(bool scan=1);
int rnd_next(byte *buf);
int rnd_pos(byte * buf, byte *pos);
+ bool check_and_repair(THD *thd);
+ int check(THD* thd, HA_CHECK_OPT* check_opt);
+ bool is_crashed() const;
int rnd_end();
+ int repair(THD* thd, HA_CHECK_OPT* check_opt);
+ /* This is required for SQL layer to know that we support autorepair */
+ bool auto_repair() const { return 1; }
void position(const byte *record);
void info(uint);
int extra(enum ha_extra_function operation);
diff --git a/storage/example/Makefile.am b/storage/example/Makefile.am
index efc0ede91e9..518d82abe2d 100644
--- a/storage/example/Makefile.am
+++ b/storage/example/Makefile.am
@@ -26,12 +26,11 @@ INCLUDES = -I$(top_srcdir)/include \
-I$(srcdir)
WRAPLIBS=
-pkglib_LTLIBRARIES = ha_example.la
+pkglib_LIBRARIES = libexample.a
-ha_example_la_LDFLAGS = -module
noinst_HEADERS = ha_example.h
-ha_example_la_SOURCES = ha_example.cc
-
+libexample_a_SOURCES = ha_example.cc
+EXTRA_DIST = cmakelists.txt
LDADD =
DEFS = -DMYSQL_SERVER @DEFS@
diff --git a/storage/example/cmakelists.txt b/storage/example/cmakelists.txt
new file mode 100644
index 00000000000..f4579aa0c66
--- /dev/null
+++ b/storage/example/cmakelists.txt
@@ -0,0 +1,6 @@
+SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql
+ ${CMAKE_SOURCE_DIR}/extra/yassl/include)
+ADD_LIBRARY(example ha_example.cc)
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc
index dff36e10b1a..433fc3e78e0 100644
--- a/storage/example/ha_example.cc
+++ b/storage/example/ha_example.cc
@@ -726,6 +726,7 @@ int ha_example::create(const char *name, TABLE *table_arg,
DBUG_RETURN(0);
}
+#ifdef MYSQL_PLUGIN
mysql_declare_plugin
{
MYSQL_STORAGE_ENGINE_PLUGIN,
@@ -738,4 +739,4 @@ mysql_declare_plugin
0x0001 /* 0.1 */,
}
mysql_declare_plugin_end;
-
+#endif
diff --git a/storage/heap/Makefile.am b/storage/heap/Makefile.am
index 79e0379f9a4..fceaeec664a 100644
--- a/storage/heap/Makefile.am
+++ b/storage/heap/Makefile.am
@@ -30,6 +30,7 @@ libheap_a_SOURCES = hp_open.c hp_extra.c hp_close.c hp_panic.c hp_info.c \
hp_rnext.c hp_rlast.c hp_rprev.c hp_clear.c \
hp_rkey.c hp_block.c \
hp_hash.c _check.c _rectest.c hp_static.c
+EXTRA_DIST = cmakelists.txt
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am
index 9de4bcdc995..22796b45882 100644
--- a/storage/innobase/Makefile.am
+++ b/storage/innobase/Makefile.am
@@ -76,7 +76,8 @@ EXTRA_DIST = include/btr0btr.h include/btr0btr.ic include/btr0cur.h include/btr
include/univ.i include/usr0sess.h include/usr0sess.ic include/usr0types.h \
include/ut0byte.h include/ut0byte.ic include/ut0dbg.h include/ut0lst.h \
include/ut0mem.h include/ut0mem.ic include/ut0rnd.h include/ut0rnd.ic \
- include/ut0sort.h include/ut0ut.h include/ut0ut.ic
+ include/ut0sort.h include/ut0ut.h include/ut0ut.ic \
+ cmakelists.txt
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
index d8c3cfb7eda..428b4d9a6b7 100644
--- a/storage/innobase/btr/btr0sea.c
+++ b/storage/innobase/btr/btr0sea.c
@@ -59,6 +59,9 @@ before hash index building is started */
#define BTR_SEARCH_BUILD_LIMIT 100
+/* How many cells to check before temporarily releasing btr_search_latch */
+#define BTR_CHUNK_SIZE 10000
+
/************************************************************************
Builds a hash index on a page with the given parameters. If the page already
has a hash index with different parameters, the old hash index is removed.
@@ -1604,25 +1607,21 @@ btr_search_validate(void)
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_;
- /* How many cells to check before temporarily releasing
- btr_search_latch. */
- ulint chunk_size = 10000;
-
*offsets_ = (sizeof offsets_) / sizeof *offsets_;
rw_lock_x_lock(&btr_search_latch);
cell_count = hash_get_n_cells(btr_search_sys->hash_index);
-
+
for (i = 0; i < cell_count; i++) {
/* We release btr_search_latch every once in a while to
give other queries a chance to run. */
- if ((i != 0) && ((i % chunk_size) == 0)) {
+ if ((i != 0) && ((i % BTR_CHUNK_SIZE) == 0)) {
rw_lock_x_unlock(&btr_search_latch);
os_thread_yield();
rw_lock_x_lock(&btr_search_latch);
}
-
+
node = hash_get_nth_cell(btr_search_sys->hash_index, i)->node;
while (node != NULL) {
@@ -1676,9 +1675,9 @@ btr_search_validate(void)
}
}
- for (i = 0; i < cell_count; i += chunk_size) {
- ulint end_index = ut_min(i + chunk_size - 1, cell_count - 1);
-
+ for (i = 0; i < cell_count; i += BTR_CHUNK_SIZE) {
+ ulint end_index = ut_min(i + BTR_CHUNK_SIZE - 1, cell_count - 1);
+
/* We release btr_search_latch every once in a while to
give other queries a chance to run. */
if (i != 0) {
diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
index 7b021087163..de57f6f07b8 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -40,7 +40,9 @@ if we are compiling on Windows. */
#undef VERSION
/* Include the header file generated by GNU autoconf */
+#ifndef __WIN__
#include "../ib_config.h"
+#endif
#ifdef HAVE_SCHED_H
#include <sched.h>
diff --git a/storage/myisam/Makefile.am b/storage/myisam/Makefile.am
index e4327070997..3c6a5c22234 100644
--- a/storage/myisam/Makefile.am
+++ b/storage/myisam/Makefile.am
@@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-EXTRA_DIST = mi_test_all.sh mi_test_all.res
+EXTRA_DIST = mi_test_all.sh mi_test_all.res ft_stem.c cmakelists.txt
pkgdata_DATA = mi_test_all mi_test_all.res
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
diff --git a/storage/myisam/mi_key.c b/storage/myisam/mi_key.c
index 5dcc99d41b4..f8463a0b6b0 100644
--- a/storage/myisam/mi_key.c
+++ b/storage/myisam/mi_key.c
@@ -64,7 +64,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
TODO: nulls processing
*/
#ifdef HAVE_SPATIAL
- return sp_make_key(info,keynr,key,record,filepos);
+ DBUG_RETURN(sp_make_key(info,keynr,key,record,filepos));
#else
DBUG_ASSERT(0); /* mi_open should check that this never happens*/
#endif
diff --git a/storage/myisam/mi_keycache.c b/storage/myisam/mi_keycache.c
index fb13f3703a2..b4122089d1d 100644
--- a/storage/myisam/mi_keycache.c
+++ b/storage/myisam/mi_keycache.c
@@ -159,4 +159,5 @@ void mi_change_key_cache(KEY_CACHE *old_key_cache,
*/
multi_key_cache_change(old_key_cache, new_key_cache);
pthread_mutex_unlock(&THR_LOCK_myisam);
+ DBUG_VOID_RETURN;
}
diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c
index a6c2cbd6082..05f8459a4b4 100644
--- a/storage/myisam/mi_search.c
+++ b/storage/myisam/mi_search.c
@@ -1471,7 +1471,7 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key,
if (!*key++)
{
s_temp->key=key;
- s_temp->ref_length=s_temp->key_length=0;
+ s_temp->key_length= 0;
s_temp->totlength=key_length-1+diff_flag;
s_temp->next_key_pos=0; /* No next key */
return (s_temp->totlength);
@@ -1626,12 +1626,12 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key,
s_temp->prev_length= org_key_length;
s_temp->n_ref_length=s_temp->n_length= org_key_length;
length+= org_key_length;
- /* +get_pack_length(org_key_length); */
}
return (int) length;
}
ref_length=n_length;
+ /* Get information about not packed key suffix */
get_key_pack_length(n_length,next_length_pack,next_key);
/* Test if new keys has fewer characters that match the previous key */
@@ -1640,7 +1640,6 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key,
s_temp->part_of_prev_key= 0;
s_temp->prev_length= ref_length;
s_temp->n_ref_length= s_temp->n_length= n_length+ref_length;
- /* s_temp->prev_key+= get_pack_length(org_key_length); */
return (int) length+ref_length-next_length_pack;
}
if (ref_length+pack_marker > new_ref_length)
@@ -1651,9 +1650,7 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key,
s_temp->prev_length= ref_length - new_pack_length;
s_temp->n_ref_length=s_temp->n_length=n_length + s_temp->prev_length;
s_temp->prev_key+= new_pack_length;
-/* +get_pack_length(org_key_length); */
- length= length-get_pack_length(ref_length)+
- get_pack_length(new_pack_length);
+ length-= (next_length_pack - get_pack_length(s_temp->n_length));
return (int) length + s_temp->prev_length;
}
}
@@ -1662,7 +1659,7 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key,
/* Next key wasn't a prefix of previous key */
ref_length=0;
next_length_pack=0;
- }
+ }
DBUG_PRINT("test",("length: %d next_key: %lx", length,
(long) next_key));
diff --git a/storage/myisammrg/Makefile.am b/storage/myisammrg/Makefile.am
index 14e3295c1ae..0719780b366 100644
--- a/storage/myisammrg/Makefile.am
+++ b/storage/myisammrg/Makefile.am
@@ -23,6 +23,7 @@ libmyisammrg_a_SOURCES = myrg_open.c myrg_extra.c myrg_info.c myrg_locking.c \
myrg_rkey.c myrg_rfirst.c myrg_rlast.c myrg_rnext.c \
myrg_rprev.c myrg_queue.c myrg_write.c myrg_range.c \
myrg_rnext_same.c
+EXTRA_DIST = cmakelists.txt
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/storage/ndb/include/kernel/signaldata/ArbitSignalData.hpp b/storage/ndb/include/kernel/signaldata/ArbitSignalData.hpp
index 34b73644a13..2c4c60c1875 100644
--- a/storage/ndb/include/kernel/signaldata/ArbitSignalData.hpp
+++ b/storage/ndb/include/kernel/signaldata/ArbitSignalData.hpp
@@ -35,6 +35,8 @@ public:
STATIC_CONST( DataLength = 2 );
STATIC_CONST( TextLength = DataLength * 8 ); // hex digits
+ ArbitTicket() {}
+
inline void clear() {
data[0] = 0;
data[1] = 0;
@@ -145,6 +147,7 @@ public:
STATIC_CONST( SignalLength = 3 + ArbitTicket::DataLength + NodeBitmask::Size );
+ ArbitSignalData() {}
inline bool match(ArbitSignalData& aData) const {
return
node == aData.node &&
diff --git a/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp b/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp
index 5c0781944c3..6997938472c 100644
--- a/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp
+++ b/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp
@@ -336,6 +336,7 @@ public:
Uint32 RowGCIFlag;
Uint32 RowChecksumFlag;
+ Table() {}
void init();
};
@@ -398,6 +399,7 @@ public:
Uint32 AttributeStorageType;
char AttributeDefaultValue[MAX_ATTR_DEFAULT_VALUE_SIZE];
+ Attribute() {}
void init();
inline
@@ -685,6 +687,7 @@ struct DictFilegroupInfo {
//GrowSpec LF_RedoGrow;
Uint32 LF_UndoFreeWordsHi;
Uint32 LF_UndoFreeWordsLo;
+ Filegroup() {}
void init();
};
static const Uint32 MappingSize;
@@ -700,6 +703,8 @@ struct DictFilegroupInfo {
Uint32 FileSizeHi;
Uint32 FileSizeLo;
Uint32 FileFreeExtents;
+
+ File() {}
void init();
};
static const Uint32 FileMappingSize;
diff --git a/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp b/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp
index 35f1d6685e8..ef165b6c16f 100644
--- a/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp
+++ b/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp
@@ -128,7 +128,11 @@ public:
DihAllAllowNodeStart = 7016,
DihMinTimeBetweenLCP = 7017,
DihMaxTimeBetweenLCP = 7018,
+ // 7019
+ // 7020
+ // 7021
EnableUndoDelayDataWrite = 7080, // DIH+ACC+TUP
+ DihSetTimeBetweenGcp = 7090,
DihStartLcpImmediately = 7099,
// 8000 Suma
// 12000 Tux
diff --git a/storage/ndb/include/kernel/signaldata/StartPerm.hpp b/storage/ndb/include/kernel/signaldata/StartPerm.hpp
index 38be72835a3..63e01ed3868 100644
--- a/storage/ndb/include/kernel/signaldata/StartPerm.hpp
+++ b/storage/ndb/include/kernel/signaldata/StartPerm.hpp
@@ -64,5 +64,11 @@ private:
Uint32 startingNodeId;
Uint32 errorCode;
+
+ enum ErrorCode
+ {
+ ZNODE_ALREADY_STARTING_ERROR = 305,
+ InitialStartRequired = 320
+ };
};
#endif
diff --git a/storage/ndb/include/kernel/signaldata/SumaImpl.hpp b/storage/ndb/include/kernel/signaldata/SumaImpl.hpp
index cd2b73b3722..2517cbbf246 100644
--- a/storage/ndb/include/kernel/signaldata/SumaImpl.hpp
+++ b/storage/ndb/include/kernel/signaldata/SumaImpl.hpp
@@ -30,6 +30,7 @@ struct SubCreateReq {
friend bool printSUB_CREATE_REQ(FILE *, const Uint32 *, Uint32, Uint16);
STATIC_CONST( SignalLength = 6 );
+ STATIC_CONST( SignalLength2 = 7 );
enum SubscriptionType {
SingleTableScan = 1, //
@@ -50,6 +51,7 @@ struct SubCreateReq {
Uint32 subscriptionKey;
Uint32 subscriptionType;
Uint32 tableId;
+ Uint32 state;
};
struct SubCreateRef {
diff --git a/storage/ndb/include/kernel/signaldata/TcContinueB.hpp b/storage/ndb/include/kernel/signaldata/TcContinueB.hpp
index 85213791b2a..b87b982e49b 100644
--- a/storage/ndb/include/kernel/signaldata/TcContinueB.hpp
+++ b/storage/ndb/include/kernel/signaldata/TcContinueB.hpp
@@ -44,7 +44,8 @@ private:
CHECK_WAIT_DROP_TAB_FAILED_LQH = 16,
TRIGGER_PENDING = 17,
- DelayTCKEYCONF = 18
+ DelayTCKEYCONF = 18,
+ ZNF_CHECK_TRANSACTIONS = 19
};
};
diff --git a/storage/ndb/include/mgmapi/ndbd_exit_codes.h b/storage/ndb/include/mgmapi/ndbd_exit_codes.h
index 2a0802add02..686641ebef5 100644
--- a/storage/ndb/include/mgmapi/ndbd_exit_codes.h
+++ b/storage/ndb/include/mgmapi/ndbd_exit_codes.h
@@ -74,9 +74,7 @@ typedef ndbd_exit_classification_enum ndbd_exit_classification;
#define NDBD_EXIT_SR_OTHERNODEFAILED 2308
#define NDBD_EXIT_NODE_NOT_DEAD 2309
#define NDBD_EXIT_SR_REDOLOG 2310
-/*
#define NDBD_EXIT_SR_RESTARTCONFLICT 2311
-*/
#define NDBD_EXIT_NO_MORE_UNDOLOG 2312
#define NDBD_EXIT_SR_UNDOLOG 2313
#define NDBD_EXIT_MEMALLOC 2327
diff --git a/storage/ndb/include/ndbapi/NdbIndexOperation.hpp b/storage/ndb/include/ndbapi/NdbIndexOperation.hpp
index a8a15978568..d16cd071f77 100644
--- a/storage/ndb/include/ndbapi/NdbIndexOperation.hpp
+++ b/storage/ndb/include/ndbapi/NdbIndexOperation.hpp
@@ -129,6 +129,11 @@ public:
*/
int deleteTuple();
+ /**
+ * Get index object for this operation
+ */
+ const NdbDictionary::Index * getIndex() const;
+
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
/**
* Define the NdbIndexOperation to be a standard operation of type
diff --git a/storage/ndb/include/ndbapi/NdbIndexStat.hpp b/storage/ndb/include/ndbapi/NdbIndexStat.hpp
index 9951ff9bcd1..c718d175864 100644
--- a/storage/ndb/include/ndbapi/NdbIndexStat.hpp
+++ b/storage/ndb/include/ndbapi/NdbIndexStat.hpp
@@ -108,6 +108,7 @@ private:
Uint16 m_entries;
Uint8 m_idir;
Uint8 pad1;
+ Area() {}
Pointer& get_pointer(unsigned i) const {
return *(Pointer*)&m_data[i];
}
diff --git a/storage/ndb/include/ndbapi/NdbOperation.hpp b/storage/ndb/include/ndbapi/NdbOperation.hpp
index 3a442c94253..e747dedb84b 100644
--- a/storage/ndb/include/ndbapi/NdbOperation.hpp
+++ b/storage/ndb/include/ndbapi/NdbOperation.hpp
@@ -56,9 +56,32 @@ public:
*/
/**
- * Lock when performing read
+ * Different access types (supported by sub-classes of NdbOperation)
*/
+
+ enum Type {
+ PrimaryKeyAccess ///< Read, insert, update, or delete using pk
+#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
+ = 0 // NdbOperation
+#endif
+ ,UniqueIndexAccess ///< Read, update, or delete using unique index
+#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
+ = 1 // NdbIndexOperation
+#endif
+ ,TableScan ///< Full table scan
+#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
+ = 2 // NdbScanOperation
+#endif
+ ,OrderedIndexScan ///< Ordered index scan
+#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
+ = 3 // NdbIndexScanOperation
+#endif
+ };
+ /**
+ * Lock when performing read
+ */
+
enum LockMode {
LM_Read ///< Read with shared lock
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
@@ -720,6 +743,11 @@ public:
*/
const NdbDictionary::Table * getTable() const;
+ /**
+ * Get the type of access for this operation
+ */
+ const Type getType() const;
+
/** @} *********************************************************************/
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
@@ -773,7 +801,7 @@ protected:
int init(const class NdbTableImpl*, NdbTransaction* aCon);
void initInterpreter();
- NdbOperation(Ndb* aNdb);
+ NdbOperation(Ndb* aNdb, Type aType = PrimaryKeyAccess);
virtual ~NdbOperation();
void next(NdbOperation*); // Set next pointer
NdbOperation* next(); // Get next pointer
@@ -887,6 +915,8 @@ protected:
* These are the private variables that are defined in the operation objects.
*****************************************************************************/
+ Type m_type;
+
NdbReceiver theReceiver;
NdbError theError; // Errorcode
@@ -1051,6 +1081,19 @@ NdbOperation::getFirstRecAttr() const
}
/******************************************************************************
+Type getType()
+
+Return Value Return the Type.
+Remark: Gets type of access.
+******************************************************************************/
+inline
+const NdbOperation::Type
+NdbOperation::getType() const
+{
+ return m_type;
+}
+
+/******************************************************************************
OperationStatus Status();
Return Value Return the OperationStatus.
diff --git a/storage/ndb/include/ndbapi/NdbScanOperation.hpp b/storage/ndb/include/ndbapi/NdbScanOperation.hpp
index 048e7a0c952..6f80a1627fe 100644
--- a/storage/ndb/include/ndbapi/NdbScanOperation.hpp
+++ b/storage/ndb/include/ndbapi/NdbScanOperation.hpp
@@ -178,7 +178,8 @@ public:
int restart(bool forceSend = false);
protected:
- NdbScanOperation(Ndb* aNdb);
+ NdbScanOperation(Ndb* aNdb,
+ NdbOperation::Type aType = NdbOperation::TableScan);
virtual ~NdbScanOperation();
int nextResultImpl(bool fetchAllowed = true, bool forceSend = false);
diff --git a/storage/ndb/include/transporter/TransporterDefinitions.hpp b/storage/ndb/include/transporter/TransporterDefinitions.hpp
index e9c5ffa2c80..f7b5431bda0 100644
--- a/storage/ndb/include/transporter/TransporterDefinitions.hpp
+++ b/storage/ndb/include/transporter/TransporterDefinitions.hpp
@@ -117,6 +117,7 @@ struct SegmentedSectionPtr {
Uint32 i;
struct SectionSegment * p;
+ SegmentedSectionPtr() {}
void setNull() { p = 0;}
bool isNull() const { return p == 0;}
};
diff --git a/storage/ndb/include/util/InputStream.hpp b/storage/ndb/include/util/InputStream.hpp
index b2a56b1e433..10e22a70e42 100644
--- a/storage/ndb/include/util/InputStream.hpp
+++ b/storage/ndb/include/util/InputStream.hpp
@@ -25,6 +25,7 @@
*/
class InputStream {
public:
+ virtual ~InputStream() {}
virtual char* gets(char * buf, int bufLen) = 0;
};
@@ -32,6 +33,7 @@ class FileInputStream : public InputStream {
FILE * f;
public:
FileInputStream(FILE * file = stdin);
+ virtual ~FileInputStream() {}
char* gets(char * buf, int bufLen);
};
@@ -42,6 +44,7 @@ class SocketInputStream : public InputStream {
unsigned m_timeout;
public:
SocketInputStream(NDB_SOCKET_TYPE socket, unsigned readTimeout = 1000);
+ virtual ~SocketInputStream() {}
char* gets(char * buf, int bufLen);
};
diff --git a/storage/ndb/include/util/OutputStream.hpp b/storage/ndb/include/util/OutputStream.hpp
index c7e009d4537..66adb549da0 100644
--- a/storage/ndb/include/util/OutputStream.hpp
+++ b/storage/ndb/include/util/OutputStream.hpp
@@ -25,6 +25,7 @@
*/
class OutputStream {
public:
+ virtual ~OutputStream() {}
virtual int print(const char * fmt, ...) = 0;
virtual int println(const char * fmt, ...) = 0;
virtual void flush() {};
@@ -34,7 +35,8 @@ class FileOutputStream : public OutputStream {
FILE * f;
public:
FileOutputStream(FILE * file = stdout);
-
+ virtual ~FileOutputStream() {}
+
int print(const char * fmt, ...);
int println(const char * fmt, ...);
void flush() { fflush(f); }
@@ -45,7 +47,8 @@ class SocketOutputStream : public OutputStream {
unsigned m_timeout;
public:
SocketOutputStream(NDB_SOCKET_TYPE socket, unsigned writeTimeout = 1000);
-
+ virtual ~SocketOutputStream() {}
+
int print(const char * fmt, ...);
int println(const char * fmt, ...);
};
@@ -53,13 +56,15 @@ public:
class SoftOseOutputStream : public OutputStream {
public:
SoftOseOutputStream();
-
+ virtual ~SoftOseOutputStream() {}
+
int print(const char * fmt, ...);
int println(const char * fmt, ...);
};
class NullOutputStream : public OutputStream {
public:
+ virtual ~NullOutputStream() {}
int print(const char * /* unused */, ...) { return 1;}
int println(const char * /* unused */, ...) { return 1;}
};
diff --git a/storage/ndb/include/util/SimpleProperties.hpp b/storage/ndb/include/util/SimpleProperties.hpp
index 438426fb62b..bae91108518 100644
--- a/storage/ndb/include/util/SimpleProperties.hpp
+++ b/storage/ndb/include/util/SimpleProperties.hpp
@@ -92,6 +92,8 @@ public:
*/
class Reader {
public:
+ virtual ~Reader() {}
+
/**
* Move to first element
* Return true if element exist
@@ -164,6 +166,9 @@ public:
*/
class Writer {
public:
+ Writer() {}
+ virtual ~Writer() {}
+
bool first();
bool add(Uint16 key, Uint32 value);
bool add(Uint16 key, const char * value);
@@ -183,6 +188,7 @@ public:
class SimplePropertiesLinearReader : public SimpleProperties::Reader {
public:
SimplePropertiesLinearReader(const Uint32 * src, Uint32 len);
+ virtual ~SimplePropertiesLinearReader() {}
virtual void reset();
virtual bool step(Uint32 len);
@@ -201,7 +207,8 @@ private:
class LinearWriter : public SimpleProperties::Writer {
public:
LinearWriter(Uint32 * src, Uint32 len);
-
+ virtual ~LinearWriter() {}
+
virtual bool reset();
virtual bool putWord(Uint32 val);
virtual bool putWords(const Uint32 * src, Uint32 len);
@@ -218,6 +225,7 @@ private:
class UtilBufferWriter : public SimpleProperties::Writer {
public:
UtilBufferWriter(class UtilBuffer & buf);
+ virtual ~UtilBufferWriter() {}
virtual bool reset();
virtual bool putWord(Uint32 val);
@@ -237,7 +245,9 @@ class SimplePropertiesSectionReader : public SimpleProperties::Reader {
public:
SimplePropertiesSectionReader(struct SegmentedSectionPtr &,
class SectionSegmentPool &);
+ virtual ~SimplePropertiesSectionReader() {}
+
virtual void reset();
virtual bool step(Uint32 len);
virtual bool getWord(Uint32 * dst);
@@ -269,6 +279,7 @@ Uint32 SimplePropertiesSectionReader::getSize() const
class SimplePropertiesSectionWriter : public SimpleProperties::Writer {
public:
SimplePropertiesSectionWriter(class SectionSegmentPool &);
+ virtual ~SimplePropertiesSectionWriter() {}
virtual bool reset();
virtual bool putWord(Uint32 val);
diff --git a/storage/ndb/include/util/SocketServer.hpp b/storage/ndb/include/util/SocketServer.hpp
index 4c37e63adf0..e131b78baa1 100644
--- a/storage/ndb/include/util/SocketServer.hpp
+++ b/storage/ndb/include/util/SocketServer.hpp
@@ -60,6 +60,7 @@ public:
*/
class Service {
public:
+ Service() {}
virtual ~Service(){}
/**
diff --git a/storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp b/storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp
index 47b2dfb1c77..b9f91c510c0 100644
--- a/storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp
+++ b/storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp
@@ -233,7 +233,7 @@ sizeof(SimpleProperties::SP2StructMapping);
void
DictFilegroupInfo::Filegroup::init(){
- memset(FilegroupName, sizeof(FilegroupName), 0);
+ memset(FilegroupName, 0, sizeof(FilegroupName));
FilegroupType = ~0;
FilegroupId = ~0;
FilegroupVersion = ~0;
@@ -244,8 +244,10 @@ DictFilegroupInfo::Filegroup::init(){
TS_DataGrow.GrowLimit = 0;
TS_DataGrow.GrowSizeHi = 0;
TS_DataGrow.GrowSizeLo = 0;
- memset(TS_DataGrow.GrowPattern, sizeof(TS_DataGrow.GrowPattern), 0);
+ memset(TS_DataGrow.GrowPattern, 0, sizeof(TS_DataGrow.GrowPattern));
TS_DataGrow.GrowMaxSize = 0;
+ LF_UndoFreeWordsHi= 0;
+ LF_UndoFreeWordsLo= 0;
}
void
diff --git a/storage/ndb/src/kernel/blocks/ERROR_codes.txt b/storage/ndb/src/kernel/blocks/ERROR_codes.txt
index d9d52e43779..059c80a960d 100644
--- a/storage/ndb/src/kernel/blocks/ERROR_codes.txt
+++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt
@@ -228,6 +228,8 @@ Delay execution of COMPLETECONF signal 2 seconds to generate time-out.
8045: (ABORTCONF only as part of take-over)
Delay execution of ABORTCONF signal 2 seconds to generate time-out.
+8050: Send ZABORT_TIMEOUT_BREAK delayed
+
ERROR CODES FOR TESTING TIME-OUT HANDLING IN DBTC
-------------------------------------------------
@@ -305,6 +307,8 @@ Test Crashes in handling node restarts
7131: Crash when receiving START_COPYREQ in master node
7132: Crash when receiving START_COPYCONF in starting node
+7170: Crash when receiving START_PERMREF (InitialStartRequired)
+
DICT:
6000 Crash during NR when receiving DICTSTARTREQ
6001 Crash during NR when receiving SCHEMA_INFO
@@ -314,7 +318,7 @@ LQH:
5026 Crash when receiving COPY_ACTIVEREQ
5027 Crash when receiving STAT_RECREQ
-5042 Crash starting node, when scan is finished on primary replica
+5043 Crash starting node, when scan is finished on primary replica
Test Crashes in handling take over
----------------------------------
diff --git a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
index 02c3abe0e80..6d3df7b2047 100644
--- a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
+++ b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
@@ -1131,11 +1131,24 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal)
return;
}
- if (dumpState->args[0] == DumpStateOrd::CmvmiSetRestartOnErrorInsert){
+ if (dumpState->args[0] == DumpStateOrd::CmvmiSetRestartOnErrorInsert)
+ {
if(signal->getLength() == 1)
- m_ctx.m_config.setRestartOnErrorInsert((int)NRT_NoStart_Restart);
+ {
+ Uint32 val = (Uint32)NRT_NoStart_Restart;
+ const ndb_mgm_configuration_iterator * p =
+ m_ctx.m_config.getOwnConfigIterator();
+ ndbrequire(p != 0);
+
+ if(!ndb_mgm_get_int_parameter(p, CFG_DB_STOP_ON_ERROR_INSERT, &val))
+ {
+ m_ctx.m_config.setRestartOnErrorInsert(val);
+ }
+ }
else
+ {
m_ctx.m_config.setRestartOnErrorInsert(signal->theData[1]);
+ }
}
if (dumpState->args[0] == DumpStateOrd::CmvmiTestLongSigWithDelay) {
diff --git a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
index c8f65d2a9dd..f98df82ea7d 100644
--- a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
+++ b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
@@ -75,7 +75,6 @@
#define ZWRONG_FAILURE_NUMBER_ERROR 302
#define ZWRONG_START_NODE_ERROR 303
#define ZNO_REPLICA_FOUND_ERROR 304
-#define ZNODE_ALREADY_STARTING_ERROR 305
#define ZNODE_START_DISALLOWED_ERROR 309
// --------------------------------------
@@ -1040,7 +1039,8 @@ private:
void prepareReplicas(FragmentstorePtr regFragptr);
void removeNodeFromStored(Uint32 nodeId,
FragmentstorePtr regFragptr,
- ReplicaRecordPtr replicaPtr);
+ ReplicaRecordPtr replicaPtr,
+ bool temporary);
void removeOldStoredReplica(FragmentstorePtr regFragptr,
ReplicaRecordPtr replicaPtr);
void removeStoredReplica(FragmentstorePtr regFragptr,
diff --git a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
index cf1c5cda1e6..95c691f0c6b 100644
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
@@ -1439,6 +1439,33 @@ void Dbdih::ndbStartReqLab(Signal* signal, BlockReference ref)
return;
}
+ NodeRecordPtr nodePtr;
+ Uint32 gci = SYSFILE->lastCompletedGCI[getOwnNodeId()];
+ for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++)
+ {
+ jam();
+ ptrAss(nodePtr, nodeRecord);
+ if (SYSFILE->lastCompletedGCI[nodePtr.i] > gci)
+ {
+ jam();
+ /**
+ * Since we're starting(is master) and there
+ * there are other nodes with higher GCI...
+ * there gci's must be invalidated...
+ * and they _must_ do an initial start
+ * indicate this by setting lastCompletedGCI = 0
+ */
+ SYSFILE->lastCompletedGCI[nodePtr.i] = 0;
+ ndbrequire(nodePtr.p->nodeStatus != NodeRecord::ALIVE);
+ warningEvent("Making filesystem for node %d unusable",
+ nodePtr.i);
+ }
+ }
+ /**
+ * This set which GCI we will try to restart to
+ */
+ SYSFILE->newestRestorableGCI = gci;
+
ndbrequire(isMaster());
copyGciLab(signal, CopyGCIReq::RESTART); // We have already read the file!
}//Dbdih::ndbStartReqLab()
@@ -1574,7 +1601,7 @@ void Dbdih::execSTART_PERMREF(Signal* signal)
{
jamEntry();
Uint32 errorCode = signal->theData[1];
- if (errorCode == ZNODE_ALREADY_STARTING_ERROR) {
+ if (errorCode == StartPermRef::ZNODE_ALREADY_STARTING_ERROR) {
jam();
/*-----------------------------------------------------------------------*/
// The master was busy adding another node. We will wait for a second and
@@ -1584,6 +1611,20 @@ void Dbdih::execSTART_PERMREF(Signal* signal)
sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 3000, 1);
return;
}//if
+
+ if (errorCode == StartPermRef::InitialStartRequired)
+ {
+ CRASH_INSERTION(7170);
+ char buf[255];
+ BaseString::snprintf(buf, sizeof(buf),
+ "Cluster requires this node to be started "
+ " with --initial as partial start has been performed"
+ " and this filesystem is unusable");
+ progError(__LINE__,
+ NDBD_EXIT_SR_RESTARTCONFLICT,
+ buf);
+ ndbrequire(false);
+ }
/*------------------------------------------------------------------------*/
// Some node process in another node involving our node was still active. We
// will recover from this by crashing here.
@@ -1677,7 +1718,7 @@ void Dbdih::execSTART_PERMREQ(Signal* signal)
(c_nodeStartMaster.wait != ZFALSE)) {
jam();
signal->theData[0] = nodeId;
- signal->theData[1] = ZNODE_ALREADY_STARTING_ERROR;
+ signal->theData[1] = StartPermRef::ZNODE_ALREADY_STARTING_ERROR;
sendSignal(retRef, GSN_START_PERMREF, signal, 2, JBB);
return;
}//if
@@ -1687,6 +1728,16 @@ void Dbdih::execSTART_PERMREQ(Signal* signal)
ndbrequire(false);
}//if
+ if (SYSFILE->lastCompletedGCI[nodeId] == 0 &&
+ typeStart != NodeState::ST_INITIAL_NODE_RESTART)
+ {
+ jam();
+ signal->theData[0] = nodeId;
+ signal->theData[1] = StartPermRef::InitialStartRequired;
+ sendSignal(retRef, GSN_START_PERMREF, signal, 2, JBB);
+ return;
+ }
+
/*----------------------------------------------------------------------
* WE START THE INCLUSION PROCEDURE
* ---------------------------------------------------------------------*/
@@ -3685,24 +3736,12 @@ void Dbdih::closingGcpLab(Signal* signal, FileRecordPtr filePtr)
/* ------------------------------------------------------------------------- */
void Dbdih::selectMasterCandidateAndSend(Signal* signal)
{
- Uint32 gci = 0;
- Uint32 masterCandidateId = 0;
- NodeRecordPtr nodePtr;
- for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
- jam();
- ptrAss(nodePtr, nodeRecord);
- if (SYSFILE->lastCompletedGCI[nodePtr.i] > gci) {
- jam();
- masterCandidateId = nodePtr.i;
- gci = SYSFILE->lastCompletedGCI[nodePtr.i];
- }//if
- }//for
- ndbrequire(masterCandidateId != 0);
setNodeGroups();
- signal->theData[0] = masterCandidateId;
- signal->theData[1] = gci;
+ signal->theData[0] = getOwnNodeId();
+ signal->theData[1] = SYSFILE->lastCompletedGCI[getOwnNodeId()];
sendSignal(cntrlblockref, GSN_DIH_RESTARTCONF, signal, 2, JBB);
-
+
+ NodeRecordPtr nodePtr;
Uint32 node_groups[MAX_NDB_NODES];
memset(node_groups, 0, sizeof(node_groups));
for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) {
@@ -3720,10 +3759,10 @@ void Dbdih::selectMasterCandidateAndSend(Signal* signal)
if(count != 0 && count != cnoReplicas){
char buf[255];
BaseString::snprintf(buf, sizeof(buf),
- "Illegal configuration change."
- " Initial start needs to be performed "
- " when changing no of replicas (%d != %d)",
- node_groups[nodePtr.i], cnoReplicas);
+ "Illegal configuration change."
+ " Initial start needs to be performed "
+ " when changing no of replicas (%d != %d)",
+ node_groups[nodePtr.i], cnoReplicas);
progError(__LINE__, NDBD_EXIT_INVALID_CONFIG, buf);
}
}
@@ -5396,6 +5435,7 @@ void Dbdih::removeNodeFromTable(Signal* signal,
//const Uint32 lcpId = SYSFILE->latestLCP_ID;
const bool lcpOngoingFlag = (tabPtr.p->tabLcpStatus== TabRecord::TLS_ACTIVE);
+ const bool temporary = !tabPtr.p->storedTable;
FragmentstorePtr fragPtr;
for(Uint32 fragNo = 0; fragNo < tabPtr.p->totalfragments; fragNo++){
@@ -5416,7 +5456,7 @@ void Dbdih::removeNodeFromTable(Signal* signal,
jam();
found = true;
noOfRemovedReplicas++;
- removeNodeFromStored(nodeId, fragPtr, replicaPtr);
+ removeNodeFromStored(nodeId, fragPtr, replicaPtr, temporary);
if(replicaPtr.p->lcpOngoingFlag){
jam();
/**
@@ -6121,9 +6161,6 @@ void Dbdih::MASTER_LCPhandling(Signal* signal, Uint32 failedNodeId)
signal->theData[0] = 7012;
execDUMP_STATE_ORD(signal);
- signal->theData[0] = 7015;
- execDUMP_STATE_ORD(signal);
-
c_lcpMasterTakeOverState.set(LMTOS_IDLE, __LINE__);
checkLocalNodefailComplete(signal, failedNodePtr.i, NF_LCP_TAKE_OVER);
@@ -12139,7 +12176,8 @@ void Dbdih::newCrashedReplica(Uint32 nodeId, ReplicaRecordPtr ncrReplicaPtr)
/* THAT THE NEW REPLICA IS NOT STARTED YET AND REPLICA_LAST_GCI IS*/
/* SET TO -1 TO INDICATE THAT IT IS NOT DEAD YET. */
/*----------------------------------------------------------------------*/
- arrGuard(ncrReplicaPtr.p->noCrashedReplicas + 1, 8);
+ arrGuardErr(ncrReplicaPtr.p->noCrashedReplicas + 1, 8,
+ NDBD_EXIT_MAX_CRASHED_REPLICAS);
ncrReplicaPtr.p->replicaLastGci[ncrReplicaPtr.p->noCrashedReplicas] =
SYSFILE->lastCompletedGCI[nodeId];
ncrReplicaPtr.p->noCrashedReplicas = ncrReplicaPtr.p->noCrashedReplicas + 1;
@@ -12502,9 +12540,18 @@ void Dbdih::removeDeadNode(NodeRecordPtr removeNodePtr)
/*---------------------------------------------------------------*/
void Dbdih::removeNodeFromStored(Uint32 nodeId,
FragmentstorePtr fragPtr,
- ReplicaRecordPtr replicatePtr)
+ ReplicaRecordPtr replicatePtr,
+ bool temporary)
{
- newCrashedReplica(nodeId, replicatePtr);
+ if (!temporary)
+ {
+ jam();
+ newCrashedReplica(nodeId, replicatePtr);
+ }
+ else
+ {
+ jam();
+ }
removeStoredReplica(fragPtr, replicatePtr);
linkOldStoredReplica(fragPtr, replicatePtr);
ndbrequire(fragPtr.p->storedReplicas != RNIL);
@@ -13439,7 +13486,8 @@ void
Dbdih::execDUMP_STATE_ORD(Signal* signal)
{
DumpStateOrd * const & dumpState = (DumpStateOrd *)&signal->theData[0];
- if (dumpState->args[0] == DumpStateOrd::DihDumpNodeRestartInfo) {
+ Uint32 arg = dumpState->args[0];
+ if (arg == DumpStateOrd::DihDumpNodeRestartInfo) {
infoEvent("c_nodeStartMaster.blockLcp = %d, c_nodeStartMaster.blockGcp = %d, c_nodeStartMaster.wait = %d",
c_nodeStartMaster.blockLcp, c_nodeStartMaster.blockGcp, c_nodeStartMaster.wait);
infoEvent("cstartGcpNow = %d, cgcpStatus = %d",
@@ -13449,7 +13497,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
infoEvent("cgcpOrderBlocked = %d, cgcpStartCounter = %d",
cgcpOrderBlocked, cgcpStartCounter);
}//if
- if (dumpState->args[0] == DumpStateOrd::DihDumpNodeStatusInfo) {
+ if (arg == DumpStateOrd::DihDumpNodeStatusInfo) {
NodeRecordPtr localNodePtr;
infoEvent("Printing nodeStatus of all nodes");
for (localNodePtr.i = 1; localNodePtr.i < MAX_NDB_NODES; localNodePtr.i++) {
@@ -13461,7 +13509,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
}//for
}//if
- if (dumpState->args[0] == DumpStateOrd::DihPrintFragmentation){
+ if (arg == DumpStateOrd::DihPrintFragmentation){
infoEvent("Printing fragmentation of all tables --");
for(Uint32 i = 0; i<ctabFileSize; i++){
TabRecordPtr tabPtr;
@@ -13636,7 +13684,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
}
}
- if(dumpState->args[0] == 7019 && signal->getLength() == 2)
+ if(arg == 7019 && signal->getLength() == 2)
{
char buf2[8+1];
NodeRecordPtr nodePtr;
@@ -13654,7 +13702,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
nodePtr.p->m_nodefailSteps.getText(buf2));
}
- if(dumpState->args[0] == 7020 && signal->getLength() > 3)
+ if(arg == 7020 && signal->getLength() > 3)
{
Uint32 gsn= signal->theData[1];
Uint32 block= signal->theData[2];
@@ -13678,7 +13726,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
gsn, getBlockName(block, "UNKNOWN"), length, buf);
}
- if(dumpState->args[0] == DumpStateOrd::DihDumpLCPState){
+ if(arg == DumpStateOrd::DihDumpLCPState){
infoEvent("-- Node %d LCP STATE --", getOwnNodeId());
infoEvent("lcpStatus = %d (update place = %d) ",
c_lcpState.lcpStatus, c_lcpState.lcpStatusUpdatedPlace);
@@ -13694,7 +13742,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
infoEvent("-- Node %d LCP STATE --", getOwnNodeId());
}
- if(dumpState->args[0] == DumpStateOrd::DihDumpLCPMasterTakeOver){
+ if(arg == DumpStateOrd::DihDumpLCPMasterTakeOver){
infoEvent("-- Node %d LCP MASTER TAKE OVER STATE --", getOwnNodeId());
infoEvent
("c_lcpMasterTakeOverState.state = %d updatePlace = %d failedNodeId = %d",
@@ -13709,52 +13757,25 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
infoEvent("-- Node %d LCP MASTER TAKE OVER STATE --", getOwnNodeId());
}
- if (signal->theData[0] == 7015){
- for(Uint32 i = 0; i<ctabFileSize; i++){
- TabRecordPtr tabPtr;
- tabPtr.i = i;
- ptrCheckGuard(tabPtr, ctabFileSize, tabRecord);
-
- if(tabPtr.p->tabStatus != TabRecord::TS_ACTIVE)
- continue;
-
- infoEvent
- ("Table %d: TabCopyStatus: %d TabUpdateStatus: %d TabLcpStatus: %d",
- tabPtr.i,
- tabPtr.p->tabCopyStatus,
- tabPtr.p->tabUpdateState,
- tabPtr.p->tabLcpStatus);
+ if (signal->theData[0] == 7015)
+ {
+ if (signal->getLength() == 1)
+ {
+ signal->theData[1] = 0;
+ }
- FragmentstorePtr fragPtr;
- for (Uint32 fid = 0; fid < tabPtr.p->totalfragments; fid++) {
- jam();
- getFragstore(tabPtr.p, fid, fragPtr);
-
- char buf[100], buf2[100];
- BaseString::snprintf(buf, sizeof(buf), " Fragment %d: noLcpReplicas==%d ",
- fid, fragPtr.p->noLcpReplicas);
-
- Uint32 num=0;
- ReplicaRecordPtr replicaPtr;
- replicaPtr.i = fragPtr.p->storedReplicas;
- do {
- ptrCheckGuard(replicaPtr, creplicaFileSize, replicaRecord);
- BaseString::snprintf(buf2, sizeof(buf2), "%s %d(on %d)=%d(%s)",
- buf, num,
- replicaPtr.p->procNode,
- replicaPtr.p->lcpIdStarted,
- replicaPtr.p->lcpOngoingFlag ? "Ongoing" : "Idle");
- BaseString::snprintf(buf, sizeof(buf), "%s", buf2);
-
- num++;
- replicaPtr.i = replicaPtr.p->nextReplica;
- } while (replicaPtr.i != RNIL);
- infoEvent(buf);
- }
+ Uint32 tableId = signal->theData[1];
+ if (tableId < ctabFileSize)
+ {
+ signal->theData[0] = 7021;
+ execDUMP_STATE_ORD(signal);
+ signal->theData[0] = 7015;
+ signal->theData[1] = tableId + 1;
+ sendSignal(reference(), GSN_DUMP_STATE_ORD, signal, 2, JBB);
}
}
- if(dumpState->args[0] == DumpStateOrd::EnableUndoDelayDataWrite){
+ if(arg == DumpStateOrd::EnableUndoDelayDataWrite){
ndbout << "Dbdih:: delay write of datapages for table = "
<< dumpState->args[1]<< endl;
// Send this dump to ACC and TUP
@@ -13784,7 +13805,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
return;
}
- if(dumpState->args[0] == 7098){
+ if(arg == 7098){
if(signal->length() == 3){
jam();
infoEvent("startLcpRoundLoopLab(tabel=%d, fragment=%d)",
@@ -13797,10 +13818,73 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
}
}
- if(dumpState->args[0] == DumpStateOrd::DihStartLcpImmediately){
+ if(arg == DumpStateOrd::DihStartLcpImmediately){
c_lcpState.ctimer += (1 << c_lcpState.clcpDelay);
return;
}
+
+ if (arg == DumpStateOrd::DihSetTimeBetweenGcp)
+ {
+ if (signal->getLength() == 1)
+ {
+ const ndb_mgm_configuration_iterator * p =
+ m_ctx.m_config.getOwnConfigIterator();
+ ndbrequire(p != 0);
+ ndb_mgm_get_int_parameter(p, CFG_DB_GCP_INTERVAL, &cgcpDelay);
+ }
+ else
+ {
+ cgcpDelay = signal->theData[1];
+ }
+ ndbout_c("Setting time between gcp : %d", cgcpDelay);
+ }
+
+ if (arg == 7021 && signal->getLength() == 2)
+ {
+ TabRecordPtr tabPtr;
+ tabPtr.i = signal->theData[1];
+ if (tabPtr.i >= ctabFileSize)
+ return;
+
+ ptrCheckGuard(tabPtr, ctabFileSize, tabRecord);
+
+ if(tabPtr.p->tabStatus != TabRecord::TS_ACTIVE)
+ return;
+
+ infoEvent
+ ("Table %d: TabCopyStatus: %d TabUpdateStatus: %d TabLcpStatus: %d",
+ tabPtr.i,
+ tabPtr.p->tabCopyStatus,
+ tabPtr.p->tabUpdateState,
+ tabPtr.p->tabLcpStatus);
+
+ FragmentstorePtr fragPtr;
+ for (Uint32 fid = 0; fid < tabPtr.p->totalfragments; fid++) {
+ jam();
+ getFragstore(tabPtr.p, fid, fragPtr);
+
+ char buf[100], buf2[100];
+ BaseString::snprintf(buf, sizeof(buf), " Fragment %d: noLcpReplicas==%d ",
+ fid, fragPtr.p->noLcpReplicas);
+
+ Uint32 num=0;
+ ReplicaRecordPtr replicaPtr;
+ replicaPtr.i = fragPtr.p->storedReplicas;
+ do {
+ ptrCheckGuard(replicaPtr, creplicaFileSize, replicaRecord);
+ BaseString::snprintf(buf2, sizeof(buf2), "%s %d(on %d)=%d(%s)",
+ buf, num,
+ replicaPtr.p->procNode,
+ replicaPtr.p->lcpIdStarted,
+ replicaPtr.p->lcpOngoingFlag ? "Ongoing" : "Idle");
+ BaseString::snprintf(buf, sizeof(buf), "%s", buf2);
+
+ num++;
+ replicaPtr.i = replicaPtr.p->nextReplica;
+ } while (replicaPtr.i != RNIL);
+ infoEvent(buf);
+ }
+ }
}//Dbdih::execDUMP_STATE_ORD()
void
diff --git a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
index 00378ecd84a..69db36c8517 100644
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
@@ -9960,7 +9960,7 @@ void Dblqh::nextScanConfCopyLab(Signal* signal)
/*---------------------------------------------------------------------------*/
scanptr.p->scanCompletedStatus = ZTRUE;
scanptr.p->scanState = ScanRecord::WAIT_LQHKEY_COPY;
- if (ERROR_INSERTED(5042))
+ if (ERROR_INSERTED(5043))
{
CLEAR_ERROR_INSERT_VALUE;
tcConnectptr.p->copyCountWords = ~0;
@@ -18198,6 +18198,89 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal)
return;
}
+#ifdef ERROR_INSERT
+#ifdef NDB_DEBUG_FULL
+ if(dumpState->args[0] == DumpStateOrd::LCPContinue){
+ switch(cerrorInsert){
+ case 5904:
+ CLEAR_ERROR_INSERT_VALUE;
+ g_trace_lcp.restore(*globalData.getBlock(BACKUP), signal);
+ return;
+ default:
+ return;
+ }
+ }
+#endif
+#endif
+
+ if(arg == 2304 || arg == 2305)
+ {
+ jam();
+ Uint32 i;
+ GcpRecordPtr gcp; gcp.i = RNIL;
+ for(i = 0; i<4; i++)
+ {
+ logPartPtr.i = i;
+ ptrCheckGuard(logPartPtr, clogPartFileSize, logPartRecord);
+ ndbout_c("LP %d state: %d WW_Gci: %d gcprec: %d flq: %d currfile: %d tailFileNo: %d logTailMbyte: %d",
+ i,
+ logPartPtr.p->logPartState,
+ logPartPtr.p->waitWriteGciLog,
+ logPartPtr.p->gcprec,
+ logPartPtr.p->firstLogQueue,
+ logPartPtr.p->currentLogfile,
+ logPartPtr.p->logTailFileNo,
+ logPartPtr.p->logTailMbyte);
+
+ if(gcp.i == RNIL && logPartPtr.p->gcprec != RNIL)
+ gcp.i = logPartPtr.p->gcprec;
+
+ LogFileRecordPtr logFilePtr;
+ Uint32 first= logFilePtr.i= logPartPtr.p->firstLogfile;
+ do
+ {
+ ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
+ ndbout_c(" file %d(%d) FileChangeState: %d logFileStatus: %d currentMbyte: %d currentFilepage",
+ logFilePtr.p->fileNo,
+ logFilePtr.i,
+ logFilePtr.p->fileChangeState,
+ logFilePtr.p->logFileStatus,
+ logFilePtr.p->currentMbyte,
+ logFilePtr.p->currentFilepage);
+ logFilePtr.i = logFilePtr.p->nextLogFile;
+ } while(logFilePtr.i != first);
+ }
+
+ if(gcp.i != RNIL)
+ {
+ ptrCheckGuard(gcp, cgcprecFileSize, gcpRecord);
+ for(i = 0; i<4; i++)
+ {
+ ndbout_c(" GCP %d file: %d state: %d sync: %d page: %d word: %d",
+ i, gcp.p->gcpFilePtr[i], gcp.p->gcpLogPartState[i],
+ gcp.p->gcpSyncReady[i],
+ gcp.p->gcpPageNo[i],
+ gcp.p->gcpWordNo[i]);
+ }
+ }
+
+ if(arg== 2305)
+ {
+ progError(__LINE__, NDBD_EXIT_SYSTEM_ERROR,
+ "Please report this as a bug. "
+ "Provide as much info as possible, expecially all the "
+ "ndb_*_out.log files, Thanks. "
+ "Shutting down node due to failed handling of GCP_SAVEREQ");
+
+ }
+ }
+
+ if (dumpState->args[0] == DumpStateOrd::LqhErrorInsert5042 && signal->getLength() == 2)
+ {
+ c_error_insert_table_id = dumpState->args[1];
+ SET_ERROR_INSERT_VALUE(5042);
+ }
+
TcConnectionrec *regTcConnectionrec = tcConnectionrec;
Uint32 ttcConnectrecFileSize = ctcConnectrecFileSize;
if(arg == 2306)
@@ -18363,88 +18446,6 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal)
ndbrequire(arg != 2308);
}
-#ifdef ERROR_INSERT
-#ifdef NDB_DEBUG_FULL
- if(dumpState->args[0] == DumpStateOrd::LCPContinue){
- switch(cerrorInsert){
- case 5904:
- CLEAR_ERROR_INSERT_VALUE;
- g_trace_lcp.restore(*globalData.getBlock(BACKUP), signal);
- return;
- default:
- return;
- }
- }
-#endif
-#endif
-
- if(arg == 2304 || arg == 2305)
- {
- jam();
- Uint32 i;
- GcpRecordPtr gcp; gcp.i = RNIL;
- for(i = 0; i<4; i++)
- {
- logPartPtr.i = i;
- ptrCheckGuard(logPartPtr, clogPartFileSize, logPartRecord);
- ndbout_c("LP %d state: %d WW_Gci: %d gcprec: %d flq: %d currfile: %d tailFileNo: %d logTailMbyte: %d",
- i,
- logPartPtr.p->logPartState,
- logPartPtr.p->waitWriteGciLog,
- logPartPtr.p->gcprec,
- logPartPtr.p->firstLogQueue,
- logPartPtr.p->currentLogfile,
- logPartPtr.p->logTailFileNo,
- logPartPtr.p->logTailMbyte);
-
- if(gcp.i == RNIL && logPartPtr.p->gcprec != RNIL)
- gcp.i = logPartPtr.p->gcprec;
-
- LogFileRecordPtr logFilePtr;
- Uint32 first= logFilePtr.i= logPartPtr.p->firstLogfile;
- do
- {
- ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
- ndbout_c(" file %d(%d) FileChangeState: %d logFileStatus: %d currentMbyte: %d currentFilepage",
- logFilePtr.p->fileNo,
- logFilePtr.i,
- logFilePtr.p->fileChangeState,
- logFilePtr.p->logFileStatus,
- logFilePtr.p->currentMbyte,
- logFilePtr.p->currentFilepage);
- logFilePtr.i = logFilePtr.p->nextLogFile;
- } while(logFilePtr.i != first);
- }
-
- if(gcp.i != RNIL)
- {
- ptrCheckGuard(gcp, cgcprecFileSize, gcpRecord);
- for(i = 0; i<4; i++)
- {
- ndbout_c(" GCP %d file: %d state: %d sync: %d page: %d word: %d",
- i, gcp.p->gcpFilePtr[i], gcp.p->gcpLogPartState[i],
- gcp.p->gcpSyncReady[i],
- gcp.p->gcpPageNo[i],
- gcp.p->gcpWordNo[i]);
- }
- }
-
- if(arg== 2305)
- {
- progError(__LINE__, NDBD_EXIT_SYSTEM_ERROR,
- "Please report this as a bug. "
- "Provide as much info as possible, expecially all the "
- "ndb_*_out.log files, Thanks. "
- "Shutting down node due to failed handling of GCP_SAVEREQ");
-
- }
- }
-
- if (dumpState->args[0] == DumpStateOrd::LqhErrorInsert5042 && signal->getLength() == 2)
- {
- c_error_insert_table_id = dumpState->args[1];
- SET_ERROR_INSERT_VALUE(5042);
- }
}//Dblqh::execDUMP_STATE_ORD()
void Dblqh::execSET_VAR_REQ(Signal* signal)
diff --git a/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
index 430fa137c7f..bcda7bee5a9 100644
--- a/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
+++ b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
@@ -213,14 +213,6 @@ public:
LTS_ACTIVE = 1
};
- enum TakeOverState {
- TOS_NOT_DEFINED = 0,
- TOS_IDLE = 1,
- TOS_ACTIVE = 2,
- TOS_COMPLETED = 3,
- TOS_NODE_FAILED = 4
- };
-
enum FailState {
FS_IDLE = 0,
FS_LISTENING = 1,
@@ -645,6 +637,7 @@ public:
ConnectionState apiConnectstate;
UintR transid[2];
UintR firstTcConnect;
+ NdbNodeBitmask m_transaction_nodes;
//---------------------------------------------------
// Second 16 byte cache line. Hot variables.
@@ -937,7 +930,6 @@ public:
struct HostRecord {
HostState hostStatus;
LqhTransState lqhTransStatus;
- TakeOverState takeOverStatus;
bool inPackedList;
UintR noOfPackedWordsLqh;
UintR packedWordsLqh[26];
@@ -946,6 +938,17 @@ public:
UintR noOfWordsTCINDXCONF;
UintR packedWordsTCINDXCONF[30];
BlockReference hostLqhBlockRef;
+
+ enum NodeFailBits
+ {
+ NF_TAKEOVER = 0x1,
+ NF_CHECK_SCAN = 0x2,
+ NF_CHECK_TRANSACTION = 0x4,
+ NF_CHECK_DROP_TAB = 0x8,
+ NF_NODE_FAIL_BITS = 0xF // All bits...
+ };
+ Uint32 m_nf_bits;
+ NdbNodeBitmask m_lqh_trans_conf;
}; /* p2c: size = 128 bytes */
typedef Ptr<HostRecord> HostRecordPtr;
@@ -1593,7 +1596,7 @@ private:
void wrongSchemaVersionErrorLab(Signal* signal);
void noFreeConnectionErrorLab(Signal* signal);
void tckeyreq050Lab(Signal* signal);
- void timeOutFoundLab(Signal* signal, UintR anAdd);
+ void timeOutFoundLab(Signal* signal, UintR anAdd, Uint32 errCode);
void completeTransAtTakeOverLab(Signal* signal, UintR TtakeOverInd);
void completeTransAtTakeOverDoLast(Signal* signal, UintR TtakeOverInd);
void completeTransAtTakeOverDoOne(Signal* signal, UintR TtakeOverInd);
@@ -1615,6 +1618,9 @@ private:
void checkScanFragList(Signal*, Uint32 failedNodeId, ScanRecord * scanP,
LocalDLList<ScanFragRec>::Head&);
+ void nodeFailCheckTransactions(Signal*,Uint32 transPtrI,Uint32 failedNodeId);
+ void checkNodeFailComplete(Signal* signal, Uint32 failedNodeId, Uint32 bit);
+
// Initialisation
void initData();
void initRecords();
@@ -1641,6 +1647,7 @@ private:
HostRecord *hostRecord;
HostRecordPtr hostptr;
UintR chostFilesize;
+ NdbNodeBitmask c_alive_nodes;
GcpRecord *gcpRecord;
GcpRecordPtr gcpPtr;
diff --git a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
index 7c505265d19..369ba53126e 100644
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
@@ -267,6 +267,10 @@ void Dbtc::execCONTINUEB(Signal* signal)
jam();
checkScanActiveInFailedLqh(signal, Tdata0, Tdata1);
return;
+ case TcContinueB::ZNF_CHECK_TRANSACTIONS:
+ jam();
+ nodeFailCheckTransactions(signal, Tdata0, Tdata1);
+ return;
case TcContinueB::CHECK_WAIT_DROP_TAB_FAILED_LQH:
jam();
checkWaitDropTabFailedLqh(signal, Tdata0, Tdata1);
@@ -304,8 +308,8 @@ void Dbtc::execINCL_NODEREQ(Signal* signal)
hostptr.i = signal->theData[1];
ptrCheckGuard(hostptr, chostFilesize, hostRecord);
hostptr.p->hostStatus = HS_ALIVE;
- hostptr.p->takeOverStatus = TOS_IDLE;
signal->theData[0] = cownref;
+ c_alive_nodes.set(hostptr.i);
sendSignal(tblockref, GSN_INCL_NODECONF, signal, 1, JBB);
}
@@ -504,6 +508,7 @@ Dbtc::checkWaitDropTabFailedLqh(Signal* signal, Uint32 nodeId, Uint32 tableId)
* Finished
*/
jam();
+ checkNodeFailComplete(signal, nodeId, HostRecord::NF_CHECK_DROP_TAB);
return;
}
@@ -869,8 +874,6 @@ void Dbtc::execREAD_NODESCONF(Signal* signal)
hostptr.i = i;
ptrCheckGuard(hostptr, chostFilesize, hostRecord);
- hostptr.p->takeOverStatus = TOS_IDLE;
-
if (NodeBitmask::get(readNodes->inactiveNodes, i)) {
jam();
hostptr.p->hostStatus = HS_DEAD;
@@ -878,6 +881,7 @@ void Dbtc::execREAD_NODESCONF(Signal* signal)
jam();
con_lineNodes++;
hostptr.p->hostStatus = HS_ALIVE;
+ c_alive_nodes.set(i);
}//if
}//if
}//for
@@ -2380,6 +2384,7 @@ void Dbtc::initApiConnectRec(Signal* signal,
regApiPtr->commitAckMarker = RNIL;
regApiPtr->buddyPtr = RNIL;
regApiPtr->currSavePointId = 0;
+ regApiPtr->m_transaction_nodes.clear();
// Trigger data
releaseFiredTriggerData(&regApiPtr->theFiredTriggers),
// Index data
@@ -2968,6 +2973,10 @@ void Dbtc::tckeyreq050Lab(Signal* signal)
signal->theData[0] = TdihConnectptr;
signal->theData[1] = Ttableref;
signal->theData[2] = TdistrHashValue;
+ signal->theData[3] = 0;
+ signal->theData[4] = 0;
+ signal->theData[5] = 0;
+ signal->theData[6] = 0;
/*-------------------------------------------------------------*/
/* FOR EFFICIENCY REASONS WE AVOID THE SIGNAL SENDING HERE AND */
@@ -3148,6 +3157,7 @@ void Dbtc::sendlqhkeyreq(Signal* signal,
ApiConnectRecord * const regApiPtr = apiConnectptr.p;
CacheRecord * const regCachePtr = cachePtr.p;
Uint32 version = getNodeInfo(refToNode(TBRef)).m_version;
+ UintR sig0, sig1, sig2, sig3, sig4, sig5, sig6;
#ifdef ERROR_INSERT
if (ERROR_INSERTED(8002)) {
systemErrorLab(signal, __LINE__);
@@ -3185,6 +3195,9 @@ void Dbtc::sendlqhkeyreq(Signal* signal,
LqhKeyReq::setScanTakeOverFlag(tslrAttrLen, regCachePtr->scanTakeOverInd);
Tdata10 = 0;
+ sig0 = regCachePtr->opSimple;
+ sig1 = regTcPtr->operation;
+ bool simpleRead = (sig1 == ZREAD && sig0 == ZTRUE);
LqhKeyReq::setKeyLen(Tdata10, regCachePtr->keylen);
LqhKeyReq::setLastReplicaNo(Tdata10, regTcPtr->lastReplicaNo);
if (unlikely(version < NDBD_ROWID_VERSION))
@@ -3199,8 +3212,8 @@ void Dbtc::sendlqhkeyreq(Signal* signal,
LqhKeyReq::setApplicationAddressFlag(Tdata10, 1);
LqhKeyReq::setDirtyFlag(Tdata10, regTcPtr->dirtyOp);
LqhKeyReq::setInterpretedFlag(Tdata10, regCachePtr->opExec);
- LqhKeyReq::setSimpleFlag(Tdata10, regCachePtr->opSimple);
- LqhKeyReq::setOperation(Tdata10, regTcPtr->operation);
+ LqhKeyReq::setSimpleFlag(Tdata10, sig0);
+ LqhKeyReq::setOperation(Tdata10, sig1);
LqhKeyReq::setNoDiskFlag(Tdata10, regCachePtr->m_no_disk_flag);
/* -----------------------------------------------------------------------
@@ -3215,18 +3228,16 @@ void Dbtc::sendlqhkeyreq(Signal* signal,
* ----------------------------------------------------------------------- */
//LqhKeyReq::setAPIVersion(Tdata10, regCachePtr->apiVersionNo);
Uint32 commitAckMarker = regTcPtr->commitAckMarker;
+ const Uint32 noOfLqhs = regTcPtr->noOfNodes;
if(commitAckMarker != RNIL){
jam();
-
LqhKeyReq::setMarkerFlag(Tdata10, 1);
- CommitAckMarker * tmp;
- tmp = m_commitAckMarkerHash.getPtr(commitAckMarker);
+ CommitAckMarker * tmp = m_commitAckMarkerHash.getPtr(commitAckMarker);
/**
* Populate LQH array
*/
- const Uint32 noOfLqhs = regTcPtr->noOfNodes;
tmp->noOfLqhs = noOfLqhs;
for(Uint32 i = 0; i<noOfLqhs; i++){
tmp->lqhNodeId[i] = regTcPtr->tcNodedata[i];
@@ -3237,7 +3248,6 @@ void Dbtc::sendlqhkeyreq(Signal* signal,
/* NO READ LENGTH SENT FROM TC. SEQUENTIAL NUMBER IS 1 AND IT */
/* IS SENT TO A PRIMARY NODE. */
/* ************************************************************> */
- UintR sig0, sig1, sig2, sig3, sig4, sig5, sig6;
LqhKeyReq * const lqhKeyReq = (LqhKeyReq *)signal->getDataPtrSend();
@@ -3261,6 +3271,14 @@ void Dbtc::sendlqhkeyreq(Signal* signal,
sig5 = regTcPtr->clientData;
sig6 = regCachePtr->scanInfo;
+ if (! simpleRead)
+ {
+ regApiPtr->m_transaction_nodes.set(regTcPtr->tcNodedata[0]);
+ regApiPtr->m_transaction_nodes.set(regTcPtr->tcNodedata[1]);
+ regApiPtr->m_transaction_nodes.set(regTcPtr->tcNodedata[2]);
+ regApiPtr->m_transaction_nodes.set(regTcPtr->tcNodedata[3]);
+ }
+
lqhKeyReq->tableSchemaVersion = sig0;
lqhKeyReq->fragmentData = sig1;
lqhKeyReq->transId1 = sig2;
@@ -4646,6 +4664,7 @@ void Dbtc::copyApi(Signal* signal)
UintR TgcpPointer = regTmpApiPtr->gcpPointer;
UintR TgcpFilesize = cgcpFilesize;
UintR TcommitAckMarker = regTmpApiPtr->commitAckMarker;
+ NdbNodeBitmask Tnodes = regTmpApiPtr->m_transaction_nodes;
GcpRecord *localGcpRecord = gcpRecord;
regApiPtr->ndbapiBlockref = regTmpApiPtr->ndbapiBlockref;
@@ -4656,6 +4675,7 @@ void Dbtc::copyApi(Signal* signal)
regApiPtr->transid[1] = Ttransid2;
regApiPtr->lqhkeyconfrec = Tlqhkeyconfrec;
regApiPtr->commitAckMarker = TcommitAckMarker;
+ regApiPtr->m_transaction_nodes = Tnodes;
gcpPtr.i = TgcpPointer;
ptrCheckGuard(gcpPtr, TgcpFilesize, localGcpRecord);
@@ -4666,6 +4686,7 @@ void Dbtc::copyApi(Signal* signal)
regTmpApiPtr->commitAckMarker = RNIL;
regTmpApiPtr->firstTcConnect = RNIL;
regTmpApiPtr->lastTcConnect = RNIL;
+ regTmpApiPtr->m_transaction_nodes.clear();
releaseAllSeizedIndexOperations(regTmpApiPtr);
}//Dbtc::copyApi()
@@ -4925,7 +4946,7 @@ void Dbtc::releaseTransResources(Signal* signal)
TcConnectRecordPtr localTcConnectptr;
UintR TtcConnectFilesize = ctcConnectFilesize;
TcConnectRecord *localTcConnectRecord = tcConnectRecord;
-
+ apiConnectptr.p->m_transaction_nodes.clear();
localTcConnectptr.i = apiConnectptr.p->firstTcConnect;
do {
jam();
@@ -5343,7 +5364,8 @@ void Dbtc::execTC_COMMITREQ(Signal* signal)
break;
case CS_ABORTING:
jam();
- errorCode = ZABORTINPROGRESS;
+ errorCode = regApiPtr->returncode ?
+ regApiPtr->returncode : ZABORTINPROGRESS;
break;
case CS_START_SCAN:
jam();
@@ -5882,9 +5904,9 @@ void Dbtc::abort010Lab(Signal* signal)
if (transP->firstTcConnect == RNIL) {
jam();
- /*-----------------------------------------------------------------------*/
- /* WE HAVE NO PARTICIPANTS IN THE TRANSACTION. */
- /*-----------------------------------------------------------------------*/
+ /*--------------------------------------------------------------------*/
+ /* WE HAVE NO PARTICIPANTS IN THE TRANSACTION. */
+ /*--------------------------------------------------------------------*/
releaseAbortResources(signal);
return;
}//if
@@ -6161,10 +6183,12 @@ void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr)
if (api_timer != 0) {
time_out_value= time_out_param + (api_con_ptr & mask_value);
time_passed= tc_timer - api_timer;
- if (time_passed > time_out_value) {
+ if (time_passed > time_out_value)
+ {
jam();
- timeOutFoundLab(signal, api_con_ptr);
- return;
+ timeOutFoundLab(signal, api_con_ptr, ZTIME_OUT_ERROR);
+ api_con_ptr++;
+ break;
}
}
}
@@ -6184,10 +6208,8 @@ void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr)
return;
}//Dbtc::timeOutLoopStartLab()
-void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr)
+void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr, Uint32 errCode)
{
- sendContinueTimeOutControl(signal, TapiConPtr + 1);
-
apiConnectptr.i = TapiConPtr;
ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord);
/*------------------------------------------------------------------*/
@@ -6200,7 +6222,8 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr)
<< "Time-out in state = " << apiConnectptr.p->apiConnectstate
<< " apiConnectptr.i = " << apiConnectptr.i
<< " - exec: " << apiConnectptr.p->m_exec_flag
- << " - place: " << c_apiConTimer_line[apiConnectptr.i]);
+ << " - place: " << c_apiConTimer_line[apiConnectptr.i]
+ << " code: " << errCode);
switch (apiConnectptr.p->apiConnectstate) {
case CS_STARTED:
if(apiConnectptr.p->lqhkeyreqrec == apiConnectptr.p->lqhkeyconfrec){
@@ -6217,7 +6240,7 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr)
}//if
}
apiConnectptr.p->returnsignal = RS_TCROLLBACKREP;
- apiConnectptr.p->returncode = ZTIME_OUT_ERROR;
+ apiConnectptr.p->returncode = errCode;
abort010Lab(signal);
return;
case CS_RECEIVING:
@@ -6230,7 +6253,7 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr)
/* START ABORTING THE TRANSACTION. ALSO START CHECKING THE */
/* REMAINING TRANSACTIONS. */
/*------------------------------------------------------------------*/
- terrorCode = ZTIME_OUT_ERROR;
+ terrorCode = errCode;
abortErrorLab(signal);
return;
case CS_COMMITTING:
@@ -6437,6 +6460,7 @@ void Dbtc::sendAbortedAfterTimeout(Signal* signal, int Tcheck)
return;
}
+ bool found = false;
OperationState tmp[16];
Uint32 TloopCount = 0;
@@ -6444,7 +6468,31 @@ void Dbtc::sendAbortedAfterTimeout(Signal* signal, int Tcheck)
jam();
if (tcConnectptr.i == RNIL) {
jam();
- if (Tcheck == 0) {
+
+#ifdef VM_TRACE
+ ndbout_c("found: %d Tcheck: %d apiConnectptr.p->counter: %d",
+ found, Tcheck, apiConnectptr.p->counter);
+#endif
+ if (found || apiConnectptr.p->counter)
+ {
+ jam();
+ /**
+ * We sent atleast one ABORT/ABORTED
+ * or ZABORT_TIMEOUT_BREAK is in job buffer
+ * wait for reception...
+ */
+ return;
+ }
+
+ if (Tcheck == 1)
+ {
+ jam();
+ releaseAbortResources(signal);
+ return;
+ }
+
+ if (Tcheck == 0)
+ {
jam();
/*------------------------------------------------------------------
* All nodes had already reported ABORTED for all tcConnect records.
@@ -6453,9 +6501,11 @@ void Dbtc::sendAbortedAfterTimeout(Signal* signal, int Tcheck)
*------------------------------------------------------------------*/
char buf[96]; buf[0] = 0;
char buf2[96];
- BaseString::snprintf(buf, sizeof(buf), "TC %d: %d ops:",
- __LINE__, apiConnectptr.i);
- for(Uint32 i = 0; i<TloopCount; i++){
+ BaseString::snprintf(buf, sizeof(buf), "TC %d: %d counter: %d ops:",
+ __LINE__, apiConnectptr.i,
+ apiConnectptr.p->counter);
+ for(Uint32 i = 0; i<TloopCount; i++)
+ {
BaseString::snprintf(buf2, sizeof(buf2), "%s %d", buf, tmp[i]);
BaseString::snprintf(buf, sizeof(buf), buf2);
}
@@ -6463,7 +6513,9 @@ void Dbtc::sendAbortedAfterTimeout(Signal* signal, int Tcheck)
ndbout_c(buf);
ndbrequire(false);
releaseAbortResources(signal);
+ return;
}
+
return;
}//if
TloopCount++;
@@ -6478,7 +6530,16 @@ void Dbtc::sendAbortedAfterTimeout(Signal* signal, int Tcheck)
signal->theData[0] = TcContinueB::ZABORT_TIMEOUT_BREAK;
signal->theData[1] = tcConnectptr.i;
signal->theData[2] = apiConnectptr.i;
- sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB);
+ if (ERROR_INSERTED(8050))
+ {
+ ndbout_c("sending ZABORT_TIMEOUT_BREAK delayed (%d %d)",
+ Tcheck, apiConnectptr.p->counter);
+ sendSignalWithDelay(cownref, GSN_CONTINUEB, signal, 2000, 3);
+ }
+ else
+ {
+ sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB);
+ }
return;
}//if
ptrCheckGuard(tcConnectptr, ctcConnectFilesize, tcConnectRecord);
@@ -6501,7 +6562,7 @@ void Dbtc::sendAbortedAfterTimeout(Signal* signal, int Tcheck)
jam();
if (tcConnectptr.p->tcNodedata[Ti] != 0) {
TloopCount += 31;
- Tcheck = 1;
+ found = true;
hostptr.i = tcConnectptr.p->tcNodedata[Ti];
ptrCheckGuard(hostptr, chostFilesize, hostRecord);
if (hostptr.p->hostStatus == HS_ALIVE) {
@@ -6874,58 +6935,44 @@ void Dbtc::execNODE_FAILREP(Signal* signal)
const Uint32 tnewMasterId = nodeFail->masterNodeId;
arrGuard(tnoOfNodes, MAX_NDB_NODES);
+ Uint32 i;
int index = 0;
- for (unsigned i = 1; i< MAX_NDB_NODES; i++) {
- if(NodeBitmask::get(nodeFail->theNodes, i)){
+ for (i = 1; i< MAX_NDB_NODES; i++)
+ {
+ if(NodeBitmask::get(nodeFail->theNodes, i))
+ {
cdata[index] = i;
index++;
}//if
}//for
+ cmasterNodeId = tnewMasterId;
+
tcNodeFailptr.i = 0;
ptrAss(tcNodeFailptr, tcFailRecord);
- Uint32 tindex;
- for (tindex = 0; tindex < tnoOfNodes; tindex++) {
+ for (i = 0; i < tnoOfNodes; i++)
+ {
jam();
- hostptr.i = cdata[tindex];
+ hostptr.i = cdata[i];
ptrCheckGuard(hostptr, chostFilesize, hostRecord);
+
/*------------------------------------------------------------*/
/* SET STATUS OF THE FAILED NODE TO DEAD SINCE IT HAS */
/* FAILED. */
/*------------------------------------------------------------*/
hostptr.p->hostStatus = HS_DEAD;
+ hostptr.p->m_nf_bits = HostRecord::NF_NODE_FAIL_BITS;
+ c_alive_nodes.clear(hostptr.i);
- if (hostptr.p->takeOverStatus == TOS_COMPLETED) {
- jam();
- /*------------------------------------------------------------*/
- /* A VERY UNUSUAL SITUATION. THE TAKE OVER WAS COMPLETED*/
- /* EVEN BEFORE WE HEARD ABOUT THE NODE FAILURE REPORT. */
- /* HOWEVER UNUSUAL THIS SITUATION IS POSSIBLE. */
- /*------------------------------------------------------------*/
- /* RELEASE THE CURRENTLY UNUSED LQH CONNECTIONS. THE */
- /* REMAINING WILL BE RELEASED WHEN THE TRANSACTION THAT */
- /* USED THEM IS COMPLETED. */
- /*------------------------------------------------------------*/
- {
- NFCompleteRep * const nfRep = (NFCompleteRep *)&signal->theData[0];
- nfRep->blockNo = DBTC;
- nfRep->nodeId = cownNodeid;
- nfRep->failedNodeId = hostptr.i;
- }
- sendSignal(cdihblockref, GSN_NF_COMPLETEREP, signal,
- NFCompleteRep::SignalLength, JBB);
- } else {
- ndbrequire(hostptr.p->takeOverStatus == TOS_IDLE);
- hostptr.p->takeOverStatus = TOS_NODE_FAILED;
- }//if
-
- if (tcNodeFailptr.p->failStatus == FS_LISTENING) {
+ if (tcNodeFailptr.p->failStatus == FS_LISTENING)
+ {
jam();
/*------------------------------------------------------------*/
/* THE CURRENT TAKE OVER CAN BE AFFECTED BY THIS NODE */
/* FAILURE. */
/*------------------------------------------------------------*/
- if (hostptr.p->lqhTransStatus == LTS_ACTIVE) {
+ if (hostptr.p->lqhTransStatus == LTS_ACTIVE)
+ {
jam();
/*------------------------------------------------------------*/
/* WE WERE WAITING FOR THE FAILED NODE IN THE TAKE OVER */
@@ -6937,86 +6984,46 @@ void Dbtc::execNODE_FAILREP(Signal* signal)
}//if
}//if
- }//for
-
- const bool masterFailed = (cmasterNodeId != tnewMasterId);
- cmasterNodeId = tnewMasterId;
-
- if(getOwnNodeId() == cmasterNodeId && masterFailed){
- /**
- * Master has failed and I'm the new master
- */
- jam();
-
- for (hostptr.i = 1; hostptr.i < MAX_NDB_NODES; hostptr.i++) {
+ if (getOwnNodeId() != tnewMasterId)
+ {
jam();
- ptrAss(hostptr, hostRecord);
- if (hostptr.p->hostStatus != HS_ALIVE) {
- jam();
- if (hostptr.p->takeOverStatus == TOS_COMPLETED) {
- jam();
- /*------------------------------------------------------------*/
- /* SEND TAKE OVER CONFIRMATION TO ALL ALIVE NODES IF */
- /* TAKE OVER IS COMPLETED. THIS IS PERFORMED TO ENSURE */
- /* THAT ALL NODES AGREE ON THE IDLE STATE OF THE TAKE */
- /* OVER. THIS MIGHT BE MISSED IN AN ERROR SITUATION IF */
- /* MASTER FAILS AFTER SENDING CONFIRMATION TO NEW */
- /* MASTER BUT FAILING BEFORE SENDING TO ANOTHER NODE */
- /* WHICH WAS NOT MASTER. IF THIS NODE LATER BECOMES */
- /* MASTER IT MIGHT START A NEW TAKE OVER EVEN AFTER THE */
- /* CRASHED NODE HAVE ALREADY RECOVERED. */
- /*------------------------------------------------------------*/
- for(tmpHostptr.i = 1; tmpHostptr.i < MAX_NDB_NODES;tmpHostptr.i++) {
- jam();
- ptrAss(tmpHostptr, hostRecord);
- if (tmpHostptr.p->hostStatus == HS_ALIVE) {
- jam();
- tblockref = calcTcBlockRef(tmpHostptr.i);
- signal->theData[0] = hostptr.i;
- sendSignal(tblockref, GSN_TAKE_OVERTCCONF, signal, 1, JBB);
- }//if
- }//for
- }//if
- }//if
- }//for
- }
-
- if(getOwnNodeId() == cmasterNodeId){
- jam();
- for (hostptr.i = 1; hostptr.i < MAX_NDB_NODES; hostptr.i++) {
+ /**
+ * Only master does takeover currently
+ */
+ hostptr.p->m_nf_bits &= ~HostRecord::NF_TAKEOVER;
+ }
+ else
+ {
jam();
- ptrAss(hostptr, hostRecord);
- if (hostptr.p->hostStatus != HS_ALIVE) {
- jam();
- if (hostptr.p->takeOverStatus == TOS_NODE_FAILED) {
- jam();
- /*------------------------------------------------------------*/
- /* CONCLUDE ALL ACTIVITIES THE FAILED TC DID CONTROL */
- /* SINCE WE ARE THE MASTER. THIS COULD HAVE BEEN STARTED*/
- /* BY A PREVIOUS MASTER BUT HAVE NOT BEEN CONCLUDED YET.*/
- /*------------------------------------------------------------*/
- hostptr.p->takeOverStatus = TOS_ACTIVE;
- signal->theData[0] = hostptr.i;
- sendSignal(cownref, GSN_TAKE_OVERTCREQ, signal, 1, JBB);
- }//if
- }//if
- }//for
- }//if
- for (tindex = 0; tindex < tnoOfNodes; tindex++) {
- jam();
- hostptr.i = cdata[tindex];
- ptrCheckGuard(hostptr, chostFilesize, hostRecord);
- /*------------------------------------------------------------*/
- /* LOOP THROUGH AND ABORT ALL SCANS THAT WHERE */
- /* CONTROLLED BY THIS TC AND ACTIVE IN THE FAILED */
- /* NODE'S LQH */
- /*------------------------------------------------------------*/
+ signal->theData[0] = hostptr.i;
+ sendSignal(cownref, GSN_TAKE_OVERTCREQ, signal, 1, JBB);
+ }
+
checkScanActiveInFailedLqh(signal, 0, hostptr.i);
checkWaitDropTabFailedLqh(signal, hostptr.i, 0); // nodeid, tableid
- }//for
-
+ nodeFailCheckTransactions(signal, 0, hostptr.i);
+ }
}//Dbtc::execNODE_FAILREP()
+void
+Dbtc::checkNodeFailComplete(Signal* signal,
+ Uint32 failedNodeId,
+ Uint32 bit)
+{
+ hostptr.i = failedNodeId;
+ ptrCheckGuard(hostptr, chostFilesize, hostRecord);
+ hostptr.p->m_nf_bits &= ~bit;
+ if (hostptr.p->m_nf_bits == 0)
+ {
+ NFCompleteRep * const nfRep = (NFCompleteRep *)&signal->theData[0];
+ nfRep->blockNo = DBTC;
+ nfRep->nodeId = cownNodeid;
+ nfRep->failedNodeId = hostptr.i;
+ sendSignal(cdihblockref, GSN_NF_COMPLETEREP, signal,
+ NFCompleteRep::SignalLength, JBB);
+ }
+}
+
void Dbtc::checkScanActiveInFailedLqh(Signal* signal,
Uint32 scanPtrI,
Uint32 failedNodeId){
@@ -7058,8 +7065,44 @@ void Dbtc::checkScanActiveInFailedLqh(Signal* signal,
sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB);
return;
}//for
+
+ checkNodeFailComplete(signal, failedNodeId, HostRecord::NF_CHECK_SCAN);
+}
+
+void
+Dbtc::nodeFailCheckTransactions(Signal* signal,
+ Uint32 transPtrI,
+ Uint32 failedNodeId)
+{
+ jam();
+ Ptr<ApiConnectRecord> transPtr;
+ for (transPtr.i = transPtrI; transPtr.i < capiConnectFilesize; transPtr.i++)
+ {
+ ptrCheckGuard(transPtr, capiConnectFilesize, apiConnectRecord);
+ if (transPtr.p->m_transaction_nodes.get(failedNodeId))
+ {
+ jam();
+ // Force timeout regardless of state
+ Uint32 save = c_appl_timeout_value;
+ c_appl_timeout_value = 1;
+ setApiConTimer(transPtr.i, 0, __LINE__);
+ timeOutFoundLab(signal, transPtr.i, ZNODEFAIL_BEFORE_COMMIT);
+ c_appl_timeout_value = save;
+ }
+
+ // Send CONTINUEB to continue later
+ signal->theData[0] = TcContinueB::ZNF_CHECK_TRANSACTIONS;
+ signal->theData[1] = transPtr.i + 1; // Check next
+ signal->theData[2] = failedNodeId;
+ sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB);
+ return;
+ }
+
+ checkNodeFailComplete(signal, failedNodeId,
+ HostRecord::NF_CHECK_TRANSACTION);
}
+
void
Dbtc::checkScanFragList(Signal* signal,
Uint32 failedNodeId,
@@ -7075,54 +7118,14 @@ void Dbtc::execTAKE_OVERTCCONF(Signal* signal)
tfailedNodeId = signal->theData[0];
hostptr.i = tfailedNodeId;
ptrCheckGuard(hostptr, chostFilesize, hostRecord);
- switch (hostptr.p->takeOverStatus) {
- case TOS_IDLE:
- jam();
- /*------------------------------------------------------------*/
- /* THIS MESSAGE ARRIVED EVEN BEFORE THE NODE_FAILREP */
- /* MESSAGE. THIS IS POSSIBLE IN EXTREME SITUATIONS. */
- /* WE SET THE STATE TO TAKE_OVER_COMPLETED AND WAIT */
- /* FOR THE NODE_FAILREP MESSAGE. */
- /*------------------------------------------------------------*/
- hostptr.p->takeOverStatus = TOS_COMPLETED;
- break;
- case TOS_NODE_FAILED:
- case TOS_ACTIVE:
- jam();
- /*------------------------------------------------------------*/
- /* WE ARE NOT MASTER AND THE TAKE OVER IS ACTIVE OR WE */
- /* ARE MASTER AND THE TAKE OVER IS ACTIVE. IN BOTH */
- /* WE SET THE STATE TO TAKE_OVER_COMPLETED. */
- /*------------------------------------------------------------*/
- /* RELEASE THE CURRENTLY UNUSED LQH CONNECTIONS. THE */
- /* REMAINING WILL BE RELEASED WHEN THE TRANSACTION THAT */
- /* USED THEM IS COMPLETED. */
- /*------------------------------------------------------------*/
- hostptr.p->takeOverStatus = TOS_COMPLETED;
- {
- NFCompleteRep * const nfRep = (NFCompleteRep *)&signal->theData[0];
- nfRep->blockNo = DBTC;
- nfRep->nodeId = cownNodeid;
- nfRep->failedNodeId = hostptr.i;
- }
- sendSignal(cdihblockref, GSN_NF_COMPLETEREP, signal,
- NFCompleteRep::SignalLength, JBB);
- break;
- case TOS_COMPLETED:
- jam();
- /*------------------------------------------------------------*/
- /* WE HAVE ALREADY RECEIVED THE CONF SIGNAL. IT IS MOST */
- /* LIKELY SENT FROM A NEW MASTER WHICH WASN'T SURE IF */
- /* THIS NODE HEARD THE CONF SIGNAL FROM THE OLD MASTER. */
- /* WE SIMPLY IGNORE THE MESSAGE. */
- /*------------------------------------------------------------*/
- /*empty*/;
- break;
- default:
+
+ if (signal->getSendersBlockRef() != reference())
+ {
jam();
- systemErrorLab(signal, __LINE__);
return;
- }//switch
+ }
+
+ checkNodeFailComplete(signal, hostptr.i, HostRecord::NF_TAKEOVER);
}//Dbtc::execTAKE_OVERTCCONF()
void Dbtc::execTAKE_OVERTCREQ(Signal* signal)
@@ -7362,16 +7365,10 @@ void Dbtc::completeTransAtTakeOverDoLast(Signal* signal, UintR TtakeOverInd)
/* TO REPORT THE COMPLETION OF THE TAKE OVER TO ALL */
/* NODES THAT ARE ALIVE. */
/*------------------------------------------------------------*/
- for (hostptr.i = 1; hostptr.i < MAX_NDB_NODES; hostptr.i++) {
- jam();
- ptrAss(hostptr, hostRecord);
- if (hostptr.p->hostStatus == HS_ALIVE) {
- jam();
- tblockref = calcTcBlockRef(hostptr.i);
- signal->theData[0] = tcNodeFailptr.p->takeOverNode;
- sendSignal(tblockref, GSN_TAKE_OVERTCCONF, signal, 1, JBB);
- }//if
- }//for
+ NodeReceiverGroup rg(DBTC, c_alive_nodes);
+ signal->theData[0] = tcNodeFailptr.p->takeOverNode;
+ sendSignal(rg, GSN_TAKE_OVERTCCONF, signal, 1, JBB);
+
if (tcNodeFailptr.p->queueIndex > 0) {
jam();
/*------------------------------------------------------------*/
@@ -8053,6 +8050,7 @@ void Dbtc::initApiConnectFail(Signal* signal)
apiConnectptr.p->ndbapiBlockref = 0;
apiConnectptr.p->ndbapiConnect = 0;
apiConnectptr.p->buddyPtr = RNIL;
+ apiConnectptr.p->m_transaction_nodes.clear();
setApiConTimer(apiConnectptr.i, 0, __LINE__);
switch(ttransStatus){
case LqhTransConf::Committed:
@@ -9886,6 +9884,7 @@ void Dbtc::initApiConnect(Signal* signal)
apiConnectptr.p->executingIndexOp = RNIL;
apiConnectptr.p->buddyPtr = RNIL;
apiConnectptr.p->currSavePointId = 0;
+ apiConnectptr.p->m_transaction_nodes.clear();
}//for
apiConnectptr.i = tiacTmp - 1;
ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord);
@@ -9913,6 +9912,7 @@ void Dbtc::initApiConnect(Signal* signal)
apiConnectptr.p->executingIndexOp = RNIL;
apiConnectptr.p->buddyPtr = RNIL;
apiConnectptr.p->currSavePointId = 0;
+ apiConnectptr.p->m_transaction_nodes.clear();
}//for
apiConnectptr.i = (2 * tiacTmp) - 1;
ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord);
@@ -9940,6 +9940,7 @@ void Dbtc::initApiConnect(Signal* signal)
apiConnectptr.p->executingIndexOp = RNIL;
apiConnectptr.p->buddyPtr = RNIL;
apiConnectptr.p->currSavePointId = 0;
+ apiConnectptr.p->m_transaction_nodes.clear();
}//for
apiConnectptr.i = (3 * tiacTmp) - 1;
ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord);
@@ -10000,13 +10001,13 @@ void Dbtc::inithost(Signal* signal)
ptrAss(hostptr, hostRecord);
hostptr.p->hostStatus = HS_DEAD;
hostptr.p->inPackedList = false;
- hostptr.p->takeOverStatus = TOS_NOT_DEFINED;
hostptr.p->lqhTransStatus = LTS_IDLE;
hostptr.p->noOfWordsTCKEYCONF = 0;
hostptr.p->noOfWordsTCINDXCONF = 0;
hostptr.p->noOfPackedWordsLqh = 0;
hostptr.p->hostLqhBlockRef = calcLqhBlockRef(hostptr.i);
}//for
+ c_alive_nodes.clear();
}//Dbtc::inithost()
void Dbtc::initialiseRecordsLab(Signal* signal, UintR Tdata0,
@@ -10260,6 +10261,7 @@ void Dbtc::releaseAbortResources(Signal* signal)
}//while
apiConnectptr.p->firstTcConnect = RNIL;
apiConnectptr.p->lastTcConnect = RNIL;
+ apiConnectptr.p->m_transaction_nodes.clear();
// MASV let state be CS_ABORTING until all
// signals in the "air" have been received. Reset to CS_CONNECTED
@@ -10333,6 +10335,7 @@ void Dbtc::releaseApiCon(Signal* signal, UintR TapiConnectPtr)
cfirstfreeApiConnect = TlocalApiConnectptr.i;
setApiConTimer(TlocalApiConnectptr.i, 0, __LINE__);
TlocalApiConnectptr.p->apiConnectstate = CS_DISCONNECTED;
+ ndbassert(TlocalApiConnectptr.p->m_transaction_nodes.isclear());
ndbassert(TlocalApiConnectptr.p->apiScanRec == RNIL);
TlocalApiConnectptr.p->ndbapiBlockref = 0;
}//Dbtc::releaseApiCon()
@@ -10868,6 +10871,34 @@ Dbtc::execDUMP_STATE_ORD(Signal* signal)
c_theIndexOperationPool.getSize(),
c_theIndexOperationPool.getNoOfFree());
}
+
+ if (dumpState->args[0] == 2514)
+ {
+ if (signal->getLength() == 2)
+ {
+ dumpState->args[0] = DumpStateOrd::TcDumpOneApiConnectRec;
+ execDUMP_STATE_ORD(signal);
+ }
+
+ NodeReceiverGroup rg(CMVMI, c_alive_nodes);
+ dumpState->args[0] = 15;
+ sendSignal(rg, GSN_DUMP_STATE_ORD, signal, 1, JBB);
+
+ signal->theData[0] = 2515;
+ sendSignalWithDelay(cownref, GSN_DUMP_STATE_ORD, signal, 1000, 1);
+ return;
+ }
+
+ if (dumpState->args[0] == 2515)
+ {
+ NdbNodeBitmask mask = c_alive_nodes;
+ mask.clear(getOwnNodeId());
+ NodeReceiverGroup rg(NDBCNTR, mask);
+
+ sendSignal(rg, GSN_SYSTEM_ERROR, signal, 1, JBB);
+ sendSignalWithDelay(cownref, GSN_SYSTEM_ERROR, signal, 300, 1);
+ return;
+ }
}//Dbtc::execDUMP_STATE_ORD()
void Dbtc::execSET_VAR_REQ(Signal* signal)
diff --git a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
index 04e02a9e9ae..69447745757 100644
--- a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
+++ b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
@@ -278,6 +278,7 @@ void Qmgr::setArbitTimeout(UintR aArbitTimeout)
void Qmgr::execCONNECT_REP(Signal* signal)
{
+ jamEntry();
const Uint32 nodeId = signal->theData[0];
c_connectedNodes.set(nodeId);
NodeRecPtr nodePtr;
@@ -285,9 +286,13 @@ void Qmgr::execCONNECT_REP(Signal* signal)
ptrCheckGuard(nodePtr, MAX_NODES, nodeRec);
switch(nodePtr.p->phase){
case ZSTARTING:
+ case ZRUNNING:
jam();
+ if(!c_start.m_nodes.isWaitingFor(nodeId)){
+ jam();
+ return;
+ }
break;
- case ZRUNNING:
case ZPREPARE_FAIL:
case ZFAIL_CLOSING:
jam();
@@ -298,21 +303,28 @@ void Qmgr::execCONNECT_REP(Signal* signal)
case ZAPI_INACTIVE:
return;
}
-
- if(!c_start.m_nodes.isWaitingFor(nodeId)){
- jam();
- return;
- }
-
+
switch(c_start.m_gsn){
case GSN_CM_REGREQ:
jam();
sendCmRegReq(signal, nodeId);
return;
- case GSN_CM_NODEINFOREQ:{
+ case GSN_CM_NODEINFOREQ:
jam();
sendCmNodeInfoReq(signal, nodeId, nodePtr.p);
return;
+ case GSN_CM_ADD:{
+ jam();
+
+ ndbrequire(getOwnNodeId() != cpresident);
+ c_start.m_nodes.clearWaitingFor(nodeId);
+ c_start.m_gsn = RNIL;
+
+ NodeRecPtr addNodePtr;
+ addNodePtr.i = nodeId;
+ ptrCheckGuard(addNodePtr, MAX_NDB_NODES, nodeRec);
+ cmAddPrepare(signal, addNodePtr, nodePtr.p);
+ return;
}
default:
return;
@@ -945,15 +957,27 @@ Qmgr::cmAddPrepare(Signal* signal, NodeRecPtr nodePtr, const NodeRec * self){
return;
case ZFAIL_CLOSING:
jam();
-#ifdef VM_TRACE
- ndbout_c("Enabling communication to CM_ADD node state=%d",
- nodePtr.p->phase);
-#endif
+
+#if 1
+ warningEvent("Recieved request to incorperate node %u, "
+ "while error handling has not yet completed",
+ nodePtr.i);
+
+ ndbrequire(getOwnNodeId() != cpresident);
+ ndbrequire(signal->header.theVerId_signalNumber == GSN_CM_ADD);
+ c_start.m_nodes.clearWaitingFor();
+ c_start.m_nodes.setWaitingFor(nodePtr.i);
+ c_start.m_gsn = GSN_CM_ADD;
+#else
+ warningEvent("Enabling communication to CM_ADD node %u state=%d",
+ nodePtr.i,
+ nodePtr.p->phase);
nodePtr.p->phase = ZSTARTING;
nodePtr.p->failState = NORMAL;
signal->theData[0] = 0;
signal->theData[1] = nodePtr.i;
sendSignal(CMVMI_REF, GSN_OPEN_COMREQ, signal, 2, JBA);
+#endif
return;
case ZSTARTING:
break;
@@ -1788,11 +1812,27 @@ void Qmgr::execNDB_FAILCONF(Signal* signal)
jamEntry();
failedNodePtr.i = signal->theData[0];
+
+ if (ERROR_INSERTED(930))
+ {
+ CLEAR_ERROR_INSERT_VALUE;
+ infoEvent("Discarding NDB_FAILCONF for %u", failedNodePtr.i);
+ return;
+ }
+
ptrCheckGuard(failedNodePtr, MAX_NODES, nodeRec);
if (failedNodePtr.p->failState == WAITING_FOR_NDB_FAILCONF){
failedNodePtr.p->failState = NORMAL;
} else {
jam();
+
+ char buf[100];
+ BaseString::snprintf(buf, 100,
+ "Received NDB_FAILCONF for node %u with state: %d %d",
+ failedNodePtr.i,
+ failedNodePtr.p->phase,
+ failedNodePtr.p->failState);
+ progError(__LINE__, 0, buf);
systemErrorLab(signal, __LINE__);
}//if
if (cpresident == getOwnNodeId()) {
@@ -2115,10 +2155,42 @@ void Qmgr::failReportLab(Signal* signal, Uint16 aFailedNode,
ptrCheckGuard(failedNodePtr, MAX_NODES, nodeRec);
if (failedNodePtr.i == getOwnNodeId()) {
jam();
- systemErrorLab(signal, __LINE__);
+
+ const char * msg = 0;
+ switch(aFailCause){
+ case FailRep::ZOWN_FAILURE:
+ msg = "Own failure";
+ break;
+ case FailRep::ZOTHER_NODE_WHEN_WE_START:
+ case FailRep::ZOTHERNODE_FAILED_DURING_START:
+ msg = "Other node died during start";
+ break;
+ case FailRep::ZIN_PREP_FAIL_REQ:
+ msg = "Prep fail";
+ break;
+ case FailRep::ZSTART_IN_REGREQ:
+ msg = "Start timeout";
+ break;
+ case FailRep::ZHEARTBEAT_FAILURE:
+ msg = "Hearbeat failure";
+ break;
+ case FailRep::ZLINK_FAILURE:
+ msg = "Connection failure";
+ break;
+ }
+
+ char buf[100];
+ BaseString::snprintf(buf, 100,
+ "We(%u) have been declared dead by %u reason: %s(%u)",
+ getOwnNodeId(),
+ refToNode(signal->getSendersBlockRef()),
+ aFailCause,
+ msg ? msg : "<Unknown>");
+
+ progError(__LINE__, 0, buf);
return;
}//if
-
+
myNodePtr.i = getOwnNodeId();
ptrCheckGuard(myNodePtr, MAX_NDB_NODES, nodeRec);
if (myNodePtr.p->phase != ZRUNNING) {
@@ -2829,6 +2901,7 @@ void Qmgr::failReport(Signal* signal,
cfailureNr = cprepareFailureNr;
ctoFailureNr = 0;
ctoStatus = Q_ACTIVE;
+ c_start.reset(); // Don't take over nodes being started
if (cnoCommitFailedNodes > 0) {
jam();
/**-----------------------------------------------------------------
diff --git a/storage/ndb/src/kernel/blocks/suma/Suma.cpp b/storage/ndb/src/kernel/blocks/suma/Suma.cpp
index ccb8759c18a..867b13e1e40 100644
--- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp
@@ -1040,6 +1040,15 @@ Suma::execSUB_CREATE_REQ(Signal* signal)
const Uint32 reportSubscribe = (flags & SubCreateReq::ReportSubscribe) ?
Subscription::REPORT_SUBSCRIBE : 0;
const Uint32 tableId = req.tableId;
+ Subscription::State state = (Subscription::State) req.state;
+ if (signal->getLength() != SubCreateReq::SignalLength2)
+ {
+ /*
+ api or restarted by older version
+ if restarted by old version, do the best we can
+ */
+ state = Subscription::DEFINED;
+ }
Subscription key;
key.m_subscriptionId = subId;
@@ -1067,6 +1076,17 @@ Suma::execSUB_CREATE_REQ(Signal* signal)
addTableId(req.tableId, subPtr, 0);
}
} else {
+ if (c_startup.m_restart_server_node_id &&
+ refToNode(subRef) != c_startup.m_restart_server_node_id)
+ {
+ /**
+ * only allow "restart_server" Suma's to come through
+ * for restart purposes
+ */
+ jam();
+ sendSubStartRef(signal, 1405);
+ DBUG_VOID_RETURN;
+ }
// Check that id/key is unique
if(c_subscriptions.find(subPtr, key)) {
jam();
@@ -1090,7 +1110,7 @@ Suma::execSUB_CREATE_REQ(Signal* signal)
subPtr.p->m_options = reportSubscribe | reportAll;
subPtr.p->m_tableId = tableId;
subPtr.p->m_table_ptrI = RNIL;
- subPtr.p->m_state = Subscription::DEFINED;
+ subPtr.p->m_state = state;
subPtr.p->n_subscribers = 0;
subPtr.p->m_current_sync_ptrI = RNIL;
@@ -1446,7 +1466,9 @@ Suma::completeOneSubscriber(Signal *signal, TablePtr tabPtr, SubscriberPtr subbP
jam();
DBUG_ENTER("Suma::completeOneSubscriber");
- if (tabPtr.p->m_error)
+ if (tabPtr.p->m_error &&
+ (c_startup.m_restart_server_node_id == 0 ||
+ tabPtr.p->m_state != Table::DROPPED))
{
sendSubStartRef(signal,subbPtr,tabPtr.p->m_error,
SubscriptionData::TableData);
@@ -1531,8 +1553,44 @@ Suma::completeInitTable(Signal *signal, TablePtr tabPtr)
void
Suma::execGET_TABINFOREF(Signal* signal){
jamEntry();
- /* ToDo handle this */
- ndbrequire(false);
+ GetTabInfoRef* ref = (GetTabInfoRef*)signal->getDataPtr();
+ Uint32 tableId = ref->tableId;
+ Uint32 senderData = ref->senderData;
+ GetTabInfoRef::ErrorCode errorCode =
+ (GetTabInfoRef::ErrorCode) ref->errorCode;
+ int do_resend_request = 0;
+ TablePtr tabPtr;
+ c_tablePool.getPtr(tabPtr, senderData);
+ switch (errorCode)
+ {
+ case GetTabInfoRef::TableNotDefined:
+ // wrong state
+ break;
+ case GetTabInfoRef::InvalidTableId:
+ // no such table
+ break;
+ case GetTabInfoRef::Busy:
+ do_resend_request = 1;
+ break;
+ case GetTabInfoRef::TableNameTooLong:
+ ndbrequire(false);
+ }
+ if (do_resend_request)
+ {
+ GetTabInfoReq * req = (GetTabInfoReq *)signal->getDataPtrSend();
+ req->senderRef = reference();
+ req->senderData = senderData;
+ req->requestType =
+ GetTabInfoReq::RequestById | GetTabInfoReq::LongSignalConf;
+ req->tableId = tableId;
+ sendSignalWithDelay(DBDICT_REF, GSN_GET_TABINFOREQ, signal,
+ 30, GetTabInfoReq::SignalLength);
+ return;
+ }
+ tabPtr.p->m_state = Table::DROPPED;
+ tabPtr.p->m_error = errorCode;
+ completeAllSubscribers(signal, tabPtr);
+ completeInitTable(signal, tabPtr);
}
void
@@ -2153,7 +2211,7 @@ Suma::execSUB_START_REQ(Signal* signal){
Subscription key;
key.m_subscriptionId = req->subscriptionId;
key.m_subscriptionKey = req->subscriptionKey;
-
+
if (c_startup.m_restart_server_node_id &&
refToNode(senderRef) != c_startup.m_restart_server_node_id)
{
@@ -2173,13 +2231,24 @@ Suma::execSUB_START_REQ(Signal* signal){
DBUG_VOID_RETURN;
}
- if (subPtr.p->m_state != Subscription::DEFINED) {
+ if (subPtr.p->m_state == Subscription::LOCKED) {
jam();
DBUG_PRINT("info",("Locked"));
sendSubStartRef(signal, 1411);
DBUG_VOID_RETURN;
}
+ if (subPtr.p->m_state == Subscription::DROPPED &&
+ c_startup.m_restart_server_node_id == 0) {
+ jam();
+ DBUG_PRINT("info",("Dropped"));
+ sendSubStartRef(signal, 1418);
+ DBUG_VOID_RETURN;
+ }
+
+ ndbrequire(subPtr.p->m_state == Subscription::DEFINED ||
+ c_startup.m_restart_server_node_id);
+
SubscriberPtr subbPtr;
if(!c_subscriberPool.seize(subbPtr)){
jam();
@@ -2193,7 +2262,8 @@ Suma::execSUB_START_REQ(Signal* signal){
c_subscriber_nodes.set(refToNode(subscriberRef));
// setup subscription record
- subPtr.p->m_state = Subscription::LOCKED;
+ if (subPtr.p->m_state == Subscription::DEFINED)
+ subPtr.p->m_state = Subscription::LOCKED;
// store these here for later use
subPtr.p->m_senderRef = senderRef;
subPtr.p->m_senderData = senderData;
@@ -2241,8 +2311,14 @@ Suma::sendSubStartComplete(Signal* signal,
SubscriptionPtr subPtr;
c_subscriptions.getPtr(subPtr, subbPtr.p->m_subPtrI);
- ndbrequire( subPtr.p->m_state == Subscription::LOCKED )
- subPtr.p->m_state = Subscription::DEFINED;
+ ndbrequire(subPtr.p->m_state == Subscription::LOCKED ||
+ (subPtr.p->m_state == Subscription::DROPPED &&
+ c_startup.m_restart_server_node_id));
+ if (subPtr.p->m_state == Subscription::LOCKED)
+ {
+ jam();
+ subPtr.p->m_state = Subscription::DEFINED;
+ }
subPtr.p->n_subscribers++;
DBUG_PRINT("info",("subscriber: %u[%u,%u] subscription: %u[%u,%u] "
@@ -2293,8 +2369,14 @@ Suma::sendSubStartRef(Signal* signal,
SubscriptionPtr subPtr;
c_subscriptions.getPtr(subPtr, subbPtr.p->m_subPtrI);
- ndbrequire( subPtr.p->m_state == Subscription::LOCKED );
- subPtr.p->m_state = Subscription::DEFINED;
+ ndbrequire(subPtr.p->m_state == Subscription::LOCKED ||
+ (subPtr.p->m_state == Subscription::DROPPED &&
+ c_startup.m_restart_server_node_id));
+ if (subPtr.p->m_state == Subscription::LOCKED)
+ {
+ jam();
+ subPtr.p->m_state = Subscription::DEFINED;
+ }
SubStartRef * ref= (SubStartRef *)signal->getDataPtrSend();
ref->senderRef = reference();
@@ -2360,6 +2442,18 @@ Suma::execSUB_STOP_REQ(Signal* signal){
DBUG_VOID_RETURN;
}
+ if (c_startup.m_restart_server_node_id &&
+ refToNode(senderRef) != c_startup.m_restart_server_node_id)
+ {
+ /**
+ * only allow "restart_server" Suma's to come through
+ * for restart purposes
+ */
+ jam();
+ sendSubStopRef(signal, 1405);
+ DBUG_VOID_RETURN;
+ }
+
if (subPtr.p->m_state == Subscription::LOCKED) {
jam();
DBUG_PRINT("error", ("locked"));
@@ -3668,7 +3762,17 @@ Suma::execSUB_REMOVE_REQ(Signal* signal)
sendSubRemoveRef(signal, req, 1413);
DBUG_VOID_RETURN;
}
-
+ if (subPtr.p->m_state == Subscription::DROPPED)
+ {
+ /**
+ * already dropped
+ */
+ jam();
+ sendSubRemoveRef(signal, req, 1419);
+ DBUG_VOID_RETURN;
+ }
+
+ ndbrequire(subPtr.p->m_state == Subscription::DEFINED);
DBUG_PRINT("info",("n_subscribers: %u", subPtr.p->n_subscribers));
if (subPtr.p->n_subscribers == 0)
@@ -3981,8 +4085,9 @@ Suma::Restart::nextSubscription(Signal* signal, Uint32 sumaRef)
case SubCreateReq::TableEvent:
jam();
req->tableId = subPtr.p->m_tableId;
+ req->state = subPtr.p->m_state;
suma.sendSignal(sumaRef, GSN_SUB_CREATE_REQ, signal,
- SubCreateReq::SignalLength, JBB);
+ SubCreateReq::SignalLength2, JBB);
DBUG_VOID_RETURN;
case SubCreateReq::SingleTableScan:
jam();
diff --git a/storage/ndb/src/kernel/error/ndbd_exit_codes.c b/storage/ndb/src/kernel/error/ndbd_exit_codes.c
index 9b8c907cb7c..6a14d8b7ffd 100644
--- a/storage/ndb/src/kernel/error/ndbd_exit_codes.c
+++ b/storage/ndb/src/kernel/error/ndbd_exit_codes.c
@@ -85,6 +85,9 @@ static const ErrStruct errArray[] =
*/
{NDBD_EXIT_OS_SIGNAL_RECEIVED, XIE, "Error OS signal received"},
+ {NDBD_EXIT_SR_RESTARTCONFLICT, XRE,
+ "Partial system restart causing conflicting file systems"},
+
/* VM */
{NDBD_EXIT_OUT_OF_LONG_SIGNAL_MEMORY, XCR,
"Signal lost, out of long signal memory, please increase LongMessageBuffer"},
diff --git a/storage/ndb/src/kernel/vm/DLFifoList.hpp b/storage/ndb/src/kernel/vm/DLFifoList.hpp
index 2a10c0303ea..ff833aa5723 100644
--- a/storage/ndb/src/kernel/vm/DLFifoList.hpp
+++ b/storage/ndb/src/kernel/vm/DLFifoList.hpp
@@ -312,15 +312,16 @@ inline
void
DLFifoListImpl<P,T,U>::release()
{
- Ptr<T> p;
- while(head.firstItem != RNIL)
+ Ptr<T> ptr;
+ Uint32 curr = head.firstItem;
+ while(curr != RNIL)
{
- p.i = head.firstItem;
- p.p = thePool.getPtr(head.firstItem);
- T * t = p.p;
- head.firstItem = t->U::nextList;
- release(p);
+ thePool.getPtr(ptr, curr);
+ curr = ptr.p->U::nextList;
+ thePool.release(ptr);
}
+ head.firstItem = RNIL;
+ head.lastItem = RNIL;
}
template <typename P, typename T, typename U>
diff --git a/storage/ndb/src/kernel/vm/DLList.hpp b/storage/ndb/src/kernel/vm/DLList.hpp
index 26c660cd582..effc2a1bb1d 100644
--- a/storage/ndb/src/kernel/vm/DLList.hpp
+++ b/storage/ndb/src/kernel/vm/DLList.hpp
@@ -332,13 +332,15 @@ void
DLListImpl<P,T,U>::release()
{
Ptr<T> ptr;
- while((ptr.i = head.firstItem) != RNIL)
+ Uint32 curr = head.firstItem;
+ while(curr != RNIL)
{
- thePool.getPtr(ptr);
- head.firstItem = ptr.p->U::nextList;
+ thePool.getPtr(ptr, curr);
+ curr = ptr.p->U::nextList;
thePool.release(ptr);
}
-}
+ head.firstItem = RNIL;
+}
template <typename P, typename T, typename U>
inline
diff --git a/storage/ndb/src/kernel/vm/Pool.hpp b/storage/ndb/src/kernel/vm/Pool.hpp
index f4149c7da65..9ac6ea2fb46 100644
--- a/storage/ndb/src/kernel/vm/Pool.hpp
+++ b/storage/ndb/src/kernel/vm/Pool.hpp
@@ -197,7 +197,7 @@ public:
/**
* Return an object to pool
*/
- void release(Ptr<T> &);
+ void release(Ptr<T>);
private:
P m_pool;
};
@@ -213,10 +213,15 @@ inline
void
RecordPool<T, P>::init(Uint32 type_id, const Pool_context& pc)
{
+ T tmp;
+ const char * off_base = (char*)&tmp;
+ const char * off_next = (char*)&tmp.nextPool;
+ const char * off_magic = (char*)&tmp.m_magic;
+
Record_info ri;
ri.m_size = sizeof(T);
- ri.m_offset_next_pool = offsetof(T, nextPool);
- ri.m_offset_magic = offsetof(T, m_magic);
+ ri.m_offset_next_pool = Uint32(off_next - off_base);
+ ri.m_offset_magic = Uint32(off_magic - off_base);
ri.m_type_id = type_id;
m_pool.init(ri, pc);
}
@@ -226,10 +231,14 @@ inline
void
RecordPool<T, P>::wo_pool_init(Uint32 type_id, const Pool_context& pc)
{
+ T tmp;
+ const char * off_base = (char*)&tmp;
+ const char * off_magic = (char*)&tmp.m_magic;
+
Record_info ri;
ri.m_size = sizeof(T);
ri.m_offset_next_pool = 0;
- ri.m_offset_magic = offsetof(T, m_magic);
+ ri.m_offset_magic = Uint32(off_magic - off_base);
ri.m_type_id = type_id;
m_pool.init(ri, pc);
}
@@ -313,7 +322,7 @@ RecordPool<T, P>::release(Uint32 i)
template <typename T, typename P>
inline
void
-RecordPool<T, P>::release(Ptr<T> & ptr)
+RecordPool<T, P>::release(Ptr<T> ptr)
{
m_pool.release(*(Ptr<void>*)&ptr);
}
diff --git a/storage/ndb/src/kernel/vm/SLList.hpp b/storage/ndb/src/kernel/vm/SLList.hpp
index 5fabe981edd..35845612677 100644
--- a/storage/ndb/src/kernel/vm/SLList.hpp
+++ b/storage/ndb/src/kernel/vm/SLList.hpp
@@ -302,13 +302,15 @@ void
SLListImpl<P, T, U>::release()
{
Ptr<T> ptr;
- while((ptr.i = head.firstItem) != RNIL)
+ Uint32 curr = head.firstItem;
+ while(curr != RNIL)
{
- thePool.getPtr(ptr);
- head.firstItem = ptr.p->U::nextList;
+ thePool.getPtr(ptr, curr);
+ curr = ptr.p->U::nextList;
thePool.release(ptr);
}
-}
+ head.firstItem = RNIL;
+}
template <typename P, typename T, typename U>
inline
diff --git a/storage/ndb/src/kernel/vm/TransporterCallback.cpp b/storage/ndb/src/kernel/vm/TransporterCallback.cpp
index aab81957d07..f315918b871 100644
--- a/storage/ndb/src/kernel/vm/TransporterCallback.cpp
+++ b/storage/ndb/src/kernel/vm/TransporterCallback.cpp
@@ -55,7 +55,9 @@ static const ConnectionError connectionError[] =
const char *lookupConnectionError(Uint32 err)
{
int i= 0;
- while ((Uint32)connectionError[i].err != err && (Uint32)connectionError[i].err != -1);
+ while ((Uint32)connectionError[i].err != err &&
+ (Uint32)connectionError[i].err != -1)
+ i++;
return connectionError[i].text;
}
diff --git a/storage/ndb/src/ndbapi/ClusterMgr.hpp b/storage/ndb/src/ndbapi/ClusterMgr.hpp
index eacdac9512e..31682885f90 100644
--- a/storage/ndb/src/ndbapi/ClusterMgr.hpp
+++ b/storage/ndb/src/ndbapi/ClusterMgr.hpp
@@ -179,6 +179,8 @@ private:
ArbitSignalData data;
NDB_TICKS timestamp;
+ ArbitSignal() {}
+
inline void init(GlobalSignalNumber aGsn, const Uint32* aData) {
gsn = aGsn;
if (aData != NULL)
diff --git a/storage/ndb/src/ndbapi/NdbBlob.cpp b/storage/ndb/src/ndbapi/NdbBlob.cpp
index 2b655a3dc0e..2adb928ba42 100644
--- a/storage/ndb/src/ndbapi/NdbBlob.cpp
+++ b/storage/ndb/src/ndbapi/NdbBlob.cpp
@@ -195,8 +195,9 @@ NdbBlob::getBlobEvent(NdbEventImpl& be, const NdbEventImpl* e, const NdbColumnIm
assert(c->m_blobTable != NULL);
const NdbTableImpl& bt = *c->m_blobTable;
// blob event name
- char bename[NdbBlobImpl::BlobTableNameSize];
+ char bename[MAX_TAB_NAME_SIZE+1];
getBlobEventName(bename, e, c);
+ bename[sizeof(bename)-1]= 0;
be.setName(bename);
be.setTable(bt);
// simple assigments
diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
index 044ac58ade1..bffc2174be5 100644
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
@@ -51,6 +51,7 @@ struct EventBufData
EventBufData *m_next_hash; // Next in per-GCI hash
Uint32 m_pkhash; // PK hash (without op) for fast compare
+ EventBufData() {}
// Get blob part number from blob data
Uint32 get_blob_part_no() {
assert(ptr[0].sz > 2);
diff --git a/storage/ndb/src/ndbapi/NdbIndexOperation.cpp b/storage/ndb/src/ndbapi/NdbIndexOperation.cpp
index 250af162262..39dbab423d3 100644
--- a/storage/ndb/src/ndbapi/NdbIndexOperation.cpp
+++ b/storage/ndb/src/ndbapi/NdbIndexOperation.cpp
@@ -26,7 +26,7 @@
#include <signaldata/IndxAttrInfo.hpp>
NdbIndexOperation::NdbIndexOperation(Ndb* aNdb) :
- NdbOperation(aNdb),
+ NdbOperation(aNdb, NdbOperation::UniqueIndexAccess),
m_theIndex(NULL)
{
m_tcReqGSN = GSN_TCINDXREQ;
@@ -164,6 +164,12 @@ int NdbIndexOperation::interpretedDeleteTuple()
return NdbOperation::interpretedDeleteTuple();
}
+const NdbDictionary::Index*
+NdbIndexOperation::getIndex() const
+{
+ return m_theIndex;
+}
+
int
NdbIndexOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransactionId)
{
diff --git a/storage/ndb/src/ndbapi/NdbOperation.cpp b/storage/ndb/src/ndbapi/NdbOperation.cpp
index c88b3a5e6ac..769ce0662ef 100644
--- a/storage/ndb/src/ndbapi/NdbOperation.cpp
+++ b/storage/ndb/src/ndbapi/NdbOperation.cpp
@@ -37,7 +37,8 @@
* aTable: Pointers to the Table object
* Remark: Creat an object of NdbOperation.
****************************************************************************/
-NdbOperation::NdbOperation(Ndb* aNdb) :
+NdbOperation::NdbOperation(Ndb* aNdb, NdbOperation::Type aType) :
+ m_type(aType),
theReceiver(aNdb),
theErrorLine(0),
theNdb(aNdb),
diff --git a/storage/ndb/src/ndbapi/NdbScanOperation.cpp b/storage/ndb/src/ndbapi/NdbScanOperation.cpp
index c841a371af9..ea7fbe4077d 100644
--- a/storage/ndb/src/ndbapi/NdbScanOperation.cpp
+++ b/storage/ndb/src/ndbapi/NdbScanOperation.cpp
@@ -37,8 +37,8 @@
#define DEBUG_NEXT_RESULT 0
-NdbScanOperation::NdbScanOperation(Ndb* aNdb) :
- NdbOperation(aNdb),
+NdbScanOperation::NdbScanOperation(Ndb* aNdb, NdbOperation::Type aType) :
+ NdbOperation(aNdb, aType),
m_transConnection(NULL)
{
theParallelism = 0;
@@ -169,7 +169,7 @@ NdbScanOperation::readTuples(NdbScanOperation::LockMode lm,
{ char* p = getenv("NDB_USE_TUPSCAN");
if (p != 0) {
unsigned n = atoi(p); // 0-10
- if (::time(0) % 10 < n) tupScan = true;
+ if ((unsigned int) (::time(0) % 10) < n) tupScan = true;
}
}
#endif
@@ -1032,7 +1032,7 @@ NdbScanOperation::getBlobHandle(Uint32 anAttrId)
}
NdbIndexScanOperation::NdbIndexScanOperation(Ndb* aNdb)
- : NdbScanOperation(aNdb)
+ : NdbScanOperation(aNdb, NdbOperation::OrderedIndexScan)
{
}
diff --git a/storage/ndb/src/ndbapi/NdbTransaction.cpp b/storage/ndb/src/ndbapi/NdbTransaction.cpp
index f309c448fd3..3d98dea7edc 100644
--- a/storage/ndb/src/ndbapi/NdbTransaction.cpp
+++ b/storage/ndb/src/ndbapi/NdbTransaction.cpp
@@ -434,12 +434,12 @@ NdbTransaction::executeNoBlobs(ExecType aTypeOfExec,
//------------------------------------------------------------------------
Ndb* tNdb = theNdb;
+ Uint32 timeout = theNdb->theImpl->m_transporter_facade->m_waitfor_timeout;
m_waitForReply = false;
executeAsynchPrepare(aTypeOfExec, NULL, NULL, abortOption);
if (m_waitForReply){
while (1) {
- int noOfComp = tNdb->sendPollNdb((3 * WAITFOR_RESPONSE_TIMEOUT),
- 1, forceSend);
+ int noOfComp = tNdb->sendPollNdb(3 * timeout, 1, forceSend);
if (noOfComp == 0) {
/**
* This timeout situation can occur if NDB crashes.
@@ -1193,6 +1193,8 @@ NdbTransaction::getNdbIndexScanOperation(const NdbIndexImpl* index,
{
tOp->m_currentTable = table;
}
+ // Mark that this really an NdbIndexScanOperation
+ tOp->m_type = NdbOperation::OrderedIndexScan;
return tOp;
} else {
setOperationErrorCodeAbort(4271);
@@ -1254,6 +1256,8 @@ NdbTransaction::getNdbScanOperation(const NdbTableImpl * tab)
if (tOp->init(tab, this) != -1) {
define_scan_op(tOp);
+ // Mark that this NdbIndexScanOperation is used as NdbScanOperation
+ tOp->m_type = NdbOperation::TableScan;
return tOp;
} else {
theNdb->releaseScanOperation(tOp);
diff --git a/storage/ndb/src/ndbapi/Ndbif.cpp b/storage/ndb/src/ndbapi/Ndbif.cpp
index dc4171afc3e..b0692eb8236 100644
--- a/storage/ndb/src/ndbapi/Ndbif.cpp
+++ b/storage/ndb/src/ndbapi/Ndbif.cpp
@@ -1055,6 +1055,7 @@ Ndb::pollCompleted(NdbTransaction** aCopyArray)
void
Ndb::check_send_timeout()
{
+ Uint32 timeout = theImpl->m_transporter_facade->m_waitfor_timeout;
NDB_TICKS current_time = NdbTick_CurrentMillisecond();
assert(current_time >= the_last_check_time);
if (current_time - the_last_check_time > 1000) {
@@ -1062,17 +1063,18 @@ Ndb::check_send_timeout()
Uint32 no_of_sent = theNoOfSentTransactions;
for (Uint32 i = 0; i < no_of_sent; i++) {
NdbTransaction* a_con = theSentTransactionsArray[i];
- if ((current_time - a_con->theStartTransTime) >
- WAITFOR_RESPONSE_TIMEOUT) {
+ if ((current_time - a_con->theStartTransTime) > timeout)
+ {
#ifdef VM_TRACE
a_con->printState();
Uint32 t1 = a_con->theTransactionId;
Uint32 t2 = a_con->theTransactionId >> 32;
- ndbout_c("[%.8x %.8x]", t1, t2);
- abort();
+ ndbout_c("4012 [%.8x %.8x]", t1, t2);
+ //abort();
#endif
+ a_con->theReleaseOnClose = true;
a_con->setOperationErrorCodeAbort(4012);
- a_con->theCommitStatus = NdbTransaction::Aborted;
+ a_con->theCommitStatus = NdbTransaction::NeedAbort;
a_con->theCompletionStatus = NdbTransaction::CompletedFailure;
a_con->handleExecuteCompletion();
remove_sent_list(i);
diff --git a/storage/ndb/src/ndbapi/TransporterFacade.cpp b/storage/ndb/src/ndbapi/TransporterFacade.cpp
index 48882e187ac..7005d5d2325 100644
--- a/storage/ndb/src/ndbapi/TransporterFacade.cpp
+++ b/storage/ndb/src/ndbapi/TransporterFacade.cpp
@@ -721,6 +721,19 @@ TransporterFacade::init(Uint32 nodeId, const ndb_mgm_configuration* props)
m_batch_size= batch_size;
}
+ Uint32 timeout = 120000;
+ iter.first();
+ for (iter.first(); iter.valid(); iter.next())
+ {
+ Uint32 tmp1 = 0, tmp2 = 0;
+ iter.get(CFG_DB_TRANSACTION_CHECK_INTERVAL, &tmp1);
+ iter.get(CFG_DB_TRANSACTION_DEADLOCK_TIMEOUT, &tmp2);
+ tmp1 += tmp2;
+ if (tmp1 > timeout)
+ timeout = tmp1;
+ }
+ m_waitfor_timeout = timeout;
+
if (!theTransporterRegistry->start_service(m_socket_server)){
ndbout_c("Unable to start theTransporterRegistry->start_service");
DBUG_RETURN(false);
diff --git a/storage/ndb/src/ndbapi/TransporterFacade.hpp b/storage/ndb/src/ndbapi/TransporterFacade.hpp
index 1052d7e6184..b64ce2e8614 100644
--- a/storage/ndb/src/ndbapi/TransporterFacade.hpp
+++ b/storage/ndb/src/ndbapi/TransporterFacade.hpp
@@ -121,6 +121,7 @@ public:
Uint32 get_scan_batch_size();
Uint32 get_batch_byte_size();
Uint32 get_batch_size();
+ Uint32 m_waitfor_timeout; // in milli seconds...
TransporterRegistry* get_registry() { return theTransporterRegistry;};
diff --git a/storage/ndb/src/ndbapi/ndberror.c b/storage/ndb/src/ndbapi/ndberror.c
index 544010ed55d..52ecb5f8e21 100644
--- a/storage/ndb/src/ndbapi/ndberror.c
+++ b/storage/ndb/src/ndbapi/ndberror.c
@@ -475,6 +475,8 @@ ErrorBundle ErrorCodes[] = {
{ 1415, DMEC, SE, "Subscription not unique in subscriber manager" },
{ 1416, DMEC, IS, "Can't accept more subscriptions, out of space in pool" },
{ 1417, DMEC, SE, "Table in suscription not defined, probably dropped" },
+ { 1418, DMEC, SE, "Subscription dropped, no new subscribers allowed" },
+ { 1419, DMEC, SE, "Subscription already dropped" },
{ 4004, DMEC, AE, "Attribute name not found in the Table" },
diff --git a/storage/ndb/test/include/NDBT_Tables.hpp b/storage/ndb/test/include/NDBT_Tables.hpp
index 4a5886502e1..0b4a9f8bb09 100644
--- a/storage/ndb/test/include/NDBT_Tables.hpp
+++ b/storage/ndb/test/include/NDBT_Tables.hpp
@@ -44,6 +44,8 @@ public:
static const NdbDictionary::Table* getTable(int _num);
static int getNumTables();
+ static int create_default_tablespace(Ndb* pNdb);
+
private:
static const NdbDictionary::Table* tableWithPkSize(const char* _nam, Uint32 pkSize);
};
diff --git a/storage/ndb/test/include/NdbRestarter.hpp b/storage/ndb/test/include/NdbRestarter.hpp
index e9bf96148d1..403e21ab62e 100644
--- a/storage/ndb/test/include/NdbRestarter.hpp
+++ b/storage/ndb/test/include/NdbRestarter.hpp
@@ -62,6 +62,7 @@ public:
int dumpStateAllNodes(int * _args, int _num_args);
int getMasterNodeId();
+ int getRandomNodeSameNodeGroup(int nodeId, int randomNumber);
int getRandomNodeOtherNodeGroup(int nodeId, int randomNumber);
int getRandomNotMasterNodeId(int randomNumber);
diff --git a/storage/ndb/test/ndbapi/bank/Bank.cpp b/storage/ndb/test/ndbapi/bank/Bank.cpp
index 294ed80edcf..5ef01533e07 100644
--- a/storage/ndb/test/ndbapi/bank/Bank.cpp
+++ b/storage/ndb/test/ndbapi/bank/Bank.cpp
@@ -19,7 +19,7 @@
#include <NdbSleep.h>
#include <UtilTransactions.hpp>
-Bank::Bank(Ndb_cluster_connection& con, bool _init, char * dbase):
+Bank::Bank(Ndb_cluster_connection& con, bool _init, const char * dbase):
m_ndb(&con, dbase),
m_maxAccount(-1),
m_initialized(false)
diff --git a/storage/ndb/test/ndbapi/bank/Bank.hpp b/storage/ndb/test/ndbapi/bank/Bank.hpp
index a581684a41b..60ec7745b59 100644
--- a/storage/ndb/test/ndbapi/bank/Bank.hpp
+++ b/storage/ndb/test/ndbapi/bank/Bank.hpp
@@ -27,9 +27,9 @@
class Bank {
public:
- Bank(Ndb_cluster_connection&, bool init = true, char *dbase="BANK");
+ Bank(Ndb_cluster_connection&, bool init = true, const char *dbase="BANK");
- int createAndLoadBank(bool overWrite, int num_accounts=10);
+ int createAndLoadBank(bool overWrite, bool disk= false, int num_accounts=10);
int dropBank();
int performTransactions(int maxSleepBetweenTrans = 20, int yield=0);
@@ -121,8 +121,8 @@ private:
int prepareReadSystemValueOp(NdbConnection*, SystemValueId sysValId, Uint64 &time);
int prepareGetCurrTimeOp(NdbConnection*, Uint64 &time);
- int createTables();
- int createTable(const char* tabName);
+ int createTables(bool disk);
+ int createTable(const char* tabName, bool disk);
int dropTables();
int dropTable(const char* tabName);
diff --git a/storage/ndb/test/ndbapi/bank/BankLoad.cpp b/storage/ndb/test/ndbapi/bank/BankLoad.cpp
index 78fd6c7d678..45d6a860a3d 100644
--- a/storage/ndb/test/ndbapi/bank/BankLoad.cpp
+++ b/storage/ndb/test/ndbapi/bank/BankLoad.cpp
@@ -53,7 +53,7 @@ int Bank::getNumAccountTypes(){
return accountTypesSize;
}
-int Bank::createAndLoadBank(bool ovrWrt, int num_accounts){
+int Bank::createAndLoadBank(bool ovrWrt, bool disk, int num_accounts){
m_ndb.init();
if (m_ndb.waitUntilReady() != 0)
@@ -69,7 +69,7 @@ int Bank::createAndLoadBank(bool ovrWrt, int num_accounts){
}
}
- if (createTables() != NDBT_OK)
+ if (createTables(disk) != NDBT_OK)
return NDBT_FAILED;
if (clearTables() != NDBT_OK)
@@ -104,9 +104,9 @@ int Bank::dropBank(){
}
-int Bank::createTables(){
+int Bank::createTables(bool disk){
for (int i = 0; i < tableNamesSize; i++){
- if (createTable(tableNames[i]) != NDBT_OK)
+ if (createTable(tableNames[i], disk) != NDBT_OK)
return NDBT_FAILED;
}
return NDBT_OK;
@@ -136,7 +136,7 @@ int Bank::clearTable(const char* tabName){
return NDBT_OK;
}
-int Bank::createTable(const char* tabName){
+int Bank::createTable(const char* tabName, bool disk){
ndbout << "createTable " << tabName << endl;
const NdbDictionary::Table* pTab = NDBT_Tables::getTable(tabName);
@@ -146,7 +146,8 @@ int Bank::createTable(const char* tabName){
const NdbDictionary::Table* org =
m_ndb.getDictionary()->getTable(tabName);
- if (org != 0 && pTab->equal(* org)){
+ if (org != 0 && (disk || pTab->equal(* org)))
+ {
return NDBT_OK;
}
@@ -154,11 +155,31 @@ int Bank::createTable(const char* tabName){
ndbout << "Different table with same name exists" << endl;
return NDBT_FAILED;
}
-
- if(m_ndb.getDictionary()->createTable(* pTab) == -1){
- ndbout << "Failed to create table: " <<
- m_ndb.getNdbError() << endl;
- return NDBT_FAILED;
+
+ if (disk)
+ {
+ if (NDBT_Tables::create_default_tablespace(&m_ndb))
+ {
+ ndbout << "Failed to create tablespaces" << endl;
+ return NDBT_FAILED;
+ }
+ NdbDictionary::Table copy(* pTab);
+ copy.setTablespace("DEFAULT-TS");
+ for (Uint32 i = 0; i<copy.getNoOfColumns(); i++)
+ copy.getColumn(i)->setStorageType(NdbDictionary::Column::StorageTypeDisk);
+ if(m_ndb.getDictionary()->createTable(copy) == -1){
+ ndbout << "Failed to create table: " <<
+ m_ndb.getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+ }
+ else
+ {
+ if(m_ndb.getDictionary()->createTable(* pTab) == -1){
+ ndbout << "Failed to create table: " <<
+ m_ndb.getNdbError() << endl;
+ return NDBT_FAILED;
+ }
}
return NDBT_OK;
diff --git a/storage/ndb/test/ndbapi/bank/bankCreator.cpp b/storage/ndb/test/ndbapi/bank/bankCreator.cpp
index 02a2e85732e..39e4920867f 100644
--- a/storage/ndb/test/ndbapi/bank/bankCreator.cpp
+++ b/storage/ndb/test/ndbapi/bank/bankCreator.cpp
@@ -30,9 +30,11 @@ int main(int argc, const char** argv){
ndb_init();
int _help = 0;
char * _database = "BANK";
-
+ int disk = 0;
+
struct getargs args[] = {
{ "database", 'd', arg_string, &_database, "Database name", ""},
+ { "disk", 0, arg_flag, &disk, "Use disk tables", "" },
{ "usage", '?', arg_flag, &_help, "Print help", "" }
};
int num_args = sizeof(args) / sizeof(args[0]);
@@ -53,7 +55,7 @@ int main(int argc, const char** argv){
Bank bank(con,_database);
int overWriteExisting = true;
- if (bank.createAndLoadBank(overWriteExisting) != NDBT_OK)
+ if (bank.createAndLoadBank(overWriteExisting, disk) != NDBT_OK)
return NDBT_ProgramExit(NDBT_FAILED);
return NDBT_ProgramExit(NDBT_OK);
diff --git a/storage/ndb/test/ndbapi/bank/testBank.cpp b/storage/ndb/test/ndbapi/bank/testBank.cpp
index 035cfe0a685..3516032b655 100644
--- a/storage/ndb/test/ndbapi/bank/testBank.cpp
+++ b/storage/ndb/test/ndbapi/bank/testBank.cpp
@@ -31,8 +31,9 @@
#include "Bank.hpp"
+const char* _database = "BANK";
+
int runCreateBank(NDBT_Context* ctx, NDBT_Step* step){
- char * _database = "BANK";
Bank bank(ctx->m_cluster_connection, _database);
int overWriteExisting = true;
if (bank.createAndLoadBank(overWriteExisting) != NDBT_OK)
@@ -41,7 +42,6 @@ int runCreateBank(NDBT_Context* ctx, NDBT_Step* step){
}
int runBankTimer(NDBT_Context* ctx, NDBT_Step* step){
- char * _database = "BANK";
Bank bank(ctx->m_cluster_connection, _database);
int wait = 30; // Max seconds between each "day"
int yield = 1; // Loops before bank returns
@@ -53,7 +53,6 @@ int runBankTimer(NDBT_Context* ctx, NDBT_Step* step){
}
int runBankTransactions(NDBT_Context* ctx, NDBT_Step* step){
- char * _database = "BANK";
Bank bank(ctx->m_cluster_connection, _database);
int wait = 10; // Max ms between each transaction
int yield = 100; // Loops before bank returns
@@ -65,7 +64,6 @@ int runBankTransactions(NDBT_Context* ctx, NDBT_Step* step){
}
int runBankGL(NDBT_Context* ctx, NDBT_Step* step){
- char * _database = "BANK";
Bank bank(ctx->m_cluster_connection, _database);
int yield = 20; // Loops before bank returns
int result = NDBT_OK;
@@ -80,7 +78,6 @@ int runBankGL(NDBT_Context* ctx, NDBT_Step* step){
}
int runBankSum(NDBT_Context* ctx, NDBT_Step* step){
- char * _database = "BANK";
Bank bank(ctx->m_cluster_connection, _database);
int wait = 2000; // Max ms between each sum of accounts
int yield = 1; // Loops before bank returns
@@ -96,7 +93,6 @@ int runBankSum(NDBT_Context* ctx, NDBT_Step* step){
}
int runDropBank(NDBT_Context* ctx, NDBT_Step* step){
- char * _database = "BANK";
Bank bank(ctx->m_cluster_connection, _database);
if (bank.dropBank() != NDBT_OK)
return NDBT_FAILED;
diff --git a/storage/ndb/test/ndbapi/testNodeRestart.cpp b/storage/ndb/test/ndbapi/testNodeRestart.cpp
index 92d6c1830ef..ba195290e9e 100644
--- a/storage/ndb/test/ndbapi/testNodeRestart.cpp
+++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp
@@ -433,12 +433,28 @@ int runBug15587(NDBT_Context* ctx, NDBT_Step* step){
if (restarter.waitNodesNoStart(&nodeId, 1))
return NDBT_FAILED;
+ int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+
+ if (restarter.dumpStateOneNode(nodeId, val2, 2))
+ return NDBT_FAILED;
+
if (restarter.dumpStateOneNode(nodeId, dump, 2))
return NDBT_FAILED;
if (restarter.startNodes(&nodeId, 1))
return NDBT_FAILED;
+ restarter.waitNodesStartPhase(&nodeId, 1, 3);
+
+ if (restarter.waitNodesNoStart(&nodeId, 1))
+ return NDBT_FAILED;
+
+ if (restarter.dumpStateOneNode(nodeId, val2, 1))
+ return NDBT_FAILED;
+
+ if (restarter.startNodes(&nodeId, 1))
+ return NDBT_FAILED;
+
if (restarter.waitNodesStarted(&nodeId, 1))
return NDBT_FAILED;
@@ -535,6 +551,123 @@ err:
return NDBT_FAILED;
}
+int
+runBug16772(NDBT_Context* ctx, NDBT_Step* step){
+
+ NdbRestarter restarter;
+ if (restarter.getNumDbNodes() < 2)
+ {
+ ctx->stopTest();
+ return NDBT_OK;
+ }
+
+ int aliveNodeId = restarter.getRandomNotMasterNodeId(rand());
+ int deadNodeId = aliveNodeId;
+ while (deadNodeId == aliveNodeId)
+ deadNodeId = restarter.getDbNodeId(rand() % restarter.getNumDbNodes());
+
+ if (restarter.insertErrorInNode(aliveNodeId, 930))
+ return NDBT_FAILED;
+
+ if (restarter.restartOneDbNode(deadNodeId,
+ /** initial */ false,
+ /** nostart */ true,
+ /** abort */ true))
+ return NDBT_FAILED;
+
+ if (restarter.waitNodesNoStart(&deadNodeId, 1))
+ return NDBT_FAILED;
+
+ if (restarter.startNodes(&deadNodeId, 1))
+ return NDBT_FAILED;
+
+ // It should now be hanging since we throw away NDB_FAILCONF
+ int ret = restarter.waitNodesStartPhase(&deadNodeId, 1, 3, 10);
+ // So this should fail...i.e it should not reach startphase 3
+
+ // Now send a NDB_FAILCONF for deadNo
+ int dump[] = { 7020, 323, 252, 0 };
+ dump[3] = deadNodeId;
+ if (restarter.dumpStateOneNode(aliveNodeId, dump, 4))
+ return NDBT_FAILED;
+
+ if (restarter.waitNodesStarted(&deadNodeId, 1))
+ return NDBT_FAILED;
+
+ return ret ? NDBT_OK : NDBT_FAILED;
+}
+
+int
+runBug18414(NDBT_Context* ctx, NDBT_Step* step){
+
+ NdbRestarter restarter;
+ if (restarter.getNumDbNodes() < 2)
+ {
+ ctx->stopTest();
+ return NDBT_OK;
+ }
+
+ Ndb* pNdb = GETNDB(step);
+ HugoOperations hugoOps(*ctx->getTab());
+ HugoTransactions hugoTrans(*ctx->getTab());
+ int loop = 0;
+ do
+ {
+ if(hugoOps.startTransaction(pNdb) != 0)
+ goto err;
+
+ if(hugoOps.pkUpdateRecord(pNdb, 0, 128, rand()) != 0)
+ goto err;
+
+ if(hugoOps.execute_NoCommit(pNdb) != 0)
+ goto err;
+
+ int node1 = hugoOps.getTransaction()->getConnectedNodeId();
+ int node2 = restarter.getRandomNodeSameNodeGroup(node1, rand());
+
+ if (node1 == -1 || node2 == -1)
+ break;
+
+ if (loop & 1)
+ {
+ if (restarter.insertErrorInNode(node1, 8050))
+ goto err;
+ }
+
+ int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+ if (restarter.dumpStateOneNode(node2, val2, 2))
+ goto err;
+
+ if (restarter.insertErrorInNode(node2, 5003))
+ goto err;
+
+ int res= hugoOps.execute_Rollback(pNdb);
+
+ if (restarter.waitNodesNoStart(&node2, 1) != 0)
+ goto err;
+
+ if (restarter.insertErrorInAllNodes(0))
+ goto err;
+
+ if (restarter.startNodes(&node2, 1) != 0)
+ goto err;
+
+ if (restarter.waitClusterStarted() != 0)
+ goto err;
+
+ if (hugoTrans.scanUpdateRecords(pNdb, 128) != 0)
+ goto err;
+
+ hugoOps.closeTransaction(pNdb);
+
+ } while(++loop < 5);
+
+ return NDBT_OK;
+
+err:
+ hugoOps.closeTransaction(pNdb);
+ return NDBT_FAILED;
+}
NDBT_TESTSUITE(testNodeRestart);
TESTCASE("NoLoad",
@@ -820,6 +953,16 @@ TESTCASE("Bug15685",
STEP(runBug15685);
FINALIZER(runClearTable);
}
+TESTCASE("Bug16772",
+ "Test bug with restarting before NF handling is complete"){
+ STEP(runBug16772);
+}
+TESTCASE("Bug18414",
+ "Test bug with NF during NR"){
+ INITIALIZER(runLoadTable);
+ STEP(runBug18414);
+ FINALIZER(runClearTable);
+}
NDBT_TESTSUITE_END(testNodeRestart);
int main(int argc, const char** argv){
diff --git a/storage/ndb/test/ndbapi/testSRBank.cpp b/storage/ndb/test/ndbapi/testSRBank.cpp
index df7bfa3a7f9..22fd45bc255 100644
--- a/storage/ndb/test/ndbapi/testSRBank.cpp
+++ b/storage/ndb/test/ndbapi/testSRBank.cpp
@@ -22,10 +22,12 @@
#include "bank/Bank.hpp"
+bool disk = false;
+
int runCreateBank(NDBT_Context* ctx, NDBT_Step* step){
Bank bank(ctx->m_cluster_connection);
int overWriteExisting = true;
- if (bank.createAndLoadBank(overWriteExisting, 10) != NDBT_OK)
+ if (bank.createAndLoadBank(overWriteExisting, disk, 10) != NDBT_OK)
return NDBT_FAILED;
return NDBT_OK;
}
@@ -406,8 +408,20 @@ TESTCASE("Mix",
}
NDBT_TESTSUITE_END(testSRBank);
-int main(int argc, const char** argv){
+int
+main(int argc, const char** argv){
ndb_init();
+ for (int i = 0; i<argc; i++)
+ {
+ if (strcmp(argv[i], "--disk") == 0)
+ {
+ argc--;
+ disk = true;
+ for (; i<argc; i++)
+ argv[i] = argv[i+1];
+ break;
+ }
+ }
return testSRBank.execute(argc, argv);
}
diff --git a/storage/ndb/test/ndbapi/testSystemRestart.cpp b/storage/ndb/test/ndbapi/testSystemRestart.cpp
index 35016896495..30f7aca9b06 100644
--- a/storage/ndb/test/ndbapi/testSystemRestart.cpp
+++ b/storage/ndb/test/ndbapi/testSystemRestart.cpp
@@ -1051,6 +1051,52 @@ int runSystemRestart9(NDBT_Context* ctx, NDBT_Step* step){
return result;
}
+int runBug18385(NDBT_Context* ctx, NDBT_Step* step){
+ NdbRestarter restarter;
+ const Uint32 nodeCount = restarter.getNumDbNodes();
+ if(nodeCount < 2){
+ g_info << "Bug18385 - Needs atleast 2 nodes to test" << endl;
+ return NDBT_OK;
+ }
+
+ int node1 = restarter.getDbNodeId(rand() % nodeCount);
+ int node2 = restarter.getRandomNodeSameNodeGroup(node1, rand());
+
+ if (node1 == -1 || node2 == -1)
+ return NDBT_OK;
+
+ int dump[] = { DumpStateOrd::DihSetTimeBetweenGcp, 300 };
+
+ int result = NDBT_OK;
+ do {
+ CHECK(restarter.dumpStateAllNodes(dump, 2) == 0);
+ CHECK(restarter.restartOneDbNode(node1, false, true, false) == 0);
+ NdbSleep_SecSleep(3);
+ CHECK(restarter.restartAll(false, true, false) == 0);
+
+ Uint32 cnt = 0;
+ int nodes[128];
+ for(Uint32 i = 0; i<nodeCount; i++)
+ if ((nodes[cnt] = restarter.getDbNodeId(i)) != node2)
+ cnt++;
+
+ assert(cnt == nodeCount - 1);
+
+ CHECK(restarter.startNodes(nodes, cnt) == 0);
+ CHECK(restarter.waitNodesStarted(nodes, cnt, 300) == 0);
+
+ CHECK(restarter.insertErrorInNode(node2, 7170) == 0);
+ CHECK(restarter.waitNodesNoStart(&node2, 1) == 0);
+ CHECK(restarter.restartOneDbNode(node2, true, false, true) == 0);
+ CHECK(restarter.waitNodesStarted(&node2, 1) == 0);
+
+ } while(0);
+
+ g_info << "Bug18385 finished" << endl;
+
+ return result;
+}
+
int runWaitStarted(NDBT_Context* ctx, NDBT_Step* step){
NdbRestarter restarter;
@@ -1234,6 +1280,13 @@ TESTCASE("SR9",
STEP(runSystemRestart9);
FINALIZER(runClearTable);
}
+TESTCASE("Bug18385",
+ "Perform partition system restart with other nodes with higher GCI"){
+ INITIALIZER(runWaitStarted);
+ INITIALIZER(runClearTable);
+ STEP(runBug18385);
+ FINALIZER(runClearTable);
+}
NDBT_TESTSUITE_END(testSystemRestart);
int main(int argc, const char** argv){
diff --git a/storage/ndb/test/ndbapi/testTimeout.cpp b/storage/ndb/test/ndbapi/testTimeout.cpp
index b02751ec819..36fb34a50e2 100644
--- a/storage/ndb/test/ndbapi/testTimeout.cpp
+++ b/storage/ndb/test/ndbapi/testTimeout.cpp
@@ -24,6 +24,7 @@
#define TIMEOUT (Uint32)3000
Uint32 g_org_timeout = 3000;
+Uint32 g_org_deadlock = 3000;
int
setTransactionTimeout(NDBT_Context* ctx, NDBT_Step* step){
@@ -59,6 +60,60 @@ resetTransactionTimeout(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_OK;
}
+int
+setDeadlockTimeout(NDBT_Context* ctx, NDBT_Step* step){
+ NdbRestarter restarter;
+ int timeout = ctx->getProperty("TransactionDeadlockTimeout", TIMEOUT);
+
+ NdbConfig conf(GETNDB(step)->getNodeId()+1);
+ unsigned int nodeId = conf.getMasterNodeId();
+ if (!conf.getProperty(nodeId,
+ NODE_TYPE_DB,
+ CFG_DB_TRANSACTION_DEADLOCK_TIMEOUT,
+ &g_org_deadlock))
+ return NDBT_FAILED;
+
+ g_err << "Setting timeout: " << timeout << endl;
+ int val[] = { DumpStateOrd::TcSetTransactionTimeout, timeout };
+ if(restarter.dumpStateAllNodes(val, 2) != 0){
+ return NDBT_FAILED;
+ }
+
+ return NDBT_OK;
+}
+
+int
+getDeadlockTimeout(NDBT_Context* ctx, NDBT_Step* step){
+ NdbRestarter restarter;
+
+ Uint32 val = 0;
+ NdbConfig conf(GETNDB(step)->getNodeId()+1);
+ unsigned int nodeId = conf.getMasterNodeId();
+ if (!conf.getProperty(nodeId,
+ NODE_TYPE_DB,
+ CFG_DB_TRANSACTION_DEADLOCK_TIMEOUT,
+ &val))
+ return NDBT_FAILED;
+
+ if (val < 120000)
+ val = 120000;
+ ctx->setProperty("TransactionDeadlockTimeout", 4*val);
+
+ return NDBT_OK;
+}
+
+int
+resetDeadlockTimeout(NDBT_Context* ctx, NDBT_Step* step){
+ NdbRestarter restarter;
+
+ int val[] = { DumpStateOrd::TcSetTransactionTimeout, g_org_deadlock };
+ if(restarter.dumpStateAllNodes(val, 2) != 0){
+ return NDBT_FAILED;
+ }
+
+ return NDBT_OK;
+}
+
int runLoadTable(NDBT_Context* ctx, NDBT_Step* step){
@@ -333,6 +388,43 @@ int runBuddyTransNoTimeout(NDBT_Context* ctx, NDBT_Step* step){
return result;
}
+int
+runError4012(NDBT_Context* ctx, NDBT_Step* step){
+ int result = NDBT_OK;
+ int loops = ctx->getNumLoops();
+ int stepNo = step->getStepNo();
+
+ int timeout = ctx->getProperty("TransactionDeadlockTimeout", TIMEOUT);
+
+ HugoOperations hugoOps(*ctx->getTab());
+ Ndb* pNdb = GETNDB(step);
+
+ do{
+ // Commit transaction
+ CHECK(hugoOps.startTransaction(pNdb) == 0);
+ CHECK(hugoOps.pkUpdateRecord(pNdb, 0) == 0);
+ int ret = hugoOps.execute_NoCommit(pNdb);
+ if (ret == 0)
+ {
+ int sleep = timeout;
+ ndbout << "Sleeping for " << sleep << " milliseconds" << endl;
+ NdbSleep_MilliSleep(sleep);
+
+ // Expect that transaction has NOT timed-out
+ CHECK(hugoOps.execute_Commit(pNdb) == 0);
+ }
+ else
+ {
+ CHECK(ret == 4012);
+ }
+ } while(false);
+
+ hugoOps.closeTransaction(pNdb);
+
+ return result;
+}
+
+
NDBT_TESTSUITE(testTimeout);
TESTCASE("DontTimeoutTransaction",
"Test that the transaction does not timeout "\
@@ -403,6 +495,15 @@ TESTCASE("BuddyTransNoTimeout5",
FINALIZER(resetTransactionTimeout);
FINALIZER(runClearTable);
}
+TESTCASE("Error4012", ""){
+ TC_PROPERTY("TransactionDeadlockTimeout", 120000);
+ INITIALIZER(runLoadTable);
+ INITIALIZER(getDeadlockTimeout);
+ INITIALIZER(setDeadlockTimeout);
+ STEPS(runError4012, 2);
+ FINALIZER(runClearTable);
+}
+
NDBT_TESTSUITE_END(testTimeout);
int main(int argc, const char** argv){
diff --git a/storage/ndb/test/ndbapi/test_event.cpp b/storage/ndb/test/ndbapi/test_event.cpp
index 1e7db14ff40..2f2a28fbff2 100644
--- a/storage/ndb/test/ndbapi/test_event.cpp
+++ b/storage/ndb/test/ndbapi/test_event.cpp
@@ -101,6 +101,40 @@ static int dropEvent(Ndb *pNdb, const NdbDictionary::Table &tab)
return NDBT_OK;
}
+static
+NdbEventOperation *createEventOperation(Ndb *ndb,
+ const NdbDictionary::Table &tab,
+ int do_report_error = 1)
+{
+ char buf[1024];
+ sprintf(buf, "%s_EVENT", tab.getName());
+ NdbEventOperation *pOp= ndb->createEventOperation(buf);
+ if (pOp == 0)
+ {
+ if (do_report_error)
+ g_err << "createEventOperation: "
+ << ndb->getNdbError().code << " "
+ << ndb->getNdbError().message << endl;
+ return 0;
+ }
+ int n_columns= tab.getNoOfColumns();
+ for (int j = 0; j < n_columns; j++)
+ {
+ pOp->getValue(tab.getColumn(j)->getName());
+ pOp->getPreValue(tab.getColumn(j)->getName());
+ }
+ if ( pOp->execute() )
+ {
+ if (do_report_error)
+ g_err << "pOp->execute(): "
+ << pOp->getNdbError().code << " "
+ << pOp->getNdbError().message << endl;
+ ndb->dropEventOperation(pOp);
+ return 0;
+ }
+ return pOp;
+}
+
static int runCreateEvent(NDBT_Context* ctx, NDBT_Step* step)
{
if (createEvent(GETNDB(step),* ctx->getTab()) != 0){
@@ -870,7 +904,7 @@ static int createAllEvents(NDBT_Context* ctx, NDBT_Step* step)
static int dropAllEvents(NDBT_Context* ctx, NDBT_Step* step)
{
- DBUG_ENTER("createAllEvents");
+ DBUG_ENTER("dropAllEvents");
Ndb * ndb= GETNDB(step);
int i;
@@ -1212,6 +1246,18 @@ static int createEventOperations(Ndb * ndb)
DBUG_RETURN(NDBT_OK);
}
+static int createAllEventOperations(NDBT_Context* ctx, NDBT_Step* step)
+{
+ DBUG_ENTER("createAllEventOperations");
+ Ndb * ndb= GETNDB(step);
+ int r= createEventOperations(ndb);
+ if (r != NDBT_OK)
+ {
+ DBUG_RETURN(NDBT_FAILED);
+ }
+ DBUG_RETURN(NDBT_OK);
+}
+
static int dropEventOperations(Ndb * ndb)
{
DBUG_ENTER("dropEventOperations");
@@ -1228,6 +1274,18 @@ static int dropEventOperations(Ndb * ndb)
DBUG_RETURN(NDBT_OK);
}
+static int dropAllEventOperations(NDBT_Context* ctx, NDBT_Step* step)
+{
+ DBUG_ENTER("dropAllEventOperations");
+ Ndb * ndb= GETNDB(step);
+ int r= dropEventOperations(ndb);
+ if (r != NDBT_OK)
+ {
+ DBUG_RETURN(NDBT_FAILED);
+ }
+ DBUG_RETURN(NDBT_OK);
+}
+
static int runMulti(NDBT_Context* ctx, NDBT_Step* step)
{
DBUG_ENTER("runMulti");
@@ -1409,6 +1467,87 @@ static int runMulti_NR(NDBT_Context* ctx, NDBT_Step* step)
DBUG_RETURN(NDBT_OK);
}
+static int restartAllNodes()
+{
+ NdbRestarter restarter;
+ int id = 0;
+ do {
+ int nodeId = restarter.getDbNodeId(id++);
+ ndbout << "Restart node " << nodeId << endl;
+ if(restarter.restartOneDbNode(nodeId, false, false, true) != 0){
+ g_err << "Failed to restartNextDbNode" << endl;
+ break;
+ }
+ if(restarter.waitClusterStarted(60) != 0){
+ g_err << "Cluster failed to start" << endl;
+ break;
+ }
+ id = id % restarter.getNumDbNodes();
+ } while (id);
+ return id != 0;
+}
+
+static int runCreateDropNR(NDBT_Context* ctx, NDBT_Step* step)
+{
+ DBUG_ENTER("runCreateDropNR");
+ Ndb * ndb= GETNDB(step);
+ int result = NDBT_OK;
+ NdbRestarter restarter;
+ int loops = ctx->getNumLoops();
+
+ if (restarter.getNumDbNodes() < 2)
+ {
+ ctx->stopTest();
+ return NDBT_OK;
+ }
+ do
+ {
+ result = NDBT_FAILED;
+ const NdbDictionary::Table* pTab = ctx->getTab();
+ if (createEvent(ndb, *pTab))
+ {
+ g_err << "createEvent failed" << endl;
+ break;
+ }
+ NdbEventOperation *pOp= createEventOperation(ndb, *pTab);
+ if (pOp == 0)
+ {
+ g_err << "Failed to createEventOperation" << endl;
+ break;
+ }
+ if (dropEvent(ndb, *pTab))
+ {
+ g_err << "Failed to dropEvent()" << endl;
+ break;
+ }
+ ndbout << "Restarting with dropped events with subscribers" << endl;
+ if (restartAllNodes())
+ break;
+ if (ndb->getDictionary()->dropTable(pTab->getName()) != 0){
+ g_err << "Failed to drop " << pTab->getName() <<" in db" << endl;
+ break;
+ }
+ ndbout << "Restarting with dropped events and dropped "
+ << "table with subscribers" << endl;
+ if (restartAllNodes())
+ break;
+ if (ndb->dropEventOperation(pOp))
+ {
+ g_err << "Failed dropEventOperation" << endl;
+ break;
+ }
+ NdbDictionary::Table tmp(*pTab);
+ //tmp.setNodeGroupIds(0, 0);
+ if (ndb->getDictionary()->createTable(tmp) != 0){
+ g_err << "createTable failed: "
+ << ndb->getDictionary()->getNdbError() << endl;
+ break;
+ }
+ result = NDBT_OK;
+ } while (--loops);
+
+ DBUG_RETURN(result);
+}
NDBT_TESTSUITE(test_event);
TESTCASE("BasicEventOperation",
@@ -1492,6 +1631,11 @@ TESTCASE("Multi_NR",
FINALIZER(dropAllShadows);
FINALIZER(dropAllEvents);
}
+TESTCASE("CreateDropNR",
+ "Verify that we can Create and Drop in any order"
+ "NOTE! No errors are allowed!" ){
+ FINALIZER(runCreateDropNR);
+}
NDBT_TESTSUITE_END(test_event);
int main(int argc, const char** argv){
diff --git a/storage/ndb/test/run-test/ATRT_SETUP_README.txt b/storage/ndb/test/run-test/ATRT_SETUP_README.txt
new file mode 100644
index 00000000000..adef464e5f6
--- /dev/null
+++ b/storage/ndb/test/run-test/ATRT_SETUP_README.txt
@@ -0,0 +1,292 @@
+ATRT_SETUP_README.txt
+Author: Serge Kozlov, MySQL
+Date: 03/23/2006
+
+Contents
+
+1. Overview
+2. Setup
+3. Preparing for testing
+4. CPCD. Command line and configuration options
+5. d.tmp. Examples
+6. Test Case File format. Examples
+
+Note: how to run ATRT tests please look ATRT_USAGE_README.txt
+
+
+ 1.Overview
+ ==========
+
+ Auto Test Run Test (ATRT) is a home made test frame work. This frame work can
+start and stop processes on different Linux hosts through another executable
+called Cluster Process Control Daemon (CPCD) running on the other hosts.
+It uses for testing cluster configurations located on different machines.
+ATRT isn't replacement for mysqltest. In fact, ATRT can invoke mysql-test as
+samples blow show. This framework has been designed to run most any test
+(mysqltest testcases, stress tests, any applications) in cluster and detects
+all errors and issues which happened in any node. In addition, ATRT starts
+applications that are defined as test with arguments and will analyze log files
+from all nodes that are produced.
+
+
+ 2.Setup
+ =======
+
+ Following steps described how to setup ATRT framework on a cluster:
+* You need to have cloned source tree (e.g mysql-5.1-new) on machine where you
+ plan to use ATRT.
+* Compile and install build (e.g. for Linux/x86 can use
+ BUILD/compile-pentium-max --prefix=/path/to/installation).
+* Copy $MYSQL_DIR on all machines and on same path which you plan to use as
+ nodes (you can use scp utility or ask JonathanMiller about distribution on
+ ndbXX servers).
+* Compile and install ATRT:
+ * Go to $TREE_ROOT/storage/ndb/test
+ * do make
+ * do make install
+ * Make sure that $MYSQL_DIR/bin now contains files like that: testBasic,
+ testBlobs, testDict and so on
+ * Make sure that $MYSQL_DIR/mysql-test/ndb now contains files like that: atrt,
+ atrt-analyze-result.sh, atrt-setup.sh, make-config.sh and so on
+ * Add $MYSQL_DIR/mysql-test/ndb to PATH and make sure that you can call atrt
+ from any place on disk.
+* Configure CPCD processes on all machines. Repeat following steps for each
+ node:
+ * Create $VAR_DIR/run/ndb_cpcd directory
+ * Create /etc/ndb_cpcd.cnf file. It will configuration file ndb_cpcd daemon.
+ It strongly recommended instead command line options because more simply.
+ More option for configuration can fe found in this document in section CPCD
+ * Add to file following text:
+
+ [ndb_cpcd]
+ work-dir= $VAR_DIR/run/ndb_cpcd # e.g. /mysql/builds/5.1/var/run/ndb_cpcd
+ logfile= $VAR_DIR/run/ndb_cpcd/log.txt # e.g. /mysql/builds/5.1/var/run/ndb_cpcd/log.txt
+ debug= 1
+ user= ndbdev
+
+ * Register ndb_cpcd in etc/initab. Hint: you can use more simply way if use
+ Linux - add following line to /etc/rc.d/rc.local file
+
+ $MYSQL_DIR/libexec/ndb_cpcd > /dev/null 2>&1 &
+
+ * Start ndb_cpcd
+
+ $MYSQL_DIR/libexec/ndb_cpcd > /dev/null 2>&1 &
+
+ * Open log file and make sure that ndb_cpcd process started properly. Ususal mistakes are: wrong definition of paths and ndb_cpcd process already running. You can test ndb_cpcd from any ndb system by using the command line below. If nothing is returned the process is up and running. Otherwise you will see Failed to connect to node:1234:
+
+ $MYSQL_DIR/libexec/ndb_cpcc node
+
+Now ATRT Setup done. After accomplishment all steps above you should be have
+following:
+* Each node contains fresh build
+* Each node has configured and started ndb_cpcd process.
+* The node that will used for starting ATRT has installed atrt binaries/scripts
+ and some tests.
+
+
+ 3.Preparing for testing
+ =======================
+
+* Create new empty directory where you plan to use for testing. Note: if you
+ plan to test different cluster configuration you need to create own directory
+ for each cluster configuration. Do not use same directory.
+* Create d.tmp file for your cluster configuration. See details in this
+ document in section d.tmp.
+* Run make-config.sh ./d.tmp. It will create necessary directories and files for
+ ATRT.
+* Create ATRT testcase file(s) (e.g. test1.atrt). See details in this document
+ in section Test Case File format. Examples.
+* Put your test application into $MYSQL_DIR/bin directory. If your application
+ requires another directory (e.g. mysql-test-run.pl) create redirect script
+ such as example below:
+
+ #!/bin/sh
+
+ set -x
+ cd $MYSQL_BASE_DIR/mysql-test
+ ./mysql-test-run.pl --with-ndbcluster --ndb-connectstring=$*
+
+Now preparing for testing done.
+
+
+ 4.CPCD.
+ =======
+
+ The CPCD process needs to be running on each host contacts CPCD to tell it
+what process to execute. In other word for testing each node should have to
+running ndb_cpcd. Usually ndb_cpcd can be found in storage/ndb/src/cw/cpcd for
+source tree or in libexec/ndb_cpcd for binary distribution. ndb_cpcd uses
+configuration file /etc/ndb_cpcd.cnf but all options from one can be replaced
+by command line. Names of options in command line are same as from
+configuration file except some some commands have short notation (-X).
+
+ndb_cpcd command line options
+
+-w, --work-dir=name
+ Work directory. Should be exist before starting ndb_cpcd. Usually it's
+ $VARDIR/run/ndb_cpcd
+-p, --port=#
+ TCP port to listen on. By default 1234
+-S, --syslog
+ Log events to syslog
+-L, --logfile=name
+ File to log events to. Usually it's $VARDIR/run/ndb_cpcd/logfile.txt
+-D, --debug
+ Enable debug mode.
+-u, --user=name
+ Run as user
+
+
+ 5.d.tmp
+ =======
+
+ The d.tmp file is used to create the d.txt file (configuration file for ATRT)
+and the config.ini file (configuration file for MySQL Cluster). This file does
+not have to be called d.tmp, it can be called by any name. The file will be feed
+to make-config.sh. All options in the file separated by two parts:
+* Original options. They are located before '-- cluster config'. Description of
+all these options are below.
+* Options for config.ini. They are located after '-- cluster config'. All
+options, sections and values completely coincide with config.ini.
+
+d.tmp options
+
+baseport
+ Port used for communicating to the cluster on.
+basedir
+ basedir has to point to the root of the mysql install. Note that ATRT will
+ create a run directory under the base directory. All test directories and
+ files created will be copied to all hosts in the test under the basedir/run directory.
+mgm
+ Host to NDB Cluster manager on. Put hostnames separated by blanks.
+ndb
+ Host(s) to run NDB Data Nodes on. Put hostnames separated by blanks.
+api
+ Host(s) that NDB API should be ran on. Put hostnames separated by blanks.
+mysqld
+ Host(s) that mysqld processes should be started on. Put hostnames separated by blanks.
+mysql
+ Host(s) that mysql processes should be started on. Put hostnames separated
+ by blanks.
+
+Example d.tmp for cluster configuration: 1 ndb node, 1 replica, 1 mgm, 1 api,
+1 mysql, 1 mysqld. Available hosts for nodes: ndb16, ndb17
+
+baseport: 14000
+basedir: /home/ndbdev/skozlov/builds
+mgm: ndb16
+ndb: ndb17
+api: ndb16
+mysqld ndb16
+mysql ndb16
+-- cluster config
+[DB DEFAULT]
+NoOfReplicas: 1
+
+[MGM DEFAULT]
+PortNumber: 14000
+ArbitrationRank: 1
+
+Example d.tmp for cluster configuration: 2 ndb nodes, 2 replicas, 1 mgm, 1 api,
+1 mysql, 1 mysqld. Available hosts for nodes: ndb16, ndb17, ndb18
+
+baseport: 14000
+basedir: /home/ndbdev/skozlov/builds
+mgm: ndb16
+ndb: ndb17 ndb18
+api: ndb16
+mysqld ndb16
+mysql ndb16
+-- cluster config
+[DB DEFAULT]
+NoOfReplicas: 2
+
+[MGM DEFAULT]
+PortNumber: 14000
+ArbitrationRank: 1
+
+Example d.tmp for cluster configuration: 4 ndb nodes, 4 replicas, 1 mgm, 3 api,
+2 mysql, 1 mysqld. Available hosts for nodes: ndb14, ndb15, ndb16, ndb17, ndb18
+
+baseport: 14000
+basedir: /home/ndbdev/skozlov/builds
+mgm: ndb16
+ndb: ndb17 ndb18 ndb15 ndb14
+api: ndb16 ndb17 ndb18
+mysqld ndb16
+mysql ndb16 ndb17
+-- cluster config
+[DB DEFAULT]
+NoOfReplicas: 4
+
+[MGM DEFAULT]
+PortNumber: 14000
+ArbitrationRank: 1
+
+
+ 6.Test Case File Format. Examples.
+ ==================================
+
+ A test file consists of a list of test cases. Each test case is ended by an
+empty/blank line. Each test case is described by a set of name value pairs.
+ATRT looks for tests executables, shell and Perl scripts in the basedir/bin
+directory.
+
+Test Case File options:
+
+max-time
+ This value is in seconds. Test ATRT how long to allow the test to run before
+ marking the test a failure and moving on to the next test. If the test
+ finishes before max-time, it will move on to the next test.
+cmd
+ Tells ATRT which test or script to run from the bin directory
+args
+ These are the command-line arguments to be passed to the test or script
+ that is being executed.
+type
+ Currently only bench. See ATRT Command-line parameters for details.
+run-all
+ will start the same command for each defined api/mysql (normally it only
+ started in 1 instance)
+
+Example 1.
+ATRT starts test $MYSQL_DIR/bin/testBlobs without arguments and sets time for
+execution as 10 min. testBlobs is binary application
+
+max-time: 600
+cmd: testBlobs
+args:
+
+Example 2.
+ATRT starts test $MYSQL_DIR/bin/testRead -n PkRead and sets time for execution
+as 20 min. testRead is binary application
+
+max-time: 1200
+cmd: testRead
+args: -n PkRead
+
+Example 3.
+ATRT starts test $MYSQL_DIR/bin/atrt-mysql-test-run -force and sets time for
+execution as one hour. atrt-mysql-test-run is bash script and it points to
+$MYSQL_DIR/mysql-test/mysql-test-run. In fact this test will start
+mysql-test-run --force that means the execution all mysqltest testcases in
+mysql-test/t directory.
+
+max-time: 3600
+cmd: atrt-mysql-test-run
+args: --force
+
+Example 4.
+ATRT starts test $MYSQL_DIR/bin/MyTest1 -n and sets time for execution as 2 min.
+Then starts $MYSQL_DIR/bin/MyTest2 for each defined mysql/api node and set
+timeout 3 min.
+
+max-time: 120
+cmd: MyTest1
+args: -n
+
+max-time: 180
+cmd: MyTest2
+run-all: yes
+
diff --git a/storage/ndb/test/run-test/ATRT_USAGE_README.txt b/storage/ndb/test/run-test/ATRT_USAGE_README.txt
new file mode 100644
index 00000000000..b745a735761
--- /dev/null
+++ b/storage/ndb/test/run-test/ATRT_USAGE_README.txt
@@ -0,0 +1,224 @@
+ATRT_USAGE_README.txt
+Author: Serge Kozlov, MySQL
+Date: 03/23/2006
+
+Contents
+
+1. How to run
+2. Results
+3. ATRT Command Line Options
+
+Note: how to setup ATRT please look ATRT_SETUP_README.txt
+
+ 1.How to run.
+ =============
+
+Simple way to start atrt:
+
+ atrt --testcase-file=atrt_test_case_file
+
+Command line above doesn't produce any log files. Better use following :
+
+ atrt --log-file=log.txt --testcase-file=atrt_test_case_file
+
+Now we can look log.txt for investigation any issues. If it is insufficiently
+then add one or more -v arguments:
+
+ atrt -v -v --log-file=log.txt --testcase-file=atrt_test_case_file
+
+If the test case file contains two or more test we can add -r options for
+preventing stopping testing if one test fails (like --force for mysql-test-run)
+
+ atrt -v -v -r --log-file=log.txt --testcase-file=atrt_test_case_file
+
+The line below is optimal solution for testing:
+
+ atrt -v -v -r -R --log-file=log.txt --testcase-file=atrt_test_case_file
+
+All additional command line arguments and description of used in exampes above
+available in this document in section atrt command line options
+
+ 2.Results.
+ ==========
+
+ Unlike mysql-test-run frame work atrt doesn't inform to console passed/failed
+status of tests. You need to use --log-file option and look into log file for
+getting information about status of tests. When atrt finished you can look into
+log file defined --log-file option. It's main source of information about how
+were performed atrt tests. Below added the examples of content of log-file for
+different failures (except example 1 for passed test). Examples include
+probable cases with reasons and recommended solutions and cover not test issues
+only but mistakes of atrt configuration or cluster settings. As ATRT testcase
+file used simple test included in MySQL installation:
+
+ max-time: 600
+ cmd: testBasic
+ args: -n PkRead? T1
+
+
+Of course these examples don't cover all possible failures but at least most
+probable and often appearing.
+Note: Before start atrt I recommend try to run selected cluster configuration
+by manual and make sure that it can work: enough to run mgmd, ndbd, mysqld and
+look via mgm to status of these nodes
+
+Example 1. Test passed
+
+2006-03-02 15:36:51 [ndb_atrt] INFO -- Setup path not specified, using /home/ndbdev/skozlov/asetup
+2006-03-02 15:36:51 [ndb_atrt] INFO -- Starting...
+2006-03-02 15:36:51 [ndb_atrt] INFO -- Connecting to hosts
+2006-03-02 15:36:51 [ndb_atrt] DEBUG -- Connected to node1:1234
+2006-03-02 15:36:51 [ndb_atrt] DEBUG -- Connected to node2:1234
+2006-03-02 15:36:51 [ndb_atrt] DEBUG -- Connected to node3:1234
+2006-03-02 15:36:55 [ndb_atrt] INFO -- (Re)starting ndb processes
+2006-03-02 15:37:11 [ndb_atrt] INFO -- Ndb start completed
+2006-03-02 15:37:11 [ndb_atrt] INFO -- #1 - testBasic -n PkRead? T1
+2006-03-02 16:37:16 [ndb_atrt] INFO -- #1 OK (0)
+
+Example 2. Test failed.
+Reason: ATRT not started properly. d.txt not found. Probably necessary folders
+and d.txt file don't exist.
+Solution: run make-config.sh d.tmp and try again.
+
+2006-03-02 18:32:08 [ndb_atrt] INFO -- Setup path not specified, using /home/ndbdev/skozlov/asetup
+2006-03-02 18:32:08 [ndb_atrt] INFO -- Starting...
+2006-03-02 18:32:08 [ndb_atrt] CRITICAL -- Failed to open process config file: d.txt
+
+Example 3. Test failed.
+Reason: ATRT not started properly. Necessary folders were removed but d.txt file
+exists.
+Solution: run make-config.sh d.tmp and try again.
+
+2006-03-02 18:30:54 [ndb_atrt] INFO -- Setup path not specified, using /home/ndbdev/skozlov/asetup
+2006-03-02 18:30:54 [ndb_atrt] INFO -- Starting...
+2006-03-02 18:30:54 [ndb_atrt] INFO -- Connecting to hosts
+2006-03-02 18:30:54 [ndb_atrt] DEBUG -- Connected to node1:1234
+2006-03-02 18:30:54 [ndb_atrt] DEBUG -- Connected to node2:1234
+2006-03-02 18:30:54 [ndb_atrt] DEBUG -- Connected to node3:1234
+2006-03-02 18:30:58 [ndb_atrt] INFO -- (Re)starting ndb processes
+2006-03-02 18:31:00 [ndb_atrt] CRITICAL -- Failed to setup process
+
+Example 4. Test failed.
+Reason: ATRT not started properly. node2 hasn't running ndb_cpcd process.
+Solution: log into node2 and starts ndb_cpcd process.
+
+2006-03-02 18:15:05 [ndb_atrt] INFO -- Setup path not specified, using /home/ndbdev/skozlov/asetup
+2006-03-02 18:15:05 [ndb_atrt] INFO -- Starting...
+2006-03-02 18:15:05 [ndb_atrt] INFO -- Connecting to hosts
+2006-03-02 18:15:05 [ndb_atrt] DEBUG -- Connected to node1:1234
+2006-03-02 18:15:05 [ndb_atrt] ERROR -- Unable to connect to cpc node2:1234
+
+Example 5. Test failed.
+Reason: ATRT not started properly. baseport option isn't defined in d.tmp or
+baseport and PortNumber are different.
+Solution: correct d.tmp, run make-config.sh d.tmp and try again.
+
+2006-03-02 18:25:31 [ndb_atrt] INFO -- Setup path not specified, using /home/ndbdev/skozlov/asetup
+2006-03-02 18:25:31 [ndb_atrt] INFO -- Starting...
+2006-03-02 18:25:31 [ndb_atrt] INFO -- Connecting to hosts
+2006-03-02 18:25:31 [ndb_atrt] DEBUG -- Connected to node1:1234
+2006-03-02 18:25:31 [ndb_atrt] DEBUG -- Connected to node2:1234
+2006-03-02 18:25:31 [ndb_atrt] DEBUG -- Connected to node3:1234
+2006-03-02 18:25:36 [ndb_atrt] INFO -- (Re)starting ndb processes
+2006-03-02 18:26:08 [ndb_atrt] CRITICAL -- Unable to connect to ndb mgm node1:0
+
+Example 6. Test failed.
+Reason: ATRT not started properly. basedir option points to wrong path.
+Solution: correct basedir, run make-config.sh d.tmp and try again.
+
+2006-03-02 18:40:10 [ndb_atrt] INFO -- Setup path not specified, using /home/ndbdev/skozlov/asetup
+2006-03-02 18:40:10 [ndb_atrt] INFO -- Starting...
+2006-03-02 18:40:10 [ndb_atrt] INFO -- Connecting to hosts
+2006-03-02 18:40:10 [ndb_atrt] DEBUG -- Connected to node1:1234
+2006-03-02 18:40:10 [ndb_atrt] DEBUG -- Connected to node2:1234
+2006-03-02 18:40:10 [ndb_atrt] DEBUG -- Connected to node3:1234
+2006-03-02 18:40:14 [ndb_atrt] INFO -- (Re)starting ndb processes
+2006-03-02 18:40:16 [ndb_atrt] ERROR -- Unable to start process: Failed to start
+
+Example 7. Test failed.
+Reason: ndb nodes have problems on starting.
+Solution: Check configuration of ndb nodes.
+
+2006-03-02 18:46:44 [ndb_atrt] INFO -- Setup path not specified, using /home/ndbdev/skozlov/asetup
+2006-03-02 18:46:44 [ndb_atrt] INFO -- Starting...
+2006-03-02 18:46:44 [ndb_atrt] INFO -- Connecting to hosts
+2006-03-02 18:46:44 [ndb_atrt] DEBUG -- Connected to node1:1234
+2006-03-02 18:46:44 [ndb_atrt] DEBUG -- Connected to node2:1234
+2006-03-02 18:46:44 [ndb_atrt] DEBUG -- Connected to node3:1234
+2006-03-02 18:46:50 [ndb_atrt] INFO -- (Re)starting ndb processes
+2006-03-02 18:52:59 [ndb_atrt] CRITICAL -- wait ndb timed out 3 3 4
+2006-03-02 18:58:59 [ndb_atrt] CRITICAL -- wait ndb timed out 3 3 4
+
+Example 8. Test failed.
+Reason: test application not found.
+Solution: Correct file name in ATRT test case file and make sure that the file
+exists in $MYSQL_DIR/bin directory.
+
+2006-03-02 20:21:54 [ndb_atrt] INFO -- Starting...
+2006-03-02 20:21:54 [ndb_atrt] INFO -- Connecting to hosts
+2006-03-02 20:21:54 [ndb_atrt] DEBUG -- Connected to node1:1234
+2006-03-02 20:21:54 [ndb_atrt] DEBUG -- Connected to node2:1234
+2006-03-02 20:21:54 [ndb_atrt] DEBUG -- Connected to node3:1234
+2006-03-02 20:21:57 [ndb_atrt] INFO -- (Re)starting ndb processes
+2006-03-02 20:22:12 [ndb_atrt] INFO -- Ndb start completed
+2006-03-02 20:22:12 [ndb_atrt] INFO -- #1 - testBasic123 -n PkRead? T2
+2006-03-02 20:22:13 [ndb_atrt] ERROR -- Unable to start process: Failed to start
+
+Example 9. Test failed.
+Probable reasons:
+* wrong arguments for test application
+* itself test failed
+* timeout reached
+Solution: Since mgmd/ndbd nodes started properly in such case then try to
+investigate log files in result/X.api/, result/X.mysqld, result/X.mysql
+directories.
+
+2006-03-02 19:59:35 [ndb_atrt] INFO -- Setup path not specified, using /home/ndbdev/skozlov/asetup
+2006-03-02 19:59:35 [ndb_atrt] INFO -- Starting...
+2006-03-02 19:59:35 [ndb_atrt] INFO -- Connecting to hosts
+2006-03-02 19:59:35 [ndb_atrt] DEBUG -- Connected to node1:1234
+2006-03-02 19:59:35 [ndb_atrt] DEBUG -- Connected to node2:1234
+2006-03-02 19:59:35 [ndb_atrt] DEBUG -- Connected to node3:1234
+2006-03-02 20:00:49 [ndb_atrt] INFO -- (Re)starting ndb processes
+2006-03-02 20:01:05 [ndb_atrt] INFO -- Ndb start completed
+2006-03-02 20:01:05 [ndb_atrt] INFO -- #1 - testBasic -n PkRead? T1
+2006-03-02 20:01:38 [ndb_atrt] INFO -- #1 FAILED(256)
+
+
+ 3.ATRT Command Line Options.
+ ============================
+
+--process-config=string
+ Specify ATRT configuration file. If not specified, ATRT will look in local
+ directory for the d.txt file.
+
+--setup-path=string
+ This path points to place where necessary directories (created by
+ make-config) can be found. Note: d.txt should be in same directory where
+ you start atrt!
+
+-v (verbose)
+
+ * without the option: atrt prints only [CRITICAL] events
+ * one -v: atrt prints [CRITICAL], [INFO] events
+ * two -v: atrt prints [CRITICAL], [INFO], [DEBUG] events
+
+--log-file=string
+ Used to specify file to log ATRT's results on starting application and
+ running tests.
+
+--testcase-file=string -f
+ Used to feed ATRT test cases in a text file.
+
+--report-file=string
+ File to record test results
+
+-i, --interactive
+ ATRT terminates on first test failure
+
+-r, --regression
+ Continues even on test failures
+
+-b, --bench
+ Always produce report
+
diff --git a/storage/ndb/test/run-test/Makefile.am b/storage/ndb/test/run-test/Makefile.am
index 34d164b09dd..c0da73b00ae 100644
--- a/storage/ndb/test/run-test/Makefile.am
+++ b/storage/ndb/test/run-test/Makefile.am
@@ -7,14 +7,13 @@ include $(top_srcdir)/storage/ndb/config/type_mgmapiclient.mk.am
test_PROGRAMS = atrt
test_DATA=daily-basic-tests.txt daily-devel-tests.txt 16node-tests.txt \
- conf-daily-basic-ndbmaster.txt \
- conf-daily-basic-shark.txt \
- conf-daily-devel-ndbmaster.txt \
- conf-daily-sql-ndbmaster.txt \
- conf-daily-basic-dl145a.txt \
conf-daily-basic-ndb08.txt \
conf-daily-devel-ndb08.txt \
- conf-daily-sql-ndb08.txt
+ conf-daily-sql-ndb08.txt \
+ conf-ndbmaster.txt \
+ conf-shark.txt \
+ conf-dl145a.txt
+
test_SCRIPTS=atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \
atrt-clear-result.sh make-config.sh make-index.sh make-html-reports.sh
diff --git a/storage/ndb/test/run-test/conf-daily-devel-ndbmaster.txt b/storage/ndb/test/run-test/conf-daily-devel-ndbmaster.txt
index 8adbf84454d..45e6e25f030 100644
--- a/storage/ndb/test/run-test/conf-daily-devel-ndbmaster.txt
+++ b/storage/ndb/test/run-test/conf-daily-devel-ndbmaster.txt
@@ -17,3 +17,6 @@ FileSystemPath: CHOOSE_dir/run
PortNumber: 16000
ArbitrationRank: 1
DataDir: .
+
+[TCP DEFAULT]
+SendBufferMemory: 2M
diff --git a/storage/ndb/test/run-test/conf-daily-basic-dl145a.txt b/storage/ndb/test/run-test/conf-dl145a.txt
index d8cf8d34d82..d0a240f09d1 100644
--- a/storage/ndb/test/run-test/conf-daily-basic-dl145a.txt
+++ b/storage/ndb/test/run-test/conf-dl145a.txt
@@ -17,3 +17,6 @@ FileSystemPath: /home/ndbdev/autotest/run
PortNumber: 14000
ArbitrationRank: 1
DataDir: .
+
+[TCP DEFAULT]
+SendBufferMemory: 2M
diff --git a/storage/ndb/test/run-test/conf-daily-basic-ndbmaster.txt b/storage/ndb/test/run-test/conf-ndbmaster.txt
index 30e90a9527f..9f50432f5e3 100644
--- a/storage/ndb/test/run-test/conf-daily-basic-ndbmaster.txt
+++ b/storage/ndb/test/run-test/conf-ndbmaster.txt
@@ -17,3 +17,6 @@ FileSystemPath: CHOOSE_dir/run
PortNumber: 14000
ArbitrationRank: 1
DataDir: .
+
+[TCP DEFAULT]
+SendBufferMemory: 2M
diff --git a/storage/ndb/test/run-test/conf-daily-basic-shark.txt b/storage/ndb/test/run-test/conf-shark.txt
index 6d1f8b64f44..d66d0280d8a 100644
--- a/storage/ndb/test/run-test/conf-daily-basic-shark.txt
+++ b/storage/ndb/test/run-test/conf-shark.txt
@@ -17,3 +17,6 @@ FileSystemPath: /space/autotest/run
PortNumber: 14000
ArbitrationRank: 1
DataDir: .
+
+[TCP DEFAULT]
+SendBufferMemory: 2M
diff --git a/storage/ndb/test/run-test/daily-basic-tests.txt b/storage/ndb/test/run-test/daily-basic-tests.txt
index 6dbb078e0d2..5d5e70f7184 100644
--- a/storage/ndb/test/run-test/daily-basic-tests.txt
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt
@@ -445,6 +445,18 @@ max-time: 500
cmd: testNodeRestart
args: -n Bug15685 T1
+max-time: 500
+cmd: testNodeRestart
+args: -n Bug16772 T1
+
+#max-time: 500
+#cmd: testSystemRestart
+#args: -n Bug18385 T1
+#
+max-time: 500
+cmd: testNodeRestart
+args: -n Bug18414 T1
+
#
# DICT TESTS
max-time: 1500
diff --git a/storage/ndb/test/run-test/daily-devel-tests.txt b/storage/ndb/test/run-test/daily-devel-tests.txt
index 34e914644fc..1a3a87fbc6e 100644
--- a/storage/ndb/test/run-test/daily-devel-tests.txt
+++ b/storage/ndb/test/run-test/daily-devel-tests.txt
@@ -218,6 +218,11 @@ max-time: 2500
cmd: test_event
args: -n Multi
+#
+max-time: 2500
+cmd: test_event
+args: -n CreateDropNR -l 2
+
max-time: 600
cmd: testBasic
args: -n PkRead T1
diff --git a/storage/ndb/test/run-test/ndb-autotest.sh b/storage/ndb/test/run-test/ndb-autotest.sh
index 6f94ef6e46c..544897a2aa2 100755
--- a/storage/ndb/test/run-test/ndb-autotest.sh
+++ b/storage/ndb/test/run-test/ndb-autotest.sh
@@ -13,7 +13,7 @@ save_args=$*
VERSION="ndb-autotest.sh version 1.04"
DATE=`date '+%Y-%m-%d'`
-HOST=`hostname`
+HOST=`hostname -s`
export DATE HOST
set -e
@@ -67,7 +67,7 @@ done
if [ -f $conf ]
then
- . ./$conf
+ . $conf
else
echo "Can't find config file: $conf"
exit
@@ -299,9 +299,12 @@ choose_conf(){
elif [ -f $test_dir/conf-$1.txt ]
then
echo "$test_dir/conf-$1.txt"
+ elif [ -f $test_dir/conf-$HOST.txt ]
+ echo "$test_dir/conf-$HOST.txt"
else
echo "Unable to find conf file looked for" 1>&2
echo "$test_dir/conf-$1-$HOST.txt and" 1>&2
+ echo "$test_dir/conf-$HOST.txt" 1>&2
echo "$test_dir/conf-$1.txt" 1>&2
exit
fi
diff --git a/storage/ndb/test/src/NDBT_Tables.cpp b/storage/ndb/test/src/NDBT_Tables.cpp
index 3cbd3fb305e..71da6cfc2d9 100644
--- a/storage/ndb/test/src/NDBT_Tables.cpp
+++ b/storage/ndb/test/src/NDBT_Tables.cpp
@@ -848,9 +848,8 @@ NDBT_Tables::createAllTables(Ndb* pNdb){
return createAllTables(pNdb, false);
}
-static
int
-create_default_tablespace(Ndb* pNdb)
+NDBT_Tables::create_default_tablespace(Ndb* pNdb)
{
NdbDictionary::Dictionary* pDict = pNdb->getDictionary();
diff --git a/storage/ndb/test/src/NdbBackup.cpp b/storage/ndb/test/src/NdbBackup.cpp
index 588f785c5a3..42ebf31fc47 100644
--- a/storage/ndb/test/src/NdbBackup.cpp
+++ b/storage/ndb/test/src/NdbBackup.cpp
@@ -291,8 +291,8 @@ NdbBackup::NF(NdbRestarter& _restarter, int *NFDuringBackup_codes, const int sz,
<< masterNodeId << endl;
- int val = DumpStateOrd::CmvmiSetRestartOnErrorInsert;
- CHECK(_restarter.dumpStateOneNode(nodeId, &val, 1) == 0,
+ int val[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+ CHECK(_restarter.dumpStateOneNode(nodeId, val, 2) == 0,
"failed to set RestartOnErrorInsert");
CHECK(_restarter.insertErrorInNode(nodeId, error) == 0,
"failed to set error insert");
diff --git a/storage/ndb/test/src/NdbRestarter.cpp b/storage/ndb/test/src/NdbRestarter.cpp
index 91c0963feae..2c16a05240d 100644
--- a/storage/ndb/test/src/NdbRestarter.cpp
+++ b/storage/ndb/test/src/NdbRestarter.cpp
@@ -174,6 +174,39 @@ NdbRestarter::getRandomNodeOtherNodeGroup(int nodeId, int rand){
return -1;
}
+int
+NdbRestarter::getRandomNodeSameNodeGroup(int nodeId, int rand){
+ if (!isConnected())
+ return -1;
+
+ if (getStatus() != 0)
+ return -1;
+
+ int node_group = -1;
+ for(size_t i = 0; i < ndbNodes.size(); i++){
+ if(ndbNodes[i].node_id == nodeId){
+ node_group = ndbNodes[i].node_group;
+ break;
+ }
+ }
+ if(node_group == -1){
+ return -1;
+ }
+
+ Uint32 counter = 0;
+ rand = rand % ndbNodes.size();
+ while(counter++ < ndbNodes.size() &&
+ (ndbNodes[rand].node_id == nodeId ||
+ ndbNodes[rand].node_group != node_group))
+ rand = (rand + 1) % ndbNodes.size();
+
+ if(ndbNodes[rand].node_group == node_group &&
+ ndbNodes[rand].node_id != nodeId)
+ return ndbNodes[rand].node_id;
+
+ return -1;
+}
+
int
NdbRestarter::waitClusterStarted(unsigned int _timeout){
return waitClusterState(NDB_MGM_NODE_STATUS_STARTED, _timeout);
diff --git a/storage/ndb/test/src/NdbRestarts.cpp b/storage/ndb/test/src/NdbRestarts.cpp
index c0f31af84ce..eea4af437c4 100644
--- a/storage/ndb/test/src/NdbRestarts.cpp
+++ b/storage/ndb/test/src/NdbRestarts.cpp
@@ -641,8 +641,8 @@ int restartNFDuringNR(NdbRestarter& _restarter,
CHECK(_restarter.waitNodesNoStart(&nodeId, 1) == 0,
"waitNodesNoStart failed");
- int val = DumpStateOrd::CmvmiSetRestartOnErrorInsert;
- CHECK(_restarter.dumpStateOneNode(nodeId, &val, 1) == 0,
+ int val[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 } ;
+ CHECK(_restarter.dumpStateOneNode(nodeId, val, 2) == 0,
"failed to set RestartOnErrorInsert");
CHECK(_restarter.insertErrorInNode(nodeId, error) == 0,
@@ -698,8 +698,8 @@ int restartNFDuringNR(NdbRestarter& _restarter,
CHECK(_restarter.waitNodesNoStart(&nodeId, 1) == 0,
"waitNodesNoStart failed");
- int val = DumpStateOrd::CmvmiSetRestartOnErrorInsert;
- CHECK(_restarter.dumpStateOneNode(crashNodeId, &val, 2) == 0,
+ int val[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+ CHECK(_restarter.dumpStateOneNode(crashNodeId, val, 2) == 0,
"failed to set RestartOnErrorInsert");
CHECK(_restarter.insertErrorInNode(crashNodeId, error) == 0,
@@ -771,8 +771,8 @@ int restartNodeDuringLCP(NdbRestarter& _restarter,
<< " error code = " << error << endl;
{
- int val = DumpStateOrd::CmvmiSetRestartOnErrorInsert;
- CHECK(_restarter.dumpStateAllNodes(&val, 1) == 0,
+ int val[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+ CHECK(_restarter.dumpStateAllNodes(val, 2) == 0,
"failed to set RestartOnErrorInsert");
}
@@ -812,8 +812,8 @@ int restartNodeDuringLCP(NdbRestarter& _restarter,
ndbout << _restart->m_name << " restarting non-master node = " << nodeId
<< " error code = " << error << endl;
- int val = DumpStateOrd::CmvmiSetRestartOnErrorInsert;
- CHECK(_restarter.dumpStateAllNodes(&val, 1) == 0,
+ int val[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+ CHECK(_restarter.dumpStateAllNodes(val, 2) == 0,
"failed to set RestartOnErrorInsert");
CHECK(_restarter.insertErrorInNode(nodeId, error) == 0,
diff --git a/storage/ndb/tools/Makefile.am b/storage/ndb/tools/Makefile.am
index 77263a92b32..d99dd4d9b59 100644
--- a/storage/ndb/tools/Makefile.am
+++ b/storage/ndb/tools/Makefile.am
@@ -1,4 +1,7 @@
+dist_bin_SCRIPTS = ndb_size.pl ndb_error_reporter
+dist_pkgdata_DATA = ndb_size.tmpl
+
ndbtools_PROGRAMS = \
ndb_test_platform \
ndb_waiter \
diff --git a/storage/ndb/tools/desc.cpp b/storage/ndb/tools/desc.cpp
index bbd69baacd2..37157ef9eec 100644
--- a/storage/ndb/tools/desc.cpp
+++ b/storage/ndb/tools/desc.cpp
@@ -30,6 +30,7 @@ NDB_STD_OPTS_VARS;
static const char* _dbname = "TEST_DB";
static int _unqualified = 0;
+static int _partinfo = 0;
static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
@@ -39,6 +40,9 @@ static struct my_option my_long_options[] =
{ "unqualified", 'u', "Use unqualified table names",
(gptr*) &_unqualified, (gptr*) &_unqualified, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
+ { "extra-partition-info", 'p', "Print more info per partition",
+ (gptr*) &_partinfo, (gptr*) &_partinfo, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
static void usage()
@@ -52,6 +56,8 @@ static void usage()
my_print_variables(my_long_options);
}
+static void print_part_info(Ndb* pNdb, NDBT_Table* pTab);
+
int main(int argc, char** argv){
NDB_INIT(argv[0]);
const char *load_default_groups[]= { "mysql_cluster",0 };
@@ -260,5 +266,76 @@ int desc_table(Ndb *myndb, char* name)
}
ndbout << endl;
+ if (_partinfo)
+ print_part_info(myndb, pTab);
+
return 1;
}
+
+struct InfoInfo
+{
+ const char * m_title;
+ NdbRecAttr* m_rec_attr;
+ const NdbDictionary::Column* m_column;
+};
+
+
+static
+void print_part_info(Ndb* pNdb, NDBT_Table* pTab)
+{
+ InfoInfo g_part_info[] = {
+ { "Partition", 0, NdbDictionary::Column::FRAGMENT },
+ { "Row count", 0, NdbDictionary::Column::ROW_COUNT },
+ { "Commit count", 0, NdbDictionary::Column::COMMIT_COUNT },
+ { "Frag memory", 0, NdbDictionary::Column::FRAGMENT_MEMORY },
+ { 0, 0, 0 }
+ };
+
+ ndbout << "-- Per partition info -- " << endl;
+
+ NdbConnection* pTrans = pNdb->startTransaction();
+ if (pTrans == 0)
+ return;
+
+ do
+ {
+ NdbScanOperation* pOp= pTrans->getNdbScanOperation(pTab->getName());
+ if (pOp == NULL)
+ break;
+
+ int rs = pOp->readTuples(NdbOperation::LM_CommittedRead);
+ if (rs != 0)
+ break;
+
+ if (pOp->interpret_exit_last_row() != 0)
+ break;
+
+ Uint32 i = 0;
+ for(i = 0; g_part_info[i].m_title != 0; i++)
+ {
+ if ((g_part_info[i].m_rec_attr = pOp->getValue(g_part_info[i].m_column)) == 0)
+ break;
+ }
+
+ if (g_part_info[i].m_title != 0)
+ break;
+
+ if (pTrans->execute(NoCommit) != 0)
+ break;
+
+ for (i = 0; g_part_info[i].m_title != 0; i++)
+ ndbout << g_part_info[i].m_title << "\t";
+ ndbout << endl;
+
+ while(pOp->nextResult() == 0)
+ {
+ for(i = 0; g_part_info[i].m_title != 0; i++)
+ {
+ ndbout << *g_part_info[i].m_rec_attr << "\t";
+ }
+ ndbout << endl;
+ }
+ } while(0);
+
+ pTrans->close();
+}
diff --git a/strings/Makefile.am b/strings/Makefile.am
index fcb97a071f1..1183fcae01a 100644
--- a/strings/Makefile.am
+++ b/strings/Makefile.am
@@ -54,7 +54,7 @@ EXTRA_DIST = ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc
bmove_upp-sparc.s strappend-sparc.s strend-sparc.s \
strinstr-sparc.s strmake-sparc.s strmov-sparc.s \
strnmov-sparc.s strstr-sparc.s strxmov-sparc.s \
- t_ctype.h my_strchr.c
+ t_ctype.h my_strchr.c cmakelists.txt
libmystrings_a_LIBADD=
conf_to_src_SOURCES = conf_to_src.c xml.c ctype.c bcmp.c
diff --git a/strings/cmakelists.txt b/strings/cmakelists.txt
index 7b78e5f6b39..ab4031f071a 100644
--- a/strings/cmakelists.txt
+++ b/strings/cmakelists.txt
@@ -8,4 +8,5 @@ ADD_LIBRARY(strings bchange.c bcmp.c bfill.c bmove512.c bmove_upp.c ctype-big5.c
ctype-ucs2.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype.c decimal.c int2str.c
is_prefix.c llstr.c longlong2str.c my_strtoll10.c my_vsnprintf.c r_strinstr.c
str2int.c str_alloc.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c
- strtod.c strtol.c strtoll.c strtoul.c strtoull.c strxmov.c strxnmov.c xml.c my_strchr.c)
+ strtod.c strtol.c strtoll.c strtoul.c strtoull.c strxmov.c strxnmov.c xml.c
+ my_strchr.c strcont.c strinstr.c)
diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c
index 9ec2224ab62..8f7e40966b9 100644
--- a/strings/conf_to_src.c
+++ b/strings/conf_to_src.c
@@ -22,7 +22,7 @@
#define ROW_LEN 16
#define ROW16_LEN 8
-#define MAX_BUF 16*1024
+#define MAX_BUF 64*1024
static CHARSET_INFO all_charsets[256];
@@ -156,6 +156,7 @@ static int my_read_charset_file(const char *filename)
}
len=read(fd,buf,MAX_BUF);
+ DBUG_ASSERT(len < MAX_BUF);
close(fd);
if (my_parse_charset_xml(buf,len,add_collation))
@@ -221,15 +222,19 @@ void dispcset(FILE *f,CHARSET_INFO *cs)
}
fprintf(f," NULL, /* from_uni */\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");
+ fprintf(f," 1, /* caseup_multiply*/\n");
+ fprintf(f," 1, /* casedn_multiply*/\n");
fprintf(f," 1, /* mbminlen */\n");
fprintf(f," 1, /* mbmaxlen */\n");
fprintf(f," 0, /* min_sort_char */\n");
fprintf(f," 255, /* max_sort_char */\n");
+ fprintf(f," ' ', /* pad_char */\n");
fprintf(f," 0, /* escape_with_backslash_is_dangerous */\n");
-
+
fprintf(f," &my_charset_8bit_handler,\n");
if (cs->state & MY_CS_BINSORT)
fprintf(f," &my_collation_8bit_bin_handler,\n");
diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c
index 9fa4873c5d3..a5230497b70 100644
--- a/strings/ctype-extra.c
+++ b/strings/ctype-extra.c
@@ -1,51 +1,8692 @@
-/* Copyright (C) 2000 MySQL AB
+#include <my_global.h>
+#include <m_ctype.h>
- 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; either version 2 of the License, or
- (at your option) any later version.
+#ifdef HAVE_CHARSET_dec8
+uchar ctype_dec8_swedish_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02
+};
+
+uchar to_lower_dec8_swedish_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,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E6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
- 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.
+uchar to_upper_dec8_swedish_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF
+};
- 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+uchar sort_order_dec8_swedish_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0x41,0x41,0x41,0x41,0x5C,0x5B,0x5C,0x43,0x45,0x45,0x45,0x45,0x49,0x49,0x49,0x49,
+0x44,0x4E,0x4F,0x4F,0x4F,0x4F,0x5D,0xD7,0xD8,0x55,0x55,0x55,0x59,0x59,0xDE,0xDF,
+0x41,0x41,0x41,0x41,0x5C,0x5B,0x5C,0x43,0x45,0x45,0x45,0x45,0x49,0x49,0x49,0x49,
+0x44,0x4E,0x4F,0x4F,0x4F,0x4F,0x5D,0xF7,0xD8,0x55,0x55,0x55,0x59,0x59,0xDE,0xFF
+};
-#include <my_global.h>
-#include <m_ctype.h>
+uint16 to_uni_dec8_swedish_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x00A1,0x00A2,0x00A3,0x0000,0x00A5,0x0000,0x00A7,
+0x00A4,0x00A9,0x00AA,0x00AB,0x0000,0x0000,0x0000,0x0000,
+0x00B0,0x00B1,0x00B2,0x00B3,0x0000,0x00B5,0x00B6,0x00B7,
+0x0000,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x0000,0x00BF,
+0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
+0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
+0x0000,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x0152,
+0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x0178,0x0000,0x00DF,
+0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
+0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
+0x0000,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x0153,
+0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FF,0x0000,0x0000
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp850
+uchar ctype_cp850_general_ci[] = {
+0x00,
+0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x30,0x30,
+0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x20,0x30,0x30,0x30,0x30,0x30,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x30,
+0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,
+0x01,0x02,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x10,0x01,0x10,0x10,
+0x02,0x02,0x02,0x02,0x02,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x02,0x01,0x01,0x01,0x01,0x02,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,0x01,0x10,
+0x01,0x02,0x01,0x01,0x02,0x01,0x10,0x02,0x01,0x01,0x01,0x01,0x02,0x01,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20
+};
+
+uchar to_lower_cp850_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x87,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x84,0x86,
+0x82,0x91,0x91,0x93,0x94,0x95,0x96,0x97,0x98,0x94,0x81,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA4,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xA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,0x92,0x94,0x97,0x99,0xA3,0xA5,0xA7,0xA9,0xAE,0xB1,0xB2,0xB3,0xB4,0xB5,
+0xB6,0x41,0x51,0x53,0x55,0x59,0x63,0x65,0x67,0x69,0x74,0x76,0x78,0x7A,0x7C,0x80,
+0x8E,0x90,0x92,0x94,0x97,0x99,0xA3,0xA5,0xA7,0xA9,0xAE,0xB7,0xB8,0xB9,0xBA,0xBB,
+0x54,0xA1,0x5D,0x47,0x4B,0x43,0x4D,0x54,0x5F,0x61,0x5B,0x71,0x6F,0x6B,0x4B,0x4D,
+0x5D,0x4F,0x4F,0x86,0x8A,0x82,0x9F,0x9B,0xAD,0x8A,0xA1,0x8C,0xE3,0x8C,0xBD,0xBE,
+0x45,0x6D,0x84,0x9D,0x7E,0x7E,0xEA,0xFA,0xFF,0xEE,0xEC,0xFD,0xFC,0xCE,0xEB,0xFB,
+0xDC,0xDD,0xDE,0xC3,0xC9,0x45,0x47,0x43,0xE9,0xD5,0xCF,0xD1,0xD3,0xE2,0xE5,0xC5,
+0xC6,0xCB,0xCA,0xC8,0xC2,0xCC,0x49,0x49,0xD2,0xD0,0xD7,0xD6,0xD4,0xCD,0xD8,0xE4,
+0x57,0x57,0x5F,0x61,0x5B,0x73,0x6D,0x6F,0x71,0xC7,0xC4,0xDB,0xDA,0xE6,0x6B,0xD9,
+0x84,0x96,0x86,0x82,0x88,0x88,0xF5,0xB0,0xB0,0x9D,0x9F,0x9B,0xAB,0xAB,0xEF,0xF4,
+0xED,0xF1,0xC1,0xFE,0xF6,0xE7,0xBF,0xBC,0xF0,0xE8,0xF7,0xF9,0xF3,0xF2,0xDF,0xE0
+};
+
+uint16 to_uni_cp850_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x00C7,0x00FC,0x00E9,0x00E2,0x00E4,0x00E0,0x00E5,0x00E7,
+0x00EA,0x00EB,0x00E8,0x00EF,0x00EE,0x00EC,0x00C4,0x00C5,
+0x00C9,0x00E6,0x00C6,0x00F4,0x00F6,0x00F2,0x00FB,0x00F9,
+0x00FF,0x00D6,0x00DC,0x00F8,0x00A3,0x00D8,0x00D7,0x0192,
+0x00E1,0x00ED,0x00F3,0x00FA,0x00F1,0x00D1,0x00AA,0x00BA,
+0x00BF,0x00AE,0x00AC,0x00BD,0x00BC,0x00A1,0x00AB,0x00BB,
+0x2591,0x2592,0x2593,0x2502,0x2524,0x00C1,0x00C2,0x00C0,
+0x00A9,0x2563,0x2551,0x2557,0x255D,0x00A2,0x00A5,0x2510,
+0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x00E3,0x00C3,
+0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x00A4,
+0x00F0,0x00D0,0x00CA,0x00CB,0x00C8,0x0131,0x00CD,0x00CE,
+0x00CF,0x2518,0x250C,0x2588,0x2584,0x00A6,0x00CC,0x2580,
+0x00D3,0x00DF,0x00D4,0x00D2,0x00F5,0x00D5,0x00B5,0x00FE,
+0x00DE,0x00DA,0x00DB,0x00D9,0x00FD,0x00DD,0x00AF,0x00B4,
+0x00AD,0x00B1,0x2017,0x00BE,0x00B6,0x00A7,0x00F7,0x00B8,
+0x00B0,0x00A8,0x00B7,0x00B9,0x00B3,0x00B2,0x25A0,0x00A0
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_latin1
+uchar ctype_latin1_german1_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x10,0x00,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x01,0x00,0x01,0x00,
+0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x02,0x00,0x02,0x01,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02
+};
+
+uchar to_lower_latin1_german1_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,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,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x43,0x45,0x45,0x45,0x45,0x49,0x49,0x49,0x49,
+0xD0,0x4E,0x4F,0x4F,0x4F,0x4F,0x4F,0xD7,0x4F,0x55,0x55,0x55,0x55,0x59,0xDE,0x53,
+0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x43,0x45,0x45,0x45,0x45,0x49,0x49,0x49,0x49,
+0xD0,0x4E,0x4F,0x4F,0x4F,0x4F,0x4F,0xF7,0x4F,0x55,0x55,0x55,0x55,0x59,0xDE,0xFF
+};
+
+uint16 to_uni_latin1_german1_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x0081,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021,
+0x02C6,0x2030,0x0160,0x2039,0x0152,0x008D,0x017D,0x008F,
+0x0090,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x02DC,0x2122,0x0161,0x203A,0x0153,0x009D,0x017E,0x0178,
+0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
+0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
+0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
+0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
+0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,
+0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF,
+0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
+0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
+0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7,
+0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_hp8
+uchar ctype_hp8_english_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x02,0x02,
+0x01,0x10,0x10,0x01,0x02,0x10,0x10,0x02,0x01,0x10,0x01,0x01,0x01,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x20,0x20,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20
+};
+
+uchar to_lower_hp8_english_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,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,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_hp8_english_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x00C0,0x00C2,0x00C8,0x00CA,0x00CB,0x00CE,0x00CF,
+0x00B4,0x02CB,0x02C6,0x00A8,0x02DC,0x00D9,0x00DB,0x20A4,
+0x00AF,0x00DD,0x00FD,0x00B0,0x00C7,0x00E7,0x00D1,0x00F1,
+0x00A1,0x00BF,0x00A4,0x00A3,0x00A5,0x00A7,0x0192,0x00A2,
+0x00E2,0x00EA,0x00F4,0x00FB,0x00E1,0x00E9,0x00F3,0x00FA,
+0x00E0,0x00E8,0x00F2,0x00F9,0x00E4,0x00EB,0x00F6,0x00FC,
+0x00C5,0x00EE,0x00D8,0x00C6,0x00E5,0x00ED,0x00F8,0x00E6,
+0x00C4,0x00EC,0x00D6,0x00DC,0x00C9,0x00EF,0x00DF,0x00D4,
+0x00C1,0x00C3,0x00E3,0x00D0,0x00F0,0x00CD,0x00CC,0x00D3,
+0x00D2,0x00D5,0x00F5,0x0160,0x0161,0x00DA,0x0178,0x00FF,
+0x00DE,0x00FE,0x00B7,0x00B5,0x00B6,0x00BE,0x2014,0x00BC,
+0x00BD,0x00AA,0x00BA,0x00AB,0x25A0,0x00BB,0x00B1,0x0000
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_koi8r
+uchar ctype_koi8r_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01
+};
+
+uchar to_lower_koi8r_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x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C,0xFD,0xFE,0xFF
+};
+
+uchar sort_order_koi8r_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xE5,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,
+0xAF,0xB0,0xB1,0xE5,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,
+0xFE,0xDF,0xE0,0xF6,0xE3,0xE4,0xF4,0xE2,0xF5,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,
+0xEF,0xFF,0xF0,0xF1,0xF2,0xF3,0xE6,0xE1,0xFC,0xFB,0xE7,0xF8,0xFD,0xF9,0xF7,0xFA,
+0xFE,0xDF,0xE0,0xF6,0xE3,0xE4,0xF4,0xE2,0xF5,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,
+0xEF,0xFF,0xF0,0xF1,0xF2,0xF3,0xE6,0xE1,0xFC,0xFB,0xE7,0xF8,0xFD,0xF9,0xF7,0xFA
+};
+
+uint16 to_uni_koi8r_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x2500,0x2502,0x250C,0x2510,0x2514,0x2518,0x251C,0x2524,
+0x252C,0x2534,0x253C,0x2580,0x2584,0x2588,0x258C,0x2590,
+0x2591,0x2592,0x2593,0x2320,0x25A0,0x2219,0x221A,0x2248,
+0x2264,0x2265,0x00A0,0x2321,0x00B0,0x00B2,0x00B7,0x00F7,
+0x2550,0x2551,0x2552,0x0451,0x2553,0x2554,0x2555,0x2556,
+0x2557,0x2558,0x2559,0x255A,0x255B,0x255C,0x255D,0x255E,
+0x255F,0x2560,0x2561,0x0401,0x2562,0x2563,0x2564,0x2565,
+0x2566,0x2567,0x2568,0x2569,0x256A,0x256B,0x256C,0x00A9,
+0x044E,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433,
+0x0445,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,
+0x043F,0x044F,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432,
+0x044C,0x044B,0x0437,0x0448,0x044D,0x0449,0x0447,0x044A,
+0x042E,0x0410,0x0411,0x0426,0x0414,0x0415,0x0424,0x0413,
+0x0425,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,
+0x041F,0x042F,0x0420,0x0421,0x0422,0x0423,0x0416,0x0412,
+0x042C,0x042B,0x0417,0x0428,0x042D,0x0429,0x0427,0x042A
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_latin2
+uchar ctype_latin2_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x48,0x01,0x10,0x01,0x10,0x01,0x01,0x10,0x10,0x01,0x01,0x01,0x01,0x10,0x01,0x01,
+0x10,0x02,0x10,0x02,0x10,0x02,0x02,0x10,0x10,0x02,0x02,0x02,0x02,0x10,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10
+};
+
+uchar to_lower_latin2_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,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D0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF
+};
+
+uchar sort_order_latin2_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x44,0x45,0x48,0x49,0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x51,0x53,0x54,0x56,
+0x58,0x59,0x5A,0x5B,0x5E,0x5F,0x60,0x61,0x62,0x63,0x64,0x68,0x69,0x6A,0x6B,0x6C,
+0x6D,0x41,0x44,0x45,0x48,0x49,0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x51,0x53,0x54,0x56,
+0x58,0x59,0x5A,0x5B,0x5E,0x5F,0x60,0x61,0x62,0x63,0x64,0x6E,0x6F,0x70,0x71,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0xFF,0x42,0xFF,0x52,0xFF,0x51,0x5C,0xFF,0xFF,0x5D,0x5B,0x5E,0x65,0xFF,0x67,0x66,
+0xFF,0x42,0xFF,0x52,0xFF,0x51,0x5C,0xFF,0xFF,0x5D,0x5B,0x5E,0x65,0xFF,0x67,0x66,
+0x5A,0x43,0x43,0x43,0x43,0x51,0x46,0x45,0x47,0x49,0x4A,0x49,0x49,0x4E,0x4E,0x48,
+0xFF,0x55,0x54,0x57,0x56,0x56,0x56,0xFF,0x5A,0x5F,0x5F,0x5F,0x5F,0x63,0x5E,0xFF,
+0x5A,0x43,0x43,0x43,0x43,0x51,0x46,0x45,0x47,0x49,0x4A,0x49,0x49,0x4E,0x4E,0x48,
+0xFF,0x55,0x54,0x57,0x56,0x56,0x56,0xFF,0x5A,0x5F,0x5F,0x5F,0x5F,0x63,0x5E,0xFF
+};
+
+uint16 to_uni_latin2_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x0104,0x02D8,0x0141,0x00A4,0x013D,0x015A,0x00A7,
+0x00A8,0x0160,0x015E,0x0164,0x0179,0x00AD,0x017D,0x017B,
+0x00B0,0x0105,0x02DB,0x0142,0x00B4,0x013E,0x015B,0x02C7,
+0x00B8,0x0161,0x015F,0x0165,0x017A,0x02DD,0x017E,0x017C,
+0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7,
+0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E,
+0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7,
+0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF,
+0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7,
+0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F,
+0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7,
+0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_swe7
+uchar ctype_swe7_swedish_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x01,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,
+0x01,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x20,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
+
+uchar to_lower_swe7_swedish_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37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1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar sort_order_swe7_swedish_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x45,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5C,0x5D,0x5B,0x59,0x5F,
+0x45,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5C,0x5D,0x5B,0x59,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_swe7_swedish_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x00C9,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x00C4,0x00D6,0x00C5,0x00DC,0x005F,
+0x00E9,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x00E4,0x00F6,0x00E5,0x00FC,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_ascii
+uchar ctype_ascii_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
+
+uchar to_lower_ascii_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,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0xFF
+};
+
+uchar to_upper_ascii_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar sort_order_ascii_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5C,0x5D,0x5B,0x5E,0x5F,
+0x45,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x59,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_ascii_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp1251
+uchar ctype_cp1251_bulgarian_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x01,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x01,0x01,0x01,
+0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x02,0x02,0x02,
+0x00,0x01,0x02,0x01,0x00,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01,
+0x00,0x00,0x01,0x02,0x02,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x01,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02
+};
+
+uchar to_lower_cp1251_bulgarian_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,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2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar to_upper_cp1251_bulgarian_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x81,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x8E,0x8F,
+0xA0,0xA1,0xA1,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF
+};
+
+uchar sort_order_cp1251_bulgarian_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7C,0x7D,0x7E,0x7F,0x80,
+0x81,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x82,0x83,0x84,0x85,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x61,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x61,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0x5B,0x5C,0x5D,0x5E,0x5F,0x60,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,
+0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,
+0x5B,0x5C,0x5D,0x5E,0x5F,0x60,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,
+0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B
+};
+
+uint16 to_uni_cp1251_bulgarian_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021,
+0x0000,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F,
+0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F,
+0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7,
+0x0401,0x00A9,0x0404,0x00AB,0x00AC,0x00AD,0x00AE,0x0407,
+0x00B0,0x00B1,0x0406,0x0456,0x0491,0x00B5,0x00B6,0x00B7,
+0x0451,0x2116,0x0454,0x00BB,0x0458,0x0405,0x0455,0x0457,
+0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417,
+0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F,
+0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427,
+0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F,
+0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437,
+0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F,
+0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447,
+0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_latin1
+uchar ctype_latin1_danish_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x10,0x00,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x01,0x00,0x01,0x00,
+0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x02,0x00,0x02,0x01,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02
+};
+
+uchar to_lower_latin1_danish_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0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6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar to_upper_latin1_danish_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF
+};
+
+uchar sort_order_latin1_danish_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0x41,0x41,0x41,0x41,0x5B,0x5D,0x5B,0x43,0x45,0x45,0x45,0x45,0x49,0x49,0x49,0x49,
+0x44,0x4E,0x4F,0x4F,0x4F,0x4F,0x5C,0xD7,0x5C,0x55,0x55,0x55,0x59,0x59,0xDE,0xDF,
+0x41,0x41,0x41,0x41,0x5B,0x5D,0x5B,0x43,0x45,0x45,0x45,0x45,0x49,0x49,0x49,0x49,
+0x44,0x4E,0x4F,0x4F,0x4F,0x4F,0x5C,0xF7,0x5C,0x55,0x55,0x55,0x59,0x59,0xDE,0xFF
+};
+
+uint16 to_uni_latin1_danish_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x0081,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021,
+0x02C6,0x2030,0x0160,0x2039,0x0152,0x008D,0x017D,0x008F,
+0x0090,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x02DC,0x2122,0x0161,0x203A,0x0153,0x009D,0x017E,0x0178,
+0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
+0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
+0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
+0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
+0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,
+0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF,
+0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
+0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
+0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7,
+0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_hebrew
+uchar ctype_hebrew_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x00
+};
+
+uchar to_lower_hebrew_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar to_upper_hebrew_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,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,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_hebrew_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x0000,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
+0x00A8,0x00A9,0x00D7,0x00AB,0x00AC,0x00AD,0x00AE,0x203E,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x00B9,0x00F7,0x00BB,0x00BC,0x00BD,0x00BE,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x2017,
+0x05D0,0x05D1,0x05D2,0x05D3,0x05D4,0x05D5,0x05D6,0x05D7,
+0x05D8,0x05D9,0x05DA,0x05DB,0x05DC,0x05DD,0x05DE,0x05DF,
+0x05E0,0x05E1,0x05E2,0x05E3,0x05E4,0x05E5,0x05E6,0x05E7,
+0x05E8,0x05E9,0x05EA,0x0000,0x0000,0x0000,0x0000,0x0000
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_latin7
+uchar ctype_latin7_estonian_cs[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x01,0x20,0x10,0x20,0x10,0x10,0x00,0x00,0x20,0x10,0x20,0x10,0x20,0x10,0x10,0x10,
+0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x00,0x20,0x10,0x20,0x10,0x10,0x20,
+0x48,0x20,0x10,0x10,0x10,0x20,0x10,0x10,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10
+};
+
+uchar to_lower_latin7_estonian_cs[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0xA9,0xBA,0xAB,0xAC,0xAD,0xAE,0xBF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar to_upper_latin7_estonian_cs[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8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,0xDD,0x43,0x44,0x45,0x46,0x47,
+0x48,0x87,0x91,0x93,0x99,0x9B,0xA5,0xA7,0xAB,0xAD,0xB3,0xB5,0xB9,0xBF,0xC1,0xC7,
+0xCF,0xD1,0xD3,0xD7,0xE6,0xE9,0xEF,0xF1,0xFB,0xFD,0xDE,0x49,0x4A,0x4B,0x4C,0x1C,
+0x01,0x1D,0x57,0x1E,0x5A,0x74,0x71,0x72,0x1F,0x75,0x20,0x5B,0x21,0x4E,0x52,0x51,
+0x22,0x55,0x56,0x58,0x59,0x73,0x2A,0x2B,0x23,0xE7,0x24,0x5C,0x25,0x4F,0x54,0x26,
+0x2D,0xFE,0x66,0x67,0x68,0xFF,0x4D,0x69,0xCC,0x6A,0xD4,0x62,0x6B,0x29,0x6C,0x8E,
+0x6D,0x61,0x7D,0x7F,0x50,0x6E,0x6F,0x70,0xCD,0x7B,0xD5,0x63,0x77,0x78,0x79,0x8F,
+0x8C,0xB0,0x88,0x94,0xF4,0x8A,0xA2,0xA0,0x96,0x9C,0xDF,0x9E,0xA8,0xB6,0xAE,0xBA,
+0xDB,0xC2,0xC4,0xC8,0xCA,0xF2,0xF6,0x64,0xEC,0xBC,0xD8,0xEA,0xF8,0xE1,0xE3,0xDA,
+0x8D,0xB1,0x89,0x95,0xF5,0x8B,0xA3,0xA1,0x97,0x9D,0xE0,0x9F,0xA9,0xB7,0xAF,0xBB,
+0xDC,0xC3,0xC5,0xC9,0xCB,0xF3,0xF7,0x65,0xED,0xBD,0xD9,0xEB,0xF9,0xE2,0xE4,0x53
+};
+
+uint16 to_uni_latin7_estonian_cs[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x201D,0x00A2,0x00A3,0x00A4,0x201E,0x00A6,0x00A7,
+0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6,
+0x00B0,0x00B1,0x00B2,0x00B3,0x201C,0x00B5,0x00B6,0x00B7,
+0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6,
+0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112,
+0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B,
+0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7,
+0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF,
+0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113,
+0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C,
+0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7,
+0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x2019
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_latin2
+uchar ctype_latin2_hungarian_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x48,0x01,0x10,0x01,0x10,0x01,0x01,0x10,0x10,0x01,0x01,0x01,0x01,0x10,0x01,0x01,
+0x10,0x02,0x10,0x02,0x10,0x02,0x02,0x10,0x10,0x02,0x02,0x02,0x02,0x10,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10
+};
+
+uchar to_lower_latin2_hungarian_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xB1,0xA2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48,0x4C,0x4E,0x53,0x54,0x55,0x56,0x5A,0x5B,0x5C,0x60,0x61,0x64,
+0x69,0x6A,0x6B,0x6E,0x72,0x75,0x7A,0x7B,0x7C,0x7D,0x7F,0x83,0x84,0x85,0x86,0x87,
+0x88,0x41,0x47,0x48,0x4C,0x4E,0x53,0x54,0x55,0x56,0x5A,0x5B,0x5C,0x60,0x61,0x64,
+0x69,0x6A,0x6B,0x6E,0x72,0x75,0x7A,0x7B,0x7C,0x7D,0x7F,0x89,0x8A,0x8B,0x8C,0x00,
+0x01,0x78,0x4E,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x67,0x67,0x56,0x56,0x0F,0x41,
+0x4E,0x12,0x13,0x67,0x67,0x64,0x78,0x75,0x78,0x67,0x78,0x1C,0x1D,0x1E,0x1F,0xFF,
+0x41,0x56,0x64,0x75,0x5E,0x6F,0xFF,0x67,0xFF,0x70,0x71,0x73,0x80,0xFF,0x81,0x82,
+0xFF,0x42,0xFF,0x5D,0xFF,0x41,0x6F,0xFF,0xFF,0x70,0x71,0x73,0x80,0xFF,0x81,0x82,
+0x6C,0x41,0x44,0x45,0x46,0x5F,0x49,0x4B,0x4A,0x4E,0x51,0x52,0x50,0x56,0x57,0x4D,
+0xFF,0x62,0x63,0x64,0x66,0x67,0x67,0xFF,0x6D,0x77,0x75,0x78,0x78,0x7E,0x74,0xFF,
+0x64,0x41,0x44,0x45,0x46,0x5F,0x49,0x4B,0x4A,0x4E,0x51,0x78,0x50,0x56,0x58,0x4D,
+0xFF,0x62,0x63,0x64,0x66,0x67,0x67,0xFF,0x6D,0x77,0x75,0x78,0x78,0x7E,0x74,0xFF
+};
+
+uint16 to_uni_latin2_hungarian_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x0104,0x02D8,0x0141,0x00A4,0x013D,0x015A,0x00A7,
+0x00A8,0x0160,0x015E,0x0164,0x0179,0x00AD,0x017D,0x017B,
+0x00B0,0x0105,0x02DB,0x0142,0x00B4,0x013E,0x015B,0x02C7,
+0x00B8,0x0161,0x015F,0x0165,0x017A,0x02DD,0x017E,0x017C,
+0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7,
+0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E,
+0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7,
+0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF,
+0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7,
+0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F,
+0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7,
+0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_koi8u
+uchar ctype_koi8u_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x02,0x02,0x10,0x02,0x02,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,
+0x10,0x10,0x10,0x01,0x01,0x10,0x01,0x01,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x10,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01
+};
+
+uchar to_lower_koi8u_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x20,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x20,0x20,0x20,0xA3,0xA4,0x20,0xA6,0xA7,0x20,0x20,0x20,0x20,0x20,0xAD,0x20,0x20,
+0x20,0x20,0x20,0xA3,0xA4,0x20,0xA6,0xA7,0x20,0x20,0x20,0x20,0x20,0xAD,0x20,0x20,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF
+};
+
+uchar to_upper_koi8u_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x20,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x20,0x20,0x20,0xB3,0xB4,0x20,0xB6,0xB7,0x20,0x20,0x20,0x20,0x20,0xBD,0x20,0x20,
+0x20,0x20,0x20,0xB3,0xB4,0x20,0xB6,0xB7,0x20,0x20,0x20,0x20,0x20,0xBD,0x20,0x20,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar sort_order_koi8u_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x20,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,
+0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,0xC0,0xC1,0xC2,0xC3,0xC4,
+0xC5,0xC6,0xC7,0x88,0x87,0xC8,0x8C,0x8D,0xC9,0xCA,0xCB,0xCC,0xCD,0x84,0xCE,0xCF,
+0xD0,0xD1,0xD2,0x88,0x87,0xD3,0x8C,0x8D,0xD4,0xD5,0xD6,0xD7,0xD8,0x84,0xD9,0xDA,
+0xA3,0x80,0x81,0x9B,0x85,0x86,0x99,0x83,0x9A,0x8B,0x8E,0x8F,0x90,0x91,0x92,0x93,
+0x94,0xA4,0x95,0x96,0x97,0x98,0x89,0x82,0xA1,0xA0,0x8A,0x9D,0xA2,0x9E,0x9C,0x9F,
+0xA3,0x80,0x81,0x9B,0x85,0x86,0x99,0x83,0x9A,0x8B,0x8E,0x8F,0x90,0x91,0x92,0x93,
+0x94,0xA4,0x95,0x96,0x97,0x98,0x89,0x82,0xA1,0xA0,0x8A,0x9D,0xA2,0x9E,0x9C,0x9F
+};
+
+uint16 to_uni_koi8u_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x2500,0x2502,0x250C,0x2510,0x2514,0x2518,0x251C,0x2524,
+0x252C,0x2534,0x253C,0x2580,0x2584,0x2588,0x258C,0x2590,
+0x2591,0x2592,0x2593,0x2320,0x25A0,0x2022,0x221A,0x2248,
+0x2264,0x2265,0x00A0,0x2321,0x00B0,0x00B2,0x00B7,0x00F7,
+0x2550,0x2551,0x2552,0x0451,0x0454,0x2554,0x0456,0x0457,
+0x2557,0x2558,0x2559,0x255A,0x255B,0x0491,0x255D,0x255E,
+0x255F,0x2560,0x2561,0x0401,0x0404,0x2563,0x0406,0x0407,
+0x2566,0x2567,0x2568,0x2569,0x256A,0x0490,0x256C,0x00A9,
+0x044E,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433,
+0x0445,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,
+0x043F,0x044F,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432,
+0x044C,0x044B,0x0437,0x0448,0x044D,0x0449,0x0447,0x044A,
+0x042E,0x0410,0x0411,0x0426,0x0414,0x0415,0x0424,0x0413,
+0x0425,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,
+0x041F,0x042F,0x0420,0x0421,0x0422,0x0423,0x0416,0x0412,
+0x042C,0x042B,0x0417,0x0428,0x042D,0x0429,0x0427,0x042A
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp1251
+uchar ctype_cp1251_ukrainian_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x01,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x01,0x01,0x01,
+0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x02,0x02,0x02,
+0x00,0x01,0x02,0x01,0x00,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01,
+0x00,0x00,0x01,0x02,0x02,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x01,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02
+};
+
+uchar to_lower_cp1251_ukrainian_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x90,0x83,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B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0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x20,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,
+0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,0xC0,0xC1,0xC2,0xC3,0xC4,
+0xC5,0xC6,0xC7,0xC8,0xC9,0x84,0xCA,0xCB,0x88,0xCC,0x87,0xCD,0xCE,0xCF,0xD0,0x8D,
+0xD1,0xD2,0x8C,0x8C,0x84,0xD3,0xD4,0xD5,0x88,0xD6,0x87,0xD7,0xD8,0xD9,0xDA,0x8D,
+0x80,0x81,0x82,0x83,0x85,0x86,0x89,0x8A,0x8B,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,
+0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xA0,0xA1,0xA2,0xA3,0xA4,
+0x80,0x81,0x82,0x83,0x85,0x86,0x89,0x8A,0x8B,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,
+0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xA0,0xA1,0xA2,0xA3,0xA4
+};
+
+uint16 to_uni_cp1251_ukrainian_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021,
+0x0000,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F,
+0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F,
+0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7,
+0x0401,0x00A9,0x0404,0x00AB,0x00AC,0x00AD,0x00AE,0x0407,
+0x00B0,0x00B1,0x0406,0x0456,0x0491,0x00B5,0x00B6,0x00B7,
+0x0451,0x2116,0x0454,0x00BB,0x0458,0x0405,0x0455,0x0457,
+0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417,
+0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F,
+0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427,
+0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F,
+0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437,
+0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F,
+0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447,
+0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_greek
+uchar ctype_greek_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x48,0x10,0x10,0x10,0x00,0x00,0x10,0x10,0x10,0x10,0x00,0x10,0x10,0x10,0x00,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x01,0x01,0x01,0x10,0x01,0x10,0x01,0x01,
+0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00
+};
+
+uchar to_lower_greek_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,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
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x02BD,0x02BC,0x00A3,0x0000,0x0000,0x00A6,0x00A7,
+0x00A8,0x00A9,0x0000,0x00AB,0x00AC,0x00AD,0x0000,0x2015,
+0x00B0,0x00B1,0x00B2,0x00B3,0x0384,0x0385,0x0386,0x00B7,
+0x0388,0x0389,0x038A,0x00BB,0x038C,0x00BD,0x038E,0x038F,
+0x0390,0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397,
+0x0398,0x0399,0x039A,0x039B,0x039C,0x039D,0x039E,0x039F,
+0x03A0,0x03A1,0x0000,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7,
+0x03A8,0x03A9,0x03AA,0x03AB,0x03AC,0x03AD,0x03AE,0x03AF,
+0x03B0,0x03B1,0x03B2,0x03B3,0x03B4,0x03B5,0x03B6,0x03B7,
+0x03B8,0x03B9,0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF,
+0x03C0,0x03C1,0x03C2,0x03C3,0x03C4,0x03C5,0x03C6,0x03C7,
+0x03C8,0x03C9,0x03CA,0x03CB,0x03CC,0x03CD,0x03CE,0x0000
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp1250
+uchar ctype_cp1250_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x20,0x20,0x10,0x20,0x10,0x10,0x10,0x10,0x20,0x10,0x01,0x10,0x01,0x01,0x01,0x01,
+0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x10,0x02,0x10,0x02,0x02,0x02,0x02,
+0x48,0x10,0x10,0x01,0x10,0x01,0x10,0x01,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01,
+0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x02,0x02,0x10,0x01,0x10,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10
+};
+
+uchar to_lower_cp1250_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x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14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x46,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x52,0x53,0x55,
+0x56,0x57,0x58,0x59,0x5B,0x5C,0x5D,0x5E,0x5F,0x60,0x61,0x63,0x64,0x65,0x66,0x67,
+0x68,0x41,0x42,0x43,0x46,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x52,0x53,0x55,
+0x56,0x57,0x58,0x59,0x5B,0x5C,0x5D,0x5E,0x5F,0x60,0x61,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x5A,0x8B,0x5A,0x5B,0x62,0x62,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x5A,0x9B,0x5A,0x5B,0x62,0x62,
+0x20,0xA1,0xA2,0x50,0xA4,0x41,0xA6,0x59,0xA8,0xA9,0x59,0xAB,0xAC,0xAD,0xAE,0x62,
+0xB0,0xB1,0xB2,0x50,0xB4,0xB5,0xB6,0xB7,0xB8,0x41,0x59,0xBB,0x50,0xBD,0x50,0x62,
+0x58,0x41,0x41,0x41,0x41,0x50,0x45,0x43,0x44,0x49,0x49,0x49,0x49,0x4D,0x4D,0x46,
+0x47,0x53,0x53,0x55,0x55,0x55,0x55,0xD7,0x58,0x5C,0x5C,0x5C,0x5C,0x60,0x5B,0x59,
+0x58,0x41,0x41,0x41,0x41,0x50,0x45,0x43,0x44,0x49,0x49,0x49,0x49,0x4D,0x4D,0x46,
+0x47,0x53,0x53,0x55,0x55,0x55,0x55,0xF7,0x58,0x5C,0x5C,0x5C,0x5C,0x60,0x5B,0xFF
+};
+
+uint16 to_uni_cp1250_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021,
+0x0000,0x2030,0x0160,0x2039,0x015A,0x0164,0x017D,0x0179,
+0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x0000,0x2122,0x0161,0x203A,0x015B,0x0165,0x017E,0x017A,
+0x00A0,0x02C7,0x02D8,0x0141,0x00A4,0x0104,0x00A6,0x00A7,
+0x00A8,0x00A9,0x015E,0x00AB,0x00AC,0x00AD,0x00AE,0x017B,
+0x00B0,0x00B1,0x02DB,0x0142,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x0105,0x015F,0x00BB,0x013D,0x02DD,0x013E,0x017C,
+0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7,
+0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E,
+0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7,
+0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF,
+0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7,
+0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F,
+0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7,
+0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_latin2
+uchar ctype_latin2_croatian_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x48,0x01,0x10,0x01,0x10,0x01,0x01,0x10,0x10,0x01,0x01,0x01,0x01,0x10,0x01,0x01,
+0x10,0x02,0x10,0x02,0x10,0x02,0x02,0x10,0x10,0x02,0x02,0x02,0x02,0x10,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10
+};
+
+uchar to_lower_latin2_croatian_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x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0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x43,0x44,0x48,0x4B,0x4D,0x4E,0x4F,0x50,0x52,0x53,0x54,0x56,0x57,0x59,
+0x5B,0x5C,0x5D,0x5F,0x62,0x64,0x66,0x67,0x68,0x69,0x6B,0xC6,0xC7,0xC8,0xC9,0xCA,
+0xCB,0x41,0x43,0x44,0x48,0x4B,0x4D,0x4E,0x4F,0x50,0x52,0x53,0x54,0x56,0x57,0x59,
+0x5B,0x5C,0x5D,0x5F,0x62,0x64,0x66,0x67,0x68,0x69,0x6B,0xCC,0xCD,0xCE,0xCF,0xD0,
+0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,0xE0,
+0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,
+0xF1,0x41,0xF2,0x54,0xF3,0x54,0x5F,0xF4,0xF5,0x61,0x5F,0x62,0x6B,0xF6,0x8E,0x6B,
+0xF7,0x41,0xF8,0x54,0xF9,0x54,0x5F,0xFA,0xFB,0x61,0x5F,0x62,0x6B,0xFC,0x8E,0x6B,
+0x5D,0x41,0x41,0x41,0x41,0x54,0x47,0x44,0x46,0x4B,0x4B,0x4B,0x4B,0x50,0x50,0x48,
+0x4A,0x57,0x57,0x59,0x59,0x59,0x59,0xFD,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0x5F,
+0x5D,0x41,0x41,0x41,0x41,0x54,0x47,0x44,0x46,0x4B,0x4B,0x4B,0x4B,0x50,0x50,0x48,
+0x4A,0x57,0x57,0x59,0x59,0x59,0x59,0xFE,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0xFF
+};
+
+uint16 to_uni_latin2_croatian_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x0104,0x02D8,0x0141,0x00A4,0x013D,0x015A,0x00A7,
+0x00A8,0x0160,0x015E,0x0164,0x0179,0x00AD,0x017D,0x017B,
+0x00B0,0x0105,0x02DB,0x0142,0x00B4,0x013E,0x015B,0x02C7,
+0x00B8,0x0161,0x015F,0x0165,0x017A,0x02DD,0x017E,0x017C,
+0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7,
+0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E,
+0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7,
+0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF,
+0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7,
+0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F,
+0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7,
+0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp1257
+uchar ctype_cp1257_lithuanian_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00
+};
+
+uchar to_lower_cp1257_lithuanian_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74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xDB,0xDC,0xDD,0xDE,0xFF
+};
+
+uchar sort_order_cp1257_lithuanian_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x43,0x44,0x46,0x47,0x4A,0x4B,0x4C,0x4D,0x50,0x51,0x52,0x53,0x54,0x55,
+0x56,0x57,0x58,0x59,0x5B,0x5C,0x5F,0x60,0x61,0x4E,0xFF,0x62,0x63,0x64,0x65,0x66,
+0x67,0x41,0x43,0x44,0x46,0x47,0x4A,0x4B,0x4C,0x4D,0x50,0x51,0x52,0x53,0x54,0x55,
+0x56,0x57,0x58,0x59,0x5B,0x5C,0x5F,0x60,0x61,0x4E,0xFF,0x68,0x69,0x6A,0x6B,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+0x42,0x4F,0xFF,0xFF,0xFF,0xFF,0x48,0xFF,0x45,0xFF,0xFF,0x49,0xFF,0xFF,0xFF,0xFF,
+0x5A,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x5E,0xFF,0xFF,0x5D,0xFF,0xFF,0xFF,0xFF,
+0xFF,0x4F,0xFF,0xFF,0xFF,0xFF,0x48,0xFF,0x45,0xFF,0xFF,0x49,0xFF,0xFF,0xFF,0xFF,
+0x5A,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x5E,0xFF,0xFF,0x5D,0xFF,0xFF,0xFF,0xFF
+};
+
+uint16 to_uni_cp1257_lithuanian_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021,
+0x0000,0x2030,0x0000,0x2039,0x0000,0x00A8,0x02C7,0x00B8,
+0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x0000,0x2122,0x0000,0x203A,0x0000,0x00AF,0x02DB,0x0000,
+0x00A0,0x0000,0x00A2,0x00A3,0x00A4,0x0000,0x00A6,0x00A7,
+0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6,
+0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112,
+0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B,
+0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7,
+0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF,
+0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113,
+0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C,
+0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7,
+0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x02D9
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_latin5
+uchar ctype_latin5_turkish_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02
+};
+
+uchar to_lower_latin5_turkish_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,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0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0x49,0xDE,0xFF
+};
+
+uchar sort_order_latin5_turkish_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x45,0x46,0x47,0x48,0x4A,0x4B,0x4D,0x4E,0x4F,0x50,0x51,0x52,
+0x54,0x55,0x56,0x57,0x59,0x5A,0x5C,0x5D,0x5E,0x5F,0x60,0x61,0x62,0x63,0x64,0x65,
+0x66,0x41,0x42,0x43,0x45,0x46,0x47,0x48,0x4A,0x4C,0x4D,0x4E,0x4F,0x50,0x51,0x52,
+0x54,0x55,0x56,0x57,0x59,0x5A,0x5C,0x5D,0x5E,0x5F,0x60,0x87,0x88,0x89,0x8A,0x8B,
+0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,
+0x9C,0x9D,0x9E,0x9F,0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,
+0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,
+0xBC,0xBD,0xBE,0xBF,0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,
+0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x44,0x46,0x46,0x46,0x46,0x4C,0x4C,0x4C,0x4C,
+0x49,0x51,0x52,0x52,0x52,0x52,0x53,0xE0,0x52,0x5A,0x5A,0x5A,0x5B,0x4C,0x58,0x57,
+0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x44,0x46,0x46,0x46,0x46,0x4C,0x4C,0x4C,0x4C,
+0x49,0x51,0x52,0x52,0x52,0x52,0x53,0xFA,0x52,0x5A,0x5A,0x5A,0x5B,0x4B,0x58,0x5F
+};
+
+uint16 to_uni_latin5_turkish_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
+0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
+0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
+0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
+0x011E,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,
+0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x0130,0x015E,0x00DF,
+0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
+0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
+0x011F,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7,
+0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x0131,0x015F,0x00FF
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_armscii8
+uchar ctype_armscii8_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,
+0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,
+0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,
+0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,
+0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x10,0x10
+};
+
+uchar to_lower_armscii8_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C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F5,0xF5,0xF7,0xF7,0xF9,0xF9,0xFB,0xFB,0xFD,0xFD,0xFE,0xFF
+};
+
+uchar to_upper_armscii8_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB2,0xB4,0xB4,0xB6,0xB6,0xB8,0xB8,0xBA,0xBA,0xBC,0xBC,0xBE,0xBE,
+0xC0,0xC0,0xC2,0xC2,0xC4,0xC4,0xC6,0xC6,0xC8,0xC8,0xCA,0xCA,0xCC,0xCC,0xCE,0xCE,
+0xD0,0xD0,0xD2,0xD2,0xD4,0xD4,0xD6,0xD6,0xD8,0xD8,0xDA,0xDA,0xDC,0xDC,0xDE,0xDE,
+0xE0,0xE0,0xE2,0xE2,0xE4,0xE4,0xE6,0xE6,0xE8,0xE8,0xEA,0xEA,0xEC,0xEC,0xEE,0xEE,
+0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xFA,0xFA,0xFC,0xFC,0xFE,0xFF
+};
+
+uchar sort_order_armscii8_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_armscii8_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x2741,0x00A7,0x0589,0x0029,0x0028,0x00BB,0x00AB,
+0x2014,0x002E,0x055D,0x002C,0x002D,0x055F,0x2026,0x055C,
+0x055B,0x055E,0x0531,0x0561,0x0532,0x0562,0x0533,0x0563,
+0x0534,0x0564,0x0535,0x0565,0x0536,0x0566,0x0537,0x0567,
+0x0538,0x0568,0x0539,0x0569,0x053A,0x056A,0x053B,0x056B,
+0x053C,0x056C,0x053D,0x056D,0x053E,0x056E,0x053F,0x056F,
+0x0540,0x0570,0x0541,0x0571,0x0542,0x0572,0x0543,0x0573,
+0x0544,0x0574,0x0545,0x0575,0x0546,0x0576,0x0547,0x0577,
+0x0548,0x0578,0x0549,0x0579,0x054A,0x057A,0x054B,0x057B,
+0x054C,0x057C,0x054D,0x057D,0x054E,0x057E,0x054F,0x057F,
+0x0550,0x0580,0x0551,0x0581,0x0552,0x0582,0x0553,0x0583,
+0x0554,0x0584,0x0555,0x0585,0x0556,0x0586,0x2019,0x0027
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp866
+uchar ctype_cp866_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48
+};
+
+uchar to_lower_cp866_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0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xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF1,0xF1,0xF3,0xF3,0xF5,0xF5,0xF7,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar to_upper_cp866_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar sort_order_cp866_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x43,0x45,0x47,0x49,0x4B,0x4D,0x4F,0x51,0x53,0x55,0x57,0x59,0x5B,0x5D,
+0x5F,0x61,0x63,0x65,0x67,0x69,0x6B,0x6D,0x6F,0x71,0x73,0xBD,0xBE,0xBF,0xC0,0xC1,
+0xC2,0x41,0x43,0x45,0x47,0x49,0x4B,0x4D,0x4F,0x51,0x54,0x55,0x57,0x59,0x5B,0x5D,
+0x5F,0x61,0x63,0x65,0x67,0x69,0x6B,0x6D,0x6F,0x71,0x73,0xC3,0xC4,0xC5,0xC6,0xC7,
+0x75,0x77,0x79,0x7B,0x7D,0x7F,0x85,0x87,0x89,0x8D,0x8F,0x91,0x93,0x95,0x97,0x99,
+0x9B,0x9D,0x9F,0xA1,0xA5,0xA7,0xA9,0xAB,0xAD,0xAF,0xB1,0xB3,0xB5,0xB7,0xB9,0xBB,
+0x75,0x77,0x79,0x7B,0x7D,0x7F,0x85,0x87,0x89,0x8D,0x8F,0x91,0x93,0x95,0x97,0x99,
+0xC8,0xC9,0xCA,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF,
+0x9B,0x9D,0x9F,0xA1,0xA5,0xA7,0xA9,0xAB,0xAD,0xAF,0xB1,0xB3,0xB5,0xB7,0xB9,0xBB,
+0x81,0x81,0x83,0x83,0x8B,0x8B,0xA3,0xA3,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2
+};
+
+uint16 to_uni_cp866_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417,
+0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F,
+0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427,
+0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F,
+0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437,
+0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F,
+0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556,
+0x2555,0x2563,0x2551,0x2557,0x255D,0x255C,0x255B,0x2510,
+0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x255E,0x255F,
+0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x2567,
+0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256B,
+0x256A,0x2518,0x250C,0x2588,0x2584,0x258C,0x2590,0x2580,
+0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447,
+0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F,
+0x0401,0x0451,0x0404,0x0454,0x0407,0x0457,0x040E,0x045E,
+0x00B0,0x2219,0x00B7,0x221A,0x207F,0x00B2,0x25A0,0x00A0
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_keybcs2
+uchar ctype_keybcs2_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x01,0x02,0x82,0x02,0x02,0x01,0x01,0x02,0x82,0x81,0x01,0x01,0x02,0x02,0x01,0x01,
+0x81,0x02,0x01,0x02,0x02,0x01,0x02,0x01,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x02,0x02,0x02,0x01,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x02,0x02,0x01,0x02,0x01,0x02,0x00,0x02,0x01,0x01,0x01,0x02,0x00,0x02,0x02,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48
+};
+
+uchar to_lower_keybcs2_general_ci[] = {
+0x00,0x01,0x02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DE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xED,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar to_upper_keybcs2_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x68,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x87,0x9A,0x90,0x85,0x8E,0x85,0x86,0x80,0x89,0x89,0x8A,0x8B,0x9C,0x8A,0x8E,0x8F,
+0x90,0x92,0x92,0xA7,0x99,0x95,0xA6,0x97,0x9D,0x99,0x9A,0xA8,0x9C,0x9D,0x9E,0x9F,
+0x8F,0x8B,0x95,0x97,0xA5,0xA5,0xA6,0xA7,0xA8,0x9E,0xAB,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xE8,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar sort_order_keybcs2_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x44,0x45,0x47,0x49,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x5A,
+0x5E,0x5F,0x60,0x63,0x66,0x68,0x6C,0x6D,0x6E,0x6F,0x72,0x90,0x91,0x92,0x93,0x94,
+0x95,0x41,0x44,0x45,0x47,0x49,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x5A,
+0x5E,0x5F,0x60,0x63,0x66,0x68,0x6C,0x6D,0x6E,0x6F,0x72,0x96,0x97,0x98,0x99,0x9A,
+0x45,0x68,0x49,0x47,0x41,0x47,0x66,0x45,0x49,0x49,0x56,0x53,0x56,0x56,0x41,0x41,
+0x49,0x72,0x72,0x5A,0x5A,0x5A,0x68,0x68,0x6F,0x5A,0x68,0x63,0x56,0x6F,0x60,0x66,
+0x41,0x53,0x5A,0x68,0x58,0x58,0x68,0x5A,0x63,0x60,0x60,0x60,0xA0,0xA1,0xA2,0xA3,
+0xA4,0xA5,0xA6,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,
+0xBD,0xBE,0xBF,0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,
+0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,
+0x80,0x65,0x83,0x87,0x88,0x89,0xDD,0x8A,0x85,0x8B,0x84,0x81,0xDE,0x85,0x82,0xDF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_keybcs2_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x010C,0x00FC,0x00E9,0x010F,0x00E4,0x010E,0x0164,0x010D,
+0x011B,0x011A,0x0139,0x00CD,0x013E,0x013A,0x00C4,0x00C1,
+0x00C9,0x017E,0x017D,0x00F4,0x00F6,0x00D3,0x016F,0x00DA,
+0x00FD,0x00D6,0x00DC,0x0160,0x013D,0x00DD,0x0158,0x0165,
+0x00E1,0x00ED,0x00F3,0x00FA,0x0148,0x0147,0x016E,0x00D4,
+0x0161,0x0159,0x0155,0x0154,0x00BC,0x00A1,0x00AB,0x00BB,
+0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556,
+0x2555,0x2563,0x2551,0x2557,0x255D,0x255C,0x255B,0x2510,
+0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x255E,0x255F,
+0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x2567,
+0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256B,
+0x256A,0x2518,0x250C,0x2588,0x2584,0x258C,0x2590,0x2580,
+0x03B1,0x00DF,0x0393,0x03C0,0x03A3,0x03C3,0x00B5,0x03C4,
+0x03A6,0x0398,0x03A9,0x03B4,0x221E,0x03C6,0x03B5,0x2229,
+0x2261,0x00B1,0x2265,0x2264,0x2320,0x2321,0x00F7,0x2248,
+0x00B0,0x2219,0x00B7,0x221A,0x207F,0x00B2,0x25A0,0x00A0
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_macce
+uchar ctype_macce_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x01,0x01,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x02,0x02,0x01,0x02,0x02,0x01,
+0x02,0x01,0x02,0x02,0x01,0x02,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x02,0x02,
+0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x02,0x01,
+0x02,0x01,0x00,0x00,0x02,0x01,0x00,0x00,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,
+0x02,0x01,0x00,0x00,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x01,0x02,0x01,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x02,0x01,0x00,0x00,0x02,0x01,
+0x02,0x01,0x00,0x00,0x02,0x01,0x02,0x01,0x01,0x02,0x01,0x01,0x02,0x01,0x01,0x01,
+0x02,0x01,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x02,0x01,0x01,0x02,0x01,0x00
+};
+
+uchar to_lower_macce_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x8A,0x82,0x82,0x8E,0x88,0x9A,0x9F,0x87,0x88,0x8B,0x8A,0x8B,0x8D,0x8D,0x8E,0x90,
+0x90,0x93,0x92,0x93,0x95,0x95,0x98,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9E,0x9E,0x9F,
+0xA0,0xA1,0xAB,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xB0,
+0xB0,0xB4,0xB2,0xB3,0xB4,0xFA,0xB6,0xB7,0xB8,0xBA,0xBA,0xBC,0xBC,0xBE,0xBE,0xC0,
+0xC0,0xC4,0xC2,0xC3,0xC4,0xCB,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCE,0x9B,0xCE,0xD8,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xDA,0xDA,0xDE,0xDC,0xDD,0xDE,0xE0,
+0xE0,0xE4,0xE2,0xE3,0xE4,0xE6,0xE6,0x87,0xE9,0xE9,0x92,0xEC,0xEC,0xF0,0x97,0x99,
+0xF0,0xF3,0x9C,0xF3,0xF5,0xF5,0xF7,0xF7,0xF9,0xF9,0xFA,0xFD,0xB8,0xFD,0xAE,0xFF
+};
+
+uchar to_upper_macce_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x74,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x74,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x81,0x83,0x84,0x85,0x86,0xE7,0x84,0x89,0x80,0x89,0x8C,0x8C,0x83,0x8F,
+0x8F,0x91,0xEA,0x91,0x94,0x94,0x96,0xEE,0x96,0xEF,0x85,0xCD,0xF2,0x9D,0x9D,0x86,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xA2,0xAC,0xAD,0xFE,0xAF,
+0xAF,0xB1,0xB2,0xB3,0xB1,0xB5,0xB6,0xB7,0xFC,0xB9,0xB9,0xBB,0xBB,0xBD,0xBD,0xBF,
+0xBF,0xC1,0xC2,0xC3,0xC1,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xC5,0xCC,0xCD,0xCC,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xCF,0xD9,0xD9,0xDB,0xDC,0xDD,0xDB,0xDF,
+0xDF,0xE1,0xE2,0xE3,0xE1,0xE5,0xE5,0xE7,0xE8,0xE8,0xEA,0xEB,0xEB,0xED,0xEE,0xEF,
+0xED,0xF1,0xF2,0xF1,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xB5,0xFB,0xFC,0xFB,0xFE,0xFF
+};
+
+uchar sort_order_macce_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x46,0x47,0x4A,0x4C,0x52,0x53,0x55,0x56,0x5A,0x5B,0x5D,0x62,0x62,0x67,
+0x6F,0x70,0x71,0x75,0x79,0x81,0x88,0x89,0x8A,0x8B,0x8D,0x90,0x91,0x92,0x93,0x94,
+0x95,0x41,0x46,0x47,0x4A,0x4C,0x52,0x53,0x55,0x56,0x5A,0x5B,0x5D,0x62,0x62,0x67,
+0x6F,0x70,0x71,0x75,0x79,0x81,0x88,0x89,0x8A,0x8B,0x8D,0x96,0x97,0x98,0x99,0x9A,
+0x41,0x41,0x41,0x4C,0x41,0x67,0x81,0x41,0x41,0x47,0x41,0x47,0x47,0x47,0x4C,0x8D,
+0x8D,0x4A,0x56,0x4A,0x4C,0x4C,0x4C,0x67,0x4C,0x67,0x67,0x67,0x81,0x4C,0x4C,0x81,
+0xA0,0xA1,0x4C,0xA3,0xA4,0xA5,0xA6,0x75,0xA8,0xA9,0xAA,0x4C,0xAC,0xAD,0x53,0x56,
+0x56,0x56,0xB2,0xB3,0x56,0x5B,0xB6,0xB7,0x5D,0x5D,0x5D,0x5D,0x5D,0x5D,0x5D,0x62,
+0x62,0x62,0xC2,0xC3,0x62,0x62,0xC6,0xC7,0xC8,0xC9,0xCA,0x62,0x67,0x67,0x67,0x67,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0x67,0x71,0x71,0x71,0xDC,0xDD,0x71,0x71,
+0x71,0x75,0xE2,0xE3,0x75,0x75,0x75,0x41,0x79,0x79,0x56,0x8D,0x8D,0x81,0x67,0x67,
+0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x8B,0x8B,0x5B,0x8D,0x5D,0x8D,0x53,0xFF
+};
+
+uint16 to_uni_macce_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x00C4,0x0100,0x0101,0x00C9,0x0104,0x00D6,0x00DC,0x00E1,
+0x0105,0x010C,0x00E4,0x010D,0x0106,0x0107,0x00E9,0x0179,
+0x017A,0x010E,0x00ED,0x010F,0x0112,0x0113,0x0116,0x00F3,
+0x0117,0x00F4,0x00F6,0x00F5,0x00FA,0x011A,0x011B,0x00FC,
+0x2020,0x00B0,0x0118,0x00A3,0x00A7,0x2022,0x00B6,0x00DF,
+0x00AE,0x00A9,0x2122,0x0119,0x00A8,0x2260,0x0123,0x012E,
+0x012F,0x012A,0x2264,0x2265,0x012B,0x0136,0x2202,0x2211,
+0x0142,0x013B,0x013C,0x013D,0x013E,0x0139,0x013A,0x0145,
+0x0146,0x0143,0x00AC,0x221A,0x0144,0x0147,0x2206,0x00AB,
+0x00BB,0x2026,0x00A0,0x0148,0x0150,0x00D5,0x0151,0x014C,
+0x2013,0x2014,0x201C,0x201D,0x2018,0x2019,0x00F7,0x25CA,
+0x014D,0x0154,0x0155,0x0158,0x2039,0x203A,0x0159,0x0156,
+0x0157,0x0160,0x201A,0x201E,0x0161,0x015A,0x015B,0x00C1,
+0x0164,0x0165,0x00CD,0x017D,0x017E,0x016A,0x00D3,0x00D4,
+0x016B,0x016E,0x00DA,0x016F,0x0170,0x0171,0x0172,0x0173,
+0x00DD,0x00FD,0x0137,0x017B,0x0141,0x017C,0x0122,0x02C7
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_macroman
+uchar ctype_macroman_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x10,
+0x20,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02,
+0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x01,0x01,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x20,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x00,0x01,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
+
+uchar to_lower_macroman_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x8A,0x8C,0x8D,0x8E,0x96,0x9A,0x9F,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xBE,0xBF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0x88,0x8B,0x9B,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD8,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0x89,0x90,0x87,0x91,0x8F,0x92,0x94,0x95,0x93,0x97,0x99,
+0xF0,0x98,0x9C,0x9E,0x9D,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar to_upper_macroman_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0xE7,0xCB,0xE5,0x80,0xCC,0x81,0x82,0x83,0xE9,
+0xE6,0xE8,0xEA,0xED,0xEB,0xEC,0x84,0xEE,0xF1,0xEF,0x85,0xCD,0xF2,0xF4,0xF3,0x86,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xAE,0xAF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD9,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar sort_order_macroman_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x49,0x50,0x52,0x53,0x57,0x59,0x60,0x61,0x67,0x68,0x69,0x70,0x71,0x72,
+0x79,0x80,0x81,0x82,0x84,0x85,0x90,0x91,0x92,0x93,0x95,0xA0,0xA1,0xA2,0xA3,0xA4,
+0xA5,0x41,0x49,0x50,0x52,0x53,0x57,0x59,0x60,0x61,0x67,0x68,0x69,0x70,0x71,0x72,
+0x79,0x80,0x81,0x82,0x84,0x85,0x90,0x91,0x92,0x93,0x95,0xA6,0xA7,0xA8,0xA9,0xAA,
+0x41,0x41,0x50,0x53,0x71,0x72,0x85,0x41,0x41,0x41,0x41,0x41,0x41,0x50,0x53,0x53,
+0x53,0x53,0x61,0x61,0x61,0x61,0x71,0x72,0x72,0x72,0x72,0x72,0x85,0x85,0x85,0x85,
+0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0x82,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0x48,0x72,
+0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0x48,0x72,
+0xC6,0xC7,0xC8,0xC9,0x57,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0x41,0x41,0x72,0xD0,0xD1,
+0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0x93,0x93,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0x41,0x53,0x41,0x53,0x53,0x61,0x61,0x61,0x61,0x72,0x72,
+0xF0,0x72,0x85,0x85,0x85,0x61,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_macroman_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x00C4,0x00C5,0x00C7,0x00C9,0x00D1,0x00D6,0x00DC,0x00E1,
+0x00E0,0x00E2,0x00E4,0x00E3,0x00E5,0x00E7,0x00E9,0x00E8,
+0x00EA,0x00EB,0x00ED,0x00EC,0x00EE,0x00EF,0x00F1,0x00F3,
+0x00F2,0x00F4,0x00F6,0x00F5,0x00FA,0x00F9,0x00FB,0x00FC,
+0x2020,0x00B0,0x00A2,0x00A3,0x00A7,0x2022,0x00B6,0x00DF,
+0x00AE,0x00A9,0x2122,0x00B4,0x00A8,0x2260,0x00C6,0x00D8,
+0x221E,0x00B1,0x2264,0x2265,0x00A5,0x00B5,0x2202,0x2211,
+0x220F,0x03C0,0x222B,0x00AA,0x00BA,0x03A9,0x00E6,0x00F8,
+0x00BF,0x00A1,0x00AC,0x221A,0x0192,0x2248,0x2206,0x00AB,
+0x00BB,0x2026,0x00A0,0x00C0,0x00C3,0x00D5,0x0152,0x0153,
+0x2013,0x2014,0x201C,0x201D,0x2018,0x2019,0x00F7,0x25CA,
+0x00FF,0x0178,0x2044,0x20AC,0x2039,0x203A,0xFB01,0xFB02,
+0x2021,0x00B7,0x201A,0x201E,0x2030,0x00C2,0x00CA,0x00C1,
+0x00CB,0x00C8,0x00CD,0x00CE,0x00CF,0x00CC,0x00D3,0x00D4,
+0xF8FF,0x00D2,0x00DA,0x00DB,0x00D9,0x0131,0x02C6,0x02DC,
+0x00AF,0x02D8,0x02D9,0x02DA,0x00B8,0x02DD,0x02DB,0x02C7
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp852
+uchar ctype_cp852_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x02,0x02,0x01,0x01,0x01,
+0x01,0x01,0x02,0x02,0x02,0x01,0x02,0x01,0x02,0x01,0x01,0x01,0x02,0x01,0x00,0x02,
+0x02,0x02,0x02,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x00,0x02,0x01,0x01,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x01,0x02,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x02,0x01,0x01,0x01,0x02,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x01,0x01,0x00,
+0x01,0x02,0x01,0x01,0x02,0x02,0x01,0x02,0x01,0x01,0x02,0x01,0x02,0x01,0x02,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x02,0x00,0x48
+};
+
+uchar to_lower_cp852_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x87,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8B,0x8B,0x8C,0xAB,0x84,0x86,
+0x82,0x92,0x92,0x93,0x94,0x96,0x96,0x98,0x98,0x94,0x81,0x9C,0x9C,0x88,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA5,0xA5,0xA7,0xA7,0xA9,0xA9,0xAA,0xAB,0x9F,0xB8,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xA0,0x83,0xD8,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD0,0xD4,0x89,0xD4,0xE5,0xA1,0x8C,0xD8,0xD9,0xDA,0xDB,0xDC,0xEE,0x85,0xDF,
+0xA2,0xE1,0x93,0xE4,0xE4,0xE5,0xE7,0xE7,0xEA,0xA3,0xE8,0xFB,0xEC,0xEC,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar to_upper_cp852_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x9A,0x90,0xB6,0x8E,0xDE,0x8F,0x80,0x9D,0xD3,0x8A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0x90,0x91,0x92,0x93,0x94,
+0x95,0x41,0x47,0x48,0x4C,0x4F,0x54,0x55,0x56,0x57,0x5A,0x5B,0x5C,0x5E,0x5F,0x62,
+0x67,0x68,0x69,0x6C,0x71,0x74,0x75,0x76,0x77,0x78,0x7B,0x96,0x97,0x98,0x99,0x9A,
+0x48,0x74,0x4F,0x41,0x41,0x74,0x48,0x48,0x5C,0x4F,0x62,0x62,0x57,0x7B,0x41,0x48,
+0x4F,0x5C,0x5C,0x62,0x62,0x5C,0x5C,0x6C,0x6C,0x62,0x74,0x71,0x71,0x5C,0x9E,0x48,
+0x41,0x57,0x62,0x74,0x41,0x41,0x7B,0x7B,0x4F,0x4F,0xAA,0x7B,0x48,0x6C,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0x41,0x41,0x4F,0x6C,0xB5,0xBA,0xBB,0xBC,0x7B,0x7B,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0x41,0x41,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0x4C,0x4C,0x4C,0x4F,0x4C,0x60,0x57,0x57,0x4F,0xD9,0xDA,0xDB,0xDC,0x71,0x74,0xDF,
+0x62,0x70,0x62,0x60,0x60,0x60,0x6C,0x6C,0x69,0x74,0x69,0x74,0x78,0x78,0x71,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0x74,0x69,0x69,0xFE,0xFF
+};
+
+uint16 to_uni_cp852_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x00C7,0x00FC,0x00E9,0x00E2,0x00E4,0x016F,0x0107,0x00E7,
+0x0142,0x00EB,0x0150,0x0151,0x00EE,0x0179,0x00C4,0x0106,
+0x00C9,0x0139,0x013A,0x00F4,0x00F6,0x013D,0x013E,0x015A,
+0x015B,0x00D6,0x00DC,0x0164,0x0165,0x0141,0x00D7,0x010D,
+0x00E1,0x00ED,0x00F3,0x00FA,0x0104,0x0105,0x017D,0x017E,
+0x0118,0x0119,0x00AC,0x017A,0x010C,0x015F,0x00AB,0x00BB,
+0x2591,0x2592,0x2593,0x2502,0x2524,0x00C1,0x00C2,0x011A,
+0x015E,0x2563,0x2551,0x2557,0x255D,0x017B,0x017C,0x2510,
+0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x0102,0x0103,
+0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x00A4,
+0x0111,0x0110,0x010E,0x00CB,0x010F,0x0147,0x00CD,0x00CE,
+0x011B,0x2518,0x250C,0x2588,0x2584,0x0162,0x016E,0x2580,
+0x00D3,0x00DF,0x00D4,0x0143,0x0144,0x0148,0x0160,0x0161,
+0x0154,0x00DA,0x0155,0x0170,0x00FD,0x00DD,0x0163,0x00B4,
+0x00AD,0x02DD,0x02DB,0x02C7,0x02D8,0x00A7,0x00F7,0x00B8,
+0x00B0,0x00A8,0x02D9,0x0171,0x0158,0x0159,0x25A0,0x00A0
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_latin7
+uchar ctype_latin7_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x01,0x20,0x10,0x20,0x10,0x10,0x00,0x00,0x20,0x10,0x20,0x10,0x20,0x10,0x10,0x10,
+0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x00,0x20,0x10,0x20,0x10,0x10,0x20,
+0x48,0x20,0x10,0x10,0x10,0x20,0x10,0x10,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10
+};
+
+uchar to_lower_latin7_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xB8,0x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,0xB6,0xBA,0xC0,0xC2,0xC8,
+0xD4,0xD6,0xD8,0xDC,0xE3,0xE6,0xEE,0xF0,0xF2,0xF4,0xF6,0x42,0x43,0x44,0x45,0x46,
+0x47,0x86,0x92,0x94,0x9A,0x9C,0xA6,0xA8,0xAC,0xAE,0xB4,0xB6,0xBA,0xC0,0xC2,0xC8,
+0xD4,0xD6,0xD8,0xDC,0xE2,0xE6,0xEE,0xF0,0xF2,0xF4,0xF6,0x48,0x49,0x4A,0x4B,0x20,
+0x75,0x21,0x56,0x22,0x59,0x73,0x70,0x71,0x23,0x74,0x24,0x5A,0x25,0x4D,0x51,0x50,
+0x26,0x54,0x55,0x57,0x58,0x72,0x2E,0x2F,0x27,0xE5,0x28,0x5B,0x29,0x4E,0x53,0x2A,
+0x31,0xFE,0x65,0x66,0x67,0xFF,0x4C,0x68,0x2D,0x69,0xDA,0x61,0x6A,0x2D,0x6B,0x90,
+0x6C,0x60,0x7D,0x7F,0x4F,0x6D,0x6E,0x6F,0xD3,0x7B,0xDB,0x62,0x77,0x78,0x79,0x90,
+0x8E,0xB2,0x8A,0x96,0x88,0x8C,0xA4,0xA2,0x98,0x9E,0xF8,0xA0,0xAA,0xB8,0xB0,0xBE,
+0xE1,0xC4,0xC6,0xCA,0xCE,0xD0,0xCC,0x63,0xEC,0xBC,0xDE,0xEA,0xE8,0xFA,0xFC,0xE0,
+0x8E,0xB2,0x8A,0x96,0x88,0x8C,0xA4,0xA2,0x98,0x9E,0xF8,0xA0,0xAA,0xB8,0xB0,0xBE,
+0xE1,0xC4,0xC6,0xCA,0xCE,0xD0,0xCC,0x64,0xEC,0xBC,0xDE,0xEA,0xE8,0xFA,0xFC,0x52
+};
+
+uint16 to_uni_latin7_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x201D,0x00A2,0x00A3,0x00A4,0x201E,0x00A6,0x00A7,
+0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6,
+0x00B0,0x00B1,0x00B2,0x00B3,0x201C,0x00B5,0x00B6,0x00B7,
+0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6,
+0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112,
+0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B,
+0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7,
+0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF,
+0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113,
+0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C,
+0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7,
+0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x2019
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_latin7
+uchar ctype_latin7_general_cs[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x01,0x20,0x10,0x20,0x10,0x10,0x00,0x00,0x20,0x10,0x20,0x10,0x20,0x10,0x10,0x10,
+0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x00,0x20,0x10,0x20,0x10,0x10,0x20,
+0x48,0x20,0x10,0x10,0x10,0x20,0x10,0x10,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10
+};
+
+uchar to_lower_latin7_general_cs[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0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,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x201D,0x00A2,0x00A3,0x00A4,0x201E,0x00A6,0x00A7,
+0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6,
+0x00B0,0x00B1,0x00B2,0x00B3,0x201C,0x00B5,0x00B6,0x00B7,
+0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6,
+0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112,
+0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B,
+0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7,
+0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF,
+0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113,
+0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C,
+0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7,
+0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x2019
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_macce
+uchar ctype_macce_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x01,0x01,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x02,0x02,0x01,0x02,0x02,0x01,
+0x02,0x01,0x02,0x02,0x01,0x02,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x02,0x02,
+0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x02,0x01,
+0x02,0x01,0x00,0x00,0x02,0x01,0x00,0x00,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,
+0x02,0x01,0x00,0x00,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x01,0x02,0x01,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x02,0x01,0x00,0x00,0x02,0x01,
+0x02,0x01,0x00,0x00,0x02,0x01,0x02,0x01,0x01,0x02,0x01,0x01,0x02,0x01,0x01,0x01,
+0x02,0x01,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x02,0x01,0x01,0x02,0x01,0x00
+};
+
+uchar to_lower_macce_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x8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0x52,0x53,0x74,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x74,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x81,0x83,0x84,0x85,0x86,0xE7,0x84,0x89,0x80,0x89,0x8C,0x8C,0x83,0x8F,
+0x8F,0x91,0xEA,0x91,0x94,0x94,0x96,0xEE,0x96,0xEF,0x85,0xCD,0xF2,0x9D,0x9D,0x86,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xA2,0xAC,0xAD,0xFE,0xAF,
+0xAF,0xB1,0xB2,0xB3,0xB1,0xB5,0xB6,0xB7,0xFC,0xB9,0xB9,0xBB,0xBB,0xBD,0xBD,0xBF,
+0xBF,0xC1,0xC2,0xC3,0xC1,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xC5,0xCC,0xCD,0xCC,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xCF,0xD9,0xD9,0xDB,0xDC,0xDD,0xDB,0xDF,
+0xDF,0xE1,0xE2,0xE3,0xE1,0xE5,0xE5,0xE7,0xE8,0xE8,0xEA,0xEB,0xEB,0xED,0xEE,0xEF,
+0xED,0xF1,0xF2,0xF1,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xB5,0xFB,0xFC,0xFB,0xFE,0xFF
+};
+
+uint16 to_uni_macce_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x00C4,0x0100,0x0101,0x00C9,0x0104,0x00D6,0x00DC,0x00E1,
+0x0105,0x010C,0x00E4,0x010D,0x0106,0x0107,0x00E9,0x0179,
+0x017A,0x010E,0x00ED,0x010F,0x0112,0x0113,0x0116,0x00F3,
+0x0117,0x00F4,0x00F6,0x00F5,0x00FA,0x011A,0x011B,0x00FC,
+0x2020,0x00B0,0x0118,0x00A3,0x00A7,0x2022,0x00B6,0x00DF,
+0x00AE,0x00A9,0x2122,0x0119,0x00A8,0x2260,0x0123,0x012E,
+0x012F,0x012A,0x2264,0x2265,0x012B,0x0136,0x2202,0x2211,
+0x0142,0x013B,0x013C,0x013D,0x013E,0x0139,0x013A,0x0145,
+0x0146,0x0143,0x00AC,0x221A,0x0144,0x0147,0x2206,0x00AB,
+0x00BB,0x2026,0x00A0,0x0148,0x0150,0x00D5,0x0151,0x014C,
+0x2013,0x2014,0x201C,0x201D,0x2018,0x2019,0x00F7,0x25CA,
+0x014D,0x0154,0x0155,0x0158,0x2039,0x203A,0x0159,0x0156,
+0x0157,0x0160,0x201A,0x201E,0x0161,0x015A,0x015B,0x00C1,
+0x0164,0x0165,0x00CD,0x017D,0x017E,0x016A,0x00D3,0x00D4,
+0x016B,0x016E,0x00DA,0x016F,0x0170,0x0171,0x0172,0x0173,
+0x00DD,0x00FD,0x0137,0x017B,0x0141,0x017C,0x0122,0x02C7
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp1250
+uchar ctype_cp1250_croatian_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x20,0x20,0x10,0x20,0x10,0x10,0x10,0x10,0x20,0x10,0x01,0x10,0x01,0x01,0x01,0x01,
+0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x10,0x02,0x10,0x02,0x02,0x02,0x02,
+0x48,0x10,0x10,0x01,0x10,0x01,0x10,0x01,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01,
+0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x02,0x02,0x10,0x01,0x10,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10
+};
+
+uchar to_lower_cp1250_croatian_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9C,0x9D,0x9E,0x9F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9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C,0x3D,0x3E,0x3F,
+0x40,0x41,0x43,0x44,0x48,0x4B,0x4D,0x4E,0x4F,0x50,0x52,0x53,0x54,0x56,0x57,0x59,
+0x5B,0x5C,0x5D,0x5F,0x62,0x64,0x66,0x67,0x68,0x69,0x6B,0x90,0x91,0x92,0x93,0x94,
+0x95,0x41,0x43,0x44,0x48,0x4B,0x4D,0x4E,0x4F,0x50,0x52,0x53,0x54,0x56,0x57,0x59,
+0x5B,0x5C,0x5D,0x5F,0x62,0x64,0x66,0x67,0x68,0x69,0x6B,0x96,0x97,0x98,0x99,0x9A,
+0x9B,0x9C,0x9E,0x9F,0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0x60,0xA6,0x5F,0x62,0x6C,0x6B,
+0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0x60,0xB1,0x5F,0x62,0x6C,0x6B,
+0xB2,0xB3,0xB4,0x54,0xB5,0x41,0xB6,0xB7,0xB8,0xB9,0x5F,0xBA,0xBB,0xBC,0xBD,0x6B,
+0xBE,0xBF,0xC0,0x54,0xC1,0xC2,0xC3,0xC4,0xC5,0x41,0x5F,0xC6,0x54,0xC7,0x54,0x6B,
+0x5D,0x41,0x41,0x41,0x41,0x54,0x47,0x44,0x46,0x4B,0x4B,0x4B,0x4B,0x50,0x50,0x48,
+0x4A,0x57,0x57,0x59,0x59,0x59,0x59,0xC8,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0x5F,
+0x5D,0x41,0x41,0x41,0x41,0x54,0x47,0x44,0x46,0x4B,0x4B,0x4B,0x4B,0x50,0x50,0x48,
+0x4A,0x57,0x57,0x59,0x59,0x59,0x59,0xC9,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0xFF
+};
+
+uint16 to_uni_cp1250_croatian_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021,
+0x0000,0x2030,0x0160,0x2039,0x015A,0x0164,0x017D,0x0179,
+0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x0000,0x2122,0x0161,0x203A,0x015B,0x0165,0x017E,0x017A,
+0x00A0,0x02C7,0x02D8,0x0141,0x00A4,0x0104,0x00A6,0x00A7,
+0x00A8,0x00A9,0x015E,0x00AB,0x00AC,0x00AD,0x00AE,0x017B,
+0x00B0,0x00B1,0x02DB,0x0142,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x0105,0x015F,0x00BB,0x013D,0x02DD,0x013E,0x017C,
+0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7,
+0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E,
+0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7,
+0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF,
+0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7,
+0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F,
+0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7,
+0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_latin1
+uchar ctype_latin1_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x10,0x00,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x01,0x00,0x01,0x00,
+0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x02,0x00,0x02,0x01,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02
+};
+
+uchar to_lower_latin1_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8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ni_latin1_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x0081,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021,
+0x02C6,0x2030,0x0160,0x2039,0x0152,0x008D,0x017D,0x008F,
+0x0090,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x02DC,0x2122,0x0161,0x203A,0x0153,0x009D,0x017E,0x0178,
+0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
+0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
+0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
+0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
+0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,
+0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF,
+0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
+0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
+0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7,
+0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_latin1
+uchar ctype_latin1_general_cs[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x10,0x00,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x01,0x00,0x01,0x00,
+0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x02,0x00,0x02,0x01,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02
+};
+
+uchar to_lower_latin1_general_cs[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,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0x48,0x4A,0x4C,0x4E,0x50,0x56,0x5E,0x60,0x62,0x64,0x6E,0x70,0x72,0x74,
+0x5A,0x80,0x84,0x86,0x88,0x8A,0x8C,0xBE,0x8E,0x9D,0x9F,0xA1,0xA3,0xAD,0xB2,0xAE
+};
+
+uint16 to_uni_latin1_general_cs[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x0081,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021,
+0x02C6,0x2030,0x0160,0x2039,0x0152,0x008D,0x017D,0x008F,
+0x0090,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x02DC,0x2122,0x0161,0x203A,0x0153,0x009D,0x017E,0x0178,
+0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
+0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
+0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
+0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
+0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,
+0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF,
+0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
+0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
+0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7,
+0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp1251
+uchar ctype_cp1251_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x01,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x01,0x01,0x01,
+0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x02,0x02,0x02,
+0x00,0x01,0x02,0x01,0x00,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01,
+0x00,0x00,0x01,0x02,0x02,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x01,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02
+};
+
+uchar to_lower_cp1251_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0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,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF
+};
+
+uint16 to_uni_cp1251_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021,
+0x0000,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F,
+0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F,
+0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7,
+0x0401,0x00A9,0x0404,0x00AB,0x00AC,0x00AD,0x00AE,0x0407,
+0x00B0,0x00B1,0x0406,0x0456,0x0491,0x00B5,0x00B6,0x00B7,
+0x0451,0x2116,0x0454,0x00BB,0x0458,0x0405,0x0455,0x0457,
+0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417,
+0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F,
+0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427,
+0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F,
+0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437,
+0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F,
+0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447,
+0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp1251
+uchar ctype_cp1251_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x01,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x01,0x01,0x01,
+0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x02,0x02,0x02,
+0x00,0x01,0x02,0x01,0x00,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01,
+0x00,0x00,0x01,0x02,0x02,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x01,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02
+};
+
+uchar to_lower_cp1251_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0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x79,0x7B,0x7F,0x85,0x8B,0x8D,0x91,0x97,0x9B,0x9F,0xA3,0xA5,0xA9,0xAB,
+0xAD,0xAF,0xB1,0xB5,0xB9,0xBB,0xBD,0xBF,0xC3,0xC5,0xC7,0xC9,0xCB,0xCD,0xCF,0xD1
+};
+
+uint16 to_uni_cp1251_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021,
+0x0000,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F,
+0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F,
+0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7,
+0x0401,0x00A9,0x0404,0x00AB,0x00AC,0x00AD,0x00AE,0x0407,
+0x00B0,0x00B1,0x0406,0x0456,0x0491,0x00B5,0x00B6,0x00B7,
+0x0451,0x2116,0x0454,0x00BB,0x0458,0x0405,0x0455,0x0457,
+0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417,
+0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F,
+0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427,
+0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F,
+0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437,
+0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F,
+0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447,
+0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp1251
+uchar ctype_cp1251_general_cs[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x01,0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x01,0x01,0x01,
+0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x02,0x02,0x02,
+0x00,0x01,0x02,0x01,0x00,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01,
+0x00,0x00,0x01,0x02,0x02,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x01,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02
+};
+
+uchar to_lower_cp1251_general_cs[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,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E,0xDF
+};
+
+uchar sort_order_cp1251_general_cs[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x43,0x45,0x47,0x49,0x4B,0x4D,0x4F,0x51,0x53,0x55,0x57,0x59,0x5B,0x5D,
+0x5F,0x61,0x63,0x65,0x67,0x69,0x6B,0x6D,0x6F,0x71,0x73,0xD3,0xD4,0xD5,0xD6,0xD7,
+0xD8,0x42,0x44,0x46,0x48,0x4A,0x4C,0x4E,0x50,0x52,0x54,0x56,0x58,0x5A,0x5C,0x5E,
+0x60,0x62,0x64,0x66,0x68,0x6A,0x6C,0x6E,0x70,0x72,0x74,0xD9,0xDA,0xDB,0xDC,0xDD,
+0x81,0x83,0xDE,0x84,0xDF,0xE0,0xE1,0xE2,0xE3,0xE4,0xA1,0xE5,0xA7,0x9D,0xB3,0xC1,
+0x82,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xA2,0xEF,0xA8,0x9E,0xB4,0xC2,
+0xF0,0xB7,0xB8,0x99,0xF1,0x7D,0xF2,0xF3,0x87,0xF4,0x89,0xF5,0xF6,0xF7,0xF8,0x95,
+0xF9,0xFA,0x93,0x94,0x7E,0xFB,0xFC,0xFD,0x88,0xFE,0x8A,0xFF,0x9A,0x8F,0x90,0x96,
+0x75,0x77,0x79,0x7B,0x7F,0x85,0x8B,0x8D,0x91,0x97,0x9B,0x9F,0xA3,0xA5,0xA9,0xAB,
+0xAD,0xAF,0xB1,0xB5,0xB9,0xBB,0xBD,0xBF,0xC3,0xC5,0xC7,0xC9,0xCB,0xCD,0xCF,0xD1,
+0x76,0x78,0x7A,0x7C,0x80,0x86,0x8C,0x8E,0x92,0x98,0x9C,0xA0,0xA4,0xA6,0xAA,0xAC,
+0xAE,0xB0,0xB2,0xB6,0xBA,0xBC,0xBE,0xC0,0xC4,0xC6,0xC8,0xCA,0xCC,0xCE,0xD0,0xD2
+};
+
+uint16 to_uni_cp1251_general_cs[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021,
+0x0000,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F,
+0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F,
+0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7,
+0x0401,0x00A9,0x0404,0x00AB,0x00AC,0x00AD,0x00AE,0x0407,
+0x00B0,0x00B1,0x0406,0x0456,0x0491,0x00B5,0x00B6,0x00B7,
+0x0451,0x2116,0x0454,0x00BB,0x0458,0x0405,0x0455,0x0457,
+0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417,
+0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F,
+0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427,
+0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F,
+0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437,
+0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F,
+0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447,
+0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_macroman
+uchar ctype_macroman_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x10,
+0x20,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02,
+0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x01,0x01,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x20,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x00,0x01,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
+
+uchar to_lower_macroman_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0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,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_macroman_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x00C4,0x00C5,0x00C7,0x00C9,0x00D1,0x00D6,0x00DC,0x00E1,
+0x00E0,0x00E2,0x00E4,0x00E3,0x00E5,0x00E7,0x00E9,0x00E8,
+0x00EA,0x00EB,0x00ED,0x00EC,0x00EE,0x00EF,0x00F1,0x00F3,
+0x00F2,0x00F4,0x00F6,0x00F5,0x00FA,0x00F9,0x00FB,0x00FC,
+0x2020,0x00B0,0x00A2,0x00A3,0x00A7,0x2022,0x00B6,0x00DF,
+0x00AE,0x00A9,0x2122,0x00B4,0x00A8,0x2260,0x00C6,0x00D8,
+0x221E,0x00B1,0x2264,0x2265,0x00A5,0x00B5,0x2202,0x2211,
+0x220F,0x03C0,0x222B,0x00AA,0x00BA,0x03A9,0x00E6,0x00F8,
+0x00BF,0x00A1,0x00AC,0x221A,0x0192,0x2248,0x2206,0x00AB,
+0x00BB,0x2026,0x00A0,0x00C0,0x00C3,0x00D5,0x0152,0x0153,
+0x2013,0x2014,0x201C,0x201D,0x2018,0x2019,0x00F7,0x25CA,
+0x00FF,0x0178,0x2044,0x20AC,0x2039,0x203A,0xFB01,0xFB02,
+0x2021,0x00B7,0x201A,0x201E,0x2030,0x00C2,0x00CA,0x00C1,
+0x00CB,0x00C8,0x00CD,0x00CE,0x00CF,0x00CC,0x00D3,0x00D4,
+0xF8FF,0x00D2,0x00DA,0x00DB,0x00D9,0x0131,0x02C6,0x02DC,
+0x00AF,0x02D8,0x02D9,0x02DA,0x00B8,0x02DD,0x02DB,0x02C7
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp1256
+uchar ctype_cp1256_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x00,0x00,
+0x00,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x00,0x03,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x03,0x00,
+0x03,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
+0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x00,0x00,
+0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x10,
+0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
+0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
+0x02,0x03,0x02,0x03,0x03,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02,
+0x03,0x03,0x03,0x03,0x02,0x03,0x03,0x00,0x03,0x02,0x03,0x02,0x02,0x00,0x00,0x00
+};
+
+uchar to_lower_cp1256_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x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xFE,0xFF
+};
+
+uchar sort_order_cp1256_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x45,0x47,0x4A,0x4C,0x52,0x55,0x57,0x59,0x5D,0x5F,0x61,0x63,0x65,0x67,
+0x6C,0x6E,0x70,0x72,0x74,0x76,0x7B,0x7D,0x7F,0x81,0x83,0xB9,0xBA,0xBB,0xBC,0xBD,
+0xBE,0x41,0x45,0x47,0x4A,0x4C,0x52,0x55,0x57,0x59,0x5D,0x5F,0x61,0x63,0x65,0x67,
+0x6C,0x6E,0x70,0x72,0x74,0x76,0x7B,0x7D,0x7F,0x81,0x83,0xBF,0xC0,0xC1,0xC2,0xC3,
+0xC4,0x8E,0xC5,0x54,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0x6A,0x92,0x99,0xCE,
+0xA5,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0x6A,0xDA,0xDB,0xDC,
+0xDD,0xB6,0xDE,0xDF,0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,
+0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xB7,0xF6,0xF7,0xF8,0xF9,0xB8,
+0xFA,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x9F,0x90,0x91,0x93,0x94,0x95,
+0x96,0x97,0x98,0x9A,0x9B,0x9C,0x9D,0xFB,0x9E,0x9F,0xA0,0xA1,0xAD,0xA2,0xA3,0xA4,
+0x43,0xA6,0x44,0xA7,0xA8,0xA9,0xAA,0x49,0x4E,0x4F,0x50,0x51,0xAB,0xAC,0x5B,0x5C,
+0xAE,0xAF,0xB0,0xB1,0x69,0xB2,0xB3,0xFC,0xB4,0x78,0xB5,0x79,0x7A,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_cp1256_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x067E,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021,
+0x02C6,0x2030,0x0000,0x2039,0x0152,0x0686,0x0698,0x0000,
+0x06AF,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x0000,0x2122,0x0000,0x203A,0x0153,0x200C,0x200D,0x0000,
+0x00A0,0x060C,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
+0x00A8,0x00A9,0x0000,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x00B9,0x061B,0x00BB,0x00BC,0x00BD,0x00BE,0x061F,
+0x0000,0x0621,0x0622,0x0623,0x0624,0x0625,0x0626,0x0627,
+0x0628,0x0629,0x062A,0x062B,0x062C,0x062D,0x062E,0x062F,
+0x0630,0x0631,0x0632,0x0633,0x0634,0x0635,0x0636,0x00D7,
+0x0637,0x0638,0x0639,0x063A,0x0640,0x0641,0x0642,0x0643,
+0x00E0,0x0644,0x00E2,0x0645,0x0646,0x0647,0x0648,0x00E7,
+0x00E8,0x00E9,0x00EA,0x00EB,0x0649,0x064A,0x00EE,0x00EF,
+0x064B,0x064C,0x064D,0x064E,0x00F4,0x064F,0x0650,0x00F7,
+0x0651,0x00F9,0x0652,0x00FB,0x00FC,0x200E,0x200F,0x0000
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp1257
+uchar ctype_cp1257_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00
+};
+
+uchar to_lower_cp1257_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+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A,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF
+};
+
+uint16 to_uni_cp1257_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021,
+0x0000,0x2030,0x0000,0x2039,0x0000,0x00A8,0x02C7,0x00B8,
+0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x0000,0x2122,0x0000,0x203A,0x0000,0x00AF,0x02DB,0x0000,
+0x00A0,0x0000,0x00A2,0x00A3,0x00A4,0x0000,0x00A6,0x00A7,
+0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6,
+0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112,
+0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B,
+0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7,
+0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF,
+0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113,
+0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C,
+0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7,
+0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x02D9
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp1257
+uchar ctype_cp1257_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00
+};
+
+uchar to_lower_cp1257_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78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xFF
+};
+
+uchar sort_order_cp1257_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x4D,0x4F,0x55,0x57,0x61,0x63,0x67,0x69,0x6F,0x71,0x75,0x7B,0x7D,0x83,
+0x8F,0x91,0x93,0x97,0x9E,0xA0,0xA8,0xAA,0xAC,0xAE,0xB0,0xB8,0xB9,0xBA,0xBB,0xBC,
+0xBD,0x41,0x4D,0x4F,0x55,0x57,0x61,0x63,0x67,0x69,0x6F,0x71,0x75,0x7B,0x7D,0x83,
+0x8F,0x91,0x93,0x97,0x9E,0xA0,0xA8,0xAA,0xAC,0xAE,0xB0,0xBE,0xBF,0xC0,0xC1,0xC4,
+0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,
+0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,0xE0,0xE1,0xE2,0xE3,0xE4,
+0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0x83,0xED,0x93,0xEE,0xEF,0xF0,0xF1,0x41,
+0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0x83,0xFA,0x93,0xFB,0xFC,0xFD,0xFE,0x41,
+0x41,0x69,0x41,0x4F,0x41,0x41,0x57,0x57,0x4F,0x57,0xB0,0x57,0x63,0x71,0x69,0x75,
+0x97,0x7D,0x7D,0x83,0x83,0x83,0x83,0xC2,0xA0,0x75,0x97,0xA0,0xA0,0xB0,0xB0,0x97,
+0x41,0x69,0x41,0x4F,0x41,0x41,0x57,0x57,0x4F,0x57,0xB0,0x57,0x63,0x71,0x69,0x75,
+0x97,0x7D,0x7D,0x83,0x83,0x83,0x83,0xC3,0xA0,0x75,0x97,0xA0,0xA0,0xB0,0xB0,0xFF
+};
+
+uint16 to_uni_cp1257_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021,
+0x0000,0x2030,0x0000,0x2039,0x0000,0x00A8,0x02C7,0x00B8,
+0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x0000,0x2122,0x0000,0x203A,0x0000,0x00AF,0x02DB,0x0000,
+0x00A0,0x0000,0x00A2,0x00A3,0x00A4,0x0000,0x00A6,0x00A7,
+0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6,
+0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112,
+0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B,
+0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7,
+0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF,
+0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113,
+0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C,
+0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7,
+0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x02D9
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_armscii8
+uchar ctype_armscii8_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,
+0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,
+0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,
+0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,
+0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x10,0x10
+};
+
+uchar to_lower_armscii8_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x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EC,0xEE,0xEE,
+0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xFA,0xFA,0xFC,0xFC,0xFE,0xFF
+};
+
+uint16 to_uni_armscii8_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x2741,0x00A7,0x0589,0x0029,0x0028,0x00BB,0x00AB,
+0x2014,0x002E,0x055D,0x002C,0x002D,0x055F,0x2026,0x055C,
+0x055B,0x055E,0x0531,0x0561,0x0532,0x0562,0x0533,0x0563,
+0x0534,0x0564,0x0535,0x0565,0x0536,0x0566,0x0537,0x0567,
+0x0538,0x0568,0x0539,0x0569,0x053A,0x056A,0x053B,0x056B,
+0x053C,0x056C,0x053D,0x056D,0x053E,0x056E,0x053F,0x056F,
+0x0540,0x0570,0x0541,0x0571,0x0542,0x0572,0x0543,0x0573,
+0x0544,0x0574,0x0545,0x0575,0x0546,0x0576,0x0547,0x0577,
+0x0548,0x0578,0x0549,0x0579,0x054A,0x057A,0x054B,0x057B,
+0x054C,0x057C,0x054D,0x057D,0x054E,0x057E,0x054F,0x057F,
+0x0550,0x0580,0x0551,0x0581,0x0552,0x0582,0x0553,0x0583,
+0x0554,0x0584,0x0555,0x0585,0x0556,0x0586,0x2019,0x0027
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_ascii
+uchar ctype_ascii_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
+
+uchar to_lower_ascii_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,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+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp1250
+uchar ctype_cp1250_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x20,0x20,0x10,0x20,0x10,0x10,0x10,0x10,0x20,0x10,0x01,0x10,0x01,0x01,0x01,0x01,
+0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x10,0x02,0x10,0x02,0x02,0x02,0x02,
+0x48,0x10,0x10,0x01,0x10,0x01,0x10,0x01,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01,
+0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x02,0x02,0x10,0x01,0x10,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10
+};
+
+uchar to_lower_cp1250_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x9A,0x8B,0x9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D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xA5,0xAA,0xBB,0xBC,0xBD,0xBC,0xAF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF
+};
+
+uint16 to_uni_cp1250_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021,
+0x0000,0x2030,0x0160,0x2039,0x015A,0x0164,0x017D,0x0179,
+0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x0000,0x2122,0x0161,0x203A,0x015B,0x0165,0x017E,0x017A,
+0x00A0,0x02C7,0x02D8,0x0141,0x00A4,0x0104,0x00A6,0x00A7,
+0x00A8,0x00A9,0x015E,0x00AB,0x00AC,0x00AD,0x00AE,0x017B,
+0x00B0,0x00B1,0x02DB,0x0142,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x0105,0x015F,0x00BB,0x013D,0x02DD,0x013E,0x017C,
+0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7,
+0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E,
+0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7,
+0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF,
+0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7,
+0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F,
+0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7,
+0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp1256
+uchar ctype_cp1256_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x00,0x00,
+0x00,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x00,0x03,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x03,0x00,
+0x03,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
+0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x00,0x00,
+0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x10,
+0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
+0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
+0x02,0x03,0x02,0x03,0x03,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02,
+0x03,0x03,0x03,0x03,0x02,0x03,0x03,0x00,0x03,0x02,0x03,0x02,0x02,0x00,0x00,0x00
+};
+
+uchar to_lower_cp1256_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x54,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x9C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0x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x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7F,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x8C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_cp1256_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x067E,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021,
+0x02C6,0x2030,0x0000,0x2039,0x0152,0x0686,0x0698,0x0000,
+0x06AF,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x0000,0x2122,0x0000,0x203A,0x0153,0x200C,0x200D,0x0000,
+0x00A0,0x060C,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
+0x00A8,0x00A9,0x0000,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x00B9,0x061B,0x00BB,0x00BC,0x00BD,0x00BE,0x061F,
+0x0000,0x0621,0x0622,0x0623,0x0624,0x0625,0x0626,0x0627,
+0x0628,0x0629,0x062A,0x062B,0x062C,0x062D,0x062E,0x062F,
+0x0630,0x0631,0x0632,0x0633,0x0634,0x0635,0x0636,0x00D7,
+0x0637,0x0638,0x0639,0x063A,0x0640,0x0641,0x0642,0x0643,
+0x00E0,0x0644,0x00E2,0x0645,0x0646,0x0647,0x0648,0x00E7,
+0x00E8,0x00E9,0x00EA,0x00EB,0x0649,0x064A,0x00EE,0x00EF,
+0x064B,0x064C,0x064D,0x064E,0x00F4,0x064F,0x0650,0x00F7,
+0x0651,0x00F9,0x0652,0x00FB,0x00FC,0x200E,0x200F,0x0000
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp866
+uchar ctype_cp866_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48
+};
+
+uchar to_lower_cp866_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0x86,0x87,0x88,0x89,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0x86,0x87,0x88,0x89,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF1,0xF1,0xF3,0xF3,0xF5,0xF5,0xF7,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar to_upper_cp866_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_cp866_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417,
+0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F,
+0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427,
+0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F,
+0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437,
+0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F,
+0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556,
+0x2555,0x2563,0x2551,0x2557,0x255D,0x255C,0x255B,0x2510,
+0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x255E,0x255F,
+0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x2567,
+0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256B,
+0x256A,0x2518,0x250C,0x2588,0x2584,0x258C,0x2590,0x2580,
+0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447,
+0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F,
+0x0401,0x0451,0x0404,0x0454,0x0407,0x0457,0x040E,0x045E,
+0x00B0,0x2219,0x00B7,0x221A,0x207F,0x00B2,0x25A0,0x00A0
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_dec8
+uchar ctype_dec8_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02
+};
+
+uchar to_lower_dec8_bin[] = {
+0x00,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C,0xFD,0xFE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar to_upper_dec8_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF
+};
+
+uint16 to_uni_dec8_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x00A1,0x00A2,0x00A3,0x0000,0x00A5,0x0000,0x00A7,
+0x00A4,0x00A9,0x00AA,0x00AB,0x0000,0x0000,0x0000,0x0000,
+0x00B0,0x00B1,0x00B2,0x00B3,0x0000,0x00B5,0x00B6,0x00B7,
+0x0000,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x0000,0x00BF,
+0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
+0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
+0x0000,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x0152,
+0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x0178,0x0000,0x00DF,
+0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
+0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
+0x0000,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x0153,
+0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FF,0x0000,0x0000
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_greek
+uchar ctype_greek_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x48,0x10,0x10,0x10,0x00,0x00,0x10,0x10,0x10,0x10,0x00,0x10,0x10,0x10,0x00,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x01,0x01,0x01,0x10,0x01,0x10,0x01,0x01,
+0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00
+};
+
+uchar to_lower_greek_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,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,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar to_upper_greek_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xDA,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xC1,0xC5,0xC7,0xC9,
+0xDB,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD3,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xCF,0xD5,0xD9,0xFF
+};
+
+uint16 to_uni_greek_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x02BD,0x02BC,0x00A3,0x0000,0x0000,0x00A6,0x00A7,
+0x00A8,0x00A9,0x0000,0x00AB,0x00AC,0x00AD,0x0000,0x2015,
+0x00B0,0x00B1,0x00B2,0x00B3,0x0384,0x0385,0x0386,0x00B7,
+0x0388,0x0389,0x038A,0x00BB,0x038C,0x00BD,0x038E,0x038F,
+0x0390,0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397,
+0x0398,0x0399,0x039A,0x039B,0x039C,0x039D,0x039E,0x039F,
+0x03A0,0x03A1,0x0000,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7,
+0x03A8,0x03A9,0x03AA,0x03AB,0x03AC,0x03AD,0x03AE,0x03AF,
+0x03B0,0x03B1,0x03B2,0x03B3,0x03B4,0x03B5,0x03B6,0x03B7,
+0x03B8,0x03B9,0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF,
+0x03C0,0x03C1,0x03C2,0x03C3,0x03C4,0x03C5,0x03C6,0x03C7,
+0x03C8,0x03C9,0x03CA,0x03CB,0x03CC,0x03CD,0x03CE,0x0000
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_hebrew
+uchar ctype_hebrew_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x00
+};
+
+uchar to_lower_hebrew_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,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hebrew_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_hebrew_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x0000,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
+0x00A8,0x00A9,0x00D7,0x00AB,0x00AC,0x00AD,0x00AE,0x203E,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x00B9,0x00F7,0x00BB,0x00BC,0x00BD,0x00BE,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x2017,
+0x05D0,0x05D1,0x05D2,0x05D3,0x05D4,0x05D5,0x05D6,0x05D7,
+0x05D8,0x05D9,0x05DA,0x05DB,0x05DC,0x05DD,0x05DE,0x05DF,
+0x05E0,0x05E1,0x05E2,0x05E3,0x05E4,0x05E5,0x05E6,0x05E7,
+0x05E8,0x05E9,0x05EA,0x0000,0x0000,0x0000,0x0000,0x0000
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_hp8
+uchar ctype_hp8_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x02,0x02,
+0x01,0x10,0x10,0x01,0x02,0x10,0x10,0x02,0x01,0x10,0x01,0x01,0x01,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x20,0x20,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20
+};
+
+uchar to_lower_hp8_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0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0xEE,
+0xF0,0xF0,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_hp8_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x00C0,0x00C2,0x00C8,0x00CA,0x00CB,0x00CE,0x00CF,
+0x00B4,0x02CB,0x02C6,0x00A8,0x02DC,0x00D9,0x00DB,0x20A4,
+0x00AF,0x00DD,0x00FD,0x00B0,0x00C7,0x00E7,0x00D1,0x00F1,
+0x00A1,0x00BF,0x00A4,0x00A3,0x00A5,0x00A7,0x0192,0x00A2,
+0x00E2,0x00EA,0x00F4,0x00FB,0x00E1,0x00E9,0x00F3,0x00FA,
+0x00E0,0x00E8,0x00F2,0x00F9,0x00E4,0x00EB,0x00F6,0x00FC,
+0x00C5,0x00EE,0x00D8,0x00C6,0x00E5,0x00ED,0x00F8,0x00E6,
+0x00C4,0x00EC,0x00D6,0x00DC,0x00C9,0x00EF,0x00DF,0x00D4,
+0x00C1,0x00C3,0x00E3,0x00D0,0x00F0,0x00CD,0x00CC,0x00D3,
+0x00D2,0x00D5,0x00F5,0x0160,0x0161,0x00DA,0x0178,0x00FF,
+0x00DE,0x00FE,0x00B7,0x00B5,0x00B6,0x00BE,0x2014,0x00BC,
+0x00BD,0x00AA,0x00BA,0x00AB,0x25A0,0x00BB,0x00B1,0x0000
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_keybcs2
+uchar ctype_keybcs2_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x01,0x02,0x82,0x02,0x02,0x01,0x01,0x02,0x82,0x81,0x01,0x01,0x02,0x02,0x01,0x01,
+0x81,0x02,0x01,0x02,0x02,0x01,0x02,0x01,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x02,0x02,0x02,0x01,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x02,0x02,0x01,0x02,0x01,0x02,0x00,0x02,0x01,0x01,0x01,0x02,0x00,0x02,0x02,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48
+};
+
+uchar to_lower_keybcs2_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0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C,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_keybcs2_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x010C,0x00FC,0x00E9,0x010F,0x00E4,0x010E,0x0164,0x010D,
+0x011B,0x011A,0x0139,0x00CD,0x013E,0x013A,0x00C4,0x00C1,
+0x00C9,0x017E,0x017D,0x00F4,0x00F6,0x00D3,0x016F,0x00DA,
+0x00FD,0x00D6,0x00DC,0x0160,0x013D,0x00DD,0x0158,0x0165,
+0x00E1,0x00ED,0x00F3,0x00FA,0x0148,0x0147,0x016E,0x00D4,
+0x0161,0x0159,0x0155,0x0154,0x00BC,0x00A1,0x00AB,0x00BB,
+0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556,
+0x2555,0x2563,0x2551,0x2557,0x255D,0x255C,0x255B,0x2510,
+0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x255E,0x255F,
+0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x2567,
+0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256B,
+0x256A,0x2518,0x250C,0x2588,0x2584,0x258C,0x2590,0x2580,
+0x03B1,0x00DF,0x0393,0x03C0,0x03A3,0x03C3,0x00B5,0x03C4,
+0x03A6,0x0398,0x03A9,0x03B4,0x221E,0x03C6,0x03B5,0x2229,
+0x2261,0x00B1,0x2265,0x2264,0x2320,0x2321,0x00F7,0x2248,
+0x00B0,0x2219,0x00B7,0x221A,0x207F,0x00B2,0x25A0,0x00A0
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_koi8r
+uchar ctype_koi8r_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01
+};
+
+uchar to_lower_koi8r_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x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000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x2500,0x2502,0x250C,0x2510,0x2514,0x2518,0x251C,0x2524,
+0x252C,0x2534,0x253C,0x2580,0x2584,0x2588,0x258C,0x2590,
+0x2591,0x2592,0x2593,0x2320,0x25A0,0x2219,0x221A,0x2248,
+0x2264,0x2265,0x00A0,0x2321,0x00B0,0x00B2,0x00B7,0x00F7,
+0x2550,0x2551,0x2552,0x0451,0x2553,0x2554,0x2555,0x2556,
+0x2557,0x2558,0x2559,0x255A,0x255B,0x255C,0x255D,0x255E,
+0x255F,0x2560,0x2561,0x0401,0x2562,0x2563,0x2564,0x2565,
+0x2566,0x2567,0x2568,0x2569,0x256A,0x256B,0x256C,0x00A9,
+0x044E,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433,
+0x0445,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,
+0x043F,0x044F,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432,
+0x044C,0x044B,0x0437,0x0448,0x044D,0x0449,0x0447,0x044A,
+0x042E,0x0410,0x0411,0x0426,0x0414,0x0415,0x0424,0x0413,
+0x0425,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,
+0x041F,0x042F,0x0420,0x0421,0x0422,0x0423,0x0416,0x0412,
+0x042C,0x042B,0x0417,0x0428,0x042D,0x0429,0x0427,0x042A
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_koi8u
+uchar ctype_koi8u_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x02,0x02,0x10,0x02,0x02,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,
+0x10,0x10,0x10,0x01,0x01,0x10,0x01,0x01,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x10,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01
+};
+
+uchar to_lower_koi8u_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x20,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x20,0x20,0x20,0xA3,0xA4,0x20,0xA6,0xA7,0x20,0x20,0x20,0x20,0x20,0xAD,0x20,0x20,
+0x20,0x20,0x20,0xA3,0xA4,0x20,0xA6,0xA7,0x20,0x20,0x20,0x20,0x20,0xAD,0x20,0x20,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF
+};
+
+uchar to_upper_koi8u_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x20,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x20,0x20,0x20,0xB3,0xB4,0x20,0xB6,0xB7,0x20,0x20,0x20,0x20,0x20,0xBD,0x20,0x20,
+0x20,0x20,0x20,0xB3,0xB4,0x20,0xB6,0xB7,0x20,0x20,0x20,0x20,0x20,0xBD,0x20,0x20,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_koi8u_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x2500,0x2502,0x250C,0x2510,0x2514,0x2518,0x251C,0x2524,
+0x252C,0x2534,0x253C,0x2580,0x2584,0x2588,0x258C,0x2590,
+0x2591,0x2592,0x2593,0x2320,0x25A0,0x2022,0x221A,0x2248,
+0x2264,0x2265,0x00A0,0x2321,0x00B0,0x00B2,0x00B7,0x00F7,
+0x2550,0x2551,0x2552,0x0451,0x0454,0x2554,0x0456,0x0457,
+0x2557,0x2558,0x2559,0x255A,0x255B,0x0491,0x255D,0x255E,
+0x255F,0x2560,0x2561,0x0401,0x0404,0x2563,0x0406,0x0407,
+0x2566,0x2567,0x2568,0x2569,0x256A,0x0490,0x256C,0x00A9,
+0x044E,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433,
+0x0445,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,
+0x043F,0x044F,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432,
+0x044C,0x044B,0x0437,0x0448,0x044D,0x0449,0x0447,0x044A,
+0x042E,0x0410,0x0411,0x0426,0x0414,0x0415,0x0424,0x0413,
+0x0425,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,
+0x041F,0x042F,0x0420,0x0421,0x0422,0x0423,0x0416,0x0412,
+0x042C,0x042B,0x0417,0x0428,0x042D,0x0429,0x0427,0x042A
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_latin2
+uchar ctype_latin2_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x48,0x01,0x10,0x01,0x10,0x01,0x01,0x10,0x10,0x01,0x01,0x01,0x01,0x10,0x01,0x01,
+0x10,0x02,0x10,0x02,0x10,0x02,0x02,0x10,0x10,0x02,0x02,0x02,0x02,0x10,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10
+};
+
+uchar to_lower_latin2_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xB1,0xA2,0xB3,0xA4,0xB5,0xB6,0xA7,0xA8,0xB9,0xBA,0xBB,0xBC,0xAD,0xBE,0xBF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar to_upper_latin2_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xA1,0xB2,0xA3,0xB4,0xA5,0xA6,0xB7,0xB8,0xA9,0xAA,0xAB,0xAC,0xBD,0xAE,0xAF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF
+};
+
+uint16 to_uni_latin2_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x0104,0x02D8,0x0141,0x00A4,0x013D,0x015A,0x00A7,
+0x00A8,0x0160,0x015E,0x0164,0x0179,0x00AD,0x017D,0x017B,
+0x00B0,0x0105,0x02DB,0x0142,0x00B4,0x013E,0x015B,0x02C7,
+0x00B8,0x0161,0x015F,0x0165,0x017A,0x02DD,0x017E,0x017C,
+0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7,
+0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E,
+0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7,
+0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF,
+0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7,
+0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F,
+0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7,
+0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_latin5
+uchar ctype_latin5_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02
+};
+
+uchar to_lower_latin5_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0xFD,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xD7,0xF8,0xF9,0xFA,0xFB,0xFC,0x69,0xFE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar to_upper_latin5_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0xDD,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0x49,0xDE,0xFF
+};
+
+uint16 to_uni_latin5_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
+0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
+0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
+0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
+0x011E,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,
+0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x0130,0x015E,0x00DF,
+0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
+0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
+0x011F,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7,
+0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x0131,0x015F,0x00FF
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_latin7
+uchar ctype_latin7_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x01,0x20,0x10,0x20,0x10,0x10,0x00,0x00,0x20,0x10,0x20,0x10,0x20,0x10,0x10,0x10,
+0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x00,0x20,0x10,0x20,0x10,0x10,0x20,
+0x48,0x20,0x10,0x10,0x10,0x20,0x10,0x10,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10
+};
+
+uchar to_lower_latin7_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,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E7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uchar to_upper_latin7_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
+0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xBC,0xBD,0xBE,0xAF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF
+};
+
+uint16 to_uni_latin7_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
+0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
+0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
+0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F,
+0x00A0,0x201D,0x00A2,0x00A3,0x00A4,0x201E,0x00A6,0x00A7,
+0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6,
+0x00B0,0x00B1,0x00B2,0x00B3,0x201C,0x00B5,0x00B6,0x00B7,
+0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6,
+0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112,
+0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B,
+0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7,
+0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF,
+0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113,
+0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C,
+0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7,
+0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x2019
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp850
+uchar ctype_cp850_bin[] = {
+0x00,
+0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x30,0x30,
+0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x20,0x30,0x30,0x30,0x30,0x30,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x30,
+0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,
+0x01,0x02,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x10,0x01,0x10,0x10,
+0x02,0x02,0x02,0x02,0x02,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x01,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x02,0x01,0x01,0x01,0x01,0x02,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,0x01,0x10,
+0x01,0x02,0x01,0x01,0x02,0x01,0x10,0x02,0x01,0x01,0x01,0x01,0x02,0x01,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20
+};
+
+uchar to_lower_cp850_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,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
+
+uchar to_upper_cp850_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
+0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x7B,0x7C,0x7D,0x7E,0x7F,
+0x80,0x9A,0x90,0x41,0x8E,0x41,0x8F,0x80,0x45,0x45,0x45,0x49,0x49,0x49,0x8E,0x8F,
+0x90,0x92,0x92,0x4F,0x99,0x4F,0x55,0x55,0x59,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
+0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
+0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
+0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
+0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
+0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_cp850_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x00C7,0x00FC,0x00E9,0x00E2,0x00E4,0x00E0,0x00E5,0x00E7,
+0x00EA,0x00EB,0x00E8,0x00EF,0x00EE,0x00EC,0x00C4,0x00C5,
+0x00C9,0x00E6,0x00C6,0x00F4,0x00F6,0x00F2,0x00FB,0x00F9,
+0x00FF,0x00D6,0x00DC,0x00F8,0x00A3,0x00D8,0x00D7,0x0192,
+0x00E1,0x00ED,0x00F3,0x00FA,0x00F1,0x00D1,0x00AA,0x00BA,
+0x00BF,0x00AE,0x00AC,0x00BD,0x00BC,0x00A1,0x00AB,0x00BB,
+0x2591,0x2592,0x2593,0x2502,0x2524,0x00C1,0x00C2,0x00C0,
+0x00A9,0x2563,0x2551,0x2557,0x255D,0x00A2,0x00A5,0x2510,
+0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x00E3,0x00C3,
+0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x00A4,
+0x00F0,0x00D0,0x00CA,0x00CB,0x00C8,0x0131,0x00CD,0x00CE,
+0x00CF,0x2518,0x250C,0x2588,0x2584,0x00A6,0x00CC,0x2580,
+0x00D3,0x00DF,0x00D4,0x00D2,0x00F5,0x00D5,0x00B5,0x00FE,
+0x00DE,0x00DA,0x00DB,0x00D9,0x00FD,0x00DD,0x00AF,0x00B4,
+0x00AD,0x00B1,0x2017,0x00BE,0x00B6,0x00A7,0x00F7,0x00B8,
+0x00B0,0x00A8,0x00B7,0x00B9,0x00B3,0x00B2,0x25A0,0x00A0
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp852
+uchar ctype_cp852_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x00,
+0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x02,0x02,0x01,0x01,0x01,
+0x01,0x01,0x02,0x02,0x02,0x01,0x02,0x01,0x02,0x01,0x01,0x01,0x02,0x01,0x00,0x02,
+0x02,0x02,0x02,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x00,0x02,0x01,0x01,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x01,0x02,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x02,0x01,0x01,0x01,0x02,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x01,0x01,0x00,
+0x01,0x02,0x01,0x01,0x02,0x02,0x01,0x02,0x01,0x01,0x02,0x01,0x02,0x01,0x02,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x02,0x00,0x48
+};
+
+uchar to_lower_cp852_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A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,0xD5,0xE6,0xE6,0xE8,0xE9,0xE8,0xEB,0xED,0xED,0xDD,0xEF,
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xEB,0xFC,0xFC,0xFE,0xFF
+};
+
+uint16 to_uni_cp852_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x00C7,0x00FC,0x00E9,0x00E2,0x00E4,0x016F,0x0107,0x00E7,
+0x0142,0x00EB,0x0150,0x0151,0x00EE,0x0179,0x00C4,0x0106,
+0x00C9,0x0139,0x013A,0x00F4,0x00F6,0x013D,0x013E,0x015A,
+0x015B,0x00D6,0x00DC,0x0164,0x0165,0x0141,0x00D7,0x010D,
+0x00E1,0x00ED,0x00F3,0x00FA,0x0104,0x0105,0x017D,0x017E,
+0x0118,0x0119,0x00AC,0x017A,0x010C,0x015F,0x00AB,0x00BB,
+0x2591,0x2592,0x2593,0x2502,0x2524,0x00C1,0x00C2,0x011A,
+0x015E,0x2563,0x2551,0x2557,0x255D,0x017B,0x017C,0x2510,
+0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x0102,0x0103,
+0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x00A4,
+0x0111,0x0110,0x010E,0x00CB,0x010F,0x0147,0x00CD,0x00CE,
+0x011B,0x2518,0x250C,0x2588,0x2584,0x0162,0x016E,0x2580,
+0x00D3,0x00DF,0x00D4,0x0143,0x0144,0x0148,0x0160,0x0161,
+0x0154,0x00DA,0x0155,0x0170,0x00FD,0x00DD,0x0163,0x00B4,
+0x00AD,0x02DD,0x02DB,0x02C7,0x02D8,0x00A7,0x00F7,0x00B8,
+0x00B0,0x00A8,0x02D9,0x0171,0x0158,0x0159,0x25A0,0x00A0
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_swe7
+uchar ctype_swe7_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x01,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,
+0x01,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x20,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
+
+uchar to_lower_swe7_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,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,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_swe7_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x00C9,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x00C4,0x00D6,0x00C5,0x00DC,0x005F,
+0x00E9,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x00E4,0x00F6,0x00E5,0x00FC,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_geostd8
+uchar ctype_geostd8_general_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x00,0x00,0x10,0x00,0x10,0x10,0x10,0x10,0x00,0x10,0x00,0x10,0x00,0x00,0x00,0x00,
+0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,
+0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
+0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
+0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
+
+uchar to_lower_geostd8_general_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76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
+0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
+};
+
+uint16 to_uni_geostd8_general_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021,
+0x0000,0x2030,0x0000,0x2039,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x0000,0x0000,0x0000,0x203A,0x0000,0x0000,0x0000,0x0000,
+0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
+0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
+0x10D0,0x10D1,0x10D2,0x10D3,0x10D4,0x10D5,0x10D6,0x10F1,
+0x10D7,0x10D8,0x10D9,0x10DA,0x10DB,0x10DC,0x10F2,0x10DD,
+0x10DE,0x10DF,0x10E0,0x10E1,0x10E2,0x10F3,0x10E3,0x10E4,
+0x10E5,0x10E6,0x10E7,0x10E8,0x10E9,0x10EA,0x10EB,0x10EC,
+0x10ED,0x10EE,0x10F4,0x10EF,0x10F0,0x10F5,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x2116,0x0000,0x0000
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_geostd8
+uchar ctype_geostd8_bin[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x00,0x00,0x10,0x00,0x10,0x10,0x10,0x10,0x00,0x10,0x00,0x10,0x00,0x00,0x00,0x00,
+0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,
+0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
+0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
+0x03,0x03,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
+
+uchar to_lower_geostd8_bin[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,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16 to_uni_geostd8_bin[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021,
+0x0000,0x2030,0x0000,0x2039,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x0000,0x0000,0x0000,0x203A,0x0000,0x0000,0x0000,0x0000,
+0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
+0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
+0x10D0,0x10D1,0x10D2,0x10D3,0x10D4,0x10D5,0x10D6,0x10F1,
+0x10D7,0x10D8,0x10D9,0x10DA,0x10DB,0x10DC,0x10F2,0x10DD,
+0x10DE,0x10DF,0x10E0,0x10E1,0x10E2,0x10F3,0x10E3,0x10E4,
+0x10E5,0x10E6,0x10E7,0x10E8,0x10E9,0x10EA,0x10EB,0x10EC,
+0x10ED,0x10EE,0x10F4,0x10EF,0x10F0,0x10F5,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,0x2116,0x0000,0x0000
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_latin1
+uchar ctype_latin1_spanish_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x10,0x00,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x10,0x01,0x00,0x01,0x00,
+0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x02,0x10,0x02,0x00,0x02,0x01,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02
+};
+
+uchar to_lower_latin1_spanish_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
+0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x5B,0x5C,0x5D,0x5E,0x5F,
+0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,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41,0x53,0x5B,0x5B,0x5B,0x5B,0x6B,0x6B,0x6B,0x6B,
+0x57,0x7F,0x81,0x81,0x81,0x81,0x81,0xBE,0x81,0x9A,0x9A,0x9A,0x9A,0xAA,0xB1,0xAA
+};
+
+uint16 to_uni_latin1_spanish_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x0081,0x201A,0x0192,0x201E,0x2026,0x2020,0x2021,
+0x02C6,0x2030,0x0160,0x2039,0x0152,0x008D,0x017D,0x008F,
+0x0090,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x02DC,0x2122,0x0161,0x203A,0x0153,0x009D,0x017E,0x0178,
+0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
+0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
+0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
+0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
+0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
+0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,
+0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF,
+0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
+0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
+0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7,
+0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF
+};
+
+#endif
+
+#ifdef HAVE_CHARSET_cp1250
+uchar ctype_cp1250_polish_ci[] = {
+0x00,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x48,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x10,0x10,0x10,0x10,0x10,0x10,
+0x10,0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,0x10,
+0x10,0x82,0x82,0x82,0x82,0x82,0x82,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x10,0x10,0x10,0x20,
+0x20,0x20,0x10,0x20,0x10,0x10,0x10,0x10,0x20,0x10,0x01,0x10,0x01,0x01,0x01,0x01,
+0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x10,0x02,0x10,0x02,0x02,0x02,0x02,
+0x48,0x10,0x10,0x01,0x10,0x01,0x10,0x01,0x10,0x10,0x01,0x10,0x10,0x10,0x10,0x01,
+0x10,0x10,0x10,0x02,0x10,0x10,0x10,0x10,0x10,0x02,0x02,0x10,0x01,0x10,0x02,0x02,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
+0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10
+};
+
+uchar to_lower_cp1250_polish_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6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xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF
+};
+
+uchar sort_order_cp1250_polish_ci[] = {
+0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
+0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
+0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
+0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+0x40,0x41,0x43,0x44,0x48,0x4B,0x4D,0x4E,0x4F,0x50,0x52,0x53,0x54,0x56,0x57,0x59,
+0x5B,0x5C,0x5D,0x5F,0x62,0x64,0x66,0x67,0x68,0x69,0x6B,0x90,0x91,0x92,0x93,0x94,
+0x95,0x41,0x43,0x44,0x48,0x4B,0x4D,0x4E,0x4F,0x50,0x52,0x53,0x54,0x56,0x57,0x59,
+0x5B,0x5C,0x5D,0x5F,0x62,0x64,0x66,0x67,0x68,0x69,0x6B,0x96,0x97,0x98,0x99,0x9A,
+0x9B,0x9C,0x9E,0x9F,0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0x5F,0xA6,0x60,0x62,0x6B,0x6C,
+0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0x5F,0xB1,0x60,0x62,0x6B,0x6C,
+0xB2,0xB3,0xB4,0x55,0xB5,0x42,0xB6,0xB7,0xB8,0xB9,0x5F,0xBA,0xBB,0xBC,0xBD,0x6D,
+0xBE,0xBF,0xC0,0x55,0xC1,0xC2,0xC3,0xC4,0xC5,0x42,0x5F,0xC6,0x54,0xC7,0x54,0x6D,
+0x5D,0x41,0x41,0x41,0x41,0x54,0x47,0x44,0x44,0x4B,0x4C,0x4B,0x4B,0x50,0x50,0x48,
+0x48,0x58,0x57,0x5A,0x59,0x59,0x59,0xC8,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0x5F,
+0x5D,0x41,0x41,0x41,0x41,0x54,0x47,0x44,0x44,0x4B,0x4C,0x4B,0x4B,0x50,0x50,0x48,
+0x48,0x58,0x57,0x5A,0x59,0x59,0x59,0xC9,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0xFF
+};
+
+uint16 to_uni_cp1250_polish_ci[] = {
+0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x20AC,0x0000,0x201A,0x0000,0x201E,0x2026,0x2020,0x2021,
+0x0000,0x2030,0x0160,0x2039,0x015A,0x0164,0x017D,0x0179,
+0x0000,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
+0x0000,0x2122,0x0161,0x203A,0x015B,0x0165,0x017E,0x017A,
+0x00A0,0x02C7,0x02D8,0x0141,0x00A4,0x0104,0x00A6,0x00A7,
+0x00A8,0x00A9,0x015E,0x00AB,0x00AC,0x00AD,0x00AE,0x017B,
+0x00B0,0x00B1,0x02DB,0x0142,0x00B4,0x00B5,0x00B6,0x00B7,
+0x00B8,0x0105,0x015F,0x00BB,0x013D,0x02DD,0x013E,0x017C,
+0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7,
+0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E,
+0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7,
+0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF,
+0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7,
+0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F,
+0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7,
+0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9
+};
+
+#endif
CHARSET_INFO compiled_charsets[] = {
- {
- 0,0,0, /* end-of-list marker */
- 0, /* state */
- NullS, /* cs name */
- NullS, /* name */
- NullS, /* comment */
- NULL, /* tailoring */
- NULL, /* ctype */
- NULL, /* to_lower */
- NULL, /* to_upper */
- NULL, /* sort_order */
- NULL, /* contractions */
- NULL, /* sort_order_big*/
- NULL, /* tab_to_uni */
- NULL, /* tab_from_uni */
- my_unicase_default, /* caseinfo */
- NULL, /* state_map */
- NULL, /* ident_map */
- 0, /* strxfrm_mul */
- 0, /* caseup_mul */
- 0, /* casedn_mul */
- 0, /* mbminlen */
- 0, /* mbmaxlen */
- 0, /* min_sort_ord */
- 0, /* max_sort_ord */
- ' ', /* pad char */
- 0, /* escape_with_backslash_is_dangerous */
- NULL, /* cset handler */
- NULL /* coll handler */
- }
+#ifdef HAVE_CHARSET_dec8
+{
+ 3,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "dec8", /* cset name */
+ "dec8_swedish_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_dec8_swedish_ci, /* ctype */
+ to_lower_dec8_swedish_ci, /* lower */
+ to_upper_dec8_swedish_ci, /* upper */
+ sort_order_dec8_swedish_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_dec8_swedish_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp850
+{
+ 4,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "cp850", /* cset name */
+ "cp850_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp850_general_ci, /* ctype */
+ to_lower_cp850_general_ci, /* lower */
+ to_upper_cp850_general_ci, /* upper */
+ sort_order_cp850_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp850_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_latin1
+{
+ 5,0,0,
+ MY_CS_COMPILED,
+ "latin1", /* cset name */
+ "latin1_german1_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_latin1_german1_ci, /* ctype */
+ to_lower_latin1_german1_ci, /* lower */
+ to_upper_latin1_german1_ci, /* upper */
+ sort_order_latin1_german1_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_latin1_german1_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_hp8
+{
+ 6,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "hp8", /* cset name */
+ "hp8_english_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_hp8_english_ci, /* ctype */
+ to_lower_hp8_english_ci, /* lower */
+ to_upper_hp8_english_ci, /* upper */
+ sort_order_hp8_english_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_hp8_english_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_koi8r
+{
+ 7,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "koi8r", /* cset name */
+ "koi8r_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_koi8r_general_ci, /* ctype */
+ to_lower_koi8r_general_ci, /* lower */
+ to_upper_koi8r_general_ci, /* upper */
+ sort_order_koi8r_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_koi8r_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_latin2
+{
+ 9,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "latin2", /* cset name */
+ "latin2_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_latin2_general_ci, /* ctype */
+ to_lower_latin2_general_ci, /* lower */
+ to_upper_latin2_general_ci, /* upper */
+ sort_order_latin2_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_latin2_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_swe7
+{
+ 10,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "swe7", /* cset name */
+ "swe7_swedish_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_swe7_swedish_ci, /* ctype */
+ to_lower_swe7_swedish_ci, /* lower */
+ to_upper_swe7_swedish_ci, /* upper */
+ sort_order_swe7_swedish_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_swe7_swedish_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_ascii
+{
+ 11,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "ascii", /* cset name */
+ "ascii_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_ascii_general_ci, /* ctype */
+ to_lower_ascii_general_ci, /* lower */
+ to_upper_ascii_general_ci, /* upper */
+ sort_order_ascii_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_ascii_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp1251
+{
+ 14,0,0,
+ MY_CS_COMPILED,
+ "cp1251", /* cset name */
+ "cp1251_bulgarian_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp1251_bulgarian_ci, /* ctype */
+ to_lower_cp1251_bulgarian_ci, /* lower */
+ to_upper_cp1251_bulgarian_ci, /* upper */
+ sort_order_cp1251_bulgarian_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp1251_bulgarian_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_latin1
+{
+ 15,0,0,
+ MY_CS_COMPILED,
+ "latin1", /* cset name */
+ "latin1_danish_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_latin1_danish_ci, /* ctype */
+ to_lower_latin1_danish_ci, /* lower */
+ to_upper_latin1_danish_ci, /* upper */
+ sort_order_latin1_danish_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_latin1_danish_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_hebrew
+{
+ 16,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "hebrew", /* cset name */
+ "hebrew_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_hebrew_general_ci, /* ctype */
+ to_lower_hebrew_general_ci, /* lower */
+ to_upper_hebrew_general_ci, /* upper */
+ sort_order_hebrew_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_hebrew_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_latin7
+{
+ 20,0,0,
+ MY_CS_COMPILED|MY_CS_CSSORT,
+ "latin7", /* cset name */
+ "latin7_estonian_cs", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_latin7_estonian_cs, /* ctype */
+ to_lower_latin7_estonian_cs, /* lower */
+ to_upper_latin7_estonian_cs, /* upper */
+ sort_order_latin7_estonian_cs, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_latin7_estonian_cs, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_latin2
+{
+ 21,0,0,
+ MY_CS_COMPILED,
+ "latin2", /* cset name */
+ "latin2_hungarian_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_latin2_hungarian_ci, /* ctype */
+ to_lower_latin2_hungarian_ci, /* lower */
+ to_upper_latin2_hungarian_ci, /* upper */
+ sort_order_latin2_hungarian_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_latin2_hungarian_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_koi8u
+{
+ 22,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "koi8u", /* cset name */
+ "koi8u_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_koi8u_general_ci, /* ctype */
+ to_lower_koi8u_general_ci, /* lower */
+ to_upper_koi8u_general_ci, /* upper */
+ sort_order_koi8u_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_koi8u_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp1251
+{
+ 23,0,0,
+ MY_CS_COMPILED,
+ "cp1251", /* cset name */
+ "cp1251_ukrainian_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp1251_ukrainian_ci, /* ctype */
+ to_lower_cp1251_ukrainian_ci, /* lower */
+ to_upper_cp1251_ukrainian_ci, /* upper */
+ sort_order_cp1251_ukrainian_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp1251_ukrainian_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_greek
+{
+ 25,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "greek", /* cset name */
+ "greek_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_greek_general_ci, /* ctype */
+ to_lower_greek_general_ci, /* lower */
+ to_upper_greek_general_ci, /* upper */
+ sort_order_greek_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_greek_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp1250
+{
+ 26,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "cp1250", /* cset name */
+ "cp1250_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp1250_general_ci, /* ctype */
+ to_lower_cp1250_general_ci, /* lower */
+ to_upper_cp1250_general_ci, /* upper */
+ sort_order_cp1250_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp1250_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_latin2
+{
+ 27,0,0,
+ MY_CS_COMPILED,
+ "latin2", /* cset name */
+ "latin2_croatian_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_latin2_croatian_ci, /* ctype */
+ to_lower_latin2_croatian_ci, /* lower */
+ to_upper_latin2_croatian_ci, /* upper */
+ sort_order_latin2_croatian_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_latin2_croatian_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp1257
+{
+ 29,0,0,
+ MY_CS_COMPILED,
+ "cp1257", /* cset name */
+ "cp1257_lithuanian_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp1257_lithuanian_ci, /* ctype */
+ to_lower_cp1257_lithuanian_ci, /* lower */
+ to_upper_cp1257_lithuanian_ci, /* upper */
+ sort_order_cp1257_lithuanian_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp1257_lithuanian_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_latin5
+{
+ 30,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "latin5", /* cset name */
+ "latin5_turkish_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_latin5_turkish_ci, /* ctype */
+ to_lower_latin5_turkish_ci, /* lower */
+ to_upper_latin5_turkish_ci, /* upper */
+ sort_order_latin5_turkish_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_latin5_turkish_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_armscii8
+{
+ 32,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "armscii8", /* cset name */
+ "armscii8_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_armscii8_general_ci, /* ctype */
+ to_lower_armscii8_general_ci, /* lower */
+ to_upper_armscii8_general_ci, /* upper */
+ sort_order_armscii8_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_armscii8_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp866
+{
+ 36,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "cp866", /* cset name */
+ "cp866_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp866_general_ci, /* ctype */
+ to_lower_cp866_general_ci, /* lower */
+ to_upper_cp866_general_ci, /* upper */
+ sort_order_cp866_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp866_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_keybcs2
+{
+ 37,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "keybcs2", /* cset name */
+ "keybcs2_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_keybcs2_general_ci, /* ctype */
+ to_lower_keybcs2_general_ci, /* lower */
+ to_upper_keybcs2_general_ci, /* upper */
+ sort_order_keybcs2_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_keybcs2_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_macce
+{
+ 38,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "macce", /* cset name */
+ "macce_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_macce_general_ci, /* ctype */
+ to_lower_macce_general_ci, /* lower */
+ to_upper_macce_general_ci, /* upper */
+ sort_order_macce_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_macce_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_macroman
+{
+ 39,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "macroman", /* cset name */
+ "macroman_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_macroman_general_ci, /* ctype */
+ to_lower_macroman_general_ci, /* lower */
+ to_upper_macroman_general_ci, /* upper */
+ sort_order_macroman_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_macroman_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp852
+{
+ 40,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "cp852", /* cset name */
+ "cp852_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp852_general_ci, /* ctype */
+ to_lower_cp852_general_ci, /* lower */
+ to_upper_cp852_general_ci, /* upper */
+ sort_order_cp852_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp852_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_latin7
+{
+ 41,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "latin7", /* cset name */
+ "latin7_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_latin7_general_ci, /* ctype */
+ to_lower_latin7_general_ci, /* lower */
+ to_upper_latin7_general_ci, /* upper */
+ sort_order_latin7_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_latin7_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_latin7
+{
+ 42,0,0,
+ MY_CS_COMPILED|MY_CS_CSSORT,
+ "latin7", /* cset name */
+ "latin7_general_cs", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_latin7_general_cs, /* ctype */
+ to_lower_latin7_general_cs, /* lower */
+ to_upper_latin7_general_cs, /* upper */
+ sort_order_latin7_general_cs, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_latin7_general_cs, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_macce
+{
+ 43,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "macce", /* cset name */
+ "macce_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_macce_bin, /* ctype */
+ to_lower_macce_bin, /* lower */
+ to_upper_macce_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_macce_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp1250
+{
+ 44,0,0,
+ MY_CS_COMPILED,
+ "cp1250", /* cset name */
+ "cp1250_croatian_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp1250_croatian_ci, /* ctype */
+ to_lower_cp1250_croatian_ci, /* lower */
+ to_upper_cp1250_croatian_ci, /* upper */
+ sort_order_cp1250_croatian_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp1250_croatian_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_latin1
+{
+ 48,0,0,
+ MY_CS_COMPILED,
+ "latin1", /* cset name */
+ "latin1_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_latin1_general_ci, /* ctype */
+ to_lower_latin1_general_ci, /* lower */
+ to_upper_latin1_general_ci, /* upper */
+ sort_order_latin1_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_latin1_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_latin1
+{
+ 49,0,0,
+ MY_CS_COMPILED|MY_CS_CSSORT,
+ "latin1", /* cset name */
+ "latin1_general_cs", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_latin1_general_cs, /* ctype */
+ to_lower_latin1_general_cs, /* lower */
+ to_upper_latin1_general_cs, /* upper */
+ sort_order_latin1_general_cs, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_latin1_general_cs, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp1251
+{
+ 50,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "cp1251", /* cset name */
+ "cp1251_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp1251_bin, /* ctype */
+ to_lower_cp1251_bin, /* lower */
+ to_upper_cp1251_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp1251_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp1251
+{
+ 51,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "cp1251", /* cset name */
+ "cp1251_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp1251_general_ci, /* ctype */
+ to_lower_cp1251_general_ci, /* lower */
+ to_upper_cp1251_general_ci, /* upper */
+ sort_order_cp1251_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp1251_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp1251
+{
+ 52,0,0,
+ MY_CS_COMPILED|MY_CS_CSSORT,
+ "cp1251", /* cset name */
+ "cp1251_general_cs", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp1251_general_cs, /* ctype */
+ to_lower_cp1251_general_cs, /* lower */
+ to_upper_cp1251_general_cs, /* upper */
+ sort_order_cp1251_general_cs, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp1251_general_cs, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_macroman
+{
+ 53,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "macroman", /* cset name */
+ "macroman_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_macroman_bin, /* ctype */
+ to_lower_macroman_bin, /* lower */
+ to_upper_macroman_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_macroman_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp1256
+{
+ 57,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "cp1256", /* cset name */
+ "cp1256_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp1256_general_ci, /* ctype */
+ to_lower_cp1256_general_ci, /* lower */
+ to_upper_cp1256_general_ci, /* upper */
+ sort_order_cp1256_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp1256_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp1257
+{
+ 58,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "cp1257", /* cset name */
+ "cp1257_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp1257_bin, /* ctype */
+ to_lower_cp1257_bin, /* lower */
+ to_upper_cp1257_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp1257_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp1257
+{
+ 59,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "cp1257", /* cset name */
+ "cp1257_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp1257_general_ci, /* ctype */
+ to_lower_cp1257_general_ci, /* lower */
+ to_upper_cp1257_general_ci, /* upper */
+ sort_order_cp1257_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp1257_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_armscii8
+{
+ 64,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "armscii8", /* cset name */
+ "armscii8_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_armscii8_bin, /* ctype */
+ to_lower_armscii8_bin, /* lower */
+ to_upper_armscii8_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_armscii8_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_ascii
+{
+ 65,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "ascii", /* cset name */
+ "ascii_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_ascii_bin, /* ctype */
+ to_lower_ascii_bin, /* lower */
+ to_upper_ascii_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_ascii_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp1250
+{
+ 66,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "cp1250", /* cset name */
+ "cp1250_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp1250_bin, /* ctype */
+ to_lower_cp1250_bin, /* lower */
+ to_upper_cp1250_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp1250_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp1256
+{
+ 67,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "cp1256", /* cset name */
+ "cp1256_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp1256_bin, /* ctype */
+ to_lower_cp1256_bin, /* lower */
+ to_upper_cp1256_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp1256_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp866
+{
+ 68,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "cp866", /* cset name */
+ "cp866_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp866_bin, /* ctype */
+ to_lower_cp866_bin, /* lower */
+ to_upper_cp866_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp866_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_dec8
+{
+ 69,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "dec8", /* cset name */
+ "dec8_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_dec8_bin, /* ctype */
+ to_lower_dec8_bin, /* lower */
+ to_upper_dec8_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_dec8_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_greek
+{
+ 70,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "greek", /* cset name */
+ "greek_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_greek_bin, /* ctype */
+ to_lower_greek_bin, /* lower */
+ to_upper_greek_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_greek_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_hebrew
+{
+ 71,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "hebrew", /* cset name */
+ "hebrew_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_hebrew_bin, /* ctype */
+ to_lower_hebrew_bin, /* lower */
+ to_upper_hebrew_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_hebrew_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_hp8
+{
+ 72,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "hp8", /* cset name */
+ "hp8_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_hp8_bin, /* ctype */
+ to_lower_hp8_bin, /* lower */
+ to_upper_hp8_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_hp8_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_keybcs2
+{
+ 73,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "keybcs2", /* cset name */
+ "keybcs2_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_keybcs2_bin, /* ctype */
+ to_lower_keybcs2_bin, /* lower */
+ to_upper_keybcs2_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_keybcs2_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_koi8r
+{
+ 74,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "koi8r", /* cset name */
+ "koi8r_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_koi8r_bin, /* ctype */
+ to_lower_koi8r_bin, /* lower */
+ to_upper_koi8r_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_koi8r_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_koi8u
+{
+ 75,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "koi8u", /* cset name */
+ "koi8u_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_koi8u_bin, /* ctype */
+ to_lower_koi8u_bin, /* lower */
+ to_upper_koi8u_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_koi8u_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_latin2
+{
+ 77,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "latin2", /* cset name */
+ "latin2_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_latin2_bin, /* ctype */
+ to_lower_latin2_bin, /* lower */
+ to_upper_latin2_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_latin2_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_latin5
+{
+ 78,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "latin5", /* cset name */
+ "latin5_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_latin5_bin, /* ctype */
+ to_lower_latin5_bin, /* lower */
+ to_upper_latin5_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_latin5_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_latin7
+{
+ 79,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "latin7", /* cset name */
+ "latin7_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_latin7_bin, /* ctype */
+ to_lower_latin7_bin, /* lower */
+ to_upper_latin7_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_latin7_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp850
+{
+ 80,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "cp850", /* cset name */
+ "cp850_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp850_bin, /* ctype */
+ to_lower_cp850_bin, /* lower */
+ to_upper_cp850_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp850_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp852
+{
+ 81,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "cp852", /* cset name */
+ "cp852_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp852_bin, /* ctype */
+ to_lower_cp852_bin, /* lower */
+ to_upper_cp852_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp852_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_swe7
+{
+ 82,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "swe7", /* cset name */
+ "swe7_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_swe7_bin, /* ctype */
+ to_lower_swe7_bin, /* lower */
+ to_upper_swe7_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_swe7_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_geostd8
+{
+ 92,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "geostd8", /* cset name */
+ "geostd8_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_geostd8_general_ci, /* ctype */
+ to_lower_geostd8_general_ci, /* lower */
+ to_upper_geostd8_general_ci, /* upper */
+ sort_order_geostd8_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_geostd8_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_geostd8
+{
+ 93,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "geostd8", /* cset name */
+ "geostd8_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_geostd8_bin, /* ctype */
+ to_lower_geostd8_bin, /* lower */
+ to_upper_geostd8_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_geostd8_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_geostd8
+{
+ 92,0,0,
+ MY_CS_COMPILED|MY_CS_PRIMARY,
+ "geostd8", /* cset name */
+ "geostd8_general_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_geostd8_general_ci, /* ctype */
+ to_lower_geostd8_general_ci, /* lower */
+ to_upper_geostd8_general_ci, /* upper */
+ sort_order_geostd8_general_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_geostd8_general_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_geostd8
+{
+ 93,0,0,
+ MY_CS_COMPILED|MY_CS_BINSORT,
+ "geostd8", /* cset name */
+ "geostd8_bin", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_geostd8_bin, /* ctype */
+ to_lower_geostd8_bin, /* lower */
+ to_upper_geostd8_bin, /* upper */
+ NULL, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_geostd8_bin, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_bin_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_latin1
+{
+ 94,0,0,
+ MY_CS_COMPILED,
+ "latin1", /* cset name */
+ "latin1_spanish_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_latin1_spanish_ci, /* ctype */
+ to_lower_latin1_spanish_ci, /* lower */
+ to_upper_latin1_spanish_ci, /* upper */
+ sort_order_latin1_spanish_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_latin1_spanish_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+#ifdef HAVE_CHARSET_cp1250
+{
+ 99,0,0,
+ MY_CS_COMPILED,
+ "cp1250", /* cset name */
+ "cp1250_polish_ci", /* coll name */
+ "", /* comment */
+ NULL, /* tailoring */
+ ctype_cp1250_polish_ci, /* ctype */
+ to_lower_cp1250_polish_ci, /* lower */
+ to_upper_cp1250_polish_ci, /* upper */
+ sort_order_cp1250_polish_ci, /* sort_order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ to_uni_cp1250_polish_ci, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
+,
+#endif
+{
+ 0,0,0,
+ MY_CS_COMPILED,
+ NULL, /* cset name */
+ NULL, /* coll name */
+ NULL, /* comment */
+ NULL, /* tailoging */
+ NULL, /* ctype */
+ NULL, /* lower */
+ NULL, /* upper */
+ NULL, /* sort order */
+ NULL, /* contractions */
+ NULL, /* sort_order_big*/
+ NULL, /* to_uni */
+ NULL, /* from_uni */
+ my_unicase_default, /* caseinfo */
+ NULL, /* state map */
+ NULL, /* ident map */
+ 1, /* strxfrm_multiply*/
+ 1, /* caseup_multiply*/
+ 1, /* casedn_multiply*/
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
+ ' ', /* pad_char */
+ 0, /* escape_with_backslash_is_dangerous */
+ &my_charset_8bit_handler,
+ &my_collation_8bit_simple_ci_handler,
+}
};
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index 3a0dca94267..3e765affa4b 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -1,3 +1,4 @@
+
%define mysql_version @VERSION@
# use "rpmbuild --with static" or "rpm --define '_with_static 1'" (for RPM 3.x)
@@ -217,6 +218,7 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
CXX=\"${CXX:-$MYSQL_BUILD_CXX}\" \
CFLAGS=\"$CFLAGS\" \
CXXFLAGS=\"$CXXFLAGS\" \
+ LDFLAGS=\"$MYSQL_BUILD_LDFLAGS\" \
./configure \
$* \
--with-mysqld-ldflags='-static' \
@@ -709,6 +711,10 @@ fi
# itself - note that they must be ordered by date (important when
# merging BK trees)
%changelog
+* Sat Apr 01 2006 Kent Boortz <kent@mysql.com>
+
+- Set $LDFLAGS from $MYSQL_BUILD_LDFLAGS
+
* Wed Mar 07 2006 Kent Boortz <kent@mysql.com>
- Changed product name from "Community Edition" to "Community Server"
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 131f8b1b625..ba0a7ad73d0 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -29,7 +29,8 @@ EXTRA_DIST = auto_increment.res auto_increment.tst \
insert_and_repair.pl \
grant.pl grant.res test_delayed_insert.pl \
pmail.pl mail_to_db.pl table_types.pl \
- udf_test udf_test.res myisam-big-rows.tst
+ udf_test udf_test.res myisam-big-rows.tst \
+ cmakelists.txt
bin_PROGRAMS = mysql_client_test
noinst_PROGRAMS = insert_test select_test thread_test
diff --git a/vio/Makefile.am b/vio/Makefile.am
index 544639139de..b7e002a3033 100644
--- a/vio/Makefile.am
+++ b/vio/Makefile.am
@@ -38,6 +38,7 @@ test_sslclient_LDADD= @CLIENT_EXTRA_LDFLAGS@ ../dbug/libdbug.a libvio.a \
../mysys/libmysys.a ../strings/libmystrings.a \
$(openssl_libs) $(yassl_libs)
libvio_a_SOURCES= vio.c viosocket.c viossl.c viosslfactories.c
+EXTRA_DIST= cmakelists.txt
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/win/Makefile.am b/win/Makefile.am
new file mode 100644
index 00000000000..2f4aa626a93
--- /dev/null
+++ b/win/Makefile.am
@@ -0,0 +1,21 @@
+# Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to create Makefile.in
+EXTRA_DIST = build-vs71.bat build-vs8.bat configure.js README
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/win/README b/win/README
index 27c7e5c5762..dcd65516abe 100644
--- a/win/README
+++ b/win/README
@@ -34,12 +34,25 @@ Clone your bk tree to any location you like.
Step 4
------
From the root of your bk clone, execute the command: win\configure <options>.
-The options right now are WITH_INNODB and WITH_PARTITION. So the command line
-would look like:
-
-win\configure WITH_INNODB WITH_PARTITION
-
-These are the only two flags supported right now. Others will come later.
+The options right now are
+
+ WITH_INNOBASE_STORAGE_ENGINE Enable particular storage engines
+ WITH_PARTITION_STORAGE_ENGINE
+ WITH_ARCHIVE_STORAGE_ENGINE
+ WITH_BERKELEY_STORAGE_ENGINE
+ WITH_BLACKHOLE_STORAGE_ENGINE
+ WITH_EXAMPLE_STORAGE_ENGINE
+ WITH_FEDERATED_STORAGE_ENGINE
+ WITH_INNOBASE_STORAGE_ENGINE
+ __NT__ Enable named pipe support
+ MYSQL_SERVER_SUFFIX=<suffix> Server suffix, default none
+ COMPILATION_COMMENT=<comment> Server comment, default "Source distribution"
+ MYSQL_TCP_PORT=<port> Server port, default 3306
+ CYBOZU
+
+So the command line could look like:
+
+win\configure WITH_INNOBASE_STORAGE_ENGINE WITH_PARTITION_STORAGE_ENGINE MYSQL_SERVER_SUFFIX=-pro
Step 5
------
@@ -60,11 +73,5 @@ click the build solution menu option.
Current issues
--------------
-1. Not all configurations are currently available. i.e. Classic, Pro, Max.
-Currently, only debug and release are available. This will change in the near
-future.
-
-2. The definitions set for features (partitioning, blackhole, etc) are not
-changed based on the options given with configure. This will soon be fixed
-as well.
-
+1. After changing configuration (eg. adding or removing a storage engine), it
+may be necessary to clean the build tree to remove any stale objects.
diff --git a/win/config-handlerton.js b/win/config-handlerton.js
deleted file mode 100644
index fd668fa3ec0..00000000000
--- a/win/config-handlerton.js
+++ /dev/null
@@ -1,171 +0,0 @@
-// Configure.js
-
-ForReading = 1;
-ForWriting = 2;
-ForAppending = 8;
-
-try
-{
- // first we attempt to open the main configure.in file
- var fso = new ActiveXObject("Scripting.FileSystemObject");
-
- var args = WScript.Arguments
-
- var datafile = fso.OpenTextFile(args.Item(0), ForReading);
- var extern_line = '';
- var address_line = '';
- while (! datafile.AtEndOfStream)
- {
- var line = datafile.ReadLine();
- if (line == "WITH_INNODB")
- {
- extern_line += ",innobase_hton";
- address_line += ",&innobase_hton";
- }
- else if (line == "WITH_PARTITION")
- {
- extern_line += ",partition_hton";
- address_line += ",&partition_hton";
- }
- }
- datafile.Close();
-
- var infile = fso.OpenTextFile("..\\sql\\handlerton.cc.in", ForReading);
- var infile_contents = infile.ReadAll();
- infile.Close();
- infile_contents = infile_contents.replace("@mysql_se_decls@", extern_line);
- infile_contents = infile_contents.replace("@mysql_se_htons@", address_line);
-
- var outfile = fso.CreateTextFile("..\\sql\\handlerton.cc", true)
- outfile.Write(infile_contents);
- outfile.Close();
-
- fso = null;
-
- WScript.Echo("done!");
-}
-catch (e)
-{
- WScript.Echo("Error: " + e.description);
-}
-
-function ConfigureBDB()
-{
- // read in the Unix configure.in file
- var dbIncTS = fso.OpenTextFile("..\\bdb\\dbinc\\db.in", ForReading);
- var dbIn = dbIncTS.ReadAll();
- dbIncTS.Close();
-
- dbIn = dbIn.replace("@DB_VERSION_MAJOR@", "$DB_VERSION_MAJOR");
- dbIn = dbIn.replace("@DB_VERSION_MINOR@", "$DB_VERSION_MINOR");
- dbIn = dbIn.replace("@DB_VERSION_PATCH@", "$DB_VERSION_PATCH");
- dbIn = dbIn.replace("@DB_VERSION_STRING@", "$DB_VERSION_STRING");
-
- dbIn = dbIn.replace("@u_int8_decl@", "typedef unsigned char u_int8_t;");
- dbIn = dbIn.replace("@int16_decl@", "typedef short int16_t;");
- dbIn = dbIn.replace("@u_int16_decl@", "typedef unsigned short u_int16_t;");
- dbIn = dbIn.replace("@int32_decl@", "typedef int int32_t;");
- dbIn = dbIn.replace("@u_int32_decl@", "typedef unsigned int u_int32_t;");
-
- dbIn = dbIn.replace("@u_char_decl@", "{\r\n#if !defined(_WINSOCKAPI_)\r\n" +
- "typedef unsigned char u_char;");
- dbIn = dbIn.replace("@u_short_decl@", "typedef unsigned short u_short;");
- dbIn = dbIn.replace("@u_int_decl@", "typedef unsigned int u_int;");
- dbIn = dbIn.replace("@u_long_decl@", "typedef unsigned long u_long;");
-
- dbIn = dbIn.replace("@ssize_t_decl@", "#endif\r\n#if defined(_WIN64)\r\n" +
- "typedef __int64 ssize_t;\r\n#else\r\n" +
- "typedef int ssize_t;\r\n#endif");
-}
-
-function ConfigureMySqlVersion()
-{
- // read in the Unix configure.in file
- var configureInTS = fso.OpenTextFile("..\\configure.in", ForReading);
- var configureIn = configureInTS.ReadAll();
- configureInTS.Close();
-
- // read in the mysql_version.h.in file
- var mysqlTS = fso.OpenTextFile("..\\include\\mysql_version.h.in", ForReading);
- var mysqlin = mysqlTS.ReadAll();
- mysqlTS.Close();
-
- mysqlin = mysqlin.replace("@PROTOCOL_VERSION@", GetValue(configureIn, "PROTOCOL_VERSION"));
- mysqlin = mysqlin.replace("@DOT_FRM_VERSION@", GetValue(configureIn, "DOT_FRM_VERSION"));
- mysqlin = mysqlin.replace("@MYSQL_TCP_PORT@", GetValue(configureIn, "MYSQL_TCP_PORT_DEFAULT"));
- mysqlin = mysqlin.replace("@MYSQL_UNIX_ADDR@", GetValue(configureIn, "MYSQL_UNIX_ADDR_DEFAULT"));
- mysqlin = mysqlin.replace("@MYSQL_SERVER_SUFFIX@", '');
- mysqlin = mysqlin.replace("@COMPILATION_COMMENT@", 'Source distribution');
-
-
- var version = GetVersion(configureIn);
- mysqlin = mysqlin.replace("@VERSION@", version);
- mysqlin = mysqlin.replace("@MYSQL_BASE_VERSION@", GetBaseVersion(version));
- mysqlin = mysqlin.replace("@MYSQL_VERSION_ID@", GetVersionId(version));
-
-
- var mysqlfile = fso.CreateTextFile("..\\include\\mysql_version.h", true);
- mysqlfile.Write(mysqlin);
- mysqlfile.Close();
-
-}
-
-function GetValue(str, key)
-{
- var pos = str.indexOf(key+'=');
- if (pos == -1) return null;
- pos += key.length + 1;
- var end = str.indexOf("\n", pos);
- if (str.charAt(pos) == "\"")
- pos++;
- if (str.charAt(end-1) == "\"")
- end--;
- return str.substring(pos, end);
-}
-
-function GetVersion(str)
-{
- var key = "AM_INIT_AUTOMAKE(mysql, ";
- var pos = str.indexOf(key); //5.0.6-beta)
- if (pos == -1) return null;
- pos += key.length;
- var end = str.indexOf(")", pos);
- if (end == -1) return null;
- return str.substring(pos, end);
-}
-
-function GetBaseVersion(version)
-{
- var dot = version.indexOf(".");
- if (dot == -1) return null;
- dot = version.indexOf(".", dot+1);
- if (dot == -1) dot = version.length;
- return version.substring(0, dot);
-}
-
-function GetVersionId(version)
-{
- var dot = version.indexOf(".");
- if (dot == -1) return null;
- var major = parseInt(version.substring(0, dot), 10);
-
- dot++;
- var nextdot = version.indexOf(".", dot);
- if (nextdot == -1) return null;
- var minor = parseInt(version.substring(dot, nextdot), 10);
- dot = nextdot+1;
-
- var stop = version.indexOf("-", dot);
- if (stop == -1) stop = version.length;
- var build = parseInt(version.substring(dot, stop), 10);
-
- var id = major;
- if (minor < 10)
- id += '0';
- id += minor;
- if (build < 10)
- id += '0';
- id += build;
- return id;
-}
-
diff --git a/win/config-version.js b/win/config-version.js
deleted file mode 100644
index 4c895bcf515..00000000000
--- a/win/config-version.js
+++ /dev/null
@@ -1,142 +0,0 @@
-// Configure.js
-
-ForReading = 1;
-ForWriting = 2;
-ForAppending = 8;
-
-try
-{
- // first we attempt to open the main configure.in file
- var fso = new ActiveXObject("Scripting.FileSystemObject");
-
- ConfigureMySqlVersion();
- //ConfigureBDB();
- fso = null;
-
- WScript.Echo("done!");
-}
-catch (e)
-{
- WScript.Echo("Error: " + e.description);
-}
-
-function ConfigureBDB()
-{
- // read in the Unix configure.in file
- var dbIncTS = fso.OpenTextFile("..\\bdb\\dbinc\\db.in", ForReading);
- var dbIn = dbIncTS.ReadAll();
- dbIncTS.Close();
-
- dbIn = dbIn.replace("@DB_VERSION_MAJOR@", "$DB_VERSION_MAJOR");
- dbIn = dbIn.replace("@DB_VERSION_MINOR@", "$DB_VERSION_MINOR");
- dbIn = dbIn.replace("@DB_VERSION_PATCH@", "$DB_VERSION_PATCH");
- dbIn = dbIn.replace("@DB_VERSION_STRING@", "$DB_VERSION_STRING");
-
- dbIn = dbIn.replace("@u_int8_decl@", "typedef unsigned char u_int8_t;");
- dbIn = dbIn.replace("@int16_decl@", "typedef short int16_t;");
- dbIn = dbIn.replace("@u_int16_decl@", "typedef unsigned short u_int16_t;");
- dbIn = dbIn.replace("@int32_decl@", "typedef int int32_t;");
- dbIn = dbIn.replace("@u_int32_decl@", "typedef unsigned int u_int32_t;");
-
- dbIn = dbIn.replace("@u_char_decl@", "{\r\n#if !defined(_WINSOCKAPI_)\r\n" +
- "typedef unsigned char u_char;");
- dbIn = dbIn.replace("@u_short_decl@", "typedef unsigned short u_short;");
- dbIn = dbIn.replace("@u_int_decl@", "typedef unsigned int u_int;");
- dbIn = dbIn.replace("@u_long_decl@", "typedef unsigned long u_long;");
-
- dbIn = dbIn.replace("@ssize_t_decl@", "#endif\r\n#if defined(_WIN64)\r\n" +
- "typedef __int64 ssize_t;\r\n#else\r\n" +
- "typedef int ssize_t;\r\n#endif");
-}
-
-function ConfigureMySqlVersion()
-{
- // read in the Unix configure.in file
- var configureInTS = fso.OpenTextFile("..\\configure.in", ForReading);
- var configureIn = configureInTS.ReadAll();
- configureInTS.Close();
-
- // read in the mysql_version.h.in file
- var mysqlTS = fso.OpenTextFile("..\\include\\mysql_version.h.in", ForReading);
- var mysqlin = mysqlTS.ReadAll();
- mysqlTS.Close();
-
- mysqlin = mysqlin.replace("@PROTOCOL_VERSION@", GetValue(configureIn, "PROTOCOL_VERSION"));
- mysqlin = mysqlin.replace("@DOT_FRM_VERSION@", GetValue(configureIn, "DOT_FRM_VERSION"));
- mysqlin = mysqlin.replace("@MYSQL_TCP_PORT@", GetValue(configureIn, "MYSQL_TCP_PORT_DEFAULT"));
- mysqlin = mysqlin.replace("@MYSQL_UNIX_ADDR@", GetValue(configureIn, "MYSQL_UNIX_ADDR_DEFAULT"));
- mysqlin = mysqlin.replace("@MYSQL_SERVER_SUFFIX@", '');
- mysqlin = mysqlin.replace("@COMPILATION_COMMENT@", 'Source distribution');
-
-
- var version = GetVersion(configureIn);
- mysqlin = mysqlin.replace("@VERSION@", version);
- mysqlin = mysqlin.replace("@MYSQL_BASE_VERSION@", GetBaseVersion(version));
- mysqlin = mysqlin.replace("@MYSQL_VERSION_ID@", GetVersionId(version));
-
-
- var mysqlfile = fso.CreateTextFile("..\\include\\mysql_version.h", true);
- mysqlfile.Write(mysqlin);
- mysqlfile.Close();
-
-}
-
-function GetValue(str, key)
-{
- var pos = str.indexOf(key+'=');
- if (pos == -1) return null;
- pos += key.length + 1;
- var end = str.indexOf("\n", pos);
- if (str.charAt(pos) == "\"")
- pos++;
- if (str.charAt(end-1) == "\"")
- end--;
- return str.substring(pos, end);
-}
-
-function GetVersion(str)
-{
- var key = "AM_INIT_AUTOMAKE(mysql, ";
- var pos = str.indexOf(key); //5.0.6-beta)
- if (pos == -1) return null;
- pos += key.length;
- var end = str.indexOf(")", pos);
- if (end == -1) return null;
- return str.substring(pos, end);
-}
-
-function GetBaseVersion(version)
-{
- var dot = version.indexOf(".");
- if (dot == -1) return null;
- dot = version.indexOf(".", dot+1);
- if (dot == -1) dot = version.length;
- return version.substring(0, dot);
-}
-
-function GetVersionId(version)
-{
- var dot = version.indexOf(".");
- if (dot == -1) return null;
- var major = parseInt(version.substring(0, dot), 10);
-
- dot++;
- var nextdot = version.indexOf(".", dot);
- if (nextdot == -1) return null;
- var minor = parseInt(version.substring(dot, nextdot), 10);
- dot = nextdot+1;
-
- var stop = version.indexOf("-", dot);
- if (stop == -1) stop = version.length;
- var build = parseInt(version.substring(dot, stop), 10);
-
- var id = major;
- if (minor < 10)
- id += '0';
- id += minor;
- if (build < 10)
- id += '0';
- id += build;
- return id;
-}
-
diff --git a/win/configure.js b/win/configure.js
index b1c269d4eed..ef90ce982a6 100644
--- a/win/configure.js
+++ b/win/configure.js
@@ -6,19 +6,69 @@ ForAppending = 8;
try
{
- // first we attempt to open the main configure.in file
var fso = new ActiveXObject("Scripting.FileSystemObject");
+
+ var args = WScript.Arguments
- var args = WScript.Arguments
-
+ // read in the Unix configure.in file
+ var configureInTS = fso.OpenTextFile("configure.in", ForReading);
+ var configureIn = configureInTS.ReadAll();
+ configureInTS.Close();
+ var default_comment = "Source distribution";
+ var default_port = GetValue(configureIn, "MYSQL_TCP_PORT_DEFAULT");
+
var configfile = fso.CreateTextFile("win\\configure.data", true);
for (i=0; i < args.Count(); i++)
{
- configfile.WriteLine(args.Item(i));
+ var parts = args.Item(i).split('=');
+ switch (parts[0])
+ {
+ case "WITH_ARCHIVE_STORAGE_ENGINE":
+ case "WITH_BERKELEY_STORAGE_ENGINE":
+ case "WITH_BLACKHOLE_STORAGE_ENGINE":
+ case "WITH_EXAMPLE_STORAGE_ENGINE":
+ case "WITH_FEDERATED_STORAGE_ENGINE":
+ case "WITH_INNOBASE_STORAGE_ENGINE":
+ case "WITH_PARTITION_STORAGE_ENGINE":
+ case "__NT__":
+ case "CYBOZU":
+ configfile.WriteLine("SET (" + args.Item(i) + " TRUE)");
+ break;
+ case "MYSQL_SERVER_SUFFIX":
+ configfile.WriteLine("SET (" + parts[0] + " \""
+ + parts[1] + "\")");
+ break;
+ case "COMPILATION_COMMENT":
+ default_comment = parts[1];
+ break;
+ case "MYSQL_TCP_PORT":
+ default_port = parts[1];
+ break;
+ }
}
+
+ configfile.WriteLine("SET (COMPILATION_COMMENT \"" +
+ default_comment + "\")");
+
+ configfile.WriteLine("SET (PROTOCOL_VERSION \"" +
+ GetValue(configureIn, "PROTOCOL_VERSION") + "\")");
+ configfile.WriteLine("SET (DOT_FRM_VERSION \"" +
+ GetValue(configureIn, "DOT_FRM_VERSION") + "\")");
+ configfile.WriteLine("SET (MYSQL_TCP_PORT \"" + default_port + "\")");
+ configfile.WriteLine("SET (MYSQL_UNIX_ADDR \"" +
+ GetValue(configureIn, "MYSQL_UNIX_ADDR_DEFAULT") + "\")");
+ var version = GetVersion(configureIn);
+ configfile.WriteLine("SET (VERSION \"" + version + "\")");
+ configfile.WriteLine("SET (MYSQL_BASE_VERSION \"" +
+ GetBaseVersion(version) + "\")");
+ configfile.WriteLine("SET (MYSQL_VERSION_ID \"" +
+ GetVersionId(version) + "\")");
+
configfile.Close();
- fso = null;
+ //ConfigureBDB();
+
+ fso = null;
WScript.Echo("done!");
}
@@ -34,9 +84,9 @@ function GetValue(str, key)
pos += key.length + 1;
var end = str.indexOf("\n", pos);
if (str.charAt(pos) == "\"")
- pos++;
- if (str.charAt(end-1) == "\"")
- end--;
+ pos++;
+ if (str.charAt(end-1) == "\"")
+ end--;
return str.substring(pos, end);
}
@@ -86,3 +136,31 @@ function GetVersionId(version)
return id;
}
+function ConfigureBDB()
+{
+ // read in the Unix configure.in file
+ var dbIncTS = fso.OpenTextFile("..\\bdb\\dbinc\\db.in", ForReading);
+ var dbIn = dbIncTS.ReadAll();
+ dbIncTS.Close();
+
+ dbIn = dbIn.replace("@DB_VERSION_MAJOR@", "$DB_VERSION_MAJOR");
+ dbIn = dbIn.replace("@DB_VERSION_MINOR@", "$DB_VERSION_MINOR");
+ dbIn = dbIn.replace("@DB_VERSION_PATCH@", "$DB_VERSION_PATCH");
+ dbIn = dbIn.replace("@DB_VERSION_STRING@", "$DB_VERSION_STRING");
+
+ dbIn = dbIn.replace("@u_int8_decl@", "typedef unsigned char u_int8_t;");
+ dbIn = dbIn.replace("@int16_decl@", "typedef short int16_t;");
+ dbIn = dbIn.replace("@u_int16_decl@", "typedef unsigned short u_int16_t;");
+ dbIn = dbIn.replace("@int32_decl@", "typedef int int32_t;");
+ dbIn = dbIn.replace("@u_int32_decl@", "typedef unsigned int u_int32_t;");
+
+ dbIn = dbIn.replace("@u_char_decl@", "{\r\n#if !defined(_WINSOCKAPI_)\r\n" +
+ "typedef unsigned char u_char;");
+ dbIn = dbIn.replace("@u_short_decl@", "typedef unsigned short u_short;");
+ dbIn = dbIn.replace("@u_int_decl@", "typedef unsigned int u_int;");
+ dbIn = dbIn.replace("@u_long_decl@", "typedef unsigned long u_long;");
+
+ dbIn = dbIn.replace("@ssize_t_decl@", "#endif\r\n#if defined(_WIN64)\r\n" +
+ "typedef __int64 ssize_t;\r\n#else\r\n" +
+ "typedef int ssize_t;\r\n#endif");
+}
diff --git a/zlib/Makefile.am b/zlib/Makefile.am
index 71619ce40c1..cc3777b1e88 100644
--- a/zlib/Makefile.am
+++ b/zlib/Makefile.am
@@ -29,5 +29,4 @@ libz_la_SOURCES= adler32.c compress.c crc32.c deflate.c gzio.c \
infback.c inffast.c inflate.c inftrees.c trees.c \
uncompr.c zutil.c
-EXTRA_DIST= README FAQ INDEX ChangeLog algorithm.txt zlib.3
-
+EXTRA_DIST= README FAQ INDEX ChangeLog algorithm.txt zlib.3 cmakelists.txt